storegen

package
v0.7.16-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbuseReport

type AbuseReport struct {
	ID         uuid.UUID  `json:"id"`
	AgentID    uuid.UUID  `json:"agent_id"`
	VersionID  *uuid.UUID `json:"version_id"`
	ReporterID *uuid.UUID `json:"reporter_id"`
	Category   string     `json:"category"`
	Detail     string     `json:"detail"`
	State      string     `json:"state"`
	TriagedBy  *uuid.UUID `json:"triaged_by"`
	TriagedAt  *time.Time `json:"triaged_at"`
	Resolution *string    `json:"resolution"`
	CreatedAt  time.Time  `json:"created_at"`
}

type AccountInstall

type AccountInstall struct {
	UserID            uuid.UUID `json:"user_id"`
	AgentID           uuid.UUID `json:"agent_id"`
	VersionID         uuid.UUID `json:"version_id"`
	RefNamespace      string    `json:"ref_namespace"`
	RefName           string    `json:"ref_name"`
	Capabilities      []byte    `json:"capabilities"`
	AcceptedUnsigned  bool      `json:"accepted_unsigned"`
	AcceptedUnscanned bool      `json:"accepted_unscanned"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

type ActivateMembershipParams

type ActivateMembershipParams struct {
	OrgID     uuid.UUID `json:"org_id"`
	UserID    uuid.UUID `json:"user_id"`
	Role      string    `json:"role"`
	ViaScim   bool      `json:"via_scim"`
	ViaDomain bool      `json:"via_domain"`
}

type AddTeamMemberParams

type AddTeamMemberParams struct {
	TeamID uuid.UUID `json:"team_id"`
	UserID uuid.UUID `json:"user_id"`
}

type AdmittedStore

type AdmittedStore struct {
	Ticket   string    `json:"ticket"`
	Kind     string    `json:"kind"`
	StoredAt time.Time `json:"stored_at"`
}

type Advisory

type Advisory struct {
	ID               uuid.UUID  `json:"id"`
	AgentID          uuid.UUID  `json:"agent_id"`
	AffectedVersions string     `json:"affected_versions"`
	Severity         string     `json:"severity"`
	Summary          string     `json:"summary"`
	Detail           *string    `json:"detail"`
	PublishedAt      *time.Time `json:"published_at"`
}

type Agent

type Agent struct {
	ID                       uuid.UUID   `json:"id"`
	NamespaceID              uuid.UUID   `json:"namespace_id"`
	Name                     string      `json:"name"`
	Visibility               string      `json:"visibility"`
	RepoID                   uuid.UUID   `json:"repo_id"`
	Summary                  string      `json:"summary"`
	LatestPublishedVersionID *uuid.UUID  `json:"latest_published_version_id"`
	QuarantineState          string      `json:"quarantine_state"`
	AutoPublishTags          bool        `json:"auto_publish_tags"`
	SearchTsv                interface{} `json:"search_tsv"`
	CreatedAt                time.Time   `json:"created_at"`
	UpdatedAt                time.Time   `json:"updated_at"`
	ReadmeText               string      `json:"readme_text"`
	AllowForcePush           bool        `json:"allow_force_push"`
	Modes                    []string    `json:"modes"`
	PipelineSkip             bool        `json:"pipeline_skip"`
	Builtin                  bool        `json:"builtin"`
	RetiredAt                *time.Time  `json:"retired_at"`
	RetiredVisibility        *string     `json:"retired_visibility"`
	DeletedAt                *time.Time  `json:"deleted_at"`
	ForkedFromAgentID        *uuid.UUID  `json:"forked_from_agent_id"`
	ForkedFromVersionID      *uuid.UUID  `json:"forked_from_version_id"`
	ForkedBy                 *uuid.UUID  `json:"forked_by"`
	ForkState                *string     `json:"fork_state"`
	ForkDetail               string      `json:"fork_detail"`
}

type AgentTeamGrant

type AgentTeamGrant struct {
	AgentID   uuid.UUID `json:"agent_id"`
	TeamID    uuid.UUID `json:"team_id"`
	Role      string    `json:"role"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AgentUserGrant

type AgentUserGrant struct {
	AgentID   uuid.UUID `json:"agent_id"`
	UserID    uuid.UUID `json:"user_id"`
	Role      string    `json:"role"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AgentVersion

type AgentVersion struct {
	ID                uuid.UUID  `json:"id"`
	AgentID           uuid.UUID  `json:"agent_id"`
	Version           string     `json:"version"`
	CommitSha         string     `json:"commit_sha"`
	Manifest          []byte     `json:"manifest"`
	Capabilities      []byte     `json:"capabilities"`
	ArchiveDigest     *string    `json:"archive_digest"`
	ArchiveKey        *string    `json:"archive_key"`
	ArchiveSize       *int64     `json:"archive_size"`
	Status            string     `json:"status"`
	StatusReason      *string    `json:"status_reason"`
	PublishedAt       *time.Time `json:"published_at"`
	YankedAt          *time.Time `json:"yanked_at"`
	YankReason        *string    `json:"yank_reason"`
	Channel           string     `json:"channel"`
	SubmittedBy       uuid.UUID  `json:"submitted_by"`
	Source            string     `json:"source"`
	CreatedAt         time.Time  `json:"created_at"`
	UpdatedAt         time.Time  `json:"updated_at"`
	SubmitterIpHash   *string    `json:"submitter_ip_hash"`
	ScanStatus        string     `json:"scan_status"`
	DraftRun          *uuid.UUID `json:"draft_run"`
	DraftBaseline     *string    `json:"draft_baseline"`
	KnowledgeShipping []byte     `json:"knowledge_shipping"`
}

type AgentVersionMcpServer

type AgentVersionMcpServer struct {
	VersionID uuid.UUID `json:"version_id"`
	Ecosystem string    `json:"ecosystem"`
	Package   string    `json:"package"`
	Version   string    `json:"version"`
}

type AppendAttestationSignatureParams

type AppendAttestationSignatureParams struct {
	Signature []byte    `json:"signature"`
	ID        uuid.UUID `json:"id"`
	KeyMatch  []byte    `json:"key_match"`
}

type Attestation

type Attestation struct {
	ID            uuid.UUID `json:"id"`
	VersionID     uuid.UUID `json:"version_id"`
	PredicateType string    `json:"predicate_type"`
	DsseEnvelope  []byte    `json:"dsse_envelope"`
	KeyID         string    `json:"key_id"`
	CreatedAt     time.Time `json:"created_at"`
}

type AuditEvent

type AuditEvent struct {
	ID         uuid.UUID   `json:"id"`
	OccurredAt time.Time   `json:"occurred_at"`
	ActorID    *uuid.UUID  `json:"actor_id"`
	ActorKind  string      `json:"actor_kind"`
	OrgID      *uuid.UUID  `json:"org_id"`
	Action     string      `json:"action"`
	TargetKind *string     `json:"target_kind"`
	TargetID   *uuid.UUID  `json:"target_id"`
	Ip         *netip.Addr `json:"ip"`
	UserAgent  *string     `json:"user_agent"`
	Detail     []byte      `json:"detail"`
}

type AuditEventsDefault

type AuditEventsDefault struct {
	ID         uuid.UUID   `json:"id"`
	OccurredAt time.Time   `json:"occurred_at"`
	ActorID    *uuid.UUID  `json:"actor_id"`
	ActorKind  string      `json:"actor_kind"`
	OrgID      *uuid.UUID  `json:"org_id"`
	Action     string      `json:"action"`
	TargetKind *string     `json:"target_kind"`
	TargetID   *uuid.UUID  `json:"target_id"`
	Ip         *netip.Addr `json:"ip"`
	UserAgent  *string     `json:"user_agent"`
	Detail     []byte      `json:"detail"`
}

type AuditExport

type AuditExport struct {
	ID           uuid.UUID  `json:"id"`
	OrgID        uuid.UUID  `json:"org_id"`
	RequestedBy  *uuid.UUID `json:"requested_by"`
	Status       string     `json:"status"`
	ActionFilter *string    `json:"action_filter"`
	ObjectKey    *string    `json:"object_key"`
	EventCount   int32      `json:"event_count"`
	Error        *string    `json:"error"`
	CreatedAt    time.Time  `json:"created_at"`
	FinishedAt   *time.Time `json:"finished_at"`
}

type BumpDownloadStatParams

type BumpDownloadStatParams struct {
	AgentID   uuid.UUID `json:"agent_id"`
	VersionID uuid.UUID `json:"version_id"`
}

type ClaimIdempotencyKeyParams

type ClaimIdempotencyKeyParams struct {
	Key         string    `json:"key"`
	UserID      uuid.UUID `json:"user_id"`
	Endpoint    string    `json:"endpoint"`
	RequestHash string    `json:"request_hash"`
	ExpiresAt   time.Time `json:"expires_at"`
}

type ClaimIdempotencyKeyRow

type ClaimIdempotencyKeyRow struct {
	Key            string     `json:"key"`
	UserID         uuid.UUID  `json:"user_id"`
	Endpoint       string     `json:"endpoint"`
	RequestHash    string     `json:"request_hash"`
	ResponseStatus *int32     `json:"response_status"`
	ResponseBody   []byte     `json:"response_body"`
	ResourceID     *uuid.UUID `json:"resource_id"`
	CreatedAt      time.Time  `json:"created_at"`
	ExpiresAt      time.Time  `json:"expires_at"`
	Claimed        bool       `json:"claimed"`
}

type ClearOrgReportDesignCoverImageParams added in v0.7.5

type ClearOrgReportDesignCoverImageParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type ClearOrgReportDesignCustomCoverParams added in v0.7.5

type ClearOrgReportDesignCustomCoverParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type ClearOrgReportDesignLogoParams added in v0.7.5

type ClearOrgReportDesignLogoParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type ClearUserReportDesignCoverImageParams added in v0.7.4

type ClearUserReportDesignCoverImageParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type ClearUserReportDesignCustomCoverParams added in v0.7.4

type ClearUserReportDesignCustomCoverParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type ClearUserReportDesignLogoParams added in v0.7.4

type ClearUserReportDesignLogoParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type CompleteAuditExportParams

type CompleteAuditExportParams struct {
	ID         uuid.UUID `json:"id"`
	ObjectKey  *string   `json:"object_key"`
	EventCount int32     `json:"event_count"`
}

type CompleteIdempotencyKeyParams

type CompleteIdempotencyKeyParams struct {
	UserID         uuid.UUID  `json:"user_id"`
	Endpoint       string     `json:"endpoint"`
	Key            string     `json:"key"`
	ResponseStatus *int32     `json:"response_status"`
	ResponseBody   []byte     `json:"response_body"`
	ResourceID     *uuid.UUID `json:"resource_id"`
}

type ConsumeDesktopGrantParams

type ConsumeDesktopGrantParams struct {
	CodeSha256  []byte `json:"code_sha256"`
	StateSha256 []byte `json:"state_sha256"`
}

type ConsumeSAMLAssertionParams

type ConsumeSAMLAssertionParams struct {
	ID           string    `json:"id"`
	ExpiresAt    time.Time `json:"expires_at"`
	FloorSeconds float64   `json:"floor_seconds"`
}

type CountActiveMembershipsElsewhereParams

type CountActiveMembershipsElsewhereParams struct {
	UserID uuid.UUID `json:"user_id"`
	OrgID  uuid.UUID `json:"org_id"`
}

type CountAgentDeleteBlockersRow

type CountAgentDeleteBlockersRow struct {
	Versions         int64 `json:"versions"`
	VersionsInFlight int64 `json:"versions_in_flight"`
	Advisories       int64 `json:"advisories"`
	AbuseReports     int64 `json:"abuse_reports"`
}

type CountAuditActionsByActorSinceParams

type CountAuditActionsByActorSinceParams struct {
	ActorID    *uuid.UUID `json:"actor_id"`
	Action     string     `json:"action"`
	OccurredAt time.Time  `json:"occurred_at"`
}

type CountAuditEventsParams

type CountAuditEventsParams struct {
	Action string     `json:"action"`
	OrgID  *uuid.UUID `json:"org_id"`
}

type CountEmailVerificationsSinceParams

type CountEmailVerificationsSinceParams struct {
	UserID    uuid.UUID `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
}

type CountEmailVerificationsSinceRow

type CountEmailVerificationsSinceRow struct {
	Sent   int64     `json:"sent"`
	Oldest time.Time `json:"oldest"`
}

type CountFindingsBySeverityRow

type CountFindingsBySeverityRow struct {
	Severity string `json:"severity"`
	Count    int64  `json:"count"`
}

type CountIPClusterSubmissionsRow

type CountIPClusterSubmissionsRow struct {
	Accounts int64 `json:"accounts"`
	Versions int64 `json:"versions"`
}

type CountOrgSeatsRow

type CountOrgSeatsRow struct {
	Used    int64 `json:"used"`
	Invited int64 `json:"invited"`
	Pending int64 `json:"pending"`
}

type CountSearchAgentsParams

type CountSearchAgentsParams struct {
	Query        string  `json:"query"`
	Mode         *string `json:"mode"`
	Capability   *string `json:"capability"`
	License      *string `json:"license"`
	VerifiedOnly bool    `json:"verified_only"`
}

type CreateAbuseReportParams

type CreateAbuseReportParams struct {
	ID         uuid.UUID  `json:"id"`
	AgentID    uuid.UUID  `json:"agent_id"`
	VersionID  *uuid.UUID `json:"version_id"`
	ReporterID *uuid.UUID `json:"reporter_id"`
	Category   string     `json:"category"`
	Detail     string     `json:"detail"`
}

type CreateAdvisoryParams

type CreateAdvisoryParams struct {
	ID               uuid.UUID `json:"id"`
	AgentID          uuid.UUID `json:"agent_id"`
	AffectedVersions string    `json:"affected_versions"`
	Severity         string    `json:"severity"`
	Summary          string    `json:"summary"`
	Detail           *string   `json:"detail"`
}

type CreateAgentParams

type CreateAgentParams struct {
	ID          uuid.UUID `json:"id"`
	NamespaceID uuid.UUID `json:"namespace_id"`
	Name        string    `json:"name"`
	Visibility  string    `json:"visibility"`
	RepoID      uuid.UUID `json:"repo_id"`
	Summary     string    `json:"summary"`
	Modes       []string  `json:"modes"`
}

type CreateAgentVersionParams

type CreateAgentVersionParams struct {
	ID                uuid.UUID  `json:"id"`
	AgentID           uuid.UUID  `json:"agent_id"`
	Version           string     `json:"version"`
	CommitSha         string     `json:"commit_sha"`
	Manifest          []byte     `json:"manifest"`
	Capabilities      []byte     `json:"capabilities"`
	Channel           string     `json:"channel"`
	SubmittedBy       uuid.UUID  `json:"submitted_by"`
	Source            string     `json:"source"`
	SubmitterIpHash   *string    `json:"submitter_ip_hash"`
	DraftRun          *uuid.UUID `json:"draft_run"`
	KnowledgeShipping []byte     `json:"knowledge_shipping"`
}

type CreateAttestationParams

type CreateAttestationParams struct {
	ID            uuid.UUID `json:"id"`
	VersionID     uuid.UUID `json:"version_id"`
	PredicateType string    `json:"predicate_type"`
	DsseEnvelope  []byte    `json:"dsse_envelope"`
	KeyID         string    `json:"key_id"`
}

type CreateAuditExportParams

type CreateAuditExportParams struct {
	ID           uuid.UUID  `json:"id"`
	OrgID        uuid.UUID  `json:"org_id"`
	RequestedBy  *uuid.UUID `json:"requested_by"`
	ActionFilter *string    `json:"action_filter"`
}

type CreateDesktopGrantParams

type CreateDesktopGrantParams struct {
	ID          uuid.UUID `json:"id"`
	UserID      uuid.UUID `json:"user_id"`
	CodeSha256  []byte    `json:"code_sha256"`
	StateSha256 []byte    `json:"state_sha256"`
	Scopes      []string  `json:"scopes"`
	Name        string    `json:"name"`
	ExpiresAt   time.Time `json:"expires_at"`
}

type CreateDomainClaimParams

type CreateDomainClaimParams struct {
	ID                uuid.UUID `json:"id"`
	OrgID             uuid.UUID `json:"org_id"`
	Domain            string    `json:"domain"`
	VerificationToken string    `json:"verification_token"`
}

type CreateEmailVerificationParams

type CreateEmailVerificationParams struct {
	TokenSha256 []byte    `json:"token_sha256"`
	UserID      uuid.UUID `json:"user_id"`
	ExpiresAt   time.Time `json:"expires_at"`
}

type CreateForkAgentParams

type CreateForkAgentParams struct {
	ID                  uuid.UUID  `json:"id"`
	NamespaceID         uuid.UUID  `json:"namespace_id"`
	Name                string     `json:"name"`
	RepoID              uuid.UUID  `json:"repo_id"`
	Summary             string     `json:"summary"`
	Modes               []string   `json:"modes"`
	ForkedFromAgentID   *uuid.UUID `json:"forked_from_agent_id"`
	ForkedFromVersionID *uuid.UUID `json:"forked_from_version_id"`
	ForkedBy            *uuid.UUID `json:"forked_by"`
}

type CreateFounderMembershipParams

type CreateFounderMembershipParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
	Role   string    `json:"role"`
}

type CreateHandleParams

type CreateHandleParams struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
	Kind   string    `json:"kind"`
}

type CreateIdentityParams

type CreateIdentityParams struct {
	ID              uuid.UUID  `json:"id"`
	UserID          uuid.UUID  `json:"user_id"`
	ProviderKind    string     `json:"provider_kind"`
	SsoConnectionID *uuid.UUID `json:"sso_connection_id"`
	Subject         string     `json:"subject"`
}

type CreateInvitationParams

type CreateInvitationParams struct {
	ID          uuid.UUID  `json:"id"`
	OrgID       uuid.UUID  `json:"org_id"`
	Email       string     `json:"email"`
	Role        string     `json:"role"`
	TokenSha256 []byte     `json:"token_sha256"`
	InvitedBy   *uuid.UUID `json:"invited_by"`
	ExpiresAt   time.Time  `json:"expires_at"`
}

type CreateKnowledgeObjectParams

type CreateKnowledgeObjectParams struct {
	Key       string    `json:"key"`
	PackID    uuid.UUID `json:"pack_id"`
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
	Bytes     int64     `json:"bytes"`
}

type CreateKnowledgeOwnerSaltParams

type CreateKnowledgeOwnerSaltParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
	Salt      []byte    `json:"salt"`
}

type CreateKnowledgePackParams

type CreateKnowledgePackParams struct {
	OwnerKind        string    `json:"owner_kind"`
	OwnerID          uuid.UUID `json:"owner_id"`
	Name             string    `json:"name"`
	WrapperKind      string    `json:"wrapper_kind"`
	WrapperRecipient string    `json:"wrapper_recipient"`
	WrappedKey       []byte    `json:"wrapped_key"`
}

type CreateOrgParams

type CreateOrgParams struct {
	ID          uuid.UUID  `json:"id"`
	DisplayName string     `json:"display_name"`
	CreatedBy   *uuid.UUID `json:"created_by"`
	Activated   bool       `json:"activated"`
	Domain      *string    `json:"domain"`
}

type CreateOrgReportDesignParams added in v0.7.5

type CreateOrgReportDesignParams struct {
	OrgID            uuid.UUID `json:"org_id"`
	Document         []byte    `json:"document"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
	CustomCover      []byte    `json:"custom_cover"`
}

type CreatePATParams

type CreatePATParams struct {
	ID          uuid.UUID  `json:"id"`
	UserID      uuid.UUID  `json:"user_id"`
	Name        string     `json:"name"`
	TokenSha256 []byte     `json:"token_sha256"`
	TokenPrefix string     `json:"token_prefix"`
	Scopes      []string   `json:"scopes"`
	OrgID       *uuid.UUID `json:"org_id"`
	ExpiresAt   time.Time  `json:"expires_at"`
}

type CreateRepoWithBranchParams

type CreateRepoWithBranchParams struct {
	ID            uuid.UUID `json:"id"`
	DefaultBranch string    `json:"default_branch"`
}

type CreateReviewItemParams

type CreateReviewItemParams struct {
	ID        uuid.UUID  `json:"id"`
	VersionID uuid.UUID  `json:"version_id"`
	Queue     string     `json:"queue"`
	OrgID     *uuid.UUID `json:"org_id"`
}

type CreateRulesetReleaseParams

type CreateRulesetReleaseParams struct {
	ID           uuid.UUID `json:"id"`
	Semver       string    `json:"semver"`
	BundleDigest string    `json:"bundle_digest"`
	Notes        *string   `json:"notes"`
}

type CreateRulesetReleaseRow

type CreateRulesetReleaseRow struct {
	ID           uuid.UUID `json:"id"`
	Semver       string    `json:"semver"`
	BundleDigest string    `json:"bundle_digest"`
	Notes        *string   `json:"notes"`
	PublishedAt  time.Time `json:"published_at"`
	Inserted     bool      `json:"inserted"`
}

type CreateSSHKeyParams

type CreateSSHKeyParams struct {
	ID          uuid.UUID `json:"id"`
	UserID      uuid.UUID `json:"user_id"`
	Title       string    `json:"title"`
	KeyType     string    `json:"key_type"`
	PublicKey   string    `json:"public_key"`
	Fingerprint string    `json:"fingerprint"`
}

type CreateScanRunParams

type CreateScanRunParams struct {
	ID               uuid.UUID `json:"id"`
	VersionID        uuid.UUID `json:"version_id"`
	Trigger          string    `json:"trigger"`
	RulesetReleaseID uuid.UUID `json:"ruleset_release_id"`
	PolicySnapshot   []byte    `json:"policy_snapshot"`
	JudgeModel       *string   `json:"judge_model"`
	JudgePromptHash  *string   `json:"judge_prompt_hash"`
}

type CreateSessionParams

type CreateSessionParams struct {
	ID          uuid.UUID   `json:"id"`
	TokenSha256 []byte      `json:"token_sha256"`
	UserID      uuid.UUID   `json:"user_id"`
	CsrfToken   string      `json:"csrf_token"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	ExpiresAt   time.Time   `json:"expires_at"`
}

type CreateTeamParams

type CreateTeamParams struct {
	ID    uuid.UUID `json:"id"`
	OrgID uuid.UUID `json:"org_id"`
	Slug  string    `json:"slug"`
}

type CreateTrustedDeviceParams

type CreateTrustedDeviceParams struct {
	ID          uuid.UUID   `json:"id"`
	UserID      uuid.UUID   `json:"user_id"`
	TokenSha256 []byte      `json:"token_sha256"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	ExpiresAt   time.Time   `json:"expires_at"`
}

type CreateTrustedDeviceRow

type CreateTrustedDeviceRow struct {
	ID         uuid.UUID `json:"id"`
	UserID     uuid.UUID `json:"user_id"`
	CreatedAt  time.Time `json:"created_at"`
	LastSeenAt time.Time `json:"last_seen_at"`
	ExpiresAt  time.Time `json:"expires_at"`
}

type CreateUserParams

type CreateUserParams struct {
	ID          uuid.UUID `json:"id"`
	Email       string    `json:"email"`
	DisplayName string    `json:"display_name"`
}

type CreateUserReportDesignParams added in v0.7.4

type CreateUserReportDesignParams struct {
	UserID           uuid.UUID `json:"user_id"`
	Document         []byte    `json:"document"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
	CustomCover      []byte    `json:"custom_cover"`
	IsDefault        bool      `json:"is_default"`
}

type CreateVoiceParams

type CreateVoiceParams struct {
	UserID           uuid.UUID `json:"user_id"`
	WrapperKind      string    `json:"wrapper_kind"`
	WrapperRecipient string    `json:"wrapper_recipient"`
	WrappedKey       []byte    `json:"wrapped_key"`
}

type CreateWebhookDeliveryParams

type CreateWebhookDeliveryParams struct {
	ID         uuid.UUID `json:"id"`
	EndpointID uuid.UUID `json:"endpoint_id"`
	EventType  string    `json:"event_type"`
	Payload    []byte    `json:"payload"`
}

type CreateWebhookEndpointParams

type CreateWebhookEndpointParams struct {
	ID        uuid.UUID `json:"id"`
	OrgID     uuid.UUID `json:"org_id"`
	Url       string    `json:"url"`
	SecretEnc []byte    `json:"secret_enc"`
	Events    []string  `json:"events"`
	Active    bool      `json:"active"`
}

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 DecideReviewItemParams

type DecideReviewItemParams struct {
	ID        uuid.UUID  `json:"id"`
	State     string     `json:"state"`
	DecidedBy *uuid.UUID `json:"decided_by"`
	Rationale *string    `json:"rationale"`
}

type DecommissionOrgParams

type DecommissionOrgParams struct {
	ID                 uuid.UUID  `json:"id"`
	DecommissionAt     *time.Time `json:"decommission_at"`
	DecommissionReason *string    `json:"decommission_reason"`
}

type DeleteAccountInstallByRefParams

type DeleteAccountInstallByRefParams struct {
	UserID       uuid.UUID `json:"user_id"`
	RefNamespace string    `json:"ref_namespace"`
	RefName      string    `json:"ref_name"`
}

type DeleteAccountInstallParams

type DeleteAccountInstallParams struct {
	UserID  uuid.UUID `json:"user_id"`
	AgentID uuid.UUID `json:"agent_id"`
}

type DeleteAgentTeamGrantParams

type DeleteAgentTeamGrantParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	TeamID  uuid.UUID `json:"team_id"`
}

type DeleteAgentUserGrantParams

type DeleteAgentUserGrantParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	UserID  uuid.UUID `json:"user_id"`
}

type DeleteFindingsForScannerParams

type DeleteFindingsForScannerParams struct {
	ScanRunID uuid.UUID `json:"scan_run_id"`
	Scanner   string    `json:"scanner"`
}

type DeleteFoldInDeclineParams

type DeleteFoldInDeclineParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
}

type DeleteInvitationParams

type DeleteInvitationParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type DeleteKnowledgeObjectsOfOwnerParams

type DeleteKnowledgeObjectsOfOwnerParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type DeleteKnowledgeOwnerSaltParams

type DeleteKnowledgeOwnerSaltParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type DeleteKnowledgePackParams

type DeleteKnowledgePackParams struct {
	ID        uuid.UUID `json:"id"`
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type DeleteKnowledgePacksOfOwnerParams

type DeleteKnowledgePacksOfOwnerParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type DeleteMembershipParams

type DeleteMembershipParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
}

type DeleteOrgReportDesignParams added in v0.7.5

type DeleteOrgReportDesignParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type DeleteTeamParams

type DeleteTeamParams struct {
	OrgID uuid.UUID `json:"org_id"`
	Slug  string    `json:"slug"`
}

type DeleteUnacceptedInvitationsForParams

type DeleteUnacceptedInvitationsForParams struct {
	OrgID uuid.UUID `json:"org_id"`
	Email string    `json:"email"`
}

type DeleteUserReportDesignParams added in v0.7.4

type DeleteUserReportDesignParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type DeleteVoiceVersionInSlotParams

type DeleteVoiceVersionInSlotParams struct {
	UserID uuid.UUID `json:"user_id"`
	Slot   string    `json:"slot"`
}

type DeleteWebhookEndpointParams

type DeleteWebhookEndpointParams struct {
	ID    uuid.UUID `json:"id"`
	OrgID uuid.UUID `json:"org_id"`
}

type DesktopGrant

type DesktopGrant struct {
	ID          uuid.UUID  `json:"id"`
	UserID      uuid.UUID  `json:"user_id"`
	CodeSha256  []byte     `json:"code_sha256"`
	StateSha256 []byte     `json:"state_sha256"`
	Scopes      []string   `json:"scopes"`
	Name        string     `json:"name"`
	ExpiresAt   time.Time  `json:"expires_at"`
	ConsumedAt  *time.Time `json:"consumed_at"`
	CreatedAt   time.Time  `json:"created_at"`
}

type DomainClaim

type DomainClaim struct {
	ID                uuid.UUID  `json:"id"`
	OrgID             uuid.UUID  `json:"org_id"`
	Domain            string     `json:"domain"`
	VerificationToken string     `json:"verification_token"`
	VerifiedAt        *time.Time `json:"verified_at"`
	CreatedAt         time.Time  `json:"created_at"`
}

type DownloadStat

type DownloadStat struct {
	AgentID   uuid.UUID   `json:"agent_id"`
	VersionID uuid.UUID   `json:"version_id"`
	Day       pgtype.Date `json:"day"`
	Installs  int32       `json:"installs"`
}

type EmailVerification

type EmailVerification struct {
	TokenSha256 []byte     `json:"token_sha256"`
	UserID      uuid.UUID  `json:"user_id"`
	ExpiresAt   time.Time  `json:"expires_at"`
	ConsumedAt  *time.Time `json:"consumed_at"`
	CreatedAt   time.Time  `json:"created_at"`
}

type FailAuditExportParams

type FailAuditExportParams struct {
	ID    uuid.UUID `json:"id"`
	Error *string   `json:"error"`
}

type Finding

type Finding struct {
	ID            uuid.UUID  `json:"id"`
	ScanRunID     uuid.UUID  `json:"scan_run_id"`
	Scanner       string     `json:"scanner"`
	Severity      string     `json:"severity"`
	Confidence    string     `json:"confidence"`
	Title         string     `json:"title"`
	FilePath      *string    `json:"file_path"`
	LineStart     *int32     `json:"line_start"`
	LineEnd       *int32     `json:"line_end"`
	Excerpt       *string    `json:"excerpt"`
	Detail        []byte     `json:"detail"`
	Verdict       string     `json:"verdict"`
	VerdictBy     *uuid.UUID `json:"verdict_by"`
	VerdictReason *string    `json:"verdict_reason"`
	VerdictAt     *time.Time `json:"verdict_at"`
	CreatedAt     time.Time  `json:"created_at"`
}

type FinishKnowledgeScanParams

type FinishKnowledgeScanParams struct {
	State     string    `json:"state"`
	Report    []byte    `json:"report"`
	ID        uuid.UUID `json:"id"`
	ObjectKey string    `json:"object_key"`
}

type FinishScanRunParams

type FinishScanRunParams struct {
	ID                    uuid.UUID `json:"id"`
	Status                string    `json:"status"`
	ReportDigest          *string   `json:"report_digest"`
	JudgeModel            *string   `json:"judge_model"`
	JudgePromptHash       *string   `json:"judge_prompt_hash"`
	JudgePromptTokens     *int32    `json:"judge_prompt_tokens"`
	JudgeCompletionTokens *int32    `json:"judge_completion_tokens"`
}

type FlagVoiceVersionParams

type FlagVoiceVersionParams struct {
	ID          uuid.UUID `json:"id"`
	Review      []byte    `json:"review"`
	QuestionSet string    `json:"question_set"`
}

type FoldInDecline

type FoldInDecline struct {
	OrgID      uuid.UUID  `json:"org_id"`
	UserID     uuid.UUID  `json:"user_id"`
	DeclinedBy *uuid.UUID `json:"declined_by"`
	DeclinedAt time.Time  `json:"declined_at"`
}

type GetAccountInstallParams

type GetAccountInstallParams struct {
	UserID  uuid.UUID `json:"user_id"`
	AgentID uuid.UUID `json:"agent_id"`
}

type GetAdvisoryPublicRow

type GetAdvisoryPublicRow struct {
	ID               uuid.UUID  `json:"id"`
	AgentID          uuid.UUID  `json:"agent_id"`
	AffectedVersions string     `json:"affected_versions"`
	Severity         string     `json:"severity"`
	Summary          string     `json:"summary"`
	Detail           *string    `json:"detail"`
	PublishedAt      *time.Time `json:"published_at"`
	Namespace        string     `json:"namespace"`
	AgentName        string     `json:"agent_name"`
}

type GetAgentByIDRow

type GetAgentByIDRow struct {
	ID                       uuid.UUID   `json:"id"`
	NamespaceID              uuid.UUID   `json:"namespace_id"`
	Name                     string      `json:"name"`
	Visibility               string      `json:"visibility"`
	RepoID                   uuid.UUID   `json:"repo_id"`
	Summary                  string      `json:"summary"`
	LatestPublishedVersionID *uuid.UUID  `json:"latest_published_version_id"`
	QuarantineState          string      `json:"quarantine_state"`
	AutoPublishTags          bool        `json:"auto_publish_tags"`
	SearchTsv                interface{} `json:"search_tsv"`
	CreatedAt                time.Time   `json:"created_at"`
	UpdatedAt                time.Time   `json:"updated_at"`
	ReadmeText               string      `json:"readme_text"`
	AllowForcePush           bool        `json:"allow_force_push"`
	Modes                    []string    `json:"modes"`
	PipelineSkip             bool        `json:"pipeline_skip"`
	Builtin                  bool        `json:"builtin"`
	RetiredAt                *time.Time  `json:"retired_at"`
	RetiredVisibility        *string     `json:"retired_visibility"`
	DeletedAt                *time.Time  `json:"deleted_at"`
	ForkedFromAgentID        *uuid.UUID  `json:"forked_from_agent_id"`
	ForkedFromVersionID      *uuid.UUID  `json:"forked_from_version_id"`
	ForkedBy                 *uuid.UUID  `json:"forked_by"`
	ForkState                *string     `json:"fork_state"`
	ForkDetail               string      `json:"fork_detail"`
	Namespace                string      `json:"namespace"`
	NamespaceKind            string      `json:"namespace_kind"`
}

type GetAgentByPathParams

type GetAgentByPathParams struct {
	Handle         string `json:"handle"`
	Name           string `json:"name"`
	IncludeDeleted bool   `json:"include_deleted"`
}

type GetAgentByPathRow

type GetAgentByPathRow struct {
	ID                       uuid.UUID   `json:"id"`
	NamespaceID              uuid.UUID   `json:"namespace_id"`
	Name                     string      `json:"name"`
	Visibility               string      `json:"visibility"`
	RepoID                   uuid.UUID   `json:"repo_id"`
	Summary                  string      `json:"summary"`
	LatestPublishedVersionID *uuid.UUID  `json:"latest_published_version_id"`
	QuarantineState          string      `json:"quarantine_state"`
	AutoPublishTags          bool        `json:"auto_publish_tags"`
	SearchTsv                interface{} `json:"search_tsv"`
	CreatedAt                time.Time   `json:"created_at"`
	UpdatedAt                time.Time   `json:"updated_at"`
	ReadmeText               string      `json:"readme_text"`
	AllowForcePush           bool        `json:"allow_force_push"`
	Modes                    []string    `json:"modes"`
	PipelineSkip             bool        `json:"pipeline_skip"`
	Builtin                  bool        `json:"builtin"`
	RetiredAt                *time.Time  `json:"retired_at"`
	RetiredVisibility        *string     `json:"retired_visibility"`
	DeletedAt                *time.Time  `json:"deleted_at"`
	ForkedFromAgentID        *uuid.UUID  `json:"forked_from_agent_id"`
	ForkedFromVersionID      *uuid.UUID  `json:"forked_from_version_id"`
	ForkedBy                 *uuid.UUID  `json:"forked_by"`
	ForkState                *string     `json:"fork_state"`
	ForkDetail               string      `json:"fork_detail"`
	Namespace                string      `json:"namespace"`
	NamespaceKind            string      `json:"namespace_kind"`
	DefaultBranch            string      `json:"default_branch"`
	SizeBytes                int64       `json:"size_bytes"`
	OriginNamespaceID        *uuid.UUID  `json:"origin_namespace_id"`
	OriginNamespaceKind      *string     `json:"origin_namespace_kind"`
}

type GetAgentForUpdateRow

type GetAgentForUpdateRow struct {
	ID                       uuid.UUID   `json:"id"`
	NamespaceID              uuid.UUID   `json:"namespace_id"`
	Name                     string      `json:"name"`
	Visibility               string      `json:"visibility"`
	RepoID                   uuid.UUID   `json:"repo_id"`
	Summary                  string      `json:"summary"`
	LatestPublishedVersionID *uuid.UUID  `json:"latest_published_version_id"`
	QuarantineState          string      `json:"quarantine_state"`
	AutoPublishTags          bool        `json:"auto_publish_tags"`
	SearchTsv                interface{} `json:"search_tsv"`
	CreatedAt                time.Time   `json:"created_at"`
	UpdatedAt                time.Time   `json:"updated_at"`
	ReadmeText               string      `json:"readme_text"`
	AllowForcePush           bool        `json:"allow_force_push"`
	Modes                    []string    `json:"modes"`
	PipelineSkip             bool        `json:"pipeline_skip"`
	Builtin                  bool        `json:"builtin"`
	RetiredAt                *time.Time  `json:"retired_at"`
	RetiredVisibility        *string     `json:"retired_visibility"`
	DeletedAt                *time.Time  `json:"deleted_at"`
	ForkedFromAgentID        *uuid.UUID  `json:"forked_from_agent_id"`
	ForkedFromVersionID      *uuid.UUID  `json:"forked_from_version_id"`
	ForkedBy                 *uuid.UUID  `json:"forked_by"`
	ForkState                *string     `json:"fork_state"`
	ForkDetail               string      `json:"fork_detail"`
	Namespace                string      `json:"namespace"`
	NamespaceKind            string      `json:"namespace_kind"`
}

type GetAgentInstallCountsRow

type GetAgentInstallCountsRow struct {
	InstallsTotal int64 `json:"installs_total"`
	Installs30d   int64 `json:"installs_30d"`
}

type GetAgentUserGrantParams

type GetAgentUserGrantParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	UserID  uuid.UUID `json:"user_id"`
}

type GetAuditExportParams

type GetAuditExportParams struct {
	ID    uuid.UUID `json:"id"`
	OrgID uuid.UUID `json:"org_id"`
}

type GetDomainClaimParams

type GetDomainClaimParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	Domain string    `json:"domain"`
}

type GetFoldInDeclineParams

type GetFoldInDeclineParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
}

type GetForkOriginRow

type GetForkOriginRow struct {
	OriginNamespace string `json:"origin_namespace"`
	OriginName      string `json:"origin_name"`
	OriginVersion   string `json:"origin_version"`
	OriginPublic    bool   `json:"origin_public"`
}

type GetInvitationByTokenRow

type GetInvitationByTokenRow struct {
	ID               uuid.UUID  `json:"id"`
	OrgID            uuid.UUID  `json:"org_id"`
	Email            string     `json:"email"`
	Role             string     `json:"role"`
	TokenSha256      []byte     `json:"token_sha256"`
	InvitedBy        *uuid.UUID `json:"invited_by"`
	CreatedAt        time.Time  `json:"created_at"`
	ExpiresAt        time.Time  `json:"expires_at"`
	AcceptedAt       *time.Time `json:"accepted_at"`
	AcceptedBy       *uuid.UUID `json:"accepted_by"`
	OrgHandle        string     `json:"org_handle"`
	OrgDisplayName   string     `json:"org_display_name"`
	AtVerifiedDomain bool       `json:"at_verified_domain"`
}

type GetKnowledgeOwnerSaltParams

type GetKnowledgeOwnerSaltParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type GetKnowledgePackByObjectParams

type GetKnowledgePackByObjectParams struct {
	ID        uuid.UUID `json:"id"`
	ObjectKey string    `json:"object_key"`
}

type GetKnowledgePackForUpdateParams

type GetKnowledgePackForUpdateParams struct {
	ID        uuid.UUID `json:"id"`
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type GetKnowledgePackParams

type GetKnowledgePackParams struct {
	ID        uuid.UUID `json:"id"`
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type GetMCPServerScanParams

type GetMCPServerScanParams struct {
	Ecosystem string `json:"ecosystem"`
	Package   string `json:"package"`
	Version   string `json:"version"`
}

type GetMembershipParams

type GetMembershipParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
}

type GetOrgByDomainRow

type GetOrgByDomainRow struct {
	ID                 uuid.UUID  `json:"id"`
	DisplayName        string     `json:"display_name"`
	SsoRequired        bool       `json:"sso_required"`
	State              string     `json:"state"`
	CreatedAt          time.Time  `json:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at"`
	CreatedBy          *uuid.UUID `json:"created_by"`
	ActivatedAt        *time.Time `json:"activated_at"`
	Domain             *string    `json:"domain"`
	DecommissionAt     *time.Time `json:"decommission_at"`
	DecommissionReason *string    `json:"decommission_reason"`
	LogoObjectKey      *string    `json:"logo_object_key"`
	Handle             string     `json:"handle"`
}

type GetOrgByHandleRow

type GetOrgByHandleRow struct {
	ID                 uuid.UUID  `json:"id"`
	DisplayName        string     `json:"display_name"`
	SsoRequired        bool       `json:"sso_required"`
	State              string     `json:"state"`
	CreatedAt          time.Time  `json:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at"`
	CreatedBy          *uuid.UUID `json:"created_by"`
	ActivatedAt        *time.Time `json:"activated_at"`
	Domain             *string    `json:"domain"`
	DecommissionAt     *time.Time `json:"decommission_at"`
	DecommissionReason *string    `json:"decommission_reason"`
	LogoObjectKey      *string    `json:"logo_object_key"`
	Handle             string     `json:"handle"`
	VerifiedDomains    []string   `json:"verified_domains"`
}

type GetOrgByIDRow

type GetOrgByIDRow struct {
	ID                 uuid.UUID  `json:"id"`
	DisplayName        string     `json:"display_name"`
	SsoRequired        bool       `json:"sso_required"`
	State              string     `json:"state"`
	CreatedAt          time.Time  `json:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at"`
	CreatedBy          *uuid.UUID `json:"created_by"`
	ActivatedAt        *time.Time `json:"activated_at"`
	Domain             *string    `json:"domain"`
	DecommissionAt     *time.Time `json:"decommission_at"`
	DecommissionReason *string    `json:"decommission_reason"`
	LogoObjectKey      *string    `json:"logo_object_key"`
	Handle             string     `json:"handle"`
	VerifiedDomains    []string   `json:"verified_domains"`
}

type GetOrgReportDesignByNameParams added in v0.7.5

type GetOrgReportDesignByNameParams struct {
	OrgID uuid.UUID `json:"org_id"`
	Name  string    `json:"name"`
}

type GetOrgReportDesignParams added in v0.7.5

type GetOrgReportDesignParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type GetOrgStateRow

type GetOrgStateRow struct {
	State          string     `json:"state"`
	DecommissionAt *time.Time `json:"decommission_at"`
}

type GetPreviousPublishedVersionParams

type GetPreviousPublishedVersionParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	ID      uuid.UUID `json:"id"`
}

type GetReviewItemDetailRow

type GetReviewItemDetailRow struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Queue          string     `json:"queue"`
	OrgID          *uuid.UUID `json:"org_id"`
	State          string     `json:"state"`
	DecidedBy      *uuid.UUID `json:"decided_by"`
	DecidedAt      *time.Time `json:"decided_at"`
	Rationale      *string    `json:"rationale"`
	CreatedAt      time.Time  `json:"created_at"`
	PublishPending bool       `json:"publish_pending"`
	Version        string     `json:"version"`
	VersionStatus  string     `json:"version_status"`
	AgentName      string     `json:"agent_name"`
	Namespace      string     `json:"namespace"`
}

type GetScanResultCacheParams

type GetScanResultCacheParams struct {
	ArchiveDigest    string    `json:"archive_digest"`
	Scanner          string    `json:"scanner"`
	RulesetReleaseID uuid.UUID `json:"ruleset_release_id"`
}

type GetTeamParams

type GetTeamParams struct {
	OrgID uuid.UUID `json:"org_id"`
	Slug  string    `json:"slug"`
}

type GetTrustedDeviceByHashParams

type GetTrustedDeviceByHashParams struct {
	TokenSha256 []byte    `json:"token_sha256"`
	UserID      uuid.UUID `json:"user_id"`
}

type GetTrustedDeviceByHashRow

type GetTrustedDeviceByHashRow struct {
	ID         uuid.UUID `json:"id"`
	UserID     uuid.UUID `json:"user_id"`
	CreatedAt  time.Time `json:"created_at"`
	LastSeenAt time.Time `json:"last_seen_at"`
	ExpiresAt  time.Time `json:"expires_at"`
}

type GetUserByEmailRow

type GetUserByEmailRow struct {
	ID               uuid.UUID  `json:"id"`
	Email            string     `json:"email"`
	EmailVerifiedAt  *time.Time `json:"email_verified_at"`
	DisplayName      string     `json:"display_name"`
	State            string     `json:"state"`
	DeletedTombstone []byte     `json:"deleted_tombstone"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	PlatformStaff    bool       `json:"platform_staff"`
	CookieAckAt      *time.Time `json:"cookie_ack_at"`
	IdpMfaAt         *time.Time `json:"idp_mfa_at"`
	Handle           string     `json:"handle"`
}

type GetUserByHandleRow

type GetUserByHandleRow struct {
	ID               uuid.UUID  `json:"id"`
	Email            string     `json:"email"`
	EmailVerifiedAt  *time.Time `json:"email_verified_at"`
	DisplayName      string     `json:"display_name"`
	State            string     `json:"state"`
	DeletedTombstone []byte     `json:"deleted_tombstone"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	PlatformStaff    bool       `json:"platform_staff"`
	CookieAckAt      *time.Time `json:"cookie_ack_at"`
	IdpMfaAt         *time.Time `json:"idp_mfa_at"`
	Handle           string     `json:"handle"`
}

type GetUserByIDRow

type GetUserByIDRow struct {
	ID               uuid.UUID  `json:"id"`
	Email            string     `json:"email"`
	EmailVerifiedAt  *time.Time `json:"email_verified_at"`
	DisplayName      string     `json:"display_name"`
	State            string     `json:"state"`
	DeletedTombstone []byte     `json:"deleted_tombstone"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	PlatformStaff    bool       `json:"platform_staff"`
	CookieAckAt      *time.Time `json:"cookie_ack_at"`
	IdpMfaAt         *time.Time `json:"idp_mfa_at"`
	Handle           string     `json:"handle"`
}

type GetUserPendingOrgRow

type GetUserPendingOrgRow struct {
	Handle      string `json:"handle"`
	DisplayName string `json:"display_name"`
	ViaScim     bool   `json:"via_scim"`
	ViaDomain   bool   `json:"via_domain"`
}

type GetUserReportDesignParams added in v0.7.4

type GetUserReportDesignParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type GetVersionParams

type GetVersionParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	Version string    `json:"version"`
}

type GetVoiceVersionInSlotParams

type GetVoiceVersionInSlotParams struct {
	UserID uuid.UUID `json:"user_id"`
	Slot   string    `json:"slot"`
}

type GetWebhookDeliveryWithEndpointRow

type GetWebhookDeliveryWithEndpointRow struct {
	ID             uuid.UUID `json:"id"`
	EndpointID     uuid.UUID `json:"endpoint_id"`
	EventType      string    `json:"event_type"`
	Payload        []byte    `json:"payload"`
	Attempt        int32     `json:"attempt"`
	Url            string    `json:"url"`
	SecretEnc      []byte    `json:"secret_enc"`
	EndpointActive bool      `json:"endpoint_active"`
	OrgID          uuid.UUID `json:"org_id"`
}

type GetWebhookEndpointParams

type GetWebhookEndpointParams struct {
	ID    uuid.UUID `json:"id"`
	OrgID uuid.UUID `json:"org_id"`
}

type Handle

type Handle struct {
	ID        uuid.UUID `json:"id"`
	Handle    string    `json:"handle"`
	Kind      string    `json:"kind"`
	Reserved  bool      `json:"reserved"`
	CreatedAt time.Time `json:"created_at"`
}

type HasSigningKeyHandoverParams added in v0.7.10

type HasSigningKeyHandoverParams struct {
	FromKeyID string `json:"from_key_id"`
	ToKeyID   string `json:"to_key_id"`
}

type HoldsReleaseParams

type HoldsReleaseParams struct {
	AgentID uuid.UUID  `json:"agent_id"`
	UserID  *uuid.UUID `json:"user_id"`
	Digest  *string    `json:"digest"`
}

type IdempotencyKey

type IdempotencyKey struct {
	Key            string     `json:"key"`
	UserID         uuid.UUID  `json:"user_id"`
	Endpoint       string     `json:"endpoint"`
	RequestHash    string     `json:"request_hash"`
	ResponseStatus *int32     `json:"response_status"`
	ResponseBody   []byte     `json:"response_body"`
	ResourceID     *uuid.UUID `json:"resource_id"`
	CreatedAt      time.Time  `json:"created_at"`
	ExpiresAt      time.Time  `json:"expires_at"`
}

type Identity

type Identity struct {
	ID                 uuid.UUID  `json:"id"`
	UserID             uuid.UUID  `json:"user_id"`
	ProviderKind       string     `json:"provider_kind"`
	SsoConnectionID    *uuid.UUID `json:"sso_connection_id"`
	Subject            string     `json:"subject"`
	CreatedAt          time.Time  `json:"created_at"`
	DirectoryAccountID *int64     `json:"directory_account_id"`
}

type InsertAuditEventParams

type InsertAuditEventParams struct {
	ID         uuid.UUID   `json:"id"`
	OccurredAt time.Time   `json:"occurred_at"`
	ActorID    *uuid.UUID  `json:"actor_id"`
	ActorKind  string      `json:"actor_kind"`
	OrgID      *uuid.UUID  `json:"org_id"`
	Action     string      `json:"action"`
	TargetKind *string     `json:"target_kind"`
	TargetID   *uuid.UUID  `json:"target_id"`
	Ip         *netip.Addr `json:"ip"`
	UserAgent  *string     `json:"user_agent"`
	Detail     []byte      `json:"detail"`
}

type InsertFindingParams

type InsertFindingParams struct {
	ID         uuid.UUID `json:"id"`
	ScanRunID  uuid.UUID `json:"scan_run_id"`
	Scanner    string    `json:"scanner"`
	Severity   string    `json:"severity"`
	Confidence string    `json:"confidence"`
	Title      string    `json:"title"`
	FilePath   *string   `json:"file_path"`
	LineStart  *int32    `json:"line_start"`
	LineEnd    *int32    `json:"line_end"`
	Excerpt    *string   `json:"excerpt"`
	Detail     []byte    `json:"detail"`
}

type InsertLiveVoiceVersionParams

type InsertLiveVoiceVersionParams struct {
	UserID      uuid.UUID  `json:"user_id"`
	Source      string     `json:"source"`
	Sealed      []byte     `json:"sealed"`
	Digest      string     `json:"digest"`
	Bytes       int32      `json:"bytes"`
	Review      []byte     `json:"review"`
	QuestionSet string     `json:"question_set"`
	ReviewedAt  *time.Time `json:"reviewed_at"`
}

type InsertPendingVoiceVersionParams

type InsertPendingVoiceVersionParams struct {
	UserID uuid.UUID `json:"user_id"`
	Source string    `json:"source"`
	Sealed []byte    `json:"sealed"`
	Digest string    `json:"digest"`
	Bytes  int32     `json:"bytes"`
}

type InsertRedTeamReportParams

type InsertRedTeamReportParams struct {
	ID            uuid.UUID `json:"id"`
	RulesetSemver string    `json:"ruleset_semver"`
	BundleDigest  string    `json:"bundle_digest"`
	Fixtures      int32     `json:"fixtures"`
	Cases         int32     `json:"cases"`
	Evaded        int32     `json:"evaded"`
	Report        []byte    `json:"report"`
}

type InsertRulesetAttestationParams

type InsertRulesetAttestationParams struct {
	BundleDigest string `json:"bundle_digest"`
	KeyID        string `json:"key_id"`
	DsseEnvelope []byte `json:"dsse_envelope"`
}

type InsertSigningKeyHandoverParams added in v0.7.10

type InsertSigningKeyHandoverParams struct {
	FromKeyID    string `json:"from_key_id"`
	ToKeyID      string `json:"to_key_id"`
	DsseEnvelope []byte `json:"dsse_envelope"`
}

type InsertVersionMCPServerParams

type InsertVersionMCPServerParams struct {
	VersionID uuid.UUID `json:"version_id"`
	Ecosystem string    `json:"ecosystem"`
	Package   string    `json:"package"`
	Version   string    `json:"version"`
}

type IsAgentStarredParams

type IsAgentStarredParams struct {
	UserID  uuid.UUID `json:"user_id"`
	AgentID uuid.UUID `json:"agent_id"`
}

type KnowledgeObject

type KnowledgeObject struct {
	Key       string    `json:"key"`
	PackID    uuid.UUID `json:"pack_id"`
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
	Bytes     int64     `json:"bytes"`
	CreatedAt time.Time `json:"created_at"`
}

type KnowledgeOwnerKey

type KnowledgeOwnerKey struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
	Salt      []byte    `json:"salt"`
	CreatedAt time.Time `json:"created_at"`
}

type KnowledgePack

type KnowledgePack struct {
	ID               uuid.UUID  `json:"id"`
	OwnerKind        string     `json:"owner_kind"`
	OwnerID          uuid.UUID  `json:"owner_id"`
	Name             string     `json:"name"`
	State            string     `json:"state"`
	Bytes            int64      `json:"bytes"`
	Files            int32      `json:"files"`
	Pages            int32      `json:"pages"`
	Digest           string     `json:"digest"`
	ObjectKey        string     `json:"object_key"`
	ScanReport       []byte     `json:"scan_report"`
	ScannedAt        *time.Time `json:"scanned_at"`
	WrapperKind      string     `json:"wrapper_kind"`
	WrapperRecipient string     `json:"wrapper_recipient"`
	WrappedKey       []byte     `json:"wrapped_key"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	Exportable       bool       `json:"exportable"`
}

