globaldb

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalDB

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

GlobalDB owns the global session index and observability database.

func OpenGlobalDB

func OpenGlobalDB(ctx context.Context, path string) (*GlobalDB, error)

OpenGlobalDB opens or creates the global AGH index database.

func (*GlobalDB) AdvanceCursor

func (g *GlobalDB) AdvanceCursor(
	ctx context.Context,
	update notifications.AdvanceCursor,
) (cursor notifications.Cursor, err error)

AdvanceCursor records a monotonic confirmed delivery position.

func (*GlobalDB) AdvanceSessionInputGeneration

func (g *GlobalDB) AdvanceSessionInputGeneration(ctx context.Context, sessionID string, now time.Time) (int64, error)

AdvanceSessionInputGeneration increments the session generation used to fence stale queue entries.

func (*GlobalDB) AppendHeartbeatRevision

func (g *GlobalDB) AppendHeartbeatRevision(
	ctx context.Context,
	revision heartbeat.Revision,
) (heartbeat.Revision, error)

AppendHeartbeatRevision appends one managed Heartbeat authoring revision row.

func (*GlobalDB) AppendHeartbeatWakeEvent

func (g *GlobalDB) AppendHeartbeatWakeEvent(
	ctx context.Context,
	event heartbeat.WakeEvent,
) (heartbeat.WakeEvent, error)

AppendHeartbeatWakeEvent appends one retained Heartbeat wake audit row.

func (*GlobalDB) AppendSoulRevision

func (g *GlobalDB) AppendSoulRevision(ctx context.Context, revision soul.Revision) (soul.Revision, error)

AppendSoulRevision appends one managed authoring revision row.

func (*GlobalDB) AttachSession

AttachSession acquires a short-lived attach lease for a resumable session.

func (*GlobalDB) BindRunReviewSession

func (g *GlobalDB) BindRunReviewSession(
	ctx context.Context,
	req taskpkg.BindRunReviewSessionRequest,
	boundAt time.Time,
) (stored taskpkg.RunReview, err error)

BindRunReviewSession binds an active review request to a reviewer session.

func (*GlobalDB) CancelPendingSessionInputs

func (g *GlobalDB) CancelPendingSessionInputs(
	ctx context.Context,
	sessionID string,
	generation int64,
	now time.Time,
) (int, error)

CancelPendingSessionInputs cancels stale entries older than the supplied generation.

func (*GlobalDB) CancelSessionInput

func (g *GlobalDB) CancelSessionInput(
	ctx context.Context,
	sessionID string,
	entryID string,
	now time.Time,
) (store.SessionInputQueueEntry, error)

CancelSessionInput cancels one pending queue entry.

func (*GlobalDB) ClaimNextRun

func (g *GlobalDB) ClaimNextRun(ctx context.Context, criteria taskpkg.ClaimCriteria) (taskpkg.ClaimResult, error)

ClaimNextRun atomically selects and claims the next eligible queued task run.

func (*GlobalDB) ClaimNextSessionInput

func (g *GlobalDB) ClaimNextSessionInput(
	ctx context.Context,
	sessionID string,
	now time.Time,
) (entry store.SessionInputQueueEntry, ok bool, err error)

ClaimNextSessionInput atomically leases the next eligible input for dispatch.

func (*GlobalDB) ClaimScheduledRun

func (g *GlobalDB) ClaimScheduledRun(
	ctx context.Context,
	claim automation.SchedulerClaim,
) (result automation.SchedulerClaimResult, err error)

ClaimScheduledRun advances one durable cursor and creates a run reservation before scheduler dispatch begins.

func (*GlobalDB) Close

func (g *GlobalDB) Close(ctx context.Context) error

Close checkpoints the WAL and closes the database.

func (*GlobalDB) CompleteOnboarding

func (g *GlobalDB) CompleteOnboarding(ctx context.Context, completedAt string) (store.OnboardingStatus, error)

CompleteOnboarding stores the first completion timestamp and preserves it on repeat calls.

func (*GlobalDB) CompleteRunLease

func (g *GlobalDB) CompleteRunLease(ctx context.Context, completion taskpkg.LeaseCompletion) (taskpkg.Run, error)

CompleteRunLease marks one claimed run complete after token verification.

func (*GlobalDB) ConsumeSessionSteer

func (g *GlobalDB) ConsumeSessionSteer(
	ctx context.Context,
	sessionID string,
	now time.Time,
) (entry store.SessionInputQueueEntry, ok bool, err error)

ConsumeSessionSteer atomically marks the staged steer entry as sent and returns it once.

func (*GlobalDB) CountActiveSessionBindings

func (g *GlobalDB) CountActiveSessionBindings(ctx context.Context, sessionID string) (int, error)

CountActiveSessionBindings reports how many non-terminal runs are bound to one session.

func (*GlobalDB) CountActiveTaskRunClaims

func (g *GlobalDB) CountActiveTaskRunClaims(ctx context.Context) (int, error)

CountActiveTaskRunClaims returns currently leased task runs.

func (*GlobalDB) CountBundleActivationsForExtension

func (g *GlobalDB) CountBundleActivationsForExtension(ctx context.Context, extensionName string) (int, error)

func (*GlobalDB) CountDependencies

func (g *GlobalDB) CountDependencies(ctx context.Context, taskID string) (int, error)

CountDependencies reports how many dependency edges are stored for one task.

func (*GlobalDB) CountDirectChildren

func (g *GlobalDB) CountDirectChildren(ctx context.Context, parentTaskID string) (int, error)

CountDirectChildren reports how many persisted tasks reference the supplied parent id.

func (*GlobalDB) CountPausedTasks

func (g *GlobalDB) CountPausedTasks(ctx context.Context) (int, error)

CountPausedTasks returns the number of directly paused tasks.

func (*GlobalDB) CountQueuedTaskRuns

func (g *GlobalDB) CountQueuedTaskRuns(ctx context.Context, includePaused bool) (int, error)

CountQueuedTaskRuns returns queued run pressure, optionally excluding paused tasks.

func (*GlobalDB) CountRuns

func (g *GlobalDB) CountRuns(ctx context.Context, query automation.RunQuery) (int64, error)

CountRuns returns the number of automation runs matching the supplied filters.

func (*GlobalDB) CreateDependency

func (g *GlobalDB) CreateDependency(ctx context.Context, dependency taskpkg.Dependency) error

CreateDependency inserts one durable task-dependency edge under a single SQLite write lock.

func (*GlobalDB) CreateJob

func (g *GlobalDB) CreateJob(ctx context.Context, job automation.Job) (automation.Job, error)

CreateJob stores a new automation job definition.

func (*GlobalDB) CreatePreset

func (g *GlobalDB) CreatePreset(
	ctx context.Context,
	preset presetspkg.Preset,
) (presetspkg.Preset, error)

func (*GlobalDB) CreateRun

func (g *GlobalDB) CreateRun(ctx context.Context, run automation.Run) (automation.Run, error)

CreateRun stores a new automation run history row.

func (*GlobalDB) CreateTask

func (g *GlobalDB) CreateTask(ctx context.Context, record taskpkg.Task) error

CreateTask inserts one durable task record.

func (*GlobalDB) CreateTaskEvent

func (g *GlobalDB) CreateTaskEvent(ctx context.Context, event taskpkg.Event) error

CreateTaskEvent inserts one immutable task audit event.

func (*GlobalDB) CreateTaskRun

func (g *GlobalDB) CreateTaskRun(ctx context.Context, run taskpkg.Run) error

