sqlite

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sqlite implements the state.Store interface using embedded SQLite. This is the zero-dependency default backend -- no external DB needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteStore

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

SQLiteStore implements state.Store with an embedded SQLite database.

func New

func New(path string) (*SQLiteStore, error)

New creates a new SQLite store. If path is empty, uses an in-memory DB.

func (*SQLiteStore) AckActionDelivery added in v0.7.0

func (s *SQLiteStore) AckActionDelivery(ctx context.Context, id, token string) error

func (*SQLiteStore) BeginRunAttempt

func (s *SQLiteStore) BeginRunAttempt(ctx context.Context, id string, generation int64) (bool, error)

func (*SQLiteStore) ClaimActionDeliveries added in v0.7.0

func (s *SQLiteStore) ClaimActionDeliveries(ctx context.Context, sinkID string, now, leaseUntil time.Time, limit int) ([]*state.ActionDelivery, error)

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

Close closes the database connection.

func (*SQLiteStore) CompleteRun

func (*SQLiteStore) ConsumeApprovedAction

func (s *SQLiteStore) ConsumeApprovedAction(ctx context.Context, tenantID, agentID, runID string, generation int64, connector, tool, argsDigest, targetRevision, policyRevision, toolRevision string) (string, error)

ConsumeApprovedAction atomically marks an approved action consumed.

func (*SQLiteStore) CountActiveRuns

func (s *SQLiteStore) CountActiveRuns(ctx context.Context, agentID string) (int, error)

func (*SQLiteStore) CountAgents

func (s *SQLiteStore) CountAgents(ctx context.Context) (int, error)

func (*SQLiteStore) CountRunsByStatus

func (s *SQLiteStore) CountRunsByStatus(ctx context.Context) (map[string]int, error)

func (*SQLiteStore) CountRunsCreatedSince

func (s *SQLiteStore) CountRunsCreatedSince(ctx context.Context, since time.Time, agentID string) (int, error)

func (*SQLiteStore) CountRunsSince

func (s *SQLiteStore) CountRunsSince(ctx context.Context, tenantID, agentID string, since time.Time) (int64, error)

CountRunsSince counts runs created at/after since for tenant (optional agent).

func (*SQLiteStore) CountThreadsByStatus

func (s *SQLiteStore) CountThreadsByStatus(ctx context.Context) (map[string]int, error)

func (*SQLiteStore) CreateBreakGlassWindow

func (s *SQLiteStore) CreateBreakGlassWindow(ctx context.Context, w *models.BreakGlassWindow) error

func (*SQLiteStore) CreateCachedRun

func (s *SQLiteStore) CreateCachedRun(ctx context.Context, run *models.Run, caps *state.RunAdmissionCaps) error

func (*SQLiteStore) CreateConnectorAction added in v0.7.0

func (s *SQLiteStore) CreateConnectorAction(ctx context.Context, a *models.ConnectorAction, mutation string) (*models.ConnectorAction, error)

func (*SQLiteStore) CreatePendingAction

func (s *SQLiteStore) CreatePendingAction(ctx context.Context, a *models.PendingAction) error

CreatePendingAction inserts or reuses a scoped open approval. The canonical action ID is written back to a.ID. A nullable unique key arbitrates concurrent creates; legacy rows are reused without changing their stored history.

func (*SQLiteStore) CreateRun

func (s *SQLiteStore) CreateRun(ctx context.Context, run *models.Run) error

func (*SQLiteStore) CreateRunAdmitted

func (s *SQLiteStore) CreateRunAdmitted(ctx context.Context, run *models.Run, caps *state.RunAdmissionCaps) error

CreateRunAdmitted runs COUNT + INSERT under BEGIN IMMEDIATE so concurrent writers serialize (SQLite write lock) before either observes the other.

func (*SQLiteStore) CreateThread

func (s *SQLiteStore) CreateThread(ctx context.Context, thread *models.Thread) error

func (*SQLiteStore) CredentialLeaseStorage added in v0.7.0

func (s *SQLiteStore) CredentialLeaseStorage() (credentials.Store, error)

func (*SQLiteStore) DeleteBoundOpaqueCheckpoint

func (s *SQLiteStore) DeleteBoundOpaqueCheckpoint(ctx context.Context, binding state.RunCheckpointBinding, checkpointID string) error

