models

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package models defines database record models used by the application.

Index

Constants

View Source
const (
	AIJobStatusQueued = "queued"
	AIJobStatusOK     = "ok"
	AIJobStatusError  = "error"
)

AIJobStatus* constants define the lifecycle state of an AI job.

View Source
const (
	BillingPaymentMethodStatusActive   = "active"
	BillingPaymentMethodStatusDetached = "detached"
)

BillingPaymentMethodStatusActive and BillingPaymentMethodStatusDetached define lifecycle states for stored payment methods.

View Source
const (
	BillingProviderNone   = "none"
	BillingProviderStripe = "stripe"
)

BillingProvider* constants describe supported billing providers.

View Source
const (
	SKMetadata = "METADATA"
	SKProfile  = "PROFILE"
	SKInfra    = "INFRA"
	SKJob      = "JOB"
)

SK* constants are shared sort key values.

View Source
const (
	KeyPatternUser    = "USER#%s"
	KeyPatternSession = "SESSION#%s"
)

KeyPattern* constants define common partition key patterns.

View Source
const (
	CreditPurchaseStatusPending = "pending"
	CreditPurchaseStatusPaid    = "paid"
	CreditPurchaseStatusExpired = "expired"
	CreditPurchaseStatusFailed  = "failed"
)

CreditPurchaseStatus* constants define payment lifecycle states.

View Source
const (
	DomainTypePrimary = "primary"
	DomainTypeVanity  = "vanity"
)

DomainType* constants define the type of a domain.

View Source
const (
	DomainStatusPending  = "pending"
	DomainStatusVerified = "verified"
	DomainStatusActive   = "active"
	DomainStatusDisabled = "disabled"
	DomainStatusRejected = "rejected"
)

DomainStatus* constants define the verification status of a domain.

View Source
const (
	ExternalInstanceRegistrationStatusPending  = "pending"
	ExternalInstanceRegistrationStatusApproved = "approved"
	ExternalInstanceRegistrationStatusRejected = "rejected"
)

ExternalInstanceRegistrationStatusPending, ExternalInstanceRegistrationStatusApproved, and ExternalInstanceRegistrationStatusRejected define lifecycle states for external instance registrations.

View Source
const (
	InstanceStatusActive   = "active"
	InstanceStatusDisabled = "disabled"
)

InstanceStatus* constants define whether an instance is active.

View Source
const (
	RoleAdmin    = "admin"
	RoleOperator = "operator"
	RoleCustomer = "customer"
)

Role* constants define portal and operator roles.

View Source
const (
	UserApprovalStatusPending  = "pending"
	UserApprovalStatusApproved = "approved"
	UserApprovalStatusRejected = "rejected"
)

UserApprovalStatus* constants define portal approval states.

View Source
const (
	ProvisionJobStatusQueued  = "queued"
	ProvisionJobStatusRunning = "running"
	ProvisionJobStatusOK      = "ok"
	ProvisionJobStatusError   = "error"
)

ProvisionJobStatus* constants define the lifecycle state of a provisioning job.

View Source
const (
	RenderRetentionClassBenign   = "benign"
	RenderRetentionClassEvidence = "evidence"
)

RenderRetentionClass* constants define the retention class for rendered artifacts.

View Source
const (
	SoulBoundaryCategoryRefusal           = "refusal"
	SoulBoundaryCategoryScopeLimit        = "scope_limit"
	SoulBoundaryCategoryEthicalCommitment = "ethical_commitment"
	SoulBoundaryCategoryCircuitBreaker    = "circuit_breaker"
)

SoulBoundaryCategory* constants enumerate boundary categories.

View Source
const (
	SoulChannelTypeENS   = "ens"
	SoulChannelTypeEmail = "email"
	SoulChannelTypePhone = "phone"
)

SoulChannelType* constants define supported channel types.

View Source
const (
	SoulChannelStatusActive         = "active"
	SoulChannelStatusPaused         = "paused"
	SoulChannelStatusDecommissioned = "decommissioned"
)

SoulChannelStatus* constants define supported channel lifecycle states.

View Source
const (
	SoulEmailLegacyAliasStatusActive   = "active"
	SoulEmailLegacyAliasStatusDisabled = "disabled"
)

SoulEmailLegacyAliasStatus* constants describe host-internal legacy email aliases used only for migrated bare Lesser Soul addresses.

View Source
const (
	SoulCommDirectionInbound  = "inbound"
	SoulCommDirectionOutbound = "outbound"
)

SoulCommDirection* constants define message direction.

View Source
const (
	SoulCommBoundaryCheckPassed   = "passed"
	SoulCommBoundaryCheckViolated = "violated"
	SoulCommBoundaryCheckSkipped  = "skipped"
)

SoulCommBoundaryCheck* constants define boundary-check outcomes.

View Source
const (
	SoulCommQueueStatusQueued    = "queued"
	SoulCommQueueStatusDelivered = "delivered"
	SoulCommQueueStatusExpired   = "expired"
)

SoulCommQueueStatus* constants define delivery queue status values.

View Source
const (
	SoulContinuityEntryTypeCapabilityAcquired   = "capability_acquired"
	SoulContinuityEntryTypeCapabilityDeprecated = "capability_deprecated"
	SoulContinuityEntryTypeSignificantFailure   = "significant_failure"
	SoulContinuityEntryTypeRecovery             = "recovery"
	SoulContinuityEntryTypeBoundaryAdded        = "boundary_added"
	SoulContinuityEntryTypeMigration            = "migration"
	SoulContinuityEntryTypeModelChange          = "model_change"
	SoulContinuityEntryTypeRelationshipFormed   = "relationship_formed"
	SoulContinuityEntryTypeRelationshipEnded    = "relationship_ended"
	SoulContinuityEntryTypeSelfSuspension       = "self_suspension"
	SoulContinuityEntryTypeArchived             = "archived"
	SoulContinuityEntryTypeSuccessionDeclared   = "succession_declared"
	SoulContinuityEntryTypeSuccessionReceived   = "succession_received"
)

SoulContinuityEntryType* constants enumerate continuity entry types.

View Source
const (
	SoulDisputeStatusOpen      = "open"
	SoulDisputeStatusResolved  = "resolved"
	SoulDisputeStatusDismissed = "dismissed"
)

SoulDisputeStatus* constants define dispute lifecycle states.

View Source
const (
	SoulAgentStatusPending       = "pending"
	SoulAgentStatusActive        = "active"
	SoulAgentStatusSuspended     = "suspended"
	SoulAgentStatusSelfSuspended = "self_suspended"
	SoulAgentStatusArchived      = "archived"
	SoulAgentStatusSucceeded     = "succeeded"
	SoulAgentStatusBurned        = "burned"
)

SoulAgentStatus* constants define lifecycle states for a soul agent identity.

View Source
const (
	SoulPolicyVersionHostedBoundSoulV1        = "hosted-bound-soul/v1"
	SoulAnchorStateHostedOffchain             = "hosted_offchain"
	SoulAnchorStateImmutableOnchain           = "immutable_onchain"
	SoulOperationalBindingHostedBoundSoul     = "hosted_bound_soul"
	SoulCapabilityPolicyVersionV1             = "capability-policy/v1"
	SoulCallerAccessPaymentPolicyVersionV1    = "caller-access-payment/v1"
	SoulPhoneEntitlementNotEntitled           = "not_entitled"
	SoulPhoneEntitlementProvisioned           = "provisioned"
	SoulPhoneEntitlementPaid                  = "paid"
	SoulPublicPaidCallerAccessDenied          = "denied"
	SoulPublicPaidCallerAccessGrantable       = "grantable"
	SoulPolicyMigrationStateImplicitDefaultV1 = "implicit_default_v1"
	SoulPolicyMigrationStatePersistedV1       = "persisted_v1"
)

Soul policy vocabulary constants define the hosted-bound-soul v1 policy contract.

The names intentionally separate immutable anchor assurance from operational binding, capability policy, and caller access/payment policy. They are persisted on SoulAgentIdentity so existing souls can migrate in place without a new on-chain action.

View Source
const (
	SoulMintConversationStatusInProgress = "in_progress"
	SoulMintConversationStatusCompleted  = "completed"
	SoulMintConversationStatusFailed     = "failed"
)

SoulMintConversationStatus* constants define minting conversation states.

View Source
const (
	SoulAgentPromotionStageRequested       = "requested"
	SoulAgentPromotionStageApproved        = "approved"
	SoulAgentPromotionStageMinted          = "minted"
	SoulAgentPromotionStageReviewing       = "reviewing"
	SoulAgentPromotionStageReadyToFinalize = "ready_to_finalize"
	SoulAgentPromotionStageGraduated       = "graduated"
)
View Source
const (
	SoulAgentPromotionRequestStatusRequested = "requested"
	SoulAgentPromotionRequestStatusVerified  = "verified"
	SoulAgentPromotionRequestStatusMinted    = "minted"
	SoulAgentPromotionRequestStatusGraduated = "graduated"
)
View Source
const (
	SoulAgentPromotionReviewStatusNotStarted             = "not_started"
	SoulAgentPromotionReviewStatusConversationInProgress = "conversation_in_progress"
	SoulAgentPromotionReviewStatusDraftReady             = "draft_ready"
	SoulAgentPromotionReviewStatusPublished              = "published"
)
View Source
const (
	SoulAgentPromotionApprovalStatusPending  = "pending"
	SoulAgentPromotionApprovalStatusApproved = "approved"
)
View Source
const (
	SoulAgentPromotionReadinessAwaitingVerification = "awaiting_verification"
	SoulAgentPromotionReadinessAwaitingMint         = "awaiting_mint"
	SoulAgentPromotionReadinessReadyForConversation = "ready_for_conversation"
	SoulAgentPromotionReadinessReadyForFinalize     = "ready_for_finalize"
	SoulAgentPromotionReadinessGraduated            = "graduated"
)
View Source
const (
	SoulAgentPromotionEventTypeRequestCreated  = "request_created"
	SoulAgentPromotionEventTypeRequestApproved = "request_approved"
	SoulAgentPromotionEventTypeMintExecuted    = "mint_executed"
	SoulAgentPromotionEventTypeReviewStarted   = "review_started"
	SoulAgentPromotionEventTypeFinalizeReady   = "finalize_ready"
	SoulAgentPromotionEventTypeGraduated       = "graduated"
)
View Source
const (
	SoulAgentRegistrationStatusPending   = "pending"
	SoulAgentRegistrationStatusCompleted = "completed"
)

SoulAgentRegistrationStatus* constants describe a soul registration lifecycle.

View Source
const (
	SoulRelationshipTypeEndorsement     = "endorsement"
	SoulRelationshipTypeDelegation      = "delegation"
	SoulRelationshipTypeCollaboration   = "collaboration"
	SoulRelationshipTypeTrustGrant      = "trust_grant"
	SoulRelationshipTypeTrustRevocation = "trust_revocation"
)

SoulRelationshipType* constants enumerate relationship types.

View Source
const (
	SoulValidationChallengeStatusIssued    = "issued"
	SoulValidationChallengeStatusResponded = "responded"
	SoulValidationChallengeStatusEvaluated = "evaluated"
)
View Source
const (
	SoulValidationResultPass     = "pass"
	SoulValidationResultFail     = "fail"
	SoulValidationResultTimeout  = "timeout"
	SoulValidationResultDeclined = "declined"
)

SoulValidationResult* constants describe evaluation outcomes.

View Source
const (
	SoulValidationOptInStatusAccepted = "accepted"
	SoulValidationOptInStatusDeclined = "declined"
	SoulValidationOptInStatusPending  = "pending"
)

SoulValidationOptInStatus* constants describe opt-in states for validation challenges.

View Source
const (
	SoulCommMailboxStatusAccepted  = "accepted"
	SoulCommMailboxStatusSent      = "sent"
	SoulCommMailboxStatusDelivered = "delivered"
	SoulCommMailboxStatusQueued    = "queued"
	SoulCommMailboxStatusFailed    = "failed"
	SoulCommMailboxStatusBounced   = "bounced"
	SoulCommMailboxStatusDropped   = "dropped"
)

SoulCommMailbox* constants define canonical mailbox state values.

View Source
const (
	SoulCommMailboxEventCreated          = "created"
	SoulCommMailboxEventContentStored    = "content_stored"
	SoulCommMailboxEventProjectionQueued = "projection_queued"
	SoulCommMailboxEventStateChanged     = "state_changed"
)

SoulCommMailboxEvent* constants define immutable mailbox event types.

View Source
const (
	SoulCommMessageStatusAccepted = "accepted"
	SoulCommMessageStatusSent     = "sent"
	SoulCommMessageStatusFailed   = "failed"
)

SoulCommMessageStatus* constants define supported comm message status values.

View Source
const (
	SoulCommSendIdempotencyStatusProcessing = "processing"
	SoulCommSendIdempotencyStatusSucceeded  = "succeeded"
	SoulCommSendIdempotencyStatusFailed     = "failed"
)
View Source
const (
	SoulOperationStatusPending  = "pending"
	SoulOperationStatusProposed = "proposed"
	SoulOperationStatusExecuted = "executed"
	SoulOperationStatusFailed   = "failed"
)

SoulOperationStatus* constants define lifecycle states for an on-chain registry operation.

View Source
const (
	SoulOperationKindMint                  = "mint"
	SoulOperationKindRotateWallet          = "rotate_wallet"
	SoulOperationKindPublishReputationRoot = "publish_reputation_root"
	SoulOperationKindPublishValidationRoot = "publish_validation_root"
	SoulOperationKindSuspend               = "suspend"
	SoulOperationKindBurn                  = "burn"
	SoulOperationKindArchive               = "archive"
	SoulOperationKindSelfSuspend           = "self_suspend"
	SoulOperationKindSelfReinstate         = "self_reinstate"
	SoulOperationKindDesignateSuccessor    = "designate_successor"
	SoulOperationKindDispute               = "dispute"
)

SoulOperationKind* constants enumerate supported operations.

View Source
const (
	SoulX402InvocationGrantStatusIssued  = "issued"
	SoulX402InvocationGrantStatusRevoked = "revoked"

	SoulX402InvocationGrantPaymentSchemeX402              = "x402"
	SoulX402InvocationGrantFacilitatorTrustCallerProvided = "caller_provided_unverified"
	SoulX402InvocationGrantAuthorityScopedInvocation      = "scoped_invocation"
)
View Source
const (
	TipHostRegistrationStatusPending   = "pending"
	TipHostRegistrationStatusVerified  = "verified"
	TipHostRegistrationStatusRejected  = "rejected"
	TipHostRegistrationStatusCompleted = "completed"
)

TipHostRegistrationStatus* constants describe a host registration lifecycle.

View Source
const (
	TipRegistryOperationStatusPending  = "pending"
	TipRegistryOperationStatusProposed = "proposed"
	TipRegistryOperationStatusExecuted = "executed"
	TipRegistryOperationStatusFailed   = "failed"
)

TipRegistryOperationStatus* constants define lifecycle states for an on-chain registry operation.

View Source
const (
	TipRegistryOperationKindRegisterHost  = "register_host"
	TipRegistryOperationKindUpdateHost    = "update_host"
	TipRegistryOperationKindSetHostActive = "set_host_active"
	TipRegistryOperationKindSetToken      = "set_token_allowed"
)

TipRegistryOperationKind* constants enumerate supported operations.

View Source
const (
	UpdateJobStatusQueued  = "queued"
	UpdateJobStatusRunning = "running"
	UpdateJobStatusOK      = "ok"
	UpdateJobStatusError   = "error"
)
View Source
const (
	BillingTypeIncluded = "included"
	BillingTypeOverage  = "overage"
	BillingTypeNone     = "none"
	BillingTypeMixed    = "mixed"
)

BillingType* constants describe how a request was billed.

View Source
const (
	VanityDomainRequestStatusPending  = "pending"
	VanityDomainRequestStatusApproved = "approved"
	VanityDomainRequestStatusRejected = "rejected"
)

VanityDomainRequestStatusPending, VanityDomainRequestStatusApproved, and VanityDomainRequestStatusRejected define lifecycle states for vanity domain activation requests.

View Source
const SoulCommMailboxRetentionDays = 90

SoulCommMailboxRetentionDays is the bounded retention window for canonical soul comm mailbox metadata. Content objects use the same lifecycle duration in the CDK-managed mailbox bucket.

Variables

This section is empty.

Functions

func DefaultSoulAgentPromotionLifecycleEventID added in v0.2.0

func DefaultSoulAgentPromotionLifecycleEventID(eventType string, occurredAt time.Time, agentID string, conversationID string, operationID string) string

func MainTableName

func MainTableName() string

MainTableName returns the configured database table name.

func SoulCommMailboxAgentPK added in v0.2.6

func SoulCommMailboxAgentPK(instanceSlug string, agentID string) string

SoulCommMailboxAgentPK scopes mailbox reads to one instance/agent pair.

func SoulCommMailboxCanonicalThreadRoot added in v0.2.6

func SoulCommMailboxCanonicalThreadRoot(rootMessageID string) string

SoulCommMailboxCanonicalThreadRoot normalizes host-generated email Message-ID references to the stable comm message token used before provider wrapping. External Message-IDs remain untouched so unrelated correspondents do not collapse into host-owned threads.

func SoulCommMailboxDeliveryID added in v0.2.6

func SoulCommMailboxDeliveryID(instanceSlug string, agentID string, direction string, messageID string) string

SoulCommMailboxDeliveryID returns a deterministic canonical delivery id.

func SoulCommMailboxDeliveryPK added in v0.2.6

func SoulCommMailboxDeliveryPK(deliveryID string) string

SoulCommMailboxDeliveryPK returns the delivery lookup partition key.

func SoulCommMailboxEventID added in v0.2.6

func SoulCommMailboxEventID(eventType string, deliveryID string, status string, createdAt time.Time) string

SoulCommMailboxEventID returns a deterministic-ish event id for append rows.

func SoulCommMailboxPreview added in v0.2.6

func SoulCommMailboxPreview(body string) string

SoulCommMailboxPreview returns a constant redacted marker for list responses. The full body remains in the explicit content object, not in list-oriented metadata. Avoid normalizing the full body here: even short messages can carry private content, and unbounded normalization is an avoidable CPU/memory risk.

func SoulCommMailboxThreadID added in v0.2.6

func SoulCommMailboxThreadID(instanceSlug string, agentID string, channelType string, rootMessageID string) string

SoulCommMailboxThreadID returns a deterministic thread id scoped to one agent.

func SoulCommMailboxThreadPK added in v0.2.6

func SoulCommMailboxThreadPK(instanceSlug string, agentID string, threadID string) string

SoulCommMailboxThreadPK scopes thread reads to one instance/agent pair.

func SoulCommMessageStatusIdempotencyIndexPK added in v0.1.22

func SoulCommMessageStatusIdempotencyIndexPK(instanceSlug string, agentID string, idempotencyKey string) string

SoulCommMessageStatusIdempotencyIndexPK returns the GSI partition key for message status rows that belong to an outbound comm idempotency scope.

func SoulCommSendIdempotencyPK added in v0.1.22

func SoulCommSendIdempotencyPK(instanceSlug string, agentID string, idempotencyKey string) string

SoulCommSendIdempotencyPK returns the primary key used to reserve an outbound comm idempotency key.

func SoulCommSendIdempotencyScope added in v0.1.22

func SoulCommSendIdempotencyScope(instanceSlug string, agentID string, idempotencyKey string) string

SoulCommSendIdempotencyScope returns the canonical scope for outbound comm idempotency.

func SoulX402InvocationGrantID added in v0.4.1

func SoulX402InvocationGrantID(agentID string, idempotencyKey string) string

SoulX402InvocationGrantID returns the deterministic grant id for an issue idempotency scope.

func SoulX402InvocationGrantPK added in v0.4.1

func SoulX402InvocationGrantPK(grantID string) string

SoulX402InvocationGrantPK returns the grant partition key.

func SoulX402InvocationGrantUsageSK added in v0.4.1

func SoulX402InvocationGrantUsageSK(slot int) string

SoulX402InvocationGrantUsageSK returns the usage slot sort key.

Types

type AIError

type AIError struct {
	Code      string `theorydb:"attr:code" json:"code"`
	Message   string `theorydb:"attr:message" json:"message"`
	Retryable bool   `theorydb:"attr:retryable" json:"retryable,omitempty"`
	// contains filtered or unexported fields
}

AIError captures an error returned by an AI provider call.

type AIEvidenceRef