CreateTaskRun inserts one durable task-run record.

func (*GlobalDB) CreateTrigger

func (g *GlobalDB) CreateTrigger(ctx context.Context, trigger automation.Trigger) (automation.Trigger, error)

CreateTrigger stores a new automation trigger definition.

func (*GlobalDB) CurrentSessionInputGeneration

func (g *GlobalDB) CurrentSessionInputGeneration(ctx context.Context, sessionID string) (int64, error)

CurrentSessionInputGeneration returns the persisted busy-input generation for a session.

func (*GlobalDB) DB

func (g *GlobalDB) DB() *sql.DB

DB exposes the underlying SQL connection for composition-root adapters such as the extension registry.

func (*GlobalDB) DeleteAppMetadata

func (g *GlobalDB) DeleteAppMetadata(ctx context.Context, key string) error

DeleteAppMetadata removes the value stored under key. Missing keys are a no-op.

func (*GlobalDB) DeleteBridgeInstance

func (g *GlobalDB) DeleteBridgeInstance(ctx context.Context, id string) error

DeleteBridgeInstance removes a persisted bridge instance row.

func (*GlobalDB) DeleteBridgeRoute

func (g *GlobalDB) DeleteBridgeRoute(ctx context.Context, routingKeyHash string) error

DeleteBridgeRoute removes one persisted route row.

func (*GlobalDB) DeleteBridgeSecretBinding

func (g *GlobalDB) DeleteBridgeSecretBinding(ctx context.Context, bridgeInstanceID string, bindingName string) error

DeleteBridgeSecretBinding removes one persisted secret binding row.

func (*GlobalDB) DeleteBridgeTaskSubscription

func (g *GlobalDB) DeleteBridgeTaskSubscription(ctx context.Context, subscriptionID string) error

DeleteBridgeTaskSubscription removes one terminal task notification subscription.

func (*GlobalDB) DeleteDependency

func (g *GlobalDB) DeleteDependency(ctx context.Context, taskID string, dependsOnID string) error

DeleteDependency removes one persisted dependency edge.

func (*GlobalDB) DeleteExecutionProfile

func (g *GlobalDB) DeleteExecutionProfile(ctx context.Context, taskID string) error

DeleteExecutionProfile removes one profile and its selector rows.

func (*GlobalDB) DeleteExpiredBridgeIngestDedup

func (g *GlobalDB) DeleteExpiredBridgeIngestDedup(ctx context.Context, now time.Time) (int64, error)

DeleteExpiredBridgeIngestDedup removes expired dedup rows and reports how many were deleted.

func (*GlobalDB) DeleteJob

func (g *GlobalDB) DeleteJob(ctx context.Context, id string) error

DeleteJob removes an automation job definition.

func (*GlobalDB) DeleteJobEnabledOverlay

func (g *GlobalDB) DeleteJobEnabledOverlay(ctx context.Context, jobID string) error

DeleteJobEnabledOverlay clears a persisted job enabled overlay if it exists.

func (*GlobalDB) DeleteMCPAuthToken

func (g *GlobalDB) DeleteMCPAuthToken(ctx context.Context, serverName string) error

DeleteMCPAuthToken removes persisted token state for one server.

func (*GlobalDB) DeleteNetworkChannel

func (g *GlobalDB) DeleteNetworkChannel(ctx context.Context, ref store.NetworkChannelRef) error

DeleteNetworkChannel removes one persisted channel metadata row.

func (*GlobalDB) DeletePreset

func (g *GlobalDB) DeletePreset(ctx context.Context, name string) error

func (*GlobalDB) DeleteRun

func (g *GlobalDB) DeleteRun(ctx context.Context, id string) error

DeleteRun removes an automation run history row.

func (*GlobalDB) DeleteSchedulerState

func (g *GlobalDB) DeleteSchedulerState(ctx context.Context, jobID string) error

DeleteSchedulerState removes a durable scheduler cursor if it exists.

func (*GlobalDB) DeleteTask

func (g *GlobalDB) DeleteTask(ctx context.Context, id string) error

DeleteTask removes one durable task record and any ON DELETE CASCADE children owned by the task tables.

func (*GlobalDB) DeleteTrigger

func (g *GlobalDB) DeleteTrigger(ctx context.Context, id string) error

DeleteTrigger removes an automation trigger definition.

func (*GlobalDB) DeleteTriggerEnabledOverlay

func (g *GlobalDB) DeleteTriggerEnabledOverlay(ctx context.Context, triggerID string) error

DeleteTriggerEnabledOverlay clears a persisted trigger enabled overlay if it exists.

func (*GlobalDB) DeleteVaultSecret

func (g *GlobalDB) DeleteVaultSecret(ctx context.Context, ref string) error

DeleteVaultSecret removes one encrypted vault secret record.

func (*GlobalDB) DeleteWorkspace

func (g *GlobalDB) DeleteWorkspace(ctx context.Context, id string) error

DeleteWorkspace removes a persisted workspace registration row.

func (*GlobalDB) EnqueueSessionInput

func (g *GlobalDB) EnqueueSessionInput(
	ctx context.Context,
	req store.SessionInputQueueInsert,
) (entry store.SessionInputQueueEntry, position int, err error)

EnqueueSessionInput appends one queued operator input entry under the configured cap.

func (*GlobalDB) EnsureBuiltInPresets

func (g *GlobalDB) EnsureBuiltInPresets(
	ctx context.Context,
	defaults []presetspkg.Preset,
) (err error)

EnsureBuiltInPresets inserts disabled built-ins and records default drift without overwriting user edits.

func (*GlobalDB) FailRunLease

func (g *GlobalDB) FailRunLease(ctx context.Context, failure taskpkg.LeaseFailure) (taskpkg.Run, error)

FailRunLease marks one claimed run failed after token verification.

func (*GlobalDB) FindBridgeTargetsByNormalized

func (g *GlobalDB) FindBridgeTargetsByNormalized(
	ctx context.Context,
	bridgeID string,
	normalized string,
) ([]bridges.BridgeTarget, error)

FindBridgeTargetsByNormalized returns exact normalized display-name matches.

func (*GlobalDB) FindBridgeTargetsByPrefix

func (g *GlobalDB) FindBridgeTargetsByPrefix(
	ctx context.Context,
	bridgeID string,
	normalizedPrefix string,
) ([]bridges.BridgeTarget, error)

FindBridgeTargetsByPrefix returns normalized display-name prefix matches.

func (*GlobalDB) FindBridgeTargetsByQualifiedName

func (g *GlobalDB) FindBridgeTargetsByQualifiedName(
	ctx context.Context,
	bridgeID string,
	qualifier string,
	normalized string,
) ([]bridges.BridgeTarget, error)

FindBridgeTargetsByQualifiedName returns exact qualifier plus normalized-name matches.

func (*GlobalDB) FindHeartbeatRevisionForRollback

func (g *GlobalDB) FindHeartbeatRevisionForRollback(
	ctx context.Context,
	query heartbeat.RollbackLookup,
) (heartbeat.Revision, error)

FindHeartbeatRevisionForRollback returns the revision body selected for a managed rollback.

func (*GlobalDB) FindHeartbeatSnapshotByDigest

func (g *GlobalDB) FindHeartbeatSnapshotByDigest(
	ctx context.Context,
	workspaceID string,
	agentName string,
	digest string,
) (heartbeat.Snapshot, bool, error)

FindHeartbeatSnapshotByDigest returns the snapshot matching an agent digest.

func (*GlobalDB) FindSoulRevisionForRollback

