# Schemas: t3/persistence

> T3 Code · channel `nightly` · v0.1.15-nightly.20261205.5786 @ [`be521199aace`](https://github.com/pingdotgg/t3code/tree/be521199aace1a0b446f4db4a1181ef994aaa1e2) · 2026-12-05 · generated by Everdoc from source (no LLM).

42 entries.

<a id="schema-authconnectdevicerecord"></a>

## `AuthConnectDeviceRecord`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthConnectDevices.ts:13](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthConnectDevices.ts#L13-L17)
- Shape: `{ proofKeyThumbprint: string; client: string | null; approvedAt: date }`

<a id="schema-authpairinglinkrecord"></a>

## `AuthPairingLinkRecord`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:28](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L28-L44)
- Shape: `{ id: string; credential: string; method: "desktop-bootstrap" | "one-time-token"; scopes: string; subject: string; label: string | null; proofKeyThumbprint: string | null; createdAt: date; expiresAt: date; consumedAt: date | null; revokedAt: date | null; requiresConnectApproval: 0 | 1; connectApproved: 0 | 1; requestedClient: string | null }`

<a id="schema-authsessionclientmetadatarecord"></a>

## `AuthSessionClientMetadataRecord`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:24](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L24-L31)
- Shape: `{ label: string | null; ipAddress: string | null; userAgent: string | null; deviceType: AuthClientMetadataDeviceType; os: string | null; browser: string | null }`

<a id="schema-authsessionrecord"></a>

## `AuthSessionRecord`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:34](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L34-L44)
- Shape: `{ sessionId: makeEntityId; subject: string; scopes: AuthEnvironmentScopes; method: ServerAuthSessionMethod; client: AuthSessionClientMetadataRecord; issuedAt: date; expiresAt: date; lastConnectedAt: date | null; revokedAt: date | null }`

<a id="schema-consumeauthpairinglinkinput"></a>

## `ConsumeAuthPairingLinkInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:61](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L61-L70)
- Shape: `{ credential: string; proofKeyThumbprint: string | null; requestedScopes?: AuthEnvironmentScopes; requiredScopes?: AuthEnvironmentScopes; allowedSubject?: string; consumedAt: date; now: date }`

<a id="schema-createauthpairinglinkinput"></a>

## `CreateAuthPairingLinkInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:47](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L47-L58)
- Shape: `{ id: string; credential: string; method: "desktop-bootstrap" | "one-time-token"; scopes: AuthEnvironmentScopes; subject: string; label: string | null; proofKeyThumbprint: string | null; requiresConnectApproval?: boolean; createdAt: date; expiresAt: date }`

<a id="schema-createauthsessioninput"></a>

## `CreateAuthSessionInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:47](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L47-L56)
- Shape: `{ sessionId: makeEntityId; subject: string; scopes: AuthEnvironmentScopes; method: ServerAuthSessionMethod; client: AuthSessionClientMetadataRecord; issuedAt: date; expiresAt: date; proofKeyThumbprint?: string }`

<a id="schema-createreplacingactiveauthsessioninput"></a>

## `CreateReplacingActiveAuthSessionInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:59](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L59-L63)
- Shape: `{ session: CreateAuthSessionInput; revokedAt: date; replaceSessionId?: makeEntityId }`

<a id="schema-databasecompacterror"></a>

## `DatabaseCompactError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:56](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L56-L63)
- Shape: `{ _tag: "DatabaseCompactError"; path: string; cause: unknown }`

<a id="schema-databaseinuseerror"></a>

## `DatabaseInUseError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:30](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L30-L45)
- Shape: `{ _tag: "DatabaseInUseError"; path: string; cause: unknown; pid?: number; serviceManaged?: boolean }`

<a id="schema-databaseinspecterror"></a>

## `DatabaseInspectError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:47](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L47-L54)
- Shape: `{ _tag: "DatabaseInspectError"; path: string; cause: unknown }`

<a id="schema-databasemissingerror"></a>

## `DatabaseMissingError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:21](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L21-L28)
- Shape: `{ _tag: "DatabaseMissingError"; path: string }`

<a id="schema-deleteprovidersessionruntimeinput"></a>

## `DeleteProviderSessionRuntimeInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/ProviderSessionRuntime.ts:46](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/ProviderSessionRuntime.ts#L46)
- Shape: `{ threadId: makeEntityId }`

<a id="schema-diskspacecheckerror"></a>

## `DiskSpaceCheckError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:83](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L83-L90)
- Shape: `{ _tag: "DiskSpaceCheckError"; path: string; cause: unknown }`

<a id="schema-extendauthsessioninput"></a>

## `ExtendAuthSessionInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:84](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L84-L90)
- Shape: `{ sessionId: makeEntityId; expiresAt: date; now: date; onlyIfExpiresBy?: date }`

<a id="schema-findpendingconnectpairinglinkinput"></a>

## `FindPendingConnectPairingLinkInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:95](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L95-L98)
- Shape: `{ proofKeyThumbprint: string; now: date }`

<a id="schema-getactiveauthpairinglinkbyidinput"></a>

## `GetActiveAuthPairingLinkByIdInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:89](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L89-L92)
- Shape: `{ id: string; now: date }`

<a id="schema-getauthpairinglinkbycredentialinput"></a>

## `GetAuthPairingLinkByCredentialInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:84](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L84-L86)
- Shape: `{ credential: string }`

<a id="schema-getauthsessionbyidinput"></a>

## `GetAuthSessionByIdInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:67](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L67-L69)
- Shape: `{ sessionId: makeEntityId }`

<a id="schema-getbycommandidinput"></a>

## `GetByCommandIdInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/OrchestrationCommandReceipts.ts:28](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/OrchestrationCommandReceipts.ts#L28-L30)
- Shape: `{ commandId: makeEntityId }`

<a id="schema-getprovidersessionruntimeinput"></a>

## `GetProviderSessionRuntimeInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/ProviderSessionRuntime.ts:43](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/ProviderSessionRuntime.ts#L43)
- Shape: `{ threadId: makeEntityId }`

<a id="schema-legacydatabasehasunmigratedrecordserror"></a>

## `LegacyDatabaseHasUnmigratedRecordsError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:74](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L74-L81)
- Shape: `{ _tag: "LegacyDatabaseHasUnmigratedRecordsError"; projects: number; threads: number }`

<a id="schema-legacydatabaseremoveerror"></a>

## `LegacyDatabaseRemoveError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/DatabaseMaintenance.ts:65](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/DatabaseMaintenance.ts#L65-L72)
- Shape: `{ _tag: "LegacyDatabaseRemoveError"; path: string; cause: unknown }`

<a id="schema-listactiveauthpairinglinksinput"></a>

## `ListActiveAuthPairingLinksInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:73](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L73-L75)
- Shape: `{ now: date }`

<a id="schema-listactiveauthsessionsinput"></a>

## `ListActiveAuthSessionsInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:72](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L72-L75)
- Shape: `{ now: date; connectedSessionIds?: makeEntityId[] }`

<a id="schema-orchestrationcommandreceipt"></a>

## `OrchestrationCommandReceipt`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/OrchestrationCommandReceipts.ts:16](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/OrchestrationCommandReceipts.ts#L16-L25)
- Shape: `{ commandId: makeEntityId; aggregateKind: "project" | "thread"; aggregateId: makeEntityId | makeEntityId; commandType: string; acceptedAt: string; resultSequence: NonNegativeInt; status: "accepted" | "rejected"; error: string | null }`

<a id="schema-persistencedecodeerror"></a>

## `PersistenceDecodeError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/Errors.ts:43](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/Errors.ts#L43-L68)
- Shape: `{ _tag: "PersistenceDecodeError"; operation: string; issue: string; correlation?: PersistenceErrorCorrelation; cause?: unknown }`

<a id="schema-persistenceerrorcorrelation"></a>

## `PersistenceErrorCorrelation`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/Errors.ts:19](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/Errors.ts#L19-L24)
- Shape: `{ sessionId: string } | { currentSessionId: string } | { pairingLinkId: string } | { threadId: string }`

<a id="schema-persistencesqlerror"></a>

## `PersistenceSqlError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/Errors.ts:27](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/Errors.ts#L27-L41)
- Shape: `{ _tag: "PersistenceSqlError"; operation: string; detail?: string; correlation?: PersistenceErrorCorrelation; cause?: unknown }`

<a id="schema-providersessionruntime"></a>

## `ProviderSessionRuntime`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/ProviderSessionRuntime.ts:30](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/ProviderSessionRuntime.ts#L30-L40)
- Shape: `{ threadId: makeEntityId; providerName: string; providerInstanceId: TrimmedNonEmptyString | null; adapterKey: string; runtimeMode: RuntimeMode; status: "starting" | "running" | "stopped" | "error"; lastSeenAt: string; resumeCursor: unknown | null; runtimePayload: unknown | null }`

<a id="schema-pullrequestfileviewedmark"></a>

## `PullRequestFileViewedMark`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/PullRequestFilesViewed.ts:26](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/PullRequestFilesViewed.ts#L26-L30)
- Shape: `{ path: string; revision: string | null }`

<a id="schema-pullrequestfilesviewedscope"></a>

## `PullRequestFilesViewedScope`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/PullRequestFilesViewed.ts:17](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/PullRequestFilesViewed.ts#L17-L23)
- Shape: `{ provider: SourceControlProviderKind; host: string; repository: string; number: number; viewer: string }`

<a id="schema-recordconnectrequestclientinput"></a>

## `RecordConnectRequestClientInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:113](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L113-L116)
- Shape: `{ id: string; client: string }`

<a id="schema-recordimportedtranscriptinput"></a>

## `RecordImportedTranscriptInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/ProviderSessionRuntime.ts:49](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/ProviderSessionRuntime.ts#L49-L52)
- Shape: `{ threadId: makeEntityId; source: AgentSessionImportSource }`

<a id="schema-revokeauthpairinglinkinput"></a>

## `RevokeAuthPairingLinkInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:78](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L78-L81)
- Shape: `{ id: string; revokedAt: date }`

<a id="schema-revokeauthsessioninput"></a>

## `RevokeAuthSessionInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:78](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L78-L81)
- Shape: `{ sessionId: makeEntityId; revokedAt: date }`

<a id="schema-revokeauthsessionsbyproofkeyinput"></a>

## `RevokeAuthSessionsByProofKeyInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:99](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L99-L102)
- Shape: `{ proofKeyThumbprint: string; revokedAt: date }`

<a id="schema-revokeotherauthsessionsinput"></a>

## `RevokeOtherAuthSessionsInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:93](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L93-L96)
- Shape: `{ currentSessionId: makeEntityId; revokedAt: date }`

<a id="schema-revokeunspentbyproofkeyinput"></a>

## `RevokeUnspentByProofKeyInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthPairingLinks.ts:105](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthPairingLinks.ts#L105-L110)
- Shape: `{ proofKeyThumbprint: string | null; keepProofKeyThumbprint: string | null; includeUnbound: boolean; revokedAt: date }`

<a id="schema-serverownsdatabaseerror"></a>

## `ServerOwnsDatabaseError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/Sqlite.ts:18](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/Sqlite.ts#L18-L25)
- Shape: `{ _tag: "ServerOwnsDatabaseError"; stateDir: string }`

<a id="schema-setauthsessionlastconnectedatinput"></a>

## `SetAuthSessionLastConnectedAtInput`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/AuthSessions.ts:105](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/AuthSessions.ts#L105-L108)
- Shape: `{ sessionId: makeEntityId; lastConnectedAt: date }`

<a id="schema-v2databaseimporterror"></a>

## `V2DatabaseImportError`

- Kind: schema
- Workspace: [t3](../../architecture/t3.md)
- Source: [apps/server/src/persistence/initializeV2Database.ts:8](https://github.com/pingdotgg/t3code/blob/be521199aace1a0b446f4db4a1181ef994aaa1e2/apps/server/src/persistence/initializeV2Database.ts#L8-L15)
- Shape: `{ _tag: "V2DatabaseImportError"; sourcePath: string; destinationPath: string; cause: unknown }`