type ListAbuseReportsParams

type ListAbuseReportsParams struct {
	State string `json:"state"`
	Limit int32  `json:"limit"`
}

type ListAbuseReportsRow

type ListAbuseReportsRow struct {
	ID         uuid.UUID  `json:"id"`
	AgentID    uuid.UUID  `json:"agent_id"`
	VersionID  *uuid.UUID `json:"version_id"`
	ReporterID *uuid.UUID `json:"reporter_id"`
	Category   string     `json:"category"`
	Detail     string     `json:"detail"`
	State      string     `json:"state"`
	TriagedBy  *uuid.UUID `json:"triaged_by"`
	TriagedAt  *time.Time `json:"triaged_at"`
	Resolution *string    `json:"resolution"`
	CreatedAt  time.Time  `json:"created_at"`
	AgentName  string     `json:"agent_name"`
	Namespace  string     `json:"namespace"`
	Version    *string    `json:"version"`
}

type ListAccountInstallsRow

type ListAccountInstallsRow struct {
	AccountInstall AccountInstall `json:"account_install"`
	Namespace      string         `json:"namespace"`
	Name           string         `json:"name"`
}

type ListActiveUserSessionsRow

type ListActiveUserSessionsRow struct {
	ID         uuid.UUID   `json:"id"`
	Ip         *netip.Addr `json:"ip"`
	UserAgent  *string     `json:"user_agent"`
	CreatedAt  time.Time   `json:"created_at"`
	LastSeenAt time.Time   `json:"last_seen_at"`
}

type ListActiveWebhookEndpointsForEventParams

type ListActiveWebhookEndpointsForEventParams struct {
	OrgID uuid.UUID `json:"org_id"`
	Event string    `json:"event"`
}

type ListAdvisoriesFeedParams

type ListAdvisoriesFeedParams struct {
	Limit      int32      `json:"limit"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type ListAdvisoriesFeedRow

type ListAdvisoriesFeedRow struct {
	ID               uuid.UUID  `json:"id"`
	AgentID          uuid.UUID  `json:"agent_id"`
	AffectedVersions string     `json:"affected_versions"`
	Severity         string     `json:"severity"`
	Summary          string     `json:"summary"`
	Detail           *string    `json:"detail"`
	PublishedAt      *time.Time `json:"published_at"`
	Namespace        string     `json:"namespace"`
	AgentName        string     `json:"agent_name"`
}

type ListAgentActivityParams

type ListAgentActivityParams struct {
	Limit         int32      `json:"limit"`
	AgentID       *uuid.UUID `json:"agent_id"`
	PublicActions []string   `json:"public_actions"`
	BeforeTime    *time.Time `json:"before_time"`
	BeforeID      *uuid.UUID `json:"before_id"`
}

type ListAgentActivityRow

type ListAgentActivityRow struct {
	ID          uuid.UUID  `json:"id"`
	OccurredAt  time.Time  `json:"occurred_at"`
	Action      string     `json:"action"`
	Detail      []byte     `json:"detail"`
	TargetKind  *string    `json:"target_kind"`
	TargetID    *uuid.UUID `json:"target_id"`
	ActorHandle *string    `json:"actor_handle"`
	Version     *string    `json:"version"`
}

type ListAgentGrantsRow

type ListAgentGrantsRow struct {
	Kind    string `json:"kind"`
	Grantee string `json:"grantee"`
	Role    string `json:"role"`
}

type ListAgentTeamGrantsForUserParams

type ListAgentTeamGrantsForUserParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	UserID  uuid.UUID `json:"user_id"`
}

type ListAgentsByNamespaceParams

type ListAgentsByNamespaceParams struct {
	Handle         string `json:"handle"`
	IncludePrivate bool   `json:"include_private"`
	State          string `json:"state"`
	Forks          string `json:"forks"`
	Query          string `json:"query"`
	Sort           string `json:"sort"`
}

type ListAgentsByNamespaceRow

type ListAgentsByNamespaceRow struct {
	ID                       uuid.UUID   `json:"id"`
	NamespaceID              uuid.UUID   `json:"namespace_id"`
	Name                     string      `json:"name"`
	Visibility               string      `json:"visibility"`
	RepoID                   uuid.UUID   `json:"repo_id"`
	Summary                  string      `json:"summary"`
	LatestPublishedVersionID *uuid.UUID  `json:"latest_published_version_id"`
	QuarantineState          string      `json:"quarantine_state"`
	AutoPublishTags          bool        `json:"auto_publish_tags"`
	SearchTsv                interface{} `json:"search_tsv"`
	CreatedAt                time.Time   `json:"created_at"`
	UpdatedAt                time.Time   `json:"updated_at"`
	ReadmeText               string      `json:"readme_text"`
	AllowForcePush           bool        `json:"allow_force_push"`
	Modes                    []string    `json:"modes"`
	PipelineSkip             bool        `json:"pipeline_skip"`
	Builtin                  bool        `json:"builtin"`
	RetiredAt                *time.Time  `json:"retired_at"`
	RetiredVisibility        *string     `json:"retired_visibility"`
	DeletedAt                *time.Time  `json:"deleted_at"`
	ForkedFromAgentID        *uuid.UUID  `json:"forked_from_agent_id"`
	ForkedFromVersionID      *uuid.UUID  `json:"forked_from_version_id"`
	ForkedBy                 *uuid.UUID  `json:"forked_by"`
	ForkState                *string     `json:"fork_state"`
	ForkDetail               string      `json:"fork_detail"`
	Namespace                string      `json:"namespace"`
	Installs                 int64       `json:"installs"`
	LastSubmittedAt          *time.Time  `json:"last_submitted_at"`
	OriginNamespace          *string     `json:"origin_namespace"`
	OriginName               *string     `json:"origin_name"`
	OriginVersion            *string     `json:"origin_version"`
	OriginPublic             *bool       `json:"origin_public"`
	ForkCount                int64       `json:"fork_count"`
}

type ListAgentsByTagParams

type ListAgentsByTagParams struct {
	Limit      int32      `json:"limit"`
	Tag        string     `json:"tag"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type ListAgentsByTagRow

type ListAgentsByTagRow struct {
	ID              uuid.UUID `json:"id"`
	Name            string    `json:"name"`
	Modes           []string  `json:"modes"`
	Summary         string    `json:"summary"`
	QuarantineState string    `json:"quarantine_state"`
	CreatedAt       time.Time `json:"created_at"`
	Builtin         bool      `json:"builtin"`
	Namespace       string    `json:"namespace"`
	Installs        int64     `json:"installs"`
}

type ListAttestationsLackingSignatureParams

type ListAttestationsLackingSignatureParams struct {
	KeyMatch []byte     `json:"key_match"`
	After    *uuid.UUID `json:"after"`
	Batch    int32      `json:"batch"`
}

type ListAttestationsLackingSignatureRow

type ListAttestationsLackingSignatureRow struct {
	ID            uuid.UUID `json:"id"`
	VersionID     uuid.UUID `json:"version_id"`
	DsseEnvelope  []byte    `json:"dsse_envelope"`
	Version       string    `json:"version"`
	ArchiveDigest *string   `json:"archive_digest"`
}

type ListDecidedFindingsParams

type ListDecidedFindingsParams struct {
	VersionID    uuid.UUID `json:"version_id"`
	ExcludeRunID uuid.UUID `json:"exclude_run_id"`
}

type ListDecidedFindingsRow

type ListDecidedFindingsRow struct {
	Scanner   string `json:"scanner"`
	FilePath  string `json:"file_path"`
	LineStart int32  `json:"line_start"`
}

type ListDecommissionedOrgsWithLiveVersionsRow

type ListDecommissionedOrgsWithLiveVersionsRow struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
}

type ListHeldVersionsForRedoParams

type ListHeldVersionsForRedoParams struct {
	RulesetReleaseID uuid.UUID  `json:"ruleset_release_id"`
	After            *uuid.UUID `json:"after"`
	RowLimit         int32      `json:"row_limit"`
}

type ListKnowledgePackSizesParams

type ListKnowledgePackSizesParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type ListKnowledgePackSizesRow

type ListKnowledgePackSizesRow struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	State     string    `json:"state"`
	Bytes     int64     `json:"bytes"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ListKnowledgePacksParams

type ListKnowledgePacksParams struct {
	OwnerKind string    `json:"owner_kind"`
	OwnerID   uuid.UUID `json:"owner_id"`
}

type ListMCPServerScansCheckedBeforeParams

type ListMCPServerScansCheckedBeforeParams struct {
	LastCheckedAt time.Time `json:"last_checked_at"`
	Limit         int32     `json:"limit"`
}

type ListOpenInvitationsRow

type ListOpenInvitationsRow struct {
	ID              uuid.UUID  `json:"id"`
	OrgID           uuid.UUID  `json:"org_id"`
	Email           string     `json:"email"`
	Role            string     `json:"role"`
	TokenSha256     []byte     `json:"token_sha256"`
	InvitedBy       *uuid.UUID `json:"invited_by"`
	CreatedAt       time.Time  `json:"created_at"`
	ExpiresAt       time.Time  `json:"expires_at"`
	AcceptedAt      *time.Time `json:"accepted_at"`
	AcceptedBy      *uuid.UUID `json:"accepted_by"`
	InvitedByHandle *string    `json:"invited_by_handle"`
}

type ListOpenMCPDependencyAlertsForAgentRow

type ListOpenMCPDependencyAlertsForAgentRow struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Ecosystem      string     `json:"ecosystem"`
	Package        string     `json:"package"`
	PackageVersion string     `json:"package_version"`
	Severity       string     `json:"severity"`
	AdvisoryIds    []string   `json:"advisory_ids"`
	FixedIn        []string   `json:"fixed_in"`
	CreatedAt      time.Time  `json:"created_at"`
	NotifiedAt     *time.Time `json:"notified_at"`
	ResolvedAt     *time.Time `json:"resolved_at"`
	ResolvedReason *string    `json:"resolved_reason"`
	AgentVersion   string     `json:"agent_version"`
}

type ListOpenMCPDependencyAlertsForSubmitterRow

type ListOpenMCPDependencyAlertsForSubmitterRow struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Ecosystem      string     `json:"ecosystem"`
	Package        string     `json:"package"`
	PackageVersion string     `json:"package_version"`
	Severity       string     `json:"severity"`
	AdvisoryIds    []string   `json:"advisory_ids"`
	FixedIn        []string   `json:"fixed_in"`
	CreatedAt      time.Time  `json:"created_at"`
	NotifiedAt     *time.Time `json:"notified_at"`
	ResolvedAt     *time.Time `json:"resolved_at"`
	ResolvedReason *string    `json:"resolved_reason"`
	AgentVersion   string     `json:"agent_version"`
	AgentID        uuid.UUID  `json:"agent_id"`
}

type ListOrgAdminsForMailRow

type ListOrgAdminsForMailRow struct {
	ID     uuid.UUID `json:"id"`
	Email  string    `json:"email"`
	Handle string    `json:"handle"`
}

type ListOrgAgentsForErasureRow

type ListOrgAgentsForErasureRow struct {
	ID     uuid.UUID `json:"id"`
	Name   string    `json:"name"`
	RepoID uuid.UUID `json:"repo_id"`
}

type ListOrgAuditEventsParams

type ListOrgAuditEventsParams struct {
	OrgID      *uuid.UUID `json:"org_id"`
	Limit      int32      `json:"limit"`
	Action     *string    `json:"action"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type ListOrgAuditEventsRow

type ListOrgAuditEventsRow struct {
	ID          uuid.UUID   `json:"id"`
	OccurredAt  time.Time   `json:"occurred_at"`
	ActorID     *uuid.UUID  `json:"actor_id"`
	ActorKind   string      `json:"actor_kind"`
	OrgID       *uuid.UUID  `json:"org_id"`
	Action      string      `json:"action"`
	TargetKind  *string     `json:"target_kind"`
	TargetID    *uuid.UUID  `json:"target_id"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	Detail      []byte      `json:"detail"`
	ActorHandle *string     `json:"actor_handle"`
}

type ListOrgMembersRow

type ListOrgMembersRow struct {
	Role        string `json:"role"`
	ViaScim     bool   `json:"via_scim"`
	ViaDomain   bool   `json:"via_domain"`
	State       string `json:"state"`
	Handle      string `json:"handle"`
	DisplayName string `json:"display_name"`
}

type ListOrgReportDesignsRow added in v0.7.5

type ListOrgReportDesignsRow struct {
	ID             uuid.UUID `json:"id"`
	OrgID          uuid.UUID `json:"org_id"`
	Document       []byte    `json:"document"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	HasCoverImage  bool      `json:"has_cover_image"`
	HasCustomCover bool      `json:"has_custom_cover"`
}

type ListOrgVersionsForErasureRow

type ListOrgVersionsForErasureRow struct {
	ID         uuid.UUID `json:"id"`
	AgentID    uuid.UUID `json:"agent_id"`
	Status     string    `json:"status"`
	ArchiveKey *string   `json:"archive_key"`
}

type ListOrgsDueForErasureRow

type ListOrgsDueForErasureRow struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
}

type ListOrgsWithUnnotifiedPendingRow

type ListOrgsWithUnnotifiedPendingRow struct {
	ID          uuid.UUID `json:"id"`
	Handle      string    `json:"handle"`
	DisplayName string    `json:"display_name"`
}

type ListPATsRow

type ListPATsRow struct {
	ID          uuid.UUID  `json:"id"`
	UserID      uuid.UUID  `json:"user_id"`
	Name        string     `json:"name"`
	TokenSha256 []byte     `json:"token_sha256"`
	TokenPrefix string     `json:"token_prefix"`
	Scopes      []string   `json:"scopes"`
	OrgID       *uuid.UUID `json:"org_id"`
	ExpiresAt   time.Time  `json:"expires_at"`
	LastUsedAt  *time.Time `json:"last_used_at"`
	RevokedAt   *time.Time `json:"revoked_at"`
	CreatedAt   time.Time  `json:"created_at"`
	OrgHandle   *string    `json:"org_handle"`
}

type ListPendingMembersUnnotifiedRow

type ListPendingMembersUnnotifiedRow struct {
	UserID    uuid.UUID `json:"user_id"`
	Handle    string    `json:"handle"`
	Email     string    `json:"email"`
	ViaScim   bool      `json:"via_scim"`
	ViaDomain bool      `json:"via_domain"`
	CreatedAt time.Time `json:"created_at"`
}

type ListPersonalNamespaceAgentsRow

type ListPersonalNamespaceAgentsRow struct {
	ID                       uuid.UUID  `json:"id"`
	Name                     string     `json:"name"`
	Visibility               string     `json:"visibility"`
	LatestPublishedVersionID *uuid.UUID `json:"latest_published_version_id"`
	RetiredAt                *time.Time `json:"retired_at"`
	DeletedAt                *time.Time `json:"deleted_at"`
}

type ListPlatformAuditEventsParams

type ListPlatformAuditEventsParams struct {
	Limit      int32      `json:"limit"`
	Action     *string    `json:"action"`
	OrgID      *uuid.UUID `json:"org_id"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type ListPlatformAuditEventsRow

type ListPlatformAuditEventsRow struct {
	ID          uuid.UUID   `json:"id"`
	OccurredAt  time.Time   `json:"occurred_at"`
	ActorID     *uuid.UUID  `json:"actor_id"`
	ActorKind   string      `json:"actor_kind"`
	OrgID       *uuid.UUID  `json:"org_id"`
	Action      string      `json:"action"`
	TargetKind  *string     `json:"target_kind"`
	TargetID    *uuid.UUID  `json:"target_id"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	Detail      []byte      `json:"detail"`
	ActorHandle *string     `json:"actor_handle"`
}

type ListPlatformStaffRow

type ListPlatformStaffRow struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
	Email  string    `json:"email"`
}

type ListPublishedVersionsForRescanParams

type ListPublishedVersionsForRescanParams struct {
	Limit int32      `json:"limit"`
	After *uuid.UUID `json:"after"`
}

type ListPublishedVersionsForRescanRow

type ListPublishedVersionsForRescanRow struct {
	ID            uuid.UUID `json:"id"`
	AgentID       uuid.UUID `json:"agent_id"`
	ArchiveDigest *string   `json:"archive_digest"`
	ArchiveKey    *string   `json:"archive_key"`
	ArchiveSize   *int64    `json:"archive_size"`
	Manifest      []byte    `json:"manifest"`
	Capabilities  []byte    `json:"capabilities"`
	Modes         []string  `json:"modes"`
	Visibility    string    `json:"visibility"`
}

type ListPublishedVersionsUsingMCPServerParams

type ListPublishedVersionsUsingMCPServerParams struct {
	Ecosystem string `json:"ecosystem"`
	Package   string `json:"package"`
	Version   string `json:"version"`
}

type ListReviewQueueParams

type ListReviewQueueParams struct {
	Queue string     `json:"queue"`
	Limit int32      `json:"limit"`
	OrgID *uuid.UUID `json:"org_id"`
}

type ListReviewQueueRow

type ListReviewQueueRow struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Queue          string     `json:"queue"`
	OrgID          *uuid.UUID `json:"org_id"`
	State          string     `json:"state"`
	DecidedBy      *uuid.UUID `json:"decided_by"`
	DecidedAt      *time.Time `json:"decided_at"`
	Rationale      *string    `json:"rationale"`
	CreatedAt      time.Time  `json:"created_at"`
	PublishPending bool       `json:"publish_pending"`
	Version        string     `json:"version"`
	VersionStatus  string     `json:"version_status"`
	AgentName      string     `json:"agent_name"`
	Namespace      string     `json:"namespace"`
}

type ListStalledKnowledgeScansRow

type ListStalledKnowledgeScansRow struct {
	ID        uuid.UUID `json:"id"`
	ObjectKey string    `json:"object_key"`
}

type ListStalledVoiceReviewsRow

type ListStalledVoiceReviewsRow struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type ListStuckForksParams

type ListStuckForksParams struct {
	CreatedBefore time.Time `json:"created_before"`
	RowLimit      int32     `json:"row_limit"`
}

type ListStuckScanningVersionsParams

type ListStuckScanningVersionsParams struct {
	UpdatedAt time.Time `json:"updated_at"`
	Limit     int32     `json:"limit"`
}

type ListStuckSubmittedVersionsParams

type ListStuckSubmittedVersionsParams struct {
	UpdatedAt time.Time `json:"updated_at"`
	Limit     int32     `json:"limit"`
}

type ListSubagentDependentsRow added in v0.6.1002

type ListSubagentDependentsRow struct {
	ID       uuid.UUID `json:"id"`
	AgentID  uuid.UUID `json:"agent_id"`
	Version  string    `json:"version"`
	Manifest []byte    `json:"manifest"`
}

type ListTeamMembersRow

type ListTeamMembersRow struct {
	Handle      string `json:"handle"`
	DisplayName string `json:"display_name"`
}

type ListUserActivityParams

type ListUserActivityParams struct {
	Limit      int32      `json:"limit"`
	ActorID    *uuid.UUID `json:"actor_id"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type ListUserActivityRow

type ListUserActivityRow struct {
	ID         uuid.UUID  `json:"id"`
	OccurredAt time.Time  `json:"occurred_at"`
	Action     string     `json:"action"`
	Detail     []byte     `json:"detail"`
	TargetKind *string    `json:"target_kind"`
	TargetID   *uuid.UUID `json:"target_id"`
	ActorKind  string     `json:"actor_kind"`
	Ip         string     `json:"ip"`
	UserAgent  *string    `json:"user_agent"`
	Version    *string    `json:"version"`
}

type ListUserDirectoryLinksParams

type ListUserDirectoryLinksParams struct {
	ProviderID string    `json:"provider_id"`
	UserID     uuid.UUID `json:"user_id"`
}

type ListUserDirectoryLinksRow

type ListUserDirectoryLinksRow struct {
	DirectorySubject   string `json:"directory_subject"`
	DirectoryAccountID int64  `json:"directory_account_id"`
}

type ListUserMembershipsRow

type ListUserMembershipsRow struct {
	OrgID uuid.UUID `json:"org_id"`
	Role  string    `json:"role"`
}

type ListUserMembershipsWithHandlesRow

type ListUserMembershipsWithHandlesRow struct {
	OrgID  uuid.UUID `json:"org_id"`
	Role   string    `json:"role"`
	State  string    `json:"state"`
	Handle string    `json:"handle"`
}

type ListUserReportDesignsRow added in v0.7.4

type ListUserReportDesignsRow struct {
	ID             uuid.UUID `json:"id"`
	UserID         uuid.UUID `json:"user_id"`
	Document       []byte    `json:"document"`
	IsDefault      bool      `json:"is_default"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	HasCoverImage  bool      `json:"has_cover_image"`
	HasCustomCover bool      `json:"has_custom_cover"`
}

type ListUserSubmissionsParams added in v0.7.9

type ListUserSubmissionsParams struct {
	SubmittedBy uuid.UUID  `json:"submitted_by"`
	Status      *string    `json:"status"`
	BeforeTime  *time.Time `json:"before_time"`
	BeforeID    *uuid.UUID `json:"before_id"`
	Lim         int32      `json:"lim"`
}

type ListUserSubmissionsRow added in v0.7.9

type ListUserSubmissionsRow struct {
	AgentVersion  AgentVersion `json:"agent_version"`
	AgentName     string       `json:"agent_name"`
	Namespace     string       `json:"namespace"`
	InReviewSince *time.Time   `json:"in_review_since"`
}

type ListUsersAtDomainForFoldInParams

type ListUsersAtDomainForFoldInParams struct {
	Domain string    `json:"domain"`
	OrgID  uuid.UUID `json:"org_id"`
}

type ListUsersAtDomainForFoldInRow

type ListUsersAtDomainForFoldInRow struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
	Email  string    `json:"email"`
}

type ListVersionsByStatusParams

type ListVersionsByStatusParams struct {
	AgentID  uuid.UUID `json:"agent_id"`
	Statuses []string  `json:"statuses"`
}

type ListVersionsShippingKnowledgeRow

type ListVersionsShippingKnowledgeRow struct {
	Version string `json:"version"`
	Status  string `json:"status"`
	Packs   []byte `json:"packs"`
}

type ListWebhookDeliveriesParams

type ListWebhookDeliveriesParams struct {
	EndpointID uuid.UUID  `json:"endpoint_id"`
	Limit      int32      `json:"limit"`
	BeforeTime *time.Time `json:"before_time"`
	BeforeID   *uuid.UUID `json:"before_id"`
}

type MarkDomainClaimVerifiedParams

type MarkDomainClaimVerifiedParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	Domain string    `json:"domain"`
}

type MarkInvitationAcceptedParams

type MarkInvitationAcceptedParams struct {
	ID         uuid.UUID  `json:"id"`
	OrgID      uuid.UUID  `json:"org_id"`
	AcceptedBy *uuid.UUID `json:"accepted_by"`
}

type MarkPendingMembersNotifiedParams

type MarkPendingMembersNotifiedParams struct {
	OrgID   uuid.UUID   `json:"org_id"`
	UserIds []uuid.UUID `json:"user_ids"`
}

type MarkVersionDrafterRevisionParams

type MarkVersionDrafterRevisionParams struct {
	ID            uuid.UUID `json:"id"`
	DraftBaseline *string   `json:"draft_baseline"`
}

type McpDependencyAlert

type McpDependencyAlert struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Ecosystem      string     `json:"ecosystem"`
	Package        string     `json:"package"`
	PackageVersion string     `json:"package_version"`
	Severity       string     `json:"severity"`
	AdvisoryIds    []string   `json:"advisory_ids"`
	FixedIn        []string   `json:"fixed_in"`
	CreatedAt      time.Time  `json:"created_at"`
	NotifiedAt     *time.Time `json:"notified_at"`
	ResolvedAt     *time.Time `json:"resolved_at"`
	ResolvedReason *string    `json:"resolved_reason"`
}

type McpServerScan