type AIEvidenceRef struct {
	Kind        string `theorydb:"attr:kind" json:"kind"`
	Ref         string `theorydb:"attr:ref,omitempty" json:"ref,omitempty"`
	Hash        string `theorydb:"attr:hash,omitempty" json:"hash,omitempty"`
	Bytes       int64  `theorydb:"attr:bytes" json:"bytes,omitempty"`
	ContentType string `theorydb:"attr:contentType,omitempty" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

AIEvidenceRef references an evidence artifact used for an AI request.

type AIJob

type AIJob struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK,omitempty" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK,omitempty" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	InstanceSlug string `theorydb:"attr:instanceSlug,omitempty" json:"instance_slug,omitempty"`

	Module        string `theorydb:"attr:module" json:"module"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`
	ModelSet      string `theorydb:"attr:modelSet" json:"model_set"`

	CacheScope string `theorydb:"attr:cacheScope,omitempty" json:"cache_scope,omitempty"`
	ScopeKey   string `theorydb:"attr:scopeKey,omitempty" json:"scope_key,omitempty"`
	InputsHash string `theorydb:"attr:inputsHash" json:"inputs_hash"`

	InputsJSON string          `theorydb:"attr:inputsJson,omitempty" json:"inputs_json,omitempty"`
	Evidence   []AIEvidenceRef `theorydb:"attr:evidence,omitempty" json:"evidence,omitempty"`

	Status string `theorydb:"attr:status" json:"status"` // queued|ok|error

	Attempts    int64 `theorydb:"attr:attempts" json:"attempts"`
	MaxAttempts int64 `theorydb:"attr:maxAttempts" json:"max_attempts,omitempty"`

	ErrorCode    string `theorydb:"attr:errorCode,omitempty" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage,omitempty" json:"error_message,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	RequestID string    `theorydb:"attr:requestId,omitempty" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

AIJob represents an asynchronous AI job request and its status.

func (*AIJob) BeforeCreate

func (j *AIJob) BeforeCreate() error

BeforeCreate sets defaults and keys before creating AIJob.

func (*AIJob) BeforeUpdate

func (j *AIJob) BeforeUpdate() error

BeforeUpdate updates timestamps and TTL before updating AIJob.

func (*AIJob) GetPK

func (j *AIJob) GetPK() string

GetPK returns the partition key for AIJob.

func (*AIJob) GetSK

func (j *AIJob) GetSK() string

GetSK returns the sort key for AIJob.

func (AIJob) TableName

func (AIJob) TableName() string

TableName returns the database table name for AIJob.

func (*AIJob) UpdateKeys

func (j *AIJob) UpdateKeys() error

UpdateKeys updates the database keys for AIJob.

type AIResult

type AIResult struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug,omitempty"`

	Module        string `theorydb:"attr:module" json:"module"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`
	ModelSet      string `theorydb:"attr:modelSet" json:"model_set"`

	CacheScope string `theorydb:"attr:cacheScope" json:"cache_scope,omitempty"`
	ScopeKey   string `theorydb:"attr:scopeKey" json:"scope_key,omitempty"`
	InputsHash string `theorydb:"attr:inputsHash" json:"inputs_hash"`

	ResultJSON string    `theorydb:"attr:resultJson" json:"result_json"`
	Usage      AIUsage   `theorydb:"attr:usage" json:"usage,omitempty"`
	Errors     []AIError `theorydb:"attr:errors" json:"errors,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`

	JobID     string `theorydb:"attr:jobId" json:"job_id,omitempty"`
	RequestID string `theorydb:"attr:requestId" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

AIResult stores a cached AI module result and usage metadata.

func (*AIResult) BeforeCreate

func (r *AIResult) BeforeCreate() error

BeforeCreate sets defaults and keys before creating AIResult.

func (*AIResult) GetPK

func (r *AIResult) GetPK() string

GetPK returns the partition key for AIResult.

func (*AIResult) GetSK

func (r *AIResult) GetSK() string

GetSK returns the sort key for AIResult.

func (AIResult) TableName

func (AIResult) TableName() string

TableName returns the database table name for AIResult.

func (*AIResult) UpdateKeys

func (r *AIResult) UpdateKeys() error

UpdateKeys updates the database keys for AIResult.

type AIUsage

type AIUsage struct {
	Provider string `theorydb:"attr:provider,omitempty" json:"provider,omitempty"`
	Model    string `theorydb:"attr:model,omitempty" json:"model,omitempty"`

	InputTokens  int64 `theorydb:"attr:inputTokens" json:"input_tokens,omitempty"`
	OutputTokens int64 `theorydb:"attr:outputTokens" json:"output_tokens,omitempty"`
	TotalTokens  int64 `theorydb:"attr:totalTokens" json:"total_tokens,omitempty"`

	DurationMs int64 `theorydb:"attr:durationMs" json:"duration_ms,omitempty"`
	ToolCalls  int64 `theorydb:"attr:toolCalls" json:"tool_calls,omitempty"`
	// contains filtered or unexported fields
}

AIUsage captures provider usage metadata for an AI request.

type Attestation

type Attestation struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	ActorURI     string `theorydb:"attr:actorUri" json:"actor_uri,omitempty"`
	ObjectURI    string `theorydb:"attr:objectUri" json:"object_uri,omitempty"`
	ContentHash  string `theorydb:"attr:contentHash" json:"content_hash,omitempty"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug,omitempty"`

	Module        string `theorydb:"attr:module" json:"module"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`
	ModelSet      string `theorydb:"attr:modelSet" json:"model_set,omitempty"`

	JWS string `theorydb:"attr:jws" json:"jws"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	// contains filtered or unexported fields
}

Attestation stores a signed attestation for an AI module output.

func (*Attestation) BeforeCreate

func (a *Attestation) BeforeCreate() error

BeforeCreate sets defaults and keys before creating Attestation.

func (*Attestation) GetPK

func (a *Attestation) GetPK() string

GetPK returns the partition key for Attestation.

func (*Attestation) GetSK

func (a *Attestation) GetSK() string

GetSK returns the sort key for Attestation.

func (Attestation) TableName

func (Attestation) TableName() string

TableName returns the database table name for Attestation.

func (*Attestation) UpdateKeys

func (a *Attestation) UpdateKeys() error

UpdateKeys updates the database keys for Attestation.

type AuditLogEntry

type AuditLogEntry struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	ID        string    `theorydb:"attr:id" json:"id"`
	Actor     string    `theorydb:"attr:actor" json:"actor"`
	Action    string    `theorydb:"attr:action" json:"action"`
	Target    string    `theorydb:"attr:target" json:"target"`
	RequestID string    `theorydb:"attr:requestID" json:"request_id"`
	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`

	// Source provenance is provider-derived request metadata used only for
	// audit/rate-limit context. It must never become an authorization input.
	SourceIP         string `theorydb:"attr:sourceIP,omitempty" json:"source_ip,omitempty"`
	SourceProvider   string `theorydb:"attr:sourceProvider,omitempty" json:"source_provider,omitempty"`
	SourceProvenance string `theorydb:"attr:sourceProvenance,omitempty" json:"source_provenance,omitempty"`
	SourceValid      bool   `theorydb:"attr:sourceValid,omitempty" json:"source_valid,omitempty"`
	// contains filtered or unexported fields
}

AuditLogEntry records an operator action for auditing.

func (*AuditLogEntry) BeforeCreate

func (a *AuditLogEntry) BeforeCreate() error

BeforeCreate sets defaults and keys before creating AuditLogEntry.

func (*AuditLogEntry) GetPK

func (a *AuditLogEntry) GetPK() string

GetPK returns the partition key for AuditLogEntry.

func (*AuditLogEntry) GetSK

func (a *AuditLogEntry) GetSK() string

GetSK returns the sort key for AuditLogEntry.

func (AuditLogEntry) TableName

func (AuditLogEntry) TableName() string

TableName returns the database table name for AuditLogEntry.

func (*AuditLogEntry) UpdateKeys

func (a *AuditLogEntry) UpdateKeys() error

UpdateKeys updates the database keys for AuditLogEntry.

type BillingPaymentMethod

type BillingPaymentMethod struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Username string `theorydb:"attr:username" json:"username"`
	Provider string `theorydb:"attr:provider" json:"provider"`
	ID       string `theorydb:"attr:id" json:"id"`

	Type     string `theorydb:"attr:type" json:"type,omitempty"` // card, bank_account, ...
	Brand    string `theorydb:"attr:brand" json:"brand,omitempty"`
	Last4    string `theorydb:"attr:last4" json:"last4,omitempty"`
	ExpMonth int64  `theorydb:"attr:expMonth" json:"exp_month,omitempty"`
	ExpYear  int64  `theorydb:"attr:expYear" json:"exp_year,omitempty"`

	Status string `theorydb:"attr:status" json:"status"` // active|detached

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

BillingPaymentMethod stores a payment method attached to a BillingProfile.

func (*BillingPaymentMethod) BeforeCreate

func (m *BillingPaymentMethod) BeforeCreate() error

BeforeCreate sets defaults and keys before creating BillingPaymentMethod.

func (*BillingPaymentMethod) BeforeUpdate

func (m *BillingPaymentMethod) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating BillingPaymentMethod.

func (*BillingPaymentMethod) GetPK

func (m *BillingPaymentMethod) GetPK() string

GetPK returns the partition key for BillingPaymentMethod.

func (*BillingPaymentMethod) GetSK

func (m *BillingPaymentMethod) GetSK() string

GetSK returns the sort key for BillingPaymentMethod.

func (BillingPaymentMethod) TableName

func (BillingPaymentMethod) TableName() string

TableName returns the database table name for BillingPaymentMethod.

func (*BillingPaymentMethod) UpdateKeys

func (m *BillingPaymentMethod) UpdateKeys() error

UpdateKeys updates the database keys for BillingPaymentMethod.

type BillingProfile

type BillingProfile struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Username string `theorydb:"attr:username" json:"username"`
	Provider string `theorydb:"attr:provider" json:"provider"`

	StripeCustomerID       string `theorydb:"attr:stripeCustomerId" json:"stripe_customer_id,omitempty"`
	DefaultPaymentMethodID string `theorydb:"attr:defaultPaymentMethodId" json:"default_payment_method_id,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

BillingProfile stores the billing configuration for a user.

func (*BillingProfile) BeforeCreate

func (p *BillingProfile) BeforeCreate() error

BeforeCreate sets defaults and keys before creating BillingProfile.

func (*BillingProfile) BeforeUpdate

func (p *BillingProfile) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating BillingProfile.

func (*BillingProfile) GetPK

func (p *BillingProfile) GetPK() string

GetPK returns the partition key for BillingProfile.

func (*BillingProfile) GetSK

func (p *BillingProfile) GetSK() string

GetSK returns the sort key for BillingProfile.

func (BillingProfile) TableName

func (BillingProfile) TableName() string

TableName returns the database table name for BillingProfile.

func (*BillingProfile) UpdateKeys

func (p *BillingProfile) UpdateKeys() error

UpdateKeys updates the database keys for BillingProfile.

type ControlPlaneConfig

type ControlPlaneConfig struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	PrimaryAdminUsername string    `theorydb:"attr:primaryAdminUsername" json:"primary_admin_username"`
	BootstrappedAt       time.Time `theorydb:"attr:bootstrappedAt" json:"bootstrapped_at"`
	// contains filtered or unexported fields
}

ControlPlaneConfig stores global control-plane configuration.

func (*ControlPlaneConfig) BeforeCreate

func (c *ControlPlaneConfig) BeforeCreate() error

BeforeCreate sets keys before creating ControlPlaneConfig.

func (*ControlPlaneConfig) GetPK

func (c *ControlPlaneConfig) GetPK() string

GetPK returns the partition key for ControlPlaneConfig.

func (*ControlPlaneConfig) GetSK

func (c *ControlPlaneConfig) GetSK() string

GetSK returns the sort key for ControlPlaneConfig.

func (ControlPlaneConfig) TableName

func (ControlPlaneConfig) TableName() string

TableName returns the database table name for ControlPlaneConfig.

func (*ControlPlaneConfig) UpdateKeys

func (c *ControlPlaneConfig) UpdateKeys() error

UpdateKeys updates the database keys for ControlPlaneConfig.

type CreditPurchase

type CreditPurchase struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	Username     string `theorydb:"attr:username" json:"username"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	Month        string `theorydb:"attr:month" json:"month"` // YYYY-MM

	Credits     int64  `theorydb:"attr:credits" json:"credits"`
	AmountCents int64  `theorydb:"attr:amountCents" json:"amount_cents"`
	Currency    string `theorydb:"attr:currency" json:"currency"`

	Provider                  string `theorydb:"attr:provider" json:"provider"`
	ProviderCheckoutSessionID string `theorydb:"attr:providerCheckoutSessionId" json:"provider_checkout_session_id,omitempty"`
	ProviderPaymentIntentID   string `theorydb:"attr:providerPaymentIntentId" json:"provider_payment_intent_id,omitempty"`
	ProviderCustomerID        string `theorydb:"attr:providerCustomerId" json:"provider_customer_id,omitempty"`
	ReceiptURL                string `theorydb:"attr:receiptUrl" json:"receipt_url,omitempty"`

	Status string `theorydb:"attr:status" json:"status"`

	RequestID string `theorydb:"attr:requestId" json:"request_id,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	PaidAt    time.Time `theorydb:"attr:paidAt" json:"paid_at,omitempty"`
	// contains filtered or unexported fields
}

CreditPurchase records a user purchase of credits for an instance/month budget.

func (*CreditPurchase) BeforeCreate

func (p *CreditPurchase) BeforeCreate() error

BeforeCreate sets defaults and keys before creating CreditPurchase.

func (*CreditPurchase) BeforeUpdate

func (p *CreditPurchase) BeforeUpdate() error

BeforeUpdate updates timestamps before updating CreditPurchase.

func (*CreditPurchase) GetPK

func (p *CreditPurchase) GetPK() string

GetPK returns the partition key for CreditPurchase.

func (*CreditPurchase) GetSK

func (p *CreditPurchase) GetSK() string

GetSK returns the sort key for CreditPurchase.

func (CreditPurchase) TableName

func (CreditPurchase) TableName() string

TableName returns the database table name for CreditPurchase.

func (*CreditPurchase) UpdateKeys

func (p *CreditPurchase) UpdateKeys() error

UpdateKeys updates the database keys for CreditPurchase.

type Domain

type Domain struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	Domain       string `theorydb:"attr:domain" json:"domain"`
	DomainRaw    string `theorydb:"attr:domainRaw" json:"domain_raw,omitempty"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`

	Type   string `theorydb:"attr:type" json:"type"`     // primary|vanity
	Status string `theorydb:"attr:status" json:"status"` // pending|verified|rejected

	VerificationMethod string `theorydb:"attr:verificationMethod" json:"verification_method,omitempty"` // dns_txt|manual
	VerificationToken  string `theorydb:"attr:verificationToken" json:"verification_token,omitempty"`

	CreatedAt  time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt  time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	VerifiedAt time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`
	// contains filtered or unexported fields
}

Domain represents an instance-owned domain and its verification status.

func (*Domain) BeforeCreate

func (d *Domain) BeforeCreate() error

BeforeCreate sets defaults and keys before creating Domain.

func (*Domain) BeforeUpdate

func (d *Domain) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating Domain.

func (*Domain) GetPK

func (d *Domain) GetPK() string

GetPK returns the partition key for Domain.

func (*Domain) GetSK

func (d *Domain) GetSK() string

GetSK returns the sort key for Domain.

func (Domain) TableName

func (Domain) TableName() string

TableName returns the database table name for Domain.

func (*Domain) UpdateKeys

func (d *Domain) UpdateKeys() error

UpdateKeys updates the database keys for Domain.

type ExternalInstanceRegistration

type ExternalInstanceRegistration struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	Username string `theorydb:"attr:username" json:"username"`
	Slug     string `theorydb:"attr:slug" json:"slug"`

	Status string `theorydb:"attr:status" json:"status"` // pending|approved|rejected

	ReviewedBy string    `theorydb:"attr:reviewedBy" json:"reviewed_by,omitempty"`
	ReviewedAt time.Time `theorydb:"attr:reviewedAt" json:"reviewed_at,omitempty"`
	Note       string    `theorydb:"attr:note" json:"note,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

ExternalInstanceRegistration represents a request to register a non-hosted instance with lesser.host.

func (*ExternalInstanceRegistration) BeforeCreate

func (r *ExternalInstanceRegistration) BeforeCreate() error

BeforeCreate sets defaults and keys before creating ExternalInstanceRegistration.

func (*ExternalInstanceRegistration) BeforeUpdate

func (r *ExternalInstanceRegistration) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating ExternalInstanceRegistration.

func (*ExternalInstanceRegistration) GetPK

GetPK returns the partition key for ExternalInstanceRegistration.

func (*ExternalInstanceRegistration) GetSK

GetSK returns the sort key for ExternalInstanceRegistration.

func (ExternalInstanceRegistration) TableName

TableName returns the database table name for ExternalInstanceRegistration.

func (*ExternalInstanceRegistration) UpdateKeys

func (r *ExternalInstanceRegistration) UpdateKeys() error

UpdateKeys updates the database keys for ExternalInstanceRegistration.

type Instance

type Instance struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	Slug                           string    `theorydb:"attr:slug" json:"slug"`
	Owner                          string    `theorydb:"attr:owner" json:"owner,omitempty"`
	Status                         string    `theorydb:"attr:status" json:"status"`
	ProvisionStatus                string    `theorydb:"attr:provisionStatus" json:"provision_status,omitempty"` // queued|running|ok|error
	ProvisionJobID                 string    `theorydb:"attr:provisionJobId" json:"provision_job_id,omitempty"`
	UpdateStatus                   string    `theorydb:"attr:updateStatus" json:"update_status,omitempty"` // queued|running|ok|error
	UpdateJobID                    string    `theorydb:"attr:updateJobId" json:"update_job_id,omitempty"`
	LesserUpdateStatus             string    `theorydb:"attr:lesserUpdateStatus" json:"lesser_update_status,omitempty"`
	LesserUpdateJobID              string    `theorydb:"attr:lesserUpdateJobId" json:"lesser_update_job_id,omitempty"`
	LesserUpdateAt                 time.Time `theorydb:"attr:lesserUpdateAt" json:"lesser_update_at,omitempty"`
	LesserBodyUpdateStatus         string    `theorydb:"attr:lesserBodyUpdateStatus" json:"lesser_body_update_status,omitempty"`
	LesserBodyUpdateJobID          string    `theorydb:"attr:lesserBodyUpdateJobId" json:"lesser_body_update_job_id,omitempty"`
	LesserBodyUpdateAt             time.Time `theorydb:"attr:lesserBodyUpdateAt" json:"lesser_body_update_at,omitempty"`
	MCPUpdateStatus                string    `theorydb:"attr:mcpUpdateStatus" json:"mcp_update_status,omitempty"`
	MCPUpdateJobID                 string    `theorydb:"attr:mcpUpdateJobId" json:"mcp_update_job_id,omitempty"`
	MCPUpdateAt                    time.Time `theorydb:"attr:mcpUpdateAt" json:"mcp_update_at,omitempty"`
	HostedAccountID                string    `theorydb:"attr:hostedAccountId" json:"hosted_account_id,omitempty"`
	HostedRegion                   string    `theorydb:"attr:hostedRegion" json:"hosted_region,omitempty"`
	HostedBaseDomain               string    `theorydb:"attr:hostedBaseDomain" json:"hosted_base_domain,omitempty"`
	HostedZoneID                   string    `theorydb:"attr:hostedZoneId" json:"hosted_zone_id,omitempty"`
	LesserVersion                  string    `theorydb:"attr:lesserVersion" json:"lesser_version,omitempty"`
	LesserBodyVersion              string    `theorydb:"attr:lesserBodyVersion" json:"lesser_body_version,omitempty"`
	BodyProvisionedAt              time.Time `theorydb:"attr:bodyProvisionedAt" json:"body_provisioned_at,omitempty"`
	McpWiredAt                     time.Time `theorydb:"attr:mcpWiredAt" json:"mcp_wired_at,omitempty"`
	SoulEnabled                    *bool     `theorydb:"attr:soulEnabled" json:"soul_enabled,omitempty"`
	BodyEnabled                    *bool     `theorydb:"attr:bodyEnabled" json:"body_enabled,omitempty"`
	SoulVersion                    string    `theorydb:"attr:soulVersion" json:"soul_version,omitempty"`
	SoulProvisionedAt              time.Time `theorydb:"attr:soulProvisionedAt" json:"soul_provisioned_at,omitempty"`
	LesserHostBaseURL              string    `theorydb:"attr:lesserHostBaseUrl" json:"lesser_host_base_url,omitempty"`
	LesserHostAttestationsURL      string    `theorydb:"attr:lesserHostAttestationsUrl" json:"lesser_host_attestations_url,omitempty"`
	LesserHostInstanceKeySecretARN string    `theorydb:"attr:lesserHostInstanceKeySecretArn" json:"lesser_host_instance_key_secret_arn,omitempty"`
	TranslationEnabled             *bool     `theorydb:"attr:translationEnabled" json:"translation_enabled,omitempty"`

	// Tips config for hosted Lesser instances (applied via provisioning input).
	TipEnabled         *bool  `theorydb:"attr:tipEnabled" json:"tip_enabled,omitempty"`
	TipChainID         int64  `theorydb:"attr:tipChainId" json:"tip_chain_id,omitempty"`
	TipContractAddress string `theorydb:"attr:tipContractAddress" json:"tip_contract_address,omitempty"`

	// AI config for hosted Lesser instances (distinct from lesser.host's own trust/AI service configuration).
	LesserAIEnabled                 *bool `theorydb:"attr:lesserAiEnabled" json:"lesser_ai_enabled,omitempty"`
	LesserAIModerationEnabled       *bool `theorydb:"attr:lesserAiModerationEnabled" json:"lesser_ai_moderation_enabled,omitempty"`
	LesserAINsfwDetectionEnabled    *bool `theorydb:"attr:lesserAiNsfwDetectionEnabled" json:"lesser_ai_nsfw_detection_enabled,omitempty"`
	LesserAISpamDetectionEnabled    *bool `theorydb:"attr:lesserAiSpamDetectionEnabled" json:"lesser_ai_spam_detection_enabled,omitempty"`
	LesserAIPiiDetectionEnabled     *bool `theorydb:"attr:lesserAiPiiDetectionEnabled" json:"lesser_ai_pii_detection_enabled,omitempty"`
	LesserAIContentDetectionEnabled *bool `theorydb:"attr:lesserAiContentDetectionEnabled" json:"lesser_ai_content_detection_enabled,omitempty"`

	HostedPreviewsEnabled  *bool     `theorydb:"attr:hostedPreviewsEnabled" json:"hosted_previews_enabled,omitempty"`
	LinkSafetyEnabled      *bool     `theorydb:"attr:linkSafetyEnabled" json:"link_safety_enabled,omitempty"`
	RendersEnabled         *bool     `theorydb:"attr:rendersEnabled" json:"renders_enabled,omitempty"`
	RenderPolicy           string    `theorydb:"attr:renderPolicy" json:"render_policy,omitempty"`   // always|suspicious
	OveragePolicy          string    `theorydb:"attr:overagePolicy" json:"overage_policy,omitempty"` // block|allow
	ModerationEnabled      *bool     `theorydb:"attr:moderationEnabled" json:"moderation_enabled,omitempty"`
	ModerationTrigger      string    `theorydb:"attr:moderationTrigger" json:"moderation_trigger,omitempty"` // on_reports|always|links_media_only|virality
	ModerationViralityMin  int64     `theorydb:"attr:moderationViralityMin" json:"moderation_virality_min,omitempty"`
	AIEnabled              *bool     `theorydb:"attr:aiEnabled" json:"ai_enabled,omitempty"`
	AIModelSet             string    `theorydb:"attr:aiModelSet" json:"ai_model_set,omitempty"`
	AIBatchingMode         string    `theorydb:"attr:aiBatchingMode" json:"ai_batching_mode,omitempty"` // none|in_request|worker|hybrid
	AIBatchMaxItems        int64     `theorydb:"attr:aiBatchMaxItems" json:"ai_batch_max_items,omitempty"`
	AIBatchMaxTotalBytes   int64     `theorydb:"attr:aiBatchMaxTotalBytes" json:"ai_batch_max_total_bytes,omitempty"`
	AIPricingMultiplierBps *int64    `theorydb:"attr:aiPricingMultiplierBps" json:"ai_pricing_multiplier_bps,omitempty"`
	AIMaxInflightJobs      *int64    `theorydb:"attr:aiMaxInflightJobs" json:"ai_max_inflight_jobs,omitempty"`
	CreatedAt              time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt              time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Instance represents a tenant instance and its configuration.

func (*Instance) BeforeCreate

func (i *Instance) BeforeCreate() error

BeforeCreate sets defaults and keys before creating Instance.

func (*Instance) GetPK

func (i *Instance) GetPK() string

GetPK returns the partition key for Instance.

func (*Instance) GetSK

func (i *Instance) GetSK() string

GetSK returns the sort key for Instance.

func (Instance) TableName

func (Instance) TableName() string

TableName returns the database table name for Instance.

func (*Instance) UpdateKeys

func (i *Instance) UpdateKeys() error

UpdateKeys updates the database keys for Instance.

type InstanceBudgetMonth

type InstanceBudgetMonth struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	InstanceSlug    string    `theorydb:"attr:instanceSlug" json:"instance_slug"`
	Month           string    `theorydb:"attr:month" json:"month"` // YYYY-MM
	IncludedCredits int64     `theorydb:"attr:includedCredits" json:"included_credits"`
	UsedCredits     int64     `theorydb:"attr:usedCredits" json:"used_credits"`
	UpdatedAt       time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

InstanceBudgetMonth tracks monthly credits included and used for an instance.

func (*InstanceBudgetMonth) BeforeCreate

func (b *InstanceBudgetMonth) BeforeCreate() error

BeforeCreate sets defaults and keys before creating InstanceBudgetMonth.

func (*InstanceBudgetMonth) BeforeUpdate

func (b *InstanceBudgetMonth) BeforeUpdate() error

BeforeUpdate updates timestamps before updating InstanceBudgetMonth.

func (*InstanceBudgetMonth) GetPK

func (b *InstanceBudgetMonth) GetPK() string

GetPK returns the partition key for InstanceBudgetMonth.

func (*InstanceBudgetMonth) GetSK

func (b *InstanceBudgetMonth) GetSK() string

GetSK returns the sort key for InstanceBudgetMonth.

func (InstanceBudgetMonth) TableName

func (InstanceBudgetMonth) TableName() string

TableName returns the database table name for InstanceBudgetMonth.

func (*InstanceBudgetMonth) UpdateKeys

func (b *InstanceBudgetMonth) UpdateKeys() error

UpdateKeys updates the database keys for InstanceBudgetMonth.

type InstanceKey

type InstanceKey struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID           string    `theorydb:"attr:id" json:"id"`
	InstanceSlug string    `theorydb:"attr:instanceSlug" json:"instance_slug"`
	CreatedAt    time.Time `theorydb:"attr:createdAt" json:"created_at"`
	LastUsedAt   time.Time `theorydb:"attr:lastUsedAt" json:"last_used_at,omitempty"`
	RevokedAt    time.Time `theorydb:"attr:revokedAt" json:"revoked_at,omitempty"`
	// contains filtered or unexported fields
}

InstanceKey represents an API key issued to an instance.

func (*InstanceKey) BeforeCreate

func (k *InstanceKey) BeforeCreate() error

BeforeCreate sets defaults and keys before creating InstanceKey.

func (*InstanceKey) GetPK

func (k *InstanceKey) GetPK() string

GetPK returns the partition key for InstanceKey.

func (*InstanceKey) GetSK

func (k *InstanceKey) GetSK() string

GetSK returns the sort key for InstanceKey.

func (InstanceKey) TableName

func (InstanceKey) TableName() string

TableName returns the database table name for InstanceKey.

func (*InstanceKey) UpdateKeys

func (k *InstanceKey) UpdateKeys() error

UpdateKeys updates the database keys for InstanceKey.

type LinkPreview

type LinkPreview struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID            string `theorydb:"attr:id" json:"id"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`

	NormalizedURL string   `theorydb:"attr:normalizedUrl" json:"normalized_url"`
	ResolvedURL   string   `theorydb:"attr:resolvedUrl" json:"resolved_url,omitempty"`
	RedirectChain []string `theorydb:"attr:redirectChain" json:"redirect_chain,omitempty"`

	Title       string `theorydb:"attr:title" json:"title,omitempty"`
	Description string `theorydb:"attr:description" json:"description,omitempty"`

	ImageID        string `theorydb:"attr:imageId" json:"image_id,omitempty"`
	ImageObjectKey string `theorydb:"attr:imageObjectKey" json:"-"`

	ErrorCode    string `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage" json:"error_message,omitempty"`

	FetchedAt  time.Time `theorydb:"attr:fetchedAt" json:"fetched_at"`
	ExpiresAt  time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	StoredAt   time.Time `theorydb:"attr:storedAt" json:"stored_at"`
	StoredBy   string    `theorydb:"attr:storedBy" json:"stored_by,omitempty"`
	RequestID  string    `theorydb:"attr:requestId" json:"request_id,omitempty"`
	SourceType string    `theorydb:"attr:sourceType" json:"source_type,omitempty"`
	// contains filtered or unexported fields
}