func (g *GlobalDB) FindSoulRevisionForRollback(
	ctx context.Context,
	query soul.RollbackLookup,
) (soul.Revision, error)

FindSoulRevisionForRollback returns the revision body selected for a managed rollback.

func (*GlobalDB) FindSoulSnapshotByDigest

func (g *GlobalDB) FindSoulSnapshotByDigest(
	ctx context.Context,
	workspaceID string,
	agentName string,
	digest string,
) (soul.Snapshot, bool, error)

FindSoulSnapshotByDigest returns the snapshot matching an agent digest.

func (*GlobalDB) ForceFailTaskRun

func (g *GlobalDB) ForceFailTaskRun(
	ctx context.Context,
	failure taskpkg.ForceFailRunMutation,
) (taskpkg.ForceRunMutationResult, error)

ForceFailTaskRun marks one queued or claimed run as operator-forced failed with snapshot fencing.

func (*GlobalDB) ForceReleaseTaskRun

func (g *GlobalDB) ForceReleaseTaskRun(
	ctx context.Context,
	release taskpkg.ForceReleaseRunMutation,
) (taskpkg.ForceRunMutationResult, error)

ForceReleaseTaskRun requeues one claimed run with snapshot fencing.

func (*GlobalDB) GetAppMetadata

func (g *GlobalDB) GetAppMetadata(ctx context.Context, key string) (string, bool, error)

GetAppMetadata returns the value stored under key and whether the key exists.

func (*GlobalDB) GetBridgeIngestDedup

func (g *GlobalDB) GetBridgeIngestDedup(
	ctx context.Context,
	idempotencyKey string,
	lookupAt time.Time,
) (bridges.IngestDedupRecord, error)

GetBridgeIngestDedup loads one active dedup record and excludes expired rows at the supplied lookup time.

func (*GlobalDB) GetBridgeInstance

func (g *GlobalDB) GetBridgeInstance(ctx context.Context, id string) (bridges.BridgeInstance, error)

GetBridgeInstance loads one persisted bridge instance by primary key.

func (*GlobalDB) GetBridgeRoute

func (g *GlobalDB) GetBridgeRoute(ctx context.Context, routingKeyHash string) (bridges.BridgeRoute, error)

GetBridgeRoute loads one persisted route by routing-key hash.

func (*GlobalDB) GetBridgeSecretBinding

func (g *GlobalDB) GetBridgeSecretBinding(
	ctx context.Context,
	bridgeInstanceID string,
	bindingName string,
) (bridges.BridgeSecretBinding, error)

GetBridgeSecretBinding loads one persisted secret binding by composite primary key.

func (*GlobalDB) GetBridgeTargetByCanonical

func (g *GlobalDB) GetBridgeTargetByCanonical(
	ctx context.Context,
	bridgeID string,
	canonicalRoute string,
) (bridges.BridgeTarget, error)

GetBridgeTargetByCanonical returns one target by immutable provider-derived identity.

func (*GlobalDB) GetBridgeTaskSubscription

func (g *GlobalDB) GetBridgeTaskSubscription(
	ctx context.Context,
	subscriptionID string,
) (bridges.BridgeTaskSubscription, error)

GetBridgeTaskSubscription loads one persisted task notification subscription.

func (*GlobalDB) GetCursor

GetCursor returns one durable notification cursor by key.

func (*GlobalDB) GetDirectRoom

func (g *GlobalDB) GetDirectRoom(
	ctx context.Context,
	channelRef store.NetworkChannelRef,
	directID string,
) (store.NetworkDirectRoomSummary, error)

GetDirectRoom returns one direct-room summary.

func (*GlobalDB) GetExecutionProfile

func (g *GlobalDB) GetExecutionProfile(
	ctx context.Context,
	taskID string,
) (taskpkg.ExecutionProfile, error)

GetExecutionProfile returns the persisted typed execution profile for one task.

func (*GlobalDB) GetHeartbeatRevision

func (g *GlobalDB) GetHeartbeatRevision(ctx context.Context, id string) (heartbeat.Revision, error)

GetHeartbeatRevision returns a managed Heartbeat authoring revision by id.

func (*GlobalDB) GetHeartbeatSnapshot

func (g *GlobalDB) GetHeartbeatSnapshot(ctx context.Context, id string) (heartbeat.Snapshot, error)

GetHeartbeatSnapshot returns a persisted Heartbeat snapshot by id.

func (*GlobalDB) GetHeartbeatWakeEvent

func (g *GlobalDB) GetHeartbeatWakeEvent(ctx context.Context, id string) (heartbeat.WakeEvent, error)

GetHeartbeatWakeEvent returns one retained Heartbeat wake audit row.

func (*GlobalDB) GetHeartbeatWakeState

func (g *GlobalDB) GetHeartbeatWakeState(
	ctx context.Context,
	workspaceID string,
	agentName string,
	sessionID string,
) (heartbeat.WakeState, error)

GetHeartbeatWakeState returns one per-session Heartbeat wake summary.

func (*GlobalDB) GetJob

func (g *GlobalDB) GetJob(ctx context.Context, id string) (automation.Job, error)

GetJob loads one persisted automation job definition by primary key.

func (*GlobalDB) GetJobEnabledOverlay

func (g *GlobalDB) GetJobEnabledOverlay(ctx context.Context, jobID string) (automation.JobEnabledOverlay, error)

GetJobEnabledOverlay loads one persisted job enabled overlay by job id.

func (*GlobalDB) GetLatestValidHeartbeatSnapshot

func (g *GlobalDB) GetLatestValidHeartbeatSnapshot(
	ctx context.Context,
	workspaceID string,
	agentName string,
) (heartbeat.Snapshot, error)

GetLatestValidHeartbeatSnapshot returns the newest persisted valid Heartbeat policy for an agent.

func (*GlobalDB) GetMCPAuthToken

func (g *GlobalDB) GetMCPAuthToken(ctx context.Context, serverName string) (mcpauth.TokenRecord, error)

GetMCPAuthToken returns one persisted token record.

func (*GlobalDB) GetNetworkChannel

func (g *GlobalDB) GetNetworkChannel(
	ctx context.Context,
	ref store.NetworkChannelRef,
) (store.NetworkChannelEntry, error)

GetNetworkChannel returns one persisted network channel metadata row.

func (*GlobalDB) GetOnboardingStatus

func (g *GlobalDB) GetOnboardingStatus(ctx context.Context) (store.OnboardingStatus, error)

GetOnboardingStatus returns the domain status backed by app metadata.

func (*GlobalDB) GetPreset

func (g *GlobalDB) GetPreset(ctx context.Context, name string) (presetspkg.Preset, error)

func (*GlobalDB) GetRun

func (g *GlobalDB) GetRun(ctx context.Context, id string) (automation.Run, error)

GetRun loads one persisted automation run by primary key.

func (*GlobalDB) GetRunReview

func (g *GlobalDB) GetRunReview(ctx context.Context, reviewID string) (taskpkg.RunReview, error)

GetRunReview returns one persisted run review by id.

func (*GlobalDB) GetSchedulerPause

func (g *GlobalDB) GetSchedulerPause(ctx context.Context) (taskpkg.SchedulerPauseState, error)

GetSchedulerPause returns the singleton scheduler pause state.

func (*GlobalDB) GetSchedulerPauseState

func (g *GlobalDB) GetSchedulerPauseState(ctx context.Context) (taskpkg.InspectSchedulerState, error)

GetSchedulerPauseState returns the singleton scheduler pause state for inspect diagnostics.