func (*SQLiteStore) DeleteBreakGlassWindow

func (s *SQLiteStore) DeleteBreakGlassWindow(ctx context.Context, id string) error

func (*SQLiteStore) DeleteCronSchedule

func (s *SQLiteStore) DeleteCronSchedule(ctx context.Context, name string) error

func (*SQLiteStore) DeleteFinOpsOverlay

func (s *SQLiteStore) DeleteFinOpsOverlay(ctx context.Context) error

func (*SQLiteStore) DeleteItem

func (s *SQLiteStore) DeleteItem(ctx context.Context, namespace []string, key string) error

func (*SQLiteStore) DeleteKillSwitch

func (s *SQLiteStore) DeleteKillSwitch(ctx context.Context, id string) error

func (*SQLiteStore) DeleteMandatoryHITLRule

func (s *SQLiteStore) DeleteMandatoryHITLRule(ctx context.Context, id string) error

DeleteMandatoryHITLRule removes a rule by id.

func (*SQLiteStore) DeleteOpaqueCheckpoint

func (s *SQLiteStore) DeleteOpaqueCheckpoint(ctx context.Context, threadID, checkpointID string) error

func (*SQLiteStore) DeletePolicyGrant

func (s *SQLiteStore) DeletePolicyGrant(ctx context.Context, id string) error

DeletePolicyGrant removes a grant by id.

func (*SQLiteStore) DeleteRegistryEntry

func (s *SQLiteStore) DeleteRegistryEntry(ctx context.Context, name string) error

DeleteRegistryEntry also removes the entry's own version history -- see the Postgres backend's identical fix for the full rationale (delete-then-republish otherwise resurrects stale pre-delete version snapshots via ON CONFLICT DO NOTHING against orphaned rows).

func (*SQLiteStore) DeleteRun

func (s *SQLiteStore) DeleteRun(ctx context.Context, runID string) error

func (*SQLiteStore) DeleteThread

func (s *SQLiteStore) DeleteThread(ctx context.Context, threadID string) error

func (*SQLiteStore) Downgrade

func (s *SQLiteStore) Downgrade(ctx context.Context) error

Downgrade rolls back the most recently applied migration.

func (*SQLiteStore) ExpireGovernancePending

func (s *SQLiteStore) ExpireGovernancePending(ctx context.Context, now time.Time) error

ExpireGovernancePending denies embedded rows past expires_at. ponytail: no index on expires_at. Upgrade path is an index on (status, expires_at) if this sweep shows up in traces.

func (*SQLiteStore) ExpireUsageHolds

func (s *SQLiteStore) ExpireUsageHolds(ctx context.Context, olderThan time.Time) (int64, error)

ExpireUsageHolds deletes open holds with created_at strictly before olderThan. Releases budget pin for abandoned runs that never reached a terminal status callback (crash, lost runner). Returns rows deleted.

func (*SQLiteStore) FailActionDelivery added in v0.7.0

func (s *SQLiteStore) FailActionDelivery(ctx context.Context, id, token string, nextAt time.Time, reason string, dead bool) error

func (*SQLiteStore) FindActiveBreakGlass

func (s *SQLiteStore) FindActiveBreakGlass(ctx context.Context, tenantID, agentID string) (*models.BreakGlassWindow, error)

FindActiveBreakGlass returns the most specific active window: agent-scoped wins over tenant-wide (agent_id empty), then earliest expiry.

func (*SQLiteStore) FindActiveKill

func (s *SQLiteStore) FindActiveKill(ctx context.Context, tenantID, agentID string) (*models.KillSwitch, error)

FindActiveKill returns the most specific active switch: agent-scoped wins over tenant-wide (agent_id empty).

func (*SQLiteStore) FindOpenPendingAction

func (s *SQLiteStore) FindOpenPendingAction(ctx context.Context, tenantID, agentID, runID string, generation int64, connector, tool, argsDigest, targetRevision, policyRevision, toolRevision string, embedded bool) (*models.PendingAction, error)

FindOpenPendingAction returns the oldest still-pending row for this call tuple and argument digest.

func (*SQLiteStore) FinishConnectorAction added in v0.7.0