LinkPreview stores derived preview metadata for a normalized URL.

func (*LinkPreview) BeforeCreate

func (p *LinkPreview) BeforeCreate() error

BeforeCreate sets defaults and keys before creating LinkPreview.

func (*LinkPreview) GetPK

func (p *LinkPreview) GetPK() string

GetPK returns the partition key for LinkPreview.

func (*LinkPreview) GetSK

func (p *LinkPreview) GetSK() string

GetSK returns the sort key for LinkPreview.

func (LinkPreview) TableName

func (LinkPreview) TableName() string

TableName returns the database table name for LinkPreview.

func (*LinkPreview) UpdateKeys

func (p *LinkPreview) UpdateKeys() error

UpdateKeys updates the database keys for LinkPreview.

type LinkSafetyBasicLinkResult

type LinkSafetyBasicLinkResult struct {
	URL           string   `theorydb:"attr:url" json:"url"`
	NormalizedURL string   `theorydb:"attr:normalizedUrl,omitempty" json:"normalized_url,omitempty"`
	Host          string   `theorydb:"attr:host,omitempty" json:"host,omitempty"`
	Flags         []string `theorydb:"attr:flags,omitempty" json:"flags,omitempty"`

	Risk string `theorydb:"attr:risk" json:"risk"`

	ErrorCode    string `theorydb:"attr:errorCode,omitempty" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage,omitempty" json:"error_message,omitempty"`
	// contains filtered or unexported fields
}

LinkSafetyBasicLinkResult contains the risk analysis for a single link.

type LinkSafetyBasicResult

type LinkSafetyBasicResult struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID            string `theorydb:"attr:id" json:"id"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`

	ActorURI    string `theorydb:"attr:actorUri" json:"actor_uri,omitempty"`
	ObjectURI   string `theorydb:"attr:objectUri" json:"object_uri,omitempty"`
	ContentHash string `theorydb:"attr:contentHash" json:"content_hash,omitempty"`
	LinksHash   string `theorydb:"attr:linksHash" json:"links_hash"`

	Links   []LinkSafetyBasicLinkResult `theorydb:"attr:links" json:"links"`
	Summary LinkSafetyBasicSummary      `theorydb:"attr:summary" json:"summary"`

	CreatedAt    time.Time `theorydb:"attr:createdAt" json:"created_at"`
	ExpiresAt    time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	RequestID    string    `theorydb:"attr:requestId" json:"request_id,omitempty"`
	InstanceSlug string    `theorydb:"attr:instanceSlug" json:"-"`
	// contains filtered or unexported fields
}

LinkSafetyBasicResult stores the output of the link-safety-basic analysis module.

func (*LinkSafetyBasicResult) BeforeCreate

func (r *LinkSafetyBasicResult) BeforeCreate() error

BeforeCreate sets defaults and keys before creating LinkSafetyBasicResult.

func (*LinkSafetyBasicResult) GetPK

func (r *LinkSafetyBasicResult) GetPK() string

GetPK returns the partition key for LinkSafetyBasicResult.

func (*LinkSafetyBasicResult) GetSK

func (r *LinkSafetyBasicResult) GetSK() string

GetSK returns the sort key for LinkSafetyBasicResult.

func (LinkSafetyBasicResult) TableName

func (LinkSafetyBasicResult) TableName() string

TableName returns the database table name for LinkSafetyBasicResult.

func (*LinkSafetyBasicResult) UpdateKeys

func (r *LinkSafetyBasicResult) UpdateKeys() error

UpdateKeys updates the database keys for LinkSafetyBasicResult.

type LinkSafetyBasicSummary

type LinkSafetyBasicSummary struct {
	TotalLinks int `theorydb:"attr:totalLinks" json:"total_links"`

	LowCount     int `theorydb:"attr:lowCount" json:"low_count"`
	MediumCount  int `theorydb:"attr:mediumCount" json:"medium_count"`
	HighCount    int `theorydb:"attr:highCount" json:"high_count"`
	BlockedCount int `theorydb:"attr:blockedCount" json:"blocked_count"`
	InvalidCount int `theorydb:"attr:invalidCount" json:"invalid_count"`

	OverallRisk string `theorydb:"attr:overallRisk" json:"overall_risk"`
	// contains filtered or unexported fields
}

LinkSafetyBasicSummary summarizes risk counts for a set of analyzed links.

type OperatorSession

type OperatorSession struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID        string    `theorydb:"attr:id" json:"id"`
	Username  string    `theorydb:"attr:username" json:"username"`
	Role      string    `theorydb:"attr:role" json:"role"`
	Method    string    `theorydb:"attr:method" json:"method"`
	IssuedAt  time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	// contains filtered or unexported fields
}

OperatorSession represents an authenticated operator session.

func (*OperatorSession) GetPK

func (s *OperatorSession) GetPK() string

GetPK returns the partition key for OperatorSession.

func (*OperatorSession) GetSK

func (s *OperatorSession) GetSK() string

GetSK returns the sort key for OperatorSession.

func (OperatorSession) TableName

func (OperatorSession) TableName() string

TableName returns the database table name for OperatorSession.

func (*OperatorSession) UpdateKeys

func (s *OperatorSession) UpdateKeys() error

UpdateKeys updates the database keys and TTL for OperatorSession.

type ProvisionConsentChallenge

type ProvisionConsentChallenge struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID            string `theorydb:"attr:id" json:"id"`
	Username      string `theorydb:"attr:username" json:"username"`
	InstanceSlug  string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	Stage         string `theorydb:"attr:stage" json:"stage"`
	AdminUsername string `theorydb:"attr:adminUsername" json:"admin_username"`

	WalletType string `theorydb:"attr:walletType" json:"wallet_type"`
	WalletAddr string `theorydb:"attr:walletAddress" json:"wallet_address"`
	ChainID    int    `theorydb:"attr:chainID" json:"chain_id"`

	Nonce       string    `theorydb:"attr:nonce" json:"nonce"`
	Message     string    `theorydb:"attr:message" json:"message"`
	MessageHash string    `theorydb:"attr:messageHash" json:"message_hash,omitempty"`
	Consumed    bool      `theorydb:"attr:consumed" json:"consumed,omitempty"`
	ConsumedAt  time.Time `theorydb:"attr:consumedAt" json:"consumed_at,omitempty"`
	IssuedAt    time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	ExpiresAt   time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	// contains filtered or unexported fields
}

ProvisionConsentChallenge represents a short-lived managed provisioning consent message.

func (*ProvisionConsentChallenge) BeforeCreate

func (c *ProvisionConsentChallenge) BeforeCreate() error

BeforeCreate sets defaults and keys before creating ProvisionConsentChallenge.

func (*ProvisionConsentChallenge) GetPK

func (c *ProvisionConsentChallenge) GetPK() string

GetPK returns the partition key for ProvisionConsentChallenge.

func (*ProvisionConsentChallenge) GetSK

func (c *ProvisionConsentChallenge) GetSK() string

GetSK returns the sort key for ProvisionConsentChallenge.

func (ProvisionConsentChallenge) TableName

func (ProvisionConsentChallenge) TableName() string

TableName returns the database table name for ProvisionConsentChallenge.

func (*ProvisionConsentChallenge) UpdateKeys

func (c *ProvisionConsentChallenge) UpdateKeys() error

UpdateKeys updates the database keys and TTL for ProvisionConsentChallenge.

type ProvisionJob

type ProvisionJob struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID           string `theorydb:"attr:id" json:"id"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`

	Status             string    `theorydb:"attr:status" json:"status"`                          // queued|running|ok|error
	Step               string    `theorydb:"attr:step" json:"step,omitempty"`                    // implementation-defined
	Note               string    `theorydb:"attr:note" json:"note,omitempty"`                    // operator-visible
	RunID              string    `theorydb:"attr:runId" json:"run_id,omitempty"`                 // external runner id (e.g. CodeBuild)
	Mode               string    `theorydb:"attr:mode" json:"mode,omitempty"`                    // managed|manual
	Plan               string    `theorydb:"attr:plan" json:"plan,omitempty"`                    // hosting plan identifier
	Region             string    `theorydb:"attr:region" json:"region,omitempty"`                // target region (if applicable)
	Stage              string    `theorydb:"attr:stage" json:"stage,omitempty"`                  // optional stage selector
	LesserVersion      string    `theorydb:"attr:lesserVersion" json:"lesser_version,omitempty"` // semver tag
	SoulEnabled        bool      `theorydb:"attr:soulEnabled" json:"soul_enabled"`
	SoulProvisionedAt  time.Time `theorydb:"attr:soulProvisionedAt" json:"soul_provisioned_at,omitempty"`
	BodyEnabled        bool      `theorydb:"attr:bodyEnabled" json:"body_enabled"`
	BodyProvisionedAt  time.Time `theorydb:"attr:bodyProvisionedAt" json:"body_provisioned_at,omitempty"`
	McpWiredAt         time.Time `theorydb:"attr:mcpWiredAt" json:"mcp_wired_at,omitempty"`
	AdminUsername      string    `theorydb:"attr:adminUsername" json:"admin_username,omitempty"`
	AdminWalletType    string    `theorydb:"attr:adminWalletType" json:"admin_wallet_type,omitempty"`
	AdminWalletAddr    string    `theorydb:"attr:adminWalletAddress" json:"admin_wallet_address,omitempty"`
	AdminWalletChainID int       `theorydb:"attr:adminWalletChainID" json:"admin_wallet_chain_id,omitempty"`

	ConsentMessage     string    `theorydb:"attr:consentMessage" json:"consent_message,omitempty"`
	ConsentMessageHash string    `theorydb:"attr:consentMessageHash" json:"consent_message_hash,omitempty"`
	ConsentSignature   string    `theorydb:"attr:consentSignature" json:"consent_signature,omitempty"`
	ConsentEncrypted   string    `theorydb:"attr:consentEncrypted" json:"consent_encrypted,omitempty"`
	ConsentExpiresAt   time.Time `theorydb:"attr:consentExpiresAt" json:"consent_expires_at,omitempty"`

	// Account allocation / creation.
	AccountRequestID string `theorydb:"attr:accountRequestId" json:"account_request_id,omitempty"`
	AccountID        string `theorydb:"attr:accountId" json:"account_id,omitempty"`
	AccountEmail     string `theorydb:"attr:accountEmail" json:"account_email,omitempty"`
	AccountRoleName  string `theorydb:"attr:accountRoleName" json:"account_role_name,omitempty"`

	// DNS delegation (recommended v1: per-instance hosted zone with parent NS delegation).
	ParentHostedZoneID string   `theorydb:"attr:parentHostedZoneId" json:"parent_hosted_zone_id,omitempty"`
	BaseDomain         string   `theorydb:"attr:baseDomain" json:"base_domain,omitempty"`
	ChildHostedZoneID  string   `theorydb:"attr:childHostedZoneId" json:"child_hosted_zone_id,omitempty"`
	ChildNameServers   []string `theorydb:"attr:childNameServers" json:"child_name_servers,omitempty"`

	// Deployment receipt (optional; can be large).
	ReceiptJSON string `theorydb:"attr:receiptJson" json:"receipt_json,omitempty"`

	// Soul deployment receipt (optional; can be large).
	SoulReceiptJSON string `theorydb:"attr:soulReceiptJson" json:"soul_receipt_json,omitempty"`

	Attempts    int64 `theorydb:"attr:attempts" json:"attempts"`
	MaxAttempts int64 `theorydb:"attr:maxAttempts" json:"max_attempts,omitempty"`

	LeaseOwner     string    `theorydb:"attr:leaseOwner" json:"lease_owner,omitempty"`
	LeaseExpiresAt time.Time `theorydb:"attr:leaseExpiresAt" json:"lease_expires_at,omitempty"`

	ErrorCode    string `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage" json:"error_message,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	RequestID string    `theorydb:"attr:requestId" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

ProvisionJob represents an asynchronous instance provisioning workflow.

func (*ProvisionJob) BeforeCreate

func (j *ProvisionJob) BeforeCreate() error

BeforeCreate sets defaults and keys before creating ProvisionJob.

func (*ProvisionJob) BeforeUpdate

func (j *ProvisionJob) BeforeUpdate() error

BeforeUpdate updates timestamps and TTL before updating ProvisionJob.

func (*ProvisionJob) GetPK

func (j *ProvisionJob) GetPK() string

GetPK returns the partition key for ProvisionJob.

func (*ProvisionJob) GetSK

func (j *ProvisionJob) GetSK() string

GetSK returns the sort key for ProvisionJob.

func (*ProvisionJob) HasActiveLease added in v0.2.6

func (j *ProvisionJob) HasActiveLease(now time.Time) bool

HasActiveLease reports whether a worker lease should suppress duplicate provisioning work.

func (ProvisionJob) TableName

func (ProvisionJob) TableName() string

TableName returns the database table name for ProvisionJob.

func (*ProvisionJob) UpdateKeys

func (j *ProvisionJob) UpdateKeys() error

UpdateKeys updates the database keys for ProvisionJob.

type RenderArtifact

type RenderArtifact struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID            string `theorydb:"attr:id" json:"id"`
	PolicyVersion string `theorydb:"attr:policyVersion" json:"policy_version"`

	NormalizedURL string   `theorydb:"attr:normalizedUrl" json:"normalized_url"`
	ResolvedURL   string   `theorydb:"attr:resolvedUrl" json:"resolved_url,omitempty"`
	RedirectChain []string `theorydb:"attr:redirectChain" json:"redirect_chain,omitempty"`

	ThumbnailObjectKey   string `theorydb:"attr:thumbnailObjectKey" json:"-"`
	ThumbnailContentType string `theorydb:"attr:thumbnailContentType" json:"thumbnail_content_type,omitempty"`

	SnapshotObjectKey   string `theorydb:"attr:snapshotObjectKey" json:"-"`
	SnapshotContentType string `theorydb:"attr:snapshotContentType" json:"snapshot_content_type,omitempty"`

	TextPreview string `theorydb:"attr:textPreview" json:"text_preview,omitempty"`

	SummaryPolicyVersion string    `theorydb:"attr:summaryPolicyVersion" json:"summary_policy_version,omitempty"`
	Summary              string    `theorydb:"attr:summary" json:"summary,omitempty"`
	SummarizedAt         time.Time `theorydb:"attr:summarizedAt" json:"summarized_at,omitempty"`

	RetentionClass string `theorydb:"attr:retentionClass" json:"retention_class"`

	ErrorCode    string `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage" json:"error_message,omitempty"`

	RequestedBy string `theorydb:"attr:requestedBy" json:"requested_by,omitempty"`
	RequestID   string `theorydb:"attr:requestId" json:"request_id,omitempty"`

	CreatedAt  time.Time `theorydb:"attr:createdAt" json:"created_at"`
	RenderedAt time.Time `theorydb:"attr:renderedAt" json:"rendered_at,omitempty"`
	ExpiresAt  time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	// contains filtered or unexported fields
}

RenderArtifact stores the output of a link render (snapshot, thumbnail, and derived metadata).

func (*RenderArtifact) BeforeCreate

func (r *RenderArtifact) BeforeCreate() error

BeforeCreate sets defaults and keys before creating RenderArtifact.

func (*RenderArtifact) BeforeUpdate

func (r *RenderArtifact) BeforeUpdate() error

BeforeUpdate updates secondary index keys and TTL before updating RenderArtifact.

func (*RenderArtifact) GetPK

func (r *RenderArtifact) GetPK() string

GetPK returns the partition key for RenderArtifact.

func (*RenderArtifact) GetSK

func (r *RenderArtifact) GetSK() string

GetSK returns the sort key for RenderArtifact.

func (RenderArtifact) TableName

func (RenderArtifact) TableName() string

TableName returns the database table name for RenderArtifact.

func (*RenderArtifact) UpdateKeys

func (r *RenderArtifact) UpdateKeys() error

UpdateKeys updates the database keys for RenderArtifact.

type SetupSession

type SetupSession struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID           string    `theorydb:"attr:id" json:"id"`
	Purpose      string    `theorydb:"attr:purpose" json:"purpose"`
	WalletType   string    `theorydb:"attr:walletType" json:"wallet_type"`
	WalletAddr   string    `theorydb:"attr:walletAddress" json:"wallet_address"`
	IssuedAt     time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	ExpiresAt    time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	InstanceLock bool      `theorydb:"attr:instanceLocked" json:"instance_locked"`
	// contains filtered or unexported fields
}

SetupSession represents a short-lived bootstrap/setup session.

func (*SetupSession) GetPK

func (s *SetupSession) GetPK() string

GetPK returns the partition key for SetupSession.

func (*SetupSession) GetSK

func (s *SetupSession) GetSK() string

GetSK returns the sort key for SetupSession.

func (SetupSession) TableName

func (SetupSession) TableName() string

TableName returns the database table name for SetupSession.

func (*SetupSession) UpdateKeys

func (s *SetupSession) UpdateKeys() error

UpdateKeys updates the database keys and TTL for SetupSession.

type SoulAgentBoundary

type SoulAgentBoundary struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID    string `theorydb:"attr:agentId" json:"agent_id"`
	BoundaryID string `theorydb:"attr:boundaryId" json:"boundary_id"`

	Category  string `theorydb:"attr:category" json:"category"`
	Statement string `theorydb:"attr:statement" json:"statement"`
	Rationale string `theorydb:"attr:rationale" json:"rationale,omitempty"`

	AddedInVersion int    `theorydb:"attr:addedInVersion" json:"added_in_version,omitempty"`
	Supersedes     string `theorydb:"attr:supersedes" json:"supersedes,omitempty"`
	Signature      string `theorydb:"attr:signature" json:"signature,omitempty"`

	AddedAt time.Time `theorydb:"attr:addedAt" json:"added_at"`
	// contains filtered or unexported fields
}

SoulAgentBoundary stores an append-only boundary declaration for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: BOUNDARY#{boundaryId}

func (*SoulAgentBoundary) BeforeCreate

func (b *SoulAgentBoundary) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentBoundary.

func (*SoulAgentBoundary) GetPK

func (b *SoulAgentBoundary) GetPK() string

GetPK returns the partition key for SoulAgentBoundary.

func (*SoulAgentBoundary) GetSK

func (b *SoulAgentBoundary) GetSK() string

GetSK returns the sort key for SoulAgentBoundary.

func (SoulAgentBoundary) TableName

func (SoulAgentBoundary) TableName() string