func (*GlobalDB) GetSchedulerState

func (g *GlobalDB) GetSchedulerState(ctx context.Context, jobID string) (automation.SchedulerState, error)

GetSchedulerState loads one durable automation scheduler cursor by job id.

func (*GlobalDB) GetSessionHealth

func (g *GlobalDB) GetSessionHealth(ctx context.Context, sessionID string) (heartbeat.SessionHealth, error)

GetSessionHealth returns metadata-only health for one session.

func (*GlobalDB) GetSoulRevision

func (g *GlobalDB) GetSoulRevision(ctx context.Context, id string) (soul.Revision, error)

GetSoulRevision returns a managed authoring revision by id.

func (*GlobalDB) GetSoulSnapshot

func (g *GlobalDB) GetSoulSnapshot(ctx context.Context, id string) (soul.Snapshot, error)

GetSoulSnapshot returns a persisted Soul snapshot by id.

func (*GlobalDB) GetTask

func (g *GlobalDB) GetTask(ctx context.Context, id string) (taskpkg.Task, error)

GetTask returns one persisted task by primary key.

func (*GlobalDB) GetTaskEventRecord

func (g *GlobalDB) GetTaskEventRecord(ctx context.Context, eventID string) (taskpkg.EventRecord, error)

GetTaskEventRecord returns one persisted task event plus its stable row sequence.

func (*GlobalDB) GetTaskRun

func (g *GlobalDB) GetTaskRun(ctx context.Context, id string) (taskpkg.Run, error)

GetTaskRun returns one persisted task run by primary key.

func (*GlobalDB) GetTaskRunByIdempotencyKey

func (g *GlobalDB) GetTaskRunByIdempotencyKey(
	ctx context.Context,
	key string,
	origin taskpkg.Origin,
) (taskpkg.Run, error)

GetTaskRunByIdempotencyKey returns the original persisted run bound to one origin-scoped idempotency key.

func (*GlobalDB) GetTaskTriageState

func (g *GlobalDB) GetTaskTriageState(
	ctx context.Context,
	taskID string,
	actor taskpkg.ActorIdentity,
) (taskpkg.TriageState, error)

GetTaskTriageState returns the durable actor-scoped triage state for one task.

func (*GlobalDB) GetThread

func (g *GlobalDB) GetThread(
	ctx context.Context,
	channelRef store.NetworkChannelRef,
	threadID string,
) (store.NetworkThreadSummary, error)

GetThread returns one public-thread summary.

func (*GlobalDB) GetTrigger

func (g *GlobalDB) GetTrigger(ctx context.Context, id string) (automation.Trigger, error)

GetTrigger loads one persisted automation trigger definition by primary key.

func (*GlobalDB) GetTriggerByWebhookID

func (g *GlobalDB) GetTriggerByWebhookID(ctx context.Context, webhookID string) (automation.Trigger, error)

GetTriggerByWebhookID loads a webhook trigger using its stable webhook identifier.

func (*GlobalDB) GetTriggerEnabledOverlay

func (g *GlobalDB) GetTriggerEnabledOverlay(
	ctx context.Context,
	triggerID string,
) (automation.TriggerEnabledOverlay, error)

GetTriggerEnabledOverlay loads one persisted trigger enabled overlay by trigger id.

func (*GlobalDB) GetVaultSecret

func (g *GlobalDB) GetVaultSecret(ctx context.Context, ref string) (vault.Record, error)

GetVaultSecret returns one encrypted vault secret record.

func (*GlobalDB) GetWork

func (g *GlobalDB) GetWork(ctx context.Context, workspaceID string, workID string) (store.NetworkWorkEntry, error)

GetWork returns one network work row by workspace_id and work_id.

func (*GlobalDB) GetWorkspace

func (g *GlobalDB) GetWorkspace(ctx context.Context, id string) (aghworkspace.Workspace, error)

GetWorkspace loads a workspace registration by primary key.

func (*GlobalDB) GetWorkspaceByName

func (g *GlobalDB) GetWorkspaceByName(ctx context.Context, name string) (aghworkspace.Workspace, error)

GetWorkspaceByName loads a workspace registration by unique workspace name.

func (*GlobalDB) GetWorkspaceByPath

func (g *GlobalDB) GetWorkspaceByPath(ctx context.Context, rootDir string) (aghworkspace.Workspace, error)

GetWorkspaceByPath loads a workspace registration by canonical root directory.

func (*GlobalDB) HasDependencyPath

func (g *GlobalDB) HasDependencyPath(ctx context.Context, fromTaskID string, toTaskID string) (bool, error)

HasDependencyPath reports whether the dependency graph already contains a path from one task to another.

func (*GlobalDB) HeartbeatRunLease

func (g *GlobalDB) HeartbeatRunLease(ctx context.Context, heartbeat taskpkg.LeaseHeartbeat) (taskpkg.Run, error)

HeartbeatRunLease extends one active task-run lease after token verification.

func (*GlobalDB) InsertBridgeInstance

func (g *GlobalDB) InsertBridgeInstance(ctx context.Context, instance bridges.BridgeInstance) error

InsertBridgeInstance creates a new persisted bridge instance row.

func (*GlobalDB) InsertWorkspace

func (g *GlobalDB) InsertWorkspace(ctx context.Context, ws aghworkspace.Workspace) error

InsertWorkspace creates a new persisted workspace registration row.

func (*GlobalDB) IsTaskEffectivelyPaused

func (g *GlobalDB) IsTaskEffectivelyPaused(ctx context.Context, taskID string) (bool, string, error)

IsTaskEffectivelyPaused reports whether a task or one of its ancestors is paused.

func (*GlobalDB) ListAutonomyLeaseHandles

func (g *GlobalDB) ListAutonomyLeaseHandles(
	ctx context.Context,
	sessionID string,
) (handles []taskpkg.AutonomyLeaseHandle, err error)

ListAutonomyLeaseHandles returns internal-only lease handles for one session. Public task-run read projections keep claim_token masked.

func (*GlobalDB) ListBridgeInstances

func (g *GlobalDB) ListBridgeInstances(ctx context.Context) ([]bridges.BridgeInstance, error)

ListBridgeInstances returns all persisted bridge instances in stable display-name order.

func (*GlobalDB) ListBridgeRoutes

func (g *GlobalDB) ListBridgeRoutes(ctx context.Context, bridgeInstanceID string) ([]bridges.BridgeRoute, error)

ListBridgeRoutes returns persisted routes for one bridge instance ordered by recency.

func (*GlobalDB) ListBridgeSecretBindings

func (g *GlobalDB) ListBridgeSecretBindings(
	ctx context.Context,
	bridgeInstanceID string,
) ([]bridges.BridgeSecretBinding, error)

ListBridgeSecretBindings returns the persisted secret bindings for one bridge instance.

func (*GlobalDB) ListBridgeTargets

func (g *GlobalDB) ListBridgeTargets(
	ctx context.Context,
	query bridges.BridgeTargetQuery,
) (bridges.BridgeTargetPage, error)

ListBridgeTargets returns target-directory rows plus bridge-level refresh freshness.

func (*GlobalDB) ListBridgeTaskSubscriptions

func (g *GlobalDB) ListBridgeTaskSubscriptions(
	ctx context.Context,
	query bridges.BridgeTaskSubscriptionQuery,
) (subscriptions []bridges.BridgeTaskSubscription, err error)

ListBridgeTaskSubscriptions returns active bridge task subscriptions matching the query.

func (*GlobalDB) ListConversationMessages