func (s *SQLiteStore) FinishConnectorAction(ctx context.Context, id string, version int64, dispatch string, obs models.ConnectorActionObservation, mutation string) (*models.ConnectorAction, error)

func (*SQLiteStore) GetAgent

func (s *SQLiteStore) GetAgent(ctx context.Context, agentID string) (*models.Agent, error)

func (*SQLiteStore) GetAgentSchema

func (s *SQLiteStore) GetAgentSchema(ctx context.Context, agentID string) (*models.AgentSchema, error)

func (*SQLiteStore) GetAgentVersion

func (s *SQLiteStore) GetAgentVersion(ctx context.Context, agentID string, version int) (*models.AgentVersion, error)

func (*SQLiteStore) GetBreakGlassWindow

func (s *SQLiteStore) GetBreakGlassWindow(ctx context.Context, id string) (*models.BreakGlassWindow, error)

func (*SQLiteStore) GetCachedRunResult

func (s *SQLiteStore) GetCachedRunResult(ctx context.Context, cacheKey string) (*models.CachedRunResult, error)

func (*SQLiteStore) GetConnectorAction added in v0.7.0

func (s *SQLiteStore) GetConnectorAction(ctx context.Context, id string) (*models.ConnectorAction, error)

func (*SQLiteStore) GetFinOpsOverlay

func (s *SQLiteStore) GetFinOpsOverlay(ctx context.Context) (*models.FinOpsOverlay, error)

func (*SQLiteStore) GetItem

func (s *SQLiteStore) GetItem(ctx context.Context, namespace []string, key string, refreshTTL bool) (*models.StoreItem, error)

func (*SQLiteStore) GetKillSwitch

func (s *SQLiteStore) GetKillSwitch(ctx context.Context, id string) (*models.KillSwitch, error)

func (*SQLiteStore) GetLastCronFireTime

func (s *SQLiteStore) GetLastCronFireTime(ctx context.Context, scheduleName string) (time.Time, bool, error)

func (*SQLiteStore) GetLatestCheckpoint

func (s *SQLiteStore) GetLatestCheckpoint(ctx context.Context, threadID string) (*models.ThreadState, error)

func (*SQLiteStore) GetLatestOpaqueCheckpoint

func (s *SQLiteStore) GetLatestOpaqueCheckpoint(ctx context.Context, threadID, namespace string) (*models.OpaqueCheckpoint, error)

GetLatestOpaqueCheckpoint returns the newest opaque blob for threadID. namespace "" = root graph keys (checkpoint_id with no "\x1f"); otherwise keys prefixed with namespace+"\x1f" (LangGraph folds checkpoint_ns into the opaque path key this way).

func (*SQLiteStore) GetMandatoryHITLRule

func (s *SQLiteStore) GetMandatoryHITLRule(ctx context.Context, id string) (*models.MandatoryHITLRule, error)

GetMandatoryHITLRule returns one rule by id.

func (*SQLiteStore) GetOpaqueCheckpoint

func (s *SQLiteStore) GetOpaqueCheckpoint(ctx context.Context, threadID, checkpointID string) (*models.OpaqueCheckpoint, error)

func (*SQLiteStore) GetPendingAction

func (s *SQLiteStore) GetPendingAction(ctx context.Context, id string) (*models.PendingAction, error)

GetPendingAction returns one row by id.

func (*SQLiteStore) GetPolicyGrant

func (s *SQLiteStore) GetPolicyGrant(ctx context.Context, id string) (*models.PolicyGrant, error)

GetPolicyGrant returns one grant by id.

func (*SQLiteStore) GetRegistryEntry

func (s *SQLiteStore) GetRegistryEntry(ctx context.Context, name string) (*models.RegistryEntry, error)

func (*SQLiteStore) GetRegistryEntryVersion

func (s *SQLiteStore) GetRegistryEntryVersion(ctx context.Context, name string, version int) (*models.RegistryEntryVersion, error)

func (*SQLiteStore) GetRun

func (s *SQLiteStore) GetRun(ctx context.Context, runID string) (*models.Run, error)

func (*SQLiteStore) GetRunUsage added in v0.8.0

func (s *SQLiteStore) GetRunUsage(ctx context.Context, binding state.RunUsageBinding) (*models.RunUsageSnapshot, error)