TableName returns the database table name for SoulAgentBoundary.

func (*SoulAgentBoundary) UpdateKeys

func (b *SoulAgentBoundary) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentBoundary.

type SoulAgentChannel

type SoulAgentChannel struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID      string   `theorydb:"attr:agentId" json:"agent_id"`
	ChannelType  string   `theorydb:"attr:channelType" json:"channel_type"` // ens|email|phone
	Identifier   string   `theorydb:"attr:identifier" json:"identifier"`    // ens name, email address, or phone number
	Capabilities []string `theorydb:"attr:capabilities" json:"capabilities,omitempty"`
	Protocols    []string `theorydb:"attr:protocols" json:"protocols,omitempty"` // email: smtp|imap

	ENSResolverAddress string `theorydb:"attr:ensResolverAddress" json:"ens_resolver_address,omitempty"`
	ENSChain           string `theorydb:"attr:ensChain" json:"ens_chain,omitempty"`

	Provider string `theorydb:"attr:provider" json:"provider,omitempty"`

	Verified   bool      `theorydb:"attr:verified" json:"verified"`
	VerifiedAt time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`

	ProvisionedAt   time.Time `theorydb:"attr:provisionedAt" json:"provisioned_at,omitempty"`
	DeprovisionedAt time.Time `theorydb:"attr:deprovisionedAt" json:"deprovisioned_at,omitempty"`

	Status    string    `theorydb:"attr:status" json:"status"`
	SecretRef string    `theorydb:"attr:secretRef" json:"-"` // SSM parameter name/ARN (per ADR 0004)
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentChannel stores a single communication channel for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: CHANNEL#{channelType}

func (*SoulAgentChannel) BeforeCreate

func (c *SoulAgentChannel) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentChannel.

func (*SoulAgentChannel) BeforeUpdate

func (c *SoulAgentChannel) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentChannel.

func (*SoulAgentChannel) GetPK

func (c *SoulAgentChannel) GetPK() string

GetPK returns the partition key for SoulAgentChannel.

func (*SoulAgentChannel) GetSK

func (c *SoulAgentChannel) GetSK() string

GetSK returns the sort key for SoulAgentChannel.

func (SoulAgentChannel) TableName

func (SoulAgentChannel) TableName() string

TableName returns the database table name for SoulAgentChannel.

func (*SoulAgentChannel) UpdateKeys

func (c *SoulAgentChannel) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentChannel.

type SoulAgentCommActivity

type SoulAgentCommActivity struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	AgentID     string `theorydb:"attr:agentId" json:"agent_id"`
	ActivityID  string `theorydb:"attr:activityId" json:"activity_id"`
	ChannelType string `theorydb:"attr:channelType" json:"channel_type"` // email|sms|voice
	Direction   string `theorydb:"attr:direction" json:"direction"`      // inbound|outbound

	Counterparty string `theorydb:"attr:counterparty" json:"counterparty,omitempty"` // email/phone/agentId
	Action       string `theorydb:"attr:action" json:"action,omitempty"`             // send|receive|call|sms

	MessageID string `theorydb:"attr:messageId" json:"message_id,omitempty"`
	InReplyTo string `theorydb:"attr:inReplyTo" json:"in_reply_to,omitempty"`

	BoundaryCheck       string `theorydb:"attr:boundaryCheck" json:"boundary_check,omitempty"` // passed|violated|skipped
	PreferenceRespected *bool  `theorydb:"attr:preferenceRespected" json:"preference_respected,omitempty"`

	Timestamp time.Time `theorydb:"attr:timestamp" json:"timestamp"`
	// contains filtered or unexported fields
}

SoulAgentCommActivity stores a single communication activity event for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: COMM#{timestamp}#{activityId}

func (*SoulAgentCommActivity) BeforeCreate

func (a *SoulAgentCommActivity) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentCommActivity.

func (*SoulAgentCommActivity) GetPK

func (a *SoulAgentCommActivity) GetPK() string

GetPK returns the partition key for SoulAgentCommActivity.

func (*SoulAgentCommActivity) GetSK

func (a *SoulAgentCommActivity) GetSK() string

GetSK returns the sort key for SoulAgentCommActivity.

func (SoulAgentCommActivity) TableName

func (SoulAgentCommActivity) TableName() string

TableName returns the database table name for SoulAgentCommActivity.

func (*SoulAgentCommActivity) UpdateKeys

func (a *SoulAgentCommActivity) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentCommActivity.

type SoulAgentCommQueue

type SoulAgentCommQueue struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	AgentID     string `theorydb:"attr:agentId" json:"agent_id"`
	MessageID   string `theorydb:"attr:messageId" json:"message_id"`
	ChannelType string `theorydb:"attr:channelType" json:"channel_type"` // email|sms|voice

	FromAddress     string `theorydb:"attr:fromAddress" json:"from_address,omitempty"`
	FromNumber      string `theorydb:"attr:fromNumber" json:"from_number,omitempty"`
	FromSoulAgentID string `theorydb:"attr:fromSoulAgentId" json:"from_soul_agent_id,omitempty"`
	FromDisplayName string `theorydb:"attr:fromDisplayName" json:"from_display_name,omitempty"`

	Subject string `theorydb:"attr:subject" json:"subject,omitempty"`
	Body    string `theorydb:"attr:body" json:"body"`

	InReplyTo string `theorydb:"attr:inReplyTo" json:"in_reply_to,omitempty"`

	ReceivedAt            time.Time `theorydb:"attr:receivedAt" json:"received_at"`
	ScheduledDeliveryTime time.Time `theorydb:"attr:scheduledDeliveryTime" json:"scheduled_delivery_time"`
	Status                string    `theorydb:"attr:status" json:"status"`
	// contains filtered or unexported fields
}

SoulAgentCommQueue stores a queued inbound communication for later delivery.

Keys:

PK: COMM#QUEUE#{agentId}
SK: MSG#{scheduledDeliveryTime}#{messageId}

func (*SoulAgentCommQueue) BeforeCreate

func (q *SoulAgentCommQueue) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentCommQueue.

func (*SoulAgentCommQueue) GetPK

func (q *SoulAgentCommQueue) GetPK() string

GetPK returns the partition key for SoulAgentCommQueue.

func (*SoulAgentCommQueue) GetSK

func (q *SoulAgentCommQueue) GetSK() string

GetSK returns the sort key for SoulAgentCommQueue.

func (SoulAgentCommQueue) TableName

func (SoulAgentCommQueue) TableName() string

TableName returns the database table name for SoulAgentCommQueue.

func (*SoulAgentCommQueue) UpdateKeys

func (q *SoulAgentCommQueue) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentCommQueue.

type SoulAgentContactPreferences

type SoulAgentContactPreferences struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"`

	Preferred string `theorydb:"attr:preferred" json:"preferred"`
	Fallback  string `theorydb:"attr:fallback" json:"fallback,omitempty"`

	AvailabilitySchedule string                          `theorydb:"attr:availabilitySchedule" json:"availability_schedule"`
	AvailabilityTimezone string                          `theorydb:"attr:availabilityTimezone" json:"availability_timezone,omitempty"`
	AvailabilityWindows  []SoulContactAvailabilityWindow `theorydb:"attr:availabilityWindows" json:"availability_windows,omitempty"`

	ResponseTarget    string `theorydb:"attr:responseTarget" json:"response_target,omitempty"`
	ResponseGuarantee string `theorydb:"attr:responseGuarantee" json:"response_guarantee,omitempty"`

	RateLimits map[string]any `theorydb:"attr:rateLimits" json:"rate_limits,omitempty"`

	Languages    []string `theorydb:"attr:languages" json:"languages,omitempty"`
	ContentTypes []string `theorydb:"attr:contentTypes" json:"content_types,omitempty"`

	FirstContactRequireSoul          bool     `theorydb:"attr:firstContactRequireSoul" json:"first_contact_require_soul,omitempty"`
	FirstContactRequireReputation    *float64 `theorydb:"attr:firstContactRequireReputation" json:"first_contact_require_reputation,omitempty"`
	FirstContactIntroductionExpected bool     `theorydb:"attr:firstContactIntroductionExpected" json:"first_contact_introduction_expected,omitempty"`

	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

SoulAgentContactPreferences stores contact preferences for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: CONTACT_PREFERENCES

func (*SoulAgentContactPreferences) BeforeCreate

func (p *SoulAgentContactPreferences) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentContactPreferences.

func (*SoulAgentContactPreferences) BeforeUpdate

func (p *SoulAgentContactPreferences) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentContactPreferences.

func (*SoulAgentContactPreferences) GetPK

GetPK returns the partition key for SoulAgentContactPreferences.

func (*SoulAgentContactPreferences) GetSK

GetSK returns the sort key for SoulAgentContactPreferences.

func (SoulAgentContactPreferences) TableName

func (SoulAgentContactPreferences) TableName() string

TableName returns the database table name for SoulAgentContactPreferences.

func (*SoulAgentContactPreferences) UpdateKeys

func (p *SoulAgentContactPreferences) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentContactPreferences.

type SoulAgentContinuity

type SoulAgentContinuity struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"`

	Type           string   `theorydb:"attr:type" json:"type"`
	Summary        string   `theorydb:"attr:summary" json:"summary"`
	Recovery       string   `theorydb:"attr:recovery" json:"recovery,omitempty"`
	ReferencesJSON string   `theorydb:"attr:references" json:"-"`                      // legacy: JSON array encoded as string
	ReferencesV2   []string `theorydb:"attr:referencesV2" json:"references,omitempty"` // typed list
	Signature      string   `theorydb:"attr:signature" json:"signature,omitempty"`

	Timestamp time.Time `theorydb:"attr:timestamp" json:"timestamp"`
	// contains filtered or unexported fields
}

SoulAgentContinuity stores a single continuity journal entry for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: CONTINUITY#{timestamp}#{entryType}

func (*SoulAgentContinuity) BeforeCreate

func (c *SoulAgentContinuity) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentContinuity.

func (*SoulAgentContinuity) GetPK

func (c *SoulAgentContinuity) GetPK() string

GetPK returns the partition key for SoulAgentContinuity.

func (*SoulAgentContinuity) GetSK

func (c *SoulAgentContinuity) GetSK() string

GetSK returns the sort key for SoulAgentContinuity.

func (SoulAgentContinuity) TableName

func (SoulAgentContinuity) TableName() string

TableName returns the database table name for SoulAgentContinuity.

func (*SoulAgentContinuity) UpdateKeys

func (c *SoulAgentContinuity) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentContinuity.

type SoulAgentDispute

type SoulAgentDispute struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID   string `theorydb:"attr:agentId" json:"agent_id"`
	DisputeID string `theorydb:"attr:disputeId" json:"dispute_id"`

	SignalRef  string `theorydb:"attr:signalRef" json:"signal_ref,omitempty"`
	Evidence   string `theorydb:"attr:evidence" json:"evidence,omitempty"`
	Statement  string `theorydb:"attr:statement" json:"statement,omitempty"`
	Resolution string `theorydb:"attr:resolution" json:"resolution,omitempty"`
	Status     string `theorydb:"attr:status" json:"status"`

	CreatedAt  time.Time `theorydb:"attr:createdAt" json:"created_at"`
	ResolvedAt time.Time `theorydb:"attr:resolvedAt" json:"resolved_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentDispute stores a dispute record for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: DISPUTE#{disputeId}

func (*SoulAgentDispute) BeforeCreate

func (d *SoulAgentDispute) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentDispute.

func (*SoulAgentDispute) BeforeUpdate

func (d *SoulAgentDispute) BeforeUpdate() error

BeforeUpdate updates keys before updating SoulAgentDispute.

func (*SoulAgentDispute) GetPK

func (d *SoulAgentDispute) GetPK() string

GetPK returns the partition key for SoulAgentDispute.

func (*SoulAgentDispute) GetSK

func (d *SoulAgentDispute) GetSK() string

GetSK returns the sort key for SoulAgentDispute.

func (SoulAgentDispute) TableName

func (SoulAgentDispute) TableName() string

TableName returns the database table name for SoulAgentDispute.

func (*SoulAgentDispute) UpdateKeys

func (d *SoulAgentDispute) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentDispute.

type SoulAgentENSResolution

type SoulAgentENSResolution struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	ENSName string `theorydb:"attr:ensName" json:"ens_name"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	Wallet  string `theorydb:"attr:wallet" json:"wallet,omitempty"`
	LocalID string `theorydb:"attr:localId" json:"local_id,omitempty"`
	Domain  string `theorydb:"attr:domain" json:"domain,omitempty"`

	SoulRegistrationURI string `theorydb:"attr:soulRegistrationUri" json:"soul_registration_uri,omitempty"`
	MCPEndpoint         string `theorydb:"attr:mcpEndpoint" json:"mcp_endpoint,omitempty"`
	ActivityPubURI      string `theorydb:"attr:activitypubUri" json:"activitypub_uri,omitempty"`

	Email string `theorydb:"attr:email" json:"email,omitempty"`
	Phone string `theorydb:"attr:phone" json:"phone,omitempty"`

	Description string `theorydb:"attr:description" json:"description,omitempty"`
	Status      string `theorydb:"attr:status" json:"status,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

SoulAgentENSResolution stores ENS gateway material for a single name.

Keys:

PK: ENS#NAME#{ensName}
SK: RESOLUTION

func (*SoulAgentENSResolution) BeforeCreate

func (r *SoulAgentENSResolution) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentENSResolution.

func (*SoulAgentENSResolution) BeforeUpdate

func (r *SoulAgentENSResolution) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentENSResolution.

func (*SoulAgentENSResolution) GetPK

func (r *SoulAgentENSResolution) GetPK() string

GetPK returns the partition key for SoulAgentENSResolution.

func (*SoulAgentENSResolution) GetSK

func (r *SoulAgentENSResolution) GetSK() string

GetSK returns the sort key for SoulAgentENSResolution.

func (SoulAgentENSResolution) TableName

func (SoulAgentENSResolution) TableName() string

TableName returns the database table name for SoulAgentENSResolution.

func (*SoulAgentENSResolution) UpdateKeys

func (r *SoulAgentENSResolution) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentENSResolution.

type SoulAgentFailure

type SoulAgentFailure struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID   string `theorydb:"attr:agentId" json:"agent_id"`
	FailureID string `theorydb:"attr:failureId" json:"failure_id"`

	FailureType string `theorydb:"attr:failureType" json:"failure_type"`
	Description string `theorydb:"attr:description" json:"description,omitempty"`
	Impact      string `theorydb:"attr:impact" json:"impact,omitempty"`
	RecoveryRef string `theorydb:"attr:recoveryRef" json:"recovery_ref,omitempty"`
	Status      string `theorydb:"attr:status" json:"status,omitempty"` // "open", "recovered"

	Timestamp time.Time `theorydb:"attr:timestamp" json:"timestamp"`
	// contains filtered or unexported fields
}

SoulAgentFailure stores a failure record for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: FAILURE#{timestamp}#{failureId}

func (*SoulAgentFailure) BeforeCreate

func (f *SoulAgentFailure) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentFailure.

func (*SoulAgentFailure) GetPK

func (f *SoulAgentFailure) GetPK() string

GetPK returns the partition key for SoulAgentFailure.

func (*SoulAgentFailure) GetSK

func (f *SoulAgentFailure) GetSK() string

GetSK returns the sort key for SoulAgentFailure.

func (SoulAgentFailure) TableName

func (SoulAgentFailure) TableName() string

TableName returns the database table name for SoulAgentFailure.

func (*SoulAgentFailure) UpdateKeys

func (f *SoulAgentFailure) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentFailure.

type SoulAgentIdentity

type SoulAgentIdentity struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"` // hex-encoded uint256

	Domain  string `theorydb:"attr:domain" json:"domain"`
	LocalID string `theorydb:"attr:localId" json:"local_id"`

	Wallet  string `theorydb:"attr:wallet" json:"wallet"`
	TokenID string `theorydb:"attr:tokenId" json:"token_id,omitempty"`
	MetaURI string `theorydb:"attr:metaURI" json:"meta_uri,omitempty"`

	Capabilities []string `theorydb:"attr:capabilities" json:"capabilities,omitempty"`

	// v2: principal declaration
	PrincipalAddress       string `theorydb:"attr:principalAddress" json:"principal_address,omitempty"`
	PrincipalSignature     string `theorydb:"attr:principalSignature" json:"principal_signature,omitempty"`
	PrincipalDeclaration   string `theorydb:"attr:principalDeclaration" json:"principal_declaration,omitempty"`
	PrincipalDeclaredAt    string `theorydb:"attr:principalDeclaredAt" json:"principal_declared_at,omitempty"`
	SelfDescriptionVersion int    `theorydb:"attr:selfDescriptionVersion" json:"self_description_version,omitempty"`

	// v2: lifecycle (replaces simple Status for richer state machine)
	LifecycleStatus    string `theorydb:"attr:lifecycleStatus" json:"lifecycle_status,omitempty"`
	LifecycleReason    string `theorydb:"attr:lifecycleReason" json:"lifecycle_reason,omitempty"`
	SuccessorAgentID   string `theorydb:"attr:successorAgentId" json:"successor_agent_id,omitempty"`
	PredecessorAgentID string `theorydb:"attr:predecessorAgentId" json:"predecessor_agent_id,omitempty"`

	Status     string    `theorydb:"attr:status" json:"status"`
	MintTxHash string    `theorydb:"attr:mintTxHash" json:"mint_tx_hash,omitempty"`
	MintedAt   time.Time `theorydb:"attr:mintedAt" json:"minted_at,omitempty"`
	UpdatedAt  time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`

	// hosted-bound-soul v1 policy vocabulary. These fields are off-chain policy
	// state; they do not grant on-chain authority and must not be interpreted as
	// replacing contract ownership or Safe-governed mutations.
	PolicyVersion                    string `theorydb:"attr:policyVersion" json:"policy_version,omitempty"`
	AnchorState                      string `theorydb:"attr:anchorState" json:"anchor_state,omitempty"`
	OperationalBinding               string `theorydb:"attr:operationalBinding" json:"operational_binding,omitempty"`
	CapabilityPolicyVersion          string `theorydb:"attr:capabilityPolicyVersion" json:"capability_policy_version,omitempty"`
	CallerAccessPaymentPolicyVersion string `theorydb:"attr:callerAccessPaymentPolicyVersion" json:"caller_access_payment_policy_version,omitempty"`
	EmailDefaultAllowed              bool   `theorydb:"attr:emailDefaultAllowed" json:"email_default_allowed,omitempty"`
	PhoneEntitlementStatus           string `theorydb:"attr:phoneEntitlementStatus" json:"phone_entitlement_status,omitempty"`
	SMSAllowed                       bool   `theorydb:"attr:smsAllowed" json:"sms_allowed,omitempty"`
	VoiceAllowed                     bool   `theorydb:"attr:voiceAllowed" json:"voice_allowed,omitempty"`
	PublicPaidCallerAccess           string `theorydb:"attr:publicPaidCallerAccess" json:"public_paid_caller_access,omitempty"`
	PolicyMigrationState             string `theorydb:"attr:policyMigrationState" json:"policy_migration_state,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentIdentity stores the off-chain identity record for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: IDENTITY

func (*SoulAgentIdentity) BeforeCreate

func (a *SoulAgentIdentity) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentIdentity.

func (*SoulAgentIdentity) BeforeUpdate

func (a *SoulAgentIdentity) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentIdentity.

func (*SoulAgentIdentity) GetPK

func (a *SoulAgentIdentity) GetPK() string

GetPK returns the partition key for SoulAgentIdentity.

func (*SoulAgentIdentity) GetSK

func (a *SoulAgentIdentity) GetSK() string

GetSK returns the sort key for SoulAgentIdentity.

func (SoulAgentIdentity) TableName

func (SoulAgentIdentity) TableName() string

TableName returns the database table name for SoulAgentIdentity.

func (*SoulAgentIdentity) UpdateKeys

func (a *SoulAgentIdentity) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentIdentity.

type SoulAgentMintConversation

type SoulAgentMintConversation struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID        string `theorydb:"attr:agentId" json:"agent_id"`
	ConversationID string `theorydb:"attr:conversationId" json:"conversation_id"`

	Model                string `theorydb:"attr:model" json:"model"`
	Messages             string `theorydb:"attr:messages" json:"messages,omitempty"`                          // JSON array of conversation messages
	ProducedDeclarations string `theorydb:"attr:producedDeclarations" json:"produced_declarations,omitempty"` // JSON object of structured output
	Status               string `theorydb:"attr:status" json:"status"`

	Usage          AIUsage `theorydb:"attr:usage" json:"usage,omitempty"`
	ChargedCredits int64   `theorydb:"attr:chargedCredits" json:"charged_credits,omitempty"`

	CreatedAt   time.Time `theorydb:"attr:createdAt" json:"created_at"`
	CompletedAt time.Time `theorydb:"attr:completedAt" json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentMintConversation stores a minting conversation record for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: MINT_CONVERSATION#{conversationId}

func (*SoulAgentMintConversation) BeforeCreate

func (m *SoulAgentMintConversation) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentMintConversation.

func (*SoulAgentMintConversation) BeforeUpdate

func (m *SoulAgentMintConversation) BeforeUpdate() error

BeforeUpdate updates keys before updating SoulAgentMintConversation.

func (*SoulAgentMintConversation) GetPK

func (m *SoulAgentMintConversation) GetPK() string

GetPK returns the partition key for SoulAgentMintConversation.

func (*SoulAgentMintConversation) GetSK

func (m *SoulAgentMintConversation) GetSK() string

GetSK returns the sort key for SoulAgentMintConversation.

func (SoulAgentMintConversation) TableName

func (SoulAgentMintConversation) TableName() string

TableName returns the database table name for SoulAgentMintConversation.

func (*SoulAgentMintConversation) UpdateKeys

func (m *SoulAgentMintConversation) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentMintConversation.

type SoulAgentPeerEndorsement

type SoulAgentPeerEndorsement struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID         string `theorydb:"attr:agentId" json:"agent_id"` // endorsed agent (hex-encoded uint256)
	EndorserAgentID string `theorydb:"attr:endorserAgentId" json:"endorser_agent_id"`

	Message   string `theorydb:"attr:message" json:"message,omitempty"`
	Signature string `theorydb:"attr:signature" json:"signature"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

SoulAgentPeerEndorsement stores a signed endorsement from one agent to another.

Keys:

PK: SOUL#AGENT#{agentId}
SK: ENDORSEMENT#{endorserAgentId}

func (*SoulAgentPeerEndorsement) BeforeCreate

func (e *SoulAgentPeerEndorsement) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentPeerEndorsement.

func (*SoulAgentPeerEndorsement) GetPK

func (e *SoulAgentPeerEndorsement) GetPK() string