func (g *GlobalDB) ListConversationMessages(
	ctx context.Context,
	ref store.NetworkConversationRef,
	query store.NetworkConversationMessageQuery,
) (entries []store.NetworkConversationMessage, err error)

ListConversationMessages returns messages isolated to one conversation container.

func (*GlobalDB) ListCursors

func (g *GlobalDB) ListCursors(
	ctx context.Context,
	query notifications.CursorQuery,
) (cursors []notifications.Cursor, err error)

ListCursors lists durable notification cursors matching the query.

func (*GlobalDB) ListDependencies

func (g *GlobalDB) ListDependencies(ctx context.Context, taskID string) ([]taskpkg.Dependency, error)

ListDependencies returns the persisted dependency edges for one task.

func (*GlobalDB) ListDependents

func (g *GlobalDB) ListDependents(ctx context.Context, dependsOnTaskID string) ([]taskpkg.Dependency, error)

ListDependents returns persisted dependency edges that point at one task.

func (*GlobalDB) ListDirectRooms

func (g *GlobalDB) ListDirectRooms(
	ctx context.Context,
	ref store.NetworkChannelRef,
	query store.NetworkDirectRoomQuery,
) (summaries []store.NetworkDirectRoomSummary, err error)

ListDirectRooms returns direct-room summaries for one channel.

func (*GlobalDB) ListEventSummaries

func (g *GlobalDB) ListEventSummaries(
	ctx context.Context,
	query store.EventSummaryQuery,
) ([]store.EventSummary, error)

ListEventSummaries returns global event summaries filtered by the supplied options.

func (*GlobalDB) ListHeartbeatRevisions

func (g *GlobalDB) ListHeartbeatRevisions(
	ctx context.Context,
	query heartbeat.RevisionListQuery,
) (revisions []heartbeat.Revision, err error)

ListHeartbeatRevisions lists managed Heartbeat authoring revisions in newest-first order.

func (*GlobalDB) ListHeartbeatSnapshots

func (g *GlobalDB) ListHeartbeatSnapshots(
	ctx context.Context,
	query heartbeat.SnapshotListQuery,
) (snapshots []heartbeat.Snapshot, err error)

ListHeartbeatSnapshots lists persisted Heartbeat snapshots in newest-first order.

func (*GlobalDB) ListHeartbeatWakeEvents

func (g *GlobalDB) ListHeartbeatWakeEvents(
	ctx context.Context,
	query heartbeat.WakeEventListQuery,
) (events []heartbeat.WakeEvent, err error)

ListHeartbeatWakeEvents lists retained Heartbeat wake audit rows in newest-first order.

func (*GlobalDB) ListHeartbeatWakeState

func (g *GlobalDB) ListHeartbeatWakeState(
	ctx context.Context,
	query heartbeat.WakeStateListQuery,
) (states []heartbeat.WakeState, err error)

ListHeartbeatWakeState lists Heartbeat wake state rows in newest-first order.

func (*GlobalDB) ListJobEnabledOverlays

func (g *GlobalDB) ListJobEnabledOverlays(ctx context.Context) ([]automation.JobEnabledOverlay, error)

ListJobEnabledOverlays returns all persisted job enabled overlays.

func (*GlobalDB) ListJobs

func (g *GlobalDB) ListJobs(ctx context.Context, query automation.JobListQuery) ([]automation.Job, error)

ListJobs returns persisted automation jobs using the supplied filters.

func (*GlobalDB) ListMCPAuthTokens

func (g *GlobalDB) ListMCPAuthTokens(ctx context.Context) ([]mcpauth.TokenRecord, error)

ListMCPAuthTokens returns all persisted token records.

func (*GlobalDB) ListNetworkAudit

func (g *GlobalDB) ListNetworkAudit(
	ctx context.Context,
	query store.NetworkAuditQuery,
) (entries []store.NetworkAuditEntry, err error)

ListNetworkAudit returns network audit rows filtered by the supplied options.

func (*GlobalDB) ListNetworkChannels

func (g *GlobalDB) ListNetworkChannels(
	ctx context.Context,
	query store.NetworkChannelQuery,
) (entries []store.NetworkChannelEntry, err error)

ListNetworkChannels returns persisted network channel metadata rows.

func (*GlobalDB) ListNetworkMessages

func (g *GlobalDB) ListNetworkMessages(
	ctx context.Context,
	query store.NetworkMessageQuery,
) (entries []store.NetworkMessageEntry, err error)

ListNetworkMessages returns persisted network timeline rows filtered by the supplied options.

func (*GlobalDB) ListPermissionLog

func (g *GlobalDB) ListPermissionLog(
	ctx context.Context,
	query store.PermissionLogQuery,
) ([]store.PermissionLogEntry, error)

ListPermissionLog returns permission audit rows filtered by the supplied options.

func (*GlobalDB) ListPresets

func (g *GlobalDB) ListPresets(
	ctx context.Context,
	query presetspkg.Query,
) (items []presetspkg.Preset, err error)

func (*GlobalDB) ListProcessRecords

func (g *GlobalDB) ListProcessRecords(
	ctx context.Context,
	query toolruntime.ProcessQuery,
) ([]toolruntime.ProcessRecord, error)

ListProcessRecords returns process records matching the query.

func (*GlobalDB) ListRows

func (g *GlobalDB) ListRows(
	ctx context.Context,
	opts modelcatalog.ListOptions,
) (catalogRows []modelcatalog.ModelRow, err error)

ListRows returns deterministic catalog source rows matching the query.

func (*GlobalDB) ListRunReviews

func (g *GlobalDB) ListRunReviews(
	ctx context.Context,
	query taskpkg.RunReviewQuery,
) ([]taskpkg.RunReview, error)

ListRunReviews returns persisted run reviews that match the supplied filters.

func (*GlobalDB) ListRuns

func (g *GlobalDB) ListRuns(ctx context.Context, query automation.RunQuery) ([]automation.Run, error)

ListRuns returns filtered automation run history rows.

func (*GlobalDB) ListSchedulerStates

func (g *GlobalDB) ListSchedulerStates(ctx context.Context) ([]automation.SchedulerState, error)

ListSchedulerStates returns every durable automation scheduler cursor.

func (*GlobalDB) ListSessionHealth

func (g *GlobalDB) ListSessionHealth(
	ctx context.Context,
	query heartbeat.SessionHealthListQuery,
) (rowsOut []heartbeat.SessionHealth, err error)

ListSessionHealth lists metadata-only session health rows in newest-first order.

func (*GlobalDB) ListSessionHealthRecoveryInputs

func (g *GlobalDB) ListSessionHealthRecoveryInputs(ctx context.Context, limit int) ([]heartbeat.SessionHealth, error)

ListSessionHealthRecoveryInputs returns persisted rows that restart recovery must recompute before wake.

func (*GlobalDB) ListSessions

func (g *GlobalDB) ListSessions(ctx context.Context, query store.SessionListQuery) ([]store.SessionInfo, error)

ListSessions returns indexed sessions ordered by most recent update.

func (*GlobalDB) ListSoulRevisions

func (g *GlobalDB) ListSoulRevisions(
	ctx context.Context,
	query soul.RevisionListQuery,
) (revisions []soul.Revision, err error)

ListSoulRevisions lists managed authoring revisions in newest-first order.

func (*GlobalDB) ListSoulSnapshots

func (g *GlobalDB) ListSoulSnapshots(
	ctx context.Context,
	query soul.SnapshotListQuery,
) (snapshots []soul.Snapshot, err error)

ListSoulSnapshots lists persisted Soul snapshots in newest-first order.