func (*SQLiteStore) GetThread

func (s *SQLiteStore) GetThread(ctx context.Context, threadID string) (*models.Thread, error)

func (*SQLiteStore) GetWebhookDeadLetter

func (s *SQLiteStore) GetWebhookDeadLetter(ctx context.Context, id string) (*models.WebhookDeadLetter, error)

func (*SQLiteStore) Init

func (s *SQLiteStore) Init(ctx context.Context) error

Init applies pending numbered schema migrations (baseline = full DDL).

func (*SQLiteStore) ListActiveRunsCreatedBefore

func (s *SQLiteStore) ListActiveRunsCreatedBefore(ctx context.Context, before time.Time, limit int) ([]*models.Run, error)

func (*SQLiteStore) ListAgentVersions

func (s *SQLiteStore) ListAgentVersions(ctx context.Context, agentID string) ([]*models.AgentVersion, error)

func (*SQLiteStore) ListBreakGlassWindows

func (s *SQLiteStore) ListBreakGlassWindows(ctx context.Context) ([]*models.BreakGlassWindow, error)

func (*SQLiteStore) ListCheckpoints

func (s *SQLiteStore) ListCheckpoints(ctx context.Context, threadID string, limit int, before string) ([]*models.ThreadState, error)

func (*SQLiteStore) ListConnectorActionEvents added in v0.7.0

func (s *SQLiteStore) ListConnectorActionEvents(ctx context.Context, id string, after int64, limit int) ([]*models.ConnectorActionEvent, error)

func (*SQLiteStore) ListCronSchedules

func (s *SQLiteStore) ListCronSchedules(ctx context.Context) ([]*models.CronSchedule, error)