GetPK returns the partition key for SoulAgentPeerEndorsement.

func (*SoulAgentPeerEndorsement) GetSK

func (e *SoulAgentPeerEndorsement) GetSK() string

GetSK returns the sort key for SoulAgentPeerEndorsement.

func (SoulAgentPeerEndorsement) TableName

func (SoulAgentPeerEndorsement) TableName() string

TableName returns the database table name for SoulAgentPeerEndorsement.

func (*SoulAgentPeerEndorsement) UpdateKeys

func (e *SoulAgentPeerEndorsement) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentPeerEndorsement.

type SoulAgentPromotion added in v0.2.0

type SoulAgentPromotion struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`
	GSI2PK string `theorydb:"index:gsi2,pk,attr:gsi2PK" json:"-"`
	GSI2SK string `theorydb:"index:gsi2,sk,attr:gsi2SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"`

	RegistrationID string `theorydb:"attr:registrationId" json:"registration_id,omitempty"`
	RequestedBy    string `theorydb:"attr:requestedBy" json:"requested_by,omitempty"`

	Domain  string `theorydb:"attr:domain" json:"domain"`
	LocalID string `theorydb:"attr:localId" json:"local_id"`
	Wallet  string `theorydb:"attr:wallet" json:"wallet"`

	Stage           string `theorydb:"attr:stage" json:"stage"`
	RequestStatus   string `theorydb:"attr:requestStatus" json:"request_status"`
	ReviewStatus    string `theorydb:"attr:reviewStatus" json:"review_status"`
	ApprovalStatus  string `theorydb:"attr:approvalStatus" json:"approval_status"`
	ReadinessStatus string `theorydb:"attr:readinessStatus" json:"readiness_status"`

	MintOperationID     string `theorydb:"attr:mintOperationId" json:"mint_operation_id,omitempty"`
	MintOperationStatus string `theorydb:"attr:mintOperationStatus" json:"mint_operation_status,omitempty"`

	PrincipalAddress string `theorydb:"attr:principalAddress" json:"principal_address,omitempty"`

	LatestConversationID     string `theorydb:"attr:latestConversationId" json:"latest_conversation_id,omitempty"`
	LatestConversationStatus string `theorydb:"attr:latestConversationStatus" json:"latest_conversation_status,omitempty"`
	LatestReviewSHA256       string `theorydb:"attr:latestReviewSha256" json:"latest_review_sha256,omitempty"`
	LatestBoundaryCount      int    `theorydb:"attr:latestBoundaryCount" json:"latest_boundary_count,omitempty"`
	LatestCapabilityCount    int    `theorydb:"attr:latestCapabilityCount" json:"latest_capability_count,omitempty"`

	PublishedVersion int `theorydb:"attr:publishedVersion" json:"published_version,omitempty"`

	RequestedAt     time.Time `theorydb:"attr:requestedAt" json:"requested_at,omitempty"`
	VerifiedAt      time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`
	ApprovedAt      time.Time `theorydb:"attr:approvedAt" json:"approved_at,omitempty"`
	MintedAt        time.Time `theorydb:"attr:mintedAt" json:"minted_at,omitempty"`
	ReviewStartedAt time.Time `theorydb:"attr:reviewStartedAt" json:"review_started_at,omitempty"`
	ReviewReadyAt   time.Time `theorydb:"attr:reviewReadyAt" json:"review_ready_at,omitempty"`
	GraduatedAt     time.Time `theorydb:"attr:graduatedAt" json:"graduated_at,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

SoulAgentPromotion stores the durable, agent-centered promotion workflow state for moving from request through review and graduation.

Keys:

PK: SOUL#AGENT#{agentId}
SK: PROMOTION

func (*SoulAgentPromotion) BeforeCreate added in v0.2.0

func (p *SoulAgentPromotion) BeforeCreate() error

func (*SoulAgentPromotion) BeforeUpdate added in v0.2.0

func (p *SoulAgentPromotion) BeforeUpdate() error

func (*SoulAgentPromotion) GetPK added in v0.2.0

func (p *SoulAgentPromotion) GetPK() string

func (*SoulAgentPromotion) GetSK added in v0.2.0

func (p *SoulAgentPromotion) GetSK() string

func (SoulAgentPromotion) TableName added in v0.2.0

func (SoulAgentPromotion) TableName() string

func (*SoulAgentPromotion) UpdateKeys added in v0.2.0

func (p *SoulAgentPromotion) UpdateKeys() error

type SoulAgentPromotionLifecycleEvent added in v0.2.0

type SoulAgentPromotionLifecycleEvent struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	AgentID        string `theorydb:"attr:agentId" json:"agent_id"`
	EventID        string `theorydb:"attr:eventId" json:"event_id"`
	EventType      string `theorydb:"attr:eventType" json:"event_type"`
	Summary        string `theorydb:"attr:summary" json:"summary,omitempty"`
	RequestedBy    string `theorydb:"attr:requestedBy" json:"requested_by,omitempty"`
	RegistrationID string `theorydb:"attr:registrationId" json:"registration_id,omitempty"`

	RequestID      string `theorydb:"attr:requestId" json:"request_id,omitempty"`
	OperationID    string `theorydb:"attr:operationId" json:"operation_id,omitempty"`
	ConversationID string `theorydb:"attr:conversationId" json:"conversation_id,omitempty"`

	Domain  string `theorydb:"attr:domain" json:"domain,omitempty"`
	LocalID string `theorydb:"attr:localId" json:"local_id,omitempty"`
	Wallet  string `theorydb:"attr:wallet" json:"wallet,omitempty"`

	Stage           string `theorydb:"attr:stage" json:"stage,omitempty"`
	RequestStatus   string `theorydb:"attr:requestStatus" json:"request_status,omitempty"`
	ReviewStatus    string `theorydb:"attr:reviewStatus" json:"review_status,omitempty"`
	ApprovalStatus  string `theorydb:"attr:approvalStatus" json:"approval_status,omitempty"`
	ReadinessStatus string `theorydb:"attr:readinessStatus" json:"readiness_status,omitempty"`

	MintOperationID     string `theorydb:"attr:mintOperationId" json:"mint_operation_id,omitempty"`
	MintOperationStatus string `theorydb:"attr:mintOperationStatus" json:"mint_operation_status,omitempty"`
	PrincipalAddress    string `theorydb:"attr:principalAddress" json:"principal_address,omitempty"`

	AnchorState          string    `theorydb:"attr:anchorState" json:"anchor_state,omitempty"`
	AnchorEvidenceTxHash string    `theorydb:"attr:anchorEvidenceTxHash" json:"anchor_evidence_tx_hash,omitempty"`
	AnchorEvidenceAt     time.Time `theorydb:"attr:anchorEvidenceAt" json:"anchor_evidence_at,omitempty"`

	LatestConversationID     string `theorydb:"attr:latestConversationId" json:"latest_conversation_id,omitempty"`
	LatestConversationStatus string `theorydb:"attr:latestConversationStatus" json:"latest_conversation_status,omitempty"`
	LatestReviewSHA256       string `theorydb:"attr:latestReviewSha256" json:"latest_review_sha256,omitempty"`
	LatestBoundaryCount      int    `theorydb:"attr:latestBoundaryCount" json:"latest_boundary_count,omitempty"`
	LatestCapabilityCount    int    `theorydb:"attr:latestCapabilityCount" json:"latest_capability_count,omitempty"`

	PublishedVersion int `theorydb:"attr:publishedVersion" json:"published_version,omitempty"`

	RequestedAt     time.Time `theorydb:"attr:requestedAt" json:"requested_at,omitempty"`
	VerifiedAt      time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`
	ApprovedAt      time.Time `theorydb:"attr:approvedAt" json:"approved_at,omitempty"`
	MintedAt        time.Time `theorydb:"attr:mintedAt" json:"minted_at,omitempty"`
	ReviewStartedAt time.Time `theorydb:"attr:reviewStartedAt" json:"review_started_at,omitempty"`
	ReviewReadyAt   time.Time `theorydb:"attr:reviewReadyAt" json:"review_ready_at,omitempty"`
	GraduatedAt     time.Time `theorydb:"attr:graduatedAt" json:"graduated_at,omitempty"`
	CreatedAt       time.Time `theorydb:"attr:createdAt" json:"created_at,omitempty"`
	UpdatedAt       time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	OccurredAt      time.Time `theorydb:"attr:occurredAt" json:"occurred_at"`
	// contains filtered or unexported fields
}

SoulAgentPromotionLifecycleEvent stores a durable lifecycle transition snapshot for a promotion workflow.

Keys:

PK: SOUL#AGENT#{agentId}
SK: EVENT#{timestamp}#{eventId}

Indexes:

GSI1PK: SOUL_PROMOTION_EVENT_REQUESTER#{requestedBy}
GSI1SK: {timestamp}#{agentId}#{eventId}

func (*SoulAgentPromotionLifecycleEvent) BeforeCreate added in v0.2.0

func (e *SoulAgentPromotionLifecycleEvent) BeforeCreate() error

func (*SoulAgentPromotionLifecycleEvent) GetPK added in v0.2.0

func (*SoulAgentPromotionLifecycleEvent) GetSK added in v0.2.0

func (SoulAgentPromotionLifecycleEvent) TableName added in v0.2.0

func (*SoulAgentPromotionLifecycleEvent) UpdateKeys added in v0.2.0

func (e *SoulAgentPromotionLifecycleEvent) UpdateKeys() error

type SoulAgentRegistration

type SoulAgentRegistration struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID       string `theorydb:"attr:id" json:"id"`
	Username string `theorydb:"attr:username" json:"username,omitempty"`

	DomainRaw        string `theorydb:"attr:domainRaw" json:"domain_raw,omitempty"`
	DomainNormalized string `theorydb:"attr:domainNormalized" json:"domain_normalized"`

	LocalIDRaw string `theorydb:"attr:localIdRaw" json:"local_id_raw,omitempty"`
	LocalID    string `theorydb:"attr:localId" json:"local_id"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"` // hex-encoded uint256
	Wallet  string `theorydb:"attr:wallet" json:"wallet_address"`

	Capabilities []string `theorydb:"attr:capabilities" json:"capabilities,omitempty"`

	WalletNonce   string `theorydb:"attr:walletNonce" json:"wallet_nonce,omitempty"`
	WalletMessage string `theorydb:"attr:walletMessage" json:"wallet_message,omitempty"`

	ProofToken string `theorydb:"attr:proofToken" json:"proof_token,omitempty"`

	DNSVerified    bool      `theorydb:"attr:dnsVerified" json:"dns_verified,omitempty"`
	HTTPSVerified  bool      `theorydb:"attr:httpsVerified" json:"https_verified,omitempty"`
	WalletVerified bool      `theorydb:"attr:walletVerified" json:"wallet_verified,omitempty"`
	VerifiedAt     time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`

	Status string `theorydb:"attr:status" json:"status"`

	CreatedAt   time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt   time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt   time.Time `theorydb:"attr:expiresAt" json:"expires_at,omitempty"`
	CompletedAt time.Time `theorydb:"attr:completedAt" json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentRegistration represents a soul agent registration request with proof challenges.

func (*SoulAgentRegistration) BeforeCreate

func (r *SoulAgentRegistration) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentRegistration.

func (*SoulAgentRegistration) BeforeUpdate

func (r *SoulAgentRegistration) BeforeUpdate() error

BeforeUpdate updates timestamps and TTL before updating SoulAgentRegistration.

func (*SoulAgentRegistration) GetPK

func (r *SoulAgentRegistration) GetPK() string

GetPK returns the partition key for SoulAgentRegistration.

func (*SoulAgentRegistration) GetSK

func (r *SoulAgentRegistration) GetSK() string

GetSK returns the sort key for SoulAgentRegistration.

func (SoulAgentRegistration) TableName

func (SoulAgentRegistration) TableName() string

TableName returns the database table name for SoulAgentRegistration.

func (*SoulAgentRegistration) UpdateKeys

func (r *SoulAgentRegistration) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentRegistration.

type SoulAgentRelationship

type SoulAgentRelationship struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	FromAgentID string `theorydb:"attr:fromAgentId" json:"from_agent_id"`
	ToAgentID   string `theorydb:"attr:toAgentId" json:"to_agent_id"`

	Type        string         `theorydb:"attr:type" json:"type"`
	ContextJSON string         `theorydb:"attr:context" json:"-"`                   // legacy: JSON object encoded as string
	ContextV2   map[string]any `theorydb:"attr:contextV2" json:"context,omitempty"` // typed context map
	TaskType    string         `theorydb:"attr:taskType" json:"-"`                  // extracted for filtering

	Message   string `theorydb:"attr:message" json:"message,omitempty"`
	Signature string `theorydb:"attr:signature" json:"signature,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

SoulAgentRelationship stores a relationship record between two soul agents. The record is stored under the *target* agent (toAgentId) for easy lookup of "who has expressed something about this agent."

Keys:

PK: SOUL#AGENT#{agentId}       (toAgentId — the agent the record is about)
SK: RELATIONSHIP#{fromAgentId}#{timestamp}

func (*SoulAgentRelationship) BeforeCreate

func (r *SoulAgentRelationship) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentRelationship.

func (*SoulAgentRelationship) GetPK

func (r *SoulAgentRelationship) GetPK() string

GetPK returns the partition key for SoulAgentRelationship.

func (*SoulAgentRelationship) GetSK

func (r *SoulAgentRelationship) GetSK() string

GetSK returns the sort key for SoulAgentRelationship.

func (SoulAgentRelationship) TableName

func (SoulAgentRelationship) TableName() string

TableName returns the database table name for SoulAgentRelationship.

func (*SoulAgentRelationship) UpdateKeys

func (r *SoulAgentRelationship) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentRelationship.

type SoulAgentReputation

type SoulAgentReputation struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"` // hex-encoded uint256

	BlockRef int64 `theorydb:"attr:blockRef" json:"block_ref,omitempty"`

	Composite     float64 `theorydb:"attr:composite" json:"composite"`
	Economic      float64 `theorydb:"attr:economic" json:"economic"`
	Social        float64 `theorydb:"attr:social" json:"social"`
	Validation    float64 `theorydb:"attr:validation" json:"validation"`
	Trust         float64 `theorydb:"attr:trust" json:"trust"`
	Integrity     float64 `theorydb:"attr:integrity" json:"integrity"`
	Communication float64 `theorydb:"attr:communication" json:"communication"`

	TipsReceived         int64 `theorydb:"attr:tipsReceived" json:"tips_received"`
	Interactions         int64 `theorydb:"attr:interactions" json:"interactions"`
	ValidationsPassed    int64 `theorydb:"attr:validationsPassed" json:"validations_passed"`
	Endorsements         int64 `theorydb:"attr:endorsements" json:"endorsements"`
	Flags                int64 `theorydb:"attr:flags" json:"flags"`
	DelegationsCompleted int64 `theorydb:"attr:delegationsCompleted" json:"delegations_completed"`
	BoundaryViolations   int64 `theorydb:"attr:boundaryViolations" json:"boundary_violations"`
	FailureRecoveries    int64 `theorydb:"attr:failureRecoveries" json:"failure_recoveries"`

	EmailsSent                      int64   `theorydb:"attr:emailsSent" json:"emails_sent"`
	EmailsReceived                  int64   `theorydb:"attr:emailsReceived" json:"emails_received"`
	SMSSent                         int64   `theorydb:"attr:smsSent" json:"sms_sent"`
	SMSReceived                     int64   `theorydb:"attr:smsReceived" json:"sms_received"`
	CallsMade                       int64   `theorydb:"attr:callsMade" json:"calls_made"`
	CallsReceived                   int64   `theorydb:"attr:callsReceived" json:"calls_received"`
	CommunicationBoundaryViolations int64   `theorydb:"attr:communicationBoundaryViolations" json:"communication_boundary_violations"`
	SpamReports                     int64   `theorydb:"attr:spamReports" json:"spam_reports"`
	ResponseRate                    float64 `theorydb:"attr:responseRate" json:"response_rate"`
	AvgResponseTimeMinutes          float64 `theorydb:"attr:avgResponseTimeMinutes" json:"avg_response_time_minutes"`

	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentReputation stores the off-chain reputation summary record for a soul agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: REPUTATION

func (*SoulAgentReputation) BeforeCreate

func (r *SoulAgentReputation) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentReputation.

func (*SoulAgentReputation) BeforeUpdate

func (r *SoulAgentReputation) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentReputation.

func (*SoulAgentReputation) GetPK

func (r *SoulAgentReputation) GetPK() string

GetPK returns the partition key for SoulAgentReputation.

func (*SoulAgentReputation) GetSK

func (r *SoulAgentReputation) GetSK() string

GetSK returns the sort key for SoulAgentReputation.

func (SoulAgentReputation) TableName

func (SoulAgentReputation) TableName() string

TableName returns the database table name for SoulAgentReputation.

func (*SoulAgentReputation) UpdateKeys

func (r *SoulAgentReputation) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentReputation.

type SoulAgentValidationChallenge

type SoulAgentValidationChallenge struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"` // hex-encoded uint256

	ChallengeID   string `theorydb:"attr:challengeId" json:"challenge_id"`
	ChallengeType string `theorydb:"attr:challengeType" json:"challenge_type"`
	ValidatorID   string `theorydb:"attr:validatorId" json:"validator_id"`

	Request  string `theorydb:"attr:request" json:"request,omitempty"`
	Response string `theorydb:"attr:response" json:"response,omitempty"`

	Status      string  `theorydb:"attr:status" json:"status"`
	OptInStatus string  `theorydb:"attr:optInStatus" json:"opt_in_status,omitempty"`
	Result      string  `theorydb:"attr:result" json:"result,omitempty"`
	Score       float64 `theorydb:"attr:score" json:"score,omitempty"`

	IssuedAt    time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	RespondedAt time.Time `theorydb:"attr:respondedAt" json:"responded_at,omitempty"`
	EvaluatedAt time.Time `theorydb:"attr:evaluatedAt" json:"evaluated_at,omitempty"`
	UpdatedAt   time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulAgentValidationChallenge stores the mutable state for a validation challenge (issued → responded → evaluated).

Keys:

PK: SOUL#AGENT#{agentId}
SK: VALIDATIONCHAL#{challengeId}

func (*SoulAgentValidationChallenge) BeforeCreate

func (c *SoulAgentValidationChallenge) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentValidationChallenge.

func (*SoulAgentValidationChallenge) BeforeUpdate

func (c *SoulAgentValidationChallenge) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulAgentValidationChallenge.

func (*SoulAgentValidationChallenge) GetPK

GetPK returns the partition key for SoulAgentValidationChallenge.

func (*SoulAgentValidationChallenge) GetSK

GetSK returns the sort key for SoulAgentValidationChallenge.

func (SoulAgentValidationChallenge) TableName

TableName returns the database table name for SoulAgentValidationChallenge.

func (*SoulAgentValidationChallenge) UpdateKeys

func (c *SoulAgentValidationChallenge) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentValidationChallenge.

type SoulAgentValidationRecord

type SoulAgentValidationRecord struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id"` // hex-encoded uint256

	ChallengeID   string `theorydb:"attr:challengeId" json:"challenge_id"`
	ChallengeType string `theorydb:"attr:challengeType" json:"challenge_type"`
	ValidatorID   string `theorydb:"attr:validatorId" json:"validator_id"`

	Request  string `theorydb:"attr:request" json:"request,omitempty"`
	Response string `theorydb:"attr:response" json:"response,omitempty"`

	Result string  `theorydb:"attr:result" json:"result"`
	Score  float64 `theorydb:"attr:score" json:"score"`

	OptInStatus string `theorydb:"attr:optInStatus" json:"opt_in_status,omitempty"`

	EvaluatedAt time.Time `theorydb:"attr:evaluatedAt" json:"evaluated_at"`
	// contains filtered or unexported fields
}

SoulAgentValidationRecord stores a single validation challenge evaluation record.

Keys:

PK: SOUL#AGENT#{agentId}
SK: VALIDATION#{timestamp}#{challengeId}

func (*SoulAgentValidationRecord) BeforeCreate

func (v *SoulAgentValidationRecord) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentValidationRecord.

func (*SoulAgentValidationRecord) GetPK

func (v *SoulAgentValidationRecord) GetPK() string

GetPK returns the partition key for SoulAgentValidationRecord.

func (*SoulAgentValidationRecord) GetSK

func (v *SoulAgentValidationRecord) GetSK() string

GetSK returns the sort key for SoulAgentValidationRecord.

func (SoulAgentValidationRecord) TableName

func (SoulAgentValidationRecord) TableName() string

TableName returns the database table name for SoulAgentValidationRecord.

func (*SoulAgentValidationRecord) UpdateKeys

func (v *SoulAgentValidationRecord) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentValidationRecord.

type SoulAgentVersion

type SoulAgentVersion struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AgentID                    string `theorydb:"attr:agentId" json:"agent_id"`
	VersionNumber              int    `theorydb:"attr:versionNumber" json:"version_number"`
	RegistrationURI            string `theorydb:"attr:registrationUri" json:"registration_uri"`
	RegistrationSHA256         string `theorydb:"attr:registrationSha256" json:"registration_sha256,omitempty"`
	PreviousRegistrationSHA256 string `theorydb:"attr:previousRegistrationSha256" json:"previous_registration_sha256,omitempty"`
	ChangeSummary              string `theorydb:"attr:changeSummary" json:"change_summary,omitempty"`
	SelfAttestation            string `theorydb:"attr:selfAttestation" json:"self_attestation,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

SoulAgentVersion stores a version record for a soul agent's registration file.

Keys:

PK: SOUL#AGENT#{agentId}
SK: VERSION#{versionNumber}

func (*SoulAgentVersion) BeforeCreate

func (v *SoulAgentVersion) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulAgentVersion.

func (*SoulAgentVersion) GetPK

func (v *SoulAgentVersion) GetPK() string

GetPK returns the partition key for SoulAgentVersion.

func (*SoulAgentVersion) GetSK

func (v *SoulAgentVersion) GetSK() string

GetSK returns the sort key for SoulAgentVersion.

func (SoulAgentVersion) TableName

func (SoulAgentVersion) TableName() string

TableName returns the database table name for SoulAgentVersion.

func (*SoulAgentVersion) UpdateKeys

func (v *SoulAgentVersion) UpdateKeys() error

UpdateKeys updates the database keys for SoulAgentVersion.

type SoulBoundaryKeywordAgentIndex

type SoulBoundaryKeywordAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Keyword string `theorydb:"attr:keyword" json:"keyword"`
	Domain  string `theorydb:"attr:domain" json:"domain"`
	LocalID string `theorydb:"attr:localId" json:"local_id"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulBoundaryKeywordAgentIndex is a materialized index for looking up agents by boundary keyword.

Keys:

PK: SOUL#BOUNDARY#{keyword}
SK: DOMAIN#{normalizedDomain}#LOCAL#{normalizedLocalAgentId}#AGENT#{agentId}

func (*SoulBoundaryKeywordAgentIndex) BeforeCreate

func (i *SoulBoundaryKeywordAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulBoundaryKeywordAgentIndex.

func (*SoulBoundaryKeywordAgentIndex) GetPK

GetPK returns the partition key for SoulBoundaryKeywordAgentIndex.

func (*SoulBoundaryKeywordAgentIndex) GetSK

GetSK returns the sort key for SoulBoundaryKeywordAgentIndex.

func (SoulBoundaryKeywordAgentIndex) TableName

TableName returns the database table name for SoulBoundaryKeywordAgentIndex.

func (*SoulBoundaryKeywordAgentIndex) UpdateKeys

func (i *SoulBoundaryKeywordAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulBoundaryKeywordAgentIndex.

type SoulCapabilityAgentIndex

type SoulCapabilityAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Capability string `theorydb:"attr:capability" json:"capability"`
	ClaimLevel string `theorydb:"attr:claimLevel" json:"claim_level,omitempty"`
	Domain     string `theorydb:"attr:domain" json:"domain"`
	LocalID    string `theorydb:"attr:localId" json:"local_id"`
	AgentID    string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulCapabilityAgentIndex is a materialized index for looking up agents by capability.

Keys:

PK: SOUL#CAP#{capability}
SK: DOMAIN#{normalizedDomain}#LOCAL#{normalizedLocalAgentId}#AGENT#{agentId}

func (*SoulCapabilityAgentIndex) BeforeCreate

func (i *SoulCapabilityAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulCapabilityAgentIndex.

func (*SoulCapabilityAgentIndex) GetPK

func (i *SoulCapabilityAgentIndex) GetPK() string

GetPK returns the partition key for SoulCapabilityAgentIndex.

func (*SoulCapabilityAgentIndex) GetSK

func (i *SoulCapabilityAgentIndex) GetSK() string

GetSK returns the sort key for SoulCapabilityAgentIndex.

func (SoulCapabilityAgentIndex) TableName

func (SoulCapabilityAgentIndex) TableName() string

TableName returns the database table name for SoulCapabilityAgentIndex.

func (*SoulCapabilityAgentIndex) UpdateKeys

func (i *SoulCapabilityAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulCapabilityAgentIndex.

type SoulChannelAgentIndex

type SoulChannelAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	ChannelType string `theorydb:"attr:channelType" json:"channel_type"` // email|phone
	Domain      string `theorydb:"attr:domain" json:"domain"`
	LocalID     string `theorydb:"attr:localId" json:"local_id"`
	AgentID     string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulChannelAgentIndex is a materialized index for searching agents by channel type.

Keys:

PK: SOUL#CHANNEL#{channelType}
SK: DOMAIN#{normalizedDomain}#LOCAL#{normalizedLocalAgentId}#AGENT#{agentId}

func (*SoulChannelAgentIndex) BeforeCreate

func (i *SoulChannelAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulChannelAgentIndex.

func (*SoulChannelAgentIndex) GetPK

func (i *SoulChannelAgentIndex) GetPK() string

GetPK returns the partition key for SoulChannelAgentIndex.

func (*SoulChannelAgentIndex) GetSK

func (i *SoulChannelAgentIndex) GetSK() string

GetSK returns the sort key for SoulChannelAgentIndex.

func (SoulChannelAgentIndex) TableName

func (SoulChannelAgentIndex) TableName() string

TableName returns the database table name for SoulChannelAgentIndex.

func (*SoulChannelAgentIndex) UpdateKeys

func (i *SoulChannelAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulChannelAgentIndex.

type SoulCommMailboxEvent added in v0.2.6

type SoulCommMailboxEvent struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK,omitempty" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK,omitempty" json:"-"`
	GSI2PK string `theorydb:"index:gsi2,pk,attr:gsi2PK,omitempty" json:"-"`
	GSI2SK string `theorydb:"index:gsi2,sk,attr:gsi2SK,omitempty" json:"-"`

	EventID      string    `theorydb:"attr:eventId" json:"event_id"`
	DeliveryID   string    `theorydb:"attr:deliveryId" json:"delivery_id"`
	MessageID    string    `theorydb:"attr:messageId" json:"message_id,omitempty"`
	ThreadID     string    `theorydb:"attr:threadId" json:"thread_id,omitempty"`
	InstanceSlug string    `theorydb:"attr:instanceSlug" json:"instance_slug"`
	AgentID      string    `theorydb:"attr:agentId" json:"agent_id"`
	Direction    string    `theorydb:"attr:direction" json:"direction"`
	ChannelType  string    `theorydb:"attr:channelType" json:"channel_type"`
	EventType    string    `theorydb:"attr:eventType" json:"event_type"`
	Status       string    `theorydb:"attr:status" json:"status,omitempty"`
	Actor        string    `theorydb:"attr:actor" json:"actor,omitempty"`
	DetailsJSON  string    `theorydb:"attr:detailsJson" json:"details_json,omitempty"`
	CreatedAt    time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

SoulCommMailboxEvent stores immutable audit/history events for a mailbox delivery. Events intentionally avoid message body content.

func (*SoulCommMailboxEvent) BeforeCreate added in v0.2.6

func (e *SoulCommMailboxEvent) BeforeCreate() error

BeforeCreate sets defaults and keys before creating an immutable event row.

func (*SoulCommMailboxEvent) GetPK added in v0.2.6

func (e *SoulCommMailboxEvent) GetPK() string

GetPK returns the partition key for SoulCommMailboxEvent.

func (*SoulCommMailboxEvent) GetSK added in v0.2.6

func (e *SoulCommMailboxEvent) GetSK() string

GetSK returns the sort key for SoulCommMailboxEvent.

func (SoulCommMailboxEvent) TableName added in v0.2.6

func (SoulCommMailboxEvent) TableName() string

TableName returns the database table name for SoulCommMailboxEvent.

func (*SoulCommMailboxEvent) UpdateKeys added in v0.2.6

func (e *SoulCommMailboxEvent) UpdateKeys() error

UpdateKeys updates database keys for a mailbox event row.

func (SoulCommMailboxEvent) WritePolicy added in v0.2.6

WritePolicy makes mailbox event rows append-only.

type SoulCommMailboxMessage added in v0.2.6

type SoulCommMailboxMessage struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK,omitempty" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK,omitempty" json:"-"`
	GSI2PK string `theorydb:"index:gsi2,pk,attr:gsi2PK,omitempty" json:"-"`
	GSI2SK string `theorydb:"index:gsi2,sk,attr:gsi2SK,omitempty" json:"-"`

	DeliveryID   string `theorydb:"attr:deliveryId" json:"delivery_id"`
	MessageID    string `theorydb:"attr:messageId" json:"message_id"`
	ThreadID     string `theorydb:"attr:threadId" json:"thread_id"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	AgentID      string `theorydb:"attr:agentId" json:"agent_id"`

	Direction   string `theorydb:"attr:direction" json:"direction"`      // inbound|outbound
	ChannelType string `theorydb:"attr:channelType" json:"channel_type"` // email|sms|voice

	Provider          string `theorydb:"attr:provider" json:"provider,omitempty"`
	ProviderMessageID string `theorydb:"attr:providerMessageId" json:"provider_message_id,omitempty"`
	Status            string `theorydb:"attr:status" json:"status"`

	FromAddress     string `theorydb:"attr:fromAddress" json:"from_address,omitempty"`
	FromNumber      string `theorydb:"attr:fromNumber" json:"from_number,omitempty"`
	FromSoulAgentID string `theorydb:"attr:fromSoulAgentId" json:"from_soul_agent_id,omitempty"`
	FromDisplayName string `theorydb:"attr:fromDisplayName" json:"from_display_name,omitempty"`
	ToAddress       string `theorydb:"attr:toAddress" json:"to_address,omitempty"`
	ToNumber        string `theorydb:"attr:toNumber" json:"to_number,omitempty"`
	ToSoulAgentID   string `theorydb:"attr:toSoulAgentId" json:"to_soul_agent_id,omitempty"`
	ToDisplayName   string `theorydb:"attr:toDisplayName" json:"to_display_name,omitempty"`

	Subject string `theorydb:"attr:subject" json:"subject,omitempty"`
	Preview string `theorydb:"attr:preview" json:"preview,omitempty"`

	ContentStorage  string    `theorydb:"attr:contentStorage" json:"content_storage,omitempty"`
	ContentBucket   string    `theorydb:"attr:contentBucket" json:"content_bucket,omitempty"`
	ContentKey      string    `theorydb:"attr:contentKey" json:"content_key,omitempty"`
	ContentSHA256   string    `theorydb:"attr:contentSha256" json:"content_sha256,omitempty"`
	ContentBytes    int64     `theorydb:"attr:contentBytes" json:"content_bytes,omitempty"`
	ContentMimeType string    `theorydb:"attr:contentMimeType" json:"content_mime_type,omitempty"`
	ContentStoredAt time.Time `theorydb:"attr:contentStoredAt" json:"content_stored_at,omitempty"`
	HasContent      bool      `theorydb:"attr:hasContent" json:"has_content"`

	Read     bool `theorydb:"attr:read" json:"read"`
	Archived bool `theorydb:"attr:archived" json:"archived"`
	Deleted  bool `theorydb:"attr:deleted" json:"deleted"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

SoulCommMailboxMessage stores the canonical current mailbox row for a soul comm delivery. The partition key scopes every list query to a specific instance + agent pair; direct delivery and thread lookups use tenant-scoped GSIs.

Keys:

PK: COMM#MAILBOX#INSTANCE#{instanceSlug}#AGENT#{agentId}
SK: MSG#{timestamp}#{deliveryId}
GSI1PK: COMM#MAILBOX#DELIVERY#{deliveryId}
GSI1SK: CURRENT
GSI2PK: COMM#MAILBOX#INSTANCE#{instanceSlug}#AGENT#{agentId}#THREAD#{threadId}
GSI2SK: MSG#{timestamp}#{deliveryId}

The current row is mutable only for mailbox state and provider status; identity, provenance, and content identity fields are protected by TableTheory write policy metadata.

func (*SoulCommMailboxMessage) BeforeCreate added in v0.2.6

func (m *SoulCommMailboxMessage) BeforeCreate() error

BeforeCreate sets defaults and keys before creating a mailbox current row.

func (*SoulCommMailboxMessage) BeforeUpdate added in v0.2.6

func (m *SoulCommMailboxMessage) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before mutating a mailbox current row.

func (*SoulCommMailboxMessage) GetPK added in v0.2.6

func (m *SoulCommMailboxMessage) GetPK() string

GetPK returns the partition key for SoulCommMailboxMessage.

func (*SoulCommMailboxMessage) GetSK added in v0.2.6

func (m *SoulCommMailboxMessage) GetSK() string

GetSK returns the sort key for SoulCommMailboxMessage.

func (SoulCommMailboxMessage) TableName added in v0.2.6

func (SoulCommMailboxMessage) TableName() string

TableName returns the database table name for SoulCommMailboxMessage.

func (*SoulCommMailboxMessage) UpdateKeys added in v0.2.6

func (m *SoulCommMailboxMessage) UpdateKeys() error

UpdateKeys updates database keys for a mailbox current row.

func (SoulCommMailboxMessage) WritePolicy added in v0.2.6

WritePolicy protects immutable identity, provenance, and content identity fields while leaving mailbox state fields mutable for Host 3 APIs.

type SoulCommMessageStatus

type SoulCommMessageStatus struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK,omitempty" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK,omitempty" json:"-"`

	MessageID      string `theorydb:"attr:messageId" json:"message_id"`
	InstanceSlug   string `theorydb:"attr:instanceSlug" json:"instance_slug,omitempty"`
	AgentID        string `theorydb:"attr:agentId" json:"agent_id"`
	IdempotencyKey string `theorydb:"attr:idempotencyKey" json:"idempotency_key,omitempty"`

	ChannelType string `theorydb:"attr:channelType" json:"channel_type"` // email|sms|voice
	To          string `theorydb:"attr:to" json:"to"`

	Provider          string `theorydb:"attr:provider" json:"provider,omitempty"`
	ProviderMessageID string `theorydb:"attr:providerMessageId" json:"provider_message_id,omitempty"`

	Status          string    `theorydb:"attr:status" json:"status"` // accepted|sent|failed
	ErrorCode       string    `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage    string    `theorydb:"attr:errorMessage" json:"error_message,omitempty"`
	ReplyMessageID  string    `theorydb:"attr:replyMessageId" json:"reply_message_id,omitempty"`
	ReplyBody       string    `theorydb:"attr:replyBody" json:"reply_body,omitempty"`
	ReplyConfidence *float64  `theorydb:"attr:replyConfidence" json:"reply_confidence,omitempty"`
	ReplyReceivedAt time.Time `theorydb:"attr:replyReceivedAt" json:"reply_received_at,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulCommMessageStatus stores delivery status for a single comm message.

Keys:

PK: COMM#MSG#{messageId}
SK: STATUS

func (*SoulCommMessageStatus) BeforeCreate

func (m *SoulCommMessageStatus) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulCommMessageStatus.

func (*SoulCommMessageStatus) BeforeUpdate

func (m *SoulCommMessageStatus) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulCommMessageStatus.

func (*SoulCommMessageStatus) GetPK

func (m *SoulCommMessageStatus) GetPK() string

GetPK returns the partition key for SoulCommMessageStatus.

func (*SoulCommMessageStatus) GetSK

func (m *SoulCommMessageStatus) GetSK() string

GetSK returns the sort key for SoulCommMessageStatus.

func (SoulCommMessageStatus) TableName

func (SoulCommMessageStatus) TableName() string

TableName returns the database table name for SoulCommMessageStatus.

func (*SoulCommMessageStatus) UpdateKeys

func (m *SoulCommMessageStatus) UpdateKeys() error

UpdateKeys updates the database keys for SoulCommMessageStatus.

type SoulCommSendIdempotency added in v0.1.22

type SoulCommSendIdempotency struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	InstanceSlug   string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	AgentID        string `theorydb:"attr:agentId" json:"agent_id"`
	IdempotencyKey string `theorydb:"attr:idempotencyKey" json:"idempotency_key"`
	RequestHash    string `theorydb:"attr:requestHash" json:"request_hash"`

	MessageID      string `theorydb:"attr:messageId" json:"message_id"`
	ChannelType    string `theorydb:"attr:channelType" json:"channel_type"`
	To             string `theorydb:"attr:to" json:"to"`
	Status         string `theorydb:"attr:status" json:"status"`                  // processing|succeeded|failed
	ResponseStatus string `theorydb:"attr:responseStatus" json:"response_status"` // accepted|sent|failed

	Provider          string `theorydb:"attr:provider" json:"provider,omitempty"`
	ProviderMessageID string `theorydb:"attr:providerMessageId" json:"provider_message_id,omitempty"`

	ErrorCode       string `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage    string `theorydb:"attr:errorMessage" json:"error_message,omitempty"`
	ErrorStatusCode int    `theorydb:"attr:errorStatusCode" json:"error_status_code,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulCommSendIdempotency stores the outcome for an outbound comm send request keyed by caller-provided idempotency material so retries can return the original result without re-dispatching the provider call.

func (*SoulCommSendIdempotency) BeforeCreate added in v0.1.22

func (m *SoulCommSendIdempotency) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulCommSendIdempotency.

func (*SoulCommSendIdempotency) BeforeUpdate added in v0.1.22

func (m *SoulCommSendIdempotency) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulCommSendIdempotency.

func (*SoulCommSendIdempotency) GetPK added in v0.1.22

func (m *SoulCommSendIdempotency) GetPK() string

GetPK returns the partition key for SoulCommSendIdempotency.

func (*SoulCommSendIdempotency) GetSK added in v0.1.22

func (m *SoulCommSendIdempotency) GetSK() string

GetSK returns the sort key for SoulCommSendIdempotency.

func (SoulCommSendIdempotency) TableName added in v0.1.22

func (SoulCommSendIdempotency) TableName() string

TableName returns the database table name for SoulCommSendIdempotency.

func (*SoulCommSendIdempotency) UpdateKeys added in v0.1.22

func (m *SoulCommSendIdempotency) UpdateKeys() error

UpdateKeys updates the database keys for SoulCommSendIdempotency.

type SoulCommVoiceInstruction added in v0.1.6

type SoulCommVoiceInstruction struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	MessageID string `theorydb:"attr:messageId" json:"message_id"`
	AgentID   string `theorydb:"attr:agentId" json:"agent_id"`
	From      string `theorydb:"attr:from" json:"from"`
	To        string `theorydb:"attr:to" json:"to"`
	Body      string `theorydb:"attr:body" json:"body"`
	Voice     string `theorydb:"attr:voice,omitempty" json:"voice,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

SoulCommVoiceInstruction stores the TeXML payload source for an outbound voice message.

Keys:

PK: COMM#MSG#{messageId}
SK: VOICE#INSTRUCTION

func (*SoulCommVoiceInstruction) BeforeCreate added in v0.1.6

func (m *SoulCommVoiceInstruction) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulCommVoiceInstruction.

func (*SoulCommVoiceInstruction) BeforeUpdate added in v0.1.6

func (m *SoulCommVoiceInstruction) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulCommVoiceInstruction.

func (*SoulCommVoiceInstruction) GetPK added in v0.1.6

func (m *SoulCommVoiceInstruction) GetPK() string

GetPK returns the partition key for SoulCommVoiceInstruction.

func (*SoulCommVoiceInstruction) GetSK added in v0.1.6

func (m *SoulCommVoiceInstruction) GetSK() string

GetSK returns the sort key for SoulCommVoiceInstruction.

func (SoulCommVoiceInstruction) TableName added in v0.1.6

func (SoulCommVoiceInstruction) TableName() string

TableName returns the database table name for SoulCommVoiceInstruction.

func (*SoulCommVoiceInstruction) UpdateKeys added in v0.1.6

func (m *SoulCommVoiceInstruction) UpdateKeys() error

UpdateKeys updates the database keys for SoulCommVoiceInstruction.

type SoulContactAvailabilityWindow

type SoulContactAvailabilityWindow struct {
	Days      []string `theorydb:"attr:days" json:"days"`
	StartTime string   `theorydb:"attr:startTime" json:"start_time"`
	EndTime   string   `theorydb:"attr:endTime" json:"end_time"`
	// contains filtered or unexported fields
}

type SoulDomainAgentIndex

type SoulDomainAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Domain  string `theorydb:"attr:domain" json:"domain"`
	LocalID string `theorydb:"attr:localId" json:"local_id"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulDomainAgentIndex is a materialized index for looking up agents by domain + local ID.

Keys:

PK: SOUL#DOMAIN#{normalizedDomain}
SK: LOCAL#{normalizedLocalAgentId}#AGENT#{agentId}

func (*SoulDomainAgentIndex) BeforeCreate

func (i *SoulDomainAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulDomainAgentIndex.

func (*SoulDomainAgentIndex) GetPK

func (i *SoulDomainAgentIndex) GetPK() string

GetPK returns the partition key for SoulDomainAgentIndex.

func (*SoulDomainAgentIndex) GetSK

func (i *SoulDomainAgentIndex) GetSK() string

GetSK returns the sort key for SoulDomainAgentIndex.

func (SoulDomainAgentIndex) TableName

func (SoulDomainAgentIndex) TableName() string

TableName returns the database table name for SoulDomainAgentIndex.

func (*SoulDomainAgentIndex) UpdateKeys

func (i *SoulDomainAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulDomainAgentIndex.

type SoulEmailAgentIndex

type SoulEmailAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Email   string `theorydb:"attr:email" json:"email"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulEmailAgentIndex is a materialized index for looking up an agent by email address.

Keys:

PK: SOUL#EMAIL#{normalizedEmail}
SK: AGENT

func (*SoulEmailAgentIndex) BeforeCreate

func (i *SoulEmailAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulEmailAgentIndex.

func (*SoulEmailAgentIndex) GetPK

func (i *SoulEmailAgentIndex) GetPK() string

GetPK returns the partition key for SoulEmailAgentIndex.

func (*SoulEmailAgentIndex) GetSK

func (i *SoulEmailAgentIndex) GetSK() string

GetSK returns the sort key for SoulEmailAgentIndex.

func (SoulEmailAgentIndex) TableName

func (SoulEmailAgentIndex) TableName() string

TableName returns the database table name for SoulEmailAgentIndex.

func (*SoulEmailAgentIndex) UpdateKeys

func (i *SoulEmailAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulEmailAgentIndex.

type SoulEmailLegacyAliasIndex added in v0.4.3

type SoulEmailLegacyAliasIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	AliasEmail     string    `theorydb:"attr:aliasEmail" json:"alias_email"`
	CanonicalEmail string    `theorydb:"attr:canonicalEmail" json:"canonical_email"`
	AgentID        string    `theorydb:"attr:agentId" json:"agent_id"`
	Status         string    `theorydb:"attr:status" json:"status"`
	Source         string    `theorydb:"attr:source" json:"source,omitempty"`
	CreatedAt      time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt      time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

SoulEmailLegacyAliasIndex is a host-internal deprecated alias lookup used only for migrated managed Lesser Soul email channels. It is deliberately separate from SoulEmailAgentIndex so public/current channel lookup remains the canonical instance-scoped address only.

Keys:

PK: SOUL#EMAIL_ALIAS#{normalizedLegacyAliasEmail}
SK: CANONICAL

func (*SoulEmailLegacyAliasIndex) BeforeCreate added in v0.4.3

func (i *SoulEmailLegacyAliasIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulEmailLegacyAliasIndex.

func (*SoulEmailLegacyAliasIndex) BeforeUpdate added in v0.4.3

func (i *SoulEmailLegacyAliasIndex) BeforeUpdate() error

BeforeUpdate updates timestamps before updating SoulEmailLegacyAliasIndex.

func (*SoulEmailLegacyAliasIndex) GetPK added in v0.4.3

func (i *SoulEmailLegacyAliasIndex) GetPK() string

GetPK returns the partition key for SoulEmailLegacyAliasIndex.

func (*SoulEmailLegacyAliasIndex) GetSK added in v0.4.3

func (i *SoulEmailLegacyAliasIndex) GetSK() string

GetSK returns the sort key for SoulEmailLegacyAliasIndex.

func (SoulEmailLegacyAliasIndex) TableName added in v0.4.3

func (SoulEmailLegacyAliasIndex) TableName() string

TableName returns the database table name for SoulEmailLegacyAliasIndex.

func (*SoulEmailLegacyAliasIndex) UpdateKeys added in v0.4.3

func (i *SoulEmailLegacyAliasIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulEmailLegacyAliasIndex.

type SoulOperation

type SoulOperation struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	OperationID string `theorydb:"attr:operationId" json:"operation_id"`
	Kind        string `theorydb:"attr:kind" json:"kind"`

	AgentID string `theorydb:"attr:agentId" json:"agent_id,omitempty"` // target agent (hex-encoded uint256)

	Status string `theorydb:"attr:status" json:"status"`

	SafePayloadJSON string `theorydb:"attr:safePayload" json:"safe_payload,omitempty"`

	ExecTxHash      string `theorydb:"attr:execTxHash" json:"exec_tx_hash,omitempty"`
	ExecBlockNumber int64  `theorydb:"attr:execBlockNumber" json:"exec_block_number,omitempty"`
	ExecSuccess     *bool  `theorydb:"attr:execSuccess" json:"exec_success,omitempty"`

	ReceiptJSON  string `theorydb:"attr:receiptJson" json:"receipt_json,omitempty"`
	SnapshotJSON string `theorydb:"attr:snapshotJson" json:"snapshot_json,omitempty"`

	CreatedAt  time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt  time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExecutedAt time.Time `theorydb:"attr:executedAt" json:"executed_at,omitempty"`
	// contains filtered or unexported fields
}

SoulOperation represents a Safe-first on-chain operation request and its reconciliation metadata.

Keys:

PK: SOUL#OP#{operationId}
SK: OPERATION

func (*SoulOperation) BeforeCreate

func (o *SoulOperation) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulOperation.

func (*SoulOperation) BeforeUpdate

func (o *SoulOperation) BeforeUpdate() error

BeforeUpdate updates timestamps before updating SoulOperation.

func (*SoulOperation) GetPK

func (o *SoulOperation) GetPK() string

GetPK returns the partition key for SoulOperation.

func (*SoulOperation) GetSK

func (o *SoulOperation) GetSK() string

GetSK returns the sort key for SoulOperation.

func (SoulOperation) TableName

func (SoulOperation) TableName() string

TableName returns the database table name for SoulOperation.

func (*SoulOperation) UpdateKeys

func (o *SoulOperation) UpdateKeys() error

UpdateKeys updates the database keys for SoulOperation.

type SoulPhoneAgentIndex

type SoulPhoneAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Phone   string `theorydb:"attr:phone" json:"phone"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulPhoneAgentIndex is a materialized index for looking up an agent by phone number (E.164).

Keys:

PK: SOUL#PHONE#{e164}
SK: AGENT

func (*SoulPhoneAgentIndex) BeforeCreate

func (i *SoulPhoneAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulPhoneAgentIndex.

func (*SoulPhoneAgentIndex) GetPK

func (i *SoulPhoneAgentIndex) GetPK() string

GetPK returns the partition key for SoulPhoneAgentIndex.

func (*SoulPhoneAgentIndex) GetSK

func (i *SoulPhoneAgentIndex) GetSK() string

GetSK returns the sort key for SoulPhoneAgentIndex.

func (SoulPhoneAgentIndex) TableName

func (SoulPhoneAgentIndex) TableName() string

TableName returns the database table name for SoulPhoneAgentIndex.

func (*SoulPhoneAgentIndex) UpdateKeys

func (i *SoulPhoneAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulPhoneAgentIndex.

type SoulRelationshipFromIndex

type SoulRelationshipFromIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	FromAgentID string `theorydb:"attr:fromAgentId" json:"from_agent_id"`
	ToAgentID   string `theorydb:"attr:toAgentId" json:"to_agent_id"`

	Type string `theorydb:"attr:type" json:"type"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

SoulRelationshipFromIndex is a materialized index for querying relationships *from* a given agent. This is the inverse of the main SoulAgentRelationship record which is stored under the target (toAgentId).

Keys:

PK: SOUL#RELATIONSHIPS_FROM#{fromAgentId}
SK: TO#{toAgentId}#{timestamp}

func (*SoulRelationshipFromIndex) BeforeCreate

func (i *SoulRelationshipFromIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulRelationshipFromIndex.

func (*SoulRelationshipFromIndex) GetPK

func (i *SoulRelationshipFromIndex) GetPK() string

GetPK returns the partition key for SoulRelationshipFromIndex.

func (*SoulRelationshipFromIndex) GetSK

func (i *SoulRelationshipFromIndex) GetSK() string

GetSK returns the sort key for SoulRelationshipFromIndex.

func (SoulRelationshipFromIndex) TableName

func (SoulRelationshipFromIndex) TableName() string

TableName returns the database table name for SoulRelationshipFromIndex.

func (*SoulRelationshipFromIndex) UpdateKeys

func (i *SoulRelationshipFromIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulRelationshipFromIndex.

type SoulWalletAgentIndex

type SoulWalletAgentIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Wallet  string `theorydb:"attr:wallet" json:"wallet"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`
	// contains filtered or unexported fields
}

SoulWalletAgentIndex is a materialized index for looking up agents by wallet address.

Keys:

PK: SOUL#WALLET#{wallet}
SK: AGENT#{agentId}

func (*SoulWalletAgentIndex) BeforeCreate

func (i *SoulWalletAgentIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulWalletAgentIndex.

func (*SoulWalletAgentIndex) GetPK

func (i *SoulWalletAgentIndex) GetPK() string

GetPK returns the partition key for SoulWalletAgentIndex.

func (*SoulWalletAgentIndex) GetSK

func (i *SoulWalletAgentIndex) GetSK() string

GetSK returns the sort key for SoulWalletAgentIndex.

func (SoulWalletAgentIndex) TableName

func (SoulWalletAgentIndex) TableName() string

TableName returns the database table name for SoulWalletAgentIndex.

func (*SoulWalletAgentIndex) UpdateKeys

func (i *SoulWalletAgentIndex) UpdateKeys() error

UpdateKeys updates the database keys for SoulWalletAgentIndex.

type SoulWalletRotationRequest

type SoulWalletRotationRequest struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	AgentID  string `theorydb:"attr:agentId" json:"agent_id"`
	Username string `theorydb:"attr:username" json:"username"`

	CurrentWallet string `theorydb:"attr:currentWallet" json:"current_wallet"`
	NewWallet     string `theorydb:"attr:newWallet" json:"new_wallet"`

	Nonce    string `theorydb:"attr:nonce" json:"nonce"`       // decimal uint256 string
	Deadline int64  `theorydb:"attr:deadline" json:"deadline"` // unix seconds

	DigestHex string `theorydb:"attr:digestHex" json:"digest_hex"` // 0x-prefixed 32-byte hex

	Spent bool `theorydb:"attr:spent" json:"spent"`

	CreatedAt   time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt   time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt   time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	ConfirmedAt time.Time `theorydb:"attr:confirmedAt" json:"confirmed_at,omitempty"`
	// contains filtered or unexported fields
}

SoulWalletRotationRequest represents a pending wallet rotation proposal for an agent.

Keys:

PK: SOUL#AGENT#{agentId}
SK: ROTATION#{username}

func (*SoulWalletRotationRequest) BeforeCreate

func (r *SoulWalletRotationRequest) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulWalletRotationRequest.

func (*SoulWalletRotationRequest) BeforeUpdate

func (r *SoulWalletRotationRequest) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulWalletRotationRequest.

func (*SoulWalletRotationRequest) GetPK

func (r *SoulWalletRotationRequest) GetPK() string

GetPK returns the partition key for SoulWalletRotationRequest.

func (*SoulWalletRotationRequest) GetSK

func (r *SoulWalletRotationRequest) GetSK() string

GetSK returns the sort key for SoulWalletRotationRequest.

func (SoulWalletRotationRequest) TableName

func (SoulWalletRotationRequest) TableName() string

TableName returns the database table name for SoulWalletRotationRequest.

func (*SoulWalletRotationRequest) UpdateKeys

func (r *SoulWalletRotationRequest) UpdateKeys() error

UpdateKeys updates the database keys and TTL for SoulWalletRotationRequest.

type SoulX402InvocationGrant added in v0.4.1

type SoulX402InvocationGrant struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GrantID string `theorydb:"attr:grantId" json:"grant_id"`
	AgentID string `theorydb:"attr:agentId" json:"agent_id"`

	Capability  string `theorydb:"attr:capability" json:"capability"`
	Tool        string `theorydb:"attr:tool" json:"tool"`
	Resource    string `theorydb:"attr:resource" json:"resource"`
	RequestHash string `theorydb:"attr:requestHash" json:"request_hash"`

	CallerSubjectHash string `theorydb:"attr:callerSubjectHash" json:"caller_subject_hash"`

	PaymentScheme                   string `theorydb:"attr:paymentScheme" json:"payment_scheme"`
	PaymentNetwork                  string `theorydb:"attr:paymentNetwork" json:"payment_network"`
	PaymentAsset                    string `theorydb:"attr:paymentAsset" json:"payment_asset,omitempty"`
	PaymentAmount                   string `theorydb:"attr:paymentAmount" json:"payment_amount"`
	PaymentCurrency                 string `theorydb:"attr:paymentCurrency" json:"payment_currency,omitempty"`
	PaymentFacilitator              string `theorydb:"attr:paymentFacilitator" json:"payment_facilitator,omitempty"`
	PaymentFacilitatorTrustBoundary string `theorydb:"attr:paymentFacilitatorTrustBoundary" json:"payment_facilitator_trust_boundary"`
	PaymentEvidenceHash             string `theorydb:"attr:paymentEvidenceHash" json:"payment_evidence_hash"`
	PaymentIDHash                   string `theorydb:"attr:paymentIdHash" json:"payment_id_hash,omitempty"`

	Nonce                string `theorydb:"attr:nonce" json:"nonce"`
	IdempotencyKeyHash   string `theorydb:"attr:idempotencyKeyHash" json:"idempotency_key_hash"`
	IssueRequestHash     string `theorydb:"attr:issueRequestHash" json:"issue_request_hash"`
	GrantTokenHash       string `theorydb:"attr:grantTokenHash" json:"grant_token_hash"`
	PolicyVersion        string `theorydb:"attr:policyVersion" json:"policy_version"`
	Authority            string `theorydb:"attr:authority" json:"authority"`
	Status               string `theorydb:"attr:status" json:"status"`
	MaxUsage             int    `theorydb:"attr:maxUsage" json:"max_usage"`
	ConsumedUsageCount   int    `theorydb:"attr:consumedUsageCount" json:"consumed_usage_count,omitempty"`
	LatestConsumeSlot    int    `theorydb:"attr:latestConsumeSlot" json:"latest_consume_slot,omitempty"`
	LatestConsumeRequest string `theorydb:"attr:latestConsumeRequestHash" json:"latest_consume_request_hash,omitempty"`

	IssuedAt       time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	ExpiresAt      time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	UpdatedAt      time.Time `theorydb:"attr:updatedAt" json:"updated_at,omitempty"`
	LastConsumedAt time.Time `theorydb:"attr:lastConsumedAt" json:"last_consumed_at,omitempty"`
	// contains filtered or unexported fields
}

SoulX402InvocationGrant stores a minimized, off-chain x402 invocation grant.

The grant is not principal/operator authority. It only authorizes a bounded public paid invocation when an authenticated managed instance later presents the one-time raw grant token whose hash is stored here.

func (*SoulX402InvocationGrant) BeforeCreate added in v0.4.1

func (g *SoulX402InvocationGrant) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulX402InvocationGrant.

func (*SoulX402InvocationGrant) BeforeUpdate added in v0.4.1

func (g *SoulX402InvocationGrant) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating SoulX402InvocationGrant.

func (*SoulX402InvocationGrant) GetPK added in v0.4.1

func (g *SoulX402InvocationGrant) GetPK() string

GetPK returns the partition key for SoulX402InvocationGrant.

func (*SoulX402InvocationGrant) GetSK added in v0.4.1

func (g *SoulX402InvocationGrant) GetSK() string

GetSK returns the sort key for SoulX402InvocationGrant.

func (SoulX402InvocationGrant) TableName added in v0.4.1

func (SoulX402InvocationGrant) TableName() string

TableName returns the database table name for SoulX402InvocationGrant.

func (*SoulX402InvocationGrant) UpdateKeys added in v0.4.1

func (g *SoulX402InvocationGrant) UpdateKeys() error

UpdateKeys updates the database keys for SoulX402InvocationGrant.

type SoulX402InvocationGrantUsage added in v0.4.1

type SoulX402InvocationGrantUsage struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GrantID                   string    `theorydb:"attr:grantId" json:"grant_id"`
	UsageSlot                 int       `theorydb:"attr:usageSlot" json:"usage_slot"`
	AgentID                   string    `theorydb:"attr:agentId" json:"agent_id"`
	InstanceSlug              string    `theorydb:"attr:instanceSlug" json:"instance_slug"`
	ConsumeIdempotencyKeyHash string    `theorydb:"attr:consumeIdempotencyKeyHash" json:"consume_idempotency_key_hash"`
	ConsumeRequestHash        string    `theorydb:"attr:consumeRequestHash" json:"consume_request_hash"`
	ConsumedAt                time.Time `theorydb:"attr:consumedAt" json:"consumed_at"`
	// contains filtered or unexported fields
}

SoulX402InvocationGrantUsage records one consumed usage slot for an invocation grant.

Usage slots are write-once. Creating at most MaxUsage slot rows with IfNotExists bounds replay and double-spend without storing raw caller payment evidence.

func (*SoulX402InvocationGrantUsage) BeforeCreate added in v0.4.1

func (u *SoulX402InvocationGrantUsage) BeforeCreate() error

BeforeCreate sets defaults and keys before creating SoulX402InvocationGrantUsage.

func (*SoulX402InvocationGrantUsage) GetPK added in v0.4.1

GetPK returns the partition key for SoulX402InvocationGrantUsage.

func (*SoulX402InvocationGrantUsage) GetSK added in v0.4.1

GetSK returns the sort key for SoulX402InvocationGrantUsage.

func (SoulX402InvocationGrantUsage) TableName added in v0.4.1

TableName returns the database table name for SoulX402InvocationGrantUsage.

func (*SoulX402InvocationGrantUsage) UpdateKeys added in v0.4.1

func (u *SoulX402InvocationGrantUsage) UpdateKeys() error

UpdateKeys updates the database keys for SoulX402InvocationGrantUsage.

type TipHostRegistration

type TipHostRegistration struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	Kind string `theorydb:"attr:kind" json:"kind"`

	DomainRaw        string `theorydb:"attr:domainRaw" json:"domain_raw,omitempty"`
	DomainNormalized string `theorydb:"attr:domainNormalized" json:"domain_normalized"`
	HostIDHex        string `theorydb:"attr:hostIdHex" json:"host_id_hex"`

	ChainID     int64  `theorydb:"attr:chainID" json:"chain_id"`
	WalletType  string `theorydb:"attr:walletType" json:"wallet_type"`
	WalletAddr  string `theorydb:"attr:walletAddress" json:"wallet_address"`
	HostFeeBps  int64  `theorydb:"attr:hostFeeBps" json:"host_fee_bps"`
	TxMode      string `theorydb:"attr:txMode" json:"tx_mode,omitempty"` // safe|direct
	SafeAddress string `theorydb:"attr:safeAddress" json:"safe_address,omitempty"`

	WalletNonce   string `theorydb:"attr:walletNonce" json:"wallet_nonce,omitempty"`
	WalletMessage string `theorydb:"attr:walletMessage" json:"wallet_message,omitempty"`

	DNSToken  string `theorydb:"attr:dnsToken" json:"dns_token,omitempty"`
	HTTPToken string `theorydb:"attr:httpToken" json:"http_token,omitempty"`

	DNSVerified    bool      `theorydb:"attr:dnsVerified" json:"dns_verified,omitempty"`
	HTTPSVerified  bool      `theorydb:"attr:httpsVerified" json:"https_verified,omitempty"`
	WalletVerified bool      `theorydb:"attr:walletVerified" json:"wallet_verified,omitempty"`
	VerifiedAt     time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`

	Status string `theorydb:"attr:status" json:"status"`

	CreatedAt   time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt   time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt   time.Time `theorydb:"attr:expiresAt" json:"expires_at,omitempty"`
	CompletedAt time.Time `theorydb:"attr:completedAt" json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

TipHostRegistration represents an external host registry registration request with proof challenges.

func (*TipHostRegistration) BeforeCreate

func (r *TipHostRegistration) BeforeCreate() error

BeforeCreate sets defaults and keys before creating TipHostRegistration.

func (*TipHostRegistration) BeforeUpdate

func (r *TipHostRegistration) BeforeUpdate() error

BeforeUpdate updates timestamps and TTL before updating TipHostRegistration.

func (*TipHostRegistration) GetPK

func (r *TipHostRegistration) GetPK() string

GetPK returns the partition key for TipHostRegistration.

func (*TipHostRegistration) GetSK

func (r *TipHostRegistration) GetSK() string

GetSK returns the sort key for TipHostRegistration.

func (TipHostRegistration) TableName

func (TipHostRegistration) TableName() string

TableName returns the database table name for TipHostRegistration.

func (*TipHostRegistration) UpdateKeys

func (r *TipHostRegistration) UpdateKeys() error

UpdateKeys updates the database keys for TipHostRegistration.

type TipHostState

type TipHostState struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	ChainID         int64  `theorydb:"attr:chainID" json:"chain_id"`
	ContractAddress string `theorydb:"attr:contractAddress" json:"contract_address"`

	DomainNormalized string `theorydb:"attr:domainNormalized" json:"domain_normalized,omitempty"`
	HostIDHex        string `theorydb:"attr:hostIdHex" json:"host_id_hex"`

	WalletAddr string `theorydb:"attr:walletAddress" json:"wallet_address,omitempty"`
	HostFeeBps int64  `theorydb:"attr:hostFeeBps" json:"host_fee_bps,omitempty"`
	IsActive   bool   `theorydb:"attr:isActive" json:"is_active"`

	ObservedAt time.Time `theorydb:"attr:observedAt" json:"observed_at"`
	UpdatedAt  time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

TipHostState stores the latest observed on-chain host registry configuration for a hostId.

func (*TipHostState) BeforeCreate

func (s *TipHostState) BeforeCreate() error

BeforeCreate sets defaults and keys before creating TipHostState.

func (*TipHostState) BeforeUpdate

func (s *TipHostState) BeforeUpdate() error

BeforeUpdate updates timestamps before updating TipHostState.

func (*TipHostState) GetPK

func (s *TipHostState) GetPK() string

GetPK returns the partition key for TipHostState.

func (*TipHostState) GetSK

func (s *TipHostState) GetSK() string

GetSK returns the sort key for TipHostState.

func (TipHostState) TableName

func (TipHostState) TableName() string

TableName returns the database table name for TipHostState.

func (*TipHostState) UpdateKeys

func (s *TipHostState) UpdateKeys() error

UpdateKeys updates the database keys for TipHostState.

type TipRegistryOperation

type TipRegistryOperation struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID string `theorydb:"attr:id" json:"id"`

	Kind string `theorydb:"attr:kind" json:"kind"`

	ChainID         int64  `theorydb:"attr:chainID" json:"chain_id"`
	ContractAddress string `theorydb:"attr:contractAddress" json:"contract_address"`
	TxMode          string `theorydb:"attr:txMode" json:"tx_mode,omitempty"` // safe|direct
	SafeAddress     string `theorydb:"attr:safeAddress" json:"safe_address,omitempty"`

	DomainRaw        string `theorydb:"attr:domainRaw" json:"domain_raw,omitempty"`
	DomainNormalized string `theorydb:"attr:domainNormalized" json:"domain_normalized,omitempty"`
	HostIDHex        string `theorydb:"attr:hostIdHex" json:"host_id_hex,omitempty"`

	WalletAddr string `theorydb:"attr:walletAddress" json:"wallet_address,omitempty"`
	HostFeeBps int64  `theorydb:"attr:hostFeeBps" json:"host_fee_bps,omitempty"`
	Active     *bool  `theorydb:"attr:active" json:"active,omitempty"`

	TokenAddress string `theorydb:"attr:tokenAddress" json:"token_address,omitempty"`
	TokenAllowed *bool  `theorydb:"attr:tokenAllowed" json:"token_allowed,omitempty"`

	TxTo    string `theorydb:"attr:txTo" json:"tx_to,omitempty"`
	TxData  string `theorydb:"attr:txData" json:"tx_data,omitempty"`
	TxValue string `theorydb:"attr:txValue" json:"tx_value,omitempty"` // decimal string; normally "0"

	SafeTxHash string `theorydb:"attr:safeTxHash" json:"safe_tx_hash,omitempty"`

	ExecTxHash      string `theorydb:"attr:execTxHash" json:"exec_tx_hash,omitempty"`
	ExecBlockNumber int64  `theorydb:"attr:execBlockNumber" json:"exec_block_number,omitempty"`
	ExecSuccess     *bool  `theorydb:"attr:execSuccess" json:"exec_success,omitempty"`

	ReceiptJSON  string `theorydb:"attr:receiptJson" json:"receipt_json,omitempty"`
	SnapshotJSON string `theorydb:"attr:snapshotJson" json:"snapshot_json,omitempty"`

	Status string `theorydb:"attr:status" json:"status"`

	CreatedAt  time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt  time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ProposedAt time.Time `theorydb:"attr:proposedAt" json:"proposed_at,omitempty"`
	ExecutedAt time.Time `theorydb:"attr:executedAt" json:"executed_at,omitempty"`
	// contains filtered or unexported fields
}

TipRegistryOperation represents a Safe-first on-chain operation request and its reconciliation metadata.

func (*TipRegistryOperation) BeforeCreate

func (o *TipRegistryOperation) BeforeCreate() error

BeforeCreate sets defaults and keys before creating TipRegistryOperation.

func (*TipRegistryOperation) BeforeUpdate

func (o *TipRegistryOperation) BeforeUpdate() error

BeforeUpdate updates timestamps before updating TipRegistryOperation.

func (*TipRegistryOperation) GetPK

func (o *TipRegistryOperation) GetPK() string

GetPK returns the partition key for TipRegistryOperation.

func (*TipRegistryOperation) GetSK

func (o *TipRegistryOperation) GetSK() string

GetSK returns the sort key for TipRegistryOperation.

func (TipRegistryOperation) TableName

func (TipRegistryOperation) TableName() string

TableName returns the database table name for TipRegistryOperation.

func (*TipRegistryOperation) UpdateKeys

func (o *TipRegistryOperation) UpdateKeys() error

UpdateKeys updates the database keys for TipRegistryOperation.

type UpdateJob

type UpdateJob struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`
	GSI2PK string `theorydb:"index:gsi2,pk,attr:gsi2PK" json:"-"`
	GSI2SK string `theorydb:"index:gsi2,sk,attr:gsi2SK" json:"-"`

	ID           string `theorydb:"attr:id" json:"id"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`

	Status string `theorydb:"attr:status" json:"status"`            // queued|running|ok|error
	Step   string `theorydb:"attr:step" json:"step,omitempty"`      // implementation-defined
	Note   string `theorydb:"attr:note" json:"note,omitempty"`      // operator-visible
	RunID  string `theorydb:"attr:runId" json:"run_id,omitempty"`   // external runner id (e.g. CodeBuild)
	RunURL string `theorydb:"attr:runUrl" json:"run_url,omitempty"` // external runner deep link (e.g. CodeBuild logs)

	ActivePhase string `theorydb:"attr:activePhase" json:"active_phase,omitempty"`
	FailedPhase string `theorydb:"attr:failedPhase" json:"failed_phase,omitempty"`

	DeployStatus string `theorydb:"attr:deployStatus" json:"deploy_status,omitempty"`
	DeployRunID  string `theorydb:"attr:deployRunId" json:"deploy_run_id,omitempty"`
	DeployRunURL string `theorydb:"attr:deployRunUrl" json:"deploy_run_url,omitempty"`
	DeployError  string `theorydb:"attr:deployError" json:"deploy_error,omitempty"`

	BodyStatus string `theorydb:"attr:bodyStatus" json:"body_status,omitempty"`
	BodyRunID  string `theorydb:"attr:bodyRunId" json:"body_run_id,omitempty"`
	BodyRunURL string `theorydb:"attr:bodyRunUrl" json:"body_run_url,omitempty"`
	BodyError  string `theorydb:"attr:bodyError" json:"body_error,omitempty"`

	MCPStatus string `theorydb:"attr:mcpStatus" json:"mcp_status,omitempty"`
	MCPRunID  string `theorydb:"attr:mcpRunId" json:"mcp_run_id,omitempty"`
	MCPRunURL string `theorydb:"attr:mcpRunUrl" json:"mcp_run_url,omitempty"`
	MCPError  string `theorydb:"attr:mcpError" json:"mcp_error,omitempty"`

	AccountID       string `theorydb:"attr:accountId" json:"account_id,omitempty"`
	AccountRoleName string `theorydb:"attr:accountRoleName" json:"account_role_name,omitempty"`
	Region          string `theorydb:"attr:region" json:"region,omitempty"`
	BaseDomain      string `theorydb:"attr:baseDomain" json:"base_domain,omitempty"`

	LesserVersion string `theorydb:"attr:lesserVersion" json:"lesser_version,omitempty"`
	// LesserBodyVersion optionally forces a specific lesser-body release tag (example: v0.1.0).
	// When empty, the deploy runner falls back to MANAGED_LESSER_BODY_DEFAULT_VERSION (if configured)
	// or resolves releases/latest.
	LesserBodyVersion   string `theorydb:"attr:lesserBodyVersion" json:"lesser_body_version,omitempty"`
	BodyOnly            bool   `theorydb:"attr:bodyOnly" json:"body_only,omitempty"`
	MCPOnly             bool   `theorydb:"attr:mcpOnly" json:"mcp_only,omitempty"`
	BodyTemplateCertify bool   `theorydb:"attr:bodyTemplateCertify" json:"body_template_certify,omitempty"`

	// Desired configuration snapshot (applied during update).
	LesserHostBaseURL              string `theorydb:"attr:lesserHostBaseUrl" json:"lesser_host_base_url,omitempty"`
	LesserHostAttestationsURL      string `theorydb:"attr:lesserHostAttestationsUrl" json:"lesser_host_attestations_url,omitempty"`
	LesserHostInstanceKeySecretARN string `theorydb:"attr:lesserHostInstanceKeySecretArn" json:"lesser_host_instance_key_secret_arn,omitempty"`
	TranslationEnabled             bool   `theorydb:"attr:translationEnabled" json:"translation_enabled"`

	TipEnabled         bool   `theorydb:"attr:tipEnabled" json:"tip_enabled"`
	TipChainID         int64  `theorydb:"attr:tipChainId" json:"tip_chain_id,omitempty"`
	TipContractAddress string `theorydb:"attr:tipContractAddress" json:"tip_contract_address,omitempty"`

	AIEnabled                 bool `theorydb:"attr:aiEnabled" json:"ai_enabled"`
	AIModerationEnabled       bool `theorydb:"attr:aiModerationEnabled" json:"ai_moderation_enabled"`
	AINsfwDetectionEnabled    bool `theorydb:"attr:aiNsfwDetectionEnabled" json:"ai_nsfw_detection_enabled"`
	AISpamDetectionEnabled    bool `theorydb:"attr:aiSpamDetectionEnabled" json:"ai_spam_detection_enabled"`
	AIPiiDetectionEnabled     bool `theorydb:"attr:aiPiiDetectionEnabled" json:"ai_pii_detection_enabled"`
	AIContentDetectionEnabled bool `theorydb:"attr:aiContentDetectionEnabled" json:"ai_content_detection_enabled"`

	// Optional instance key rotation (safe overlap by leaving prior keys unrevoked).
	RotateInstanceKey    bool   `theorydb:"attr:rotateInstanceKey" json:"rotate_instance_key,omitempty"`
	RotatedInstanceKeyID string `theorydb:"attr:rotatedInstanceKeyId" json:"rotated_instance_key_id,omitempty"`

	// Post-deploy verification signals (nil until verification runs).
	VerifyTranslationOK  *bool  `theorydb:"attr:verifyTranslationOk" json:"verify_translation_ok,omitempty"`
	VerifyTrustOK        *bool  `theorydb:"attr:verifyTrustOk" json:"verify_trust_ok,omitempty"`
	VerifyTipsOK         *bool  `theorydb:"attr:verifyTipsOk" json:"verify_tips_ok,omitempty"`
	VerifyAIOK           *bool  `theorydb:"attr:verifyAiOk" json:"verify_ai_ok,omitempty"`
	VerifyTranslationErr string `theorydb:"attr:verifyTranslationErr" json:"verify_translation_err,omitempty"`
	VerifyTrustErr       string `theorydb:"attr:verifyTrustErr" json:"verify_trust_err,omitempty"`
	VerifyTipsErr        string `theorydb:"attr:verifyTipsErr" json:"verify_tips_err,omitempty"`
	VerifyAIErr          string `theorydb:"attr:verifyAiErr" json:"verify_ai_err,omitempty"`

	ReceiptJSON string `theorydb:"attr:receiptJson" json:"receipt_json,omitempty"`

	ProcessingLeaseOwner string    `theorydb:"attr:processingLeaseOwner" json:"processing_lease_owner,omitempty"`
	ProcessingLeaseUntil time.Time `theorydb:"attr:processingLeaseUntil" json:"processing_lease_until,omitempty"`

	Attempts    int64 `theorydb:"attr:attempts" json:"attempts"`
	MaxAttempts int64 `theorydb:"attr:maxAttempts" json:"max_attempts,omitempty"`

	ErrorCode    string `theorydb:"attr:errorCode" json:"error_code,omitempty"`
	ErrorMessage string `theorydb:"attr:errorMessage" json:"error_message,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	RequestID string    `theorydb:"attr:requestId" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

UpdateJob represents an asynchronous managed instance update workflow.

func (*UpdateJob) BeforeCreate

func (j *UpdateJob) BeforeCreate() error

func (*UpdateJob) BeforeUpdate

func (j *UpdateJob) BeforeUpdate() error

func (*UpdateJob) GetPK

func (j *UpdateJob) GetPK() string

func (*UpdateJob) GetSK

func (j *UpdateJob) GetSK() string

func (UpdateJob) TableName

func (UpdateJob) TableName() string

func (*UpdateJob) UpdateKeys

func (j *UpdateJob) UpdateKeys() error

type UsageLedgerEntry

type UsageLedgerEntry struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	ID           string `theorydb:"attr:id" json:"id"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	Month        string `theorydb:"attr:month" json:"month"` // YYYY-MM

	Module string `theorydb:"attr:module" json:"module"`
	Target string `theorydb:"attr:target,omitempty" json:"target,omitempty"`

	Cached    bool   `theorydb:"attr:cached" json:"cached"`
	Reason    string `theorydb:"attr:reason,omitempty" json:"reason,omitempty"`
	RequestID string `theorydb:"attr:requestId,omitempty" json:"request_id,omitempty"`

	RequestedCredits int64 `theorydb:"attr:requestedCredits" json:"requested_credits"`
	ListCredits      int64 `theorydb:"attr:listCredits" json:"list_credits,omitempty"`
	// PricingMultiplierBps records any applied multiplier (e.g., author-at-publish discount).
	// 10000 means no change.
	PricingMultiplierBps int64 `theorydb:"attr:pricingMultiplierBps" json:"pricing_multiplier_bps,omitempty"`
	DebitedCredits       int64 `theorydb:"attr:debitedCredits" json:"debited_credits"`

	IncludedDebitedCredits int64 `theorydb:"attr:includedDebitedCredits" json:"included_debited_credits"`
	OverageDebitedCredits  int64 `theorydb:"attr:overageDebitedCredits" json:"overage_debited_credits"`

	BillingType string `theorydb:"attr:billingType" json:"billing_type"` // included|overage|none|mixed

	ActorURI    string `theorydb:"attr:actorUri,omitempty" json:"actor_uri,omitempty"`
	ObjectURI   string `theorydb:"attr:objectUri,omitempty" json:"object_uri,omitempty"`
	ContentHash string `theorydb:"attr:contentHash,omitempty" json:"content_hash,omitempty"`
	LinksHash   string `theorydb:"attr:linksHash,omitempty" json:"links_hash,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

UsageLedgerEntry records per-request credit usage and billing attribution.

func (*UsageLedgerEntry) BeforeCreate

func (e *UsageLedgerEntry) BeforeCreate() error

BeforeCreate sets defaults and keys before creating UsageLedgerEntry.

func (*UsageLedgerEntry) GetPK

func (e *UsageLedgerEntry) GetPK() string

GetPK returns the partition key for UsageLedgerEntry.

func (*UsageLedgerEntry) GetSK

func (e *UsageLedgerEntry) GetSK() string

GetSK returns the sort key for UsageLedgerEntry.

func (UsageLedgerEntry) TableName

func (UsageLedgerEntry) TableName() string

TableName returns the database table name for UsageLedgerEntry.

func (*UsageLedgerEntry) UpdateKeys

func (e *UsageLedgerEntry) UpdateKeys() error

UpdateKeys updates the database keys for UsageLedgerEntry.

type User

type User struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	Username       string    `theorydb:"attr:username" json:"username"`
	Role           string    `theorydb:"attr:role" json:"role"`
	Approved       bool      `theorydb:"attr:approved" json:"approved"`
	ApprovalStatus string    `theorydb:"attr:approvalStatus" json:"approval_status,omitempty"`
	ReviewedBy     string    `theorydb:"attr:reviewedBy" json:"reviewed_by,omitempty"`
	ReviewedAt     time.Time `theorydb:"attr:reviewedAt" json:"reviewed_at,omitempty"`
	ApprovalNote   string    `theorydb:"attr:approvalNote" json:"approval_note,omitempty"`
	DisplayName    string    `theorydb:"attr:displayName" json:"display_name,omitempty"`
	Email          string    `theorydb:"attr:email" json:"email,omitempty"`
	CreatedAt      time.Time `theorydb:"attr:createdAt" json:"created_at"`
	// contains filtered or unexported fields
}

User represents an authenticated portal user or operator account.

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

BeforeCreate sets defaults and keys before creating User.

func (*User) GetPK

func (u *User) GetPK() string

GetPK returns the partition key for User.

func (*User) GetSK

func (u *User) GetSK() string

GetSK returns the sort key for User.

func (User) TableName

func (User) TableName() string

TableName returns the database table name for User.

func (*User) UpdateKeys

func (u *User) UpdateKeys() error

UpdateKeys updates the database keys for User.

type VanityDomainRequest

type VanityDomainRequest struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	Domain       string `theorydb:"attr:domain" json:"domain"`
	DomainRaw    string `theorydb:"attr:domainRaw" json:"domain_raw,omitempty"`
	InstanceSlug string `theorydb:"attr:instanceSlug" json:"instance_slug"`
	RequestedBy  string `theorydb:"attr:requestedBy" json:"requested_by,omitempty"`

	Status string `theorydb:"attr:status" json:"status"` // pending|approved|rejected

	VerifiedAt  time.Time `theorydb:"attr:verifiedAt" json:"verified_at,omitempty"`
	RequestedAt time.Time `theorydb:"attr:requestedAt" json:"requested_at,omitempty"`

	ReviewedBy string    `theorydb:"attr:reviewedBy" json:"reviewed_by,omitempty"`
	ReviewedAt time.Time `theorydb:"attr:reviewedAt" json:"reviewed_at,omitempty"`
	Note       string    `theorydb:"attr:note" json:"note,omitempty"`

	CreatedAt time.Time `theorydb:"attr:createdAt" json:"created_at"`
	UpdatedAt time.Time `theorydb:"attr:updatedAt" json:"updated_at"`
	// contains filtered or unexported fields
}

VanityDomainRequest tracks operator approval for a verified vanity domain.

func (*VanityDomainRequest) BeforeCreate

func (r *VanityDomainRequest) BeforeCreate() error

BeforeCreate sets defaults and keys before creating VanityDomainRequest.

func (*VanityDomainRequest) BeforeUpdate

func (r *VanityDomainRequest) BeforeUpdate() error

BeforeUpdate updates timestamps and keys before updating VanityDomainRequest.

func (*VanityDomainRequest) GetPK

func (r *VanityDomainRequest) GetPK() string

GetPK returns the partition key for VanityDomainRequest.

func (*VanityDomainRequest) GetSK

func (r *VanityDomainRequest) GetSK() string

GetSK returns the sort key for VanityDomainRequest.

func (VanityDomainRequest) TableName

func (VanityDomainRequest) TableName() string

TableName returns the database table name for VanityDomainRequest.

func (*VanityDomainRequest) UpdateKeys

func (r *VanityDomainRequest) UpdateKeys() error

UpdateKeys updates the database keys for VanityDomainRequest.

type WalletChallenge

type WalletChallenge struct {
	PK  string `theorydb:"pk,attr:PK" json:"-"`
	SK  string `theorydb:"sk,attr:SK" json:"-"`
	TTL int64  `theorydb:"ttl,attr:ttl" json:"-"`

	ID        string    `theorydb:"attr:id" json:"id"`
	Username  string    `theorydb:"attr:username" json:"username,omitempty"`
	Address   string    `theorydb:"attr:address" json:"address"`
	ChainID   int       `theorydb:"attr:chainID" json:"chain_id"`
	Nonce     string    `theorydb:"attr:nonce" json:"nonce"`
	Message   string    `theorydb:"attr:message" json:"message"`
	IssuedAt  time.Time `theorydb:"attr:issuedAt" json:"issued_at"`
	ExpiresAt time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	Used      bool      `theorydb:"attr:used" json:"used"`
	Spent     bool      `theorydb:"attr:spent" json:"spent"`
	// contains filtered or unexported fields
}

WalletChallenge represents a wallet sign-in challenge.

func (*WalletChallenge) BeforeCreate

func (w *WalletChallenge) BeforeCreate() error

BeforeCreate updates keys and timestamps before creating WalletChallenge.

func (*WalletChallenge) GetPK

func (w *WalletChallenge) GetPK() string

GetPK returns the partition key for WalletChallenge.

func (*WalletChallenge) GetSK

func (w *WalletChallenge) GetSK() string

GetSK returns the sort key for WalletChallenge.

func (WalletChallenge) TableName

func (WalletChallenge) TableName() string

TableName returns the database table name for WalletChallenge.

func (*WalletChallenge) UpdateKeys

func (w *WalletChallenge) UpdateKeys() error

UpdateKeys updates the database keys and TTL for WalletChallenge.

type WalletCredential

type WalletCredential struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Username string    `theorydb:"attr:username" json:"username"`
	Address  string    `theorydb:"attr:address" json:"address"`
	ChainID  int       `theorydb:"attr:chainID" json:"chain_id"`
	Type     string    `theorydb:"attr:type" json:"type"`
	ENS      string    `theorydb:"attr:ens" json:"ens,omitempty"`
	LinkedAt time.Time `theorydb:"attr:linkedAt" json:"linked_at"`
	LastUsed time.Time `theorydb:"attr:lastUsed" json:"last_used"`
	// contains filtered or unexported fields
}

WalletCredential represents a wallet linked to a user.

func (*WalletCredential) BeforeCreate

func (w *WalletCredential) BeforeCreate() error

BeforeCreate updates keys and timestamps before creating WalletCredential.

func (*WalletCredential) BeforeUpdate

func (w *WalletCredential) BeforeUpdate() error

BeforeUpdate updates timestamps before updating WalletCredential.

func (*WalletCredential) GetPK

func (w *WalletCredential) GetPK() string

GetPK returns the partition key for WalletCredential.

func (*WalletCredential) GetSK

func (w *WalletCredential) GetSK() string

GetSK returns the sort key for WalletCredential.

func (WalletCredential) TableName

func (WalletCredential) TableName() string

TableName returns the database table name for WalletCredential.

func (*WalletCredential) UpdateKeys

func (w *WalletCredential) UpdateKeys() error

UpdateKeys updates the database keys for WalletCredential.

type WalletIndex

type WalletIndex struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Username   string `theorydb:"attr:username" json:"username"`
	WalletType string `theorydb:"attr:walletType" json:"wallet_type"`
	Address    string `theorydb:"attr:address" json:"address"`
	// contains filtered or unexported fields
}

WalletIndex is a reverse index for looking up users by wallet address.

func (*WalletIndex) BeforeCreate

func (w *WalletIndex) BeforeCreate() error

BeforeCreate sets defaults and keys before creating WalletIndex.

func (*WalletIndex) GetPK

func (w *WalletIndex) GetPK() string

GetPK returns the partition key for WalletIndex.

func (*WalletIndex) GetSK

func (w *WalletIndex) GetSK() string

GetSK returns the sort key for WalletIndex.

func (WalletIndex) TableName

func (WalletIndex) TableName() string

TableName returns the database table name for WalletIndex.

func (*WalletIndex) UpdateKeys

func (w *WalletIndex) UpdateKeys(walletType, address, username string)

UpdateKeys updates the database keys for WalletIndex.

type WebAuthnChallenge

type WebAuthnChallenge struct {
	PK string `theorydb:"pk,attr:PK" json:"-"`
	SK string `theorydb:"sk,attr:SK" json:"-"`

	Challenge   string    `theorydb:"attr:challenge" json:"challenge"`
	UserID      string    `theorydb:"attr:userID" json:"user_id"`
	SessionData []byte    `theorydb:"attr:sessionData" json:"session_data"`
	ExpiresAt   time.Time `theorydb:"attr:expiresAt" json:"expires_at"`
	Type        string    `theorydb:"attr:type" json:"type"`

	ItemType string `theorydb:"attr:itemType" json:"ItemType"`

	TTL int64 `theorydb:"ttl,attr:ttl" json:"-"`
	// contains filtered or unexported fields
}

WebAuthnChallenge stores a short-lived WebAuthn authentication challenge.

func (*WebAuthnChallenge) BeforeCreate

func (w *WebAuthnChallenge) BeforeCreate() error

BeforeCreate sets keys before creating WebAuthnChallenge.

func (*WebAuthnChallenge) GetPK

func (w *WebAuthnChallenge) GetPK() string

GetPK returns the partition key for WebAuthnChallenge.

func (*WebAuthnChallenge) GetSK

func (w *WebAuthnChallenge) GetSK() string

GetSK returns the sort key for WebAuthnChallenge.

func (WebAuthnChallenge) TableName

func (WebAuthnChallenge) TableName() string

TableName returns the database table name for WebAuthnChallenge.

func (*WebAuthnChallenge) UpdateKeys

func (w *WebAuthnChallenge) UpdateKeys() error

UpdateKeys updates the database keys and TTL for WebAuthnChallenge.

type WebAuthnCredential

type WebAuthnCredential struct {
	PK     string `theorydb:"pk,attr:PK" json:"-"`
	SK     string `theorydb:"sk,attr:SK" json:"-"`
	GSI1PK string `theorydb:"index:gsi1,pk,attr:gsi1PK" json:"-"`
	GSI1SK string `theorydb:"index:gsi1,sk,attr:gsi1SK" json:"-"`

	ID              string    `theorydb:"attr:id" json:"id"`
	UserID          string    `theorydb:"attr:userID" json:"user_id"`
	PublicKey       []byte    `theorydb:"attr:publicKey" json:"public_key"`
	AttestationType string    `theorydb:"attr:attestationType" json:"attestation_type"`
	AAGUID          []byte    `theorydb:"attr:aaguid" json:"aaguid"`
	SignCount       uint32    `theorydb:"attr:signCount" json:"sign_count"`
	CloneWarning    bool      `theorydb:"attr:cloneWarning" json:"clone_warning"`
	UserPresent     *bool     `theorydb:"attr:userPresent,omitempty" json:"user_present,omitempty"`
	UserVerified    *bool     `theorydb:"attr:userVerified,omitempty" json:"user_verified,omitempty"`
	BackupEligible  bool      `theorydb:"attr:backupEligible" json:"backup_eligible"`
	BackupState     bool      `theorydb:"attr:backupState" json:"backup_state"`
	CreatedAt       time.Time `theorydb:"attr:createdAt" json:"created_at"`
	LastUsedAt      time.Time `theorydb:"attr:lastUsedAt" json:"last_used_at"`
	Name            string    `theorydb:"attr:name" json:"name"`

	Type string `theorydb:"attr:type" json:"Type"`
	// contains filtered or unexported fields
}

WebAuthnCredential stores a user's WebAuthn credential.

func (*WebAuthnCredential) BeforeCreate

func (w *WebAuthnCredential) BeforeCreate() error

BeforeCreate updates keys and timestamps before creating WebAuthnCredential.

func (*WebAuthnCredential) BeforeUpdate

func (w *WebAuthnCredential) BeforeUpdate() error

BeforeUpdate updates timestamps and secondary index keys before updating WebAuthnCredential.

func (*WebAuthnCredential) GetPK

func (w *WebAuthnCredential) GetPK() string

GetPK returns the partition key for WebAuthnCredential.

func (*WebAuthnCredential) GetSK

func (w *WebAuthnCredential) GetSK() string

GetSK returns the sort key for WebAuthnCredential.

func (WebAuthnCredential) TableName

func (WebAuthnCredential) TableName() string

TableName returns the database table name for WebAuthnCredential.

func (*WebAuthnCredential) UpdateKeys

func (w *WebAuthnCredential) UpdateKeys() error

UpdateKeys updates the database keys for WebAuthnCredential.

Jump to

Keyboard shortcuts

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