diff --git a/.changeset/session-idle-reclaim.md b/.changeset/session-idle-reclaim.md new file mode 100644 index 00000000..a38445bc --- /dev/null +++ b/.changeset/session-idle-reclaim.md @@ -0,0 +1,6 @@ +--- +"@pstdio/pocketcoder-cli": minor +"@pstdio/pocketcoder-sdk": minor +--- + +Release a managed session's compute after a profile's `idleSeconds` warm period; the next message resumes the chat on new compute. diff --git a/docs/managed-consumers.md b/docs/managed-consumers.md index 3ef540ef..fac0f336 100644 --- a/docs/managed-consumers.md +++ b/docs/managed-consumers.md @@ -29,7 +29,8 @@ Mount this file only into the controller and set `POCKETCODER_PRINCIPALS_FILE`: "issuer": "chat", "placement": "shared", "limits": { "workspacesPerOwner": 1, "sessionsPerWorkspace": 5 }, - "dispatchDeadlineSeconds": 600 + "dispatchDeadlineSeconds": 600, + "idleSeconds": 900 } } }] diff --git a/docs/managed-runtime.md b/docs/managed-runtime.md index 24aac40c..f81754a5 100644 --- a/docs/managed-runtime.md +++ b/docs/managed-runtime.md @@ -46,6 +46,13 @@ cleanup evidence for that workspace generation. Its sessions become suspended and place again when they have work. A new message also moves an older live binding to the profile's current template release once its work has finished. +A profile's optional `idleSeconds` sets a warm period. When a workspace has had +no queued or unfinished request for that long, PocketCoder drains it the same +way, and its sessions become `suspended` with reason `workspace_idle`. The next +message places new compute and starts the session from its last saved turn (see +[session files](#session-files)), so the chat keeps its ID, history and files. +Without `idleSeconds`, idle compute stays until its deadline or a drain for room. + The controller-wide and per-principal admission limits still apply. Managed placements wait when the principal limit is full; they do not bypass admission. diff --git a/examples/e2e/e2b-idle-reclaim.ts b/examples/e2e/e2b-idle-reclaim.ts new file mode 100644 index 00000000..d10201d8 --- /dev/null +++ b/examples/e2e/e2b-idle-reclaim.ts @@ -0,0 +1,149 @@ +// Live check: a profile's warm period (idleSeconds) releases an idle chat's E2B VM. Another +// owner then uses the freed capacity, and the first chat continues on new compute with its +// history, files and attachment. It samples guest CPU and memory with one and five warm chats +// and prints a timestamped mark at each step, so host samples taken on the workers can be +// matched to it. See e2b-live-fixture.ts for the host it needs. +import assert from "node:assert/strict"; +import { randomUUID } from "node:crypto"; +import { Sandbox } from "e2b"; +import { e2bLiveFixture } from "./e2b-live-fixture"; +import { waitFor } from "./local-process"; + +const IDLE_SECONDS = 60; +const QUIET_MS = 30_000; +const live = await e2bLiveFixture(); +const evidence: Record = {}; +const lines = (text: string) => text.trim().split("\n"); +const mark = (step: string) => console.log(JSON.stringify({ mark: step, at: new Date().toISOString() })); + +async function timed(call: () => Promise) { + const started = Date.now(); + const result = await call(); + return { result, ms: Date.now() - started }; +} + +// Whole-VM CPU use over five seconds and memory in use, as the guest kernel sees them. +async function guestSample(sandboxId: string) { + const vm = await Sandbox.connect(sandboxId, live.connection); + const script = "head -1 /proc/stat; sleep 5; head -1 /proc/stat; grep -E '^Mem(Total|Available):' /proc/meminfo"; + const [before, after, total, available] = lines((await vm.commands.run(script, { user: "root" })).stdout); + const ticks = (line = "") => line.split(/\s+/).slice(1).map(Number); + const sum = (values: number[]) => values.reduce((a, b) => a + b, 0); + const [a, b] = [ticks(before), ticks(after)]; + const busy = sum(b) - sum(a) - ((b[3] ?? 0) + (b[4] ?? 0) - (a[3] ?? 0) - (a[4] ?? 0)); + const kib = (line = "") => Number(line.split(/\s+/)[1]); + return { + cpuPercent: Math.round((1000 * busy) / (sum(b) - sum(a))) / 10, + memUsedMiB: Math.round((kib(total) - kib(available)) / 1024), + }; +} + +try { + const template = await live.rivetTemplate(); + const { keyFile, principalsFile } = await live.consumerPrincipals(template.name, ["consumer"], false, { + idleSeconds: IDLE_SECONDS, + limits: { workspacesPerOwner: 1, sessionsPerWorkspace: 5 }, + }); + const controller = await live.startController(template.directory, { POCKETCODER_PRINCIPALS_FILE: principalsFile }); + const { api, consumer, completed, settled } = await live.managedClient(controller.baseUrl, keyFile); + const vmIds = async () => (await live.vms()).map((vm) => vm.sandboxId); + mark("no chats"); + await Bun.sleep(QUIET_MS); + + // The first chat remembers a token, edits a file and reads an attachment. + const first = await consumer.startSession("chat", "alice", randomUUID(), "team-1"); + const id = first.sessionId; + const token = `pocketcoder-doctor-${randomUUID()}`; + await completed(id, `Reply with exactly this diagnostic token: ${token}`, "token turn"); + const saved = `line-${randomUUID()}`; + const code = `brief-${randomUUID()}`; + const brief = await consumer.attach("user", id, { + inputId: randomUUID(), + name: "brief.txt", + mediaType: "text/plain", + bytes: new TextEncoder().encode(code), + }); + const withFile = await consumer.ask("user", id, `Append ${saved} to ledger.txt after 1 seconds`, { + attachments: [brief.inputId], + }); + assert.equal((await settled(id, withFile.requestId, "file turn")).outcome, "completed"); + const [vm] = await vmIds(); + const ledger = `/workspace/${id}/ledger.txt`; + assert.deepEqual(lines(await live.readFile(vm as string, ledger)), [saved]); + // The turn's inputs leave the VM when it ends, so check that the agent was given the file. + const mentions = () => live.modelRequests.filter((body) => JSON.stringify(body).includes("brief.txt")).length; + const seen = mentions(); + assert.ok( + seen > 0, + `the agent got the attachment: ${JSON.stringify(live.modelRequests.at(-1)?.messages?.at(-1)).slice(0, 600)}`, + ); + + // A gap shorter than the warm period keeps the VM. A warm turn sets the latency baseline. + mark("one chat"); + await Bun.sleep(QUIET_MS); + const oneChat = await guestSample(vm as string); + const warm = await timed(() => completed(id, "Repeat the earlier diagnostic token.", "warm turn")); + assert.equal(warm.result.finalResponse, token); + assert.deepEqual(await vmIds(), [vm], "a short gap keeps the VM"); + + // Four more chats share the VM. + const others = []; + for (let i = 0; i < 4; i++) { + const other = await consumer.startSession("chat", "alice", randomUUID(), "team-1"); + await completed( + other.sessionId, + `Reply with exactly this diagnostic token: pocketcoder-doctor-${randomUUID()}`, + "chat", + ); + others.push(other.sessionId); + } + assert.deepEqual(await vmIds(), [vm], "five chats share one VM"); + const lastActivity = Date.now(); + mark("five chats"); + await Bun.sleep(QUIET_MS); + const fiveChats = await guestSample(vm as string); + evidence.guest = { oneChat, fiveChats }; + + // Past the warm period the VM is released and every chat on it waits for new work. + await waitFor(() => live.gone(vm as string), (IDLE_SECONDS + 120) * 1000, "idle release"); + const releasedAfterMs = Date.now() - lastActivity; + mark("released"); + for (const sessionId of [id, ...others]) { + const session = await api.sessions.get(sessionId); + assert.deepEqual([session.state, session.reasonCode], ["suspended", "workspace_idle"], sessionId); + } + assert.deepEqual(await vmIds(), [], "no VM runs after the release"); + evidence.release = { vm, idleSeconds: IDLE_SECONDS, releasedAfterMs }; + await Bun.sleep(QUIET_MS); + + // Another owner takes the freed capacity. + const bob = await consumer.startSession("chat", "bob", randomUUID(), "team-1"); + await completed(bob.sessionId, `Reply with exactly this diagnostic token: pocketcoder-doctor-${randomUUID()}`, "bob"); + const [bobVm] = await vmIds(); + assert.ok(bobVm && bobVm !== vm, "bob runs on new compute"); + await consumer.close("user", bob.sessionId); + await waitFor(async () => (await vmIds()).length === 0, 180_000, "bob's VM cleanup"); + evidence.otherOwner = { vm: bobVm }; + mark("other owner done"); + + // The first chat continues on new compute with the same ID, history, file and attachment. + const resumed = await timed(() => completed(id, "Repeat the earlier diagnostic token.", "resumed turn")); + assert.equal(resumed.result.finalResponse, token, "the resumed chat has its history"); + const [next] = await vmIds(); + assert.ok(next && next !== vm && next !== bobVm, "the resumed chat runs on new compute"); + assert.deepEqual(lines(await live.readFile(next, ledger)), [saved], "the resumed chat has its file"); + assert.equal((await api.files.get(id, brief.inputId)).state, "ready", "the attachment is kept"); + const again = await consumer.ask("user", id, `Append ${saved}-2 to ledger.txt after 1 seconds`, { + attachments: [brief.inputId], + }); + assert.equal((await settled(id, again.requestId, "attachment after resume")).outcome, "completed"); + assert.ok(mentions() > seen, "the resumed chat can use its attachment"); + evidence.resume = { vm: next, warmTurnMs: warm.ms, resumedTurnMs: resumed.ms }; + mark("resumed"); + + for (const sessionId of [id, ...others]) await consumer.close("user", sessionId); + await waitFor(async () => (await vmIds()).length === 0, 180_000, "VM cleanup"); + console.log(JSON.stringify({ revision: await live.revision(), template: template.alias, ...evidence }, null, 2)); +} finally { + await live.close(); +} diff --git a/examples/e2e/e2b-live-fixture.ts b/examples/e2e/e2b-live-fixture.ts index 8a96eb53..7eba80ff 100644 --- a/examples/e2e/e2b-live-fixture.ts +++ b/examples/e2e/e2b-live-fixture.ts @@ -172,8 +172,12 @@ export async function e2bLiveFixture() { tempDir, lease, modelRequests, - consumerPrincipals: (templateName: string, names = ["consumer"], revoke = false) => - writePrincipals(tempDir, lease, templateName, names, revoke), + consumerPrincipals: ( + templateName: string, + names = ["consumer"], + revoke = false, + profile: Partial = {}, + ) => writePrincipals(tempDir, lease, templateName, { names, revoke, profile }), rivetTemplate, startController, managedClient, @@ -253,8 +257,14 @@ async function gatewayAccepts(gateway: string, credential: string) { type Lease = Awaited>; // One consumer principal per name, each with its own key file. "chat" shares one VM per owner -// between two sessions. With revoke, the issuer revokes a lost generation's model leases. -async function writePrincipals(tempDir: string, lease: Lease, templateName: string, names: string[], revoke: boolean) { +// between two sessions unless profile overrides it. With revoke, the issuer revokes a lost +// generation's model leases. +async function writePrincipals( + tempDir: string, + lease: Lease, + templateName: string, + { names, revoke, profile }: { names: string[]; revoke: boolean; profile: Partial }, +) { const tokenFile = resolve(tempDir, "issuer.token"); const principalsFile = resolve(tempDir, "principals.json"); await writeFile(tokenFile, lease.config.authorization.replace(/^Bearer /, "")); @@ -273,6 +283,7 @@ async function writePrincipals(tempDir: string, lease: Lease, templateName: stri issuer: GATEWAY_POLICY, placement: "shared", limits: { workspacesPerOwner: 1, sessionsPerWorkspace: 2 }, + ...profile, }, }, })); diff --git a/examples/e2e/tsconfig.sessions.json b/examples/e2e/tsconfig.sessions.json index f8e7bdb7..b0e503c7 100644 --- a/examples/e2e/tsconfig.sessions.json +++ b/examples/e2e/tsconfig.sessions.json @@ -6,6 +6,7 @@ "e2b-live-fixture.ts", "e2b-managed-sessions.ts", "e2b-controller-restart.ts", + "e2b-idle-reclaim.ts", "e2b-recovery-points.ts", "e2b-tenants.ts", "local-echo.ts", diff --git a/package.json b/package.json index 2dea62d1..440968a0 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "example:e2e:e2b-rivet": "bun --no-env-file examples/e2e/e2b-rivet.ts", "example:e2e:e2b-managed-sessions": "bun --no-env-file examples/e2e/e2b-managed-sessions.ts", "example:e2e:e2b-controller-restart": "bun --no-env-file examples/e2e/e2b-controller-restart.ts", + "example:e2e:e2b-idle-reclaim": "bun --no-env-file examples/e2e/e2b-idle-reclaim.ts", "example:e2e:e2b-recovery-points": "bun --no-env-file examples/e2e/e2b-recovery-points.ts", "example:e2e:e2b-tenants": "bun --no-env-file examples/e2e/e2b-tenants.ts" }, diff --git a/packages/contracts/src/sessions/profile.ts b/packages/contracts/src/sessions/profile.ts index 23ce6dbc..1d4ea3e3 100644 --- a/packages/contracts/src/sessions/profile.ts +++ b/packages/contracts/src/sessions/profile.ts @@ -13,6 +13,9 @@ export const ProfileConfigSchema = z.strictObject({ }) .default({ workspacesPerOwner: 1, sessionsPerWorkspace: 1 }), dispatchDeadlineSeconds: z.number().int().positive().default(600), + // Compute with no queued or unfinished request for this long is released; the next message + // places new compute and restores the session from its last recovery point. + idleSeconds: z.number().int().positive().optional(), }); export type ProfileConfig = z.infer; export const SessionProfileSchema = ProfileConfigSchema.extend({ diff --git a/packages/db/assets/core-seed.json b/packages/db/assets/core-seed.json index a1293a9a..fa4a1c19 100644 --- a/packages/db/assets/core-seed.json +++ b/packages/db/assets/core-seed.json @@ -2,8 +2,8 @@ "app": "pocketcoder", "pgliteVersion": "0.5.8", "postgresVersion": "18.3", - "checksum": "32a53837d64c80bce4d14ee1a3cf3fd39edc4b3f7e22ec858fe867446dc2ab7a", - "sourceChecksum": "b795bdccb7f219f6f6048c8262da7bea0c42a8d163014858664f91f2ffb5ebaa", + "checksum": "72e5b0c9d9742b1418439828ff782095d2f74aed383638640a9c837121350d09", + "sourceChecksum": "135fc541158a14329ca9e15d17c9377b41c5475bd281a532c35f77ac1ff29d60", "engine": { "wasm": { "checksum": "ce6af6ff027cbf1f22da3f5bbc8b0b30082123e2826f38a27fb91847cd16046f", @@ -122,6 +122,10 @@ { "name": "20261203131024_pretty_tomas", "hash": "7d05caf4aa8a44fc769e2b45378513ad861ce7fd192d5405e747c928443fc5a3" + }, + { + "name": "20261203233219_mighty_triton", + "hash": "14a6189a6dd7560ef83bc0a7917d5d41c96ea10c0ca3cbd834ee8a639978ae8b" } ] } diff --git a/packages/db/assets/core-seed.tar.zst b/packages/db/assets/core-seed.tar.zst index b83c8c71..0a0e43a8 100644 Binary files a/packages/db/assets/core-seed.tar.zst and b/packages/db/assets/core-seed.tar.zst differ diff --git a/packages/db/assets/migrations.json b/packages/db/assets/migrations.json index cdf2de3d..5a75937c 100644 --- a/packages/db/assets/migrations.json +++ b/packages/db/assets/migrations.json @@ -457,5 +457,12 @@ "folderMillis": 1796303424000, "hash": "7d05caf4aa8a44fc769e2b45378513ad861ce7fd192d5405e747c928443fc5a3", "name": "20261203131024_pretty_tomas" + }, + { + "sql": ["ALTER TABLE \"managed_profiles\" ADD COLUMN \"idle_seconds\" integer;"], + "bps": true, + "folderMillis": 1796340739000, + "hash": "14a6189a6dd7560ef83bc0a7917d5d41c96ea10c0ca3cbd834ee8a639978ae8b", + "name": "20261203233219_mighty_triton" } ] diff --git a/packages/db/drizzle/20261203233219_mighty_triton/migration.sql b/packages/db/drizzle/20261203233219_mighty_triton/migration.sql new file mode 100644 index 00000000..9aa76acf --- /dev/null +++ b/packages/db/drizzle/20261203233219_mighty_triton/migration.sql @@ -0,0 +1 @@ +ALTER TABLE "managed_profiles" ADD COLUMN "idle_seconds" integer; \ No newline at end of file diff --git a/packages/db/drizzle/20261203233219_mighty_triton/snapshot.json b/packages/db/drizzle/20261203233219_mighty_triton/snapshot.json new file mode 100644 index 00000000..46d4b7c3 --- /dev/null +++ b/packages/db/drizzle/20261203233219_mighty_triton/snapshot.json @@ -0,0 +1,8467 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "37b798ac-7398-4548-883c-327bd07745bc", + "prevIds": [ + "16622851-45aa-4803-981b-7b5a17a83482" + ], + "ddl": [ + { + "isRlsEnabled": false, + "name": "binary_outputs", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "checkpoint_transfers", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "checkpoint_controller_state", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "conversation_records", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "conversation_requests", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "conversations", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "event_outbox", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "export_objects", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "input_manifests", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "input_objects", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "machine_keys", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_capacity", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_issuers", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_observations", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_profiles", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_recovery_points", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "managed_sessions", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "preview_grants", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "principals", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "secret_versions", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "secrets", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "session_inputs", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "storage_reservations", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "templates", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "warm_pool_runtimes", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_checkpoints", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_conversation_messages", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_conversations", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_lease_fences", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_leases", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_logs", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_network_events", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_operations", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_outputs", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_state_history", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_storage", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspace_terminal_sessions", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "workspaces", + "entityType": "tables", + "schema": "public" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reservation_id", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_epoch", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "grant_digest", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "digest", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retained_until", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "binary_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation_id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "checkpoint_id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "direction", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connection_epoch", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_digest", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "grant_digest", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reservation_id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stage_path", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stage_identity", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "declared_header", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expected_archive_bytes", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "summary", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archive_digest", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stored_bytes", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completed_at", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_controller_state" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_writer", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_controller_state" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "recovery", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_controller_state" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "journal", + "entityType": "columns", + "schema": "public", + "table": "checkpoint_controller_state" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "conversation_records_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_ref", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "record_seq", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "record_key", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "first_seq", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_seq", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "document", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "conversation_records" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identity", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "execution", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "managed", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "entityType": "columns", + "schema": "public", + "table": "conversation_requests" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "legacy", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "record_count", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "message_count", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "last_seq", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "retention_set", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "conversations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event_type", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "next_attempt_at", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempt_count", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delivered_at", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_error_code", + "entityType": "columns", + "schema": "public", + "table": "event_outbox" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "export_id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reservation_id", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "execution", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reference", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "export_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "input_manifests" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest", + "entityType": "columns", + "schema": "public", + "table": "input_manifests" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finalized_at", + "entityType": "columns", + "schema": "public", + "table": "input_manifests" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_id", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reservation_id", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reference", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "transfer_expires_at", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retained_until", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "published_at", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retention_ms", + "entityType": "columns", + "schema": "public", + "table": "input_objects" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuance_request_id", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuance_request_digest", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "managed_principal_ids", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "secret_digest", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "scopes", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "template_names", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revoked_at", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_used_at", + "entityType": "columns", + "schema": "public", + "table": "machine_keys" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "managed_capacity" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "record", + "entityType": "columns", + "schema": "public", + "table": "managed_capacity" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "managed_issuers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "managed_issuers" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "public", + "table": "managed_issuers" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "managed_observations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "managed_observations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequence", + "entityType": "columns", + "schema": "public", + "table": "managed_observations" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event", + "entityType": "columns", + "schema": "public", + "table": "managed_observations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_name", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_version", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuer", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "placement", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaces_per_owner", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sessions_per_workspace", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dispatch_deadline_seconds", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idle_seconds", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "disabled", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "managed_profiles" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "turn_id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "generation", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_digest", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "grant_digest", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "grant_expires_at", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archive_name", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archive_digest", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archive_bytes", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "committed_at", + "entityType": "columns", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "binding", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "binding_revision", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "last_generation", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "next_sequence", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "next_request_sequence", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "queue_count", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "queue_bytes", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "close", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancel", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "placement", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resume_requested_at", + "entityType": "columns", + "schema": "public", + "table": "managed_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "incarnation_id", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subject", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_revision", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "previews", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ceiling_at", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revoked_at", + "entityType": "columns", + "schema": "public", + "table": "preview_grants" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "scopes", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "template_names", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "disabled_at", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "principals" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nonce", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ciphertext", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tag", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "secret_versions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "secrets" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "secrets" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_id", + "entityType": "columns", + "schema": "public", + "table": "secrets" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "secrets" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retired_at", + "entityType": "columns", + "schema": "public", + "table": "secrets" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_id", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reference", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "session_inputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operation_id", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reserved_bytes", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reserved_files", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "materialized_bytes", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "materialized_files", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "released_at", + "entityType": "columns", + "schema": "public", + "table": "storage_reservations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "digest", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "spec", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retired_at", + "entityType": "columns", + "schema": "public", + "table": "templates" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_id", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_name", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_version", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_digest", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "driver_kind", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eligibility_fingerprint", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_ref", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enrollment_digest", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enrollment_expires_at", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ready_at", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "leased_at", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_code", + "entityType": "columns", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parent_checkpoint_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason_code", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_kind", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_ref", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_snapshot", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_provenance", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "manifest_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logical_bytes", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stored_bytes", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_count", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_restore", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ready_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seq", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identity", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bytes", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_conversations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_lease_fences" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_lease_fences" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "managed_authority", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "secret_name", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "secret_version_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_url", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_revision", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "policy_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_expires_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "removed_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "revoke_acknowledged_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuer_expires_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credential_bytes", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delivered_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "closed_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_leases" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_logs" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seq", + "entityType": "columns", + "schema": "public", + "table": "workspace_logs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stream", + "entityType": "columns", + "schema": "public", + "table": "workspace_logs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_logs" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "workspace_logs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seq", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_session_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_seq", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "decision", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "transport", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "port", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "method", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "matched_rule", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "workspace_network_events" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idempotency_key", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_digest", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "checkpoint_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "result_workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason_code", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempt_count", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completed_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_operations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_outputs" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seq", + "entityType": "columns", + "schema": "public", + "table": "workspace_outputs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "workspace_outputs" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "workspace_outputs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_outputs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "from_state", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "to_state", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason_code", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurred_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_state_history" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_kind", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_ref", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mount_manifest", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logical_bytes", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_count", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retained_until", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_error_code", + "entityType": "columns", + "schema": "public", + "table": "workspace_storage" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key_id", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "opened_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "closed_at", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "close_reason", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exit_code", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bytes_in", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bytes_out", + "entityType": "columns", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "principal_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "external_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idempotency_key", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_digest", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_name", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_version", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_digest", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "template_snapshot", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason_code", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'unknown'", + "generated": null, + "identity": null, + "name": "agent_state", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'disabled'", + "generated": null, + "identity": null, + "name": "network_state", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "network_event_seq", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "change_seq", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_log_tail", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "failure_log_tail_truncated", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_last_log_seq", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "terminal_intent", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "launch_input", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "runtime_registration", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "process_execution", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finite_process", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_kind", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_ref", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provisioning_mode", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registration_digest", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registration_expires_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reconnect_digest", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "connection_epoch", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "connected_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "disconnected_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ready_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_activity_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "launch_attempts", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "health", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lifetime", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deadline_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "terminal_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purge_requested_at", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "origin_workspace_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "restored_from_checkpoint_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_descriptor", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resolved_source", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'filesystem_only'", + "generated": null, + "identity": null, + "name": "persistence_capability", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latest_checkpoint_id", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'create'", + "generated": null, + "identity": null, + "name": "launch_mode", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "outputs", + "entityType": "columns", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "binary_outputs_workspace", + "entityType": "indexes", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "retained_until", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "binary_outputs_expiry", + "entityType": "indexes", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "operation_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "direction", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" NOT IN ('complete', 'aborted')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "checkpoint_transfers_one_live_attempt", + "entityType": "indexes", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "checkpoint_transfers_workspace", + "entityType": "indexes", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "updated_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "checkpoint_transfers_reconcile", + "entityType": "indexes", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversation_ref", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "last_seq", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "conversation_records_messages", + "entityType": "indexes", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "conversation_records_workspace", + "entityType": "indexes", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"conversation_id\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "conversations_workspace_unidentified", + "entityType": "indexes", + "schema": "public", + "table": "conversations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "conversations_workspace", + "entityType": "indexes", + "schema": "public", + "table": "conversations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "next_attempt_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"delivered_at\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "event_outbox_due", + "entityType": "indexes", + "schema": "public", + "table": "event_outbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "export_objects_retention", + "entityType": "indexes", + "schema": "public", + "table": "export_objects" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "export_objects_workspace", + "entityType": "indexes", + "schema": "public", + "table": "export_objects" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "principal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "session_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "managed_recovery_points_session", + "entityType": "indexes", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "storage_reservations_active", + "entityType": "indexes", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "storage_reservations_workspace", + "entityType": "indexes", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "principal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "storage_reservations_principal", + "entityType": "indexes", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "template_digest", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "driver_kind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eligibility_fingerprint", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "ready_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "warm_pool_eligible", + "entityType": "indexes", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "warm_pool_workspace_once", + "entityType": "indexes", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "principal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_checkpoints_principal_state", + "entityType": "indexes", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_checkpoints_gc", + "entityType": "indexes", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_leases_workspace", + "entityType": "indexes", + "schema": "public", + "table": "workspace_leases" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "seq", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_network_events_page", + "entityType": "indexes", + "schema": "public", + "table": "workspace_network_events" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "updated_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_operations_due", + "entityType": "indexes", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurred_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_state_history_ws", + "entityType": "indexes", + "schema": "public", + "table": "workspace_state_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" NOT IN ('deleted', 'lost', 'quarantined')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_storage_one_live", + "entityType": "indexes", + "schema": "public", + "table": "workspace_storage" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "retained_until", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_storage_gc", + "entityType": "indexes", + "schema": "public", + "table": "workspace_storage" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "principal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_storage_principal", + "entityType": "indexes", + "schema": "public", + "table": "workspace_storage" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspace_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "opened_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "session_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspace_terminal_sessions_page", + "entityType": "indexes", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "principal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "external_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"state\" NOT IN ('succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspaces_principal_external_active", + "entityType": "indexes", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "state", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspaces_state_created", + "entityType": "indexes", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deadline_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"state\" NOT IN ('succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "workspaces_deadline", + "entityType": "indexes", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "binary_outputs_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "binary_outputs_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": false, + "columns": [ + "key_id" + ], + "schemaTo": "public", + "tableTo": "machine_keys", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "binary_outputs_key_id_machine_keys_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": false, + "columns": [ + "reservation_id" + ], + "schemaTo": "public", + "tableTo": "storage_reservations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "binary_outputs_reservation_id_storage_reservations_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "binary_outputs" + }, + { + "nameExplicit": false, + "columns": [ + "operation_id" + ], + "schemaTo": "public", + "tableTo": "workspace_operations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "checkpoint_transfers_operation_id_workspace_operations_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": false, + "columns": [ + "checkpoint_id" + ], + "schemaTo": "public", + "tableTo": "workspace_checkpoints", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "checkpoint_transfers_LwO6aZRv7ni4_fkey", + "entityType": "fks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "checkpoint_transfers_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "checkpoint_transfers_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": false, + "columns": [ + "reservation_id" + ], + "schemaTo": "public", + "tableTo": "storage_reservations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "checkpoint_transfers_ioeVcqFKXesW_fkey", + "entityType": "fks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "nameExplicit": false, + "columns": [ + "conversation_ref" + ], + "schemaTo": "public", + "tableTo": "conversations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "conversation_records_conversation_ref_conversations_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "conversation_records_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "conversation_requests_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversation_requests" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "conversation_requests_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversation_requests" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "conversations_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "conversations_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "conversations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "event_outbox_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "event_outbox" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "input_objects_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "input_objects" + }, + { + "nameExplicit": false, + "columns": [ + "reservation_id" + ], + "schemaTo": "public", + "tableTo": "storage_reservations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "input_objects_reservation_id_storage_reservations_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "input_objects" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "machine_keys_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "machine_keys" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "managed_issuers_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "managed_issuers" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "managed_observations_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "managed_observations" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "managed_profiles_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "managed_profiles" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "managed_recovery_points_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "managed_sessions_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "managed_sessions" + }, + { + "nameExplicit": false, + "columns": [ + "version_id", + "name", + "type" + ], + "schemaTo": "public", + "tableTo": "secret_versions", + "columnsTo": [ + "id", + "name", + "type" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "secrets_version_id_name_type_secret_versions_id_name_type_fkey", + "entityType": "fks", + "schema": "public", + "table": "secrets" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "session_inputs_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "session_inputs" + }, + { + "nameExplicit": false, + "columns": [ + "operation_id" + ], + "schemaTo": "public", + "tableTo": "workspace_operations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "storage_reservations_operation_id_workspace_operations_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "storage_reservations_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "storage_reservations_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "storage_reservations" + }, + { + "nameExplicit": false, + "columns": [ + "template_id" + ], + "schemaTo": "public", + "tableTo": "templates", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "warm_pool_runtimes_template_id_templates_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "warm_pool_runtimes_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_checkpoints_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_checkpoints_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "nameExplicit": false, + "columns": [ + "storage_id" + ], + "schemaTo": "public", + "tableTo": "workspace_storage", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_checkpoints_storage_id_workspace_storage_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_conversation_messages_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_conversations_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_conversations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_lease_fences_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_lease_fences" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_leases_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_leases" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_logs_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_logs" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "workspace_network_events_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_network_events" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_operations_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_operations_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": false, + "columns": [ + "checkpoint_id" + ], + "schemaTo": "public", + "tableTo": "workspace_checkpoints", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_operations_fBJ1lkBRI011_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": false, + "columns": [ + "result_workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_operations_result_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_outputs_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_outputs" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_state_history_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_state_history" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_storage_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_storage" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_storage_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_storage" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id" + ], + "schemaTo": "public", + "tableTo": "workspaces", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "workspace_terminal_sessions_workspace_id_workspaces_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "nameExplicit": false, + "columns": [ + "key_id" + ], + "schemaTo": "public", + "tableTo": "machine_keys", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspace_terminal_sessions_key_id_machine_keys_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id" + ], + "schemaTo": "public", + "tableTo": "principals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspaces_principal_id_principals_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": false, + "columns": [ + "template_id" + ], + "schemaTo": "public", + "tableTo": "templates", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "workspaces_template_id_templates_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "workspaces" + }, + { + "columns": [ + "principal_id", + "conversation_id", + "request_id" + ], + "nameExplicit": false, + "name": "conversation_requests_pkey", + "entityType": "pks", + "schema": "public", + "table": "conversation_requests" + }, + { + "columns": [ + "workspace_id", + "file_id" + ], + "nameExplicit": false, + "name": "input_objects_pkey", + "entityType": "pks", + "schema": "public", + "table": "input_objects" + }, + { + "columns": [ + "principal_id", + "name" + ], + "nameExplicit": false, + "name": "managed_issuers_pkey", + "entityType": "pks", + "schema": "public", + "table": "managed_issuers" + }, + { + "columns": [ + "principal_id", + "session_id", + "sequence" + ], + "nameExplicit": false, + "name": "managed_observations_pkey", + "entityType": "pks", + "schema": "public", + "table": "managed_observations" + }, + { + "columns": [ + "principal_id", + "name" + ], + "nameExplicit": false, + "name": "managed_profiles_pkey", + "entityType": "pks", + "schema": "public", + "table": "managed_profiles" + }, + { + "columns": [ + "principal_id", + "session_id" + ], + "nameExplicit": false, + "name": "managed_sessions_pkey", + "entityType": "pks", + "schema": "public", + "table": "managed_sessions" + }, + { + "columns": [ + "principal_id", + "session_id", + "input_id" + ], + "nameExplicit": false, + "name": "session_inputs_pkey", + "entityType": "pks", + "schema": "public", + "table": "session_inputs" + }, + { + "columns": [ + "workspace_id", + "seq" + ], + "nameExplicit": false, + "name": "workspace_conversation_messages_pkey", + "entityType": "pks", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "columns": [ + "workspace_id", + "seq" + ], + "nameExplicit": false, + "name": "workspace_logs_pkey", + "entityType": "pks", + "schema": "public", + "table": "workspace_logs" + }, + { + "columns": [ + "workspace_id", + "seq" + ], + "nameExplicit": false, + "name": "workspace_network_events_pkey", + "entityType": "pks", + "schema": "public", + "table": "workspace_network_events" + }, + { + "columns": [ + "workspace_id", + "seq" + ], + "nameExplicit": false, + "name": "workspace_outputs_pkey", + "entityType": "pks", + "schema": "public", + "table": "workspace_outputs" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "binary_outputs_pkey", + "schema": "public", + "table": "binary_outputs", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "checkpoint_transfers_pkey", + "schema": "public", + "table": "checkpoint_transfers", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "checkpoint_controller_state_pkey", + "schema": "public", + "table": "checkpoint_controller_state", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "conversation_records_pkey", + "schema": "public", + "table": "conversation_records", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "conversations_pkey", + "schema": "public", + "table": "conversations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "event_outbox_pkey", + "schema": "public", + "table": "event_outbox", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "export_objects_pkey", + "schema": "public", + "table": "export_objects", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "input_manifests_pkey", + "schema": "public", + "table": "input_manifests", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "machine_keys_pkey", + "schema": "public", + "table": "machine_keys", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id" + ], + "nameExplicit": false, + "name": "managed_capacity_pkey", + "schema": "public", + "table": "managed_capacity", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "managed_recovery_points_pkey", + "schema": "public", + "table": "managed_recovery_points", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "preview_grants_pkey", + "schema": "public", + "table": "preview_grants", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "principals_pkey", + "schema": "public", + "table": "principals", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "secret_versions_pkey", + "schema": "public", + "table": "secret_versions", + "entityType": "pks" + }, + { + "columns": [ + "name" + ], + "nameExplicit": false, + "name": "secrets_pkey", + "schema": "public", + "table": "secrets", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "storage_reservations_pkey", + "schema": "public", + "table": "storage_reservations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "templates_pkey", + "schema": "public", + "table": "templates", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "warm_pool_runtimes_pkey", + "schema": "public", + "table": "warm_pool_runtimes", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_checkpoints_pkey", + "schema": "public", + "table": "workspace_checkpoints", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id" + ], + "nameExplicit": false, + "name": "workspace_conversations_pkey", + "schema": "public", + "table": "workspace_conversations", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id" + ], + "nameExplicit": false, + "name": "workspace_lease_fences_pkey", + "schema": "public", + "table": "workspace_lease_fences", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_leases_pkey", + "schema": "public", + "table": "workspace_leases", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_operations_pkey", + "schema": "public", + "table": "workspace_operations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_state_history_pkey", + "schema": "public", + "table": "workspace_state_history", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspace_storage_pkey", + "schema": "public", + "table": "workspace_storage", + "entityType": "pks" + }, + { + "columns": [ + "session_id" + ], + "nameExplicit": false, + "name": "workspace_terminal_sessions_pkey", + "schema": "public", + "table": "workspace_terminal_sessions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workspaces_pkey", + "schema": "public", + "table": "workspaces", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + "conversation_ref", + "record_seq" + ], + "nullsNotDistinct": false, + "name": "conversation_records_seq", + "entityType": "uniques", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": true, + "columns": [ + "conversation_ref", + "record_key" + ], + "nullsNotDistinct": false, + "name": "conversation_records_key", + "entityType": "uniques", + "schema": "public", + "table": "conversation_records" + }, + { + "nameExplicit": true, + "columns": [ + "principal_id", + "conversation_id" + ], + "nullsNotDistinct": false, + "name": "conversations_identity", + "entityType": "uniques", + "schema": "public", + "table": "conversations" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id", + "issuance_request_id" + ], + "nullsNotDistinct": false, + "name": "machine_keys_principal_id_issuance_request_id_unique", + "entityType": "uniques", + "schema": "public", + "table": "machine_keys" + }, + { + "nameExplicit": true, + "columns": [ + "principal_id", + "session_id", + "request_id" + ], + "nullsNotDistinct": false, + "name": "managed_recovery_points_request", + "entityType": "uniques", + "schema": "public", + "table": "managed_recovery_points" + }, + { + "nameExplicit": false, + "columns": [ + "id", + "name", + "type" + ], + "nullsNotDistinct": false, + "name": "secret_versions_id_name_type_unique", + "entityType": "uniques", + "schema": "public", + "table": "secret_versions" + }, + { + "nameExplicit": false, + "columns": [ + "name", + "version" + ], + "nullsNotDistinct": false, + "name": "templates_name_version_unique", + "entityType": "uniques", + "schema": "public", + "table": "templates" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id", + "message_id" + ], + "nullsNotDistinct": false, + "name": "workspace_conversation_messages_workspace_id_message_id_unique", + "entityType": "uniques", + "schema": "public", + "table": "workspace_conversation_messages" + }, + { + "nameExplicit": false, + "columns": [ + "secret_name", + "request_id" + ], + "nullsNotDistinct": false, + "name": "workspace_leases_secret_name_request_id_unique", + "entityType": "uniques", + "schema": "public", + "table": "workspace_leases" + }, + { + "nameExplicit": false, + "columns": [ + "workspace_id", + "source_session_id", + "source_seq" + ], + "nullsNotDistinct": false, + "name": "workspace_network_events_workspace_id_source_session_id_source_seq_unique", + "entityType": "uniques", + "schema": "public", + "table": "workspace_network_events" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id", + "kind", + "idempotency_key" + ], + "nullsNotDistinct": false, + "name": "workspace_operations_principal_id_kind_idempotency_key_unique", + "entityType": "uniques", + "schema": "public", + "table": "workspace_operations" + }, + { + "nameExplicit": false, + "columns": [ + "principal_id", + "idempotency_key" + ], + "nullsNotDistinct": false, + "name": "workspaces_principal_id_idempotency_key_unique", + "entityType": "uniques", + "schema": "public", + "table": "workspaces" + }, + { + "nameExplicit": false, + "columns": [ + "reservation_id" + ], + "nullsNotDistinct": false, + "name": "binary_outputs_reservation_id_key", + "schema": "public", + "table": "binary_outputs", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "principals_name_key", + "schema": "public", + "table": "principals", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "nonce" + ], + "nullsNotDistinct": false, + "name": "secret_versions_nonce_key", + "schema": "public", + "table": "secret_versions", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "digest" + ], + "nullsNotDistinct": false, + "name": "templates_digest_key", + "schema": "public", + "table": "templates", + "entityType": "uniques" + }, + { + "value": "\"state\" IN ('capturing','ready','deleted')", + "name": "binary_outputs_state", + "entityType": "checks", + "schema": "public", + "table": "binary_outputs" + }, + { + "value": "\"data\" IS NULL OR octet_length(\"data\") BETWEEN 1 AND 4194304", + "name": "binary_outputs_size", + "entityType": "checks", + "schema": "public", + "table": "binary_outputs" + }, + { + "value": "(\"state\" = 'ready') = (\"data\" IS NOT NULL)", + "name": "binary_outputs_content", + "entityType": "checks", + "schema": "public", + "table": "binary_outputs" + }, + { + "value": "\"direction\" IN ('upload', 'download')", + "name": "checkpoint_transfers_direction_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\"state\" IN ('preparing', 'granted', 'streaming', 'validated', 'publishing', 'complete', 'cleanup_pending', 'aborted')", + "name": "checkpoint_transfers_state_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\"connection_epoch\" >= 0", + "name": "checkpoint_transfers_epoch_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\"grant_digest\" IS NULL OR octet_length(\"grant_digest\") = 32", + "name": "checkpoint_transfers_digest_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\n (\"expected_archive_bytes\" IS NULL OR \"expected_archive_bytes\" BETWEEN 0 AND 9007199254740991) AND\n (\"stored_bytes\" IS NULL OR \"stored_bytes\" BETWEEN 0 AND 9007199254740991)", + "name": "checkpoint_transfers_size_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\n (\"state\" = 'granted' AND \"grant_digest\" IS NOT NULL) OR\n (\"state\" <> 'granted' AND \"grant_digest\" IS NULL)", + "name": "checkpoint_transfers_grant_phase_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\n \"direction\" <> 'upload' OR \"state\" = 'preparing' OR \"reservation_id\" IS NOT NULL", + "name": "checkpoint_transfers_upload_reservation_check", + "entityType": "checks", + "schema": "public", + "table": "checkpoint_transfers" + }, + { + "value": "\"type\" IN ('setup-issuer', 'runtime-issuer', 'registry')", + "name": "secret_versions_type_check", + "entityType": "checks", + "schema": "public", + "table": "secret_versions" + }, + { + "value": "octet_length(\"nonce\") = 12", + "name": "secret_versions_nonce_length", + "entityType": "checks", + "schema": "public", + "table": "secret_versions" + }, + { + "value": "octet_length(\"tag\") = 16", + "name": "secret_versions_tag_length", + "entityType": "checks", + "schema": "public", + "table": "secret_versions" + }, + { + "value": "\"purpose\" IN ('checkpoint-upload', 'checkpoint-index', 'backup', 'attachment', 'screenshot', 'export')", + "name": "storage_reservations_purpose_check", + "entityType": "checks", + "schema": "public", + "table": "storage_reservations" + }, + { + "value": "\"state\" IN ('reserved', 'committed', 'releasing', 'released')", + "name": "storage_reservations_state_check", + "entityType": "checks", + "schema": "public", + "table": "storage_reservations" + }, + { + "value": "\n \"reserved_bytes\" BETWEEN 0 AND 9007199254740991 AND\n \"reserved_files\" BETWEEN 0 AND 9007199254740991 AND\n \"materialized_bytes\" BETWEEN 0 AND \"reserved_bytes\" AND\n \"materialized_files\" BETWEEN 0 AND \"reserved_files\"", + "name": "storage_reservations_bounds_check", + "entityType": "checks", + "schema": "public", + "table": "storage_reservations" + }, + { + "value": "\"workspace_id\" IS NULL OR \"principal_id\" IS NOT NULL", + "name": "storage_reservations_workspace_owner_check", + "entityType": "checks", + "schema": "public", + "table": "storage_reservations" + }, + { + "value": "\n \"purpose\" NOT IN ('checkpoint-upload', 'checkpoint-index') OR\n (\"operation_id\" IS NOT NULL AND \"workspace_id\" IS NOT NULL AND \"principal_id\" IS NOT NULL)", + "name": "storage_reservations_checkpoint_owner_check", + "entityType": "checks", + "schema": "public", + "table": "storage_reservations" + }, + { + "value": "\"status\" IN ('active', 'available', 'retired')", + "name": "templates_status_check", + "entityType": "checks", + "schema": "public", + "table": "templates" + }, + { + "value": "\"state\" IN ('provisioning', 'ready', 'leasing', 'leased', 'draining', 'failed')", + "name": "warm_pool_runtimes_state_check", + "entityType": "checks", + "schema": "public", + "table": "warm_pool_runtimes" + }, + { + "value": "\"state\" IN ('creating', 'ready', 'failed', 'deleting', 'deleted')", + "name": "workspace_checkpoints_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "value": "\"conversation_restore\" IN ('supported', 'filesystem_only', 'unknown')", + "name": "workspace_checkpoints_conversation_restore_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_checkpoints" + }, + { + "value": "\"purpose\" IN ('setup-issuer', 'runtime-issuer')", + "name": "workspace_leases_purpose", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"state\" IN ('requested', 'issued', 'delivered', 'revoking', 'revoked', 'expired', 'superseded')", + "name": "workspace_leases_state", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"request_expires_at\" > \"created_at\" AND \"request_expires_at\" <= \"created_at\" + interval '5 minutes'", + "name": "workspace_leases_request_expiry", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"issuer_expires_at\" IS NULL OR (\"issuer_expires_at\" > \"created_at\" AND \"issuer_expires_at\" <= \"request_expires_at\")", + "name": "workspace_leases_issuer_expiry", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "(\"state\" IN ('revoked', 'expired')) = (\"closed_at\" IS NOT NULL)", + "name": "workspace_leases_closed", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"credential_bytes\" IS NULL OR \"credential_bytes\" BETWEEN 1 AND 65536", + "name": "workspace_leases_credential_bytes", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"state\" NOT IN ('issued', 'delivered') OR (\"issuer_expires_at\" IS NOT NULL AND \"credential_bytes\" IS NOT NULL)", + "name": "workspace_leases_acknowledged", + "entityType": "checks", + "schema": "public", + "table": "workspace_leases" + }, + { + "value": "\"kind\" IN ('preserve', 'restore', 'verify', 'delete', 'purge')", + "name": "workspace_operations_kind_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_operations" + }, + { + "value": "\"state\" IN ('pending', 'running', 'succeeded', 'failed')", + "name": "workspace_operations_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_operations" + }, + { + "value": "\"from_state\" IS NULL OR \"from_state\" IN ('queued', 'provisioning', 'connected', 'ready', 'preserving', 'terminating', 'succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "name": "workspace_state_history_from_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_state_history" + }, + { + "value": "\"to_state\" IN ('queued', 'provisioning', 'connected', 'ready', 'preserving', 'terminating', 'succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "name": "workspace_state_history_to_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_state_history" + }, + { + "value": "\"reason_code\" IS NULL OR \"reason_code\" IN ('admission_global_capacity', 'admission_principal_capacity', 'admission_template_capacity', 'admission_policy_global_capacity', 'admission_actor_capacity', 'admission_denied', 'admission_unavailable', 'child_exit_success', 'child_exit_failure', 'setup_failed', 'bootstrap_failed', 'registration_timeout', 'health_failed', 'child_crash', 'provider_lost', 'disconnect_timeout', 'canceled_by_caller', 'deadline_expired', 'idle_expired', 'queue_timeout', 'launch_failed', 'launch_refused', 'preserve_requested', 'preserved_by_policy', 'checkpoint_created', 'checkpoint_failed', 'checkpoint_corrupt', 'checkpoint_quota_exceeded', 'checkpoint_storage_lost', 'restore_requested', 'restore_failed', 'image_unavailable', 'source_resolution_failed', 'secret_resolution_failed', 'operation_conflict', 'network_policy_failed')", + "name": "workspace_state_history_reason_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_state_history" + }, + { + "value": "\"state\" IN ('allocating', 'ready', 'snapshotting', 'retained', 'restoring', 'deleting', 'deleted', 'lost', 'quarantined')", + "name": "workspace_storage_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_storage" + }, + { + "value": "\"close_reason\" IS NULL OR \"close_reason\" IN ('exit', 'idle', 'checkpoint', 'workspace_ended', 'agent_detached', 'client_closed')", + "name": "workspace_terminal_sessions_close_reason_check", + "entityType": "checks", + "schema": "public", + "table": "workspace_terminal_sessions" + }, + { + "value": "\"state\" IN ('queued', 'provisioning', 'connected', 'ready', 'preserving', 'terminating', 'succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "name": "workspaces_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"reason_code\" IS NULL OR \"reason_code\" IN ('admission_global_capacity', 'admission_principal_capacity', 'admission_template_capacity', 'admission_policy_global_capacity', 'admission_actor_capacity', 'admission_denied', 'admission_unavailable', 'child_exit_success', 'child_exit_failure', 'setup_failed', 'bootstrap_failed', 'registration_timeout', 'health_failed', 'child_crash', 'provider_lost', 'disconnect_timeout', 'canceled_by_caller', 'deadline_expired', 'idle_expired', 'queue_timeout', 'launch_failed', 'launch_refused', 'preserve_requested', 'preserved_by_policy', 'checkpoint_created', 'checkpoint_failed', 'checkpoint_corrupt', 'checkpoint_quota_exceeded', 'checkpoint_storage_lost', 'restore_requested', 'restore_failed', 'image_unavailable', 'source_resolution_failed', 'secret_resolution_failed', 'operation_conflict', 'network_policy_failed')", + "name": "workspaces_reason_code_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"agent_state\" IN ('unknown', 'running', 'stable')", + "name": "workspaces_agent_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"network_state\" IN ('disabled', 'starting', 'ready', 'degraded')", + "name": "workspaces_network_state_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"terminal_intent\" IS NULL OR \"terminal_intent\" IN ('queued', 'provisioning', 'connected', 'ready', 'preserving', 'terminating', 'succeeded', 'failed', 'canceled', 'expired', 'preserved')", + "name": "workspaces_terminal_intent_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"provisioning_mode\" IS NULL OR \"provisioning_mode\" IN ('cold', 'warm')", + "name": "workspaces_provisioning_mode_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + }, + { + "value": "\"launch_mode\" IN ('create', 'restore')", + "name": "workspaces_launch_mode_check", + "entityType": "checks", + "schema": "public", + "table": "workspaces" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/db/src/modules/budgets/capacity-idle.ts b/packages/db/src/modules/budgets/capacity-idle.ts new file mode 100644 index 00000000..535d6e07 --- /dev/null +++ b/packages/db/src/modules/budgets/capacity-idle.ts @@ -0,0 +1,73 @@ +import { and, eq, inArray } from "drizzle-orm"; +import type { DatabaseContext, Transaction } from "../../database/context"; +import { lockStorageCapacity } from "../persistence/reservation-capacity"; +import { sessionWriter } from "../sessions/observations"; + +type Tables = DatabaseContext["tables"]; +type Capacity = Tables["managedCapacity"]["$inferSelect"]; +type Profile = Tables["managedProfiles"]["$inferSelect"]; + +// Compute whose profile's warm period has passed since its last request activity. Like the idle +// victim, only a ready workspace with no running execution is drained (see busyWorkspaces). +function pastWarmPeriod(rows: Capacity[], profiles: Profile[], at: Date) { + return rows.filter(({ record }) => { + const profile = profiles.find((p) => p.principalId === record.principalId && p.name === record.profile); + if (!profile?.idleSeconds || record.drainingAt) return false; + return Date.parse(record.lastUsedAt) + profile.idleSeconds * 1000 <= at.getTime(); + }); +} + +async function busyWorkspaces(context: DatabaseContext, tx: Transaction, ids: string[]) { + const { workspaces, conversationRequests: requests } = context.tables; + const ready = await tx + .select({ id: workspaces.id }) + .from(workspaces) + .where(and(inArray(workspaces.id, ids), eq(workspaces.state, "ready"))); + const running = await tx + .select({ workspaceId: requests.workspaceId, execution: requests.execution }) + .from(requests) + .where(inArray(requests.workspaceId, ids)); + return new Set( + ids.filter( + (id) => + !ready.some((workspace) => workspace.id === id) || + running.some((q) => q.workspaceId === id && q.execution && !q.execution.finalizedAt), + ), + ); +} + +async function drain(context: DatabaseContext, tx: Transaction, row: Capacity, at: Date) { + const writer = sessionWriter(context); + const sessions = await Promise.all( + row.record.sessions + .filter((s) => !s.stoppedAt) + .map((s) => writer.read(tx, { principalId: row.record.principalId, sessionId: s.sessionId })), + ); + // Accepted work that has not been sent yet still needs this compute. + if (sessions.some((session) => session.queueCount > 0)) return; + await tx + .update(context.tables.managedCapacity) + .set({ record: { ...row.record, drainingAt: at.toISOString() } }) + .where(eq(context.tables.managedCapacity.workspaceId, row.workspaceId)); + for (const { principalId, sessionId, session } of sessions) + if (session.state !== "closed" && session.state !== "suspended") + await writer.update(tx, { principalId, sessionId }, session.revision, "suspended", "workspace_idle"); +} + +// Releases compute that its profile's warm period (idleSeconds) has left unused. The usual drain +// then stops it and frees its capacity; its sessions place again when they next have work. +export async function drainIdleCapacity(context: DatabaseContext, at: Date) { + await context.db.transaction(async (tx) => { + const profiles = (await tx.select().from(context.tables.managedProfiles)).filter((p) => p.idleSeconds); + if (profiles.length === 0) return; + await lockStorageCapacity(context, tx); + const rows = pastWarmPeriod(await tx.select().from(context.tables.managedCapacity).for("update"), profiles, at); + if (rows.length === 0) return; + const busy = await busyWorkspaces( + context, + tx, + rows.map((row) => row.workspaceId), + ); + for (const row of rows) if (!busy.has(row.workspaceId)) await drain(context, tx, row, at); + }); +} diff --git a/packages/db/src/modules/budgets/capacity.ts b/packages/db/src/modules/budgets/capacity.ts index 49eb19d9..90bf3c87 100644 --- a/packages/db/src/modules/budgets/capacity.ts +++ b/packages/db/src/modules/budgets/capacity.ts @@ -6,6 +6,7 @@ import { unavailable } from "../managed/authority-context"; import { sessionWriter } from "../sessions/observations"; import { requireCapacityLaunch } from "./capacity-admission"; import { cancelManagedPlacement } from "./capacity-cancel"; +import { drainIdleCapacity } from "./capacity-idle"; import { placeManagedCapacity } from "./capacity-placement"; import { reserveManagedPlacement } from "./capacity-reservation"; import { retireManagedWorkspace } from "./capacity-retirement"; @@ -72,6 +73,7 @@ export function createManagedCapacity(context: DatabaseContext): ManagedCapacity .filter((r) => r.record.drainingAt && r.record.state !== "released") .map((r) => ({ workspaceId: r.workspaceId, principalId: r.record.principalId })); }, + drainIdle: (at) => drainIdleCapacity(context, at), releaseUnlaunched, async reconcile(at) { const rows = await db.select().from(table); diff --git a/packages/db/src/modules/managed/authority-context.ts b/packages/db/src/modules/managed/authority-context.ts index d6418a77..d162bc23 100644 --- a/packages/db/src/modules/managed/authority-context.ts +++ b/packages/db/src/modules/managed/authority-context.ts @@ -32,6 +32,7 @@ export function authorityContext({ tables }: DatabaseContext) { placement: row.placement, limits: { workspacesPerOwner: row.workspacesPerOwner, sessionsPerWorkspace: row.sessionsPerWorkspace }, dispatchDeadlineSeconds: row.dispatchDeadlineSeconds, + idleSeconds: row.idleSeconds ?? undefined, disabled: row.disabled, templateDigest: template?.digest ?? "", businessSlots: template diff --git a/packages/db/src/modules/managed/profile-reconciliation.ts b/packages/db/src/modules/managed/profile-reconciliation.ts index b5d908ff..b9d6433b 100644 --- a/packages/db/src/modules/managed/profile-reconciliation.ts +++ b/packages/db/src/modules/managed/profile-reconciliation.ts @@ -15,6 +15,7 @@ function profileValues(input: managed.ProfileConfig) { workspacesPerOwner: p.limits.workspacesPerOwner, sessionsPerWorkspace: p.limits.sessionsPerWorkspace, dispatchDeadlineSeconds: p.dispatchDeadlineSeconds, + idleSeconds: p.idleSeconds ?? null, disabled: false, }; } diff --git a/packages/db/src/schema/managed.ts b/packages/db/src/schema/managed.ts index 9dfd7060..934b6bac 100644 --- a/packages/db/src/schema/managed.ts +++ b/packages/db/src/schema/managed.ts @@ -50,6 +50,7 @@ export function createManagedTables( workspacesPerOwner: integer("workspaces_per_owner").notNull(), sessionsPerWorkspace: integer("sessions_per_workspace").notNull(), dispatchDeadlineSeconds: integer("dispatch_deadline_seconds").notNull(), + idleSeconds: integer("idle_seconds"), disabled: boolean("disabled").notNull().default(false), updatedAt: timestamptz("updated_at").notNull(), }, diff --git a/packages/manager/assets/manager-seed.json b/packages/manager/assets/manager-seed.json index 4bebd0dc..0d236d3f 100644 --- a/packages/manager/assets/manager-seed.json +++ b/packages/manager/assets/manager-seed.json @@ -35,5 +35,5 @@ "hash": "c2375c18fc9cd9a860a82d6c5da3b019d6494b961aee7cba156efa478ecc5e37" } ], - "checksum": "d01b9dd953a3a928cc397d02d8c0f18993c3d2c96e19f05b8b0488efc3ed01a4" + "checksum": "2ec9a31b45a69899a8cb495b937f6cdb33f798993862924d20ce04501c3f199b" } diff --git a/packages/manager/assets/manager-seed.tar.br b/packages/manager/assets/manager-seed.tar.br index 5a9bce0a..e75fc083 100644 Binary files a/packages/manager/assets/manager-seed.tar.br and b/packages/manager/assets/manager-seed.tar.br differ diff --git a/packages/runtime-contracts/src/stores/managed-work.ts b/packages/runtime-contracts/src/stores/managed-work.ts index 77f834eb..4caf02f2 100644 --- a/packages/runtime-contracts/src/stores/managed-work.ts +++ b/packages/runtime-contracts/src/stores/managed-work.ts @@ -112,6 +112,8 @@ export interface ManagedCapacityStore { cancelPlacement(identity: ManagedSessionIdentity, workspaceId: string, at: Date): Promise; retire(identity: ManagedSessionIdentity, at: Date): Promise; drains(): Promise<{ workspaceId: string; principalId: string }[]>; + // Begins draining compute that its profile's warm period (idleSeconds) has left unused. + drainIdle(at: Date): Promise; releaseUnlaunched(workspaceId: string, at: Date): Promise; reconcile(at: Date): Promise; place(identity: ManagedCapacityIdentity): Promise; diff --git a/packages/server/src/sessions/recovery.ts b/packages/server/src/sessions/recovery.ts index 0537e16a..9d76c91c 100644 --- a/packages/server/src/sessions/recovery.ts +++ b/packages/server/src/sessions/recovery.ts @@ -187,6 +187,7 @@ export function createSessionRecovery(deps: { return { async tick() { + await store.managed.capacity.drainIdle(now()); for (const drain of await store.managed.capacity.drains()) { const workspace = await store.getWorkspace(drain.workspaceId); const principal = await store.getPrincipal(drain.principalId); diff --git a/packages/server/src/sessions/shared-placement-flow.test.ts b/packages/server/src/sessions/shared-placement-flow.test.ts index 7295ebcc..46fc595f 100644 --- a/packages/server/src/sessions/shared-placement-flow.test.ts +++ b/packages/server/src/sessions/shared-placement-flow.test.ts @@ -1,5 +1,6 @@ import { expect, test } from "bun:test"; import { randomUUID } from "node:crypto"; +import type { managed } from "@pstdio/pocketcoder-contracts"; import type { WorkspaceRow } from "@pstdio/pocketcoder-runtime-core"; import { eq } from "drizzle-orm"; import { fakeProducer, managedFixture } from "./managed-fixture.test"; @@ -41,9 +42,12 @@ async function placementFixture(port: number | undefined) { stopped.push(id); }, }; + // The recovery tick's clock; request activity keeps the real time. + const clock = { offsetMs: 0 }; const recovery = createSessionRecovery({ store: m.f.store, launcher, + now: () => new Date(Date.now() + clock.offsetMs), credentials: { deliver: async (identity) => { credentials.push(`deliver:${identity.sessionId}`); @@ -65,7 +69,36 @@ async function placementFixture(port: number | undefined) { }; const close = (sessionId: string) => m.f.store.managed.sessions.close(m.keyId, sessionId, new Date()); const state = async (sessionId: string) => (await m.f.store.managed.sessions.get(m.keyId, sessionId)).state; - return { m, launched, stopped, credentials, installed, placedSession, ticks, close, state }; + const session = (sessionId: string) => m.f.store.managed.sessions.get(m.keyId, sessionId); + const configure = (config: Partial) => + m.f.store.managed.profiles.reconcile( + m.f.principal.id, + { + [m.profileId]: { + template: m.f.runtime.template.name, + templateVersion: m.f.runtime.template.version, + placement: "shared", + limits: { workspacesPerOwner: 5, sessionsPerWorkspace: 8 }, + dispatchDeadlineSeconds: 600, + ...config, + }, + }, + {}, + ); + return { + m, + launched, + stopped, + credentials, + installed, + clock, + placedSession, + ticks, + close, + state, + session, + configure, + }; } test("a shared session joins compute with room, and closing one session leaves its siblings running", async () => { @@ -175,3 +208,40 @@ test("a ready session whose credentials are no longer confirmed goes back to pro expect(await p.state(sessionId)).toBe("ready"); }); }); + +test("a workspace idle past its profile's warm period is drained, and its session suspends until new work", async () => { + await sharedPlacement(async (p) => { + await p.configure({ idleSeconds: 60 }); + const sessionId = await p.placedSession(); + await p.ticks(3); + await p.m.settle(); + expect(await p.state(sessionId)).toBe("ready"); + + p.clock.offsetMs = 30_000; + await p.ticks(2); + expect(p.stopped).toEqual([]); + + // The fixture only records stops, so each later tick asks to stop the draining compute again. + p.clock.offsetMs = 61_000; + await p.ticks(2); + expect([...new Set(p.stopped)]).toEqual(p.launched.map((next) => next.id)); + expect(await p.session(sessionId)).toMatchObject({ state: "suspended", reasonCode: "workspace_idle" }); + }); +}); + +test("queued work and profiles without a warm period keep idle compute", async () => { + await sharedPlacement(async (p) => { + const quiet = await p.placedSession(); + await p.ticks(3); + await p.m.settle(); + p.clock.offsetMs = 24 * 60 * 60_000; + await p.ticks(2); + expect(p.stopped).toEqual([]); + + await p.configure({ idleSeconds: 60 }); + await p.m.submit(quiet, "complete"); + await p.ticks(2); + expect(p.stopped).toEqual([]); + expect(await p.state(quiet)).toBe("ready"); + }); +});