func (*GlobalDB) ListSourceStatus

func (g *GlobalDB) ListSourceStatus(
	ctx context.Context,
	providerID string,
) (statuses []modelcatalog.SourceStatus, err error)

ListSourceStatus returns provider-scoped source status rows.

func (*GlobalDB) ListTaskEventRecords

func (g *GlobalDB) ListTaskEventRecords(
	ctx context.Context,
	query taskpkg.EventRecordQuery,
) ([]taskpkg.EventRecord, error)

ListTaskEventRecords returns persisted task events ordered by stable sequence for live replay.

func (*GlobalDB) ListTaskEvents

func (g *GlobalDB) ListTaskEvents(ctx context.Context, query taskpkg.EventQuery) ([]taskpkg.Event, error)

ListTaskEvents returns persisted audit events that match the supplied filters.

func (*GlobalDB) ListTaskRuns

func (g *GlobalDB) ListTaskRuns(ctx context.Context, query taskpkg.RunQuery) ([]taskpkg.Run, error)

ListTaskRuns returns persisted runs that match the supplied filters.

func (*GlobalDB) ListTaskRunsByStatus

func (g *GlobalDB) ListTaskRunsByStatus(
	ctx context.Context,
	statuses []taskpkg.RunStatus,
) ([]taskpkg.Run, error)

ListTaskRunsByStatus returns persisted runs that match any of the supplied statuses.

func (*GlobalDB) ListTaskTriageStates

func (g *GlobalDB) ListTaskTriageStates(
	ctx context.Context,
	actor taskpkg.ActorIdentity,
) ([]taskpkg.TriageState, error)

ListTaskTriageStates returns all durable triage states persisted for one actor.

func (*GlobalDB) ListTasks

func (g *GlobalDB) ListTasks(ctx context.Context, query taskpkg.Query) ([]taskpkg.Summary, error)

ListTasks returns durable task summaries that match the supplied filters.

func (*GlobalDB) ListThreads

func (g *GlobalDB) ListThreads(
	ctx context.Context,
	ref store.NetworkChannelRef,
	query store.NetworkThreadQuery,
) (summaries []store.NetworkThreadSummary, err error)

ListThreads returns public-thread summaries for one channel.

func (*GlobalDB) ListTokenStats

func (g *GlobalDB) ListTokenStats(ctx context.Context, query store.TokenStatsQuery) ([]store.TokenStats, error)

ListTokenStats returns aggregated token usage rows.

func (*GlobalDB) ListTriggerEnabledOverlays

func (g *GlobalDB) ListTriggerEnabledOverlays(ctx context.Context) ([]automation.TriggerEnabledOverlay, error)

ListTriggerEnabledOverlays returns all persisted trigger enabled overlays.

func (*GlobalDB) ListTriggers

func (g *GlobalDB) ListTriggers(ctx context.Context, query automation.TriggerListQuery) ([]automation.Trigger, error)

ListTriggers returns persisted automation triggers using the supplied filters.

func (*GlobalDB) ListVaultSecrets

func (g *GlobalDB) ListVaultSecrets(ctx context.Context, prefix string) (_ []vault.Record, err error)

ListVaultSecrets returns encrypted vault secret records filtered by ref prefix.

func (*GlobalDB) ListWorkspaces

func (g *GlobalDB) ListWorkspaces(ctx context.Context) ([]aghworkspace.Workspace, error)

ListWorkspaces returns all registered workspaces in stable name order.

func (*GlobalDB) LookupRunReviewBySession

func (g *GlobalDB) LookupRunReviewBySession(ctx context.Context, sessionID string) (taskpkg.RunReview, error)

LookupRunReviewBySession returns the active run review bound to one reviewer session.

func (*GlobalDB) MarkSessionHealthStale

func (g *GlobalDB) MarkSessionHealthStale(ctx context.Context, cutoff time.Time, updatedAt time.Time) (int64, error)

MarkSessionHealthStale marks stale persisted health rows as wake-ineligible without deleting authored policy.

func (*GlobalDB) MarkSessionInputFailed

func (g *GlobalDB) MarkSessionInputFailed(
	ctx context.Context,
	sessionID string,
	entryID string,
	summary string,
	now time.Time,
) error

MarkSessionInputFailed records a dispatch failure for one queue entry.

func (*GlobalDB) MarkSessionInputSent

func (g *GlobalDB) MarkSessionInputSent(
	ctx context.Context,
	sessionID string,
	entryID string,
	now time.Time,
) error

MarkSessionInputSent records successful dispatch for one queue entry.

func (*GlobalDB) Path

func (g *GlobalDB) Path() string

Path reports the on-disk path for the global database file.

func (*GlobalDB) PauseTask

func (g *GlobalDB) PauseTask(ctx context.Context, mutation taskpkg.PauseMutation) (taskpkg.Task, error)

PauseTask marks one task as paused for future claim eligibility.

func (*GlobalDB) PutBridgeIngestDedup

func (g *GlobalDB) PutBridgeIngestDedup(ctx context.Context, record bridges.IngestDedupRecord) error

PutBridgeIngestDedup inserts or refreshes an ingest dedup record.

func (*GlobalDB) PutBridgeRoute

func (g *GlobalDB) PutBridgeRoute(ctx context.Context, route bridges.BridgeRoute) error

PutBridgeRoute inserts or refreshes a persisted bridge route row.

func (*GlobalDB) PutBridgeSecretBinding

func (g *GlobalDB) PutBridgeSecretBinding(ctx context.Context, binding bridges.BridgeSecretBinding) error

PutBridgeSecretBinding inserts or refreshes a persisted secret binding row.

func (*GlobalDB) PutBridgeTaskSubscription

func (g *GlobalDB) PutBridgeTaskSubscription(
	ctx context.Context,
	subscription bridges.BridgeTaskSubscription,
) error

PutBridgeTaskSubscription inserts or refreshes a terminal task notification subscription.

func (*GlobalDB) PutVaultSecret

func (g *GlobalDB) PutVaultSecret(ctx context.Context, record vault.Record) error

PutVaultSecret stores one encrypted vault secret record.

func (*GlobalDB) ReconcileSessions

func (g *GlobalDB) ReconcileSessions(
	ctx context.Context,
	sessions []store.SessionInfo,
) (result store.ReconcileResult, err error)

ReconcileSessions upserts on-disk sessions and marks missing ones as orphaned.

func (*GlobalDB) RecordCursorError

func (g *GlobalDB) RecordCursorError(
	ctx context.Context,
	report notifications.CursorError,
) (cursor notifications.Cursor, err error)

RecordCursorError stores a cursor diagnostic without moving delivery progress.

func (*GlobalDB) RecordHeartbeatWakeDecision

func (g *GlobalDB) RecordHeartbeatWakeDecision(
	ctx context.Context,
	event heartbeat.WakeEvent,
	state heartbeat.WakeState,
) (outEvent heartbeat.WakeEvent, outState heartbeat.WakeState, err error)

RecordHeartbeatWakeDecision appends the audit row and updates cooldown state atomically.

func (*GlobalDB) RecordRunDeliveryError

func (g *GlobalDB) RecordRunDeliveryError(ctx context.Context, runID string, runErr error) (automation.Run, error)

RecordRunDeliveryError stores delivery diagnostics separately from normal execution errors on an existing automation run.

func (*GlobalDB) RecordRunReview

func (g *GlobalDB) RecordRunReview(
	ctx context.Context,
	req taskpkg.RecordRunReviewRequest,
	actor taskpkg.ActorContext,
	recordedAt time.Time,
	continuationRunID string,
) (result taskpkg.RunReviewResult, err error)