ListCronSchedules is always called from a system context in practice (the scheduler loop must see every tenant's schedules to service them all -- see cmd/cron.go), but honors a regular tenant context too for completeness/testability: TenantID is always populated on the returned rows either way, since the scheduler needs it to dispatch each fire under its own schedule's tenant, not whichever context listed it.

func (*SQLiteStore) ListKillSwitches

func (s *SQLiteStore) ListKillSwitches(ctx context.Context) ([]*models.KillSwitch, error)

func (*SQLiteStore) ListMandatoryHITLRules

func (s *SQLiteStore) ListMandatoryHITLRules(ctx context.Context) ([]*models.MandatoryHITLRule, error)

ListMandatoryHITLRules returns every durable mandatory-HITL rule.

func (*SQLiteStore) ListNamespaces

func (s *SQLiteStore) ListNamespaces(ctx context.Context, req *models.StoreListNamespacesRequest) ([][]string, error)

func (*SQLiteStore) ListOpaqueCheckpoints

func (s *SQLiteStore) ListOpaqueCheckpoints(ctx context.Context, threadID string, limit int) ([]models.OpaqueCheckpointMeta, error)

func (*SQLiteStore) ListPendingActionApprovals added in v0.7.0

func (s *SQLiteStore) ListPendingActionApprovals(ctx context.Context, id string) ([]models.PendingActionApproval, error)

func (*SQLiteStore) ListPolicyGrants

func (s *SQLiteStore) ListPolicyGrants(ctx context.Context) ([]*models.PolicyGrant, error)

ListPolicyGrants returns every durable grant.

func (*SQLiteStore) ListRegistryEntryVersions

func (s *SQLiteStore) ListRegistryEntryVersions(ctx context.Context, name string) ([]*models.RegistryEntryVersion, error)

func (*SQLiteStore) ListWebhookDeadLetters

func (s *SQLiteStore) ListWebhookDeadLetters(ctx context.Context, limit int) ([]*models.WebhookDeadLetter, error)

func (*SQLiteStore) MarkExpiredConnectorActionsUnknown added in v0.7.0

func (s *SQLiteStore) MarkExpiredConnectorActionsUnknown(ctx context.Context, cutoff time.Time, limit int) (int, error)

func (*SQLiteStore) PeekApprovedConnectorAction added in v0.7.0

func (s *SQLiteStore) PeekApprovedConnectorAction(ctx context.Context, id string) (*models.PendingAction, error)

func (*SQLiteStore) Ping

func (s *SQLiteStore) Ping(ctx context.Context) error

Ping verifies the database file is still reachable/openable. Mostly a formality for SQLite (an embedded file, not a network service that can go down independently of this process) but kept for interface symmetry with the network-backed stores, and it does catch a real failure mode: the file being deleted or its directory becoming unwritable out from under a running process.

func (*SQLiteStore) PrepareConnectorActionDispatch added in v0.7.0

func (s *SQLiteStore) PrepareConnectorActionDispatch(ctx context.Context, id string, version int64, approval, source string, deadline time.Time, mutation string) (*state.ConnectorActionDispatch, error)

func (*SQLiteStore) PruneCheckpoints

func (s *SQLiteStore) PruneCheckpoints(ctx context.Context, keepLast int) (int64, error)

func (*SQLiteStore) PruneConnectorActions added in v0.7.0

func (s *SQLiteStore) PruneConnectorActions(ctx context.Context, cutoff time.Time, limit int) (int, error)

func (*SQLiteStore) PruneCronClaims

func (s *SQLiteStore) PruneCronClaims(ctx context.Context, olderThan time.Time) (int64, error)

func (*SQLiteStore) PruneExpiredStoreItems

func (s *SQLiteStore) PruneExpiredStoreItems(ctx context.Context) (int64, error)

func (*SQLiteStore) PruneOpaqueCheckpoints

func (s *SQLiteStore) PruneOpaqueCheckpoints(ctx context.Context, keepLast int) (int64, error)

func (*SQLiteStore) PruneRuns

func (s *SQLiteStore) PruneRuns(ctx context.Context, olderThan time.Time) (int64, error)

func (*SQLiteStore) PruneTerminalHookClaims

func (s *SQLiteStore) PruneTerminalHookClaims(ctx context.Context, olderThan time.Time) (int64, error)

func (*SQLiteStore) PruneWebhookDeadLetters

func (s *SQLiteStore) PruneWebhookDeadLetters(ctx context.Context, olderThan time.Time) (int64, error)

func (*SQLiteStore) PublishRegistryEntry

func (s *SQLiteStore) PublishRegistryEntry(ctx context.Context, entry *models.RegistryEntry) error

func (*SQLiteStore) PutBoundOpaqueCheckpoint

func (s *SQLiteStore) PutBoundOpaqueCheckpoint(ctx context.Context, binding state.RunCheckpointBinding, checkpointID string, data []byte, framework string, ifMatch *int64) (int64, error)

func (*SQLiteStore) PutItem

func (s *SQLiteStore) PutItem(ctx context.Context, item *models.StoreItem) error

func (*SQLiteStore) PutOpaqueCheckpoint

func (s *SQLiteStore) PutOpaqueCheckpoint(ctx context.Context, threadID, checkpointID string, data []byte, framework string, ifMatch *int64) (int64, error)

func (*SQLiteStore) RecordConnectorActionDecision added in v0.7.0

func (s *SQLiteStore) RecordConnectorActionDecision(ctx context.Context, id string, version int64, dec models.ConnectorActionDecision, mutation string) (*models.ConnectorAction, error)

func (*SQLiteStore) ReleaseCronClaim

func (s *SQLiteStore) ReleaseCronClaim(ctx context.Context, scheduleName string, fireTime time.Time) error

func (*SQLiteStore) ReleaseThreadIfNoOtherActive

func (s *SQLiteStore) ReleaseThreadIfNoOtherActive(ctx context.Context, threadID, excludeRunID string, status models.ThreadStatus) (bool, error)

ReleaseThreadIfNoOtherActive is a single conditional UPDATE -- the inverse of TryClaimThread -- so a late StatusCallback cannot idle a thread that a newer run already claimed.

func (*SQLiteStore) ReleaseUsageHold

func (s *SQLiteStore) ReleaseUsageHold(ctx context.Context, runID string) error

ReleaseUsageHold deletes the open hold for a run (no-op if missing).

func (*SQLiteStore) ReportRunUsage added in v0.8.0

func (s *SQLiteStore) ReportRunUsage(ctx context.Context, binding state.RunUsageBinding, report models.RunUsageReport) (*models.RunUsageSnapshot, bool, error)

func (*SQLiteStore) RetryActionDelivery added in v0.7.0

func (s *SQLiteStore) RetryActionDelivery(ctx context.Context, tenantID, id string) error

func (*SQLiteStore) SaveCachedRunResult

func (s *SQLiteStore) SaveCachedRunResult(ctx context.Context, result *models.CachedRunResult) error

func (*SQLiteStore) SaveCheckpoint

func (s *SQLiteStore) SaveCheckpoint(ctx context.Context, threadID string, ts *models.ThreadState) error

func (*SQLiteStore) SaveWebhookDeadLetter

func (s *SQLiteStore) SaveWebhookDeadLetter(ctx context.Context, dl *models.WebhookDeadLetter) error

func (*SQLiteStore) SearchActionDeliveries added in v0.7.0

func (s *SQLiteStore) SearchActionDeliveries(ctx context.Context, req *state.ActionDeliverySearchRequest) ([]*state.ActionDelivery, error)

func (*SQLiteStore) SearchAgents

func (s *SQLiteStore) SearchAgents(ctx context.Context, req *models.AgentSearchRequest) ([]*models.Agent, error)

func (*SQLiteStore) SearchAuditEvents

func (s *SQLiteStore) SearchAuditEvents(ctx context.Context, req *models.AuditSearchRequest) ([]*models.AuditEvent, error)

SearchAuditEvents lists policy decisions newest-first.

func (*SQLiteStore) SearchBreakGlassWindows

func (s *SQLiteStore) SearchBreakGlassWindows(ctx context.Context, req *models.BreakGlassSearchRequest) ([]*models.BreakGlassWindow, error)

func (*SQLiteStore) SearchConnectorActions added in v0.7.0

func (s *SQLiteStore) SearchConnectorActions(ctx context.Context, req *models.ConnectorActionSearchRequest) ([]*models.ConnectorAction, error)

func (*SQLiteStore) SearchItems

func (s *SQLiteStore) SearchItems(ctx context.Context, req *models.StoreSearchRequest) ([]*models.StoreItem, error)

func (*SQLiteStore) SearchKillSwitches

func (s *SQLiteStore) SearchKillSwitches(ctx context.Context, req *models.KillSwitchSearchRequest) ([]*models.KillSwitch, error)

func (*SQLiteStore) SearchMandatoryHITLRules

func (s *SQLiteStore) SearchMandatoryHITLRules(ctx context.Context, req *models.MandatoryHITLSearchRequest) ([]*models.MandatoryHITLRule, error)

SearchMandatoryHITLRules lists rules with optional filters and keyset paging.

func (*SQLiteStore) SearchPendingActions

func (s *SQLiteStore) SearchPendingActions(ctx context.Context, req *models.PendingActionSearchRequest) ([]*models.PendingAction, error)

SearchPendingActions lists pending actions with optional filters.

func (*SQLiteStore) SearchPolicyGrants

func (s *SQLiteStore) SearchPolicyGrants(ctx context.Context, req *models.PolicyGrantSearchRequest) ([]*models.PolicyGrant, error)

SearchPolicyGrants lists grants with optional filters and keyset paging.

func (*SQLiteStore) SearchRegistryEntries

func (s *SQLiteStore) SearchRegistryEntries(ctx context.Context, req *models.RegistrySearchRequest) ([]*models.RegistryEntry, error)

func (*SQLiteStore) SearchRuns

func (s *SQLiteStore) SearchRuns(ctx context.Context, req *models.RunSearchRequest) ([]*models.Run, error)

func (*SQLiteStore) SearchThreads

func (s *SQLiteStore) SearchThreads(ctx context.Context, req *models.ThreadSearchRequest) ([]*models.Thread, error)

func (*SQLiteStore) SearchUsageSummary

func (s *SQLiteStore) SearchUsageSummary(ctx context.Context, req *models.UsageSummaryRequest) ([]models.UsageSummaryRow, error)

SearchUsageSummary groups usage_events by tenant/agent/UTC day.

func (*SQLiteStore) SetPendingActionApproved

func (s *SQLiteStore) SetPendingActionApproved(ctx context.Context, id, decidedBy string) error

func (*SQLiteStore) SetPendingActionStatus

func (s *SQLiteStore) SetPendingActionStatus(ctx context.Context, id, fromStatus, toStatus string) error

SetPendingActionStatus updates status if still in fromStatus.

func (*SQLiteStore) SetThreadStatus

func (s *SQLiteStore) SetThreadStatus(ctx context.Context, threadID string, status models.ThreadStatus) error

func (*SQLiteStore) SumUsage

func (s *SQLiteStore) SumUsage(ctx context.Context, tenantID, agentID string, since, until time.Time) (tokensIn, tokensOut int64, usd float64, err error)

SumUsage aggregates tokens and USD for a tenant (and optional agent) in [since, until).

func (*SQLiteStore) SumUsageHolds

func (s *SQLiteStore) SumUsageHolds(ctx context.Context, tenantID, agentID string, since, until time.Time) (usd float64, tokens int64, count int64, err error)

SumUsageHolds totals open holds for tenant (and optional agent) in [since, until).

func (*SQLiteStore) SupportsWorkloadIdentity added in v0.8.0

func (*SQLiteStore) SupportsWorkloadIdentity() bool

func (*SQLiteStore) TryClaimCronFire

func (s *SQLiteStore) TryClaimCronFire(ctx context.Context, scheduleName string, fireTime time.Time) (bool, error)

func (*SQLiteStore) TryClaimTerminalHook

func (s *SQLiteStore) TryClaimTerminalHook(ctx context.Context, runID string) (bool, error)

func (*SQLiteStore) TryClaimThread

func (s *SQLiteStore) TryClaimThread(ctx context.Context, threadID string) (bool, error)

TryClaimThread does the busy-check and the busy-write as one atomic UPDATE ... WHERE status != 'busy', so two concurrent callers can never both see success -- exactly one wins the race, the other gets rowsAffected=0.

func (*SQLiteStore) TryMarkRunTimeout

func (s *SQLiteStore) TryMarkRunTimeout(ctx context.Context, runID string, errMsg string) (bool, error)

func (*SQLiteStore) UpdateRunStatus

func (s *SQLiteStore) UpdateRunStatus(ctx context.Context, runID string, status models.RunStatus, output []byte, errMsg string) error

func (*SQLiteStore) UpdateThread

func (s *SQLiteStore) UpdateThread(ctx context.Context, threadID string, patch *models.ThreadPatch) (*models.Thread, error)

func (*SQLiteStore) UpsertAgent

func (s *SQLiteStore) UpsertAgent(ctx context.Context, agent *models.Agent) error

func (*SQLiteStore) UpsertAgentSchema

func (s *SQLiteStore) UpsertAgentSchema(ctx context.Context, schema *models.AgentSchema) error

func (*SQLiteStore) UpsertCronSchedule

func (s *SQLiteStore) UpsertCronSchedule(ctx context.Context, sched *models.CronSchedule) error

func (*SQLiteStore) UpsertFinOpsOverlay

func (s *SQLiteStore) UpsertFinOpsOverlay(ctx context.Context, o *models.FinOpsOverlay) error

func (*SQLiteStore) UpsertKillSwitch

func (s *SQLiteStore) UpsertKillSwitch(ctx context.Context, k *models.KillSwitch) error

func (*SQLiteStore) UpsertMandatoryHITLRule

func (s *SQLiteStore) UpsertMandatoryHITLRule(ctx context.Context, r *models.MandatoryHITLRule) error

UpsertMandatoryHITLRule inserts or replaces a rule by id.

func (*SQLiteStore) UpsertPolicyGrant

func (s *SQLiteStore) UpsertPolicyGrant(ctx context.Context, g *models.PolicyGrant) error

UpsertPolicyGrant inserts or replaces a grant by id.

func (*SQLiteStore) UpsertUsageHold

func (s *SQLiteStore) UpsertUsageHold(ctx context.Context, h *models.UsageHold) error

UpsertUsageHold inserts or replaces the open hold for a run.

func (*SQLiteStore) WriteAuditEvent

func (s *SQLiteStore) WriteAuditEvent(ctx context.Context, ev *models.AuditEvent) error

WriteAuditEvent persists one policy/security decision.

func (*SQLiteStore) WriteUsageEvent

func (s *SQLiteStore) WriteUsageEvent(ctx context.Context, ev *models.UsageEvent) error

WriteUsageEvent upserts one usage row keyed by (run_id, source).

Jump to

Keyboard shortcuts

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