type McpServerScan struct {
	Ecosystem     string    `json:"ecosystem"`
	Package       string    `json:"package"`
	Version       string    `json:"version"`
	Status        string    `json:"status"`
	MaxSeverity   *string   `json:"max_severity"`
	Advisories    []byte    `json:"advisories"`
	FirstSeenAt   time.Time `json:"first_seen_at"`
	LastCheckedAt time.Time `json:"last_checked_at"`
	LastError     *string   `json:"last_error"`
}

type Membership

type Membership struct {
	OrgID            uuid.UUID  `json:"org_id"`
	UserID           uuid.UUID  `json:"user_id"`
	Role             string     `json:"role"`
	ViaScim          bool       `json:"via_scim"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	State            string     `json:"state"`
	ViaDomain        bool       `json:"via_domain"`
	AdminsNotifiedAt *time.Time `json:"admins_notified_at"`
}

type MoveVoiceVersionSlotParams

type MoveVoiceVersionSlotParams struct {
	ToSlot   string    `json:"to_slot"`
	UserID   uuid.UUID `json:"user_id"`
	FromSlot string    `json:"from_slot"`
}

type NoteVoiceReviewParams

type NoteVoiceReviewParams struct {
	ID     uuid.UUID `json:"id"`
	Review []byte    `json:"review"`
}

type OpenMCPDependencyAlertParams

type OpenMCPDependencyAlertParams struct {
	ID             uuid.UUID `json:"id"`
	VersionID      uuid.UUID `json:"version_id"`
	Ecosystem      string    `json:"ecosystem"`
	Package        string    `json:"package"`
	PackageVersion string    `json:"package_version"`
	Severity       string    `json:"severity"`
	AdvisoryIds    []string  `json:"advisory_ids"`
	FixedIn        []string  `json:"fixed_in"`
}

type Org

type Org struct {
	ID                 uuid.UUID  `json:"id"`
	DisplayName        string     `json:"display_name"`
	SsoRequired        bool       `json:"sso_required"`
	State              string     `json:"state"`
	CreatedAt          time.Time  `json:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at"`
	CreatedBy          *uuid.UUID `json:"created_by"`
	ActivatedAt        *time.Time `json:"activated_at"`
	Domain             *string    `json:"domain"`
	DecommissionAt     *time.Time `json:"decommission_at"`
	DecommissionReason *string    `json:"decommission_reason"`
	LogoObjectKey      *string    `json:"logo_object_key"`
}

type OrgInvitation

type OrgInvitation struct {
	ID          uuid.UUID  `json:"id"`
	OrgID       uuid.UUID  `json:"org_id"`
	Email       string     `json:"email"`
	Role        string     `json:"role"`
	TokenSha256 []byte     `json:"token_sha256"`
	InvitedBy   *uuid.UUID `json:"invited_by"`
	CreatedAt   time.Time  `json:"created_at"`
	ExpiresAt   time.Time  `json:"expires_at"`
	AcceptedAt  *time.Time `json:"accepted_at"`
	AcceptedBy  *uuid.UUID `json:"accepted_by"`
}

type OrgReportDesign added in v0.7.5