RecordRunReview persists one authoritative review verdict and optional continuation run.

func (*GlobalDB) RecoverExpiredRunLeases

func (g *GlobalDB) RecoverExpiredRunLeases(
	ctx context.Context,
	recovery taskpkg.ExpiredLeaseRecovery,
) ([]taskpkg.ExpiredLeaseRecoveryResult, error)

RecoverExpiredRunLeases requeues stale active leases without issuing new ownership.

func (*GlobalDB) RefreshBridgeTargets

func (g *GlobalDB) RefreshBridgeTargets(
	ctx context.Context,
	bridgeID string,
	targets []bridges.BridgeTarget,
	refreshedAt time.Time,
) error

RefreshBridgeTargets transactionally persists one daemon-owned target-directory snapshot.

func (*GlobalDB) RegisterSession

func (g *GlobalDB) RegisterSession(ctx context.Context, session store.SessionInfo) error

RegisterSession inserts or refreshes a session index row.

func (*GlobalDB) ReleaseRunLease

func (g *GlobalDB) ReleaseRunLease(ctx context.Context, release taskpkg.LeaseRelease) (taskpkg.Run, error)

ReleaseRunLease clears an active task-run lease after token verification and requeues the run.

func (*GlobalDB) ReleaseSessionInput

func (g *GlobalDB) ReleaseSessionInput(ctx context.Context, sessionID string, entryID string, now time.Time) error

ReleaseSessionInput returns a leased entry to the queued state after a dispatch race.

func (*GlobalDB) ReplaceBridgeInstances

func (g *GlobalDB) ReplaceBridgeInstances(ctx context.Context, instances []bridges.BridgeInstance) (err error)

ReplaceBridgeInstances atomically swaps the daemon-visible bridge instance projection.

func (*GlobalDB) ReplaceSourceRows

func (g *GlobalDB) ReplaceSourceRows(
	ctx context.Context,
	sourceID string,
	providerID string,
	rows []modelcatalog.ModelRow,
	status modelcatalog.SourceStatus,
) error

ReplaceSourceRows atomically replaces all model rows and status for one provider-scoped source.

func (*GlobalDB) RequestRunReview

func (g *GlobalDB) RequestRunReview(
	ctx context.Context,
	review *taskpkg.RunReview,
) (stored taskpkg.RunReview, created bool, err error)

RequestRunReview persists one review request or returns the existing idempotent request.

func (*GlobalDB) ReserveQueuedRun

func (g *GlobalDB) ReserveQueuedRun(
	ctx context.Context,
	taskID string,
	runID string,
	idempotencyKey string,
	origin taskpkg.Origin,
	requestedChannel string,
	metadata json.RawMessage,
	queuedAt time.Time,
) (taskpkg.Task, taskpkg.Run, bool, error)

ReserveQueuedRun atomically allocates one queued run attempt and optional idempotency binding.

func (*GlobalDB) ResetCursor

func (g *GlobalDB) ResetCursor(
	ctx context.Context,
	reset notifications.ResetCursor,
) (cursor notifications.Cursor, err error)

ResetCursor rewinds or repairs one cursor after an explicit recovery decision.

func (*GlobalDB) ResetOnboarding

func (g *GlobalDB) ResetOnboarding(ctx context.Context) (store.OnboardingStatus, error)

ResetOnboarding clears first-run completion so onboarding is shown again.

func (*GlobalDB) ResolveBridgeRoute

func (g *GlobalDB) ResolveBridgeRoute(ctx context.Context, key bridges.RoutingKey) (bridges.BridgeRoute, error)

ResolveBridgeRoute loads a persisted route by computing the hash for the supplied routing key.

func (*GlobalDB) ResolveDirectRoom

func (g *GlobalDB) ResolveDirectRoom(
	ctx context.Context,
	entry store.NetworkDirectRoomEntry,
) (summary store.NetworkDirectRoomSummary, err error)

ResolveDirectRoom inserts or returns the deterministic two-party room.

func (*GlobalDB) ResumeTask

func (g *GlobalDB) ResumeTask(ctx context.Context, mutation taskpkg.ResumeMutation) (taskpkg.Task, error)

ResumeTask clears one task pause for future claim eligibility.

func (*GlobalDB) RetryTaskRun

func (g *GlobalDB) RetryTaskRun(
	ctx context.Context,
	retry taskpkg.RetryRunMutation,
) (taskpkg.RetryRunResult, error)

RetryTaskRun creates one queued retry run linked to a failed source run.

func (*GlobalDB) SaveMCPAuthToken

func (g *GlobalDB) SaveMCPAuthToken(ctx context.Context, token mcpauth.TokenRecord) error

SaveMCPAuthToken persists one remote MCP OAuth token record.

func (*GlobalDB) SaveSchedulerState

func (g *GlobalDB) SaveSchedulerState(
	ctx context.Context,
	state automation.SchedulerState,
) (automation.SchedulerState, error)

SaveSchedulerState upserts one durable automation scheduler cursor.

func (*GlobalDB) SaveTaskRunIdempotency

func (g *GlobalDB) SaveTaskRunIdempotency(ctx context.Context, record taskpkg.RunIdempotency) error

SaveTaskRunIdempotency inserts one origin-scoped idempotency binding for a persisted run.

func (*GlobalDB) SchedulerBacklog

func (g *GlobalDB) SchedulerBacklog(
	ctx context.Context,
	query taskpkg.SchedulerBacklogQuery,
) (backlog taskpkg.SchedulerBacklog, err error)

SchedulerBacklog returns queued task runs ordered by scheduler priority.

func (*GlobalDB) SessionInputQueueSummary

func (g *GlobalDB) SessionInputQueueSummary(
	ctx context.Context,
	sessionID string,
) (summary store.SessionInputQueueSummary, err error)

SessionInputQueueSummary returns the current generation and active pending counts for one session.

func (*GlobalDB) SetAppMetadata

func (g *GlobalDB) SetAppMetadata(ctx context.Context, key string, value string) error

SetAppMetadata upserts the value stored under key.

func (*GlobalDB) SetJobEnabledOverlay

func (g *GlobalDB) SetJobEnabledOverlay(
	ctx context.Context,
	overlay automation.JobEnabledOverlay,
) (automation.JobEnabledOverlay, error)

SetJobEnabledOverlay upserts the runtime enabled override for a config-backed job.

func (*GlobalDB) SetSchedulerPaused

func (g *GlobalDB) SetSchedulerPaused(
	ctx context.Context,
	actor string,
	reason string,
) (taskpkg.SchedulerPauseState, error)

SetSchedulerPaused marks the scheduler-wide pause singleton as paused.

func (*GlobalDB) SetSchedulerResumed

func (g *GlobalDB) SetSchedulerResumed(ctx context.Context) (taskpkg.SchedulerPauseState, error)

SetSchedulerResumed clears the scheduler-wide pause singleton.

func (*GlobalDB) SetTriggerEnabledOverlay

func (g *GlobalDB) SetTriggerEnabledOverlay(
	ctx context.Context,
	overlay automation.TriggerEnabledOverlay,
) (automation.TriggerEnabledOverlay, error)

SetTriggerEnabledOverlay upserts the runtime enabled override for a config-backed trigger.

func (*GlobalDB) StageSessionSteer

func (g *GlobalDB) StageSessionSteer(
	ctx context.Context,
	req store.SessionInputQueueInsert,
) (entry store.SessionInputQueueEntry, err error)

StageSessionSteer replaces any active staged steer entry for the session.

func (*GlobalDB) SweepExpiredSessionAttachLocks

func (g *GlobalDB) SweepExpiredSessionAttachLocks(ctx context.Context, now time.Time) (int64, error)

SweepExpiredSessionAttachLocks clears expired attach leases from the session catalog.

func (*GlobalDB) SweepHeartbeatWakeEvents

func (g *GlobalDB) SweepHeartbeatWakeEvents(ctx context.Context, cutoff time.Time, limit int) (int64, error)

SweepHeartbeatWakeEvents deletes expired wake audit rows in one bounded batch.

func (*GlobalDB) SweepObservability

func (g *GlobalDB) SweepObservability(
	ctx context.Context,
	cutoff time.Time,
) (result store.ObservabilityRetentionSweepResult, err error)

SweepObservability removes global observability rows older than cutoff.

func (*GlobalDB) UpdateBridgeInstance

func (g *GlobalDB) UpdateBridgeInstance(ctx context.Context, instance bridges.BridgeInstance) error

UpdateBridgeInstance updates an existing persisted bridge instance row.

func (*GlobalDB) UpdateJob

func (g *GlobalDB) UpdateJob(ctx context.Context, job automation.Job) (automation.Job, error)

UpdateJob replaces the mutable fields of a persisted automation job definition.

func (*GlobalDB) UpdatePreset

func (g *GlobalDB) UpdatePreset(
	ctx context.Context,
	name string,
	req presetspkg.UpdateRequest,
) (presetspkg.Preset, error)

func (*GlobalDB) UpdateProcessRecordState

func (g *GlobalDB) UpdateProcessRecordState(ctx context.Context, update toolruntime.ProcessStateUpdate) error

UpdateProcessRecordState mutates lifecycle fields for one process record.

func (*GlobalDB) UpdateRun

func (g *GlobalDB) UpdateRun(ctx context.Context, run automation.Run) (automation.Run, error)

UpdateRun replaces the mutable fields of a persisted automation run.

func (*GlobalDB) UpdateSessionSoulSnapshot

func (g *GlobalDB) UpdateSessionSoulSnapshot(ctx context.Context, update store.SessionSoulSnapshotUpdate) error

UpdateSessionSoulSnapshot updates only the Soul provenance fields on a session row.

func (*GlobalDB) UpdateSessionState

func (g *GlobalDB) UpdateSessionState(ctx context.Context, update store.SessionStateUpdate) error

UpdateSessionState updates the mutable session state fields.

func (*GlobalDB) UpdateTask

func (g *GlobalDB) UpdateTask(ctx context.Context, record taskpkg.Task) error

UpdateTask replaces the persisted canonical task record.

func (*GlobalDB) UpdateTaskRun

func (g *GlobalDB) UpdateTaskRun(ctx context.Context, run taskpkg.Run) error

UpdateTaskRun replaces the persisted canonical task-run record.

func (*GlobalDB) UpdateTokenStats

func (g *GlobalDB) UpdateTokenStats(ctx context.Context, update store.TokenStatsUpdate) error

UpdateTokenStats merges one or more turns of token usage into the session aggregate.

func (*GlobalDB) UpdateTrigger

func (g *GlobalDB) UpdateTrigger(ctx context.Context, trigger automation.Trigger) (automation.Trigger, error)

UpdateTrigger replaces the mutable fields of a persisted automation trigger definition.

func (*GlobalDB) UpdateWorkspace

func (g *GlobalDB) UpdateWorkspace(ctx context.Context, ws aghworkspace.Workspace) error

UpdateWorkspace updates an existing persisted workspace registration row.

func (*GlobalDB) UpsertExecutionProfile

func (g *GlobalDB) UpsertExecutionProfile(
	ctx context.Context,
	profile *taskpkg.ExecutionProfile,
) (stored taskpkg.ExecutionProfile, err error)

UpsertExecutionProfile replaces one task-owned execution profile and its selectors atomically.

func (*GlobalDB) UpsertHeartbeatSnapshot

func (g *GlobalDB) UpsertHeartbeatSnapshot(
	ctx context.Context,
	snapshot heartbeat.Snapshot,
) (heartbeat.Snapshot, error)

UpsertHeartbeatSnapshot inserts a resolved Heartbeat snapshot or reuses the existing row for its digest.

func (*GlobalDB) UpsertHeartbeatWakeState

func (g *GlobalDB) UpsertHeartbeatWakeState(
	ctx context.Context,
	state heartbeat.WakeState,
) (heartbeat.WakeState, error)

UpsertHeartbeatWakeState stores the latest per-session Heartbeat wake summary.

func (*GlobalDB) UpsertProcessRecord

func (g *GlobalDB) UpsertProcessRecord(ctx context.Context, record toolruntime.ProcessRecord) error

UpsertProcessRecord writes one durable process checkpoint.

func (*GlobalDB) UpsertSessionHealth

func (g *GlobalDB) UpsertSessionHealth(
	ctx context.Context,
	health heartbeat.SessionHealth,
) (heartbeat.SessionHealth, error)

UpsertSessionHealth stores the latest metadata-only health row for one session.

func (*GlobalDB) UpsertSoulSnapshot

func (g *GlobalDB) UpsertSoulSnapshot(ctx context.Context, snapshot soul.Snapshot) (soul.Snapshot, error)

UpsertSoulSnapshot inserts a resolved Soul snapshot or reuses the existing row for its digest.

func (*GlobalDB) UpsertTaskTriageState

func (g *GlobalDB) UpsertTaskTriageState(ctx context.Context, state taskpkg.TriageState) error

UpsertTaskTriageState inserts or replaces one durable actor-scoped triage state.

func (*GlobalDB) WithDeleteTaskTransaction

func (g *GlobalDB) WithDeleteTaskTransaction(
	ctx context.Context,
	fn func(taskpkg.DeleteTaskMutationStore) error,
) error

WithDeleteTaskTransaction executes one delete-task mutation flow inside a single immediate transaction so reconciliation failures can roll back the primary delete.

func (*GlobalDB) WriteConversationMessage

func (g *GlobalDB) WriteConversationMessage(
	ctx context.Context,
	entry store.NetworkConversationMessage,
) (result store.NetworkConversationWriteResult, err error)

WriteConversationMessage persists one message and its derived state atomically.

func (*GlobalDB) WriteEventSummary

func (g *GlobalDB) WriteEventSummary(ctx context.Context, summary store.EventSummary) error

WriteEventSummary stores a lightweight cross-session summary entry.

func (*GlobalDB) WriteNetworkAudit

func (g *GlobalDB) WriteNetworkAudit(ctx context.Context, entry store.NetworkAuditEntry) error

WriteNetworkAudit stores one network audit row.

func (*GlobalDB) WriteNetworkChannel

func (g *GlobalDB) WriteNetworkChannel(ctx context.Context, entry store.NetworkChannelEntry) error

WriteNetworkChannel upserts durable network channel metadata.

func (*GlobalDB) WriteNetworkMessage

func (g *GlobalDB) WriteNetworkMessage(ctx context.Context, entry store.NetworkMessageEntry) error

WriteNetworkMessage stores one persisted network timeline envelope, ignoring duplicate message ids.

func (*GlobalDB) WritePermissionLog

func (g *GlobalDB) WritePermissionLog(ctx context.Context, entry store.PermissionLogEntry) error

WritePermissionLog stores one permission decision audit row.

Jump to

Keyboard shortcuts

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