type OrgReportDesign struct {
	ID               uuid.UUID `json:"id"`
	OrgID            uuid.UUID `json:"org_id"`
	Document         []byte    `json:"document"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
	CustomCover      []byte    `json:"custom_cover"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

type PassVoiceVersionParams

type PassVoiceVersionParams struct {
	ID          uuid.UUID `json:"id"`
	Review      []byte    `json:"review"`
	QuestionSet string    `json:"question_set"`
}

type Pat

type Pat struct {
	ID          uuid.UUID  `json:"id"`
	UserID      uuid.UUID  `json:"user_id"`
	Name        string     `json:"name"`
	TokenSha256 []byte     `json:"token_sha256"`
	TokenPrefix string     `json:"token_prefix"`
	Scopes      []string   `json:"scopes"`
	OrgID       *uuid.UUID `json:"org_id"`
	ExpiresAt   time.Time  `json:"expires_at"`
	LastUsedAt  *time.Time `json:"last_used_at"`
	RevokedAt   *time.Time `json:"revoked_at"`
	CreatedAt   time.Time  `json:"created_at"`
}

type Policy

type Policy struct {
	ID        uuid.UUID  `json:"id"`
	OrgID     *uuid.UUID `json:"org_id"`
	Document  []byte     `json:"document"`
	Version   int32      `json:"version"`
	UpdatedAt time.Time  `json:"updated_at"`
}

type PseudonymizeUserParams

type PseudonymizeUserParams struct {
	ID               uuid.UUID `json:"id"`
	Email            string    `json:"email"`
	DeletedTombstone []byte    `json:"deleted_tombstone"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ActivateMembership

func (q *Queries) ActivateMembership(ctx context.Context, arg ActivateMembershipParams) (int64, error)

The one write that makes a membership active. Returns 0 rows when it was already active, so the caller can tell a first activation from a repeat and emit member.added exactly once. The door flags of a pending row are kept: the console still says how the person arrived.

func (*Queries) ActivateOrg

func (q *Queries) ActivateOrg(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) AddTeamMember

func (q *Queries) AddTeamMember(ctx context.Context, arg AddTeamMemberParams) error

func (*Queries) AppendAttestationSignature

func (q *Queries) AppendAttestationSignature(ctx context.Context, arg AppendAttestationSignatureParams) (int64, error)

Append a countersignature (`signature` is `[{"keyid": …, "sig": …}]`) unless the envelope already carries one by that key id (`key_match` is `[{"keyid": …}]`). The guard is on the key id, not the signature: ECDSA signatures are randomised, so two sweeps signing the same bytes produce different ones, and a guard on the whole object would let both through.

func (*Queries) BumpDownloadStat

func (q *Queries) BumpDownloadStat(ctx context.Context, arg BumpDownloadStatParams) error

func (*Queries) ClaimIdempotencyKey

func (q *Queries) ClaimIdempotencyKey(ctx context.Context, arg ClaimIdempotencyKeyParams) (ClaimIdempotencyKeyRow, error)

Idempotency-Key replay store ("Mutating POSTs accept Idempotency-Key"). Reserves the key for this request. A conflicting row means the key was used before: the existing row comes back so the caller can decide between replaying its recorded response (same request_hash) and refusing (409).

func (*Queries) ClearLiveTrustedDevicesForUser

func (q *Queries) ClearLiveTrustedDevicesForUser(ctx context.Context, userID uuid.UUID) (int64, error)

ClearLiveTrustedDevicesForUser is the site's "Clear remembered devices" (DELETE /user/trusted-devices), for the caller's own account only. It revokes exactly the rows the count counts, live ones, so the number the button reports is the number it showed; expired rows are already inert and are the sweep's.

func (q *Queries) ClearOrgLogo(ctx context.Context, id uuid.UUID) (*string, error)

Removes the organization's logo and returns the key that was served, for the caller to delete the object; the same one-statement shape as SetOrgLogo. No row when there was no logo.

func (*Queries) ClearOrgReportDesignCoverImage added in v0.7.5

func (q *Queries) ClearOrgReportDesignCoverImage(ctx context.Context, arg ClearOrgReportDesignCoverImageParams) (OrgReportDesign, error)

func (*Queries) ClearOrgReportDesignCustomCover added in v0.7.5

func (q *Queries) ClearOrgReportDesignCustomCover(ctx context.Context, arg ClearOrgReportDesignCustomCoverParams) (OrgReportDesign, error)
func (q *Queries) ClearOrgReportDesignLogo(ctx context.Context, arg ClearOrgReportDesignLogoParams) (OrgReportDesign, error)

func (*Queries) ClearUserReportDesignCoverImage added in v0.7.4

func (q *Queries) ClearUserReportDesignCoverImage(ctx context.Context, arg ClearUserReportDesignCoverImageParams) (UserReportDesign, error)

func (*Queries) ClearUserReportDesignCustomCover added in v0.7.4

func (q *Queries) ClearUserReportDesignCustomCover(ctx context.Context, arg ClearUserReportDesignCustomCoverParams) (UserReportDesign, error)

func (*Queries) ClearUserReportDesignDefault added in v0.7.4

func (q *Queries) ClearUserReportDesignDefault(ctx context.Context, userID uuid.UUID) (int64, error)

No design is the default: a run falls through to the CLI's own choice.

func (q *Queries) ClearUserReportDesignLogo(ctx context.Context, arg ClearUserReportDesignLogoParams) (UserReportDesign, error)

func (*Queries) CompleteAuditExport

func (q *Queries) CompleteAuditExport(ctx context.Context, arg CompleteAuditExportParams) error

func (*Queries) CompleteIdempotencyKey

func (q *Queries) CompleteIdempotencyKey(ctx context.Context, arg CompleteIdempotencyKeyParams) error

func (*Queries) ConsumeDesktopGrant

func (q *Queries) ConsumeDesktopGrant(ctx context.Context, arg ConsumeDesktopGrantParams) (DesktopGrant, error)

Single-use and time-bound in one statement: the row is claimed only if it is unconsumed and unexpired, so two racing exchanges cannot both succeed.

func (*Queries) ConsumeDesktopGrantsForUser

func (q *Queries) ConsumeDesktopGrantsForUser(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data: a code minted before the clear cannot be exchanged for a token after it.

func (*Queries) ConsumeEmailVerification

func (q *Queries) ConsumeEmailVerification(ctx context.Context, tokenSha256 []byte) (uuid.UUID, error)

func (*Queries) ConsumeSAMLAssertion

func (q *Queries) ConsumeSAMLAssertion(ctx context.Context, arg ConsumeSAMLAssertionParams) (int64, error)

SAML shared state: the consumed-assertion replay set and the outstanding-AuthnRequest tracker, shared by every API replica. Records the assertion id, or renews a row whose recorded expiry has passed; a live row stays as it is, and the zero rows affected then say the assertion was seen before. Two replicas presenting one id concurrently cannot both win: the loser of the insert waits on the winner's row and re-reads it against the WHERE, which by then finds it live. The record is kept for at least the caller's floor, on the database's own clock — the one the WHERE reads — because the validator goes on accepting an assertion for its clock skew past the expiry the assertion carries, so a record that lapsed at that expiry would leave the tail of the window unprotected. Flooring on the database clock keeps the margin whatever the replicas' clocks say.

func (*Queries) ConsumeSAMLRequest

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

Single use: the row goes with the read, and an expired one counts as gone.

func (*Queries) CountActiveMemberships

func (q *Queries) CountActiveMemberships(ctx context.Context, userID uuid.UUID) (int64, error)

The same rule at the creation door: a person who is an active member anywhere founds nothing until they leave.

func (*Queries) CountActiveMembershipsElsewhere

func (q *Queries) CountActiveMembershipsElsewhere(ctx context.Context, arg CountActiveMembershipsElsewhereParams) (int64, error)

One organization per person: an invitation or an approval for someone already active elsewhere is refused.

func (*Queries) CountAgentDeleteBlockers

func (q *Queries) CountAgentDeleteBlockers(ctx context.Context, agentID uuid.UUID) (CountAgentDeleteBlockersRow, error)

What DELETE /agents/{ns}/{name} must know. Version rows can never be deleted, so an agent with any is deleted as a tombstone rather than outright. Advisories and abuse reports are trust & safety records: they outlive the author's wish to remove the agent.

func (*Queries) CountAgentStars

func (q *Queries) CountAgentStars(ctx context.Context, agentID uuid.UUID) (int64, error)

func (*Queries) CountAgentsInNamespace

func (q *Queries) CountAgentsInNamespace(ctx context.Context, namespaceID uuid.UUID) (int64, error)

A deleted agent's tombstone holds its name, not a place in the quota.

func (*Queries) CountAttestationsLackingSignature

func (q *Queries) CountAttestationsLackingSignature(ctx context.Context, keyMatch []byte) (int64, error)

How many attestations lack the given key's signature: at start, a count above zero enqueues the sweep, so a rotation, a partial sweep and a lost enqueue all complete at the next start.

func (*Queries) CountAuditActionsByActorSince

func (q *Queries) CountAuditActionsByActorSince(ctx context.Context, arg CountAuditActionsByActorSinceParams) (int64, error)

How many times an actor took one action since a moment: the record is the rate limit for an act a person may take once a day (the request for access to their domain's organization).

func (*Queries) CountAuditEvents

func (q *Queries) CountAuditEvents(ctx context.Context, arg CountAuditEventsParams) (int64, error)

func (*Queries) CountEmailVerificationsSince

How many links the account was sent since a moment, and the oldest of them (for the daily cap).

func (*Queries) CountFindingsBySeverity

func (q *Queries) CountFindingsBySeverity(ctx context.Context, scanRunID uuid.UUID) ([]CountFindingsBySeverityRow, error)

The finding counts a report carries, without loading the findings.

func (*Queries) CountForks

func (q *Queries) CountForks(ctx context.Context, id uuid.UUID) (int64, error)

How many forks an agent has: a count only, never which. A fork deleted as a tombstone is not counted.

func (*Queries) CountIPClusterSubmissions

func (q *Queries) CountIPClusterSubmissions(ctx context.Context, submitterIpHash *string) (CountIPClusterSubmissionsRow, error)

S8's cluster axis: how many distinct accounts and how many versions share this submitting-address hash in the last 24 hours.

func (*Queries) CountLiveTrustedDevicesForUser

func (q *Queries) CountLiveTrustedDevicesForUser(ctx context.Context, userID uuid.UUID) (int64, error)

CountLiveTrustedDevicesForUser is what the site's "Clear remembered devices" button reads to say whether there is anything to clear. Live is what the lookup honours: not revoked, not expired, so the number is exactly the browsers that would skip the code.

func (*Queries) CountMemberships

func (q *Queries) CountMemberships(ctx context.Context, userID uuid.UUID) (int64, error)

Every membership row a person holds, pending included: the fold-in fires only for a member of no organization, and a person already waiting somewhere is not folded in elsewhere.

func (*Queries) CountOrgAdmins

func (q *Queries) CountOrgAdmins(ctx context.Context, orgID uuid.UUID) (int64, error)

Only an admin who can still act counts: an erased account keeps its membership row (and the last-owner guard this replaces counted it), and a pending admin holds nothing until they are approved.

func (*Queries) CountOrgReportDesigns added in v0.7.5

func (q *Queries) CountOrgReportDesigns(ctx context.Context, orgID uuid.UUID) (int64, error)

func (*Queries) CountOrgSeats

func (q *Queries) CountOrgSeats(ctx context.Context, orgID uuid.UUID) (CountOrgSeatsRow, error)

A seat is every active membership plus every open invitation; pending members hold none and are reported so an admin can see who is waiting.

func (*Queries) CountPrivateAgentsInNamespace

func (q *Queries) CountPrivateAgentsInNamespace(ctx context.Context, namespaceID uuid.UUID) (int64, error)

The private-agent cap a subscription tier sets: what a namespace holds today, so one more can be refused. A retired agent and a deleted one's tombstone are private but put away: neither takes a submission or runs for anyone, so neither holds a place under the cap.

func (*Queries) CountPublishedVersions

func (q *Queries) CountPublishedVersions(ctx context.Context, agentID uuid.UUID) (int64, error)

func (*Queries) CountPublishedVersionsByUser

func (q *Queries) CountPublishedVersionsByUser(ctx context.Context, id uuid.UUID) (int64, error)

Published public versions under a user's PERSONAL namespace (the deletion chooser needs to know whether consumers depend on them).

func (*Queries) CountPublishedVersionsWithoutAttestation

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

func (*Queries) CountRecentAbuseReportsByReporter

func (q *Queries) CountRecentAbuseReportsByReporter(ctx context.Context, reporterID *uuid.UUID) (int64, error)

func (*Queries) CountRecentVersionsBySubmitter

func (q *Queries) CountRecentVersionsBySubmitter(ctx context.Context, submittedBy uuid.UUID) (int64, error)

func (*Queries) CountSearchAgents

func (q *Queries) CountSearchAgents(ctx context.Context, arg CountSearchAgentsParams) (int64, error)

The number of hits SearchAgents would return for the same predicate before LIMIT/OFFSET, so a client can say "2 of 8" truthfully. The WHERE clause is SearchAgents' verbatim and the two must move together; the installs join is absent because nothing in the predicate reads it.

func (*Queries) CountUnscannedVersionsStanding

func (q *Queries) CountUnscannedVersionsStanding(ctx context.Context, agentID uuid.UUID) (int64, error)

The versions of an agent that were admitted without a scan and could still be, or return to being, published: published, quarantined or blocked. A reinstate leaves the last two held, since it publishes only on a scan's verdict and such a version has none. While one stands the agent cannot become public, since only a version that passed the gate is ever public; yanking is what ends it.

func (*Queries) CountUserReportDesigns added in v0.7.4

func (q *Queries) CountUserReportDesigns(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) CountVersionsToday

func (q *Queries) CountVersionsToday(ctx context.Context, agentID uuid.UUID) (int64, error)

func (*Queries) CountVoiceReviewAttempt

func (q *Queries) CountVoiceReviewAttempt(ctx context.Context, id uuid.UUID) (VoiceVersion, error)

One more try at a version's review; only a version still being reviewed is counted, so a job for a replaced or decided version finds nothing.

func (*Queries) CountWebhookEndpoints

func (q *Queries) CountWebhookEndpoints(ctx context.Context, orgID uuid.UUID) (int64, error)

At most 20 webhook endpoints per org.

func (*Queries) CreateAbuseReport

func (q *Queries) CreateAbuseReport(ctx context.Context, arg CreateAbuseReportParams) (AbuseReport, error)

func (*Queries) CreateAdvisory

func (q *Queries) CreateAdvisory(ctx context.Context, arg CreateAdvisoryParams) (Advisory, error)

func (*Queries) CreateAgent

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

func (*Queries) CreateAgentVersion

func (q *Queries) CreateAgentVersion(ctx context.Context, arg CreateAgentVersionParams) (AgentVersion, error)

Agent versions + state machine.

func (*Queries) CreateAttestation

func (q *Queries) CreateAttestation(ctx context.Context, arg CreateAttestationParams) (Attestation, error)

func (*Queries) CreateAuditExport

func (q *Queries) CreateAuditExport(ctx context.Context, arg CreateAuditExportParams) (AuditExport, error)

============================ Audit exports ============================

func (*Queries) CreateDesktopGrant

func (q *Queries) CreateDesktopGrant(ctx context.Context, arg CreateDesktopGrantParams) (DesktopGrant, error)

Desktop browser sign-in grants.

func (*Queries) CreateDomainClaim

func (q *Queries) CreateDomainClaim(ctx context.Context, arg CreateDomainClaimParams) (DomainClaim, error)

============================ Domain claims ============================

func (*Queries) CreateEmailVerification

func (q *Queries) CreateEmailVerification(ctx context.Context, arg CreateEmailVerificationParams) error

func (*Queries) CreateForkAgent

func (q *Queries) CreateForkAgent(ctx context.Context, arg CreateForkAgentParams) (Agent, error)

A fork's row: private, with its origin and the version it was taken from, copying until a worker has copied the repository and submitted the first version.

func (*Queries) CreateFounderMembership

func (q *Queries) CreateFounderMembership(ctx context.Context, arg CreateFounderMembershipParams) error

The one membership written without a seat check: the person creating the organization, who is its first admin. There is nothing yet to count and nobody yet to approve them.

func (*Queries) CreateHandle

func (q *Queries) CreateHandle(ctx context.Context, arg CreateHandleParams) error

Users, handles, and email verification.

func (*Queries) CreateIdentity

func (q *Queries) CreateIdentity(ctx context.Context, arg CreateIdentityParams) (Identity, error)

Enterprise features: identities, webhooks, domain claims, audit exports, enforced-SSO helpers. ============================ Identities (JIT) ============================

func (*Queries) CreateInvitation

func (q *Queries) CreateInvitation(ctx context.Context, arg CreateInvitationParams) (OrgInvitation, error)

func (*Queries) CreateKnowledgeObject

func (q *Queries) CreateKnowledgeObject(ctx context.Context, arg CreateKnowledgeObjectParams) error

func (*Queries) CreateKnowledgeOwnerSalt

func (q *Queries) CreateKnowledgeOwnerSalt(ctx context.Context, arg CreateKnowledgeOwnerSaltParams) ([]byte, error)

The first wrap for an owner; a concurrent first wrap keeps the salt that won.

func (*Queries) CreateKnowledgePack

func (q *Queries) CreateKnowledgePack(ctx context.Context, arg CreateKnowledgePackParams) (KnowledgePack, error)

Knowledge packs. Every read and write names the owner: a pack is found only by its owner, and anyone else's lookup is a pack that does not exist.

func (*Queries) CreateOrg

func (q *Queries) CreateOrg(ctx context.Context, arg CreateOrgParams) (Org, error)

Orgs, memberships, teams. activated_at is now() where nothing will activate the org later (no admission extension), NULL where one will. domain is the creator's verified email domain, or NULL for none; the unique constraint refuses a second organization at one domain.

func (*Queries) CreateOrgReportDesign added in v0.7.5

func (q *Queries) CreateOrgReportDesign(ctx context.Context, arg CreateOrgReportDesignParams) (OrgReportDesign, error)

func (*Queries) CreatePAT

func (q *Queries) CreatePAT(ctx context.Context, arg CreatePATParams) (Pat, error)

PATs and sessions.

func (*Queries) CreateRepo

func (q *Queries) CreateRepo(ctx context.Context, id uuid.UUID) (Repo, error)

Agents, repos, and per-agent grants.

func (*Queries) CreateRepoWithBranch

func (q *Queries) CreateRepoWithBranch(ctx context.Context, arg CreateRepoWithBranchParams) (Repo, error)

A fork's repository row, on the origin's default branch so the copied history keeps its trunk's name.

func (*Queries) CreateReviewItem

func (q *Queries) CreateReviewItem(ctx context.Context, arg CreateReviewItemParams) (ReviewItem, error)

func (*Queries) CreateRulesetRelease

func (q *Queries) CreateRulesetRelease(ctx context.Context, arg CreateRulesetReleaseParams) (CreateRulesetReleaseRow, error)

Security pipeline persistence. `inserted` distinguishes a brand-new semver from a re-registration of one we already know: a NEW ruleset semver is what triggers the rescan sweep, and every process restart re-registers the bundle it embeds.

func (*Queries) CreateSSHKey

func (q *Queries) CreateSSHKey(ctx context.Context, arg CreateSSHKeyParams) (UserSshKey, error)

SSH keys.

func (*Queries) CreateScanRun

func (q *Queries) CreateScanRun(ctx context.Context, arg CreateScanRunParams) (ScanRun, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)

func (*Queries) CreateTeam

func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (Team, error)

func (*Queries) CreateTrustedDevice

func (q *Queries) CreateTrustedDevice(ctx context.Context, arg CreateTrustedDeviceParams) (CreateTrustedDeviceRow, error)

Trusted devices. The credential a browser earns by answering the second factor at a directory, so a later sign-in from it skips the code.

The credential's queries: establish and touch it, take it away when access is taken away (deprovisioning, erasure), the account's own count and clear, and the expiry sweep. There is no list and no per-browser removal.

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) CreateUserReportDesign added in v0.7.4

func (q *Queries) CreateUserReportDesign(ctx context.Context, arg CreateUserReportDesignParams) (UserReportDesign, error)

func (*Queries) CreateVoice

func (q *Queries) CreateVoice(ctx context.Context, arg CreateVoiceParams) (Voice, error)

The Writing Voice. Every read and write names the person: a voice is found only by its owner. A person's voice row, made with the first version they put; a second caller racing the first finds the row the first made.

func (*Queries) CreateWebhookDelivery

func (q *Queries) CreateWebhookDelivery(ctx context.Context, arg CreateWebhookDeliveryParams) (WebhookDelivery, error)

func (*Queries) CreateWebhookEndpoint

func (q *Queries) CreateWebhookEndpoint(ctx context.Context, arg CreateWebhookEndpointParams) (WebhookEndpoint, error)

============================ Webhooks ============================

func (*Queries) DecideReviewItem

func (q *Queries) DecideReviewItem(ctx context.Context, arg DecideReviewItemParams) (int64, error)

A decision lands only on a pending item: a second reviewer acting on a stale page gets no row and a conflict, never an overwrite of the first decision (a handed-off approval leaves its version in needs_review for a moment).

func (*Queries) DecommissionOrg

func (q *Queries) DecommissionOrg(ctx context.Context, arg DecommissionOrgParams) (int64, error)

Only an active organization enters the hold; a repeat is 0 rows.

func (*Queries) DeleteAccountInstall

func (q *Queries) DeleteAccountInstall(ctx context.Context, arg DeleteAccountInstallParams) (int64, error)

func (*Queries) DeleteAccountInstallByRef

func (q *Queries) DeleteAccountInstallByRef(ctx context.Context, arg DeleteAccountInstallByRefParams) ([]uuid.UUID, error)

The record as the list names it, for a QuickAgent the caller can no longer read or find at that name. Returns the agent ids removed, for the audit row.

func (*Queries) DeleteAccountInstallsForUser

func (q *Queries) DeleteAccountInstallsForUser(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data: every record the user holds.

func (*Queries) DeleteAgentByID

func (q *Queries) DeleteAgentByID(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) DeleteAgentTeamGrant

func (q *Queries) DeleteAgentTeamGrant(ctx context.Context, arg DeleteAgentTeamGrantParams) (int64, error)

func (*Queries) DeleteAgentUserGrant

func (q *Queries) DeleteAgentUserGrant(ctx context.Context, arg DeleteAgentUserGrantParams) (int64, error)

func (*Queries) DeleteEmailVerificationsForUser

func (q *Queries) DeleteEmailVerificationsForUser(ctx context.Context, userID uuid.UUID) error

An erased account's links go with it: one followed afterwards would confirm an address nobody holds any more.

func (*Queries) DeleteExpiredDesktopGrants

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

func (*Queries) DeleteExpiredSAMLAssertions

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

func (*Queries) DeleteExpiredSAMLRequests

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

func (*Queries) DeleteExpiredTrustedDevices

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

DeleteExpiredTrustedDevices is the expiry sweep: it removes the rows past their own expiry, and only those. A revoked record that has not expired yet is kept until it does: it is already inert, and keeping it to its own lifetime means no cap or clock of the sweep's ever decides when a record goes. Every read already filters on expiry, so a row the sweep has not reached behaves exactly like one it has.

func (*Queries) DeleteFindingsForScanner

func (q *Queries) DeleteFindingsForScanner(ctx context.Context, arg DeleteFindingsForScannerParams) error

Re-persisting a stage's findings: delete then insert, so a stage that runs again (a retried job, an errored stage re-attempted) replaces its findings rather than adding a second copy to the report a reviewer reads. Matches both the bare stage id and its rule-qualified children ("S4/inj-001").

func (*Queries) DeleteFoldInDecline

func (q *Queries) DeleteFoldInDecline(ctx context.Context, arg DeleteFoldInDeclineParams) (int64, error)

An admin's invitation or approval supersedes the decline: the memory goes when the membership is activated.

func (*Queries) DeleteInvitation

func (q *Queries) DeleteInvitation(ctx context.Context, arg DeleteInvitationParams) (int64, error)

func (*Queries) DeleteKnowledgeObject

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

func (*Queries) DeleteKnowledgeObjectsOfOwner

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

An owner's erasure, data clear or decommission, with DeleteKnowledgePacksOfOwner in the same transaction: the blob keys of every object come back for the caller to delete once it commits.

func (*Queries) DeleteKnowledgeOwnerSalt

func (q *Queries) DeleteKnowledgeOwnerSalt(ctx context.Context, arg DeleteKnowledgeOwnerSaltParams) error

func (*Queries) DeleteKnowledgePack

func (q *Queries) DeleteKnowledgePack(ctx context.Context, arg DeleteKnowledgePackParams) (uuid.UUID, error)

func (*Queries) DeleteKnowledgePacksOfOwner

func (q *Queries) DeleteKnowledgePacksOfOwner(ctx context.Context, arg DeleteKnowledgePacksOfOwnerParams) (int64, error)

func (*Queries) DeleteMembership

func (q *Queries) DeleteMembership(ctx context.Context, arg DeleteMembershipParams) (int64, error)

func (*Queries) DeleteOrgAgentAccountInstalls

func (q *Queries) DeleteOrgAgentAccountInstalls(ctx context.Context, namespaceID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgAgentStars

func (q *Queries) DeleteOrgAgentStars(ctx context.Context, namespaceID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgAgentUserGrants

func (q *Queries) DeleteOrgAgentUserGrants(ctx context.Context, namespaceID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgAuditExports

func (q *Queries) DeleteOrgAuditExports(ctx context.Context, orgID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgDomainClaims

func (q *Queries) DeleteOrgDomainClaims(ctx context.Context, orgID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgFoldInDeclines

func (q *Queries) DeleteOrgFoldInDeclines(ctx context.Context, orgID uuid.UUID) (int64, error)

An erased organization remembers no decline; the rows would go with the organization's row if it were deleted, and it is not.

func (*Queries) DeleteOrgInvitations

func (q *Queries) DeleteOrgInvitations(ctx context.Context, orgID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgMemberships

func (q *Queries) DeleteOrgMemberships(ctx context.Context, orgID uuid.UUID) (int64, error)

func (*Queries) DeleteOrgPolicy

func (q *Queries) DeleteOrgPolicy(ctx context.Context, orgID *uuid.UUID) (int64, error)

func (*Queries) DeleteOrgReportDesign added in v0.7.5

func (q *Queries) DeleteOrgReportDesign(ctx context.Context, arg DeleteOrgReportDesignParams) (int64, error)

func (*Queries) DeleteOrgReportDesigns added in v0.7.5

func (q *Queries) DeleteOrgReportDesigns(ctx context.Context, orgID uuid.UUID) (int64, error)

The organization's erasure: every design and every image of the organization's go.

func (*Queries) DeleteOrgTeams

func (q *Queries) DeleteOrgTeams(ctx context.Context, orgID uuid.UUID) (int64, error)

team_members and agent_team_grants cascade.

func (*Queries) DeleteOrgWebhookEndpoints

func (q *Queries) DeleteOrgWebhookEndpoints(ctx context.Context, orgID uuid.UUID) (int64, error)

Deliveries cascade with their endpoint.

func (*Queries) DeleteRepoByID

func (q *Queries) DeleteRepoByID(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteTeam

func (q *Queries) DeleteTeam(ctx context.Context, arg DeleteTeamParams) (int64, error)

func (*Queries) DeleteTrustedDevicesForUser

func (q *Queries) DeleteTrustedDevicesForUser(ctx context.Context, userID uuid.UUID) (int64, error)

DeleteTrustedDevicesForUser is the erasure half, and it deletes rather than revokes. A revoked row still holds an address and a user agent, which is personal data belonging to a person who asked to be deleted; the users row survives erasure only because audit events and immutable published content need a stable, now-opaque actor id, and nothing needs that of a browser credential. That the credential was issued is already in the audit log as user.trusted_device_add, so deleting the row loses no record.

func (*Queries) DeleteUnacceptedInvitationsFor

func (q *Queries) DeleteUnacceptedInvitationsFor(ctx context.Context, arg DeleteUnacceptedInvitationsForParams) (int64, error)

Re-inviting the same address supersedes the standing invitation, whose token stops working; the unique index makes this the only way to do it.

func (*Queries) DeleteUserMemberships

func (q *Queries) DeleteUserMemberships(ctx context.Context, userID uuid.UUID) (int64, error)

An erased account holds no seat anywhere: its rows go with it, after the last-admin guard has passed.

func (*Queries) DeleteUserNotificationSettings

func (q *Queries) DeleteUserNotificationSettings(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data: no row reads as the defaults.

func (*Queries) DeleteUserReportDesign added in v0.7.4

func (q *Queries) DeleteUserReportDesign(ctx context.Context, arg DeleteUserReportDesignParams) (int64, error)

func (*Queries) DeleteUserReportDesigns added in v0.7.4

func (q *Queries) DeleteUserReportDesigns(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data and the account's erasure: every design and every image of the account's go.

func (*Queries) DeleteVersionMCPServers

func (q *Queries) DeleteVersionMCPServers(ctx context.Context, versionID uuid.UUID) error

func (*Queries) DeleteVoice

func (q *Queries) DeleteVoice(ctx context.Context, userID uuid.UUID) (int64, error)

The person's voice and every version of it: a delete, the account erasure, a data clear.

func (*Queries) DeleteVoiceVersionInSlot

func (q *Queries) DeleteVoiceVersionInSlot(ctx context.Context, arg DeleteVoiceVersionInSlotParams) (int64, error)

func (*Queries) DeleteWebhookEndpoint

func (q *Queries) DeleteWebhookEndpoint(ctx context.Context, arg DeleteWebhookEndpointParams) (int64, error)

func (*Queries) EnsureAuditPartition

func (q *Queries) EnsureAuditPartition(ctx context.Context, dollar_1 pgtype.Date) error

func (*Queries) FailAuditExport

func (q *Queries) FailAuditExport(ctx context.Context, arg FailAuditExportParams) error

func (*Queries) FinishKnowledgeScan

func (q *Queries) FinishKnowledgeScan(ctx context.Context, arg FinishKnowledgeScanParams) (int64, error)

The scan of the tree named by its object ends: ready, findings or not, or failed. A scan of a tree since replaced changes nothing.

func (*Queries) FinishScanRun

func (q *Queries) FinishScanRun(ctx context.Context, arg FinishScanRunParams) error

judge_prompt_hash is written here rather than at CreateScanRun: the run row must exist before stages run (stage results reference it), and S5 only reports which rubric version it used once it has run. The judge's token use is written the same way: known only once S5 ran, NULL when the provider reported none. judge_model is re-stated at finish with the value the report and the attestation carry, so a row created by an earlier binary and resumed after an upgrade ends up agreeing with them.

func (*Queries) FlagVoiceVersion

func (q *Queries) FlagVoiceVersion(ctx context.Context, arg FlagVoiceVersionParams) (VoiceVersion, error)

A flagged review: the version stays pending, with its findings, and the live one stays live.

func (*Queries) GetAbuseReport

func (q *Queries) GetAbuseReport(ctx context.Context, id uuid.UUID) (AbuseReport, error)

func (*Queries) GetAccountInstall

func (q *Queries) GetAccountInstall(ctx context.Context, arg GetAccountInstallParams) (AccountInstall, error)

func (*Queries) GetActiveSigningKey

func (q *Queries) GetActiveSigningKey(ctx context.Context) (SigningKey, error)

The key the deployment signs with today, for a process that holds no key of its own (the api and git roles): the one registered most recently and not retired. A registration retires every other key, so at most one row qualifies once the signer has started.

func (*Queries) GetAdvisoryPublic

func (q *Queries) GetAdvisoryPublic(ctx context.Context, id uuid.UUID) (GetAdvisoryPublicRow, error)

Permalink: only advisories against public agents resolve.

func (*Queries) GetAgentByID

func (q *Queries) GetAgentByID(ctx context.Context, id uuid.UUID) (GetAgentByIDRow, error)

func (*Queries) GetAgentByPath

func (q *Queries) GetAgentByPath(ctx context.Context, arg GetAgentByPathParams) (GetAgentByPathRow, error)

A deleted agent's tombstone is absent from every read path that asks for it by name; include_deleted is the platform staff's door to it, for the trust & safety actions, and the advisories' door for a caller proved to hold a release of it. A fork carries its origin's namespace (the origin's publisher) for the extension seam.

func (*Queries) GetAgentForUpdate

func (q *Queries) GetAgentForUpdate(ctx context.Context, id uuid.UUID) (GetAgentForUpdateRow, error)

The agent row under the row lock, with its namespace, for a decision that must not race another writer of the row: the flag's refusals and the private → public change, and the gate-skipping edge.

func (*Queries) GetAgentInstallCounts

func (q *Queries) GetAgentInstallCounts(ctx context.Context, agentID uuid.UUID) (GetAgentInstallCountsRow, error)

Lifetime and trailing-30-day installs from the daily rollup, in one pass.

func (*Queries) GetAgentOwnerOrg

func (q *Queries) GetAgentOwnerOrg(ctx context.Context, id uuid.UUID) (uuid.UUID, error)

GetAgentOwnerOrg returns the owning org id when an agent's namespace is an org (webhook fan-out is org-scoped; personal-namespace agents return no row).

func (*Queries) GetAgentUserGrant

func (q *Queries) GetAgentUserGrant(ctx context.Context, arg GetAgentUserGrantParams) (string, error)

func (*Queries) GetAttestation

func (q *Queries) GetAttestation(ctx context.Context, versionID uuid.UUID) (Attestation, error)

func (*Queries) GetAuditExport

func (q *Queries) GetAuditExport(ctx context.Context, arg GetAuditExportParams) (AuditExport, error)

func (*Queries) GetAuditExportByID

func (q *Queries) GetAuditExportByID(ctx context.Context, id uuid.UUID) (AuditExport, error)

func (*Queries) GetBaselinePolicy

func (q *Queries) GetBaselinePolicy(ctx context.Context) (Policy, error)

func (*Queries) GetDomainClaim

func (q *Queries) GetDomainClaim(ctx context.Context, arg GetDomainClaimParams) (DomainClaim, error)

func (*Queries) GetFinding

func (q *Queries) GetFinding(ctx context.Context, id uuid.UUID) (Finding, error)

func (*Queries) GetFoldInDecline

func (q *Queries) GetFoldInDecline(ctx context.Context, arg GetFoldInDeclineParams) (FoldInDecline, error)

func (*Queries) GetForkOrigin

func (q *Queries) GetForkOrigin(ctx context.Context, id uuid.UUID) (GetForkOriginRow, error)

What a fork's read says of its origin: the origin's path and the version the fork was taken from, and whether the origin can still be read by anyone (public, not deleted and not blocked), which is when a page may link it.

func (*Queries) GetHandle

func (q *Queries) GetHandle(ctx context.Context, handle string) (Handle, error)

func (*Queries) GetInvitationByToken

func (q *Queries) GetInvitationByToken(ctx context.Context, tokenSha256 []byte) (GetInvitationByTokenRow, error)

Whether the invited address is at one of the organization's DNS-verified domains travels with the invitation: it decides both whether the offer was mailed and whether accepting confirms the address.

func (*Queries) GetKnowledgeOwnerSalt

func (q *Queries) GetKnowledgeOwnerSalt(ctx context.Context, arg GetKnowledgeOwnerSaltParams) ([]byte, error)

func (*Queries) GetKnowledgePack

func (q *Queries) GetKnowledgePack(ctx context.Context, arg GetKnowledgePackParams) (KnowledgePack, error)

func (*Queries) GetKnowledgePackByObject

func (q *Queries) GetKnowledgePackByObject(ctx context.Context, arg GetKnowledgePackByObjectParams) (KnowledgePack, error)

The scan job's read: the pack whose current tree is this object.

func (*Queries) GetKnowledgePackForUpdate

func (q *Queries) GetKnowledgePackForUpdate(ctx context.Context, arg GetKnowledgePackForUpdateParams) (KnowledgePack, error)

func (*Queries) GetMCPServerScan

func (q *Queries) GetMCPServerScan(ctx context.Context, arg GetMCPServerScanParams) (McpServerScan, error)

MCP server vulnerability scanning.

func (*Queries) GetMembership

func (q *Queries) GetMembership(ctx context.Context, arg GetMembershipParams) (Membership, error)

func (*Queries) GetOrgByDomain

func (q *Queries) GetOrgByDomain(ctx context.Context, domain string) (GetOrgByDomainRow, error)

The organization a domain belongs to: recorded at its creation, or verified over DNS by it. One organization per domain spans both facts, so a creation at a DNS-verified domain and a verification of another organization's creation domain are both refused by the API against this lookup. A decommissioned organization has released its domain (both columns are cleared by the erasure), so it never matches.

func (*Queries) GetOrgByHandle

func (q *Queries) GetOrgByHandle(ctx context.Context, handle string) (GetOrgByHandleRow, error)

verified_domains is every domain the organization proved control of over DNS (domain_claims.verified_at), oldest first: the invitation door reads it.

func (*Queries) GetOrgByID

func (q *Queries) GetOrgByID(ctx context.Context, id uuid.UUID) (GetOrgByIDRow, error)

func (*Queries) GetOrgReportDesign added in v0.7.5

func (q *Queries) GetOrgReportDesign(ctx context.Context, arg GetOrgReportDesignParams) (OrgReportDesign, error)

One design of the organization's, with its images; another organization's id is no rows.

func (*Queries) GetOrgReportDesignByName added in v0.7.5

func (q *Queries) GetOrgReportDesignByName(ctx context.Context, arg GetOrgReportDesignByNameParams) (OrgReportDesign, error)

The organization's design of a name, compared without regard to case, with its images: what a run that names one reads.

func (*Queries) GetOrgState

func (q *Queries) GetOrgState(ctx context.Context, id uuid.UUID) (GetOrgStateRow, error)

What the organization's state permits, for the one gate the API, the git door and the membership chokepoint consult.

func (*Queries) GetOrgWhereUserIsLastAdmin

func (q *Queries) GetOrgWhereUserIsLastAdmin(ctx context.Context, userID uuid.UUID) (string, error)

The erasure guard: an account that is the only active admin of an organization that still exists cannot be erased until another admin is in place. Counts the way CountOrgAdmins does.

func (*Queries) GetPATByHash

func (q *Queries) GetPATByHash(ctx context.Context, tokenSha256 []byte) (Pat, error)

func (*Queries) GetPendingOrgCreatedBy

func (q *Queries) GetPendingOrgCreatedBy(ctx context.Context, createdBy *uuid.UUID) (string, error)

At most one exists per creator (the unique partial index).

func (*Queries) GetPendingReviewItemForVersion

func (q *Queries) GetPendingReviewItemForVersion(ctx context.Context, versionID uuid.UUID) (ReviewItem, error)

func (*Queries) GetPolicyForOrg

func (q *Queries) GetPolicyForOrg(ctx context.Context, orgID *uuid.UUID) (Policy, error)

func (*Queries) GetPreviousPublishedVersion

func (q *Queries) GetPreviousPublishedVersion(ctx context.Context, arg GetPreviousPublishedVersionParams) (AgentVersion, error)

func (*Queries) GetRepo

func (q *Queries) GetRepo(ctx context.Context, id uuid.UUID) (Repo, error)

func (*Queries) GetReviewItem

func (q *Queries) GetReviewItem(ctx context.Context, id uuid.UUID) (ReviewItem, error)

func (*Queries) GetReviewItemDetail

func (q *Queries) GetReviewItemDetail(ctx context.Context, id uuid.UUID) (GetReviewItemDetailRow, error)

func (*Queries) GetRulesetAttestation

func (q *Queries) GetRulesetAttestation(ctx context.Context, bundleDigest string) (RulesetAttestation, error)

The ruleset attestation to serve for a bundle: the one the active key signed. None when the active key's holder has not started with this bundle yet; an envelope by a retired key is never served, because the key set advertises retired keys only for version attestations.

func (*Queries) GetRulesetByID

func (q *Queries) GetRulesetByID(ctx context.Context, id uuid.UUID) (RulesetRelease, error)

func (*Queries) GetRulesetBySemver

func (q *Queries) GetRulesetBySemver(ctx context.Context, semver string) (RulesetRelease, error)

func (*Queries) GetRulesetReleaseBySemver

func (q *Queries) GetRulesetReleaseBySemver(ctx context.Context, semver string) (RulesetRelease, error)

Ruleset releases (POST /platform/ruleset-releases). The insert lives in scanning.sql (the pipeline owns it); this is the read side the platform endpoint needs to make re-registration idempotent.

func (*Queries) GetSSHKeyByFingerprint

func (q *Queries) GetSSHKeyByFingerprint(ctx context.Context, fingerprint string) (UserSshKey, error)

func (*Queries) GetScanResultCache

func (q *Queries) GetScanResultCache(ctx context.Context, arg GetScanResultCacheParams) (ScanResultCache, error)

func (*Queries) GetScanRun

func (q *Queries) GetScanRun(ctx context.Context, id uuid.UUID) (ScanRun, error)

func (*Queries) GetSessionByHash

func (q *Queries) GetSessionByHash(ctx context.Context, tokenSha256 []byte) (Session, error)

func (*Queries) GetSigningKey

func (q *Queries) GetSigningKey(ctx context.Context, keyID string) (SigningKey, error)

func (*Queries) GetSocialIdentity

func (q *Queries) GetSocialIdentity(ctx context.Context, subject string) (Identity, error)

Social login has no sso_connection: the subject is namespaced by provider ("google:1234") and unique on its own.

func (*Queries) GetTeam

func (q *Queries) GetTeam(ctx context.Context, arg GetTeamParams) (Team, error)

func (*Queries) GetTrustedDeviceByHash

func (q *Queries) GetTrustedDeviceByHash(ctx context.Context, arg GetTrustedDeviceByHashParams) (GetTrustedDeviceByHashRow, error)

GetTrustedDeviceByHash answers "is this cookie this user's, and is it still live?" in one statement. Scoped by user_id as well as the hash, so "not mine" and "does not exist" collapse into zero rows in the database rather than in a branch above it — there is no lookup that could leak another user's record, and no path where a valid token for someone else is distinguished from an invalid one. Expiry and revocation are filtered here too, so a row the sweep has not reached yet behaves exactly like one it has.

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)

func (*Queries) GetUserByHandle

func (q *Queries) GetUserByHandle(ctx context.Context, handle string) (GetUserByHandleRow, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id uuid.UUID) (GetUserByIDRow, error)

func (*Queries) GetUserNotificationSettings

func (q *Queries) GetUserNotificationSettings(ctx context.Context, userID uuid.UUID) (UserNotificationSetting, error)

Notification settings.

func (*Queries) GetUserPendingOrg

func (q *Queries) GetUserPendingOrg(ctx context.Context, userID uuid.UUID) (GetUserPendingOrgRow, error)

The organization a person is waiting to be approved by, for GET /user's pendingOrg: every page and client says it until an admin approves or declines. Active organizations only: a suspended one is absent to everyone, its pending members included, and one in its hold can approve nobody, so a notice that its admins have been asked would promise what cannot happen.

func (*Queries) GetUserReportDesign added in v0.7.4

func (q *Queries) GetUserReportDesign(ctx context.Context, arg GetUserReportDesignParams) (UserReportDesign, error)

One design of the account's, with its images; another account's id is no rows.

func (*Queries) GetUserReportDesignDefault added in v0.7.4

func (q *Queries) GetUserReportDesignDefault(ctx context.Context, userID uuid.UUID) (UserReportDesign, error)

The account's default design, with its images; none is no rows.

func (*Queries) GetVersion

func (q *Queries) GetVersion(ctx context.Context, arg GetVersionParams) (AgentVersion, error)

func (*Queries) GetVersionByID

func (q *Queries) GetVersionByID(ctx context.Context, id uuid.UUID) (AgentVersion, error)

func (*Queries) GetVersionForUpdate

func (q *Queries) GetVersionForUpdate(ctx context.Context, id uuid.UUID) (AgentVersion, error)

func (*Queries) GetVoice

func (q *Queries) GetVoice(ctx context.Context, userID uuid.UUID) (Voice, error)

func (*Queries) GetVoiceForUpdate

func (q *Queries) GetVoiceForUpdate(ctx context.Context, userID uuid.UUID) (Voice, error)

func (*Queries) GetVoiceVersion

func (q *Queries) GetVoiceVersion(ctx context.Context, id uuid.UUID) (VoiceVersion, error)

func (*Queries) GetVoiceVersionInSlot

func (q *Queries) GetVoiceVersionInSlot(ctx context.Context, arg GetVoiceVersionInSlotParams) (VoiceVersion, error)

func (*Queries) GetWebhookDeliveryWithEndpoint

func (q *Queries) GetWebhookDeliveryWithEndpoint(ctx context.Context, id uuid.UUID) (GetWebhookDeliveryWithEndpointRow, error)

func (*Queries) GetWebhookEndpoint

func (q *Queries) GetWebhookEndpoint(ctx context.Context, arg GetWebhookEndpointParams) (WebhookEndpoint, error)

func (*Queries) HasSigningKeyHandover added in v0.7.10

func (q *Queries) HasSigningKeyHandover(ctx context.Context, arg HasSigningKeyHandoverParams) (bool, error)

func (*Queries) HoldsRelease

func (q *Queries) HoldsRelease(ctx context.Context, arg HoldsReleaseParams) (bool, error)

Whether the caller holds a release of the agent, whatever its visibility, retired or deleted state now: an account install of theirs names it, or a version of it that was ever published has the archive digest they present.

func (*Queries) InsertAuditEvent

func (q *Queries) InsertAuditEvent(ctx context.Context, arg InsertAuditEventParams) error

Append-only audit log.

func (*Queries) InsertFinding

func (q *Queries) InsertFinding(ctx context.Context, arg InsertFindingParams) (Finding, error)

func (*Queries) InsertLiveVoiceVersion

func (q *Queries) InsertLiveVoiceVersion(ctx context.Context, arg InsertLiveVoiceVersionParams) (VoiceVersion, error)

A version made live without a review of its own: a restore of the previous version, reviewed under the question set in use now.

func (*Queries) InsertPendingVoiceVersion

func (q *Queries) InsertPendingVoiceVersion(ctx context.Context, arg InsertPendingVoiceVersionParams) (VoiceVersion, error)

A new version for review. The pending one it replaces, if any, is deleted first in the same transaction (one pending version per person).

func (*Queries) InsertRedTeamReport

func (q *Queries) InsertRedTeamReport(ctx context.Context, arg InsertRedTeamReportParams) (RedteamReport, error)

Red-team reports: written by the scheduled job, read by the staff console. Report-only; nothing on the publish path reads it.

func (*Queries) InsertRulesetAttestation

func (q *Queries) InsertRulesetAttestation(ctx context.Context, arg InsertRulesetAttestationParams) error

The signer stores the ruleset attestation for the bundle it carries at start; a row already there for that digest and key stays.

func (*Queries) InsertSigningKeyHandover added in v0.7.10

func (q *Queries) InsertSigningKeyHandover(ctx context.Context, arg InsertSigningKeyHandoverParams) (int64, error)

A handover is written once per pair: a second role starting on the same new key, or a restart, finds it there.

func (*Queries) InsertVersionMCPServer

func (q *Queries) InsertVersionMCPServer(ctx context.Context, arg InsertVersionMCPServerParams) error

func (*Queries) IsAgentStarred

func (q *Queries) IsAgentStarred(ctx context.Context, arg IsAgentStarredParams) (bool, error)

func (*Queries) LatestEmailVerificationAt

func (q *Queries) LatestEmailVerificationAt(ctx context.Context, userID uuid.UUID) (time.Time, error)

When the account's newest verification link was made, or the epoch when it has none (for the five-minute limit).

func (*Queries) LatestFinishedScanRunForVersion

func (q *Queries) LatestFinishedScanRunForVersion(ctx context.Context, versionID uuid.UUID) (ScanRun, error)

The newest run of a version that has finished, whatever its outcome: what a report describes while a later run is still going.

func (*Queries) LatestRedTeamReportForBundle

func (q *Queries) LatestRedTeamReportForBundle(ctx context.Context, bundleDigest string) (RedteamReport, error)

func (*Queries) LatestRuleset

func (q *Queries) LatestRuleset(ctx context.Context) (RulesetRelease, error)

func (*Queries) LatestScanRunForVersion

func (q *Queries) LatestScanRunForVersion(ctx context.Context, versionID uuid.UUID) (ScanRun, error)

func (*Queries) ListAbuseReports

func (q *Queries) ListAbuseReports(ctx context.Context, arg ListAbuseReportsParams) ([]ListAbuseReportsRow, error)

func (*Queries) ListAccountInstalls

func (q *Queries) ListAccountInstalls(ctx context.Context, userID uuid.UUID) ([]ListAccountInstallsRow, error)

The caller's records, newest change first, with the ref each names today. The handler composes the rest through the read seam every agent route takes, and falls back to the stored ref for one it cannot read.

func (*Queries) ListActiveUserSessions

func (q *Queries) ListActiveUserSessions(ctx context.Context, userID uuid.UUID) ([]ListActiveUserSessionsRow, error)

Session-management queries behind GET/DELETE /user/sessions. Distinct from the auth-path queries in auth.sql: those establish and touch the credential, these let a user see and revoke their own sessions. ListActiveUserSessions returns the caller's live sessions, newest activity first. Expired and revoked rows are excluded — a session list is a list of ways someone can still act as you, not a history.

func (*Queries) ListActiveWebhookEndpointsForEvent

func (q *Queries) ListActiveWebhookEndpointsForEvent(ctx context.Context, arg ListActiveWebhookEndpointsForEventParams) ([]WebhookEndpoint, error)

func (*Queries) ListAdvisoriesFeed

func (q *Queries) ListAdvisoriesFeed(ctx context.Context, arg ListAdvisoriesFeedParams) ([]ListAdvisoriesFeedRow, error)

The global feed: published advisories against PUBLIC agents, newest first, keyset-paged on (published_at, id) so the cursor is stable while new advisories arrive at the head.

func (*Queries) ListAdvisoriesForAgent

func (q *Queries) ListAdvisoriesForAgent(ctx context.Context, agentID uuid.UUID) ([]Advisory, error)

Published advisories only, as the feed and the permalink serve: a row with no publication time is not yet anyone's to read.

func (*Queries) ListAgentActivity

func (q *Queries) ListAgentActivity(ctx context.Context, arg ListAgentActivityParams) ([]ListAgentActivityRow, error)

GET /agents/{ns}/{name}/activity. Entries targeting the agent itself, plus entries targeting any of its versions (joined so the version string can be surfaced). public_actions, when non-empty, restricts the result to the public-safe subset.

func (*Queries) ListAgentGrants

func (q *Queries) ListAgentGrants(ctx context.Context, agentID uuid.UUID) ([]ListAgentGrantsRow, error)

func (*Queries) ListAgentTeamGrantsForUser

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

func (*Queries) ListAgentsByNamespace

func (q *Queries) ListAgentsByNamespace(ctx context.Context, arg ListAgentsByNamespaceParams) ([]ListAgentsByNamespaceRow, error)

A suspended or erased organization's agents are absent; the handler answers 404 for the namespace before this runs, and the predicate keeps the listing honest on its own. A deleted agent's tombstone is never listed. The publisher's page searches (query: name and summary, case-folded), filters by state (active, retired; empty is both) and by origin (forks: only, none; empty is both) and sorts (name, newest, installs, submitted — the last submission of any version); the trailing keys keep every ordering total.

func (*Queries) ListAgentsByTag

func (q *Queries) ListAgentsByTag(ctx context.Context, arg ListAgentsByTagParams) ([]ListAgentsByTagRow, error)

GET /tags/{tag}: public agents whose LATEST PUBLISHED manifest carries the tag (V8 tags are lowercase [a-z0-9-]). Keyset-paged on (created_at, id) so the cursor is stable across inserts.

func (*Queries) ListApprovedReviewsAwaitingPublish

func (q *Queries) ListApprovedReviewsAwaitingPublish(ctx context.Context, grace pgtype.Interval) ([]uuid.UUID, error)

Approvals a keyless role handed to the worker whose version has not been published yet: marked publish_pending, still approved, the version still in needs_review. The same conditions PublishApproved checks; the watchdog publishes them, so a lost enqueue delays a publish.

func (*Queries) ListAttestationsLackingSignature

Attestations whose envelope carries no signature by the given key (`key_match` is `[{"keyid": "<id>"}]`), with the version row's facts the sweep checks the statement against before vouching for it. Keyset paging: the sweep moves rows out of the set it pages over.

func (*Queries) ListDecidedFindings

func (q *Queries) ListDecidedFindings(ctx context.Context, arg ListDecidedFindingsParams) ([]ListDecidedFindingsRow, error)

The findings a person has decided on for a version, by scanner, file and line: every finding of a run that finished before the version's latest approved review. None for a version no person approved.

func (*Queries) ListDecommissionedOrgsWithLiveVersions

func (q *Queries) ListDecommissionedOrgsWithLiveVersions(ctx context.Context) ([]ListDecommissionedOrgsWithLiveVersionsRow, error)

Organizations already flipped to decommissioned whose releases are not yet all terminal: the sweep resumes their second phase (the yanks, the blobs, the repositories) after an interruption.

func (*Queries) ListDomainClaims

func (q *Queries) ListDomainClaims(ctx context.Context, orgID uuid.UUID) ([]DomainClaim, error)

func (*Queries) ListFindings

func (q *Queries) ListFindings(ctx context.Context, scanRunID uuid.UUID) ([]Finding, error)

func (*Queries) ListHeldVersionsForRedo

func (q *Queries) ListHeldVersionsForRedo(ctx context.Context, arg ListHeldVersionsForRedoParams) ([]uuid.UUID, error)

The review queue a new ruleset redoes: versions in needs_review whose item is still pending (no person has decided), that no finished run of this ruleset has judged yet. The last condition makes the redo idempotent: a redelivered job, or a second start on the same ruleset, finds nothing. Unscanned versions and pipeline_skip agents are left out, as from the catalogue sweep.

func (*Queries) ListKnowledgeObjectsOfPack

func (q *Queries) ListKnowledgeObjectsOfPack(ctx context.Context, packID uuid.UUID) ([]string, error)

func (*Queries) ListKnowledgePackSizes

func (q *Queries) ListKnowledgePackSizes(ctx context.Context, arg ListKnowledgePackSizesParams) ([]ListKnowledgePackSizesRow, error)

What platform staff may see of an owner's packs: names and sizes, never a byte of content, a digest or a key.

func (*Queries) ListKnowledgePacks

func (q *Queries) ListKnowledgePacks(ctx context.Context, arg ListKnowledgePacksParams) ([]KnowledgePack, error)

func (*Queries) ListMCPServerScansCheckedBefore

func (q *Queries) ListMCPServerScansCheckedBefore(ctx context.Context, arg ListMCPServerScansCheckedBeforeParams) ([]McpServerScan, error)

func (*Queries) ListOpenFindings

func (q *Queries) ListOpenFindings(ctx context.Context, scanRunID uuid.UUID) ([]Finding, error)

func (*Queries) ListOpenInvitations

func (q *Queries) ListOpenInvitations(ctx context.Context, orgID uuid.UUID) ([]ListOpenInvitationsRow, error)

func (*Queries) ListOpenMCPDependencyAlertsForAgent

func (q *Queries) ListOpenMCPDependencyAlertsForAgent(ctx context.Context, agentID uuid.UUID) ([]ListOpenMCPDependencyAlertsForAgentRow, error)

func (*Queries) ListOpenMCPDependencyAlertsForSubmitter

func (q *Queries) ListOpenMCPDependencyAlertsForSubmitter(ctx context.Context, submittedBy uuid.UUID) ([]ListOpenMCPDependencyAlertsForSubmitterRow, error)

func (*Queries) ListOpenMCPDependencyAlertsForVersion

func (q *Queries) ListOpenMCPDependencyAlertsForVersion(ctx context.Context, versionID uuid.UUID) ([]McpDependencyAlert, error)

func (*Queries) ListOrgAdminIDs

func (q *Queries) ListOrgAdminIDs(ctx context.Context, orgID uuid.UUID) ([]uuid.UUID, error)

The active administrators of an organization, for a message an extension addresses to "the admins": active memberships of active accounts only, the same two conditions ListOrgAdminsForMail and the last-admin guard carry — a pending admin holds nothing yet, a suspended one holds nothing any more, and neither is told the organization's business.

func (*Queries) ListOrgAdminsForMail

func (q *Queries) ListOrgAdminsForMail(ctx context.Context, orgID uuid.UUID) ([]ListOrgAdminsForMailRow, error)

The organization's active admins with what a mail to them needs; whether each may be written to — a verified address, the orgInvites preference — is notify.AllowsEmail's decision, not this query's.

func (*Queries) ListOrgAgentsForErasure

func (q *Queries) ListOrgAgentsForErasure(ctx context.Context, namespaceID uuid.UUID) ([]ListOrgAgentsForErasureRow, error)

func (*Queries) ListOrgAuditEvents

func (q *Queries) ListOrgAuditEvents(ctx context.Context, arg ListOrgAuditEventsParams) ([]ListOrgAuditEventsRow, error)

func (*Queries) ListOrgAuditExportKeys

func (q *Queries) ListOrgAuditExportKeys(ctx context.Context, orgID uuid.UUID) ([]*string, error)

func (*Queries) ListOrgMembers

func (q *Queries) ListOrgMembers(ctx context.Context, orgID uuid.UUID) ([]ListOrgMembersRow, error)

func (*Queries) ListOrgReportDesigns added in v0.7.5

func (q *Queries) ListOrgReportDesigns(ctx context.Context, orgID uuid.UUID) ([]ListOrgReportDesignsRow, error)

An organization's house designs: up to ten report designs per organization, each a theme document version 3 validated by pkg/reportdesign first, with its images beside it, named uniquely within the organization and with no default. The organization's designs, oldest first, without their images: what a console lists and a run's chooser reads.

func (*Queries) ListOrgVersionsForErasure

func (q *Queries) ListOrgVersionsForErasure(ctx context.Context, namespaceID uuid.UUID) ([]ListOrgVersionsForErasureRow, error)

The erasure that ends an organization's decommission hold. Each statement removes one kind of thing the organization owned; the job in internal/api/handlers_org_lifecycle.go runs them in one transaction under the organization's row lock, which also flips the row to decommissioned and releases the handle — the point of no return, taken first — and then yanks the versions and deletes the blobs and repositories, which it can resume if interrupted. Version rows are immutable and are never deleted: the agents are retired private under the released handle instead, the way an erased person's are.

func (*Queries) ListOrgsDueForErasure

func (q *Queries) ListOrgsDueForErasure(ctx context.Context) ([]ListOrgsDueForErasureRow, error)

func (*Queries) ListOrgsWithUnnotifiedPending

func (q *Queries) ListOrgsWithUnnotifiedPending(ctx context.Context, orgID *uuid.UUID) ([]ListOrgsWithUnnotifiedPendingRow, error)

The organizations the daily digest has something to say to, or the one named: active ones with a pending member no admin has been mailed about. A suspended or held organization gets no digest; its admins can add nobody.

func (*Queries) ListPATs

func (q *Queries) ListPATs(ctx context.Context, userID uuid.UUID) ([]ListPATsRow, error)

func (*Queries) ListPendingMembersUnnotified

func (q *Queries) ListPendingMembersUnnotified(ctx context.Context, orgID uuid.UUID) ([]ListPendingMembersUnnotifiedRow, error)

One organization's pending members no admin has been mailed about yet, whichever door they came through. Read under the organization's row lock by the digest, so two runs at once cannot both name them.

func (*Queries) ListPersonalNamespaceAgents

func (q *Queries) ListPersonalNamespaceAgents(ctx context.Context, id uuid.UUID) ([]ListPersonalNamespaceAgentsRow, error)

func (*Queries) ListPlatformAuditEvents

func (q *Queries) ListPlatformAuditEvents(ctx context.Context, arg ListPlatformAuditEventsParams) ([]ListPlatformAuditEventsRow, error)

The platform-staff slice: every org plus un-scoped events. Same keyset cursor as the org view so one decoder serves both.

func (*Queries) ListPlatformStaff

func (q *Queries) ListPlatformStaff(ctx context.Context) ([]ListPlatformStaffRow, error)

Every account that is platform staff and active, with its handle and its verified address, lower-cased: what an extension mirrors staff from.

func (*Queries) ListPopularAgentNames

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

Queries the scanner stages need beyond the scan-run bookkeeping in scanning.sql. Kept in their own file so the pipeline's read-only context lookups are obvious to a reviewer. Top-N published public agent names by lifetime installs — the live feed for S8's anti-typosquat compare. Without it the confusable and edit-distance checks compare against an empty list and never fire. Quarantined/blocked agents are excluded: a name nobody should be installing is not a name worth protecting from imitation.

func (*Queries) ListPublishedVersionsForRescan

Keyset, not LIMIT/OFFSET: the sweep quarantines rows out of `published` as it goes, so an offset-paged sweep would pass over one not-yet-rescanned version per row it acted on. The cursor is the primary key, which no sweep action changes. A version published without a scan, and every version of an agent whose administrator has set pipeline_skip, is not rescanned: a rescan would put a report on a version whose verdict is "unscanned", and the flag says the organization has taken the pipeline off this agent.

func (*Queries) ListPublishedVersionsUsingMCPServer

func (q *Queries) ListPublishedVersionsUsingMCPServer(ctx context.Context, arg ListPublishedVersionsUsingMCPServerParams) ([]AgentVersion, error)

The MCP sweep leaves out a version published without a scan and every version of an agent with pipeline_skip set: no alert is opened on what the organization chose not to have scanned.

func (*Queries) ListPublishedVersionsWithoutAttestation

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

A published version with no attestation row is the shape a signing failure after the transition leaves; the attest sweep signs each from its latest finished scan run. A version published without a scan has no attestation to backfill: it attests nothing, and is left out here as it is by every sweep.

func (*Queries) ListRedTeamReports

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

func (*Queries) ListResolvableVersions

func (q *Queries) ListResolvableVersions(ctx context.Context, agentID uuid.UUID) ([]AgentVersion, error)

Resolution set: published resolves by range, yanked resolves only by exact pin. quarantined and blocked are excluded here by construction — a version the platform has disabled must never come back from a resolve.

func (*Queries) ListRetiredSigningKeysInUse

func (q *Queries) ListRetiredSigningKeysInUse(ctx context.Context) ([]SigningKey, error)

The retired keys a verifier still needs: those with at least one attestation carrying their signature. A key that signed nothing (a test process, an aborted start) has nothing for a client to verify and is not advertised.

func (*Queries) ListReviewQueue

func (q *Queries) ListReviewQueue(ctx context.Context, arg ListReviewQueueParams) ([]ListReviewQueueRow, error)

func (*Queries) ListRulesetReleases

func (q *Queries) ListRulesetReleases(ctx context.Context) ([]RulesetRelease, error)

The staff console's release history, newest first.

func (*Queries) ListSSHKeys

func (q *Queries) ListSSHKeys(ctx context.Context, userID uuid.UUID) ([]UserSshKey, error)

func (*Queries) ListSigningKeyHandovers added in v0.7.10

func (q *Queries) ListSigningKeyHandovers(ctx context.Context) ([]SigningKeyHandover, error)

Every handover, oldest first: the chain a client walks.

func (*Queries) ListStaffOrgMembersNotStaff

func (q *Queries) ListStaffOrgMembersNotStaff(ctx context.Context, orgID uuid.UUID) ([]string, error)

Active members of the staff organization who are not platform staff: an address outside its domain or unverified, or an account that is not active. Reported at start-up, never removed.

func (*Queries) ListStaffSyncCandidates

func (q *Queries) ListStaffSyncCandidates(ctx context.Context, orgID uuid.UUID) ([]uuid.UUID, error)

The accounts whose platform_staff the staff rule could change: every account flagged today, and every active member of the staff organization. The start-up resync recomputes exactly these.

func (*Queries) ListStageResults

func (q *Queries) ListStageResults(ctx context.Context, scanRunID uuid.UUID) ([]ScanStageResult, error)

func (*Queries) ListStalledKnowledgeScans

func (q *Queries) ListStalledKnowledgeScans(ctx context.Context, cutoff time.Time) ([]ListStalledKnowledgeScansRow, error)

Packs still scanning since before the cutoff: a scan never queued, or a job lost. The sweep queues their scans again.

func (*Queries) ListStalledVoiceReviews

func (q *Queries) ListStalledVoiceReviews(ctx context.Context, cutoff time.Time) ([]ListStalledVoiceReviewsRow, error)

Versions still in review whose last try is older than the cutoff: a job that ran out of attempts, or was lost. The sweep queues them again.

func (*Queries) ListStuckForks

func (q *Queries) ListStuckForks(ctx context.Context, arg ListStuckForksParams) ([]uuid.UUID, error)

Forks whose copy never finished (a job out of retries, a worker without the git volume), for the watchdog.

func (*Queries) ListStuckScanningVersions

func (q *Queries) ListStuckScanningVersions(ctx context.Context, arg ListStuckScanningVersionsParams) ([]AgentVersion, error)

Versions stuck mid-scan past the 30-minute cap. The watchdog routes these to review: a scan job that died terminally must never leave a version parked in `scanning` forever.

func (*Queries) ListStuckSubmittedVersions

func (q *Queries) ListStuckSubmittedVersions(ctx context.Context, arg ListStuckSubmittedVersionsParams) ([]AgentVersion, error)

A git-tag submission recorded by a role that hands the archive write to a worker stays `submitted` until the worker stores it; one still there past the cap was never stored.

func (*Queries) ListSubagentDependents added in v0.6.1002

func (q *Queries) ListSubagentDependents(ctx context.Context, ref string) ([]ListSubagentDependentsRow, error)

The published versions of persistent releases whose manifest names the given namespace/name among its subagents (dependencies.agents), for the advisory their holders get when that release leaves published.

func (*Queries) ListTeamMembers

func (q *Queries) ListTeamMembers(ctx context.Context, teamID uuid.UUID) ([]ListTeamMembersRow, error)

func (*Queries) ListTeams

func (q *Queries) ListTeams(ctx context.Context, orgID uuid.UUID) ([]Team, error)

func (*Queries) ListUserActivity

func (q *Queries) ListUserActivity(ctx context.Context, arg ListUserActivityParams) ([]ListUserActivityRow, error)

GET /user/activity: the audit events the caller performed — sign-ins, tokens and keys, profile changes, publishes, reviews — newest first, keyset-paged like the agent feed. ip is NULL for an event no request built (an extension's audited action), which the feed shows as no address rather than failing.

func (q *Queries) ListUserDirectoryLinks(ctx context.Context, arg ListUserDirectoryLinksParams) ([]ListUserDirectoryLinksRow, error)

The directory accounts the account is linked to by sign-ins through the sign-in provider whose id is provider_id, oldest first: each one's subject with "<provider_id>:" stripped (the uid the directory reports for it), and the directory's own id for it where one was recorded (0 otherwise). Erasure takes them all.

func (*Queries) ListUserMemberships

func (q *Queries) ListUserMemberships(ctx context.Context, userID uuid.UUID) ([]ListUserMembershipsRow, error)

The caller's org roles, for the principal every request is authorized against. ACTIVE memberships only: a pending member — provisioned by the IdP, or folded in from the domain — is waiting for an admin and holds nothing of the organization until then, so their row must not reach auth.Check as a role.

func (*Queries) ListUserMembershipsWithHandles

func (q *Queries) ListUserMembershipsWithHandles(ctx context.Context, userID uuid.UUID) ([]ListUserMembershipsWithHandlesRow, error)

func (*Queries) ListUserReportDesigns added in v0.7.4

func (q *Queries) ListUserReportDesigns(ctx context.Context, userID uuid.UUID) ([]ListUserReportDesignsRow, error)

The report design library: up to ten designs per account, each a theme document version 3 validated by pkg/reportdesign first, with its images beside it, and one of them the default. The account's designs, oldest first, without their images: what the library page lists.

func (*Queries) ListUserSignInSubjects

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

The subjects the account signs in with at individual providers ("<provider>:<sub>"), oldest first.

func (*Queries) ListUserSubmissions added in v0.7.9

func (q *Queries) ListUserSubmissions(ctx context.Context, arg ListUserSubmissionsParams) ([]ListUserSubmissionsRow, error)

The versions a person submitted, newest first, with the agent they belong to and, for one waiting in review, when its review item opened. Keyset-paged on (created_at, id); a status narrows the list when given.

func (*Queries) ListUserTeamIDs

func (q *Queries) ListUserTeamIDs(ctx context.Context, userID uuid.UUID) ([]uuid.UUID, error)

func (*Queries) ListUsersAtDomainForFoldIn

func (q *Queries) ListUsersAtDomainForFoldIn(ctx context.Context, arg ListUsersAtDomainForFoldInParams) ([]ListUsersAtDomainForFoldInRow, error)

The accounts the fold-in sweep considers when an organization gains a domain: a verified address at the domain — the part after the last @, a trailing dot dropped, the way maildomains.Of reads it — an active account, a member of nothing, and not declined by this organization before. The sign-in step applies the same rules one person at a time (registry.writePending).

func (*Queries) ListVersions

func (q *Queries) ListVersions(ctx context.Context, agentID uuid.UUID) ([]AgentVersion, error)

func (*Queries) ListVersionsByStatus

func (q *Queries) ListVersionsByStatus(ctx context.Context, arg ListVersionsByStatusParams) ([]AgentVersion, error)

func (*Queries) ListVersionsShippingKnowledge

func (q *Queries) ListVersionsShippingKnowledge(ctx context.Context, agentID uuid.UUID) ([]ListVersionsShippingKnowledgeRow, error)

The versions of an agent that ship knowledge packs and have not been yanked, rejected or withdrawn: the releases whose packs are, or can still become, readable by whoever can download them. The pack names are the contract's.

func (*Queries) ListVoiceVersions

func (q *Queries) ListVoiceVersions(ctx context.Context, userID uuid.UUID) ([]VoiceVersion, error)

func (*Queries) ListWebhookDeliveries

func (q *Queries) ListWebhookDeliveries(ctx context.Context, arg ListWebhookDeliveriesParams) ([]WebhookDelivery, error)

Keyset-paged on (created_at, id) so the cursor stays stable while new deliveries land at the head.

func (*Queries) ListWebhookEndpoints

func (q *Queries) ListWebhookEndpoints(ctx context.Context, orgID uuid.UUID) ([]WebhookEndpoint, error)

func (*Queries) LockKey

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

A transaction-scoped advisory lock on a name, for the rules that span more than one table or row and so have no constraint to hold them: a domain across orgs.domain and the verified claims, a person's once-a-day request for access. Released with the transaction.

func (*Queries) LockNamespace

func (q *Queries) LockNamespace(ctx context.Context, id uuid.UUID) error

LockNamespace serialises the per-namespace counts — the agent quota and the private-agent cap — inside the transaction that inserts or flips: the count and the write commit together, as the seat cap's do under the org row's lock.

func (*Queries) LockOrg

func (q *Queries) LockOrg(ctx context.Context, id uuid.UUID) error

Serialises the membership changes of one organization inside a transaction (the last-admin guard counts under this lock).

func (*Queries) LockUser

func (q *Queries) LockUser(ctx context.Context, id uuid.UUID) error

Serialises the membership doors of one PERSON across organizations: the one-organization-per-person count runs under this lock, after the organization's (always in that order), so two organizations admitting the same person at once cannot both count zero.

func (*Queries) LockUserForReportDesigns added in v0.7.4

func (q *Queries) LockUserForReportDesigns(ctx context.Context, id uuid.UUID) error

Serializes an account's creates and default moves, so the library's bound and its one default hold under two at once.

func (*Queries) LockUserRow

func (q *Queries) LockUserRow(ctx context.Context, id uuid.UUID) (uuid.UUID, error)

Serializes the activation mail per account: the five-minute limit is read and the new link written under this lock, so two replicas answering at once send one mail, not two.

func (*Queries) MarkDomainClaimVerified

func (q *Queries) MarkDomainClaimVerified(ctx context.Context, arg MarkDomainClaimVerifiedParams) error

func (*Queries) MarkEmailVerified

func (q *Queries) MarkEmailVerified(ctx context.Context, id uuid.UUID) error

func (*Queries) MarkForkReady

func (q *Queries) MarkForkReady(ctx context.Context, id uuid.UUID) error

A fork whose first version is recorded is ready, from copying or from a failure the watchdog declared while the copy was still running.

func (*Queries) MarkInvitationAccepted

func (q *Queries) MarkInvitationAccepted(ctx context.Context, arg MarkInvitationAcceptedParams) (int64, error)

Single use: the guard on accepted_at is what makes a second accept with the same token a no-op rather than a second membership.

func (*Queries) MarkMCPDependencyAlertNotified

func (q *Queries) MarkMCPDependencyAlertNotified(ctx context.Context, id uuid.UUID) error

func (*Queries) MarkPendingMembersNotified

func (q *Queries) MarkPendingMembersNotified(ctx context.Context, arg MarkPendingMembersNotifiedParams) (int64, error)

func (*Queries) MarkVersionDrafterRevision

func (q *Queries) MarkVersionDrafterRevision(ctx context.Context, arg MarkVersionDrafterRevisionParams) (int64, error)

The scan proved the version's claimed draft: the source becomes 'drafter-revision', with the S9 baseline it was proved against. Only once, only while scanning, and only for a cli-upload that claimed a draft (the immutability trigger holds the same edge).

func (*Queries) MarkVersionScanSkipped

func (q *Queries) MarkVersionScanSkipped(ctx context.Context, id uuid.UUID) (int64, error)

The version was admitted without a scan: recorded in the same transaction as the submitted → published edge, which refuses a version not so marked. Only a submitted version is marked; the caller requires the one row, so a version that has moved on is never marked.

func (*Queries) MoveVoiceVersionSlot

func (q *Queries) MoveVoiceVersionSlot(ctx context.Context, arg MoveVoiceVersionSlotParams) (int64, error)

func (*Queries) NoteVoiceReview

func (q *Queries) NoteVoiceReview(ctx context.Context, arg NoteVoiceReviewParams) error

A review that could not finish: what it read so far, kept on the version while it stays in review.

func (*Queries) Now

func (q *Queries) Now(ctx context.Context) (time.Time, error)

Health/diagnostic queries.

func (*Queries) OpenMCPDependencyAlert

func (q *Queries) OpenMCPDependencyAlert(ctx context.Context, arg OpenMCPDependencyAlertParams) (McpDependencyAlert, error)

Dependency alerts for declared MCP server versions.

func (*Queries) PassVoiceVersion

func (q *Queries) PassVoiceVersion(ctx context.Context, arg PassVoiceVersionParams) (VoiceVersion, error)

A clean review: the pending version becomes the live one. The caller has moved the live one to previous first.

func (*Queries) PruneAuditPartitions

func (q *Queries) PruneAuditPartitions(ctx context.Context, dollar_1 pgtype.Date) (int32, error)

Retention: drop whole monthly partitions older than the cutoff rather than DELETE rows (the append-only trigger refuses row deletes, and dropping a partition is O(1)). Returns the number of partitions dropped.

func (*Queries) PseudonymizeUser

func (q *Queries) PseudonymizeUser(ctx context.Context, arg PseudonymizeUserParams) error

GDPR erasure: PII is purged, the row survives so audit events and immutable published content keep a stable (now opaque) actor id. The tombstone keeps only a salted hash of the email for abuse-recurrence detection — never the address itself.

func (*Queries) PurgeExpiredIdempotencyKeys

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

func (*Queries) RecomputeAgentLatestPublished

func (q *Queries) RecomputeAgentLatestPublished(ctx context.Context, id uuid.UUID) error

func (*Queries) RecordAdmittedStore

func (q *Queries) RecordAdmittedStore(ctx context.Context, arg RecordAdmittedStoreParams) error

An admission ticket whose operation is being stored, in the storing transaction. A ticket is recorded once; a second store under the same ticket keeps the first row.

func (*Queries) RecordWebhookDeliveryResult

func (q *Queries) RecordWebhookDeliveryResult(ctx context.Context, arg RecordWebhookDeliveryResultParams) error

func (*Queries) RegisterSigningKey

func (q *Queries) RegisterSigningKey(ctx context.Context, arg RegisterSigningKeyParams) (RegisterSigningKeyRow, error)

Signing keys and re-attestation. A signer registers its public key at start. Seeing a key again keeps it current (a rollback to the previous key file is a legitimate rotation too); `inserted` tells the caller this is a key the registry has never signed with.

func (*Queries) ReinstateOrg

func (q *Queries) ReinstateOrg(ctx context.Context, id uuid.UUID) (int64, error)

Back to active from a suspension or from the decommission hold; the erasure that already ran cannot be undone, so decommissioned stays.

func (*Queries) ReleaseHandle

func (q *Queries) ReleaseHandle(ctx context.Context, arg ReleaseHandleParams) error

The handle is retired, not recycled: renaming it to a reserved sentinel keeps the global namespace free of impersonation of a deleted account.

func (*Queries) ReleaseIdempotencyKey

func (q *Queries) ReleaseIdempotencyKey(ctx context.Context, arg ReleaseIdempotencyKeyParams) error

Drops an unfinished claim so a failed request does not poison the key.

func (*Queries) RemoveTeamMember

func (q *Queries) RemoveTeamMember(ctx context.Context, arg RemoveTeamMemberParams) (int64, error)

func (*Queries) ResolveMCPDependencyAlertsForServer

func (q *Queries) ResolveMCPDependencyAlertsForServer(ctx context.Context, arg ResolveMCPDependencyAlertsForServerParams) (int64, error)

func (*Queries) ResolveMCPDependencyAlertsForUnpublishedVersions

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

func (*Queries) ResolveMCPDependencyAlertsForVersion

func (q *Queries) ResolveMCPDependencyAlertsForVersion(ctx context.Context, arg ResolveMCPDependencyAlertsForVersionParams) (int64, error)

func (*Queries) RestoreAgent

func (q *Queries) RestoreAgent(ctx context.Context, id uuid.UUID) (int64, error)

Restore: the visibility the agent had when it was retired. The caller has decided, under the row lock, that it may hold it.

func (*Queries) RetireAgent

func (q *Queries) RetireAgent(ctx context.Context, id uuid.UUID) (int64, error)

Retire: private, the visibility it had kept for Restore. Already retired, nothing moves.

func (*Queries) RetireOrgAgents

func (q *Queries) RetireOrgAgents(ctx context.Context, namespaceID uuid.UUID) (int64, error)

Private, nameless and pointing at no release: with no member left to derive a role and every grant gone, nobody can read them, and the retired handle keeps their path from ever resolving again.

func (*Queries) RetireOtherSigningKeys

func (q *Queries) RetireOtherSigningKeys(ctx context.Context, keyID string) (int64, error)

Every other key is retired by the arrival of the active one: one signer per deployment, so a key that is not it no longer signs.

func (*Queries) RevokeAllPATsForUser

func (q *Queries) RevokeAllPATsForUser(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data: every live token the user holds, org-bound ones included.

func (*Queries) RevokeAllSSHKeysForUser

func (q *Queries) RevokeAllSSHKeysForUser(ctx context.Context, userID uuid.UUID) (int64, error)

Clear-data.

func (*Queries) RevokeOrgBoundPATs

func (q *Queries) RevokeOrgBoundPATs(ctx context.Context, orgID *uuid.UUID) (int64, error)

func (*Queries) RevokeOrgBoundPATsForUser

func (q *Queries) RevokeOrgBoundPATsForUser(ctx context.Context, arg RevokeOrgBoundPATsForUserParams) (int64, error)

func (*Queries) RevokeOtherUserSessions

func (q *Queries) RevokeOtherUserSessions(ctx context.Context, arg RevokeOtherUserSessionsParams) (int64, error)

RevokeOtherUserSessions revokes every live session of a user except the one named by $2 ("sign out everywhere else"). Passing a nil UUID revokes all of them, since no session row has the nil id.

func (*Queries) RevokePAT

func (q *Queries) RevokePAT(ctx context.Context, arg RevokePATParams) (int64, error)

func (*Queries) RevokeSSHKey

func (q *Queries) RevokeSSHKey(ctx context.Context, arg RevokeSSHKeyParams) (int64, error)

func (*Queries) RevokeSession

func (q *Queries) RevokeSession(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) RevokeTrustedDevicesForUser

func (q *Queries) RevokeTrustedDevicesForUser(ctx context.Context, userID uuid.UUID) (int64, error)

RevokeTrustedDevicesForUser revokes every live record of one account. It sits beside RevokeUserSessions in deprovisioning, because a remembered browser is a way back in that outliving the sessions would otherwise leave open.

That deactivation is what makes this load-bearing rather than tidy: it drops the membership, revokes the org-bound PATs and kills the sessions, but it deliberately does not change the account's state, since the person may exist outside the organization. So without this, a deprovisioned user could sign straight back in from a remembered browser and be asked for *less* than before — the second factor skipped — which is the opposite of the guarantee deprovisioning exists to make.

Erasure is the other place access is taken away, and it uses DeleteTrustedDevicesForUser below instead: erasure sets state='deleted', so its rows are already inert as credentials, and what it owes is the removal of the personal data they hold.

The account-facing clear is ClearLiveTrustedDevicesForUser below, which touches live records only so that what it reports matches the count.

func (*Queries) RevokeUserSessionByID

func (q *Queries) RevokeUserSessionByID(ctx context.Context, arg RevokeUserSessionByIDParams) (int64, error)

RevokeUserSessionByID revokes one session, scoped to its owner so a caller can never revoke another user's session by guessing an id. Returns the number of rows changed (0 = not found OR not yours — indistinguishable on purpose).

func (*Queries) RevokeUserSessions

func (q *Queries) RevokeUserSessions(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) RunningScanRunForVersion

func (q *Queries) RunningScanRunForVersion(ctx context.Context, arg RunningScanRunForVersionParams) (ScanRun, error)

An interrupted run is resumed only under the ruleset it was started with: a run of an older ruleset carries that ruleset's findings and policy snapshot, and a new ruleset's scan resuming it would judge a mix of two. Such a run is left as it is; the new scan starts afresh.

func (*Queries) ScrubDecommissionedOrg

func (q *Queries) ScrubDecommissionedOrg(ctx context.Context, id uuid.UUID) (int64, error)

The row stays for the records that point at its id; everything that named the organization, or its founder, goes. The domain is freed here; the handle is released by ReleaseHandle in the same transaction; and created_by is cleared so an organization created awaiting activation (the hosted product's pending state) stops counting as the founder's pending one once it is erased — the unique partial index on (created_by) WHERE activated_at IS NULL would otherwise refuse them a fresh start forever.

func (*Queries) SearchAgents

func (q *Queries) SearchAgents(ctx context.Context, arg SearchAgentsParams) ([]SearchAgentsRow, error)

Public FTS search: weighted tsvector + trigram fuzzy fallback on name, ranked by relevance × install popularity × recency decay. The facets (capability, license, verified) filter on the LATEST PUBLISHED version's manifest/capabilities, so an agent's facets always describe what someone would actually install today. `sort` picks the primary ordering; the trailing keys keep every ordering total (stable pages).

func (*Queries) SearchFacetLicenses

func (q *Queries) SearchFacetLicenses(ctx context.Context, query string) ([]SearchFacetLicensesRow, error)

License facet over the same public corpus, read from the latest published manifest (V7 requires an SPDX id for public publish).

func (*Queries) SearchFacetModes

func (q *Queries) SearchFacetModes(ctx context.Context, query string) ([]SearchFacetModesRow, error)

One row per run mode with the number of public, unblocked agents with a published version that support it; an agent supporting both counts under each. Like the results, an agent with nothing installable is not counted.

func (*Queries) SetAgentLatestPublished

func (q *Queries) SetAgentLatestPublished(ctx context.Context, arg SetAgentLatestPublishedParams) error

func (*Queries) SetAgentNamespace

func (q *Queries) SetAgentNamespace(ctx context.Context, arg SetAgentNamespaceParams) error

Moves an agent between namespaces (deletion with transfer).

func (*Queries) SetAgentQuarantineState

func (q *Queries) SetAgentQuarantineState(ctx context.Context, arg SetAgentQuarantineStateParams) error

func (*Queries) SetAgentReadmeText

func (q *Queries) SetAgentReadmeText(ctx context.Context, arg SetAgentReadmeTextParams) error

Denormalizes the published version's README onto the agent so the weight-C index has something to index (the tsvector trigger fires on this column). Written on publish only: an agent's searchable description should follow what people can actually install, not whatever the last submission happened to contain.

func (*Queries) SetAuditExportRunning

func (q *Queries) SetAuditExportRunning(ctx context.Context, id uuid.UUID) error

func (*Queries) SetFindingVerdict

func (q *Queries) SetFindingVerdict(ctx context.Context, arg SetFindingVerdictParams) error

func (*Queries) SetForkState

func (q *Queries) SetForkState(ctx context.Context, arg SetForkStateParams) (int64, error)

The copy's outcome, from copying only: a fork that is ready or failed stays so.

func (*Queries) SetKnowledgePackExportable

func (q *Queries) SetKnowledgePackExportable(ctx context.Context, arg SetKnowledgePackExportableParams) (KnowledgePack, error)

Whether an organization's members may export its shared pack.

func (*Queries) SetKnowledgeTree

func (q *Queries) SetKnowledgeTree(ctx context.Context, arg SetKnowledgeTreeParams) (KnowledgePack, error)

A new tree is in place and its scan is queued.

func (q *Queries) SetOrgLogo(ctx context.Context, arg SetOrgLogoParams) (*string, error)

Records the logo now served for the organization and returns the key it replaces (NULL for none), so the caller can remove the old object once the row points at the new one. The previous value is read under the row lock in the same statement — a departure from this file's LockOrg-then-write shape, taken so the swap and what it replaced are one round trip and cannot disagree.

func (*Queries) SetOrgReportDesignCoverImage added in v0.7.5

func (q *Queries) SetOrgReportDesignCoverImage(ctx context.Context, arg SetOrgReportDesignCoverImageParams) (OrgReportDesign, error)

func (*Queries) SetOrgReportDesignCustomCover added in v0.7.5

func (q *Queries) SetOrgReportDesignCustomCover(ctx context.Context, arg SetOrgReportDesignCustomCoverParams) (OrgReportDesign, error)
func (q *Queries) SetOrgReportDesignLogo(ctx context.Context, arg SetOrgReportDesignLogoParams) (OrgReportDesign, error)

func (*Queries) SetOrgSSORequired

func (q *Queries) SetOrgSSORequired(ctx context.Context, arg SetOrgSSORequiredParams) error

============================ Enforced SSO ============================

func (*Queries) SetReviewPublishPending

func (q *Queries) SetReviewPublishPending(ctx context.Context, arg SetReviewPublishPendingParams) error

func (*Queries) SetUserCookieAck

func (q *Queries) SetUserCookieAck(ctx context.Context, id uuid.UUID) error

Write-once by intent: re-acknowledging just refreshes the timestamp.

func (*Queries) SetUserIdPMFA

func (q *Queries) SetUserIdPMFA(ctx context.Context, id uuid.UUID) error

The directory asserted a second factor at this sign-in.

func (*Queries) SetUserPlatformStaff

func (q *Queries) SetUserPlatformStaff(ctx context.Context, arg SetUserPlatformStaffParams) error

The staff rule decides platform staff (registry.SyncStaffIn).

func (*Queries) SetUserReportDesignCoverImage added in v0.7.4

func (q *Queries) SetUserReportDesignCoverImage(ctx context.Context, arg SetUserReportDesignCoverImageParams) (UserReportDesign, error)

func (*Queries) SetUserReportDesignCustomCover added in v0.7.4

func (q *Queries) SetUserReportDesignCustomCover(ctx context.Context, arg SetUserReportDesignCustomCoverParams) (UserReportDesign, error)

func (*Queries) SetUserReportDesignDefault added in v0.7.4

func (q *Queries) SetUserReportDesignDefault(ctx context.Context, arg SetUserReportDesignDefaultParams) (int64, error)

Run after ClearUserReportDesignDefault in the same transaction; zero rows is an id that is not the account's.

func (q *Queries) SetUserReportDesignLogo(ctx context.Context, arg SetUserReportDesignLogoParams) (UserReportDesign, error)

func (*Queries) SetUserState added in v0.6.1000

func (q *Queries) SetUserState(ctx context.Context, arg SetUserStateParams) (int64, error)

A staff act moves an account between active and suspended, and only from the state it names: an erased account is never moved back, and a second suspension changes nothing.

func (*Queries) SetVersionArchive

func (q *Queries) SetVersionArchive(ctx context.Context, arg SetVersionArchiveParams) error

func (*Queries) SetVersionStatus

func (q *Queries) SetVersionStatus(ctx context.Context, arg SetVersionStatusParams) error

func (*Queries) SetVoiceAlwaysAttach

func (q *Queries) SetVoiceAlwaysAttach(ctx context.Context, arg SetVoiceAlwaysAttachParams) (Voice, error)

func (*Queries) SetVoiceWentLive

func (q *Queries) SetVoiceWentLive(ctx context.Context, userID uuid.UUID) (Voice, error)

A version went live. The first time, the account's always-attach flag comes on; after that it stays as the person set it.

func (*Queries) StarAgent

func (q *Queries) StarAgent(ctx context.Context, arg StarAgentParams) error

Stars and the per-agent counters the stats endpoint reports. Install counts read the download_stats daily rollup rather than raw events. Idempotent by design: PUT /user/stars/{ns}/{name} may be retried.

func (*Queries) StreamOrgAuditEvents

func (q *Queries) StreamOrgAuditEvents(ctx context.Context, arg StreamOrgAuditEventsParams) ([]AuditEvent, error)

func (*Queries) SumDownloads

func (q *Queries) SumDownloads(ctx context.Context, agentID uuid.UUID) (int64, error)

func (*Queries) SumKnowledgeBytesOfPool

func (q *Queries) SumKnowledgeBytesOfPool(ctx context.Context, arg SumKnowledgeBytesOfPoolParams) (int64, error)

What a pool's owners keep in the registry, the pack named aside (the one an upload replaces; uuid.Nil for none): the allocation counts every other pack of every owner in the pool. An owner's id is a handle's, unique across people and organizations, so the two lists match exactly the owners given, on the owner index.

func (*Queries) SupersedePendingReviewItem

func (q *Queries) SupersedePendingReviewItem(ctx context.Context, arg SupersedePendingReviewItemParams) (uuid.UUID, error)

The gate takes back a pending item whose version a new ruleset published: no person decided, so the item is superseded, not approved. No row when a reviewer decided first.

func (*Queries) SuspendOrg

func (q *Queries) SuspendOrg(ctx context.Context, arg SuspendOrgParams) (int64, error)

func (*Queries) SwapLiveAndPreviousVoice

func (q *Queries) SwapLiveAndPreviousVoice(ctx context.Context, userID uuid.UUID) (int64, error)

A Restore of a version reviewed under the question set in use: live and previous trade places in one statement (the slot constraint is checked at its end).

func (*Queries) TagSessionSSO

func (q *Queries) TagSessionSSO(ctx context.Context, arg TagSessionSSOParams) error

Merge a fresh {org_id: refreshed_at} entry into the session's sso_tags.

func (*Queries) TombstoneAgent

func (q *Queries) TombstoneAgent(ctx context.Context, id uuid.UUID) (int64, error)

Delete of an agent with version history: the row stays as a tombstone, private, taking no tag-push submissions.

func (*Queries) TouchKnowledgeScan

func (q *Queries) TouchKnowledgeScan(ctx context.Context, arg TouchKnowledgeScanParams) (int64, error)

The sweep claims this tree's stalled scan to queue it again: it waits another stall period before the next sweep looks at it, and a sweep that finds it already touched past the cutoff claims nothing.

func (*Queries) TouchPAT

func (q *Queries) TouchPAT(ctx context.Context, id uuid.UUID) error

func (*Queries) TouchRepoOnPush

func (q *Queries) TouchRepoOnPush(ctx context.Context, id uuid.UUID) error

Git hosting bookkeeping. Owned by internal/gitsrv. Records that a push landed when its size could not be measured: last_push_at advances and size_bytes keeps its previous value. UpdateRepoOnPush is the normal path; this one exists so a DiskUsage failure never writes a fabricated size (a 0 would read as "empty repo" everywhere downstream).

func (*Queries) TouchSSHKey

func (q *Queries) TouchSSHKey(ctx context.Context, id uuid.UUID) error

func (*Queries) TouchSession

func (q *Queries) TouchSession(ctx context.Context, id uuid.UUID) error

func (*Queries) TouchTrustedDevice

func (q *Queries) TouchTrustedDevice(ctx context.Context, id uuid.UUID) error

TouchTrustedDevice records use. It moves last_seen_at and deliberately not expires_at: the lifetime is absolute, so a stolen cookie does not become immortal by being used, and a person who signs in daily is still asked again on day thirty (matching the 24 h absolute lifetime of sessions).

func (*Queries) TouchVoice

func (q *Queries) TouchVoice(ctx context.Context, userID uuid.UUID) error

func (*Queries) TrackSAMLRequest

func (q *Queries) TrackSAMLRequest(ctx context.Context, arg TrackSAMLRequestParams) error

func (*Queries) TriageAbuseReport

func (q *Queries) TriageAbuseReport(ctx context.Context, arg TriageAbuseReportParams) error

func (*Queries) UnstarAgent

func (q *Queries) UnstarAgent(ctx context.Context, arg UnstarAgentParams) (int64, error)

func (*Queries) UpdateAgentSettings

func (q *Queries) UpdateAgentSettings(ctx context.Context, arg UpdateAgentSettingsParams) error

func (*Queries) UpdateOrgDisplayName

func (q *Queries) UpdateOrgDisplayName(ctx context.Context, arg UpdateOrgDisplayNameParams) (uuid.UUID, error)

func (*Queries) UpdateOrgReportDesignDocument added in v0.7.5

func (q *Queries) UpdateOrgReportDesignDocument(ctx context.Context, arg UpdateOrgReportDesignDocumentParams) (OrgReportDesign, error)

The document alone: the images stay, so a client that sends a document without them cannot drop them by saving.

func (*Queries) UpdateRepoOnPush

func (q *Queries) UpdateRepoOnPush(ctx context.Context, arg UpdateRepoOnPushParams) error

func (*Queries) UpdateUserDisplayName

func (q *Queries) UpdateUserDisplayName(ctx context.Context, arg UpdateUserDisplayNameParams) (uuid.UUID, error)

func (*Queries) UpdateUserReportDesignDocument added in v0.7.4

func (q *Queries) UpdateUserReportDesignDocument(ctx context.Context, arg UpdateUserReportDesignDocumentParams) (UserReportDesign, error)

The document alone: the images stay, so a client that sends a document without them cannot drop them by saving.

func (*Queries) UpdateWebhookEndpoint

func (q *Queries) UpdateWebhookEndpoint(ctx context.Context, arg UpdateWebhookEndpointParams) (WebhookEndpoint, error)

func (*Queries) UpsertAccountInstall

func (q *Queries) UpsertAccountInstall(ctx context.Context, arg UpsertAccountInstallParams) (AccountInstall, error)

Account installs: the per-account record of a QuickAgent release a person accepted and the contract they consented to. Nothing here touches download_stats. A PUT on an existing record is the update: the version moves and the snapshot and consents are the new release's; the ref is the name the caller used, which they can read.

func (*Queries) UpsertAgentTeamGrant

func (q *Queries) UpsertAgentTeamGrant(ctx context.Context, arg UpsertAgentTeamGrantParams) error

func (*Queries) UpsertAgentUserGrant

func (q *Queries) UpsertAgentUserGrant(ctx context.Context, arg UpsertAgentUserGrantParams) error

func (*Queries) UpsertBaselinePolicy

func (q *Queries) UpsertBaselinePolicy(ctx context.Context, arg UpsertBaselinePolicyParams) error

func (*Queries) UpsertFoldInDecline

func (q *Queries) UpsertFoldInDecline(ctx context.Context, arg UpsertFoldInDeclineParams) error

A decline is remembered for that person at that organization.

func (*Queries) UpsertMCPServerScan

func (q *Queries) UpsertMCPServerScan(ctx context.Context, arg UpsertMCPServerScanParams) (McpServerScan, error)

func (*Queries) UpsertMembership

func (q *Queries) UpsertMembership(ctx context.Context, arg UpsertMembershipParams) (int64, error)

Role changes only, and it cannot create: every door that makes someone a member goes through registry.ActivateMember, which counts seats. An UPDATE with no row is 0 rows, so a caller that reaches here with nobody to change writes nothing rather than admitting them.

func (*Queries) UpsertOrgPolicy

func (q *Queries) UpsertOrgPolicy(ctx context.Context, arg UpsertOrgPolicyParams) error

func (*Queries) UpsertPendingMembership

func (q *Queries) UpsertPendingMembership(ctx context.Context, arg UpsertPendingMembershipParams) (int64, error)

The provisioning and fold-in doors: a membership that holds no seat and confers nothing until an admin approves it. An existing membership is left alone — approving twice, or provisioning someone who is already active, must not push them back to pending. Reports 1 when this call wrote the row, which is how the fold-in knows to audit and count it once.

func (*Queries) UpsertScanResultCache

func (q *Queries) UpsertScanResultCache(ctx context.Context, arg UpsertScanResultCacheParams) error

func (*Queries) UpsertStageResult

func (q *Queries) UpsertStageResult(ctx context.Context, arg UpsertStageResultParams) error

func (*Queries) UpsertUserNotificationSettings

func (q *Queries) UpsertUserNotificationSettings(ctx context.Context, arg UpsertUserNotificationSettingsParams) (UserNotificationSetting, error)

The billing, schedules, bug-report and the two run switches are nullable on the way in: a client that predates one omits it, and an omitted switch keeps the row's value — or the default on a first write (on for the first three, off for the run switches) — in the same statement, so two clients writing at once cannot resurrect a value neither sent.

func (*Queries) WithTx

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

func (*Queries) WithdrawPendingReviewItem added in v0.7.9

func (q *Queries) WithdrawPendingReviewItem(ctx context.Context, arg WithdrawPendingReviewItemParams) (uuid.UUID, error)

The version's publisher takes back a pending item: no reviewer decided, so the item closes as withdrawn. No row when a reviewer decided first.

type RecordAdmittedStoreParams

type RecordAdmittedStoreParams struct {
	Ticket string `json:"ticket"`
	Kind   string `json:"kind"`
}

type RecordWebhookDeliveryResultParams

type RecordWebhookDeliveryResultParams struct {
	ID          uuid.UUID  `json:"id"`
	Attempt     int32      `json:"attempt"`
	StatusCode  *int32     `json:"status_code"`
	Error       *string    `json:"error"`
	DeliveredAt *time.Time `json:"delivered_at"`
	NextRetryAt *time.Time `json:"next_retry_at"`
}

type RedteamReport

type RedteamReport struct {
	ID            uuid.UUID `json:"id"`
	RulesetSemver string    `json:"ruleset_semver"`
	BundleDigest  string    `json:"bundle_digest"`
	Fixtures      int32     `json:"fixtures"`
	Cases         int32     `json:"cases"`
	Evaded        int32     `json:"evaded"`
	Report        []byte    `json:"report"`
	CreatedAt     time.Time `json:"created_at"`
}

type RegisterSigningKeyParams

type RegisterSigningKeyParams struct {
	KeyID        string `json:"key_id"`
	Algorithm    string `json:"algorithm"`
	PublicKeyPem string `json:"public_key_pem"`
}

type RegisterSigningKeyRow

type RegisterSigningKeyRow struct {
	KeyID        string     `json:"key_id"`
	Algorithm    string     `json:"algorithm"`
	PublicKeyPem string     `json:"public_key_pem"`
	FirstSeenAt  time.Time  `json:"first_seen_at"`
	LastSeenAt   time.Time  `json:"last_seen_at"`
	RetiredAt    *time.Time `json:"retired_at"`
	Inserted     bool       `json:"inserted"`
}

type ReleaseHandleParams

type ReleaseHandleParams struct {
	ID     uuid.UUID `json:"id"`
	Handle string    `json:"handle"`
}

type ReleaseIdempotencyKeyParams

type ReleaseIdempotencyKeyParams struct {
	UserID   uuid.UUID `json:"user_id"`
	Endpoint string    `json:"endpoint"`
	Key      string    `json:"key"`
}

type RemoveTeamMemberParams

type RemoveTeamMemberParams struct {
	TeamID uuid.UUID `json:"team_id"`
	UserID uuid.UUID `json:"user_id"`
}

type Repo

type Repo struct {
	ID            uuid.UUID  `json:"id"`
	DefaultBranch string     `json:"default_branch"`
	SizeBytes     int64      `json:"size_bytes"`
	LastPushAt    *time.Time `json:"last_push_at"`
	CreatedAt     time.Time  `json:"created_at"`
}

type ResolveMCPDependencyAlertsForServerParams

type ResolveMCPDependencyAlertsForServerParams struct {
	Ecosystem      string  `json:"ecosystem"`
	Package        string  `json:"package"`
	PackageVersion string  `json:"package_version"`
	ResolvedReason *string `json:"resolved_reason"`
}

type ResolveMCPDependencyAlertsForVersionParams

type ResolveMCPDependencyAlertsForVersionParams struct {
	VersionID      uuid.UUID `json:"version_id"`
	ResolvedReason *string   `json:"resolved_reason"`
}

type ReviewItem

type ReviewItem struct {
	ID             uuid.UUID  `json:"id"`
	VersionID      uuid.UUID  `json:"version_id"`
	Queue          string     `json:"queue"`
	OrgID          *uuid.UUID `json:"org_id"`
	State          string     `json:"state"`
	DecidedBy      *uuid.UUID `json:"decided_by"`
	DecidedAt      *time.Time `json:"decided_at"`
	Rationale      *string    `json:"rationale"`
	CreatedAt      time.Time  `json:"created_at"`
	PublishPending bool       `json:"publish_pending"`
}

type RevokeOrgBoundPATsForUserParams

type RevokeOrgBoundPATsForUserParams struct {
	UserID uuid.UUID  `json:"user_id"`
	OrgID  *uuid.UUID `json:"org_id"`
}

type RevokeOtherUserSessionsParams

type RevokeOtherUserSessionsParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type RevokePATParams

type RevokePATParams struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type RevokeSSHKeyParams

type RevokeSSHKeyParams struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type RevokeUserSessionByIDParams

type RevokeUserSessionByIDParams struct {
	ID     uuid.UUID `json:"id"`
	UserID uuid.UUID `json:"user_id"`
}

type RulesetAttestation

type RulesetAttestation struct {
	BundleDigest string    `json:"bundle_digest"`
	KeyID        string    `json:"key_id"`
	DsseEnvelope []byte    `json:"dsse_envelope"`
	CreatedAt    time.Time `json:"created_at"`
}

type RulesetRelease

type RulesetRelease struct {
	ID           uuid.UUID `json:"id"`
	Semver       string    `json:"semver"`
	BundleDigest string    `json:"bundle_digest"`
	Notes        *string   `json:"notes"`
	PublishedAt  time.Time `json:"published_at"`
}

type RunningScanRunForVersionParams

type RunningScanRunForVersionParams struct {
	VersionID        uuid.UUID `json:"version_id"`
	Trigger          string    `json:"trigger"`
	RulesetReleaseID uuid.UUID `json:"ruleset_release_id"`
}

type ScanResultCache

type ScanResultCache struct {
	ArchiveDigest    string    `json:"archive_digest"`
	Scanner          string    `json:"scanner"`
	RulesetReleaseID uuid.UUID `json:"ruleset_release_id"`
	Findings         []byte    `json:"findings"`
	CreatedAt        time.Time `json:"created_at"`
}

type ScanRun

type ScanRun struct {
	ID                    uuid.UUID  `json:"id"`
	VersionID             uuid.UUID  `json:"version_id"`
	Trigger               string     `json:"trigger"`
	RulesetReleaseID      uuid.UUID  `json:"ruleset_release_id"`
	PolicySnapshot        []byte     `json:"policy_snapshot"`
	JudgeModel            *string    `json:"judge_model"`
	JudgePromptHash       *string    `json:"judge_prompt_hash"`
	Status                string     `json:"status"`
	StartedAt             time.Time  `json:"started_at"`
	FinishedAt            *time.Time `json:"finished_at"`
	ReportDigest          *string    `json:"report_digest"`
	JudgePromptTokens     *int32     `json:"judge_prompt_tokens"`
	JudgeCompletionTokens *int32     `json:"judge_completion_tokens"`
}

type ScanStageResult

type ScanStageResult struct {
	ScanRunID  uuid.UUID `json:"scan_run_id"`
	Scanner    string    `json:"scanner"`
	Status     string    `json:"status"`
	Detail     []byte    `json:"detail"`
	FinishedAt time.Time `json:"finished_at"`
}

type SearchAgentsParams

type SearchAgentsParams struct {
	Limit        int32   `json:"limit"`
	Offset       int32   `json:"offset"`
	Query        string  `json:"query"`
	Mode         *string `json:"mode"`
	Capability   *string `json:"capability"`
	License      *string `json:"license"`
	VerifiedOnly bool    `json:"verified_only"`
	Sort         string  `json:"sort"`
}

type SearchAgentsRow

type SearchAgentsRow struct {
	ID              uuid.UUID `json:"id"`
	Name            string    `json:"name"`
	Modes           []string  `json:"modes"`
	Visibility      string    `json:"visibility"`
	Summary         string    `json:"summary"`
	QuarantineState string    `json:"quarantine_state"`
	CreatedAt       time.Time `json:"created_at"`
	Builtin         bool      `json:"builtin"`
	Namespace       string    `json:"namespace"`
	LogoObjectKey   *string   `json:"logo_object_key"`
	Installs        int64     `json:"installs"`
	Rank            float32   `json:"rank"`
	Score           float64   `json:"score"`
}

type SearchFacetLicensesRow

type SearchFacetLicensesRow struct {
	License string `json:"license"`
	N       int64  `json:"n"`
}

type SearchFacetModesRow

type SearchFacetModesRow struct {
	Mode string `json:"mode"`
	N    int64  `json:"n"`
}

type Session

type Session struct {
	ID          uuid.UUID   `json:"id"`
	TokenSha256 []byte      `json:"token_sha256"`
	UserID      uuid.UUID   `json:"user_id"`
	CsrfToken   string      `json:"csrf_token"`
	SsoTags     []byte      `json:"sso_tags"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	CreatedAt   time.Time   `json:"created_at"`
	LastSeenAt  time.Time   `json:"last_seen_at"`
	ExpiresAt   time.Time   `json:"expires_at"`
	RevokedAt   *time.Time  `json:"revoked_at"`
}

type SetAgentLatestPublishedParams

type SetAgentLatestPublishedParams struct {
	ID                       uuid.UUID  `json:"id"`
	LatestPublishedVersionID *uuid.UUID `json:"latest_published_version_id"`
}

type SetAgentNamespaceParams

type SetAgentNamespaceParams struct {
	ID          uuid.UUID `json:"id"`
	NamespaceID uuid.UUID `json:"namespace_id"`
}

type SetAgentQuarantineStateParams

type SetAgentQuarantineStateParams struct {
	ID              uuid.UUID `json:"id"`
	QuarantineState string    `json:"quarantine_state"`
}

type SetAgentReadmeTextParams

type SetAgentReadmeTextParams struct {
	ID         uuid.UUID `json:"id"`
	ReadmeText string    `json:"readme_text"`
}

type SetFindingVerdictParams

type SetFindingVerdictParams struct {
	ID            uuid.UUID  `json:"id"`
	Verdict       string     `json:"verdict"`
	VerdictBy     *uuid.UUID `json:"verdict_by"`
	VerdictReason *string    `json:"verdict_reason"`
}

type SetForkStateParams

type SetForkStateParams struct {
	ForkState  *string   `json:"fork_state"`
	ForkDetail string    `json:"fork_detail"`
	ID         uuid.UUID `json:"id"`
}

type SetKnowledgePackExportableParams

type SetKnowledgePackExportableParams struct {
	ID         uuid.UUID `json:"id"`
	OwnerKind  string    `json:"owner_kind"`
	OwnerID    uuid.UUID `json:"owner_id"`
	Exportable bool      `json:"exportable"`
}

type SetKnowledgeTreeParams

type SetKnowledgeTreeParams struct {
	ID        uuid.UUID `json:"id"`
	Bytes     int64     `json:"bytes"`
	Files     int32     `json:"files"`
	Pages     int32     `json:"pages"`
	Digest    string    `json:"digest"`
	ObjectKey string    `json:"object_key"`
}

type SetOrgLogoParams

type SetOrgLogoParams struct {
	ID            uuid.UUID `json:"id"`
	LogoObjectKey *string   `json:"logo_object_key"`
}

type SetOrgReportDesignCoverImageParams added in v0.7.5

type SetOrgReportDesignCoverImageParams struct {
	OrgID            uuid.UUID `json:"org_id"`
	ID               uuid.UUID `json:"id"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
}

type SetOrgReportDesignCustomCoverParams added in v0.7.5

type SetOrgReportDesignCustomCoverParams struct {
	OrgID       uuid.UUID `json:"org_id"`
	ID          uuid.UUID `json:"id"`
	CustomCover []byte    `json:"custom_cover"`
}

type SetOrgReportDesignLogoParams added in v0.7.5

type SetOrgReportDesignLogoParams struct {
	OrgID uuid.UUID `json:"org_id"`
	ID    uuid.UUID `json:"id"`
}

type SetOrgSSORequiredParams

type SetOrgSSORequiredParams struct {
	ID          uuid.UUID `json:"id"`
	SsoRequired bool      `json:"sso_required"`
}

type SetReviewPublishPendingParams

type SetReviewPublishPendingParams struct {
	ID             uuid.UUID `json:"id"`
	PublishPending bool      `json:"publish_pending"`
}

type SetUserPlatformStaffParams

type SetUserPlatformStaffParams struct {
	ID            uuid.UUID `json:"id"`
	PlatformStaff bool      `json:"platform_staff"`
}

type SetUserReportDesignCoverImageParams added in v0.7.4

type SetUserReportDesignCoverImageParams struct {
	UserID           uuid.UUID `json:"user_id"`
	ID               uuid.UUID `json:"id"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
}

type SetUserReportDesignCustomCoverParams added in v0.7.4

type SetUserReportDesignCustomCoverParams struct {
	UserID      uuid.UUID `json:"user_id"`
	ID          uuid.UUID `json:"id"`
	CustomCover []byte    `json:"custom_cover"`
}

type SetUserReportDesignDefaultParams added in v0.7.4

type SetUserReportDesignDefaultParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type SetUserReportDesignLogoParams added in v0.7.4

type SetUserReportDesignLogoParams struct {
	UserID uuid.UUID `json:"user_id"`
	ID     uuid.UUID `json:"id"`
}

type SetUserStateParams added in v0.6.1000

type SetUserStateParams struct {
	ToState   string    `json:"to_state"`
	ID        uuid.UUID `json:"id"`
	FromState string    `json:"from_state"`
}

type SetVersionArchiveParams

type SetVersionArchiveParams struct {
	ID            uuid.UUID `json:"id"`
	ArchiveDigest *string   `json:"archive_digest"`
	ArchiveKey    *string   `json:"archive_key"`
	ArchiveSize   *int64    `json:"archive_size"`
}

type SetVersionStatusParams

type SetVersionStatusParams struct {
	ID           uuid.UUID `json:"id"`
	Status       string    `json:"status"`
	StatusReason *string   `json:"status_reason"`
	YankReason   *string   `json:"yank_reason"`
}

type SetVoiceAlwaysAttachParams

type SetVoiceAlwaysAttachParams struct {
	UserID       uuid.UUID `json:"user_id"`
	AlwaysAttach bool      `json:"always_attach"`
}

type SigningKey

type SigningKey struct {
	KeyID        string     `json:"key_id"`
	Algorithm    string     `json:"algorithm"`
	PublicKeyPem string     `json:"public_key_pem"`
	FirstSeenAt  time.Time  `json:"first_seen_at"`
	LastSeenAt   time.Time  `json:"last_seen_at"`
	RetiredAt    *time.Time `json:"retired_at"`
}

type SigningKeyHandover added in v0.7.10

type SigningKeyHandover struct {
	FromKeyID    string    `json:"from_key_id"`
	ToKeyID      string    `json:"to_key_id"`
	DsseEnvelope []byte    `json:"dsse_envelope"`
	CreatedAt    time.Time `json:"created_at"`
}

type Star

type Star struct {
	UserID    uuid.UUID `json:"user_id"`
	AgentID   uuid.UUID `json:"agent_id"`
	CreatedAt time.Time `json:"created_at"`
}

type StarAgentParams

type StarAgentParams struct {
	UserID  uuid.UUID `json:"user_id"`
	AgentID uuid.UUID `json:"agent_id"`
}

type StreamOrgAuditEventsParams

type StreamOrgAuditEventsParams struct {
	OrgID     *uuid.UUID `json:"org_id"`
	Limit     int32      `json:"limit"`
	Action    *string    `json:"action"`
	AfterTime *time.Time `json:"after_time"`
	AfterID   *uuid.UUID `json:"after_id"`
}

type SumKnowledgeBytesOfPoolParams

type SumKnowledgeBytesOfPoolParams struct {
	OwnerKinds []string    `json:"owner_kinds"`
	OwnerIds   []uuid.UUID `json:"owner_ids"`
	ExceptID   uuid.UUID   `json:"except_id"`
}

type SupersedePendingReviewItemParams

type SupersedePendingReviewItemParams struct {
	Rationale *string   `json:"rationale"`
	VersionID uuid.UUID `json:"version_id"`
}

type SuspendOrgParams

type SuspendOrgParams struct {
	ID                 uuid.UUID `json:"id"`
	DecommissionReason *string   `json:"decommission_reason"`
}

type TagSessionSSOParams

type TagSessionSSOParams struct {
	ID      uuid.UUID `json:"id"`
	Column2 string    `json:"column_2"`
	Column3 string    `json:"column_3"`
}

type Team

type Team struct {
	ID        uuid.UUID `json:"id"`
	OrgID     uuid.UUID `json:"org_id"`
	Slug      string    `json:"slug"`
	CreatedAt time.Time `json:"created_at"`
}

type TeamMember

type TeamMember struct {
	TeamID    uuid.UUID `json:"team_id"`
	UserID    uuid.UUID `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
}

type TouchKnowledgeScanParams

type TouchKnowledgeScanParams struct {
	ID        uuid.UUID `json:"id"`
	ObjectKey string    `json:"object_key"`
	Cutoff    time.Time `json:"cutoff"`
}

type TrackSAMLRequestParams

type TrackSAMLRequestParams struct {
	ID        string    `json:"id"`
	ExpiresAt time.Time `json:"expires_at"`
}

type TriageAbuseReportParams

type TriageAbuseReportParams struct {
	ID         uuid.UUID  `json:"id"`
	State      string     `json:"state"`
	TriagedBy  *uuid.UUID `json:"triaged_by"`
	Resolution *string    `json:"resolution"`
}

type TrustedDevice

type TrustedDevice struct {
	ID          uuid.UUID   `json:"id"`
	UserID      uuid.UUID   `json:"user_id"`
	TokenSha256 []byte      `json:"token_sha256"`
	Ip          *netip.Addr `json:"ip"`
	UserAgent   *string     `json:"user_agent"`
	CreatedAt   time.Time   `json:"created_at"`
	LastSeenAt  time.Time   `json:"last_seen_at"`
	ExpiresAt   time.Time   `json:"expires_at"`
	RevokedAt   *time.Time  `json:"revoked_at"`
}

type UnstarAgentParams

type UnstarAgentParams struct {
	UserID  uuid.UUID `json:"user_id"`
	AgentID uuid.UUID `json:"agent_id"`
}

type UpdateAgentSettingsParams

type UpdateAgentSettingsParams struct {
	ID              uuid.UUID `json:"id"`
	Summary         *string   `json:"summary"`
	Visibility      *string   `json:"visibility"`
	AutoPublishTags *bool     `json:"auto_publish_tags"`
	AllowForcePush  *bool     `json:"allow_force_push"`
	PipelineSkip    *bool     `json:"pipeline_skip"`
	Builtin         *bool     `json:"builtin"`
	Modes           []string  `json:"modes"`
}

type UpdateOrgDisplayNameParams

type UpdateOrgDisplayNameParams struct {
	ID          uuid.UUID `json:"id"`
	DisplayName string    `json:"display_name"`
}

type UpdateOrgReportDesignDocumentParams added in v0.7.5

type UpdateOrgReportDesignDocumentParams struct {
	OrgID    uuid.UUID `json:"org_id"`
	ID       uuid.UUID `json:"id"`
	Document []byte    `json:"document"`
}

type UpdateRepoOnPushParams

type UpdateRepoOnPushParams struct {
	ID        uuid.UUID `json:"id"`
	SizeBytes int64     `json:"size_bytes"`
}

type UpdateUserDisplayNameParams

type UpdateUserDisplayNameParams struct {
	ID          uuid.UUID `json:"id"`
	DisplayName string    `json:"display_name"`
}

type UpdateUserReportDesignDocumentParams added in v0.7.4

type UpdateUserReportDesignDocumentParams struct {
	UserID   uuid.UUID `json:"user_id"`
	ID       uuid.UUID `json:"id"`
	Document []byte    `json:"document"`
}

type UpdateWebhookEndpointParams

type UpdateWebhookEndpointParams struct {
	ID     uuid.UUID `json:"id"`
	OrgID  uuid.UUID `json:"org_id"`
	Url    string    `json:"url"`
	Events []string  `json:"events"`
	Active bool      `json:"active"`
}

type UpsertAccountInstallParams

type UpsertAccountInstallParams struct {
	UserID            uuid.UUID `json:"user_id"`
	AgentID           uuid.UUID `json:"agent_id"`
	VersionID         uuid.UUID `json:"version_id"`
	RefNamespace      string    `json:"ref_namespace"`
	RefName           string    `json:"ref_name"`
	Capabilities      []byte    `json:"capabilities"`
	AcceptedUnsigned  bool      `json:"accepted_unsigned"`
	AcceptedUnscanned bool      `json:"accepted_unscanned"`
}

type UpsertAgentTeamGrantParams

type UpsertAgentTeamGrantParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	TeamID  uuid.UUID `json:"team_id"`
	Role    string    `json:"role"`
}

type UpsertAgentUserGrantParams

type UpsertAgentUserGrantParams struct {
	AgentID uuid.UUID `json:"agent_id"`
	UserID  uuid.UUID `json:"user_id"`
	Role    string    `json:"role"`
}

type UpsertBaselinePolicyParams

type UpsertBaselinePolicyParams struct {
	ID       uuid.UUID `json:"id"`
	Document []byte    `json:"document"`
}

type UpsertFoldInDeclineParams

type UpsertFoldInDeclineParams struct {
	OrgID      uuid.UUID  `json:"org_id"`
	UserID     uuid.UUID  `json:"user_id"`
	DeclinedBy *uuid.UUID `json:"declined_by"`
}

type UpsertMCPServerScanParams

type UpsertMCPServerScanParams struct {
	Ecosystem   string  `json:"ecosystem"`
	Package     string  `json:"package"`
	Version     string  `json:"version"`
	Status      string  `json:"status"`
	MaxSeverity *string `json:"max_severity"`
	Advisories  []byte  `json:"advisories"`
	LastError   *string `json:"last_error"`
}

type UpsertMembershipParams

type UpsertMembershipParams struct {
	OrgID  uuid.UUID `json:"org_id"`
	UserID uuid.UUID `json:"user_id"`
	Role   string    `json:"role"`
}

type UpsertOrgPolicyParams

type UpsertOrgPolicyParams struct {
	ID       uuid.UUID  `json:"id"`
	OrgID    *uuid.UUID `json:"org_id"`
	Document []byte     `json:"document"`
}

type UpsertPendingMembershipParams

type UpsertPendingMembershipParams struct {
	OrgID     uuid.UUID `json:"org_id"`
	UserID    uuid.UUID `json:"user_id"`
	Role      string    `json:"role"`
	ViaScim   bool      `json:"via_scim"`
	ViaDomain bool      `json:"via_domain"`
}

type UpsertScanResultCacheParams

type UpsertScanResultCacheParams struct {
	ArchiveDigest    string    `json:"archive_digest"`
	Scanner          string    `json:"scanner"`
	RulesetReleaseID uuid.UUID `json:"ruleset_release_id"`
	Findings         []byte    `json:"findings"`
}

type UpsertStageResultParams

type UpsertStageResultParams struct {
	ScanRunID uuid.UUID `json:"scan_run_id"`
	Scanner   string    `json:"scanner"`
	Status    string    `json:"status"`
	Detail    []byte    `json:"detail"`
}

type UpsertUserNotificationSettingsParams

type UpsertUserNotificationSettingsParams struct {
	UserID                uuid.UUID `json:"user_id"`
	EmailDependencyAlerts bool      `json:"email_dependency_alerts"`
	EmailQuarantine       bool      `json:"email_quarantine"`
	EmailReviewDecisions  bool      `json:"email_review_decisions"`
	EmailAdvisories       bool      `json:"email_advisories"`
	EmailOrgInvites       bool      `json:"email_org_invites"`
	WebDependencyAlerts   bool      `json:"web_dependency_alerts"`
	EmailBilling          *bool     `json:"email_billing"`
	EmailSchedules        *bool     `json:"email_schedules"`
	EmailBugReports       *bool     `json:"email_bug_reports"`
	EmailRunFailures      *bool     `json:"email_run_failures"`
	EmailRunFinished      *bool     `json:"email_run_finished"`
}

type User

type User struct {
	ID               uuid.UUID  `json:"id"`
	Email            string     `json:"email"`
	EmailVerifiedAt  *time.Time `json:"email_verified_at"`
	DisplayName      string     `json:"display_name"`
	State            string     `json:"state"`
	DeletedTombstone []byte     `json:"deleted_tombstone"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	PlatformStaff    bool       `json:"platform_staff"`
	CookieAckAt      *time.Time `json:"cookie_ack_at"`
	IdpMfaAt         *time.Time `json:"idp_mfa_at"`
}

type UserNotificationSetting

type UserNotificationSetting struct {
	UserID                uuid.UUID `json:"user_id"`
	EmailDependencyAlerts bool      `json:"email_dependency_alerts"`
	EmailQuarantine       bool      `json:"email_quarantine"`
	EmailReviewDecisions  bool      `json:"email_review_decisions"`
	EmailAdvisories       bool      `json:"email_advisories"`
	EmailOrgInvites       bool      `json:"email_org_invites"`
	WebDependencyAlerts   bool      `json:"web_dependency_alerts"`
	UpdatedAt             time.Time `json:"updated_at"`
	EmailBilling          bool      `json:"email_billing"`
	EmailSchedules        bool      `json:"email_schedules"`
	EmailBugReports       bool      `json:"email_bug_reports"`
	EmailRunFailures      bool      `json:"email_run_failures"`
	EmailRunFinished      bool      `json:"email_run_finished"`
}

type UserReportDesign added in v0.7.4

type UserReportDesign struct {
	ID               uuid.UUID `json:"id"`
	UserID           uuid.UUID `json:"user_id"`
	Document         []byte    `json:"document"`
	CoverImage       []byte    `json:"cover_image"`
	CoverImageFormat *string   `json:"cover_image_format"`
	CustomCover      []byte    `json:"custom_cover"`
	IsDefault        bool      `json:"is_default"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

type UserSshKey

type UserSshKey struct {
	ID          uuid.UUID  `json:"id"`
	UserID      uuid.UUID  `json:"user_id"`
	Title       string     `json:"title"`
	KeyType     string     `json:"key_type"`
	PublicKey   string     `json:"public_key"`
	Fingerprint string     `json:"fingerprint"`
	CreatedAt   time.Time  `json:"created_at"`
	LastUsedAt  *time.Time `json:"last_used_at"`
	RevokedAt   *time.Time `json:"revoked_at"`
}

type Voice

type Voice struct {
	UserID           uuid.UUID `json:"user_id"`
	WrapperKind      string    `json:"wrapper_kind"`
	WrapperRecipient string    `json:"wrapper_recipient"`
	WrappedKey       []byte    `json:"wrapped_key"`
	AlwaysAttach     bool      `json:"always_attach"`
	WentLive         bool      `json:"went_live"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

type VoiceVersion

type VoiceVersion struct {
	ID             uuid.UUID  `json:"id"`
	UserID         uuid.UUID  `json:"user_id"`
	Slot           string     `json:"slot"`
	ReviewState    string     `json:"review_state"`
	Source         string     `json:"source"`
	Sealed         []byte     `json:"sealed"`
	Digest         string     `json:"digest"`
	Bytes          int32      `json:"bytes"`
	Review         []byte     `json:"review"`
	QuestionSet    string     `json:"question_set"`
	ReviewAttempts int32      `json:"review_attempts"`
	ReviewedAt     *time.Time `json:"reviewed_at"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
}

type WebhookDelivery

type WebhookDelivery struct {
	ID          uuid.UUID  `json:"id"`
	EndpointID  uuid.UUID  `json:"endpoint_id"`
	EventType   string     `json:"event_type"`
	Payload     []byte     `json:"payload"`
	Attempt     int32      `json:"attempt"`
	StatusCode  *int32     `json:"status_code"`
	Error       *string    `json:"error"`
	DeliveredAt *time.Time `json:"delivered_at"`
	NextRetryAt *time.Time `json:"next_retry_at"`
	CreatedAt   time.Time  `json:"created_at"`
}

type WebhookEndpoint

type WebhookEndpoint struct {
	ID        uuid.UUID `json:"id"`
	OrgID     uuid.UUID `json:"org_id"`
	Url       string    `json:"url"`
	SecretEnc []byte    `json:"secret_enc"`
	Events    []string  `json:"events"`
	Active    bool      `json:"active"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type WithdrawPendingReviewItemParams added in v0.7.9

type WithdrawPendingReviewItemParams struct {
	DecidedBy *uuid.UUID `json:"decided_by"`
	Rationale *string    `json:"rationale"`
	VersionID uuid.UUID  `json:"version_id"`
}

Jump to

Keyboard shortcuts

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