UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

21,450 lines • 518 kB
import { l as isRecord } from "./record-coerce-CVPuDqcc.mjs";
import { n as isPostgresSqlConnection } from "./sql-connection-Beiyg5Dt.mjs";
import { f as invalidateLocalSqliteSchemaAdmissions, rt as OPENCLAW_STATE_SCHEMA_SQL, x as publishSqliteDatabaseSchemaChange } from "./sqlite-database-admission-DQIqro3d.mjs";
import { l as quoteSqliteIdentifier, t as extractSqliteTableSchema } from "./sqlite-schema-sql-CPyk_2Hd.mjs";
import { n as OPENCLAW_STATE_SCHEMA_VERSION } from "./openclaw-schema-versions-E_10NoI6.mjs";
import { c as createSqliteLifecycleAggregateError, u as throwSqliteLifecycleErrors } from "./sqlite-lifecycle-errors-D8BU4VLa.mjs";
import { s as stageSqliteTransactionState } from "./sqlite-post-commit-BrUVQObC.mjs";
import { i as executeSqliteQuerySync, s as getNodeSqliteKysely } from "./kysely-sync-YJo2lmGV.mjs";
import { t as assertPostgresCatalog } from "./postgres-catalog-BahDJJPz.mjs";
import { C as admitPostgresPhysicalFacts, D as requireNativeDatabaseFile, _ as captureSqliteSchemaFacts, d as invalidateSqliteSchemaFacts, o as getAdmittedSqliteSchemaFacts, w as getPostgresPhysicalFacts } from "./sqlite-schema-facts-B1bVE8IB.mjs";
import { a as tableExists, i as readTableColumns, n as ensureColumn } from "./openclaw-state-db-schema-helpers-nImZNMq_.mjs";
import { o as readSqliteUserVersion } from "./sqlite-user-version-C02a4KwH.mjs";
import "./openclaw-state-db-contract-DfPjvL0M.mjs";
import { t as VERSION } from "./version-GlxUMdxI.mjs";
import { o as publishStateRuntimeSchemaAdmission, r as getStateRuntimeSchemaAdmission, s as publishStateSchemaVersionAdmission } from "./openclaw-state-db-admission-Bw1Mtc4x.mjs";
import { c as withSqliteDatabaseAdmissionWait, n as assertSqliteDatabaseAdmissionWaitActive, s as readSqliteDatabaseAdmissionDeadline, t as SqliteDatabaseAdmissionTimeoutError } from "./sqlite-worker-database-admission-relay-CLRCTftr.mjs";
import { m as openClawStateDatabaseCache } from "./openclaw-state-db-cache-CkwtTqzF.mjs";
import { r as openTrackedStateDatabase } from "./openclaw-state-db-handle-BxpEWiaT.mjs";
import { t as openEngineStore } from "./open-jth9KEHn.mjs";
import { n as withLegacyPostgresIndexOrdering, t as postgresIndexOrderingMigration } from "./postgres-index-ordering-CLLgXtNR.mjs";
import { t as stateEngineInput } from "./openclaw-state-db-engine-input-Dy8v5WSG.mjs";
import { o as withLegacyTemplateStateSchema, p as withLegacyPublicationDraft, r as legacyTemplateStateIdentifier, t as TEMPLATE_STATE_POSTGRES_MIGRATION_SQL } from "./openclaw-state-db-schema-v36-template-names-D8yHNQrP.mjs";
import { a as parseStateSchemaContentVersion, n as PostgresSchemaAdmissionUnavailableError, r as admitStateSchemaFacts, t as CONTENT_VERSION_KEY } from "./openclaw-state-db-schema-version-uNbDFl6T.mjs";
import { t as ABANDONED_UPDATE_RUN_MS } from "./update-run-timeouts-Byb-PlTk.mjs";
import { parse } from "semver";
//#region src/state/openclaw-state-db-schema-v35-workspace-cas.ts
const WORKSPACE_CAS_TABLES = ["local_workspace_tree_packs", "local_workspace_source_path_sets"];
const WORKSPACE_CAS_COLUMNS = [
	"tree_root_digest",
	"source_paths_digest",
	"canonical_fingerprints",
	"projection_fingerprints"
];
/** DDL only: reconciliation converts retained baselines one projection at a time. */
function migrateLocalWorkspaceCas(e, t) {
	if (t >= 35 || !tableExists(e, "local_workspace_projections")) return false;
	for (const t of WORKSPACE_CAS_COLUMNS) ensureColumn(e, "local_workspace_projections", `${t} BLOB`);
	for (const t of WORKSPACE_CAS_TABLES) e.exec(extractSqliteTableSchema(OPENCLAW_STATE_SCHEMA_SQL, t));
	return true;
}
const stateLocalWorkspaceCasMigration = {
	version: 35,
	tables: ["local_workspace_projections", ...WORKSPACE_CAS_TABLES],
	columns: WORKSPACE_CAS_COLUMNS.map((e) => `local_workspace_projections.${e}`),
	migrate: migrateLocalWorkspaceCas,
	applied: "Prepared shared content-addressed workspace trees and compact scan fingerprints (v35)"
};
/** Exact predecessor declarations for admission, migration backups and ports. */
function withLegacyLocalWorkspaceCas(e) {
	return e.replace(/\n {2}(?:tree_root_digest|source_paths_digest|canonical_fingerprints|projection_fingerprints) BLOB,/gu, "").replace(/\n {2}"(?:tree_root_digest|source_paths_digest|canonical_fingerprints|projection_fingerprints)" bytea,/gu, "").replace(/CREATE TABLE(?: IF NOT EXISTS)? "?local_workspace_(?:tree_packs|source_path_sets)"? \([\s\S]*?\n\)(?: STRICT(?:, WITHOUT ROWID)?)?;\n?/gu, "");
}
//#endregion
//#region src/state/openclaw-state-db-schema-v31-workspace-manifests.ts
const projectionTable = "local_workspace_projections";
const nodeTable = "local_workspace_manifest_nodes";
const legacyBaselineCheck = "CHECK ((baseline_json IS NULL) = (baseline_ref IS NULL))";
const incrementalBaselineCheck = "CHECK (baseline_json IS NULL OR baseline_ref IS NOT NULL)";
/** The schema transaction preserves legacy bytes; the projection owner converts each baseline. */
function migrateLocalWorkspaceManifests(e, t) {
	if (t >= 31 || !tableExists(e, projectionTable)) return false;
	ensureColumn(e, projectionTable, "checkpoint_json TEXT");
	const n = getAdmittedSqliteSchemaFacts(e) ?? captureSqliteSchemaFacts(e);
	const r = n.tableSql.get(projectionTable);
	if (typeof r !== "string") throw new Error("Local workspace projection migration schema is missing");
	if (r.includes(legacyBaselineCheck)) {
		const t = quoteSqliteIdentifier(`${projectionTable}_migration_v31`);
		const i = quoteSqliteIdentifier(projectionTable);
		const a = [...readTableColumns(e, projectionTable)].map(quoteSqliteIdentifier).join(", ");
		const o = r.slice(r.indexOf("(")).replace(legacyBaselineCheck, incrementalBaselineCheck);
		e.exec(`CREATE TABLE ${t} ${o};
      INSERT INTO ${t} (rowid, ${a}) SELECT rowid, ${a} FROM ${i};
      DROP TABLE ${i};
      ALTER TABLE ${t} RENAME TO ${i};`);
		for (const t of [...n.indexDefinitions.values(), ...n.triggers.values()]) if (t.table === projectionTable && typeof t.sql === "string") e.exec(t.sql);
	} else if (!r.includes(incrementalBaselineCheck)) throw new Error("Local workspace baseline constraint is not recognized; preserve it for Doctor");
	e.exec(extractSqliteTableSchema(OPENCLAW_STATE_SCHEMA_SQL, nodeTable));
	return true;
}
const stateLocalWorkspaceManifestMigration = {
	version: 31,
	tables: [projectionTable, nodeTable],
	columns: [`${projectionTable}.checkpoint_json`],
	migrate: migrateLocalWorkspaceManifests,
	applied: "Prepared resumable per-path local workspace baselines and checkpoint deltas (v31)"
};
/** Keep exact predecessor declarations for SQLite admission and PostgreSQL backups. */
function withLegacyLocalWorkspaceManifests(e) {
	return withLegacyLocalWorkspaceCas(e).replace(/\n {2}(?:checkpoint_json TEXT|"checkpoint_json" text COLLATE "C"),/gu, "").replace(/^ {2}CHECK \([^\n]*baseline_json[^\n]*baseline_ref[^\n]*\),$/gmu, (e) => e.includes("\"") ? "  CHECK (((\"baseline_json\" IS NULL) = (\"baseline_ref\" IS NULL)))," : `  ${legacyBaselineCheck},`).replace(/CREATE TABLE(?: IF NOT EXISTS)? "?local_workspace_manifest_nodes"? \([\s\S]*?\n\)(?: STRICT)?;\n?/gu, "").replace(/ALTER TABLE "local_workspace_manifest_nodes" ADD FOREIGN KEY[^;]*;\n?/gu, "");
}
//#endregion
//#region src/state/openclaw-state-postgres-admission.ts
/** Callers own replay safety; retries require a settled PostgreSQL transaction. */
function withPostgresSchemaAdmissionRetry(e, t, n) {
	try {
		return t();
	} catch (r) {
		if (!(r instanceof PostgresSchemaAdmissionUnavailableError) || !isPostgresSqlConnection(e) || n?.() === false || !e.isOpen || e.isTransaction) throw r;
		const i = Math.min(Date.now() + 1e3, readSqliteDatabaseAdmissionDeadline() ?? Infinity);
		const a = performance.now() + Math.max(0, i - Date.now());
		const o = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
		return withSqliteDatabaseAdmissionWait({ deadlineAtMs: i }, () => {
			for (let s = 10;; s = Math.min(s * 2, 100)) {
				assertSqliteDatabaseAdmissionWaitActive();
				const c = Math.min(a - performance.now(), i - Date.now());
				if (c <= 0) throw r;
				Atomics.wait(o, 0, 0, Math.min(s, c));
				assertSqliteDatabaseAdmissionWaitActive();
				if (performance.now() >= a || Date.now() >= i) throw r;
				if (n?.() === false || !e.isOpen || e.isTransaction) throw r;
				try {
					if (!getPostgresPhysicalFacts(e, { refresh: true })) continue;
					return t();
				} catch (t) {
					if (t instanceof SqliteDatabaseAdmissionTimeoutError && (performance.now() >= a || Date.now() >= i)) throw r;
					if (!(t instanceof PostgresSchemaAdmissionUnavailableError) || n?.() === false || !e.isOpen || e.isTransaction) throw t;
				}
			}
		});
	}
}
//#endregion
//#region src/state/openclaw-state-schema-publication.ts
const TERMINAL_GRACE_MS = 3e5;
/** Only the 2026.9.2 release line reopens the ledger without the transaction fence. */
function isUnfencedUpdateDriver(e) {
	const t = typeof e === "string" ? parse(e) : null;
	return t !== null && `${t.major}.${t.minor}.${t.patch}` === "2026.9.2";
}
/** Every unfenced driver must clear its own deadline; a newer run cannot hide an older one. */
function readStateSchemaPublicationBlocker(e, t = Date.now()) {
	if (!tableExists(e, "update_runs")) return;
	const n = executeSqliteQuerySync(e, getNodeSqliteKysely(e).selectFrom("update_runs").select([
		"run_id",
		"before_json",
		"status",
		"updated_at_ms",
		"finished_at_ms"
	]).where((e) => e.or([e.and([e("status", "=", "running"), e("updated_at_ms", ">=", t - ABANDONED_UPDATE_RUN_MS)]), e.and([e("status", "!=", "running"), e.or([e("finished_at_ms", ">", t - TERMINAL_GRACE_MS), e("finished_at_ms", "is", null)])])])).orderBy("run_id")).rows;
	let r;
	for (const e of n) {
		const t = JSON.parse(e.before_json);
		if (!isRecord(t) || typeof t.version !== "string" || !isUnfencedUpdateDriver(t.version)) continue;
		const n = e.status === "running" ? e.updated_at_ms + ABANDONED_UPDATE_RUN_MS + 1 : e.finished_at_ms === null ? null : e.finished_at_ms + TERMINAL_GRACE_MS;
		if (!r || n === null || r.publishAfterMs !== null && n > r.publishAfterMs) r = {
			runId: e.run_id,
			updaterVersion: t.version,
			publishAfterMs: n
		};
	}
	return r;
}
/** Called inside the schema write transaction, after all content migrations succeed. */
function resolveStateSchemaVersionToPublish(e) {
	const t = readSqliteUserVersion(e);
	if (t >= 36 || !readStateSchemaPublicationBlocker(e)) return 36;
	if (!tableExists(e, "config_machine_state")) throw new Error("Shared state schema publication cannot be deferred without config_machine_state.");
	writeStateSchemaContentVersion(e);
	invalidateSqliteSchemaFacts(e);
	return t;
}
/** Persist the content marker inside the schema owner's transaction. */
function writeStateSchemaContentVersion(e) {
	executeSqliteQuerySync(e, getNodeSqliteKysely(e).insertInto("config_machine_state").values({
		state_key: CONTENT_VERSION_KEY,
		value_json: String(36),
		updated_at_ms: Date.now()
	}).onConflict((e) => e.column("state_key").doUpdateSet({
		value_json: String(36),
		updated_at_ms: Date.now()
	}).where("config_machine_state.value_json", "!=", String(36))));
}
/** Advance an existing migration marker without changing its original timestamp. */
function advanceStateSchemaContentVersion(e, t) {
	executeSqliteQuerySync(e, getNodeSqliteKysely(e).updateTable("config_machine_state").set({ value_json: String(t.toVersion) }).where("state_key", "=", CONTENT_VERSION_KEY).where("value_json", "=", String(t.fromVersion)));
}
//#endregion
//#region src/state/postgres-schema.generated/runtime.ts
const statePostgresRuntime = {
	eagerSql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"acp_replay_events\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"seq\" bigint NOT NULL,\n  \"at\" bigint NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\",\n  \"update_json\" text COLLATE \"C\" NOT NULL,\n  \"estimated_bytes\" bigint NOT NULL DEFAULT 0,\n  PRIMARY KEY (\"session_id\", \"seq\")\n);\n\nCREATE TABLE \"acp_replay_sessions\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"cwd\" text COLLATE \"C\" NOT NULL,\n  \"complete\" bigint NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  \"next_seq\" bigint NOT NULL,\n  \"estimated_bytes\" bigint NOT NULL DEFAULT 0,\n  PRIMARY KEY (\"session_id\")\n);\n\nCREATE TABLE \"acp_sessions\" (\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\",\n  \"backend\" text COLLATE \"C\" NOT NULL,\n  \"agent\" text COLLATE \"C\" NOT NULL,\n  \"runtime_session_name\" text COLLATE \"C\" NOT NULL,\n  \"identity_json\" text COLLATE \"C\",\n  \"resume_agent_session_id\" text COLLATE \"C\",\n  \"resume_acpx_session_id\" text COLLATE \"C\",\n  \"mode\" text COLLATE \"C\" NOT NULL,\n  \"runtime_options_json\" text COLLATE \"C\",\n  \"cwd\" text COLLATE \"C\",\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"last_activity_at\" bigint NOT NULL,\n  \"last_error\" text COLLATE \"C\",\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"session_key\")\n);\n\nCREATE TABLE \"agent_database_leases\" (\n  \"lease_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"owner_pid\" bigint NOT NULL,\n  \"owner_start_time\" bigint,\n  \"opened_at\" bigint NOT NULL,\n  \"provenance\" text COLLATE \"C\",\n  PRIMARY KEY (\"lease_id\")\n);\n\nCREATE TABLE \"agent_databases\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" bigint NOT NULL,\n  \"last_seen_at\" bigint NOT NULL,\n  \"size_bytes\" bigint,\n  PRIMARY KEY (\"agent_id\", \"path\")\n);\n\nCREATE TABLE \"apns_registration_tombstones\" (\n  \"node_id\" text COLLATE \"C\" NOT NULL,\n  \"deleted_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"node_id\")\n);\n\nCREATE TABLE \"apns_registrations\" (\n  \"node_id\" text COLLATE \"C\" NOT NULL,\n  \"transport\" text COLLATE \"C\" NOT NULL,\n  \"token\" text COLLATE \"C\",\n  \"relay_handle\" text COLLATE \"C\",\n  \"send_grant\" text COLLATE \"C\",\n  \"installation_id\" text COLLATE \"C\",\n  \"relay_origin\" text COLLATE \"C\",\n  \"topic\" text COLLATE \"C\" NOT NULL,\n  \"environment\" text COLLATE \"C\" NOT NULL,\n  \"distribution\" text COLLATE \"C\",\n  \"token_debug_suffix\" text COLLATE \"C\",\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"node_id\")\n);\n\nCREATE TABLE \"audit_events\" (\n  \"sequence\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"event_id\" text COLLATE \"C\" NOT NULL,\n  \"source_id\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" bigint NOT NULL DEFAULT 1,\n  \"source_sequence\" bigint NOT NULL,\n  \"occurred_at\" bigint NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"action\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"error_code\" text COLLATE \"C\",\n  \"actor_type\" text COLLATE \"C\" NOT NULL,\n  \"actor_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\",\n  \"session_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"tool_call_id\" text COLLATE \"C\",\n  \"tool_name\" text COLLATE \"C\",\n  \"direction\" text COLLATE \"C\",\n  \"channel\" text COLLATE \"C\",\n  \"conversation_kind\" text COLLATE \"C\",\n  \"message_outcome\" text COLLATE \"C\",\n  \"reason_code\" text COLLATE \"C\",\n  \"delivery_kind\" text COLLATE \"C\",\n  \"failure_stage\" text COLLATE \"C\",\n  \"duration_ms\" bigint,\n  \"result_count\" bigint,\n  \"account_ref\" text COLLATE \"C\",\n  \"conversation_ref\" text COLLATE \"C\",\n  \"message_ref\" text COLLATE \"C\",\n  \"target_ref\" text COLLATE \"C\",\n  PRIMARY KEY (\"sequence\"),\n  UNIQUE (\"event_id\"),\n  UNIQUE (\"source_id\")\n);\n\nCREATE TABLE \"audit_identity_keys\" (\n  \"id\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"key_id\" text COLLATE \"C\" NOT NULL,\n  \"key\" bytea NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  PRIMARY KEY (\"id\"),\n  CHECK ((\"id\" = 1))\n);\n\nCREATE TABLE \"backup_runs\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"archive_path\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"manifest_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"id\")\n);\n\nCREATE TABLE \"capture_blobs\" (\n  \"blob_id\" text COLLATE \"C\" NOT NULL,\n  \"content_type\" text COLLATE \"C\",\n  \"encoding\" text COLLATE \"C\" NOT NULL,\n  \"size_bytes\" bigint NOT NULL,\n  \"sha256\" text COLLATE \"C\" NOT NULL,\n  \"data\" bytea NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  PRIMARY KEY (\"blob_id\")\n);\n\nCREATE TABLE \"capture_events\" (\n  \"id\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"ts\" bigint NOT NULL,\n  \"source_scope\" text COLLATE \"C\" NOT NULL,\n  \"source_process\" text COLLATE \"C\" NOT NULL,\n  \"protocol\" text COLLATE \"C\" NOT NULL,\n  \"direction\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"flow_id\" text COLLATE \"C\" NOT NULL,\n  \"method\" text COLLATE \"C\",\n  \"host\" text COLLATE \"C\",\n  \"path\" text COLLATE \"C\",\n  \"status\" bigint,\n  \"close_code\" bigint,\n  \"content_type\" text COLLATE \"C\",\n  \"headers_json\" text COLLATE \"C\",\n  \"data_text\" text COLLATE \"C\",\n  \"data_blob_id\" text COLLATE \"C\",\n  \"data_sha256\" text COLLATE \"C\",\n  \"error_text\" text COLLATE \"C\",\n  \"meta_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"id\")\n);\n\nCREATE TABLE \"capture_sessions\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"started_at\" bigint NOT NULL,\n  \"ended_at\" bigint,\n  \"mode\" text COLLATE \"C\" NOT NULL,\n  \"source_scope\" text COLLATE \"C\" NOT NULL,\n  \"source_process\" text COLLATE \"C\" NOT NULL,\n  \"proxy_url\" text COLLATE \"C\",\n  PRIMARY KEY (\"id\")\n);\n\nCREATE TABLE \"channel_ingress_events\" (\n  \"queue_name\" text COLLATE \"C\" NOT NULL,\n  \"event_id\" text COLLATE \"C\" NOT NULL,\n  \"channel_id\" text COLLATE \"C\" NOT NULL,\n  \"account_id\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"lane_key\" text COLLATE \"C\",\n  \"payload_json\" text COLLATE \"C\" NOT NULL,\n  \"metadata_json\" text COLLATE \"C\",\n  \"received_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  \"claim_token\" text COLLATE \"C\",\n  \"claim_owner\" text COLLATE \"C\",\n  \"claimed_at\" bigint,\n  \"attempts\" bigint NOT NULL DEFAULT 0,\n  \"last_attempt_at\" bigint,\n  \"last_error\" text COLLATE \"C\",\n  \"failed_reason\" text COLLATE \"C\",\n  \"failed_at\" bigint,\n  \"completed_at\" bigint,\n  \"completed_metadata_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"queue_name\", \"event_id\")\n);\n\nCREATE TABLE \"channel_pairing_allow_entries\" (\n  \"channel_key\" text COLLATE \"C\" NOT NULL,\n  \"account_id\" text COLLATE \"C\" NOT NULL,\n  \"entry\" text COLLATE \"C\" NOT NULL,\n  \"sort_order\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"channel_key\", \"account_id\", \"entry\")\n);\n\nCREATE TABLE \"channel_pairing_requests\" (\n  \"channel_key\" text COLLATE \"C\" NOT NULL,\n  \"account_id\" text COLLATE \"C\" NOT NULL,\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"code\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" text COLLATE \"C\" NOT NULL,\n  \"last_seen_at\" text COLLATE \"C\" NOT NULL,\n  \"meta_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"channel_key\", \"account_id\", \"request_id\")\n);\n\nCREATE TABLE \"clawhub_promotion_claims\" (\n  \"slug\" text COLLATE \"C\" NOT NULL,\n  \"provider\" text COLLATE \"C\",\n  \"model_keys_json\" text COLLATE \"C\" NOT NULL,\n  \"ends_at_ms\" bigint NOT NULL,\n  \"claimed_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"slug\")\n);\n\nCREATE TABLE \"config_health_entries\" (\n  \"config_path\" text COLLATE \"C\" NOT NULL,\n  \"last_known_good_json\" text COLLATE \"C\",\n  \"last_promoted_good_json\" text COLLATE \"C\",\n  \"last_observed_suspicious_signature\" text COLLATE \"C\",\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"config_path\")\n);\n\nCREATE TABLE \"config_machine_state\" (\n  \"state_key\" text COLLATE \"C\" NOT NULL,\n  \"value_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"state_key\")\n);\n\nCREATE TABLE \"cron_job_scratch\" (\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"job_id\" text COLLATE \"C\" NOT NULL,\n  \"content\" text COLLATE \"C\",\n  \"revision\" bigint NOT NULL,\n  \"source_sha256\" text COLLATE \"C\",\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"store_key\", \"job_id\"),\n  CHECK ((\"revision\" >= 1)),\n  CHECK (\"content\" IS NULL OR (octet_length(convert_to(\"content\", 'UTF8')) <= 262144))\n);\n\nCREATE TABLE \"cron_jobs\" (\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"job_id\" text COLLATE \"C\" NOT NULL,\n  \"declaration_key\" text COLLATE \"C\",\n  \"owner_agent_id\" text COLLATE \"C\",\n  \"name\" text COLLATE \"C\" NOT NULL,\n  \"description\" text COLLATE \"C\",\n  \"enabled\" bigint NOT NULL,\n  \"agent_id\" text COLLATE \"C\",\n  \"payload_kind\" text COLLATE \"C\" NOT NULL,\n  \"job_json\" text COLLATE \"C\" NOT NULL,\n  \"grant_definition_revision\" text COLLATE \"C\",\n  \"grant_definition_generation\" bigint,\n  \"grant_definition_updated_at\" bigint,\n  \"state_json\" text COLLATE \"C\" NOT NULL DEFAULT '{}',\n  \"runtime_updated_at_ms\" bigint,\n  \"schedule_identity\" text COLLATE \"C\",\n  \"sort_order\" bigint NOT NULL DEFAULT 0,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"store_key\", \"job_id\")\n);\n\nCREATE TABLE \"current_conversation_bindings\" (\n  \"binding_key\" text COLLATE \"C\" NOT NULL,\n  \"binding_id\" text COLLATE \"C\" NOT NULL,\n  \"target_session_key\" text COLLATE \"C\" NOT NULL,\n  \"channel\" text COLLATE \"C\" NOT NULL,\n  \"account_id\" text COLLATE \"C\" NOT NULL,\n  \"conversation_kind\" text COLLATE \"C\" NOT NULL,\n  \"parent_conversation_id\" text COLLATE \"C\",\n  \"conversation_id\" text COLLATE \"C\" NOT NULL,\n  \"target_kind\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"bound_at\" bigint NOT NULL,\n  \"expires_at\" bigint,\n  \"metadata_json\" text COLLATE \"C\",\n  \"record_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"binding_key\")\n);\n\nCREATE TABLE \"delivery_queue_entries\" (\n  \"queue_name\" text COLLATE \"C\" NOT NULL,\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"entry_kind\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\",\n  \"channel\" text COLLATE \"C\",\n  \"target\" text COLLATE \"C\",\n  \"account_id\" text COLLATE \"C\",\n  \"retry_count\" bigint NOT NULL DEFAULT 0,\n  \"last_attempt_at\" bigint,\n  \"last_error\" text COLLATE \"C\",\n  \"recovery_state\" text COLLATE \"C\",\n  \"platform_send_started_at\" bigint,\n  \"entry_json\" text COLLATE \"C\" NOT NULL,\n  \"retention_id_prefix\" text COLLATE \"C\",\n  \"retention_max_age_ms\" bigint,\n  \"retention_max_entries\" bigint,\n  \"enqueued_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  \"failed_at\" bigint,\n  PRIMARY KEY (\"queue_name\", \"id\")\n);\n\nCREATE TABLE \"device_bootstrap_tokens\" (\n  \"token_key\" text COLLATE \"C\" NOT NULL,\n  \"token\" text COLLATE \"C\" NOT NULL,\n  \"setup_id\" text COLLATE \"C\",\n  \"ts\" bigint NOT NULL,\n  \"device_id\" text COLLATE \"C\",\n  \"public_key\" text COLLATE \"C\",\n  \"profile_json\" text COLLATE \"C\",\n  \"redeemed_profile_json\" text COLLATE \"C\",\n  \"pending_profile_json\" text COLLATE \"C\",\n  \"issued_at_ms\" bigint NOT NULL,\n  \"last_used_at_ms\" bigint,\n  PRIMARY KEY (\"token_key\")\n);\n\nCREATE TABLE \"device_pairing_paired\" (\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"public_key\" text COLLATE \"C\" NOT NULL,\n  \"display_name\" text COLLATE \"C\",\n  \"operator_label\" text COLLATE \"C\",\n  \"platform\" text COLLATE \"C\",\n  \"device_family\" text COLLATE \"C\",\n  \"client_id\" text COLLATE \"C\",\n  \"client_mode\" text COLLATE \"C\",\n  \"browser_origin\" text COLLATE \"C\",\n  \"role\" text COLLATE \"C\",\n  \"roles_json\" text COLLATE \"C\",\n  \"scopes_json\" text COLLATE \"C\",\n  \"approved_scopes_json\" text COLLATE \"C\",\n  \"remote_ip\" text COLLATE \"C\",\n  \"tokens_json\" text COLLATE \"C\",\n  \"approved_via\" text COLLATE \"C\",\n  \"node_surface_json\" text COLLATE \"C\",\n  \"pending_node_surface_json\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"approved_at_ms\" bigint NOT NULL,\n  \"last_seen_at_ms\" bigint,\n  \"last_seen_reason\" text COLLATE \"C\",\n  PRIMARY KEY (\"device_id\")\n);\n\nCREATE TABLE \"device_pairing_pending\" (\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"public_key\" text COLLATE \"C\" NOT NULL,\n  \"display_name\" text COLLATE \"C\",\n  \"platform\" text COLLATE \"C\",\n  \"device_family\" text COLLATE \"C\",\n  \"client_id\" text COLLATE \"C\",\n  \"client_mode\" text COLLATE \"C\",\n  \"browser_origin\" text COLLATE \"C\",\n  \"role\" text COLLATE \"C\",\n  \"roles_json\" text COLLATE \"C\",\n  \"scopes_json\" text COLLATE \"C\",\n  \"remote_ip\" text COLLATE \"C\",\n  \"silent\" bigint,\n  \"is_repair\" bigint,\n  \"ts\" bigint NOT NULL,\n  \"refreshed_at_ms\" bigint,\n  PRIMARY KEY (\"request_id\")\n);\n\nCREATE TABLE \"diagnostic_events\" (\n  \"scope\" text COLLATE \"C\" NOT NULL,\n  \"event_key\" text COLLATE \"C\" NOT NULL,\n  \"payload_json\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"sequence\" bigint NOT NULL DEFAULT 0,\n  PRIMARY KEY (\"scope\", \"event_key\")\n);\n\nCREATE TABLE \"exec_approvals_config\" (\n  \"config_key\" text COLLATE \"C\" NOT NULL,\n  \"raw_json\" text COLLATE \"C\" NOT NULL,\n  \"socket_path\" text COLLATE \"C\",\n  \"has_socket_token\" bigint NOT NULL,\n  \"default_security\" text COLLATE \"C\",\n  \"default_ask\" text COLLATE \"C\",\n  \"default_ask_fallback\" text COLLATE \"C\",\n  \"auto_allow_skills\" bigint,\n  \"agent_count\" bigint NOT NULL,\n  \"allowlist_count\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"config_key\")\n);\n\nCREATE TABLE \"flow_runs\" (\n  \"flow_id\" text COLLATE \"C\" NOT NULL,\n  \"shape\" text COLLATE \"C\",\n  \"sync_mode\" text COLLATE \"C\" NOT NULL DEFAULT 'managed',\n  \"owner_key\" text COLLATE \"C\" NOT NULL,\n  \"requester_origin_json\" text COLLATE \"C\",\n  \"controller_id\" text COLLATE \"C\",\n  \"revision\" bigint NOT NULL DEFAULT 0,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"notify_policy\" text COLLATE \"C\" NOT NULL,\n  \"goal\" text COLLATE \"C\" NOT NULL,\n  \"current_step\" text COLLATE \"C\",\n  \"blocked_task_id\" text COLLATE \"C\",\n  \"blocked_summary\" text COLLATE \"C\",\n  \"state_json\" text COLLATE \"C\",\n  \"wait_json\" text COLLATE \"C\",\n  \"cancel_requested_at\" bigint,\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  \"ended_at\" bigint,\n  PRIMARY KEY (\"flow_id\")\n);\n\nCREATE TABLE \"gateway_boot_lifecycle\" (\n  \"boot_id\" text COLLATE \"C\" NOT NULL,\n  \"pid\" bigint NOT NULL,\n  \"started_at_ms\" bigint NOT NULL,\n  \"completed_at_ms\" bigint,\n  \"outcome\" text COLLATE \"C\",\n  \"startup_reason\" text COLLATE \"C\",\n  \"reason\" text COLLATE \"C\",\n  PRIMARY KEY (\"boot_id\")\n);\n\nCREATE TABLE \"gateway_restart_handoff\" (\n  \"handoff_key\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"version\" bigint NOT NULL,\n  \"intent_id\" text COLLATE \"C\" NOT NULL,\n  \"pid\" bigint NOT NULL,\n  \"process_instance_id\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"expires_at\" bigint NOT NULL,\n  \"reason\" text COLLATE \"C\",\n  \"restart_trace_started_at\" bigint,\n  \"restart_trace_last_at\" bigint,\n  \"source\" text COLLATE \"C\" NOT NULL,\n  \"restart_kind\" text COLLATE \"C\" NOT NULL,\n  \"supervisor_mode\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"handoff_key\")\n);\n\nCREATE TABLE \"gateway_restart_intent\" (\n  \"intent_key\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"pid\" bigint NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"reason\" text COLLATE \"C\",\n  \"force\" bigint,\n  \"wait_ms\" bigint,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"intent_key\")\n);\n\nCREATE TABLE \"gateway_restart_sentinel\" (\n  \"sentinel_key\" text COLLATE \"C\" NOT NULL,\n  \"version\" bigint NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"ts\" bigint NOT NULL,\n  \"session_key\" text COLLATE \"C\",\n  \"thread_id\" text COLLATE \"C\",\n  \"delivery_channel\" text COLLATE \"C\",\n  \"delivery_to\" text COLLATE \"C\",\n  \"delivery_account_id\" text COLLATE \"C\",\n  \"message\" text COLLATE \"C\",\n  \"continuation_json\" text COLLATE \"C\",\n  \"doctor_hint\" text COLLATE \"C\",\n  \"stats_json\" text COLLATE \"C\",\n  \"payload_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"sentinel_key\")\n);\n\nCREATE TABLE \"macos_port_guardian_records\" (\n  \"pid\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"port\" bigint NOT NULL,\n  \"command\" text COLLATE \"C\" NOT NULL,\n  \"mode\" text COLLATE \"C\" NOT NULL,\n  \"timestamp\" double precision NOT NULL,\n  PRIMARY KEY (\"pid\")\n);\n\nCREATE TABLE \"managed_outgoing_image_records\" (\n  \"attachment_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\",\n  \"message_id\" text COLLATE \"C\",\n  \"created_at\" text COLLATE \"C\" NOT NULL,\n  \"updated_at\" text COLLATE \"C\",\n  \"retention_class\" text COLLATE \"C\",\n  \"alt\" text COLLATE \"C\" NOT NULL,\n  \"original_media_root\" text COLLATE \"C\" NOT NULL,\n  \"original_media_id\" text COLLATE \"C\" NOT NULL,\n  \"original_media_subdir\" text COLLATE \"C\" NOT NULL,\n  \"original_content_type\" text COLLATE \"C\" NOT NULL,\n  \"original_width\" bigint,\n  \"original_height\" bigint,\n  \"original_size_bytes\" bigint,\n  \"original_filename\" text COLLATE \"C\",\n  \"record_json\" text COLLATE \"C\" NOT NULL,\n  \"cleanup_pending\" bigint NOT NULL DEFAULT 0,\n  PRIMARY KEY (\"attachment_id\"),\n  CHECK ((\"cleanup_pending\" IN (0, 1)))\n);\n\nCREATE TABLE \"mcp_oauth_stores\" (\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"format_version\" bigint NOT NULL,\n  \"store_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"store_key\"),\n  CHECK ((\"format_version\" = 1))\n);\n\nCREATE TABLE \"meeting_transcript_sessions\" (\n  \"started_at_ms\" bigint,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"started_at\" text COLLATE \"C\" NOT NULL,\n  \"selector\" text COLLATE \"C\" NOT NULL,\n  \"export_key\" text COLLATE \"C\" NOT NULL,\n  \"session_slug\" text COLLATE \"C\" NOT NULL,\n  \"provider_id\" text COLLATE \"C\" NOT NULL,\n  \"title\" text COLLATE \"C\",\n  \"source_json\" text COLLATE \"C\" NOT NULL,\n  \"source_account_id\" text COLLATE \"C\",\n  \"source_guild_id\" text COLLATE \"C\",\n  \"source_channel_id\" text COLLATE \"C\",\n  \"source_meeting_url\" text COLLATE \"C\",\n  \"source_thread_ts\" text COLLATE \"C\",\n  \"source_file_id\" text COLLATE \"C\",\n  \"stopped_at\" text COLLATE \"C\",\n  \"metadata_json\" text COLLATE \"C\",\n  \"metadata_agent_id\" text COLLATE \"C\",\n  \"export_manifest_json\" text COLLATE \"C\" NOT NULL DEFAULT '{}',\n  \"export_pending_json\" text COLLATE \"C\" NOT NULL DEFAULT '[]',\n  \"next_utterance_seq\" bigint NOT NULL DEFAULT 0,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\", \"started_at\"),\n  CHECK ((\"next_utterance_seq\" >= 0)),\n  CHECK ((\"created_at_ms\" >= 0)),\n  CHECK ((\"updated_at_ms\" >= 0)),\n  UNIQUE (\"selector\")\n);\n\nCREATE TABLE \"meeting_transcript_summaries\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_started_at\" text COLLATE \"C\" NOT NULL,\n  \"generated_at\" text COLLATE \"C\",\n  \"summary_json\" text COLLATE \"C\",\n  \"overview\" text COLLATE \"C\",\n  \"markdown\" text COLLATE \"C\",\n  \"utterance_count\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\", \"session_started_at\"),\n  CHECK ((\"utterance_count\" >= 0)),\n  CHECK (\"summary_json\" IS NOT NULL OR \"markdown\" IS NOT NULL)\n);\n\nCREATE TABLE \"meeting_transcript_utterances\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_started_at\" text COLLATE \"C\" NOT NULL,\n  \"sequence\" bigint NOT NULL,\n  \"utterance_id\" text COLLATE \"C\",\n  \"started_at\" text COLLATE \"C\",\n  \"ended_at\" text COLLATE \"C\",\n  \"speaker_id\" text COLLATE \"C\",\n  \"speaker_label\" text COLLATE \"C\",\n  \"text\" text COLLATE \"C\" NOT NULL,\n  \"final\" bigint,\n  \"metadata_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"session_id\", \"session_started_at\", \"sequence\"),\n  CHECK ((\"sequence\" >= 0)),\n  CHECK ((\"final\" IN (0, 1)))\n);\n\nCREATE TABLE \"migration_runs\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"started_at\" bigint NOT NULL,\n  \"finished_at\" bigint,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"report_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"id\")\n);\n\nCREATE TABLE \"migration_sources\" (\n  \"source_key\" text COLLATE \"C\" NOT NULL,\n  \"migration_kind\" text COLLATE \"C\" NOT NULL,\n  \"source_path\" text COLLATE \"C\" NOT NULL,\n  \"target_table\" text COLLATE \"C\" NOT NULL,\n  \"source_sha256\" text COLLATE \"C\",\n  \"source_size_bytes\" bigint,\n  \"source_record_count\" bigint,\n  \"last_run_id\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"imported_at\" bigint NOT NULL,\n  \"removed_source\" bigint NOT NULL DEFAULT 0,\n  \"report_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"source_key\")\n);\n\nCREATE TABLE \"native_hook_relay_bridges\" (\n  \"relay_id\" text COLLATE \"C\" NOT NULL,\n  \"pid\" bigint NOT NULL,\n  \"hostname\" text COLLATE \"C\" NOT NULL,\n  \"port\" bigint NOT NULL,\n  \"token\" text COLLATE \"C\" NOT NULL,\n  \"expires_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"relay_id\")\n);\n\nCREATE TABLE \"official_external_plugin_catalog_snapshots\" (\n  \"feed_url\" text COLLATE \"C\" NOT NULL,\n  \"body\" text COLLATE \"C\" NOT NULL,\n  \"status\" bigint NOT NULL,\n  \"etag\" text COLLATE \"C\",\n  \"last_modified\" text COLLATE \"C\",\n  \"checksum\" text COLLATE \"C\" NOT NULL,\n  \"saved_at\" text COLLATE \"C\" NOT NULL,\n  \"trust_mode\" text COLLATE \"C\",\n  \"trust_key_id\" text COLLATE \"C\",\n  \"trust_signature_count\" bigint,\n  \"trust_threshold\" bigint,\n  \"trust_verified_at\" text COLLATE \"C\",\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"feed_url\")\n);\n\nCREATE TABLE \"operator_approvals\" (\n  \"cursor_id\" bigint NOT NULL,\n  \"approval_id\" text COLLATE \"C\" NOT NULL,\n  \"resolution_ref\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"presentation_json\" text COLLATE \"C\" NOT NULL,\n  \"requested_by_device_id\" text COLLATE \"C\",\n  \"requested_by_client_id\" text COLLATE \"C\",\n  \"requested_by_device_token_auth\" bigint NOT NULL DEFAULT 0,\n  \"reviewer_device_ids_json\" text COLLATE \"C\" NOT NULL,\n  \"source_agent_id\" text COLLATE \"C\",\n  \"source_session_key\" text COLLATE \"C\",\n  \"source_session_id\" text COLLATE \"C\",\n  \"source_run_id\" text COLLATE \"C\",\n  \"source_tool_call_id\" text COLLATE \"C\",\n  \"source_tool_name\" text COLLATE \"C\",\n  \"audience_session_keys_json\" text COLLATE \"C\" NOT NULL,\n  \"runtime_epoch\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"expires_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"decision\" text COLLATE \"C\",\n  \"terminal_reason\" text COLLATE \"C\",\n  \"resolved_at_ms\" bigint,\n  \"resolver_kind\" text COLLATE \"C\",\n  \"resolver_id\" text COLLATE \"C\",\n  \"consumed_at_ms\" bigint,\n  \"consumed_by\" text COLLATE \"C\",\n  PRIMARY KEY (\"approval_id\"),\n  CHECK ((char_length(\"approval_id\") > 0) AND (\"approval_id\" NOT IN ('.', '..'))),\n  CHECK ((char_length(\"resolution_ref\") = 43) AND (\"resolution_ref\" COLLATE \"C\" !~ '\\A.*[^A-Za-z0-9_-].*\\Z')),\n  CHECK ((\"kind\" IN ('exec', 'plugin', 'system-agent'))),\n  CHECK ((\"status\" IN ('pending', 'allowed', 'denied', 'expired', 'cancelled'))),\n  CHECK ((\"decision\" IN ('allow-once', 'allow-always', 'deny'))),\n  CHECK ((\"terminal_reason\" IN ('user', 'timeout', 'malformed-verdict', 'no-route', 'run-aborted', 'gateway-restart', 'storage-corrupt'))),\n  CHECK ((\"resolver_kind\" IN ('device', 'channel', 'runtime', 'system'))),\n  CHECK ((\"expires_at_ms\" >= \"created_at_ms\")),\n  CHECK ((\"updated_at_ms\" >= \"created_at_ms\")),\n  CHECK (\"resolved_at_ms\" IS NULL OR (\"resolved_at_ms\" >= \"created_at_ms\")),\n  CHECK (\"resolved_at_ms\" IS NULL OR (\"resolved_at_ms\" <= \"updated_at_ms\")),\n  CHECK (\"consumed_at_ms\" IS NULL OR (\"consumed_at_ms\" >= \"resolved_at_ms\")),\n  CHECK (\"consumed_at_ms\" IS NULL OR (\"consumed_at_ms\" <= \"updated_at_ms\")),\n  CHECK ((\"requested_by_device_token_auth\" IN (0, 1))),\n  CHECK (((\"status\" = 'pending') AND \"decision\" IS NULL AND \"terminal_reason\" IS NULL AND \"resolved_at_ms\" IS NULL AND \"resolver_kind\" IS NULL AND \"resolver_id\" IS NULL AND \"consumed_at_ms\" IS NULL AND \"consumed_by\" IS NULL) OR ((\"status\" = 'allowed') AND (\"decision\" IN ('allow-once', 'allow-always')) AND (\"terminal_reason\" = 'user') AND \"resolved_at_ms\" IS NOT NULL AND \"resolver_kind\" IS NOT NULL) OR ((\"status\" = 'denied') AND (\"decision\" = 'deny') AND (\"terminal_reason\" IN ('user', 'malformed-verdict', 'no-route', 'storage-corrupt')) AND \"resolved_at_ms\" IS NOT NULL AND \"resolver_kind\" IS NOT NULL AND \"consumed_at_ms\" IS NULL AND \"consumed_by\" IS NULL) OR ((\"status\" = 'expired') AND (\"decision\" = 'deny') AND (\"terminal_reason\" = 'timeout') AND \"resolved_at_ms\" IS NOT NULL AND \"resolver_kind\" IS NOT NULL AND \"consumed_at_ms\" IS NULL AND \"consumed_by\" IS NULL) OR ((\"status\" = 'cancelled') AND (\"decision\" = 'deny') AND (\"terminal_reason\" IN ('run-aborted', 'gateway-restart')) AND \"resolved_at_ms\" IS NOT NULL AND \"resolver_kind\" IS NOT NULL AND \"consumed_at_ms\" IS NULL AND \"consumed_by\" IS NULL)),\n  CHECK ((\"consumed_at_ms\" IS NULL AND \"consumed_by\" IS NULL) OR ((\"status\" = 'allowed') AND (\"decision\" = 'allow-once') AND \"consumed_at_ms\" IS NOT NULL AND \"consumed_by\" IS NOT NULL))\n);\n\nCREATE TABLE \"outbound_media_provenance\" (\n  \"realpath\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"version\" bigint NOT NULL,\n  \"sha256\" text COLLATE \"C\" NOT NULL,\n  \"size_bytes\" bigint NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"realpath\")\n);\n\nCREATE TABLE \"plugin_binding_approvals\" (\n  \"plugin_root\" text COLLATE \"C\" NOT NULL,\n  \"channel\" text COLLATE \"C\" NOT NULL,\n  \"account_id\" text COLLATE \"C\" NOT NULL,\n  \"plugin_id\" text COLLATE \"C\" NOT NULL,\n  \"plugin_name\" text COLLATE \"C\",\n  \"approved_at\" bigint NOT NULL,\n  PRIMARY KEY (\"plugin_root\", \"channel\", \"account_id\")\n);\n\nCREATE TABLE \"plugin_blob_entries\" (\n  \"plugin_id\" text COLLATE \"C\" NOT NULL,\n  \"namespace\" text COLLATE \"C\" NOT NULL,\n  \"entry_key\" text COLLATE \"C\" NOT NULL,\n  \"metadata_json\" text COLLATE \"C\" NOT NULL,\n  \"blob\" bytea NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"expires_at\" bigint,\n  PRIMARY KEY (\"plugin_id\", \"namespace\", \"entry_key\")\n);\n\nCREATE TABLE \"plugin_state_entries\" (\n  \"plugin_id\" text COLLATE \"C\" NOT NULL,\n  \"namespace\" text COLLATE \"C\" NOT NULL,\n  \"entry_key\" text COLLATE \"C\" NOT NULL,\n  \"value_json\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"expires_at\" bigint,\n  PRIMARY KEY (\"plugin_id\", \"namespace\", \"entry_key\")\n);\n\nCREATE TABLE \"sandbox_registry_entries\" (\n  \"registry_kind\" text COLLATE \"C\" NOT NULL,\n  \"container_name\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\",\n  \"backend_id\" text COLLATE \"C\",\n  \"runtime_label\" text COLLATE \"C\",\n  \"image\" text COLLATE \"C\",\n  \"created_at_ms\" bigint,\n  \"last_used_at_ms\" bigint,\n  \"config_label_kind\" text COLLATE \"C\",\n  \"config_hash\" text COLLATE \"C\",\n  \"cdp_port\" bigint,\n  \"no_vnc_port\" bigint,\n  \"entry_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"registry_kind\", \"container_name\")\n);\n\nCREATE TABLE \"schema_meta\" (\n  \"meta_key\" text COLLATE \"C\" NOT NULL,\n  \"role\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" bigint NOT NULL,\n  \"agent_id\" text COLLATE \"C\",\n  \"app_version\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"meta_key\")\n);\n\nCREATE TABLE \"session_groups\" (\n  \"name\" text COLLATE \"C\" NOT NULL,\n  \"position\" bigint NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"cwd\" text COLLATE \"C\",\n  \"worktree\" bigint,\n  PRIMARY KEY (\"name\")\n);\n\nCREATE TABLE \"session_state_events\" (\n  \"sequence\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"dedupe_key\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\",\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"actor_type\" text COLLATE \"C\" NOT NULL,\n  \"actor_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"occurred_at\" bigint NOT NULL,\n  \"summary\" text COLLATE \"C\" NOT NULL,\n  \"payload_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"sequence\"),\n  UNIQUE (\"dedupe_key\")\n);\n\nCREATE TABLE \"session_state_heads\" (\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"last_sequence\" bigint NOT NULL,\n  \"pruned_max_sequence\" bigint NOT NULL DEFAULT 0,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"session_key\", \"agent_id\")\n);\n\nCREATE TABLE \"session_upstream_links\" (\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"catalog_id\" text COLLATE \"C\" NOT NULL,\n  \"host_id\" text COLLATE \"C\" NOT NULL,\n  \"thread_id\" text COLLATE \"C\" NOT NULL,\n  \"upstream_kind\" text COLLATE \"C\" NOT NULL,\n  \"upstream_ref_json\" text COLLATE \"C\",\n  \"last_marker_json\" text COLLATE \"C\",\n  \"last_scanned_at\" bigint,\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"session_key\", \"agent_id\")\n);\n\nCREATE TABLE \"session_watch_cursors\" (\n  \"watcher_session_key\" text COLLATE \"C\" NOT NULL,\n  \"watcher_store_path\" text COLLATE \"C\",\n  \"target_session_key\" text COLLATE \"C\" NOT NULL,\n  \"last_seen_sequence\" bigint NOT NULL DEFAULT 0,\n  \"notified_sequence\" bigint NOT NULL DEFAULT 0,\n  \"material_sequence\" bigint NOT NULL DEFAULT 0,\n  \"provenance\" text COLLATE \"C\" NOT NULL DEFAULT 'explicit',\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"watcher_session_key\", \"target_session_key\"),\n  CHECK ((\"provenance\" IN ('explicit', 'ambient-group')))\n);\n\nCREATE TABLE \"skill_upload_chunks\" (\n  \"upload_id\" text COLLATE \"C\" NOT NULL,\n  \"byte_offset\" bigint NOT NULL,\n  \"size_bytes\" bigint NOT NULL,\n  \"chunk_blob\" bytea NOT NULL,\n  PRIMARY KEY (\"upload_id\", \"byte_offset\"),\n  CHECK ((\"byte_offset\" >= 0)),\n  CHECK ((\"size_bytes\" > 0)),\n  CHECK ((octet_length(\"chunk_blob\") = \"size_bytes\"))\n);\n\nCREATE TABLE \"skill_uploads\" (\n  \"upload_id\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"slug\" text COLLATE \"C\" NOT NULL,\n  \"force\" bigint NOT NULL,\n  \"size_bytes\" bigint NOT NULL,\n  \"sha256\" text COLLATE \"C\",\n  \"actual_sha256\" text COLLATE \"C\",\n  \"received_bytes\" bigint NOT NULL,\n  \"archive_blob\" bytea NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"expires_at\" bigint NOT NULL,\n  \"committed\" bigint NOT NULL,\n  \"committed_at\" bigint,\n  \"idempotency_key_hash\" text COLLATE \"C\",\n  PRIMARY KEY (\"upload_id\"),\n  UNIQUE (\"idempotency_key_hash\")\n);\n\nCREATE TABLE \"skill_usage\" (\n  \"skill_file\" text COLLATE \"C\" NOT NULL,\n  \"skill_key\" text COLLATE \"C\" NOT NULL,\n  \"skill_name\" text COLLATE \"C\" NOT NULL,\n  \"skill_source\" text COLLATE \"C\" NOT NULL,\n  \"first_used_at_ms\" bigint NOT NULL,\n  \"last_used_at_ms\" bigint NOT NULL,\n  \"use_count\" bigint NOT NULL,\n  \"last_agent_id\" text COLLATE \"C\",\n  PRIMARY KEY (\"skill_file\")\n);\n\nCREATE TABLE \"state_leases\" (\n  \"scope\" text COLLATE \"C\" NOT NULL,\n  \"lease_key\" text COLLATE \"C\" NOT NULL,\n  \"owner\" text COLLATE \"C\" NOT NULL,\n  \"expires_at\" bigint,\n  \"heartbeat_at\" bigint,\n  \"payload_json\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"scope\", \"lease_key\")\n);\n\nCREATE TABLE \"subagent_runs\" (\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"child_session_key\" text COLLATE \"C\" NOT NULL,\n  \"controller_session_key\" text COLLATE \"C\",\n  \"controller_store_path\" text COLLATE \"C\",\n  \"requester_session_key\" text COLLATE \"C\" NOT NULL,\n  \"requester_store_path\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"payload_json\" text COLLATE \"C\" NOT NULL DEFAULT '{}',\n  PRIMARY KEY (\"run_id\")\n);\n\nCREATE TABLE \"task_delivery_state\" (\n  \"task_id\" text COLLATE \"C\" NOT NULL,\n  \"requester_origin_json\" text COLLATE \"C\",\n  \"last_notified_event_at\" bigint,\n  PRIMARY KEY (\"task_id\")\n);\n\nCREATE TABLE \"task_runs\" (\n  \"task_id\" text COLLATE \"C\" NOT NULL,\n  \"runtime\" text COLLATE \"C\" NOT NULL,\n  \"task_kind\" text COLLATE \"C\",\n  \"source_id\" text COLLATE \"C\",\n  \"requester_session_key\" text COLLATE \"C\",\n  \"owner_key\" text COLLATE \"C\" NOT NULL,\n  \"scope_kind\" text COLLATE \"C\" NOT NULL,\n  \"child_session_key\" text COLLATE \"C\",\n  \"parent_flow_id\" text COLLATE \"C\",\n  \"parent_task_id\" text COLLATE \"C\",\n  \"agent_id\" text COLLATE \"C\",\n  \"requester_agent_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"execution_owner_host\" text COLLATE \"C\",\n  \"execution_owner_pid\" bigint,\n  \"execution_owner_start_identity\" bigint,\n  \"label\" text COLLATE \"C\",\n  \"task\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"delivery_status\" text COLLATE \"C\" NOT NULL,\n  \"notify_policy\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"started_at\" bigint,\n  \"ended_at\" bigint,\n  \"last_event_at\" bigint,\n  \"cleanup_after\" bigint,\n  \"tool_use_count\" bigint,\n  \"last_tool_name\" text COLLATE \"C\",\n  \"error\" text COLLATE \"C\",\n  \"progress_summary\" text COLLATE \"C\",\n  \"terminal_summary\" text COLLATE \"C\",\n  \"terminal_outcome\" text COLLATE \"C\",\n  \"detail_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"task_id\")\n);\n\nCREATE TABLE \"template_cron_refs\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"manifest_id\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" text COLLATE \"C\" NOT NULL,\n  \"declaration_key\" text COLLATE \"C\" NOT NULL,\n  \"scheduler_job_id\" text COLLATE \"C\",\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"job_json\" text COLLATE \"C\" NOT NULL,\n  \"error\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\", \"manifest_id\"),\n  UNIQUE (\"declaration_key\"),\n  UNIQUE (\"scheduler_job_id\")\n);\n\nCREATE TABLE \"template_installs\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" text COLLATE \"C\" NOT NULL,\n  \"source_kind\" text COLLATE \"C\" NOT NULL,\n  \"template_name\" text COLLATE \"C\" NOT NULL,\n  \"template_version\" text COLLATE \"C\" NOT NULL,\n  \"package_root\" text COLLATE \"C\" NOT NULL,\n  \"manifest_path\" text COLLATE \"C\" NOT NULL,\n  \"integrity_kind\" text COLLATE \"C\" NOT NULL,\n  \"integrity\" text COLLATE \"C\" NOT NULL,\n  \"source_byte_length\" bigint NOT NULL,\n  \"manifest_schema_version\" bigint NOT NULL,\n  \"plan_integrity\" text COLLATE \"C\" NOT NULL,\n  \"workspace\" text COLLATE \"C\" NOT NULL,\n  \"agent_config_digest\" text COLLATE \"C\" NOT NULL,\n  \"agent_owned_paths_json\" text COLLATE \"C\" NOT NULL,\n  \"bootstrap_source_path\" text COLLATE \"C\",\n  \"bootstrap_content_digest\" text COLLATE \"C\",\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"added_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\"),\n  CHECK ((\"status\" IN ('pending', 'workspace_ready', 'config_committed', 'complete', 'partial'))),\n  UNIQUE (\"workspace\")\n);\n\nCREATE TABLE \"template_mcp_server_refs\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"name\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" text COLLATE \"C\" NOT NULL,\n  \"config_digest\" text COLLATE \"C\" NOT NULL,\n  \"relationship\" text COLLATE \"C\" NOT NULL,\n  \"origin\" text COLLATE \"C\" NOT NULL,\n  \"independent_owner\" bigint NOT NULL DEFAULT 0,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"error\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\", \"name\"),\n  CHECK ((\"relationship\" IN ('managed', 'referenced'))),\n  CHECK ((\"origin\" IN ('template-introduced', 'pre-existing'))),\n  CHECK ((\"independent_owner\" IN (0, 1)))\n);\n\nCREATE TABLE \"template_package_refs\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"package_kind\" text COLLATE \"C\" NOT NULL,\n  \"package_source\" text COLLATE \"C\" NOT NULL,\n  \"package_ref\" text COLLATE \"C\" NOT NULL,\n  \"package_version\" text COLLATE \"C\" NOT NULL,\n  \"package_integrity\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" text COLLATE \"C\" NOT NULL,\n  \"template_name\" text COLLATE \"C\" NOT NULL,\n  \"package_status\" text COLLATE \"C\" NOT NULL,\n  \"relationship\" text COLLATE \"C\" NOT NULL,\n  \"origin\" text COLLATE \"C\" NOT NULL,\n  \"independent_owner\" bigint NOT NULL,\n  \"extension_id\" text COLLATE \"C\",\n  \"extension_format\" text COLLATE \"C\",\n  \"extension_detected_format\" text COLLATE \"C\",\n  \"extension_mapped_json\" text COLLATE \"C\",\n  \"extension_unavailable_json\" text COLLATE \"C\",\n  \"extension_adapter_identity\" text COLLATE \"C\",\n  \"installed_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\", \"package_kind\", \"package_source\", \"package_ref\", \"package_version\"),\n  CHECK ((\"relationship\" IN ('managed', 'referenced'))),\n  CHECK ((\"origin\" IN ('template-introduced', 'pre-existing'))),\n  CHECK ((\"independent_owner\" IN (0, 1)))\n);\n\nCREATE TABLE \"template_workspace_files\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"target_path\" text COLLATE \"C\" NOT NULL,\n  \"schema_version\" text COLLATE \"C\" NOT NULL,\n  \"workspace\" text COLLATE \"C\" NOT NULL,\n  \"source_path\" text COLLATE \"C\" NOT NULL,\n  \"content_digest\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\", \"target_path\")\n);\n\nCREATE TABLE \"web_push_subscriptions\" (\n  \"endpoint_hash\" text COLLATE \"C\" NOT NULL,\n  \"subscription_id\" text COLLATE \"C\" NOT NULL,\n  \"endpoint\" text COLLATE \"C\" NOT NULL,\n  \"p256dh\" text COLLATE \"C\" NOT NULL,\n  \"auth\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\",\n  \"user_profile_id\" text COLLATE \"C\",\n  \"preferences_json\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"endpoint_hash\"),\n  UNIQUE (\"subscription_id\")\n);\n\nCREATE TABLE \"worker_environment_credentials\" (\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"credential_hash\" text COLLATE \"C\" NOT NULL,\n  \"bundle_hash\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\",\n  \"rpc_set_version\" bigint NOT NULL,\n  \"owner_epoch\" bigint NOT NULL,\n  \"expires_at_ms\" bigint NOT NULL,\n  \"delivered_at_ms\" bigint,\n  PRIMARY KEY (\"environment_id\"),\n  CHECK ((\"rpc_set_version\" >= 1)),\n  CHECK ((\"owner_epoch\" >= 0)),\n  CHECK ((\"expires_at_ms\" >= 0)),\n  CHECK ((\"delivered_at_ms\" >= 0)),\n  UNIQUE (\"credential_hash\")\n);\n\nCREATE TABLE \"worker_environments\" (\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"provider_id\" text COLLATE \"C\" NOT NULL,\n  \"profile_id\" text COLLATE \"C\" NOT NULL,\n  \"profile_snapshot_json\" text COLLATE \"C\" NOT NULL,\n  \"last_activated_at_ms\" bigint,\n  \"preparation_key\" text COLLATE \"C\",\n  \"preparation_purpose\" text COLLATE \"C\",\n  \"preparation_demand_at_ms\" bigint,\n  \"preparation_expires_at_ms\" bigint,\n  \"preparation_consumed_at_ms\" bigint,\n  \"provision_operation_id\" text COLLATE \"C\" NOT NULL,\n  \"lease_id\" text COLLATE \"C\",\n  \"node_setup_id\" text COLLATE \"C\",\n  \"node_device_id\" text COLLATE \"C\",\n  \"ssh_host\" text COLLATE \"C\",\n  \"ssh_port\" bigint,\n  \"ssh_user\" text COLLATE \"C\",\n  \"ssh_host_key\" text COLLATE \"C\",\n  \"ssh_key_ref_json\" text COLLATE \"C\",\n  \"desktop_json\" text COLLATE \"C\",\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"bootstrap_bundle_hash\" text COLLATE \"C\",\n  \"bootstrap_openclaw_version\" text COLLATE \"C\",\n  \"bootstrap_protocol_features_json\" text COLLATE \"C\",\n  \"bootstrap_install_kind\" text COLLATE \"C\",\n  \"owner_epoch\" bigint NOT NULL DEFAULT 0,\n  \"teardown_terminal_state\" text COLLATE \"C\",\n  \"attached_session_ids_json\" text COLLATE \"C\" NOT NULL DEFAULT '[]',\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"state_changed_at_ms\" bigint NOT NULL,\n  \"idle_since_at_ms\" bigint,\n  \"destroy_requested_at_ms\" bigint,\n  \"last_error\" text COLLATE \"C\",\n  \"shared_host\" bigint,\n  PRIMARY KEY (\"environment_id\"),\n  CHECK ((\"preparation_key\" IS NULL AND \"preparation_demand_at_ms\" IS NULL AND \"preparation_expires_at_ms\" IS NULL AND \"preparation_consumed_at_ms\" IS NULL) OR (\"preparation_key\" IS NOT NULL AND (char_length(\"preparation_key\") = 64) AND (\"preparation_key\" COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z') AND \"preparation_demand_at_ms\" IS NOT NULL AND (\"preparation_demand_at_ms\" BETWEEN 0 AND 9007199254740991) AND \"preparation_expires_at_ms\" IS NOT NULL AND (\"preparation_expires_at_ms\" > \"preparation_demand_at_ms\") AND (\"preparation_expires_at_ms\" <= 9007199254740991) AND (\"preparation_consumed_at_ms\" IS NULL OR ((\"preparation_consumed_at_ms\" >= \"preparation_demand_at_ms\") AND (\"preparation_consumed_at_ms\" < \"preparation_expires_at_ms\"))))),\n  CHECK (\"ssh_port\" IS NULL OR ((\"ssh_port\" >= 1) AND (\"ssh_port\" <= 65535))),\n  CHECK ((\"state\" IN ('requested', 'provisioning', 'bootstrapping', 'ready', 'attached', 'idle', 'draining', 'destroying', 'destroyed', 'failed', 'orphaned'))),\n  CHECK ((\"owner_epoch\" >= 0)),\n  CHECK ((\"teardown_terminal_state\" IN ('destroyed', 'failed'))),\n  UNIQUE (\"provision_operation_id\")\n);\n\nCREATE TABLE \"worker_inference_turns\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"run_epoch\" bigint NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"turn_id\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"request_hash\" text COLLATE \"C\" NOT NULL,\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"terminal_json\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\", \"run_epoch\", \"run_id\", \"turn_id\"),\n  CHECK ((\"run_epoch\" >= 0)),\n  CHECK ((\"state\" IN ('pending', 'terminal'))),\n  CHECK ((\"created_at_ms\" >= 0)),\n  CHECK ((\"updated_at_ms\" >= 0)),\n  CHECK (((\"state\" = 'pending') AND \"terminal_json\" IS NULL) OR ((\"state\" = 'terminal') AND \"terminal_json\" IS NOT NULL))\n);\n\nCREATE TABLE \"worker_session_placements\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"execution_mode\" text COLLATE \"C\",\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\",\n  \"transition_generation\" bigint NOT NULL DEFAULT 0,\n  \"active_owner_epoch\" bigint,\n  \"workspace_base_manifest_ref\" text COLLATE \"C\",\n  \"remote_workspace_dir\" text COLLATE \"C\",\n  \"worker_bundle_hash\" text COLLATE \"C\",\n  \"last_transcript_ack_cursor\" bigint,\n  \"last_live_event_ack_cursor\" bigint,\n  \"recovery_error\" text COLLATE \"C\",\n  \"turn_claim_owner\" text COLLATE \"C\",\n  \"turn_claim_id\" text COLLATE \"C\",\n  \"turn_claim_run_id\" text COLLATE \"C\",\n  \"turn_claim_generation\" bigint,\n  \"turn_claim_owner_epoch\" bigint,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"state_changed_at_ms\" bigint NOT NULL,\n  \"terminal_reason\" text COLLATE \"C\",\n  \"terminal_at_ms\" bigint,\n  PRIMARY KEY (\"session_id\"),\n  CHECK ((\"execution_mode\" IN ('worker-turn', 'remote-exec'))),\n  CHECK ((\"state\" IN ('local', 'requested', 'provisioning', 'syncing', 'starting', 'active', 'draining', 'reconciling', 'reclaimed', 'failed'))),\n  CHECK ((\"transition_generation\" >= 0)),\n  CHECK (\"active_owner_epoch\" IS NULL OR (\"active_owner_epoch\" >= 1)),\n  CHECK (\"last_transcript_ack_cursor\" IS NULL OR (\"last_transcript_ack_cursor\" >= 0)),\n  CHECK (\"last_live_event_ack_cursor\" IS NULL OR (\"last_live_event_ack_cursor\" >= 0)),\n  CHECK ((\"turn_claim_owner\" IN ('local', 'worker'))),\n  CHECK (\"turn_claim_generation\" IS NULL OR (\"turn_claim_generation\" >= 0)),\n  CHECK (\"turn_claim_owner_epoch\" IS NULL OR (\"turn_claim_owner_epoch\" >= 1)),\n  CHECK (((\"state\" IN ('local', 'requested')) AND \"environment_id\" IS NULL AND \"active_owner_epoch\" IS NULL AND \"workspace_base_manifest_ref\" IS NULL AND \"remote_workspace_dir\" IS NULL AND \"worker_bundle_hash\" IS NULL AND \"last_transcript_ack_cursor\" IS NULL AND \"last_live_event_ack_cursor\" IS NULL AND \"recovery_error\" IS NULL) OR (\"state\" IS NOT DISTINCT FROM 'provisioning' AND \"active_owner_epoch\" IS NULL AND \"workspace_base_manifest_ref\" IS NULL AND \"remote_workspace_dir\" IS NULL AND \"worker_bundle_hash\" IS NULL AND \"last_transcript_ack_cursor\" IS NULL AND \"last_live_event_ack_cursor\" IS NULL AND \"recovery_error\" IS NULL) OR (\"state\" IS NOT DISTINCT FROM 'syncing' AND \"environment_id\" IS NOT NULL AND \"active_owner_epoch\" IS NULL AND \"workspace_base_manifest_ref\" IS NULL AND \"remote_workspace_dir\" IS NULL AND \"worker_bundle_hash\" IS NOT NULL AND \"last_transcript_ack_cursor\" IS NULL AND \"last_live_event_ack_cursor\" IS NULL AND \"recovery_error\" IS NULL) OR (\"state\" IS NOT DISTINCT FROM 'starting' AND \"environment_id\" IS NOT NULL AND \"active_owner_epoch\" IS NULL AND \"workspace_base_manifest_ref\" IS NOT NULL AND \"remote_workspace_dir\" IS NOT NULL AND \"worker_bundle_hash\" IS NOT NULL AND \"last_transcript_ack_cursor\" IS NULL AND \"last_live_event_ack_cursor\" IS NULL AND \"recovery_error\" IS NULL) OR ((\"state\" IN ('active', 'draining', 'reconciling')) AND \"environment_id\" IS NOT NULL AND \"active_owner_epoch\" IS NOT NULL AND \"workspace_base_manifest_ref\" IS NOT NULL AND \"remote_workspace_dir\" IS NOT NULL AND \"worker_bundle_hash\" IS NOT NULL AND \"recovery_error\" IS NULL) OR (\"state\" IS NOT DISTINCT FROM 'reclaimed' AND \"environment_id\" IS NOT NULL AND \"active_owner_epoch\" IS NOT NULL AND \"workspace_base_manifest_ref\" IS NOT NULL AND \"remote_workspace_dir\" IS NOT NULL AND \"worker_bundle_hash\" IS NOT NULL AND \"recovery_error\" IS NULL AND \"turn_claim_owner\" IS NULL AND \"turn_claim_id\" IS NULL AND \"turn_claim_run_id\" IS NULL AND \"turn_claim_generation\" IS NULL AND \"turn_claim_owner_epoch\" IS NULL) OR (\"state\" IS NOT DISTINCT FROM 'failed' AND \"recovery_error\" IS NOT NULL)),\n  CHECK ((\"turn_claim_owner\" IS NULL AND \"turn_claim_id\" IS NULL AND \"turn_claim_run_id\" IS NULL AND \"turn_claim_generation\" IS NULL AND \"turn_claim_owner_epoch\" IS NULL) OR (\"turn_claim_owner\" IS NOT DISTINCT FROM 'local' AND \"turn_claim_id\" IS NOT NULL AND \"turn_claim_run_id\" IS NOT NULL AND \"turn_claim_generation\" IS NOT NULL AND \"turn_claim_owner_epoch\" IS NULL) OR (\"turn_claim_owner\" IS NOT DISTINCT FROM 'worker' AND \"turn_claim_id\" IS NOT NULL AND \"turn_claim_run_id\" IS NOT NULL AND \"turn_claim_generation\" IS NOT NULL AND \"turn_claim_owner_epoch\" IS NOT NULL)),\n  CHECK (\"turn_claim_owner\" IS NULL OR (\"turn_claim_owner\" IS NOT DISTINCT FROM 'local' AND ((\"state\" IN ('local', 'requested', 'failed')) OR ((\"state\" IN ('active', 'draining')) AND \"execution_mode\" IS NOT DISTINCT FROM 'remote-exec'))) OR (\"turn_claim_owner\" IS NOT DISTINCT FROM 'worker' AND (\"state\" IN ('active', 'draining')) AND (\"execution_mode\" IS NULL OR \"execution_mode\" IS NOT DISTINCT FROM 'worker-turn') AND \"turn_claim_owner_epoch\" IS NOT DISTINCT FROM \"active_owner_epoch\"))\n);\n\nCREATE TABLE \"worker_session_tool_operations\" (\n  \"source_session_id\" text COLLATE \"C\" NOT NULL,\n  \"source_claim_id\" text COLLATE \"C\" NOT NULL,\n  \"tool_call_id\" text COLLATE \"C\" NOT NULL,\n  \"tool_name\" text COLLATE \"C\" NOT NULL,\n  \"request_digest\" text COLLATE \"C\" NOT NULL,\n  \"operation_seed\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"child_session_key\" text COLLATE \"C\",\n  \"result_json\" text COLLATE \"C\",\n  \"gateway_instance_id\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"source_session_id\", \"source_claim_id\", \"tool_call_id\"),\n  CHECK ((\"tool_name\" IN ('sessions_spawn', 'sessions_send'))),\n  CHECK ((\"status\" IN ('running', 'succeeded', 'failed', 'unknown')))\n);\n\nCREATE TABLE \"worker_transcript_commit_heads\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"run_epoch\" bigint NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"next_seq\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\", \"run_epoch\"),\n  CHECK ((\"run_epoch\" >= 0)),\n  CHECK ((\"next_seq\" >= 1)),\n  CHECK ((\"updated_at_ms\" >= 0))\n);\n\nCREATE TABLE \"worker_transcript_commits\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"run_epoch\" bigint NOT NULL,\n  \"seq\" bigint NOT NULL,\n  \"request_hash\" text COLLATE \"C\" NOT NULL,\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"result_json\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\", \"run_epoch\", \"seq\"),\n  CHECK ((\"run_epoch\" >= 0)),\n  CHECK ((\"seq\" >= 1)),\n  CHECK ((\"state\" IN ('pending', 'terminal'))),\n  CHECK ((\"created_at_ms\" >= 0)),\n  CHECK ((\"updated_at_ms\" >= 0)),\n  CHECK (((\"state\" = 'pending') AND \"result_json\" IS NULL) OR ((\"state\" = 'terminal') AND \"result_json\" IS NOT NULL))\n);\n\nCREATE TABLE \"worker_turn_tool_authorities\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_epoch\" bigint NOT NULL,\n  \"placement_generation\" bigint NOT NULL,\n  \"claim_id\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"tool_names_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\"),\n  CHECK ((\"owner_epoch\" >= 1)),\n  CHECK ((\"placement_generation\" >= 0))\n);\n\nCREATE TABLE \"worker_workspace_pending_results\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_epoch\" bigint NOT NULL,\n  \"placement_generation\" bigint NOT NULL,\n  \"claim_id\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"gateway_instance_id\" text COLLATE \"C\" NOT NULL,\n  \"recovery_requested_at_ms\" bigint,\n  \"workspace_accepted_at_ms\" bigint,\n  \"staged_result_ref\" text COLLATE \"C\",\n  \"repository_workspace_id\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\"),\n  CHECK ((\"owner_epoch\" >= 1)),\n  CHECK ((\"placement_generation\" >= 0))\n);\n\nCREATE TABLE \"worker_workspace_reconciliations\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_epoch\" bigint NOT NULL,\n  \"placement_generation\" bigint NOT NULL,\n  \"base_manifest_ref\" text COLLATE \"C\" NOT NULL,\n  \"current_manifest_ref\" text COLLATE \"C\" NOT NULL,\n  \"plan_json\" text COLLATE \"C\" NOT NULL,\n  \"base_pack\" bytea NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"session_id\"),\n  CHECK ((\"owner_epoch\" >= 1)),\n  CHECK ((\"placement_generation\" >= 0)),\n  CHECK ((octet_length(\"base_pack\") <= 268435456))\n);\n\nCREATE TABLE \"workspace_generated_bootstrap_hashes\" (\n  \"workspace_key\" text COLLATE \"C\" NOT NULL,\n  \"filename\" text COLLATE \"C\" NOT NULL,\n  \"sha256\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"workspace_key\", \"filename\")\n);\n\nCREATE TABLE \"workspace_path_aliases\" (\n  \"alias_key\" text COLLATE \"C\" NOT NULL,\n  \"alias_path\" text COLLATE \"C\" NOT NULL,\n  \"workspace_key\" text COLLATE \"C\" NOT NULL,\n  \"workspace_path\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"alias_key\")\n);\n\nCREATE TABLE \"workspace_setup_state\" (\n  \"workspace_key\" text COLLATE \"C\" NOT NULL,\n  \"workspace_path\" text COLLATE \"C\",\n  \"version\" bigint,\n  \"bootstrap_seeded_at\" text COLLATE \"C\",\n  \"setup_completed_at\" text COLLATE \"C\",\n  \"updated_at\" bigint,\n  \"attested_at_ms\" bigint,\n  \"attestation_updated_at_ms\" bigint,\n  PRIMARY KEY (\"workspace_key\"),\n  CHECK (\"version\" IS NULL OR \"workspace_path\" IS NOT NULL)\n);\n\nCREATE TABLE \"worktree_provisioned_file_chunks\" (\n  \"worktree_id\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"chunk_index\" bigint NOT NULL,\n  \"data\" bytea NOT NULL,\n  PRIMARY KEY (\"worktree_id\", \"path\", \"chunk_index\"),\n  CHECK ((\"chunk_index\" >= 0))\n);\n\nCREATE TABLE \"worktrees\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"repo_fingerprint\" text COLLATE \"C\" NOT NULL,\n  \"repo_root\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"branch\" text COLLATE \"C\" NOT NULL,\n  \"base_ref\" text COLLATE \"C\" NOT NULL,\n  \"owner_kind\" text COLLATE \"C\" NOT NULL,\n  \"owner_id\" text COLLATE \"C\",\n  \"snapshot_ref\" text COLLATE \"C\",\n  \"provisioned_paths_json\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"last_active_at\" bigint NOT NULL,\n  \"removed_at\" bigint,\n  \"run_end_cleanup_json\" text COLLATE \"C\",\n  \"gc_protection_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"id\"),\n  CHECK ((\"owner_kind\" IN ('manual', 'workboard', 'session')))\n);\n\nCREATE INDEX \"idx_acp_replay_sessions_key_updated\" ON \"acp_replay_sessions\" ((\"session_key\") ASC, (\"complete\") ASC, (\"updated_at\") DESC, (\"session_id\") ASC);\n\nCREATE INDEX \"idx_acp_replay_sessions_updated\" ON \"acp_replay_sessions\" ((\"updated_at\") DESC, (\"session_id\") ASC);\n\nCREATE INDEX \"idx_acp_sessions_agent_activity\" ON \"acp_sessions\" ((\"agent\") ASC, (\"last_activity_at\") DESC, (\"session_key\") ASC);\n\nCREATE INDEX \"idx_acp_sessions_resume_acpx\" ON \"acp_sessions\" ((\"resume_acpx_session_id\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_acp_sessions_resume_agent\" ON \"acp_sessions\" ((\"resume_agent_session_id\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_acp_sessions_state_activity\" ON \"acp_sessions\" ((\"state\") ASC, (\"last_activity_at\") DESC, (\"session_key\") ASC);\n\nCREATE INDEX \"idx_apns_registrations_updated\" ON \"apns_registrations\" ((\"updated_at_ms\") DESC, (\"node_id\") ASC);\n\nCREATE INDEX \"idx_audit_events_agent_sequence\" ON \"audit_events\" ((\"agent_id\") ASC NULLS FIRST, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_channel_sequence\" ON \"audit_events\" ((\"channel\") ASC NULLS FIRST, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_direction_sequence\" ON \"audit_events\" ((\"direction\") ASC NULLS FIRST, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_kind_sequence\" ON \"audit_events\" ((\"kind\") ASC, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_run_sequence\" ON \"audit_events\" ((\"run_id\") ASC NULLS FIRST, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_session_sequence\" ON \"audit_events\" ((\"session_key\") ASC NULLS FIRST, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_status_sequence\" ON \"audit_events\" ((\"status\") ASC, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_audit_events_time\" ON \"audit_events\" ((\"occurred_at\") DESC, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_backup_runs_created\" ON \"backup_runs\" ((\"created_at\") DESC, (\"id\") ASC);\n\nCREATE INDEX \"capture_events_flow_idx\" ON \"capture_events\" ((\"flow_id\") ASC, (\"ts\") ASC);\n\nCREATE INDEX \"capture_events_session_ts_idx\" ON \"capture_events\" ((\"session_id\") ASC, (\"ts\") ASC);\n\nCREATE INDEX \"idx_channel_ingress_claims\" ON \"channel_ingress_events\" ((\"queue_name\") ASC, (\"status\") ASC, (\"claimed_at\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_channel_ingress_lane\" ON \"channel_ingress_events\" ((\"queue_name\") ASC, (\"status\") ASC, (\"lane_key\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_channel_ingress_pending\" ON \"channel_ingress_events\" ((\"queue_name\") ASC, (\"status\") ASC, (\"received_at\") ASC, (\"event_id\") ASC);\n\nCREATE INDEX \"idx_channel_pairing_allow_account\" ON \"channel_pairing_allow_entries\" ((\"channel_key\") ASC, (\"account_id\") ASC, (\"sort_order\") ASC, (\"entry\") ASC);\n\nCREATE INDEX \"idx_channel_pairing_requests_code\" ON \"channel_pairing_requests\" ((\"channel_key\") ASC, (\"code\") ASC);\n\nCREATE INDEX \"idx_channel_pairing_requests_created\" ON \"channel_pairing_requests\" ((\"channel_key\") ASC, (\"created_at\") ASC, (\"request_id\") ASC);\n\nCREATE INDEX \"idx_cron_job_scratch_store_updated\" ON \"cron_job_scratch\" ((\"store_key\") ASC, (\"updated_at_ms\") DESC, (\"job_id\") ASC);\n\nCREATE INDEX \"idx_cron_jobs_store_order\" ON \"cron_jobs\" ((\"store_key\") ASC, (\"sort_order\") ASC, (\"updated_at\") ASC, (\"job_id\") ASC);\n\nCREATE INDEX \"idx_current_conversation_bindings_conversation\" ON \"current_conversation_bindings\" ((\"channel\") ASC, (\"account_id\") ASC, (\"conversation_kind\") ASC, (\"conversation_id\") ASC);\n\nCREATE INDEX \"idx_current_conversation_bindings_expires\" ON \"current_conversation_bindings\" ((\"expires_at\") ASC NULLS FIRST, (\"binding_key\") ASC);\n\nCREATE INDEX \"idx_current_conversation_bindings_target\" ON \"current_conversation_bindings\" ((\"target_session_key\") ASC, (\"updated_at\") DESC, (\"binding_key\") ASC);\n\nCREATE INDEX \"idx_delivery_queue_bounded_retention\" ON \"delivery_queue_entries\" ((\"queue_name\") ASC, (\"retention_id_prefix\") ASC, (\"enqueued_at\") DESC, (\"id\") DESC) WHERE (\"status\" IN ('completed', 'failed')) AND (\"recovery_state\" = 'completed_bounded') AND \"retention_id_prefix\" IS NOT NULL;\n\nCREATE INDEX \"idx_delivery_queue_failed\" ON \"delivery_queue_entries\" ((\"status\") ASC, (\"queue_name\") ASC, (\"failed_at\") ASC NULLS FIRST, (\"id\") ASC);\n\nCREATE INDEX \"idx_delivery_queue_pending\" ON \"delivery_queue_entries\" ((\"queue_name\") ASC, (\"status\") ASC, (\"enqueued_at\") ASC, (\"id\") ASC);\n\nCREATE INDEX \"idx_delivery_queue_session\" ON \"delivery_queue_entries\" ((\"queue_name\") ASC, (\"status\") ASC, (\"session_key\") ASC, (\"enqueued_at\") ASC, (\"id\") ASC) WHERE \"session_key\" IS NOT NULL;\n\nCREATE INDEX \"idx_delivery_queue_target\" ON \"delivery_queue_entries\" ((\"queue_name\") ASC, (\"status\") ASC, (\"channel\") ASC, (\"target\") ASC, (\"enqueued_at\") ASC, (\"id\") ASC) WHERE \"channel\" IS NOT NULL AND \"target\" IS NOT NULL;\n\nCREATE INDEX \"idx_device_bootstrap_tokens_ts\" ON \"device_bootstrap_tokens\" ((\"ts\") ASC);\n\nCREATE INDEX \"idx_device_pairing_paired_approved\" ON \"device_pairing_paired\" ((\"approved_at_ms\") DESC, (\"device_id\") ASC);\n\nCREATE INDEX \"idx_device_pairing_pending_device\" ON \"device_pairing_pending\" ((\"device_id\") ASC, (\"ts\") DESC);\n\nCREATE INDEX \"idx_diagnostic_events_scope_sequence\" ON \"diagnostic_events\" ((\"scope\") ASC, (\"sequence\") ASC, (\"event_key\") ASC);\n\nCREATE INDEX \"idx_flow_runs_owner_key\" ON \"flow_runs\" ((\"owner_key\") ASC);\n\nCREATE INDEX \"idx_flow_runs_status\" ON \"flow_runs\" ((\"status\") ASC);\n\nCREATE INDEX \"idx_flow_runs_updated_at\" ON \"flow_runs\" ((\"updated_at\") ASC);\n\nCREATE INDEX \"idx_gateway_boot_lifecycle_started\" ON \"gateway_boot_lifecycle\" ((\"started_at_ms\") ASC);\n\nCREATE INDEX \"idx_gateway_restart_handoff_expiry\" ON \"gateway_restart_handoff\" ((\"expires_at\") ASC, (\"pid\") ASC);\n\nCREATE INDEX \"idx_gateway_restart_sentinel_ts\" ON \"gateway_restart_sentinel\" ((\"ts\") DESC, (\"sentinel_key\") ASC);\n\nCREATE INDEX \"idx_macos_port_guardian_records_port\" ON \"macos_port_guardian_records\" ((\"port\") ASC, (\"timestamp\") DESC);\n\nCREATE INDEX \"idx_managed_outgoing_images_agent_message\" ON \"managed_outgoing_image_records\" ((\"session_key\") ASC, (\"agent_id\") ASC NULLS FIRST, (\"message_id\") ASC, (\"attachment_id\") ASC) WHERE \"message_id\" IS NOT NULL;\n\nCREATE INDEX \"idx_managed_outgoing_images_agent_session\" ON \"managed_outgoing_image_records\" ((\"session_key\") ASC, (\"agent_id\") ASC NULLS FIRST, (\"created_at\") DESC, (\"attachment_id\") ASC);\n\nCREATE INDEX \"idx_managed_outgoing_images_message\" ON \"managed_outgoing_image_records\" ((\"session_key\") ASC, (\"message_id\") ASC, (\"attachment_id\") ASC) WHERE \"message_id\" IS NOT NULL;\n\nCREATE INDEX \"idx_managed_outgoing_images_session\" ON \"managed_outgoing_image_records\" ((\"session_key\") ASC, (\"created_at\") DESC, (\"attachment_id\") ASC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_account\" ON \"meeting_transcript_sessions\" ((\"source_account_id\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_agent\" ON \"meeting_transcript_sessions\" ((\"metadata_agent_id\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_chronology\" ON \"meeting_transcript_sessions\" ((\"started_at_ms\") DESC NULLS LAST, (\"session_id\") ASC, (\"started_at\") ASC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_export_key\" ON \"meeting_transcript_sessions\" ((\"export_key\") ASC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_id\" ON \"meeting_transcript_sessions\" ((\"session_id\") ASC, (\"started_at\") DESC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_slug\" ON \"meeting_transcript_sessions\" ((\"session_slug\") ASC, (\"started_at\") DESC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_source\" ON \"meeting_transcript_sessions\" ((\"provider_id\") ASC, (\"source_account_id\") ASC NULLS FIRST, (\"source_guild_id\") ASC NULLS FIRST, (\"source_channel_id\") ASC NULLS FIRST, (\"source_meeting_url\") ASC NULLS FIRST, (\"source_thread_ts\") ASC NULLS FIRST, (\"source_file_id\") ASC NULLS FIRST, (\"stopped_at\") DESC NULLS LAST, (\"started_at\") DESC, (\"session_id\") ASC);\n\nCREATE INDEX \"idx_meeting_transcript_sessions_started\" ON \"meeting_transcript_sessions\" ((\"started_at\") DESC, (\"session_id\") ASC);\n\nCREATE INDEX \"idx_meeting_transcript_utterances_id\" ON \"meeting_transcript_utterances\" ((\"session_id\") ASC, (\"session_started_at\") ASC, (\"utterance_id\") ASC) WHERE \"utterance_id\" IS NOT NULL;\n\nCREATE INDEX \"idx_migration_runs_started\" ON \"migration_runs\" ((\"started_at\") DESC, (\"id\") ASC);\n\nCREATE INDEX \"idx_migration_sources_path\" ON \"migration_sources\" ((\"source_path\") ASC, (\"migration_kind\") ASC, (\"target_table\") ASC);\n\nCREATE INDEX \"idx_migration_sources_run\" ON \"migration_sources\" ((\"last_run_id\") ASC, (\"source_path\") ASC);\n\nCREATE INDEX \"idx_native_hook_relay_bridges_expires\" ON \"native_hook_relay_bridges\" ((\"expires_at_ms\") ASC, (\"relay_id\") ASC);\n\nCREATE INDEX \"idx_official_external_plugin_catalog_snapshots_updated\" ON \"official_external_plugin_catalog_snapshots\" ((\"updated_at_ms\") DESC, (\"feed_url\") ASC);\n\nCREATE UNIQUE INDEX \"idx_operator_approvals_cursor_id\" ON \"operator_approvals\" ((\"cursor_id\") ASC);\n\nCREATE UNIQUE INDEX \"idx_operator_approvals_resolution_ref\" ON \"operator_approvals\" ((\"resolution_ref\") ASC);\n\nCREATE INDEX \"idx_operator_approvals_resolved\" ON \"operator_approvals\" ((\"resolved_at_ms\") ASC, (\"approval_id\") ASC) WHERE \"resolved_at_ms\" IS NOT NULL;\n\nCREATE INDEX \"idx_operator_approvals_runtime_pending\" ON \"operator_approvals\" ((\"runtime_epoch\") ASC, (\"approval_id\") ASC) WHERE (\"status\" = 'pending');\n\nCREATE INDEX \"idx_operator_approvals_source_run_resolved\" ON \"operator_approvals\" ((\"source_run_id\") ASC, (\"resolved_at_ms\") ASC, (\"approval_id\") ASC) WHERE \"source_run_id\" IS NOT NULL AND \"resolved_at_ms\" IS NOT NULL;\n\nCREATE INDEX \"idx_operator_approvals_source_session_created\" ON \"operator_approvals\" ((\"source_session_key\") ASC NULLS FIRST, (\"created_at_ms\") DESC, (\"approval_id\") ASC);\n\nCREATE INDEX \"idx_operator_approvals_status_expiry\" ON \"operator_approvals\" ((\"status\") ASC, (\"expires_at_ms\") ASC, (\"approval_id\") ASC);\n\nCREATE INDEX \"idx_plugin_binding_approvals_plugin\" ON \"plugin_binding_approvals\" ((\"plugin_id\") ASC, (\"approved_at\") DESC);\n\nCREATE INDEX \"idx_plugin_blob_expiry\" ON \"plugin_blob_entries\" ((\"expires_at\") ASC) WHERE \"expires_at\" IS NOT NULL;\n\nCREATE INDEX \"idx_plugin_blob_listing\" ON \"plugin_blob_entries\" ((\"plugin_id\") ASC, (\"namespace\") ASC, (\"created_at\") ASC, (\"entry_key\") ASC);\n\nCREATE INDEX \"idx_plugin_state_expiry\" ON \"plugin_state_entries\" ((\"expires_at\") ASC) WHERE \"expires_at\" IS NOT NULL;\n\nCREATE INDEX \"idx_plugin_state_listing\" ON \"plugin_state_entries\" ((\"plugin_id\") ASC, (\"namespace\") ASC, (\"created_at\") ASC, (\"entry_key\") ASC, (\"expires_at\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_sandbox_registry_last_used\" ON \"sandbox_registry_entries\" ((\"registry_kind\") ASC, (\"last_used_at_ms\") DESC, (\"container_name\") ASC) WHERE \"last_used_at_ms\" IS NOT NULL;\n\nCREATE INDEX \"idx_sandbox_registry_session\" ON \"sandbox_registry_entries\" ((\"registry_kind\") ASC, (\"session_key\") ASC, (\"last_used_at_ms\") DESC NULLS LAST, (\"container_name\") ASC) WHERE \"session_key\" IS NOT NULL;\n\nCREATE INDEX \"idx_sandbox_registry_updated\" ON \"sandbox_registry_entries\" ((\"registry_kind\") ASC, (\"updated_at\") DESC, (\"container_name\") ASC);\n\nCREATE INDEX \"idx_session_state_events_session_sequence\" ON \"session_state_events\" ((\"session_key\") ASC, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_session_state_events_time\" ON \"session_state_events\" ((\"occurred_at\") DESC, (\"sequence\") DESC);\n\nCREATE INDEX \"idx_session_upstream_links_catalog_id\" ON \"session_upstream_links\" ((\"catalog_id\") ASC);\n\nCREATE INDEX \"idx_session_watch_cursors_target\" ON \"session_watch_cursors\" ((\"target_session_key\") ASC);\n\nCREATE INDEX \"idx_skill_uploads_expiry\" ON \"skill_uploads\" ((\"expires_at\") ASC);\n\nCREATE INDEX \"idx_skill_uploads_idempotency\" ON \"skill_uploads\" ((\"idempotency_key_hash\") ASC) WHERE \"idempotency_key_hash\" IS NOT NULL;\n\nCREATE INDEX \"idx_state_leases_expiry\" ON \"state_leases\" ((\"expires_at\") ASC, (\"scope\") ASC, (\"lease_key\") ASC) WHERE \"expires_at\" IS NOT NULL;\n\nCREATE INDEX \"idx_state_leases_owner\" ON \"state_leases\" ((\"owner\") ASC);\n\nCREATE INDEX \"idx_subagent_runs_child_session_key\" ON \"subagent_runs\" ((\"child_session_key\") ASC, (\"created_at\") DESC, (\"run_id\") ASC);\n\nCREATE INDEX \"idx_subagent_runs_controller_session_key\" ON \"subagent_runs\" ((\"controller_session_key\") ASC NULLS FIRST, (\"created_at\") DESC, (\"run_id\") ASC);\n\nCREATE INDEX \"idx_subagent_runs_requester_session_key\" ON \"subagent_runs\" ((\"requester_session_key\") ASC, (\"created_at\") DESC, (\"run_id\") ASC);\n\nCREATE INDEX \"idx_task_runs_cron_runtime_order\" ON \"task_runs\" ((\"runtime\") ASC, (\"created_at\") ASC, (\"task_id\") ASC) WHERE (\"runtime\" = 'cron');\n\nCREATE INDEX \"idx_task_runs_cron_source_order\" ON \"task_runs\" ((\"source_id\") ASC NULLS FIRST, (\"created_at\") ASC, (\"task_id\") ASC) WHERE (\"runtime\" = 'cron');\n\nCREATE INDEX \"idx_task_runs_runtime_run\" ON \"task_runs\" ((\"runtime\") ASC, (\"run_id\") ASC NULLS FIRST, (\"source_id\") ASC NULLS FIRST, (\"created_at\") ASC, (\"task_id\") ASC);\n\nCREATE INDEX \"idx_web_push_subscriptions_updated\" ON \"web_push_subscriptions\" ((\"updated_at_ms\") DESC, (\"subscription_id\") ASC);\n\nCREATE UNIQUE INDEX \"idx_worker_environments_provider_lease\" ON \"worker_environments\" ((\"provider_id\") ASC, (\"lease_id\") ASC) WHERE \"lease_id\" IS NOT NULL;\n\nCREATE INDEX \"idx_worker_environments_terminal_changed\" ON \"worker_environments\" ((\"state_changed_at_ms\") ASC, (\"environment_id\") ASC);\n\nCREATE UNIQUE INDEX \"idx_worker_inference_turns_pending_run\" ON \"worker_inference_turns\" ((\"session_id\") ASC, (\"run_epoch\") ASC, (\"run_id\") ASC) WHERE (\"state\" = 'pending');\n\nCREATE INDEX \"idx_worker_session_placements_environment\" ON \"worker_session_placements\" ((\"environment_id\") ASC) WHERE \"environment_id\" IS NOT NULL;\n\nCREATE INDEX \"idx_worker_session_placements_reconcile\" ON \"worker_session_placements\" ((\"updated_at_ms\") ASC, (\"session_id\") ASC);\n\nCREATE INDEX \"idx_worker_session_placements_session_key\" ON \"worker_session_placements\" ((\"agent_id\") ASC, (\"session_key\") ASC);\n\nCREATE INDEX \"idx_workspace_path_aliases_workspace\" ON \"workspace_path_aliases\" ((\"workspace_key\") ASC);\n\nCREATE INDEX \"idx_workspace_setup_state_path\" ON \"workspace_setup_state\" ((\"workspace_path\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_worktrees_removed_at\" ON \"worktrees\" ((\"removed_at\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_worktrees_repo_fingerprint\" ON \"worktrees\" ((\"repo_fingerprint\") ASC);\n\nALTER TABLE \"acp_replay_events\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"acp_replay_sessions\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"capture_events\" ADD FOREIGN KEY (\"data_blob_id\") REFERENCES \"capture_blobs\" (\"blob_id\") ON UPDATE NO ACTION ON DELETE SET NULL NOT DEFERRABLE;\n\nALTER TABLE \"capture_events\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"capture_sessions\" (\"id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"meeting_transcript_summaries\" ADD FOREIGN KEY (\"session_id\", \"session_started_at\") REFERENCES \"meeting_transcript_sessions\" (\"session_id\", \"started_at\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"meeting_transcript_utterances\" ADD FOREIGN KEY (\"session_id\", \"session_started_at\") REFERENCES \"meeting_transcript_sessions\" (\"session_id\", \"started_at\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"migration_sources\" ADD FOREIGN KEY (\"last_run_id\") REFERENCES \"migration_runs\" (\"id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"skill_upload_chunks\" ADD FOREIGN KEY (\"upload_id\") REFERENCES \"skill_uploads\" (\"upload_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"task_delivery_state\" ADD FOREIGN KEY (\"task_id\") REFERENCES \"task_runs\" (\"task_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_environment_credentials\" ADD FOREIGN KEY (\"environment_id\") REFERENCES \"worker_environments\" (\"environment_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_inference_turns\" ADD FOREIGN KEY (\"environment_id\") REFERENCES \"worker_environments\" (\"environment_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_session_tool_operations\" ADD FOREIGN KEY (\"source_session_id\") REFERENCES \"worker_session_placements\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_transcript_commits\" ADD FOREIGN KEY (\"session_id\", \"run_epoch\") REFERENCES \"worker_transcript_commit_heads\" (\"session_id\", \"run_epoch\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_turn_tool_authorities\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"worker_session_placements\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_workspace_pending_results\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"worker_session_placements\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"worker_workspace_reconciliations\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"worker_session_placements\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"workspace_generated_bootstrap_hashes\" ADD FOREIGN KEY (\"workspace_key\") REFERENCES \"workspace_setup_state\" (\"workspace_key\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n",
	operatorRecoveryV25Sql: "-- Generated v24-to-v25 metadata-only transition; the engine owner publishes openclaw_schema_meta.\n-- Subagent operator recovery requires the new reader; catalog and retained rows are unchanged.\nUPDATE schema_meta SET schema_version = 25 WHERE meta_key = 'primary' AND schema_version = 24;\nUPDATE config_machine_state SET value_json = '25' WHERE state_key = 'state.schema.contentVersion' AND value_json = '24';\n",
	preWriteIndexesV27Sql: {
		acp_replay_events: "CREATE INDEX \"idx_acp_replay_events_session_seq\" ON \"acp_replay_events\" ((\"session_id\") ASC NULLS FIRST, (\"seq\") ASC NULLS FIRST);",
		skill_usage: "CREATE INDEX \"idx_skill_usage_key\" ON \"skill_usage\" ((\"skill_key\") ASC NULLS FIRST, (\"skill_file\") ASC NULLS FIRST);",
		state_leases: "CREATE INDEX \"idx_state_leases_owner\" ON \"state_leases\" ((\"owner\") ASC NULLS FIRST, (\"updated_at\") DESC NULLS LAST);"
	},
	writeIndexesV27Sql: "\n  DROP INDEX IF EXISTS idx_acp_replay_events_session_seq;\n  DROP INDEX IF EXISTS idx_skill_usage_key;\n  DROP INDEX IF EXISTS idx_state_leases_owner;\n\nCREATE INDEX \"idx_state_leases_owner\" ON \"state_leases\" ((\"owner\") ASC NULLS FIRST);",
	clientCredentialV29Sql: "-- Generated v28-to-v29 publication after the local credential owner has verified and retired source rows.\nUPDATE schema_meta SET schema_version = 29 WHERE meta_key = 'primary' AND schema_version = 28;\n",
	workspaceCasV35Sql: "-- Generated DDL-only v34-to-v35 transition; reconciliation converts retained rows online.\nDO $workspace_cas$ BEGIN\nIF to_regclass('local_workspace_projections') IS NOT NULL THEN\nALTER TABLE \"local_workspace_projections\" ADD COLUMN \"tree_root_digest\" bytea;\nALTER TABLE \"local_workspace_projections\" ADD COLUMN \"source_paths_digest\" bytea;\nALTER TABLE \"local_workspace_projections\" ADD COLUMN \"canonical_fingerprints\" bytea;\nALTER TABLE \"local_workspace_projections\" ADD COLUMN \"projection_fingerprints\" bytea;\nCREATE TABLE \"local_workspace_source_path_sets\" (\n  \"path_digest\" bytea NOT NULL,\n  \"paths_zstd\" bytea NOT NULL,\n  \"sweep_epoch\" bigint NOT NULL,\n  PRIMARY KEY (\"path_digest\"),\n  CHECK ((octet_length(\"path_digest\") = 32))\n);\nCREATE TABLE \"local_workspace_tree_packs\" (\n  \"tree_digest\" bytea NOT NULL,\n  \"records_json\" text COLLATE \"C\" NOT NULL,\n  \"children_json\" text COLLATE \"C\" NOT NULL,\n  \"sweep_epoch\" bigint NOT NULL,\n  PRIMARY KEY (\"tree_digest\"),\n  CHECK ((octet_length(\"tree_digest\") = 32))\n);\nEND IF; END $workspace_cas$;\n",
	clientCredentialSource: {
		sql: "CREATE TABLE \"device_auth_tokens\" (\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"role\" text COLLATE \"C\" NOT NULL,\n  \"token\" text COLLATE \"C\" NOT NULL,\n  \"scopes_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"device_id\", \"role\")\n);\n\nCREATE TABLE \"device_identities\" (\n  \"identity_key\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"public_key_pem\" text COLLATE \"C\" NOT NULL,\n  \"private_key_pem\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"identity_key\")\n);\n\nCREATE TABLE \"gateway_origin_device_tokens\" (\n  \"gateway_scope\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"role\" text COLLATE \"C\" NOT NULL,\n  \"token\" text COLLATE \"C\" NOT NULL,\n  \"scopes_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"gateway_scope\", \"device_id\", \"role\")\n);\n\nCREATE INDEX \"idx_device_auth_tokens_updated\" ON \"device_auth_tokens\" ((\"updated_at_ms\") DESC NULLS LAST, (\"device_id\") ASC NULLS FIRST, (\"role\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_device_identities_device\" ON \"device_identities\" ((\"device_id\") ASC NULLS FIRST, (\"updated_at_ms\") DESC NULLS LAST);",
		preData: [0, 926],
		postData: [926, 1225],
		tables: [
			{
				name: "device_auth_tokens",
				identities: []
			},
			{
				name: "device_identities",
				identities: []
			},
			{
				name: "gateway_origin_device_tokens",
				identities: []
			}
		],
		expectedCatalog: [
			{
				table: "device_auth_tokens",
				kind: "table",
				value: null
			},
			{
				table: "device_auth_tokens",
				kind: "column",
				value: {
					name: "device_id",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 1
				}
			},
			{
				table: "device_auth_tokens",
				kind: "column",
				value: {
					name: "role",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 2
				}
			},
			{
				table: "device_auth_tokens",
				kind: "column",
				value: {
					name: "token",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 3
				}
			},
			{
				table: "device_auth_tokens",
				kind: "column",
				value: {
					name: "scopes_json",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 4
				}
			},
			{
				table: "device_auth_tokens",
				kind: "column",
				value: {
					name: "updated_at_ms",
					type: "bigint",
					nullable: false,
					identity: false,
					default: null,
					position: 5
				}
			},
			{
				table: "device_auth_tokens",
				kind: "primaryKey",
				value: ["device_id", "role"]
			},
			{
				table: "device_auth_tokens",
				kind: "indexes",
				value: 2
			},
			{
				table: "device_auth_tokens",
				kind: "checks",
				value: 0
			},
			{
				table: "device_identities",
				kind: "table",
				value: null
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "identity_key",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 1
				}
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "device_id",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 2
				}
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "public_key_pem",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 3
				}
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "private_key_pem",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 4
				}
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "created_at_ms",
					type: "bigint",
					nullable: false,
					identity: false,
					default: null,
					position: 5
				}
			},
			{
				table: "device_identities",
				kind: "column",
				value: {
					name: "updated_at_ms",
					type: "bigint",
					nullable: false,
					identity: false,
					default: null,
					position: 6
				}
			},
			{
				table: "device_identities",
				kind: "primaryKey",
				value: ["identity_key"]
			},
			{
				table: "device_identities",
				kind: "indexes",
				value: 2
			},
			{
				table: "device_identities",
				kind: "checks",
				value: 0
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "table",
				value: null
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "gateway_scope",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 1
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "device_id",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 2
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "role",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 3
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "token",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 4
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "scopes_json",
					type: "text",
					nullable: false,
					identity: false,
					default: null,
					position: 5
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "column",
				value: {
					name: "updated_at_ms",
					type: "bigint",
					nullable: false,
					identity: false,
					default: null,
					position: 6
				}
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "primaryKey",
				value: [
					"gateway_scope",
					"device_id",
					"role"
				]
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "indexes",
				value: 1
			},
			{
				table: "gateway_origin_device_tokens",
				kind: "checks",
				value: 0
			}
		]
	},
	fragments: [
		{
			id: "local_workspace_projections",
			tables: [
				"local_workspace_projections",
				"local_workspace_manifest_nodes",
				"local_workspace_tree_packs",
				"local_workspace_source_path_sets"
			],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"local_workspace_manifest_nodes\" (\n  \"worktree_id\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"node_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"worktree_id\", \"path\")\n);\n\nCREATE TABLE \"local_workspace_projections\" (\n  \"worktree_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"lifecycle_revision\" text COLLATE \"C\",\n  \"projection_path\" text COLLATE \"C\" NOT NULL,\n  \"base_commit\" text COLLATE \"C\" NOT NULL,\n  \"source_paths_json\" text COLLATE \"C\" NOT NULL,\n  \"baseline_json\" text COLLATE \"C\",\n  \"baseline_ref\" text COLLATE \"C\",\n  \"pending_ref\" text COLLATE \"C\",\n  \"pending_target\" text COLLATE \"C\",\n  \"paused_runtimes_json\" text COLLATE \"C\",\n  \"journal_json\" text COLLATE \"C\",\n  \"journal_pack\" bytea,\n  \"revision\" bigint NOT NULL DEFAULT 0,\n  \"created_at_ms\" bigint NOT NULL,\n  \"checkpoint_json\" text COLLATE \"C\",\n  \"tree_root_digest\" bytea,\n  \"source_paths_digest\" bytea,\n  \"canonical_fingerprints\" bytea,\n  \"projection_fingerprints\" bytea,\n  PRIMARY KEY (\"worktree_id\"),\n  CHECK ((\"pending_target\" IN ('canonical', 'projection'))),\n  CHECK (\"journal_pack\" IS NULL OR (octet_length(\"journal_pack\") <= 268435456)),\n  CHECK ((\"revision\" >= 0)),\n  CHECK (\"baseline_json\" IS NULL OR \"baseline_ref\" IS NOT NULL),\n  CHECK (((\"journal_json\" IS NULL) = (\"journal_pack\" IS NULL))),\n  UNIQUE (\"projection_path\")\n);\n\nCREATE TABLE \"local_workspace_source_path_sets\" (\n  \"path_digest\" bytea NOT NULL,\n  \"paths_zstd\" bytea NOT NULL,\n  \"sweep_epoch\" bigint NOT NULL,\n  PRIMARY KEY (\"path_digest\"),\n  CHECK ((octet_length(\"path_digest\") = 32))\n);\n\nCREATE TABLE \"local_workspace_tree_packs\" (\n  \"tree_digest\" bytea NOT NULL,\n  \"records_json\" text COLLATE \"C\" NOT NULL,\n  \"children_json\" text COLLATE \"C\" NOT NULL,\n  \"sweep_epoch\" bigint NOT NULL,\n  PRIMARY KEY (\"tree_digest\"),\n  CHECK ((octet_length(\"tree_digest\") = 32))\n);\n\nALTER TABLE \"local_workspace_manifest_nodes\" ADD FOREIGN KEY (\"worktree_id\") REFERENCES \"local_workspace_projections\" (\"worktree_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "user_profiles",
			tables: [
				"user_profiles",
				"user_profile_emails",
				"user_profile_identities"
			],
			indexes: [
				"idx_user_profile_emails_profile_id",
				"idx_user_profile_identities_profile_id",
				"idx_user_profile_identities_authorization"
			],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"user_profile_emails\" (\n  \"email\" text COLLATE \"C\" NOT NULL,\n  \"profile_id\" text COLLATE \"C\" NOT NULL,\n  \"binding_id\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  PRIMARY KEY (\"email\")\n);\n\nCREATE TABLE \"user_profile_identities\" (\n  \"provider\" text COLLATE \"C\" NOT NULL,\n  \"subject\" text COLLATE \"C\" NOT NULL,\n  \"profile_id\" text COLLATE \"C\" NOT NULL,\n  \"canonical_login\" text COLLATE \"C\",\n  \"verified_email_json\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"authorization_id\" text COLLATE \"C\",\n  \"authorization_basis_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"provider\", \"subject\")\n);\n\nCREATE TABLE \"user_profiles\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"display_name\" text COLLATE \"C\",\n  \"primary_github_account_id\" bigint,\n  \"avatar\" bytea,\n  \"avatar_mime\" text COLLATE \"C\",\n  \"avatar_sha256\" text COLLATE \"C\",\n  \"merged_into\" text COLLATE \"C\",\n  \"role\" text COLLATE \"C\",\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"id\")\n);\n\nCREATE INDEX \"idx_user_profile_emails_profile_id\" ON \"user_profile_emails\" ((\"profile_id\") ASC);\n\nCREATE UNIQUE INDEX \"idx_user_profile_identities_authorization\" ON \"user_profile_identities\" ((\"authorization_id\") ASC NULLS FIRST);\n\nCREATE INDEX \"idx_user_profile_identities_profile_id\" ON \"user_profile_identities\" ((\"profile_id\") ASC);\n"
		},
		{
			id: "skill_library_entries",
			tables: [
				"skill_library_entries",
				"skill_library_revisions",
				"skill_library_events",
				"skill_library_uploads"
			],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"skill_library_entries\" (\n  \"skill_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_profile_id\" text COLLATE \"C\",\n  \"author_profile_id\" text COLLATE \"C\" NOT NULL,\n  \"slug\" text COLLATE \"C\" NOT NULL,\n  \"current_revision\" text COLLATE \"C\" NOT NULL,\n  \"shared\" bigint NOT NULL,\n  \"enabled\" bigint NOT NULL,\n  \"removed\" bigint NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"updated_at\" bigint NOT NULL,\n  PRIMARY KEY (\"skill_id\")\n);\n\nCREATE TABLE \"skill_library_events\" (\n  \"event_id\" text COLLATE \"C\" NOT NULL,\n  \"skill_id\" text COLLATE \"C\" NOT NULL,\n  \"revision\" text COLLATE \"C\" NOT NULL,\n  \"action\" text COLLATE \"C\" NOT NULL,\n  \"actor_profile_id\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  PRIMARY KEY (\"event_id\")\n);\n\nCREATE TABLE \"skill_library_revisions\" (\n  \"skill_id\" text COLLATE \"C\" NOT NULL,\n  \"revision\" text COLLATE \"C\" NOT NULL,\n  \"description\" text COLLATE \"C\" NOT NULL,\n  \"files_json\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  PRIMARY KEY (\"skill_id\", \"revision\")\n);\n\nCREATE TABLE \"skill_library_uploads\" (\n  \"upload_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_profile_id\" text COLLATE \"C\" NOT NULL,\n  \"slug\" text COLLATE \"C\" NOT NULL,\n  \"size_bytes\" bigint NOT NULL,\n  \"sha256\" text COLLATE \"C\" NOT NULL,\n  \"archive_blob\" bytea NOT NULL,\n  \"expires_at\" bigint NOT NULL,\n  \"published_skill_id\" text COLLATE \"C\",\n  PRIMARY KEY (\"upload_id\")\n);\n"
		},
		{
			id: "operator_approval_standing_grants",
			tables: ["operator_approval_standing_grants", "operator_approval_standing_grant_generations"],
			indexes: ["idx_operator_approval_standing_grants_binding"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"operator_approval_standing_grant_generations\" (\n  \"grant_id\" text COLLATE \"C\" NOT NULL,\n  \"job_definition_generation\" bigint NOT NULL,\n  PRIMARY KEY (\"grant_id\"),\n  CHECK ((\"job_definition_generation\" >= 1))\n);\n\nCREATE TABLE \"operator_approval_standing_grants\" (\n  \"grant_id\" text COLLATE \"C\" NOT NULL,\n  \"minted_by_approval_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"cron_job_id\" text COLLATE \"C\" NOT NULL,\n  \"job_config_revision\" text COLLATE \"C\" NOT NULL,\n  \"operation_binding\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"expires_at_ms\" bigint,\n  \"revoked_at_ms\" bigint,\n  \"revoked_by\" text COLLATE \"C\",\n  \"last_used_at_ms\" bigint,\n  \"use_count\" bigint NOT NULL DEFAULT 0,\n  PRIMARY KEY (\"grant_id\"),\n  CHECK ((char_length(\"grant_id\") > 0)),\n  CHECK ((char_length(\"agent_id\") > 0)),\n  CHECK ((char_length(\"cron_job_id\") > 0)),\n  CHECK ((char_length(\"job_config_revision\") > 0)),\n  CHECK ((char_length(\"operation_binding\") > 0)),\n  CHECK (\"expires_at_ms\" IS NULL OR (\"expires_at_ms\" >= \"created_at_ms\"))\n);\n\nCREATE INDEX \"idx_operator_approval_standing_grants_binding\" ON \"operator_approval_standing_grants\" ((\"agent_id\") ASC, (\"cron_job_id\") ASC, (\"operation_binding\") ASC, (\"created_at_ms\") DESC);\n\nALTER TABLE \"operator_approval_standing_grant_generations\" ADD FOREIGN KEY (\"grant_id\") REFERENCES \"operator_approval_standing_grants\" (\"grant_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"operator_approval_standing_grants\" ADD FOREIGN KEY (\"minted_by_approval_id\") REFERENCES \"operator_approvals\" (\"approval_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "worker_environment_session_attachments",
			tables: ["worker_environment_session_attachments"],
			indexes: ["worker_environment_session_attachments_session_key"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"worker_environment_session_attachments\" (\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"session_lifecycle_revision\" text COLLATE \"C\",\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"generation\" bigint NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"last_used_at_ms\" bigint NOT NULL,\n  \"closed_at_ms\" bigint,\n  PRIMARY KEY (\"session_id\"),\n  CHECK ((\"generation\" >= 1)),\n  UNIQUE (\"environment_id\")\n);\n\nCREATE INDEX \"worker_environment_session_attachments_session_key\" ON \"worker_environment_session_attachments\" ((\"agent_id\") ASC, (\"session_key\") ASC);\n\nALTER TABLE \"worker_environment_session_attachments\" ADD FOREIGN KEY (\"environment_id\") REFERENCES \"worker_environments\" (\"environment_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "sandbox_persistent_execs",
			tables: ["sandbox_persistent_execs"],
			indexes: [
				"idx_sandbox_persistent_execs_container",
				"idx_sandbox_persistent_execs_container_name",
				"idx_sandbox_persistent_execs_source"
			],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"sandbox_persistent_execs\" (\n  \"owner_key\" text COLLATE \"C\" NOT NULL,\n  \"source_identity\" text COLLATE \"C\" NOT NULL,\n  \"attempt_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_json\" text COLLATE \"C\" NOT NULL,\n  \"backend_id\" text COLLATE \"C\" NOT NULL,\n  \"backend_target_json\" text COLLATE \"C\" NOT NULL,\n  \"workspace_binding_json\" text COLLATE \"C\" NOT NULL,\n  \"container_id\" text COLLATE \"C\" NOT NULL,\n  \"container_name\" text COLLATE \"C\" NOT NULL,\n  \"container_started_at\" text COLLATE \"C\" NOT NULL,\n  \"revision\" bigint NOT NULL,\n  \"phase\" text COLLATE \"C\" NOT NULL,\n  \"receipt_json\" text COLLATE \"C\",\n  \"error\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"owner_key\"),\n  CHECK ((\"backend_id\" = 'docker')),\n  CHECK ((\"revision\" > 0)),\n  CHECK ((\"phase\" IN ('reserved', 'prepared', 'running', 'stopping', 'uncertain', 'stopped'))),\n  CHECK ((\"phase\" NOT IN ('prepared', 'running')) OR \"receipt_json\" IS NOT NULL),\n  UNIQUE (\"attempt_id\")\n);\n\nCREATE INDEX \"idx_sandbox_persistent_execs_container\" ON \"sandbox_persistent_execs\" ((\"container_id\") ASC, (\"owner_key\") ASC);\n\nCREATE INDEX \"idx_sandbox_persistent_execs_container_name\" ON \"sandbox_persistent_execs\" ((\"container_name\") ASC, (\"owner_key\") ASC);\n\nCREATE INDEX \"idx_sandbox_persistent_execs_source\" ON \"sandbox_persistent_execs\" ((\"source_identity\") ASC, (\"owner_key\") ASC);\n"
		},
		{
			id: "user_background_images",
			tables: ["user_background_images"],
			indexes: [],
			dependencies: ["user_profiles"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"user_background_images\" (\n  \"profile_id\" text COLLATE \"C\" NOT NULL,\n  \"asset_id\" text COLLATE \"C\" NOT NULL,\n  \"image\" bytea NOT NULL,\n  \"width\" bigint NOT NULL,\n  \"height\" bigint NOT NULL,\n  PRIMARY KEY (\"profile_id\"),\n  CHECK ((octet_length(\"image\") BETWEEN 1 AND 2097152)),\n  CHECK ((\"width\" BETWEEN 1 AND 2560)),\n  CHECK ((\"height\" BETWEEN 1 AND 2560)),\n  UNIQUE (\"asset_id\")\n);\n\nALTER TABLE \"user_background_images\" ADD FOREIGN KEY (\"profile_id\") REFERENCES \"user_profiles\" (\"id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "update_runs",
			tables: ["update_runs"],
			indexes: ["idx_update_runs_created", "idx_update_runs_active"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"update_runs\" (\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"trigger\" text COLLATE \"C\" NOT NULL,\n  \"phase\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"reason\" text COLLATE \"C\",\n  \"origin_json\" text COLLATE \"C\" NOT NULL,\n  \"target_json\" text COLLATE \"C\" NOT NULL,\n  \"before_json\" text COLLATE \"C\" NOT NULL,\n  \"after_json\" text COLLATE \"C\" NOT NULL,\n  \"steps_json\" text COLLATE \"C\" NOT NULL,\n  \"verification_json\" text COLLATE \"C\" NOT NULL,\n  \"repair_json\" text COLLATE \"C\" NOT NULL,\n  \"confirmed_at_ms\" bigint,\n  \"finished_at_ms\" bigint,\n  \"downtime_ms\" bigint,\n  PRIMARY KEY (\"run_id\"),\n  CHECK ((\"trigger\" IN ('chat', 'control-ui', 'cli', 'campaign', 'mac-app', 'api'))),\n  CHECK ((\"phase\" IN ('requested', 'staging', 'validating', 'repairing', 'activating', 'restarting', 'verifying', 'finished'))),\n  CHECK ((\"status\" IN ('running', 'succeeded', 'failed', 'rolled-back', 'skipped'))),\n  CHECK ((octet_length(convert_to(\"origin_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"target_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"before_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"after_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"steps_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"verification_json\", 'UTF8')) <= 16384)),\n  CHECK ((octet_length(convert_to(\"repair_json\", 'UTF8')) <= 16384)),\n  CHECK (((\"status\" = 'running') AND (\"phase\" != 'finished') AND \"finished_at_ms\" IS NULL) OR ((\"status\" != 'running') AND (\"phase\" = 'finished') AND \"finished_at_ms\" IS NOT NULL))\n);\n\nCREATE INDEX \"idx_update_runs_active\" ON \"update_runs\" ((\"status\") ASC, (\"created_at_ms\") DESC, (\"run_id\") ASC);\n\nCREATE INDEX \"idx_update_runs_created\" ON \"update_runs\" ((\"created_at_ms\") DESC, (\"run_id\") ASC);\n"
		},
		{
			id: "session_repository_workspaces",
			tables: ["session_repository_workspaces"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"session_repository_workspaces\" (\n  \"workspace_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"url\" text COLLATE \"C\" NOT NULL,\n  \"requested_ref\" text COLLATE \"C\",\n  \"run_setup_script\" bigint NOT NULL DEFAULT 0,\n  \"base_commit\" text COLLATE \"C\",\n  \"base_manifest_hash\" text COLLATE \"C\",\n  \"branch\" text COLLATE \"C\" NOT NULL,\n  \"checkpoint_ref\" text COLLATE \"C\",\n  \"manifest_hash\" text COLLATE \"C\",\n  \"revision\" bigint NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"workspace_id\"),\n  CHECK ((char_length(\"workspace_id\") = 36)),\n  CHECK ((char_length(\"agent_id\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"session_key\") BETWEEN 1 AND 1024)),\n  CHECK ((char_length(\"url\") BETWEEN 1 AND 4096)),\n  CHECK (\"requested_ref\" IS NULL OR (char_length(\"requested_ref\") BETWEEN 1 AND 1024)),\n  CHECK ((\"run_setup_script\" IN (0, 1))),\n  CHECK (\"base_commit\" IS NULL OR (char_length(\"base_commit\") IN (40, 64))),\n  CHECK ((char_length(\"branch\") BETWEEN 1 AND 256)),\n  CHECK ((\"revision\" >= 0)),\n  CHECK (\"base_manifest_hash\" IS NULL OR \"base_commit\" IS NOT NULL),\n  CHECK ((\"checkpoint_ref\" IS NULL AND \"manifest_hash\" IS NULL) OR (\"checkpoint_ref\" IS NOT NULL AND \"manifest_hash\" IS NOT NULL AND \"base_manifest_hash\" IS NOT NULL)),\n  UNIQUE (\"agent_id\", \"session_key\")\n);\n"
		},
		{
			id: "github_repository_publication_requests",
			tables: ["github_repository_publication_requests"],
			indexes: ["idx_github_repository_publication_shared_request", "idx_github_repository_publication_personal_request"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"github_repository_publication_requests\" (\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_profile_id\" text COLLATE \"C\",\n  \"connection_generation\" text COLLATE \"C\",\n  \"idempotency_key\" text COLLATE \"C\" NOT NULL,\n  \"request_digest\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_lifecycle_revision\" text COLLATE \"C\",\n  \"requester_authority_json\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"workspace_id\" text COLLATE \"C\" NOT NULL,\n  \"checkpoint_ref\" text COLLATE \"C\",\n  \"checkpoint_digest\" text COLLATE \"C\",\n  \"claim_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"environment_id\" text COLLATE \"C\",\n  \"owner_epoch\" bigint,\n  \"placement_generation\" bigint,\n  \"identity_source\" text COLLATE \"C\" NOT NULL,\n  \"identity_profile_id\" text COLLATE \"C\",\n  \"identity_account_id\" bigint NOT NULL,\n  \"identity_login\" text COLLATE \"C\" NOT NULL,\n  \"title\" text COLLATE \"C\",\n  \"body\" text COLLATE \"C\",\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"gateway_instance_id\" text COLLATE \"C\",\n  \"execution_id\" text COLLATE \"C\",\n  \"last_effect\" text COLLATE \"C\",\n  \"effect_state\" text COLLATE \"C\",\n  \"push_repository\" text COLLATE \"C\",\n  \"repository\" text COLLATE \"C\",\n  \"branch\" text COLLATE \"C\" NOT NULL,\n  \"base_branch\" text COLLATE \"C\",\n  \"source_head_commit\" text COLLATE \"C\",\n  \"source_index_tree\" text COLLATE \"C\",\n  \"workspace_tree\" text COLLATE \"C\",\n  \"previous_head_commit\" text COLLATE \"C\",\n  \"pushed_head_commit\" text COLLATE \"C\",\n  \"head_commit\" text COLLATE \"C\",\n  \"pull_request_url\" text COLLATE \"C\",\n  \"error_code\" text COLLATE \"C\",\n  \"next_action\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"reported_at_ms\" bigint,\n  \"draft\" bigint,\n  PRIMARY KEY (\"request_id\"),\n  CHECK ((\"identity_source\" IN ('system-detected', 'system-configured', 'agent-override', 'personal'))),\n  CHECK ((\"status\" IN ('requested', 'publishing', 'needs_confirmation', 'published', 'failed'))),\n  CHECK ((\"last_effect\" IN ('push', 'pull_request'))),\n  CHECK ((\"effect_state\" IN ('dispatched', 'observed'))),\n  CHECK (((\"identity_source\" = 'personal') AND \"owner_profile_id\" IS NOT NULL AND \"connection_generation\" IS NOT NULL) OR ((\"identity_source\" <> 'personal') AND \"owner_profile_id\" IS NULL AND \"connection_generation\" IS NULL)),\n  CHECK ((\"checkpoint_ref\" IS NULL AND \"checkpoint_digest\" IS NULL) OR (\"checkpoint_ref\" IS NOT NULL AND \"checkpoint_digest\" IS NOT NULL)),\n  CHECK ((\"last_effect\" IS NULL AND \"effect_state\" IS NULL) OR (\"last_effect\" IS NOT NULL AND \"effect_state\" IS NOT NULL))\n);\n\nCREATE UNIQUE INDEX \"idx_github_repository_publication_personal_request\" ON \"github_repository_publication_requests\" ((\"owner_profile_id\") ASC, (\"session_id\") ASC, (\"idempotency_key\") ASC) WHERE \"owner_profile_id\" IS NOT NULL;\n\nCREATE UNIQUE INDEX \"idx_github_repository_publication_shared_request\" ON \"github_repository_publication_requests\" ((\"session_id\") ASC, (\"idempotency_key\") ASC) WHERE \"owner_profile_id\" IS NULL;\n"
		},
		{
			id: "github_publication_session_lifecycles",
			tables: ["github_publication_session_lifecycles"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"github_publication_session_lifecycles\" (\n  \"publication_kind\" text COLLATE \"C\" NOT NULL,\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"lifecycle_revision\" text COLLATE \"C\",\n  \"requester_authority_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"publication_kind\", \"request_id\"),\n  CHECK ((\"publication_kind\" IN ('shared', 'personal')))\n);\n"
		},
		{
			id: "github_personal_publication_requests",
			tables: ["github_personal_publication_requests"],
			indexes: ["idx_github_personal_publication_owner_session", "idx_github_personal_publication_pending"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"github_personal_publication_requests\" (\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_profile_id\" text COLLATE \"C\" NOT NULL,\n  \"connection_generation\" text COLLATE \"C\" NOT NULL,\n  \"idempotency_key\" text COLLATE \"C\" NOT NULL,\n  \"request_digest\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"worktree_id\" text COLLATE \"C\" NOT NULL,\n  \"repository_fingerprint\" text COLLATE \"C\" NOT NULL,\n  \"identity_source\" text COLLATE \"C\" NOT NULL,\n  \"identity_profile_id\" text COLLATE \"C\" NOT NULL,\n  \"identity_account_id\" bigint NOT NULL,\n  \"identity_login\" text COLLATE \"C\" NOT NULL,\n  \"title\" text COLLATE \"C\",\n  \"body\" text COLLATE \"C\",\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"gateway_instance_id\" text COLLATE \"C\",\n  \"execution_id\" text COLLATE \"C\",\n  \"last_effect\" text COLLATE \"C\",\n  \"effect_state\" text COLLATE \"C\",\n  \"push_repository\" text COLLATE \"C\" NOT NULL,\n  \"repository\" text COLLATE \"C\" NOT NULL,\n  \"branch\" text COLLATE \"C\" NOT NULL,\n  \"base_branch\" text COLLATE \"C\" NOT NULL,\n  \"source_head_commit\" text COLLATE \"C\" NOT NULL,\n  \"source_index_tree\" text COLLATE \"C\" NOT NULL,\n  \"workspace_tree\" text COLLATE \"C\" NOT NULL,\n  \"head_commit\" text COLLATE \"C\",\n  \"pull_request_url\" text COLLATE \"C\",\n  \"error_code\" text COLLATE \"C\",\n  \"next_action\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"reported_at_ms\" bigint,\n  \"draft\" bigint,\n  PRIMARY KEY (\"request_id\"),\n  CHECK ((char_length(\"request_id\") = 36)),\n  CHECK ((char_length(\"owner_profile_id\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"connection_generation\") = 36)),\n  CHECK ((char_length(\"idempotency_key\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"request_digest\") = 64)),\n  CHECK ((char_length(\"session_id\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"session_key\") BETWEEN 1 AND 1024)),\n  CHECK ((char_length(\"agent_id\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"worktree_id\") BETWEEN 1 AND 128)),\n  CHECK ((char_length(\"repository_fingerprint\") BETWEEN 1 AND 256)),\n  CHECK ((\"identity_source\" = 'personal')),\n  CHECK ((char_length(\"identity_profile_id\") = 36)),\n  CHECK ((\"identity_account_id\" >= 1)),\n  CHECK ((char_length(\"identity_login\") BETWEEN 1 AND 39)),\n  CHECK (\"title\" IS NULL OR (char_length(\"title\") BETWEEN 1 AND 256)),\n  CHECK (\"body\" IS NULL OR (char_length(\"body\") BETWEEN 1 AND 8192)),\n  CHECK ((\"status\" IN ('requested', 'publishing', 'needs_confirmation', 'published', 'failed'))),\n  CHECK (\"gateway_instance_id\" IS NULL OR (char_length(\"gateway_instance_id\") BETWEEN 1 AND 128)),\n  CHECK (\"execution_id\" IS NULL OR (char_length(\"execution_id\") = 36)),\n  CHECK (\"last_effect\" IS NULL OR (\"last_effect\" IN ('push', 'pull_request'))),\n  CHECK (\"effect_state\" IS NULL OR (\"effect_state\" IN ('dispatched', 'observed'))),\n  CHECK ((char_length(\"push_repository\") BETWEEN 3 AND 256)),\n  CHECK ((char_length(\"repository\") BETWEEN 3 AND 256)),\n  CHECK ((char_length(\"branch\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"base_branch\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"source_head_commit\") IN (40, 64))),\n  CHECK ((char_length(\"source_index_tree\") IN (40, 64))),\n  CHECK ((char_length(\"workspace_tree\") IN (40, 64))),\n  CHECK (\"head_commit\" IS NULL OR (char_length(\"head_commit\") IN (40, 64))),\n  CHECK (\"pull_request_url\" IS NULL OR (char_length(\"pull_request_url\") BETWEEN 1 AND 2048)),\n  CHECK (\"error_code\" IS NULL OR (char_length(\"error_code\") BETWEEN 1 AND 64)),\n  CHECK (\"next_action\" IS NULL OR (char_length(\"next_action\") BETWEEN 1 AND 1024)),\n  CHECK ((\"created_at_ms\" >= 0)),\n  CHECK ((\"updated_at_ms\" >= \"created_at_ms\")),\n  CHECK (((\"status\" = 'publishing') AND \"gateway_instance_id\" IS NOT NULL AND \"execution_id\" IS NOT NULL) OR (\"status\" <> 'publishing')),\n  CHECK ((\"last_effect\" IS NULL AND \"effect_state\" IS NULL) OR (\"last_effect\" IS NOT NULL AND \"effect_state\" IS NOT NULL)),\n  CHECK (((\"status\" = 'published') AND \"pull_request_url\" IS NOT NULL AND \"head_commit\" IS NOT NULL AND \"error_code\" IS NULL AND \"next_action\" IS NULL) OR ((\"status\" = 'failed') AND \"error_code\" IS NOT NULL AND \"next_action\" IS NOT NULL) OR ((\"status\" IN ('requested', 'publishing', 'needs_confirmation')) AND \"error_code\" IS NULL AND \"next_action\" IS NULL)),\n  UNIQUE (\"owner_profile_id\", \"session_id\", \"idempotency_key\")\n);\n\nCREATE INDEX \"idx_github_personal_publication_owner_session\" ON \"github_personal_publication_requests\" ((\"owner_profile_id\") ASC, (\"session_id\") ASC, (\"created_at_ms\") ASC);\n\nCREATE INDEX \"idx_github_personal_publication_pending\" ON \"github_personal_publication_requests\" ((\"status\") ASC, (\"updated_at_ms\") ASC, (\"request_id\") ASC);\n"
		},
		{
			id: "cron_job_runtime_authorities",
			tables: ["cron_job_runtime_authorities"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"cron_job_runtime_authorities\" (\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"job_id\" text COLLATE \"C\" NOT NULL,\n  \"authority_json\" text COLLATE \"C\",\n  \"authority_input_fingerprint\" text COLLATE \"C\",\n  \"recovery_required\" bigint NOT NULL,\n  PRIMARY KEY (\"store_key\", \"job_id\"),\n  CHECK ((\"recovery_required\" IN (0, 1))),\n  CHECK (((\"recovery_required\" = 0) AND \"authority_json\" IS NOT NULL AND \"authority_input_fingerprint\" IS NOT NULL) OR ((\"recovery_required\" = 1) AND \"authority_json\" IS NULL AND \"authority_input_fingerprint\" IS NULL))\n);\n\nALTER TABLE \"cron_job_runtime_authorities\" ADD FOREIGN KEY (\"store_key\", \"job_id\") REFERENCES \"cron_jobs\" (\"store_key\", \"job_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "cron_run_trigger_state_retirements",
			tables: ["cron_run_trigger_state_retirements"],
			indexes: [],
			dependencies: ["cron_run_receipts"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"cron_run_trigger_state_retirements\" (\n  \"receipt_id\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"receipt_id\")\n);\n\nALTER TABLE \"cron_run_trigger_state_retirements\" ADD FOREIGN KEY (\"receipt_id\") REFERENCES \"cron_run_receipts\" (\"receipt_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "execution_identity_contexts",
			tables: ["execution_identity_contexts"],
			indexes: ["execution_identity_contexts_run_created_idx"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"execution_identity_contexts\" (\n  \"context_id\" text COLLATE \"C\" NOT NULL,\n  \"execution_id\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"coverage_state\" text COLLATE \"C\" NOT NULL,\n  \"context_bytes\" bigint NOT NULL,\n  \"context_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"context_id\"),\n  CHECK ((char_length(\"context_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"execution_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"run_id\") BETWEEN 1 AND 256)),\n  CHECK ((\"created_at\" >= 0)),\n  CHECK ((\"coverage_state\" IN ('attribution-only', 'unattributed', 'unknown', 'unsupported'))),\n  CHECK ((\"context_bytes\" BETWEEN 1 AND 16384)),\n  CHECK ((char_length(\"context_json\") > 0)),\n  UNIQUE (\"execution_id\"),\n  UNIQUE (\"created_at\", \"context_id\")\n);\n\nCREATE INDEX \"execution_identity_contexts_run_created_idx\" ON \"execution_identity_contexts\" ((\"run_id\") ASC, (\"created_at\") ASC, (\"execution_id\") ASC);\n"
		},
		{
			id: "mcp_oauth_pending_authorizations",
			tables: ["mcp_oauth_pending_authorizations"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"mcp_oauth_pending_authorizations\" (\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"create_time\" bigint NOT NULL,\n  PRIMARY KEY (\"state\")\n);\n"
		},
		{
			id: "node_worker_launch_containers",
			tables: ["node_worker_launch_containers"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_launch_containers\" (\n  \"launch_id\" text COLLATE \"C\" NOT NULL,\n  \"container_json\" text COLLATE \"C\",\n  PRIMARY KEY (\"launch_id\")\n);\n"
		},
		{
			id: "node_worker_launch_boots",
			tables: ["node_worker_launch_boots"],
			indexes: [],
			dependencies: ["node_worker_launches"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_launch_boots\" (\n  \"launch_id\" text COLLATE \"C\" NOT NULL,\n  \"boot_id\" text COLLATE \"C\",\n  PRIMARY KEY (\"launch_id\"),\n  CHECK (\"boot_id\" IS NULL OR (char_length(\"boot_id\") BETWEEN 1 AND 128))\n);\n\nALTER TABLE \"node_worker_launch_boots\" ADD FOREIGN KEY (\"launch_id\") REFERENCES \"node_worker_launches\" (\"launch_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "node_worker_launch_cleanup",
			tables: ["node_worker_launch_cleanup"],
			indexes: [],
			dependencies: ["node_worker_launches"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_launch_cleanup\" (\n  \"launch_id\" text COLLATE \"C\" NOT NULL,\n  \"cleanup_mode\" text COLLATE \"C\" NOT NULL,\n  \"lineage_settled\" bigint,\n  PRIMARY KEY (\"launch_id\"),\n  CHECK ((\"cleanup_mode\" IN ('process-group', 'owned-anchor'))),\n  CHECK (\"lineage_settled\" IS NULL OR (\"lineage_settled\" = 1))\n);\n\nALTER TABLE \"node_worker_launch_cleanup\" ADD FOREIGN KEY (\"launch_id\") REFERENCES \"node_worker_launches\" (\"launch_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "node_worker_launch_process_scopes",
			tables: ["node_worker_launch_process_scopes"],
			indexes: [],
			dependencies: ["node_worker_launches"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_launch_process_scopes\" (\n  \"launch_id\" text COLLATE \"C\" NOT NULL,\n  \"scope_kind\" text COLLATE \"C\" NOT NULL,\n  \"descendants_reaped\" bigint,\n  PRIMARY KEY (\"launch_id\"),\n  CHECK ((\"scope_kind\" = 'linux-subreaper')),\n  CHECK (\"descendants_reaped\" IS NULL OR (\"descendants_reaped\" = 1))\n);\n\nALTER TABLE \"node_worker_launch_process_scopes\" ADD FOREIGN KEY (\"launch_id\") REFERENCES \"node_worker_launches\" (\"launch_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "node_worker_launches",
			tables: ["node_worker_launches"],
			indexes: ["idx_node_worker_launches_terminal_completed"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_launches\" (\n  \"launch_id\" text COLLATE \"C\" NOT NULL,\n  \"plan_hash\" text COLLATE \"C\" NOT NULL,\n  \"gateway_namespace\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_epoch\" bigint NOT NULL,\n  \"placement_generation\" bigint NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"supervisor_pid\" bigint NOT NULL,\n  \"supervisor_start_time\" bigint NOT NULL,\n  \"worker_pid\" bigint,\n  \"worker_start_time\" bigint,\n  \"result_json\" text COLLATE \"C\",\n  \"error_text\" text COLLATE \"C\",\n  \"completed_at_ms\" bigint,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"launch_id\"),\n  CHECK ((char_length(\"launch_id\") BETWEEN 1 AND 256) AND (\"launch_id\" IS NOT NULL OR NULL)),\n  CHECK ((char_length(\"plan_hash\") = 64) AND (\"plan_hash\" COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((char_length(\"gateway_namespace\") BETWEEN 1 AND 128) AND (\"gateway_namespace\" COLLATE \"C\" !~ '\\A.*[^A-Za-z0-9._-].*\\Z') AND (\"gateway_namespace\" COLLATE \"C\" ~ '\\A[A-Za-z0-9].*\\Z')),\n  CHECK ((char_length(\"environment_id\") BETWEEN 1 AND 256) AND (\"environment_id\" IS NOT NULL OR NULL)),\n  CHECK ((char_length(\"session_id\") BETWEEN 1 AND 256) AND (\"session_id\" IS NOT NULL OR NULL)),\n  CHECK ((\"owner_epoch\" BETWEEN 1 AND 9007199254740991)),\n  CHECK ((\"placement_generation\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((char_length(\"run_id\") BETWEEN 1 AND 256) AND (\"run_id\" IS NOT NULL OR NULL)),\n  CHECK ((\"state\" IN ('pending', 'running', 'completed', 'failed', 'interrupted', 'cancelled'))),\n  CHECK ((\"supervisor_pid\" BETWEEN 1 AND 2147483647)),\n  CHECK ((\"supervisor_start_time\" BETWEEN 0 AND 9007199254740991)),\n  CHECK (\"worker_pid\" IS NULL OR (\"worker_pid\" BETWEEN 1 AND 2147483647)),\n  CHECK (\"worker_start_time\" IS NULL OR (\"worker_start_time\" BETWEEN 0 AND 9007199254740991)),\n  CHECK (\"result_json\" IS NULL OR ((octet_length(convert_to(\"result_json\", 'UTF8')) BETWEEN 1 AND 65536) AND (\"result_json\" IS NOT NULL OR NULL) AND (\"result_json\" IS JSON))),\n  CHECK (\"error_text\" IS NULL OR ((octet_length(convert_to(\"error_text\", 'UTF8')) BETWEEN 1 AND 4096) AND (\"error_text\" IS NOT NULL OR NULL) AND (strpos(\"error_text\", '\n') = 0) AND (strpos(\"error_text\", '\r') = 0))),\n  CHECK (\"completed_at_ms\" IS NULL OR (\"completed_at_ms\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((\"created_at_ms\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((\"updated_at_ms\" BETWEEN \"created_at_ms\" AND 9007199254740991)),\n  CHECK (((\"worker_pid\" IS NULL) = (\"worker_start_time\" IS NULL))),\n  CHECK (((\"state\" = 'pending') AND \"worker_pid\" IS NULL AND \"result_json\" IS NULL AND \"error_text\" IS NULL AND \"completed_at_ms\" IS NULL) OR ((\"state\" = 'running') AND \"worker_pid\" IS NOT NULL AND \"result_json\" IS NULL AND \"error_text\" IS NULL AND \"completed_at_ms\" IS NULL) OR ((\"state\" = 'completed') AND \"result_json\" IS NOT NULL AND \"error_text\" IS NULL AND (\"completed_at_ms\" BETWEEN \"created_at_ms\" AND \"updated_at_ms\")) OR ((\"state\" IN ('failed', 'interrupted', 'cancelled')) AND \"result_json\" IS NULL AND \"error_text\" IS NOT NULL AND (\"completed_at_ms\" BETWEEN \"created_at_ms\" AND \"updated_at_ms\")))\n);\n\nCREATE INDEX \"idx_node_worker_launches_terminal_completed\" ON \"node_worker_launches\" ((\"completed_at_ms\") ASC, (\"launch_id\") ASC) WHERE \"completed_at_ms\" IS NOT NULL;\n"
		},
		{
			id: "node_worker_prepared_workspaces",
			tables: ["node_worker_prepared_workspaces"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_prepared_workspaces\" (\n  \"preparation_key\" text COLLATE \"C\" NOT NULL,\n  \"cache_key\" text COLLATE \"C\" NOT NULL,\n  \"gateway_namespace\" text COLLATE \"C\" NOT NULL,\n  \"workspace_dir\" text COLLATE \"C\" NOT NULL,\n  \"home_dir\" text COLLATE \"C\" NOT NULL,\n  \"source_manifest_ref\" text COLLATE \"C\" NOT NULL,\n  \"prepared_manifest_ref\" text COLLATE \"C\" NOT NULL,\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\",\n  \"owner_epoch\" bigint,\n  \"created_at_ms\" bigint NOT NULL,\n  \"bound_at_ms\" bigint,\n  \"retired_at_ms\" bigint,\n  PRIMARY KEY (\"preparation_key\"),\n  CHECK ((char_length(\"preparation_key\") = 64) AND (\"preparation_key\" COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((char_length(\"cache_key\") = 64) AND (\"cache_key\" COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((char_length(\"gateway_namespace\") > 0)),\n  CHECK ((char_length(\"workspace_dir\") > 0)),\n  CHECK ((char_length(\"home_dir\") > 0)),\n  CHECK ((char_length(\"source_manifest_ref\") = 71) AND (substr(\"source_manifest_ref\", 1, 7) = 'sha256:') AND (substr(\"source_manifest_ref\", 8) COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((char_length(\"prepared_manifest_ref\") = 71) AND (substr(\"prepared_manifest_ref\", 1, 7) = 'sha256:') AND (substr(\"prepared_manifest_ref\", 8) COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((\"state\" IN ('available', 'bound', 'retiring', 'retired'))),\n  CHECK ((char_length(\"environment_id\") > 0)),\n  CHECK ((\"owner_epoch\" BETWEEN 1 AND 9007199254740991)),\n  CHECK ((\"created_at_ms\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((\"bound_at_ms\" BETWEEN \"created_at_ms\" AND 9007199254740991)),\n  CHECK ((\"retired_at_ms\" BETWEEN coalesce(\"bound_at_ms\", \"created_at_ms\") AND 9007199254740991)),\n  CHECK ((\"session_id\" IS NULL AND \"session_key\" IS NULL AND \"owner_epoch\" IS NULL AND \"bound_at_ms\" IS NULL) OR (\"session_id\" IS NOT NULL AND (char_length(\"session_id\") > 0) AND \"session_key\" IS NOT NULL AND (char_length(\"session_key\") > 0) AND \"owner_epoch\" IS NOT NULL AND \"bound_at_ms\" IS NOT NULL)),\n  CHECK (((\"state\" = 'available') AND \"bound_at_ms\" IS NULL AND \"retired_at_ms\" IS NULL) OR ((\"state\" = 'bound') AND \"bound_at_ms\" IS NOT NULL AND \"retired_at_ms\" IS NULL) OR ((\"state\" = 'retiring') AND \"retired_at_ms\" IS NULL) OR ((\"state\" = 'retired') AND \"retired_at_ms\" IS NOT NULL)),\n  UNIQUE (\"workspace_dir\")\n);\n"
		},
		{
			id: "node_worker_turns",
			tables: ["node_worker_turns"],
			indexes: ["idx_node_worker_turns_terminal_completed", "idx_node_worker_turns_active_owner"],
			dependencies: ["node_worker_launches"],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"node_worker_turns\" (\n  \"turn_id\" text COLLATE \"C\" NOT NULL,\n  \"owner_launch_id\" text COLLATE \"C\" NOT NULL,\n  \"plan_hash\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"state\" text COLLATE \"C\" NOT NULL,\n  \"result_json\" text COLLATE \"C\",\n  \"error_text\" text COLLATE \"C\",\n  \"completed_at_ms\" bigint,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"turn_id\"),\n  CHECK ((char_length(\"turn_id\") BETWEEN 1 AND 256) AND (\"turn_id\" IS NOT NULL OR NULL)),\n  CHECK ((char_length(\"plan_hash\") = 64) AND (\"plan_hash\" COLLATE \"C\" !~ '\\A.*[^0-9a-f].*\\Z')),\n  CHECK ((char_length(\"run_id\") BETWEEN 1 AND 256) AND (\"run_id\" IS NOT NULL OR NULL)),\n  CHECK ((\"state\" IN ('running', 'completed', 'failed', 'interrupted', 'cancelled'))),\n  CHECK (\"result_json\" IS NULL OR ((octet_length(convert_to(\"result_json\", 'UTF8')) BETWEEN 1 AND 65536) AND (\"result_json\" IS NOT NULL OR NULL) AND (\"result_json\" IS JSON))),\n  CHECK (\"error_text\" IS NULL OR ((octet_length(convert_to(\"error_text\", 'UTF8')) BETWEEN 1 AND 4096) AND (\"error_text\" IS NOT NULL OR NULL) AND (strpos(\"error_text\", '\n') = 0) AND (strpos(\"error_text\", '\r') = 0))),\n  CHECK (\"completed_at_ms\" IS NULL OR (\"completed_at_ms\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((\"created_at_ms\" BETWEEN 0 AND 9007199254740991)),\n  CHECK ((\"updated_at_ms\" BETWEEN \"created_at_ms\" AND 9007199254740991)),\n  CHECK (((\"state\" = 'running') AND \"result_json\" IS NULL AND \"error_text\" IS NULL AND \"completed_at_ms\" IS NULL) OR ((\"state\" = 'completed') AND \"result_json\" IS NOT NULL AND \"error_text\" IS NULL AND (\"completed_at_ms\" BETWEEN \"created_at_ms\" AND \"updated_at_ms\")) OR ((\"state\" IN ('failed', 'interrupted', 'cancelled')) AND \"result_json\" IS NULL AND \"error_text\" IS NOT NULL AND (\"completed_at_ms\" BETWEEN \"created_at_ms\" AND \"updated_at_ms\")))\n);\n\nCREATE UNIQUE INDEX \"idx_node_worker_turns_active_owner\" ON \"node_worker_turns\" ((\"owner_launch_id\") ASC) WHERE (\"state\" = 'running');\n\nCREATE INDEX \"idx_node_worker_turns_terminal_completed\" ON \"node_worker_turns\" ((\"completed_at_ms\") ASC, (\"turn_id\") ASC) WHERE \"completed_at_ms\" IS NOT NULL;\n\nALTER TABLE \"node_worker_turns\" ADD FOREIGN KEY (\"owner_launch_id\") REFERENCES \"node_worker_launches\" (\"launch_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "operator_approval_execution_identities",
			tables: ["operator_approval_execution_identities"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"operator_approval_execution_identities\" (\n  \"approval_id\" text COLLATE \"C\" NOT NULL,\n  \"source_context_id\" text COLLATE \"C\" NOT NULL,\n  \"source_execution_id\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"approval_id\"),\n  CHECK ((char_length(\"source_context_id\") BETWEEN 1 AND 256) AND (\"source_context_id\" = btrim(\"source_context_id\"))),\n  CHECK ((char_length(\"source_execution_id\") BETWEEN 1 AND 256) AND (\"source_execution_id\" = btrim(\"source_execution_id\")))\n);\n\nALTER TABLE \"operator_approval_execution_identities\" ADD FOREIGN KEY (\"approval_id\") REFERENCES \"operator_approvals\" (\"approval_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "web_push_approval_deliveries",
			tables: ["web_push_approval_deliveries"],
			indexes: ["idx_web_push_approval_deliveries_subscription"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"web_push_approval_deliveries\" (\n  \"approval_id\" text COLLATE \"C\" NOT NULL,\n  \"subscription_id\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"user_profile_id\" text COLLATE \"C\",\n  \"prepared_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"approval_id\", \"subscription_id\")\n);\n\nCREATE INDEX \"idx_web_push_approval_deliveries_subscription\" ON \"web_push_approval_deliveries\" ((\"subscription_id\") ASC, (\"approval_id\") ASC);\n\nALTER TABLE \"web_push_approval_deliveries\" ADD FOREIGN KEY (\"subscription_id\") REFERENCES \"web_push_subscriptions\" (\"subscription_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n\nALTER TABLE \"web_push_approval_deliveries\" ADD FOREIGN KEY (\"approval_id\") REFERENCES \"operator_approvals\" (\"approval_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "execution_decision_facts",
			tables: ["execution_decision_facts"],
			indexes: [
				"execution_decision_facts_cursor_id_idx",
				"execution_decision_facts_context_occurred_idx",
				"execution_decision_facts_run_occurred_idx"
			],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"execution_decision_facts\" (\n  \"cursor_id\" bigint NOT NULL,\n  \"receipt_id\" text COLLATE \"C\" NOT NULL,\n  \"context_id\" text COLLATE \"C\" NOT NULL,\n  \"execution_id\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  \"action_id\" text COLLATE \"C\",\n  \"action_family\" text COLLATE \"C\" NOT NULL,\n  \"decision_outcome\" text COLLATE \"C\" NOT NULL,\n  \"coverage_state\" text COLLATE \"C\" NOT NULL,\n  \"reason_code\" text COLLATE \"C\" NOT NULL,\n  \"owner\" text COLLATE \"C\" NOT NULL,\n  \"source_ref\" text COLLATE \"C\" NOT NULL,\n  \"occurred_at\" bigint NOT NULL,\n  \"receipt_bytes\" bigint NOT NULL,\n  \"receipt_json\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"receipt_id\"),\n  CHECK ((char_length(\"receipt_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"context_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"execution_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"run_id\") BETWEEN 1 AND 256)),\n  CHECK (\"action_id\" IS NULL OR (char_length(\"action_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"action_family\") BETWEEN 1 AND 256)),\n  CHECK ((\"decision_outcome\" IN ('allowed', 'denied', 'not-applicable', 'unknown'))),\n  CHECK ((\"coverage_state\" IN ('enforced', 'attribution-only', 'unattributed', 'unknown', 'unsupported'))),\n  CHECK ((char_length(\"reason_code\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"owner\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"source_ref\") BETWEEN 1 AND 256)),\n  CHECK ((\"occurred_at\" >= 0)),\n  CHECK ((\"receipt_bytes\" BETWEEN 1 AND 16384)),\n  CHECK ((char_length(\"receipt_json\") > 0)),\n  UNIQUE (\"occurred_at\", \"receipt_id\")\n);\n\nCREATE INDEX \"execution_decision_facts_context_occurred_idx\" ON \"execution_decision_facts\" ((\"context_id\") ASC, (\"occurred_at\") ASC, (\"receipt_id\") ASC);\n\nCREATE UNIQUE INDEX \"execution_decision_facts_cursor_id_idx\" ON \"execution_decision_facts\" ((\"cursor_id\") ASC);\n\nCREATE INDEX \"execution_decision_facts_run_occurred_idx\" ON \"execution_decision_facts\" ((\"run_id\") ASC, (\"occurred_at\") ASC, (\"receipt_id\") ASC);\n"
		},
		{
			id: "execution_owner_lifecycle_bindings",
			tables: ["execution_owner_lifecycle_bindings"],
			indexes: [],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"execution_owner_lifecycle_bindings\" (\n  \"owner_kind\" text COLLATE \"C\" NOT NULL,\n  \"owner_id\" text COLLATE \"C\" NOT NULL,\n  \"context_id\" text COLLATE \"C\" NOT NULL,\n  \"execution_id\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"owner_kind\", \"owner_id\")\n);\n"
		},
		{
			id: "outbound_message_execution_bindings",
			tables: ["outbound_message_execution_bindings"],
			indexes: ["outbound_message_execution_bindings_execution_event_idx"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"outbound_message_execution_bindings\" (\n  \"event_id\" text COLLATE \"C\" NOT NULL,\n  \"context_id\" text COLLATE \"C\" NOT NULL,\n  \"execution_id\" text COLLATE \"C\" NOT NULL,\n  \"run_id\" text COLLATE \"C\" NOT NULL,\n  PRIMARY KEY (\"event_id\"),\n  CHECK ((char_length(\"context_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"execution_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"run_id\") BETWEEN 1 AND 256))\n);\n\nCREATE INDEX \"outbound_message_execution_bindings_execution_event_idx\" ON \"outbound_message_execution_bindings\" ((\"context_id\") ASC, (\"execution_id\") ASC, (\"run_id\") ASC, (\"event_id\") ASC);\n\nALTER TABLE \"outbound_message_execution_bindings\" ADD FOREIGN KEY (\"event_id\") REFERENCES \"audit_events\" (\"event_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "outbound_message_progress",
			tables: ["outbound_message_progress"],
			indexes: ["outbound_message_progress_occurred_idx", "outbound_message_progress_run_occurred_idx"],
			dependencies: [],
			activation: "first-use",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"outbound_message_progress\" (\n  \"sequence\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"progress_id\" text COLLATE \"C\" NOT NULL,\n  \"source_id\" text COLLATE \"C\" NOT NULL,\n  \"source_sequence\" bigint NOT NULL,\n  \"schema_version\" bigint NOT NULL,\n  \"occurred_at\" bigint NOT NULL,\n  \"action\" text COLLATE \"C\" NOT NULL,\n  \"outcome\" text COLLATE \"C\" NOT NULL,\n  \"actor_type\" text COLLATE \"C\" NOT NULL,\n  \"actor_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"context_id\" text COLLATE \"C\",\n  \"execution_id\" text COLLATE \"C\",\n  \"channel\" text COLLATE \"C\" NOT NULL,\n  \"conversation_kind\" text COLLATE \"C\" NOT NULL,\n  \"duration_ms\" bigint,\n  \"account_ref\" text COLLATE \"C\",\n  \"conversation_ref\" text COLLATE \"C\",\n  \"target_ref\" text COLLATE \"C\",\n  PRIMARY KEY (\"sequence\"),\n  CHECK ((char_length(\"progress_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"source_id\") BETWEEN 1 AND 512)),\n  CHECK ((\"source_sequence\" >= 1)),\n  CHECK ((\"schema_version\" = 1)),\n  CHECK ((\"occurred_at\" >= 0)),\n  CHECK ((\"action\" IN ('message.outbound.queued', 'message.outbound.platform-started'))),\n  CHECK ((\"outcome\" IN ('queued', 'platform_started'))),\n  CHECK ((\"actor_type\" IN ('agent', 'system'))),\n  CHECK ((char_length(\"actor_id\") BETWEEN 1 AND 256)),\n  CHECK (\"agent_id\" IS NULL OR (char_length(\"agent_id\") BETWEEN 1 AND 256)),\n  CHECK (\"run_id\" IS NULL OR (char_length(\"run_id\") BETWEEN 1 AND 256)),\n  CHECK ((char_length(\"channel\") BETWEEN 1 AND 256)),\n  CHECK ((\"conversation_kind\" IN ('direct', 'group', 'channel', 'unknown'))),\n  CHECK (\"duration_ms\" IS NULL OR (\"duration_ms\" >= 0)),\n  UNIQUE (\"progress_id\"),\n  UNIQUE (\"source_id\"),\n  UNIQUE (\"occurred_at\", \"progress_id\")\n);\n\nCREATE INDEX \"outbound_message_progress_occurred_idx\" ON \"outbound_message_progress\" ((\"occurred_at\") ASC, (\"sequence\") ASC);\n\nCREATE INDEX \"outbound_message_progress_run_occurred_idx\" ON \"outbound_message_progress\" ((\"run_id\") ASC NULLS FIRST, (\"occurred_at\") ASC, (\"sequence\") ASC);\n"
		},
		{
			id: "agent_provenance",
			tables: ["agent_provenance"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"agent_provenance\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"created_via\" text COLLATE \"C\" NOT NULL,\n  \"creator_agent_id\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"agent_id\"),\n  CHECK ((\"created_via\" IN ('operator', 'agent', 'template')))\n);\n"
		},
		{
			id: "cron_run_receipts",
			tables: ["cron_run_receipts"],
			indexes: [
				"cron_run_receipts_cursor_id_idx",
				"idx_cron_run_receipts_active_job",
				"idx_cron_run_receipts_job_history"
			],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"cron_run_receipts\" (\n  \"cursor_id\" bigint NOT NULL,\n  \"receipt_id\" text COLLATE \"C\" NOT NULL,\n  \"store_key\" text COLLATE \"C\" NOT NULL,\n  \"job_id\" text COLLATE \"C\" NOT NULL,\n  \"config_revision\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"request_run_id\" text COLLATE \"C\",\n  \"delivery_attempt_state\" text COLLATE \"C\" NOT NULL DEFAULT 'unknown',\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"owner_pid\" bigint NOT NULL,\n  \"owner_start_time\" bigint,\n  \"started_at_ms\" bigint NOT NULL,\n  \"finished_at_ms\" bigint,\n  \"error_text\" text COLLATE \"C\",\n  PRIMARY KEY (\"receipt_id\"),\n  CHECK ((\"delivery_attempt_state\" IN ('unknown', 'not-started', 'started'))),\n  CHECK ((\"status\" IN ('running', 'ok', 'error', 'skipped', 'interrupted', 'superseded'))),\n  CHECK (((\"status\" = 'running') AND \"finished_at_ms\" IS NULL) OR ((\"status\" != 'running') AND \"finished_at_ms\" IS NOT NULL))\n);\n\nCREATE UNIQUE INDEX \"cron_run_receipts_cursor_id_idx\" ON \"cron_run_receipts\" ((\"cursor_id\") ASC);\n\nCREATE UNIQUE INDEX \"idx_cron_run_receipts_active_job\" ON \"cron_run_receipts\" ((\"store_key\") ASC, (\"job_id\") ASC) WHERE (\"status\" = 'running');\n\nCREATE INDEX \"idx_cron_run_receipts_job_history\" ON \"cron_run_receipts\" ((\"store_key\") ASC, (\"job_id\") ASC, (\"started_at_ms\") DESC, (\"receipt_id\") DESC);\n"
		},
		{
			id: "config_revision_keys",
			tables: ["config_revision_keys"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"config_revision_keys\" (\n  \"id\" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,\n  \"hmac_key\" bytea NOT NULL,\n  PRIMARY KEY (\"id\"),\n  CHECK ((\"id\" = 1)),\n  CHECK ((octet_length(\"hmac_key\") = 32))\n);\n"
		},
		{
			id: "secret_store_entries",
			tables: ["secret_store_entries"],
			indexes: ["secret_store_entries_live_idx"],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"secret_store_entries\" (\n  \"scope_kind\" text COLLATE \"C\" NOT NULL,\n  \"scope_id\" text COLLATE \"C\" NOT NULL,\n  \"name\" text COLLATE \"C\" NOT NULL,\n  \"value\" text COLLATE \"C\" NOT NULL,\n  \"kind\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"updated_by\" text COLLATE \"C\",\n  \"deleted_at_ms\" bigint,\n  \"allowed_hosts\" text COLLATE \"C\",\n  PRIMARY KEY (\"scope_kind\", \"scope_id\", \"name\"),\n  CHECK ((\"scope_kind\" IN ('team', 'identity'))),\n  CHECK ((\"kind\" IN ('secret', 'env'))),\n  CHECK ((\"created_at_ms\" >= 0)),\n  CHECK ((\"updated_at_ms\" >= 0)),\n  CHECK (((\"scope_kind\" = 'team') AND (\"scope_id\" = '')) OR ((\"scope_kind\" = 'identity') AND (char_length(\"scope_id\") > 0)))\n);\n\nCREATE INDEX \"secret_store_entries_live_idx\" ON \"secret_store_entries\" ((\"scope_kind\") ASC, (\"scope_id\") ASC, (\"name\") ASC) WHERE \"deleted_at_ms\" IS NULL;\n"
		},
		{
			id: "projects",
			tables: ["projects"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"projects\" (\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"display_name\" text COLLATE \"C\" NOT NULL,\n  \"repo_root\" text COLLATE \"C\" NOT NULL,\n  \"origin_url\" text COLLATE \"C\",\n  \"source\" text COLLATE \"C\" NOT NULL,\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"id\"),\n  CHECK ((\"source\" IN ('registered', 'cloned')))\n);\n"
		},
		{
			id: "worktree_templates",
			tables: ["worktree_templates"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"worktree_templates\" (\n  \"cache_key\" text COLLATE \"C\" NOT NULL,\n  \"id\" text COLLATE \"C\" NOT NULL,\n  \"repo_root\" text COLLATE \"C\" NOT NULL,\n  \"common_dir\" text COLLATE \"C\" NOT NULL,\n  \"worktree_root\" text COLLATE \"C\" NOT NULL,\n  \"path\" text COLLATE \"C\" NOT NULL,\n  \"backend\" text COLLATE \"C\" NOT NULL,\n  \"source_commit\" text COLLATE \"C\" NOT NULL,\n  \"content_key\" text COLLATE \"C\" NOT NULL,\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"created_at\" bigint NOT NULL,\n  \"last_used_at\" bigint NOT NULL,\n  PRIMARY KEY (\"cache_key\"),\n  CHECK ((\"status\" IN ('preparing', 'ready'))),\n  UNIQUE (\"id\")\n);\n"
		},
		{
			id: "user_preferences",
			tables: ["user_preferences"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"user_preferences\" (\n  \"profile_id\" text COLLATE \"C\" NOT NULL,\n  \"pref_key\" text COLLATE \"C\" NOT NULL,\n  \"value_json\" text COLLATE \"C\" NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"profile_id\", \"pref_key\")\n);\n"
		},
		{
			id: "device_pair_setup_completions",
			tables: ["device_pair_setup_completions"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"device_pair_setup_completions\" (\n  \"setup_id\" text COLLATE \"C\" NOT NULL,\n  \"device_id\" text COLLATE \"C\" NOT NULL,\n  \"device_name\" text COLLATE \"C\",\n  \"access\" text COLLATE \"C\" NOT NULL,\n  \"completed_at_ms\" bigint NOT NULL,\n  \"delivery_state\" text COLLATE \"C\" NOT NULL,\n  \"retain_until_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"setup_id\"),\n  CHECK ((\"delivery_state\" IN ('uncertain', 'confirmed')))\n);\n"
		},
		{
			id: "github_publication_requests",
			tables: ["github_publication_requests"],
			indexes: ["idx_github_publication_requests_pending"],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"github_publication_requests\" (\n  \"request_id\" text COLLATE \"C\" NOT NULL,\n  \"idempotency_key\" text COLLATE \"C\" NOT NULL,\n  \"request_digest\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"session_key\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"worktree_id\" text COLLATE \"C\" NOT NULL,\n  \"repository_fingerprint\" text COLLATE \"C\" NOT NULL,\n  \"claim_id\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"environment_id\" text COLLATE \"C\",\n  \"owner_epoch\" bigint,\n  \"placement_generation\" bigint,\n  \"identity_source\" text COLLATE \"C\" NOT NULL,\n  \"identity_profile_id\" text COLLATE \"C\",\n  \"identity_account_id\" bigint NOT NULL,\n  \"identity_login\" text COLLATE \"C\" NOT NULL,\n  \"title\" text COLLATE \"C\",\n  \"body\" text COLLATE \"C\",\n  \"status\" text COLLATE \"C\" NOT NULL,\n  \"gateway_instance_id\" text COLLATE \"C\",\n  \"repository\" text COLLATE \"C\",\n  \"branch\" text COLLATE \"C\" NOT NULL,\n  \"base_branch\" text COLLATE \"C\",\n  \"source_head_commit\" text COLLATE \"C\",\n  \"source_index_tree\" text COLLATE \"C\",\n  \"workspace_tree\" text COLLATE \"C\",\n  \"head_commit\" text COLLATE \"C\",\n  \"pull_request_url\" text COLLATE \"C\",\n  \"error_code\" text COLLATE \"C\",\n  \"next_action\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  \"reported_at_ms\" bigint,\n  \"draft\" bigint,\n  PRIMARY KEY (\"request_id\"),\n  CHECK (\"owner_epoch\" IS NULL OR (\"owner_epoch\" >= 1)),\n  CHECK (\"placement_generation\" IS NULL OR (\"placement_generation\" >= 0)),\n  CHECK ((\"identity_source\" IN ('system-detected', 'system-configured', 'agent-override'))),\n  CHECK ((\"identity_account_id\" >= 1)),\n  CHECK ((\"status\" IN ('requested', 'publishing', 'published', 'failed'))),\n  CHECK ((\"claim_id\" IS NULL AND \"run_id\" IS NULL AND \"environment_id\" IS NULL AND \"owner_epoch\" IS NULL AND \"placement_generation\" IS NULL) OR (\"claim_id\" IS NOT NULL AND \"run_id\" IS NOT NULL AND \"placement_generation\" IS NOT NULL AND ((\"environment_id\" IS NULL AND \"owner_epoch\" IS NULL) OR (\"environment_id\" IS NOT NULL AND \"owner_epoch\" IS NOT NULL)))),\n  CHECK ((\"identity_source\" IS NOT DISTINCT FROM 'system-detected' AND \"identity_profile_id\" IS NULL) OR ((\"identity_source\" IN ('system-configured', 'agent-override')) AND \"identity_profile_id\" IS NOT NULL)),\n  CHECK ((\"source_head_commit\" IS NULL AND \"source_index_tree\" IS NULL AND \"workspace_tree\" IS NULL) OR (\"source_head_commit\" IS NOT NULL AND \"workspace_tree\" IS NOT NULL)),\n  CHECK ((\"status\" IS NOT DISTINCT FROM 'published' AND \"pull_request_url\" IS NOT NULL AND \"error_code\" IS NULL AND \"next_action\" IS NULL) OR (\"status\" IS NOT DISTINCT FROM 'failed' AND \"pull_request_url\" IS NULL AND \"error_code\" IS NOT NULL AND \"next_action\" IS NOT NULL) OR ((\"status\" IN ('requested', 'publishing')) AND \"pull_request_url\" IS NULL AND \"error_code\" IS NULL AND \"next_action\" IS NULL)),\n  UNIQUE (\"session_id\", \"idempotency_key\")\n);\n\nCREATE INDEX \"idx_github_publication_requests_pending\" ON \"github_publication_requests\" ((\"status\") ASC, (\"updated_at_ms\") ASC, (\"request_id\") ASC);\n"
		},
		{
			id: "device_pairing_join_codes",
			tables: ["device_pairing_join_codes"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"device_pairing_join_codes\" (\n  \"shortcode\" text COLLATE \"C\",\n  \"payload_json\" text COLLATE \"C\",\n  \"created_at_ms\" bigint,\n  \"expires_at_ms\" bigint\n);\n"
		},
		{
			id: "skill_workshop_changes",
			tables: ["skill_workshop_changes"],
			indexes: ["skill_workshop_changes_cursor_id_idx", "idx_skill_workshop_changes_agent_time"],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"skill_workshop_changes\" (\n  \"cursor_id\" bigint NOT NULL,\n  \"change_id\" text COLLATE \"C\" NOT NULL,\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"skill_name\" text COLLATE \"C\" NOT NULL,\n  \"action\" text COLLATE \"C\" NOT NULL,\n  \"actor\" text COLLATE \"C\" NOT NULL,\n  \"summary\" text COLLATE \"C\" NOT NULL,\n  \"version_id\" text COLLATE \"C\",\n  \"session_key\" text COLLATE \"C\",\n  \"run_id\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"change_id\"),\n  CHECK ((\"action\" IN ('create', 'patch', 'write_file', 'remove_file', 'archive', 'restore'))),\n  CHECK ((\"actor\" IN ('agent', 'review', 'curator', 'user')))\n);\n\nCREATE INDEX \"idx_skill_workshop_changes_agent_time\" ON \"skill_workshop_changes\" ((\"agent_id\") ASC, (\"created_at_ms\") ASC);\n\nCREATE UNIQUE INDEX \"skill_workshop_changes_cursor_id_idx\" ON \"skill_workshop_changes\" ((\"cursor_id\") ASC);\n"
		},
		{
			id: "worker_environment_ssh_fallback_ports",
			tables: ["worker_environment_ssh_fallback_ports"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"worker_environment_ssh_fallback_ports\" (\n  \"environment_id\" text COLLATE \"C\" NOT NULL,\n  \"position\" bigint NOT NULL,\n  \"port\" bigint NOT NULL,\n  PRIMARY KEY (\"environment_id\", \"position\"),\n  CHECK ((\"position\" >= 0) AND (\"position\" <= 9)),\n  CHECK ((\"port\" >= 1) AND (\"port\" <= 65535)),\n  UNIQUE (\"environment_id\", \"port\")\n);\n\nALTER TABLE \"worker_environment_ssh_fallback_ports\" ADD FOREIGN KEY (\"environment_id\") REFERENCES \"worker_environments\" (\"environment_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "worker_session_placement_moves",
			tables: ["worker_session_placement_moves"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"worker_session_placement_moves\" (\n  \"operation_id\" text COLLATE \"C\" NOT NULL,\n  \"session_id\" text COLLATE \"C\" NOT NULL,\n  \"source_generation\" bigint NOT NULL,\n  \"source_environment_id\" text COLLATE \"C\" NOT NULL,\n  \"source_owner_epoch\" bigint NOT NULL,\n  \"target_kind\" text COLLATE \"C\" NOT NULL,\n  \"target_id\" text COLLATE \"C\",\n  \"target_machine_class\" text COLLATE \"C\",\n  \"target_os\" text COLLATE \"C\",\n  \"abandon_source\" bigint,\n  \"last_error\" text COLLATE \"C\",\n  \"created_at_ms\" bigint NOT NULL,\n  \"updated_at_ms\" bigint NOT NULL,\n  PRIMARY KEY (\"operation_id\"),\n  CHECK ((\"source_generation\" >= 0)),\n  CHECK ((char_length(\"source_environment_id\") BETWEEN 1 AND 256) AND (\"source_environment_id\" = btrim(\"source_environment_id\"))),\n  CHECK ((\"source_owner_epoch\" >= 1)),\n  CHECK ((\"target_kind\" IN ('gateway', 'profile', 'device'))),\n  CHECK ((\"target_kind\" IS NOT DISTINCT FROM 'gateway' AND \"target_id\" IS NULL) OR ((\"target_kind\" IN ('profile', 'device')) AND \"target_id\" IS NOT NULL AND (char_length(\"target_id\") BETWEEN 1 AND 256) AND (\"target_id\" = btrim(\"target_id\")))),\n  UNIQUE (\"session_id\")\n);\n\nALTER TABLE \"worker_session_placement_moves\" ADD FOREIGN KEY (\"session_id\") REFERENCES \"worker_session_placements\" (\"session_id\") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;\n"
		},
		{
			id: "agent_deletion_journal",
			tables: ["agent_deletion_journal"],
			indexes: [],
			dependencies: [],
			activation: "version-additive",
			sql: "-- Generated runtime DDL; the owner supplies search_path and the transaction.\n\nCREATE TABLE \"agent_deletion_journal\" (\n  \"agent_id\" text COLLATE \"C\" NOT NULL,\n  \"operation_id\" text COLLATE \"C\" NOT NULL DEFAULT '',\n  \"phase\" text COLLATE \"C\",\n  \"agent_dir\" text COLLATE \"C\" NOT NULL,\n  \"workspace_dir\" text COLLATE \"C\" NOT NULL,\n  \"sessions_dir\" text COLLATE \"C\" NOT NULL,\n  \"database_paths_json\" text COLLATE \"C\" NOT NULL DEFAULT '[]',\n  \"cleanup_paths_json\" text COLLATE \"C\" NOT NULL DEFAULT '[]',\n  \"created_at\" bigint NOT NULL,\n  \"cleanup_completed\" bigint NOT NULL DEFAULT 0,\n  \"delete_files\" bigint NOT NULL DEFAULT 1,\n  PRIMARY KEY (\"agent_id\")\n);\n"
		}
	],
	expectedCatalog: [
		{
			table: "acp_replay_events",
			kind: "table",
			value: null
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "seq",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "update_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "acp_replay_events",
			kind: "column",
			value: {
				name: "estimated_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 7
			}
		},
		{
			table: "acp_replay_events",
			kind: "primaryKey",
			value: ["session_id", "seq"]
		},
		{
			table: "acp_replay_events",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "acp_replay_sessions",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "acp_replay_events",
			kind: "indexes",
			value: 1
		},
		{
			table: "acp_replay_events",
			kind: "checks",
			value: 0
		},
		{
			table: "acp_replay_sessions",
			kind: "table",
			value: null
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "cwd",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "complete",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "next_seq",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "column",
			value: {
				name: "estimated_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 8
			}
		},
		{
			table: "acp_replay_sessions",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "acp_replay_sessions",
			kind: "indexes",
			value: 3
		},
		{
			table: "acp_replay_sessions",
			kind: "checks",
			value: 0
		},
		{
			table: "acp_sessions",
			kind: "table",
			value: null
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "backend",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "agent",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "runtime_session_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "identity_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "resume_agent_session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "resume_acpx_session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "mode",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "runtime_options_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "cwd",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "last_activity_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "last_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "acp_sessions",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "acp_sessions",
			kind: "primaryKey",
			value: ["session_key"]
		},
		{
			table: "acp_sessions",
			kind: "indexes",
			value: 5
		},
		{
			table: "acp_sessions",
			kind: "checks",
			value: 0
		},
		{
			table: "agent_database_leases",
			kind: "table",
			value: null
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "lease_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "owner_pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "owner_start_time",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "opened_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "agent_database_leases",
			kind: "column",
			value: {
				name: "provenance",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "agent_database_leases",
			kind: "primaryKey",
			value: ["lease_id"]
		},
		{
			table: "agent_database_leases",
			kind: "indexes",
			value: 1
		},
		{
			table: "agent_database_leases",
			kind: "checks",
			value: 0
		},
		{
			table: "agent_databases",
			kind: "table",
			value: null
		},
		{
			table: "agent_databases",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "agent_databases",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "agent_databases",
			kind: "column",
			value: {
				name: "schema_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "agent_databases",
			kind: "column",
			value: {
				name: "last_seen_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "agent_databases",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "agent_databases",
			kind: "primaryKey",
			value: ["agent_id", "path"]
		},
		{
			table: "agent_databases",
			kind: "indexes",
			value: 1
		},
		{
			table: "agent_databases",
			kind: "checks",
			value: 0
		},
		{
			table: "agent_deletion_journal",
			kind: "table",
			value: null
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "operation_id",
				type: "text",
				nullable: false,
				identity: false,
				default: "''",
				position: 2
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "phase",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "agent_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "workspace_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "sessions_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "database_paths_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'[]'",
				position: 7
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "cleanup_paths_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'[]'",
				position: 8
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "cleanup_completed",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 10
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "column",
			value: {
				name: "delete_files",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "1",
				position: 11
			}
		},
		{
			table: "agent_deletion_journal",
			kind: "primaryKey",
			value: ["agent_id"]
		},
		{
			table: "agent_deletion_journal",
			kind: "indexes",
			value: 1
		},
		{
			table: "agent_deletion_journal",
			kind: "checks",
			value: 0
		},
		{
			table: "agent_provenance",
			kind: "table",
			value: null
		},
		{
			table: "agent_provenance",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "agent_provenance",
			kind: "column",
			value: {
				name: "created_via",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "agent_provenance",
			kind: "column",
			value: {
				name: "creator_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "agent_provenance",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "agent_provenance",
			kind: "primaryKey",
			value: ["agent_id"]
		},
		{
			table: "agent_provenance",
			kind: "indexes",
			value: 1
		},
		{
			table: "agent_provenance",
			kind: "checks",
			value: 1
		},
		{
			table: "apns_registration_tombstones",
			kind: "table",
			value: null
		},
		{
			table: "apns_registration_tombstones",
			kind: "column",
			value: {
				name: "node_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "apns_registration_tombstones",
			kind: "column",
			value: {
				name: "deleted_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "apns_registration_tombstones",
			kind: "primaryKey",
			value: ["node_id"]
		},
		{
			table: "apns_registration_tombstones",
			kind: "indexes",
			value: 1
		},
		{
			table: "apns_registration_tombstones",
			kind: "checks",
			value: 0
		},
		{
			table: "apns_registrations",
			kind: "table",
			value: null
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "node_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "transport",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "token",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "relay_handle",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "send_grant",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "installation_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "relay_origin",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "topic",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "environment",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "distribution",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "token_debug_suffix",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "apns_registrations",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "apns_registrations",
			kind: "primaryKey",
			value: ["node_id"]
		},
		{
			table: "apns_registrations",
			kind: "indexes",
			value: 2
		},
		{
			table: "apns_registrations",
			kind: "checks",
			value: 0
		},
		{
			table: "audit_events",
			kind: "table",
			value: null
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "sequence",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "event_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "source_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "schema_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "1",
				position: 4
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "source_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "occurred_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "action",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "error_code",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "actor_type",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "actor_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "tool_call_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "tool_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "direction",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "channel",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "conversation_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "message_outcome",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "reason_code",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "delivery_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "failure_stage",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "duration_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "result_count",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "account_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "conversation_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "message_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "audit_events",
			kind: "column",
			value: {
				name: "target_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "audit_events",
			kind: "primaryKey",
			value: ["sequence"]
		},
		{
			table: "audit_events",
			kind: "unique",
			value: ["event_id"]
		},
		{
			table: "audit_events",
			kind: "unique",
			value: ["source_id"]
		},
		{
			table: "audit_events",
			kind: "indexes",
			value: 11
		},
		{
			table: "audit_events",
			kind: "checks",
			value: 0
		},
		{
			table: "audit_identity_keys",
			kind: "table",
			value: null
		},
		{
			table: "audit_identity_keys",
			kind: "column",
			value: {
				name: "id",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "audit_identity_keys",
			kind: "column",
			value: {
				name: "key_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "audit_identity_keys",
			kind: "column",
			value: {
				name: "key",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "audit_identity_keys",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "audit_identity_keys",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "audit_identity_keys",
			kind: "indexes",
			value: 1
		},
		{
			table: "audit_identity_keys",
			kind: "checks",
			value: 1
		},
		{
			table: "backup_runs",
			kind: "table",
			value: null
		},
		{
			table: "backup_runs",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "backup_runs",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "backup_runs",
			kind: "column",
			value: {
				name: "archive_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "backup_runs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "backup_runs",
			kind: "column",
			value: {
				name: "manifest_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "backup_runs",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "backup_runs",
			kind: "indexes",
			value: 2
		},
		{
			table: "backup_runs",
			kind: "checks",
			value: 0
		},
		{
			table: "capture_blobs",
			kind: "table",
			value: null
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "blob_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "content_type",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "encoding",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "sha256",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "data",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "capture_blobs",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "capture_blobs",
			kind: "primaryKey",
			value: ["blob_id"]
		},
		{
			table: "capture_blobs",
			kind: "indexes",
			value: 1
		},
		{
			table: "capture_blobs",
			kind: "checks",
			value: 0
		},
		{
			table: "capture_events",
			kind: "table",
			value: null
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "id",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "ts",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "source_scope",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "source_process",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "protocol",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "direction",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "flow_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "method",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "host",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "status",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "close_code",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "content_type",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "headers_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "data_text",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "data_blob_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "data_sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "error_text",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "capture_events",
			kind: "column",
			value: {
				name: "meta_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "capture_events",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "capture_events",
			kind: "foreignKey",
			value: {
				columns: ["data_blob_id"],
				target: "capture_blobs",
				targetColumns: ["blob_id"],
				onUpdate: "NO ACTION",
				onDelete: "SET NULL",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "capture_events",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "capture_sessions",
				targetColumns: ["id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "capture_events",
			kind: "indexes",
			value: 3
		},
		{
			table: "capture_events",
			kind: "checks",
			value: 0
		},
		{
			table: "capture_sessions",
			kind: "table",
			value: null
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "started_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "ended_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "mode",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "source_scope",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "source_process",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "capture_sessions",
			kind: "column",
			value: {
				name: "proxy_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "capture_sessions",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "capture_sessions",
			kind: "indexes",
			value: 1
		},
		{
			table: "capture_sessions",
			kind: "checks",
			value: 0
		},
		{
			table: "channel_ingress_events",
			kind: "table",
			value: null
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "queue_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "event_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "channel_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "lane_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "metadata_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "received_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "claim_token",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "claim_owner",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "claimed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "attempts",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 14
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "last_attempt_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "last_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "failed_reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "failed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "completed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "channel_ingress_events",
			kind: "column",
			value: {
				name: "completed_metadata_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "channel_ingress_events",
			kind: "primaryKey",
			value: ["queue_name", "event_id"]
		},
		{
			table: "channel_ingress_events",
			kind: "indexes",
			value: 4
		},
		{
			table: "channel_ingress_events",
			kind: "checks",
			value: 0
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "table",
			value: null
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "column",
			value: {
				name: "channel_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "column",
			value: {
				name: "entry",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "column",
			value: {
				name: "sort_order",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "primaryKey",
			value: [
				"channel_key",
				"account_id",
				"entry"
			]
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "indexes",
			value: 2
		},
		{
			table: "channel_pairing_allow_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "channel_pairing_requests",
			kind: "table",
			value: null
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "channel_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "code",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "created_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "last_seen_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "column",
			value: {
				name: "meta_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "channel_pairing_requests",
			kind: "primaryKey",
			value: [
				"channel_key",
				"account_id",
				"request_id"
			]
		},
		{
			table: "channel_pairing_requests",
			kind: "indexes",
			value: 3
		},
		{
			table: "channel_pairing_requests",
			kind: "checks",
			value: 0
		},
		{
			table: "clawhub_promotion_claims",
			kind: "table",
			value: null
		},
		{
			table: "clawhub_promotion_claims",
			kind: "column",
			value: {
				name: "slug",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "clawhub_promotion_claims",
			kind: "column",
			value: {
				name: "provider",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "clawhub_promotion_claims",
			kind: "column",
			value: {
				name: "model_keys_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "clawhub_promotion_claims",
			kind: "column",
			value: {
				name: "ends_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "clawhub_promotion_claims",
			kind: "column",
			value: {
				name: "claimed_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "clawhub_promotion_claims",
			kind: "primaryKey",
			value: ["slug"]
		},
		{
			table: "clawhub_promotion_claims",
			kind: "indexes",
			value: 1
		},
		{
			table: "clawhub_promotion_claims",
			kind: "checks",
			value: 0
		},
		{
			table: "config_health_entries",
			kind: "table",
			value: null
		},
		{
			table: "config_health_entries",
			kind: "column",
			value: {
				name: "config_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "config_health_entries",
			kind: "column",
			value: {
				name: "last_known_good_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "config_health_entries",
			kind: "column",
			value: {
				name: "last_promoted_good_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "config_health_entries",
			kind: "column",
			value: {
				name: "last_observed_suspicious_signature",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "config_health_entries",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "config_health_entries",
			kind: "primaryKey",
			value: ["config_path"]
		},
		{
			table: "config_health_entries",
			kind: "indexes",
			value: 1
		},
		{
			table: "config_health_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "config_machine_state",
			kind: "table",
			value: null
		},
		{
			table: "config_machine_state",
			kind: "column",
			value: {
				name: "state_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "config_machine_state",
			kind: "column",
			value: {
				name: "value_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "config_machine_state",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "config_machine_state",
			kind: "primaryKey",
			value: ["state_key"]
		},
		{
			table: "config_machine_state",
			kind: "indexes",
			value: 1
		},
		{
			table: "config_machine_state",
			kind: "checks",
			value: 0
		},
		{
			table: "config_revision_keys",
			kind: "table",
			value: null
		},
		{
			table: "config_revision_keys",
			kind: "column",
			value: {
				name: "id",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "config_revision_keys",
			kind: "column",
			value: {
				name: "hmac_key",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "config_revision_keys",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "config_revision_keys",
			kind: "indexes",
			value: 1
		},
		{
			table: "config_revision_keys",
			kind: "checks",
			value: 2
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "table",
			value: null
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "column",
			value: {
				name: "job_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "column",
			value: {
				name: "authority_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "column",
			value: {
				name: "authority_input_fingerprint",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "column",
			value: {
				name: "recovery_required",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "primaryKey",
			value: ["store_key", "job_id"]
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "foreignKey",
			value: {
				columns: ["store_key", "job_id"],
				target: "cron_jobs",
				targetColumns: ["store_key", "job_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "indexes",
			value: 1
		},
		{
			table: "cron_job_runtime_authorities",
			kind: "checks",
			value: 2
		},
		{
			table: "cron_job_scratch",
			kind: "table",
			value: null
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "job_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "content",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "revision",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "source_sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "cron_job_scratch",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "cron_job_scratch",
			kind: "primaryKey",
			value: ["store_key", "job_id"]
		},
		{
			table: "cron_job_scratch",
			kind: "indexes",
			value: 2
		},
		{
			table: "cron_job_scratch",
			kind: "checks",
			value: 2
		},
		{
			table: "cron_jobs",
			kind: "table",
			value: null
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "job_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "declaration_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "owner_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "description",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "enabled",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "payload_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "job_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "grant_definition_revision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "grant_definition_generation",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "grant_definition_updated_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "state_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'{}'",
				position: 14
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "runtime_updated_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "schedule_identity",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "sort_order",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 17
			}
		},
		{
			table: "cron_jobs",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "cron_jobs",
			kind: "primaryKey",
			value: ["store_key", "job_id"]
		},
		{
			table: "cron_jobs",
			kind: "indexes",
			value: 2
		},
		{
			table: "cron_jobs",
			kind: "checks",
			value: 0
		},
		{
			table: "cron_run_receipts",
			kind: "table",
			value: null
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "cursor_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "receipt_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "job_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "config_revision",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "request_run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "delivery_attempt_state",
				type: "text",
				nullable: false,
				identity: false,
				default: "'unknown'",
				position: 8
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "owner_pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "owner_start_time",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "started_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "finished_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "cron_run_receipts",
			kind: "column",
			value: {
				name: "error_text",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "cron_run_receipts",
			kind: "primaryKey",
			value: ["receipt_id"]
		},
		{
			table: "cron_run_receipts",
			kind: "indexes",
			value: 4
		},
		{
			table: "cron_run_receipts",
			kind: "checks",
			value: 3
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "table",
			value: null
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "column",
			value: {
				name: "receipt_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "primaryKey",
			value: ["receipt_id"]
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "foreignKey",
			value: {
				columns: ["receipt_id"],
				target: "cron_run_receipts",
				targetColumns: ["receipt_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "indexes",
			value: 1
		},
		{
			table: "cron_run_trigger_state_retirements",
			kind: "checks",
			value: 0
		},
		{
			table: "current_conversation_bindings",
			kind: "table",
			value: null
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "binding_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "binding_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "target_session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "channel",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "conversation_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "parent_conversation_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "conversation_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "target_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "bound_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "metadata_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "record_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "current_conversation_bindings",
			kind: "primaryKey",
			value: ["binding_key"]
		},
		{
			table: "current_conversation_bindings",
			kind: "indexes",
			value: 4
		},
		{
			table: "current_conversation_bindings",
			kind: "checks",
			value: 0
		},
		{
			table: "delivery_queue_entries",
			kind: "table",
			value: null
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "queue_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "entry_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "channel",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "target",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "retry_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 9
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "last_attempt_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "last_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "recovery_state",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "platform_send_started_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "entry_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "retention_id_prefix",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "retention_max_age_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "retention_max_entries",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "enqueued_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "column",
			value: {
				name: "failed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "delivery_queue_entries",
			kind: "primaryKey",
			value: ["queue_name", "id"]
		},
		{
			table: "delivery_queue_entries",
			kind: "indexes",
			value: 6
		},
		{
			table: "delivery_queue_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "device_bootstrap_tokens",
			kind: "table",
			value: null
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "token_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "token",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "setup_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "ts",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "public_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "profile_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "redeemed_profile_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "pending_profile_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "issued_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "column",
			value: {
				name: "last_used_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "device_bootstrap_tokens",
			kind: "primaryKey",
			value: ["token_key"]
		},
		{
			table: "device_bootstrap_tokens",
			kind: "indexes",
			value: 2
		},
		{
			table: "device_bootstrap_tokens",
			kind: "checks",
			value: 0
		},
		{
			table: "device_pair_setup_completions",
			kind: "table",
			value: null
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "setup_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "device_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "access",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "completed_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "delivery_state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "column",
			value: {
				name: "retain_until_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "device_pair_setup_completions",
			kind: "primaryKey",
			value: ["setup_id"]
		},
		{
			table: "device_pair_setup_completions",
			kind: "indexes",
			value: 1
		},
		{
			table: "device_pair_setup_completions",
			kind: "checks",
			value: 1
		},
		{
			table: "device_pairing_join_codes",
			kind: "table",
			value: null
		},
		{
			table: "device_pairing_join_codes",
			kind: "column",
			value: {
				name: "shortcode",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "device_pairing_join_codes",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "device_pairing_join_codes",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "device_pairing_join_codes",
			kind: "column",
			value: {
				name: "expires_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "device_pairing_join_codes",
			kind: "indexes",
			value: 0
		},
		{
			table: "device_pairing_join_codes",
			kind: "checks",
			value: 0
		},
		{
			table: "device_pairing_paired",
			kind: "table",
			value: null
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "public_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "display_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "operator_label",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "platform",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "device_family",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "client_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "client_mode",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "browser_origin",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "role",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "roles_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "scopes_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "approved_scopes_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "remote_ip",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "tokens_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "approved_via",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "node_surface_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "pending_node_surface_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "approved_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "last_seen_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "device_pairing_paired",
			kind: "column",
			value: {
				name: "last_seen_reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "device_pairing_paired",
			kind: "primaryKey",
			value: ["device_id"]
		},
		{
			table: "device_pairing_paired",
			kind: "indexes",
			value: 2
		},
		{
			table: "device_pairing_paired",
			kind: "checks",
			value: 0
		},
		{
			table: "device_pairing_pending",
			kind: "table",
			value: null
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "public_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "display_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "platform",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "device_family",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "client_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "client_mode",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "browser_origin",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "role",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "roles_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "scopes_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "remote_ip",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "silent",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "is_repair",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "ts",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "device_pairing_pending",
			kind: "column",
			value: {
				name: "refreshed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "device_pairing_pending",
			kind: "primaryKey",
			value: ["request_id"]
		},
		{
			table: "device_pairing_pending",
			kind: "indexes",
			value: 2
		},
		{
			table: "device_pairing_pending",
			kind: "checks",
			value: 0
		},
		{
			table: "diagnostic_events",
			kind: "table",
			value: null
		},
		{
			table: "diagnostic_events",
			kind: "column",
			value: {
				name: "scope",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "diagnostic_events",
			kind: "column",
			value: {
				name: "event_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "diagnostic_events",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "diagnostic_events",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "diagnostic_events",
			kind: "column",
			value: {
				name: "sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 5
			}
		},
		{
			table: "diagnostic_events",
			kind: "primaryKey",
			value: ["scope", "event_key"]
		},
		{
			table: "diagnostic_events",
			kind: "indexes",
			value: 2
		},
		{
			table: "diagnostic_events",
			kind: "checks",
			value: 0
		},
		{
			table: "exec_approvals_config",
			kind: "table",
			value: null
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "config_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "raw_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "socket_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "has_socket_token",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "default_security",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "default_ask",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "default_ask_fallback",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "auto_allow_skills",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "agent_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "allowlist_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "exec_approvals_config",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "exec_approvals_config",
			kind: "primaryKey",
			value: ["config_key"]
		},
		{
			table: "exec_approvals_config",
			kind: "indexes",
			value: 1
		},
		{
			table: "exec_approvals_config",
			kind: "checks",
			value: 0
		},
		{
			table: "execution_decision_facts",
			kind: "table",
			value: null
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "cursor_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "receipt_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "context_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "action_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "action_family",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "decision_outcome",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "coverage_state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "reason_code",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "owner",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "source_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "occurred_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "receipt_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "execution_decision_facts",
			kind: "column",
			value: {
				name: "receipt_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "execution_decision_facts",
			kind: "primaryKey",
			value: ["receipt_id"]
		},
		{
			table: "execution_decision_facts",
			kind: "unique",
			value: ["occurred_at", "receipt_id"]
		},
		{
			table: "execution_decision_facts",
			kind: "indexes",
			value: 5
		},
		{
			table: "execution_decision_facts",
			kind: "checks",
			value: 14
		},
		{
			table: "execution_identity_contexts",
			kind: "table",
			value: null
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "context_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "coverage_state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "context_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "column",
			value: {
				name: "context_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "execution_identity_contexts",
			kind: "primaryKey",
			value: ["context_id"]
		},
		{
			table: "execution_identity_contexts",
			kind: "unique",
			value: ["execution_id"]
		},
		{
			table: "execution_identity_contexts",
			kind: "unique",
			value: ["created_at", "context_id"]
		},
		{
			table: "execution_identity_contexts",
			kind: "indexes",
			value: 4
		},
		{
			table: "execution_identity_contexts",
			kind: "checks",
			value: 7
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "table",
			value: null
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "column",
			value: {
				name: "owner_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "column",
			value: {
				name: "owner_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "column",
			value: {
				name: "context_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "primaryKey",
			value: ["owner_kind", "owner_id"]
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "indexes",
			value: 1
		},
		{
			table: "execution_owner_lifecycle_bindings",
			kind: "checks",
			value: 0
		},
		{
			table: "flow_runs",
			kind: "table",
			value: null
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "flow_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "shape",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "sync_mode",
				type: "text",
				nullable: false,
				identity: false,
				default: "'managed'",
				position: 3
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "owner_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "requester_origin_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "controller_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "revision",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 7
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "notify_policy",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "goal",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "current_step",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "blocked_task_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "blocked_summary",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "state_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "wait_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "cancel_requested_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "flow_runs",
			kind: "column",
			value: {
				name: "ended_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "flow_runs",
			kind: "primaryKey",
			value: ["flow_id"]
		},
		{
			table: "flow_runs",
			kind: "indexes",
			value: 4
		},
		{
			table: "flow_runs",
			kind: "checks",
			value: 0
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "table",
			value: null
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "boot_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "started_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "completed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "outcome",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "startup_reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "column",
			value: {
				name: "reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "primaryKey",
			value: ["boot_id"]
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "indexes",
			value: 2
		},
		{
			table: "gateway_boot_lifecycle",
			kind: "checks",
			value: 0
		},
		{
			table: "gateway_restart_handoff",
			kind: "table",
			value: null
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "handoff_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "intent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "process_instance_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "restart_trace_started_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "restart_trace_last_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "restart_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "supervisor_mode",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "gateway_restart_handoff",
			kind: "primaryKey",
			value: ["handoff_key"]
		},
		{
			table: "gateway_restart_handoff",
			kind: "indexes",
			value: 2
		},
		{
			table: "gateway_restart_handoff",
			kind: "checks",
			value: 0
		},
		{
			table: "gateway_restart_intent",
			kind: "table",
			value: null
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "intent_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "force",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "wait_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "gateway_restart_intent",
			kind: "primaryKey",
			value: ["intent_key"]
		},
		{
			table: "gateway_restart_intent",
			kind: "indexes",
			value: 1
		},
		{
			table: "gateway_restart_intent",
			kind: "checks",
			value: 0
		},
		{
			table: "gateway_restart_sentinel",
			kind: "table",
			value: null
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "sentinel_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "ts",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "thread_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "delivery_channel",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "delivery_to",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "delivery_account_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "message",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "continuation_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "doctor_hint",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "stats_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "gateway_restart_sentinel",
			kind: "primaryKey",
			value: ["sentinel_key"]
		},
		{
			table: "gateway_restart_sentinel",
			kind: "indexes",
			value: 2
		},
		{
			table: "gateway_restart_sentinel",
			kind: "checks",
			value: 0
		},
		{
			table: "github_personal_publication_requests",
			kind: "table",
			value: null
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "owner_profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "connection_generation",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "idempotency_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "request_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "worktree_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "repository_fingerprint",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "identity_source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "identity_profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "identity_account_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "identity_login",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "title",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "body",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "gateway_instance_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "last_effect",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "effect_state",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "push_repository",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "repository",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "base_branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "source_head_commit",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "source_index_tree",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "workspace_tree",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "pull_request_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "error_code",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "next_action",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 32
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 33
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 34
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "reported_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 35
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "column",
			value: {
				name: "draft",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 36
			}
		},
		{
			table: "github_personal_publication_requests",
			kind: "primaryKey",
			value: ["request_id"]
		},
		{
			table: "github_personal_publication_requests",
			kind: "unique",
			value: [
				"owner_profile_id",
				"session_id",
				"idempotency_key"
			]
		},
		{
			table: "github_personal_publication_requests",
			kind: "indexes",
			value: 4
		},
		{
			table: "github_personal_publication_requests",
			kind: "checks",
			value: 37
		},
		{
			table: "github_publication_requests",
			kind: "table",
			value: null
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "idempotency_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "request_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "worktree_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "repository_fingerprint",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "claim_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "identity_source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "identity_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "identity_account_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "identity_login",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "title",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "body",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "gateway_instance_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "repository",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "base_branch",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "source_head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "source_index_tree",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "workspace_tree",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "pull_request_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "error_code",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "next_action",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 32
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 33
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "reported_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 34
			}
		},
		{
			table: "github_publication_requests",
			kind: "column",
			value: {
				name: "draft",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 35
			}
		},
		{
			table: "github_publication_requests",
			kind: "primaryKey",
			value: ["request_id"]
		},
		{
			table: "github_publication_requests",
			kind: "unique",
			value: ["session_id", "idempotency_key"]
		},
		{
			table: "github_publication_requests",
			kind: "indexes",
			value: 3
		},
		{
			table: "github_publication_requests",
			kind: "checks",
			value: 9
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "table",
			value: null
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "column",
			value: {
				name: "publication_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "column",
			value: {
				name: "lifecycle_revision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "column",
			value: {
				name: "requester_authority_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "primaryKey",
			value: ["publication_kind", "request_id"]
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "indexes",
			value: 1
		},
		{
			table: "github_publication_session_lifecycles",
			kind: "checks",
			value: 1
		},
		{
			table: "github_repository_publication_requests",
			kind: "table",
			value: null
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "request_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "owner_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "connection_generation",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "idempotency_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "request_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "session_lifecycle_revision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "requester_authority_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "workspace_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "checkpoint_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "checkpoint_digest",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "claim_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "identity_source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "identity_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "identity_account_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "identity_login",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "title",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "body",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "gateway_instance_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "last_effect",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "effect_state",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "push_repository",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "repository",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 32
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "base_branch",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 33
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "source_head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 34
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "source_index_tree",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 35
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "workspace_tree",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 36
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "previous_head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 37
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "pushed_head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 38
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "head_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 39
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "pull_request_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 40
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "error_code",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 41
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "next_action",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 42
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 43
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 44
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "reported_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 45
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "column",
			value: {
				name: "draft",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 46
			}
		},
		{
			table: "github_repository_publication_requests",
			kind: "primaryKey",
			value: ["request_id"]
		},
		{
			table: "github_repository_publication_requests",
			kind: "indexes",
			value: 3
		},
		{
			table: "github_repository_publication_requests",
			kind: "checks",
			value: 7
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "table",
			value: null
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "column",
			value: {
				name: "worktree_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "column",
			value: {
				name: "node_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "primaryKey",
			value: ["worktree_id", "path"]
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "foreignKey",
			value: {
				columns: ["worktree_id"],
				target: "local_workspace_projections",
				targetColumns: ["worktree_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "indexes",
			value: 1
		},
		{
			table: "local_workspace_manifest_nodes",
			kind: "checks",
			value: 0
		},
		{
			table: "local_workspace_projections",
			kind: "table",
			value: null
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "worktree_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "lifecycle_revision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "projection_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "base_commit",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "source_paths_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "baseline_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "baseline_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "pending_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "pending_target",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "paused_runtimes_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "journal_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "journal_pack",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "revision",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 16
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "checkpoint_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "tree_root_digest",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "source_paths_digest",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "canonical_fingerprints",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "local_workspace_projections",
			kind: "column",
			value: {
				name: "projection_fingerprints",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "local_workspace_projections",
			kind: "primaryKey",
			value: ["worktree_id"]
		},
		{
			table: "local_workspace_projections",
			kind: "unique",
			value: ["projection_path"]
		},
		{
			table: "local_workspace_projections",
			kind: "indexes",
			value: 2
		},
		{
			table: "local_workspace_projections",
			kind: "checks",
			value: 5
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "table",
			value: null
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "column",
			value: {
				name: "path_digest",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "column",
			value: {
				name: "paths_zstd",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "column",
			value: {
				name: "sweep_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "primaryKey",
			value: ["path_digest"]
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "indexes",
			value: 1
		},
		{
			table: "local_workspace_source_path_sets",
			kind: "checks",
			value: 1
		},
		{
			table: "local_workspace_tree_packs",
			kind: "table",
			value: null
		},
		{
			table: "local_workspace_tree_packs",
			kind: "column",
			value: {
				name: "tree_digest",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "local_workspace_tree_packs",
			kind: "column",
			value: {
				name: "records_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "local_workspace_tree_packs",
			kind: "column",
			value: {
				name: "children_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "local_workspace_tree_packs",
			kind: "column",
			value: {
				name: "sweep_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "local_workspace_tree_packs",
			kind: "primaryKey",
			value: ["tree_digest"]
		},
		{
			table: "local_workspace_tree_packs",
			kind: "indexes",
			value: 1
		},
		{
			table: "local_workspace_tree_packs",
			kind: "checks",
			value: 1
		},
		{
			table: "macos_port_guardian_records",
			kind: "table",
			value: null
		},
		{
			table: "macos_port_guardian_records",
			kind: "column",
			value: {
				name: "pid",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "macos_port_guardian_records",
			kind: "column",
			value: {
				name: "port",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "macos_port_guardian_records",
			kind: "column",
			value: {
				name: "command",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "macos_port_guardian_records",
			kind: "column",
			value: {
				name: "mode",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "macos_port_guardian_records",
			kind: "column",
			value: {
				name: "timestamp",
				type: "double precision",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "macos_port_guardian_records",
			kind: "primaryKey",
			value: ["pid"]
		},
		{
			table: "macos_port_guardian_records",
			kind: "indexes",
			value: 2
		},
		{
			table: "macos_port_guardian_records",
			kind: "checks",
			value: 0
		},
		{
			table: "managed_outgoing_image_records",
			kind: "table",
			value: null
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "attachment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "message_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "created_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "updated_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "retention_class",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "alt",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_media_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_media_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_media_subdir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_content_type",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_width",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_height",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_size_bytes",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "original_filename",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "record_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "column",
			value: {
				name: "cleanup_pending",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 18
			}
		},
		{
			table: "managed_outgoing_image_records",
			kind: "primaryKey",
			value: ["attachment_id"]
		},
		{
			table: "managed_outgoing_image_records",
			kind: "indexes",
			value: 5
		},
		{
			table: "managed_outgoing_image_records",
			kind: "checks",
			value: 1
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "table",
			value: null
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "column",
			value: {
				name: "create_time",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "primaryKey",
			value: ["state"]
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "indexes",
			value: 1
		},
		{
			table: "mcp_oauth_pending_authorizations",
			kind: "checks",
			value: 0
		},
		{
			table: "mcp_oauth_stores",
			kind: "table",
			value: null
		},
		{
			table: "mcp_oauth_stores",
			kind: "column",
			value: {
				name: "store_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "mcp_oauth_stores",
			kind: "column",
			value: {
				name: "format_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "mcp_oauth_stores",
			kind: "column",
			value: {
				name: "store_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "mcp_oauth_stores",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "mcp_oauth_stores",
			kind: "primaryKey",
			value: ["store_key"]
		},
		{
			table: "mcp_oauth_stores",
			kind: "indexes",
			value: 1
		},
		{
			table: "mcp_oauth_stores",
			kind: "checks",
			value: 1
		},
		{
			table: "meeting_transcript_sessions",
			kind: "table",
			value: null
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "started_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "started_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "selector",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "export_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "session_slug",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "provider_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "title",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_account_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_guild_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_channel_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_meeting_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_thread_ts",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "source_file_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "stopped_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "metadata_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "metadata_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "export_manifest_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'{}'",
				position: 19
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "export_pending_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'[]'",
				position: 20
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "next_utterance_seq",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 21
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "meeting_transcript_sessions",
			kind: "primaryKey",
			value: ["session_id", "started_at"]
		},
		{
			table: "meeting_transcript_sessions",
			kind: "unique",
			value: ["selector"]
		},
		{
			table: "meeting_transcript_sessions",
			kind: "indexes",
			value: 10
		},
		{
			table: "meeting_transcript_sessions",
			kind: "checks",
			value: 3
		},
		{
			table: "meeting_transcript_summaries",
			kind: "table",
			value: null
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "session_started_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "generated_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "summary_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "overview",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "markdown",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "column",
			value: {
				name: "utterance_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "primaryKey",
			value: ["session_id", "session_started_at"]
		},
		{
			table: "meeting_transcript_summaries",
			kind: "foreignKey",
			value: {
				columns: ["session_id", "session_started_at"],
				target: "meeting_transcript_sessions",
				targetColumns: ["session_id", "started_at"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "meeting_transcript_summaries",
			kind: "indexes",
			value: 1
		},
		{
			table: "meeting_transcript_summaries",
			kind: "checks",
			value: 2
		},
		{
			table: "meeting_transcript_utterances",
			kind: "table",
			value: null
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "session_started_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "utterance_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "started_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "ended_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "speaker_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "speaker_label",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "text",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "final",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "column",
			value: {
				name: "metadata_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "primaryKey",
			value: [
				"session_id",
				"session_started_at",
				"sequence"
			]
		},
		{
			table: "meeting_transcript_utterances",
			kind: "foreignKey",
			value: {
				columns: ["session_id", "session_started_at"],
				target: "meeting_transcript_sessions",
				targetColumns: ["session_id", "started_at"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "meeting_transcript_utterances",
			kind: "indexes",
			value: 2
		},
		{
			table: "meeting_transcript_utterances",
			kind: "checks",
			value: 2
		},
		{
			table: "migration_runs",
			kind: "table",
			value: null
		},
		{
			table: "migration_runs",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "migration_runs",
			kind: "column",
			value: {
				name: "started_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "migration_runs",
			kind: "column",
			value: {
				name: "finished_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "migration_runs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "migration_runs",
			kind: "column",
			value: {
				name: "report_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "migration_runs",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "migration_runs",
			kind: "indexes",
			value: 2
		},
		{
			table: "migration_runs",
			kind: "checks",
			value: 0
		},
		{
			table: "migration_sources",
			kind: "table",
			value: null
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "source_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "migration_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "source_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "target_table",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "source_sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "source_size_bytes",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "source_record_count",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "last_run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "imported_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "removed_source",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 11
			}
		},
		{
			table: "migration_sources",
			kind: "column",
			value: {
				name: "report_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "migration_sources",
			kind: "primaryKey",
			value: ["source_key"]
		},
		{
			table: "migration_sources",
			kind: "foreignKey",
			value: {
				columns: ["last_run_id"],
				target: "migration_runs",
				targetColumns: ["id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "migration_sources",
			kind: "indexes",
			value: 3
		},
		{
			table: "migration_sources",
			kind: "checks",
			value: 0
		},
		{
			table: "native_hook_relay_bridges",
			kind: "table",
			value: null
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "relay_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "hostname",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "port",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "token",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "expires_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "native_hook_relay_bridges",
			kind: "primaryKey",
			value: ["relay_id"]
		},
		{
			table: "native_hook_relay_bridges",
			kind: "indexes",
			value: 2
		},
		{
			table: "native_hook_relay_bridges",
			kind: "checks",
			value: 0
		},
		{
			table: "node_worker_launch_boots",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_launch_boots",
			kind: "column",
			value: {
				name: "launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_launch_boots",
			kind: "column",
			value: {
				name: "boot_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_launch_boots",
			kind: "primaryKey",
			value: ["launch_id"]
		},
		{
			table: "node_worker_launch_boots",
			kind: "foreignKey",
			value: {
				columns: ["launch_id"],
				target: "node_worker_launches",
				targetColumns: ["launch_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "node_worker_launch_boots",
			kind: "indexes",
			value: 1
		},
		{
			table: "node_worker_launch_boots",
			kind: "checks",
			value: 1
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "column",
			value: {
				name: "launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "column",
			value: {
				name: "cleanup_mode",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "column",
			value: {
				name: "lineage_settled",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "primaryKey",
			value: ["launch_id"]
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "foreignKey",
			value: {
				columns: ["launch_id"],
				target: "node_worker_launches",
				targetColumns: ["launch_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "indexes",
			value: 1
		},
		{
			table: "node_worker_launch_cleanup",
			kind: "checks",
			value: 2
		},
		{
			table: "node_worker_launch_containers",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_launch_containers",
			kind: "column",
			value: {
				name: "launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_launch_containers",
			kind: "column",
			value: {
				name: "container_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_launch_containers",
			kind: "primaryKey",
			value: ["launch_id"]
		},
		{
			table: "node_worker_launch_containers",
			kind: "indexes",
			value: 1
		},
		{
			table: "node_worker_launch_containers",
			kind: "checks",
			value: 0
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "column",
			value: {
				name: "launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "column",
			value: {
				name: "scope_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "column",
			value: {
				name: "descendants_reaped",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "primaryKey",
			value: ["launch_id"]
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "foreignKey",
			value: {
				columns: ["launch_id"],
				target: "node_worker_launches",
				targetColumns: ["launch_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "indexes",
			value: 1
		},
		{
			table: "node_worker_launch_process_scopes",
			kind: "checks",
			value: 2
		},
		{
			table: "node_worker_launches",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "plan_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "gateway_namespace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "supervisor_pid",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "supervisor_start_time",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "worker_pid",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "worker_start_time",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "result_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "error_text",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "completed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "node_worker_launches",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "node_worker_launches",
			kind: "primaryKey",
			value: ["launch_id"]
		},
		{
			table: "node_worker_launches",
			kind: "indexes",
			value: 2
		},
		{
			table: "node_worker_launches",
			kind: "checks",
			value: 20
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "preparation_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "cache_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "gateway_namespace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "workspace_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "home_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "source_manifest_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "prepared_manifest_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "bound_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "column",
			value: {
				name: "retired_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "primaryKey",
			value: ["preparation_key"]
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "unique",
			value: ["workspace_dir"]
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "indexes",
			value: 2
		},
		{
			table: "node_worker_prepared_workspaces",
			kind: "checks",
			value: 15
		},
		{
			table: "node_worker_turns",
			kind: "table",
			value: null
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "turn_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "owner_launch_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "plan_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "result_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "error_text",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "completed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "node_worker_turns",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "node_worker_turns",
			kind: "primaryKey",
			value: ["turn_id"]
		},
		{
			table: "node_worker_turns",
			kind: "foreignKey",
			value: {
				columns: ["owner_launch_id"],
				target: "node_worker_launches",
				targetColumns: ["launch_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "node_worker_turns",
			kind: "indexes",
			value: 3
		},
		{
			table: "node_worker_turns",
			kind: "checks",
			value: 10
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "table",
			value: null
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "feed_url",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "body",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "status",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "etag",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "last_modified",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "checksum",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "saved_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "trust_mode",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "trust_key_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "trust_signature_count",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "trust_threshold",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "trust_verified_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "primaryKey",
			value: ["feed_url"]
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "indexes",
			value: 2
		},
		{
			table: "official_external_plugin_catalog_snapshots",
			kind: "checks",
			value: 0
		},
		{
			table: "operator_approval_execution_identities",
			kind: "table",
			value: null
		},
		{
			table: "operator_approval_execution_identities",
			kind: "column",
			value: {
				name: "approval_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "operator_approval_execution_identities",
			kind: "column",
			value: {
				name: "source_context_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "operator_approval_execution_identities",
			kind: "column",
			value: {
				name: "source_execution_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "operator_approval_execution_identities",
			kind: "primaryKey",
			value: ["approval_id"]
		},
		{
			table: "operator_approval_execution_identities",
			kind: "foreignKey",
			value: {
				columns: ["approval_id"],
				target: "operator_approvals",
				targetColumns: ["approval_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "operator_approval_execution_identities",
			kind: "indexes",
			value: 1
		},
		{
			table: "operator_approval_execution_identities",
			kind: "checks",
			value: 2
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "table",
			value: null
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "column",
			value: {
				name: "grant_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "column",
			value: {
				name: "job_definition_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "primaryKey",
			value: ["grant_id"]
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "foreignKey",
			value: {
				columns: ["grant_id"],
				target: "operator_approval_standing_grants",
				targetColumns: ["grant_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "indexes",
			value: 1
		},
		{
			table: "operator_approval_standing_grant_generations",
			kind: "checks",
			value: 1
		},
		{
			table: "operator_approval_standing_grants",
			kind: "table",
			value: null
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "grant_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "minted_by_approval_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "cron_job_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "job_config_revision",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "operation_binding",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "expires_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "revoked_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "revoked_by",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "last_used_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "column",
			value: {
				name: "use_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 12
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "primaryKey",
			value: ["grant_id"]
		},
		{
			table: "operator_approval_standing_grants",
			kind: "foreignKey",
			value: {
				columns: ["minted_by_approval_id"],
				target: "operator_approvals",
				targetColumns: ["approval_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "operator_approval_standing_grants",
			kind: "indexes",
			value: 2
		},
		{
			table: "operator_approval_standing_grants",
			kind: "checks",
			value: 6
		},
		{
			table: "operator_approvals",
			kind: "table",
			value: null
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "cursor_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "approval_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "resolution_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "presentation_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "requested_by_device_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "requested_by_client_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "requested_by_device_token_auth",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 9
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "reviewer_device_ids_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_tool_call_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "source_tool_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "audience_session_keys_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "runtime_epoch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "expires_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "decision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "terminal_reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "resolved_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "resolver_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "resolver_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "consumed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "operator_approvals",
			kind: "column",
			value: {
				name: "consumed_by",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "operator_approvals",
			kind: "primaryKey",
			value: ["approval_id"]
		},
		{
			table: "operator_approvals",
			kind: "indexes",
			value: 8
		},
		{
			table: "operator_approvals",
			kind: "checks",
			value: 16
		},
		{
			table: "outbound_media_provenance",
			kind: "table",
			value: null
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "realpath",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "sha256",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "outbound_media_provenance",
			kind: "primaryKey",
			value: ["realpath"]
		},
		{
			table: "outbound_media_provenance",
			kind: "indexes",
			value: 1
		},
		{
			table: "outbound_media_provenance",
			kind: "checks",
			value: 0
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "table",
			value: null
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "column",
			value: {
				name: "event_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "column",
			value: {
				name: "context_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "primaryKey",
			value: ["event_id"]
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "foreignKey",
			value: {
				columns: ["event_id"],
				target: "audit_events",
				targetColumns: ["event_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "indexes",
			value: 2
		},
		{
			table: "outbound_message_execution_bindings",
			kind: "checks",
			value: 3
		},
		{
			table: "outbound_message_progress",
			kind: "table",
			value: null
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "sequence",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "progress_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "source_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "source_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "schema_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "occurred_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "action",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "outcome",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "actor_type",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "actor_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "context_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "execution_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "channel",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "conversation_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "duration_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "account_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "conversation_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "outbound_message_progress",
			kind: "column",
			value: {
				name: "target_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "outbound_message_progress",
			kind: "primaryKey",
			value: ["sequence"]
		},
		{
			table: "outbound_message_progress",
			kind: "unique",
			value: ["progress_id"]
		},
		{
			table: "outbound_message_progress",
			kind: "unique",
			value: ["source_id"]
		},
		{
			table: "outbound_message_progress",
			kind: "unique",
			value: ["occurred_at", "progress_id"]
		},
		{
			table: "outbound_message_progress",
			kind: "indexes",
			value: 6
		},
		{
			table: "outbound_message_progress",
			kind: "checks",
			value: 14
		},
		{
			table: "plugin_binding_approvals",
			kind: "table",
			value: null
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "plugin_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "channel",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "account_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "plugin_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "plugin_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "column",
			value: {
				name: "approved_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "plugin_binding_approvals",
			kind: "primaryKey",
			value: [
				"plugin_root",
				"channel",
				"account_id"
			]
		},
		{
			table: "plugin_binding_approvals",
			kind: "indexes",
			value: 2
		},
		{
			table: "plugin_binding_approvals",
			kind: "checks",
			value: 0
		},
		{
			table: "plugin_blob_entries",
			kind: "table",
			value: null
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "plugin_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "namespace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "entry_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "metadata_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "blob",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "plugin_blob_entries",
			kind: "primaryKey",
			value: [
				"plugin_id",
				"namespace",
				"entry_key"
			]
		},
		{
			table: "plugin_blob_entries",
			kind: "indexes",
			value: 3
		},
		{
			table: "plugin_blob_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "plugin_state_entries",
			kind: "table",
			value: null
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "plugin_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "namespace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "entry_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "value_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "plugin_state_entries",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "plugin_state_entries",
			kind: "primaryKey",
			value: [
				"plugin_id",
				"namespace",
				"entry_key"
			]
		},
		{
			table: "plugin_state_entries",
			kind: "indexes",
			value: 3
		},
		{
			table: "plugin_state_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "projects",
			kind: "table",
			value: null
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "display_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "repo_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "origin_url",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "projects",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "projects",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "projects",
			kind: "indexes",
			value: 1
		},
		{
			table: "projects",
			kind: "checks",
			value: 1
		},
		{
			table: "sandbox_persistent_execs",
			kind: "table",
			value: null
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "owner_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "source_identity",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "attempt_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "owner_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "backend_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "backend_target_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "workspace_binding_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "container_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "container_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "container_started_at",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "revision",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "phase",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "receipt_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "sandbox_persistent_execs",
			kind: "primaryKey",
			value: ["owner_key"]
		},
		{
			table: "sandbox_persistent_execs",
			kind: "unique",
			value: ["attempt_id"]
		},
		{
			table: "sandbox_persistent_execs",
			kind: "indexes",
			value: 5
		},
		{
			table: "sandbox_persistent_execs",
			kind: "checks",
			value: 4
		},
		{
			table: "sandbox_registry_entries",
			kind: "table",
			value: null
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "registry_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "container_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "backend_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "runtime_label",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "image",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "last_used_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "config_label_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "config_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "cdp_port",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "no_vnc_port",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "entry_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "sandbox_registry_entries",
			kind: "primaryKey",
			value: ["registry_kind", "container_name"]
		},
		{
			table: "sandbox_registry_entries",
			kind: "indexes",
			value: 4
		},
		{
			table: "sandbox_registry_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "schema_meta",
			kind: "table",
			value: null
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "meta_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "role",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "schema_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "app_version",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "schema_meta",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "schema_meta",
			kind: "primaryKey",
			value: ["meta_key"]
		},
		{
			table: "schema_meta",
			kind: "indexes",
			value: 1
		},
		{
			table: "schema_meta",
			kind: "checks",
			value: 0
		},
		{
			table: "secret_store_entries",
			kind: "table",
			value: null
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "scope_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "scope_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "value",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "updated_by",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "deleted_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "secret_store_entries",
			kind: "column",
			value: {
				name: "allowed_hosts",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "secret_store_entries",
			kind: "primaryKey",
			value: [
				"scope_kind",
				"scope_id",
				"name"
			]
		},
		{
			table: "secret_store_entries",
			kind: "indexes",
			value: 2
		},
		{
			table: "secret_store_entries",
			kind: "checks",
			value: 5
		},
		{
			table: "session_groups",
			kind: "table",
			value: null
		},
		{
			table: "session_groups",
			kind: "column",
			value: {
				name: "name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "session_groups",
			kind: "column",
			value: {
				name: "position",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_groups",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_groups",
			kind: "column",
			value: {
				name: "cwd",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "session_groups",
			kind: "column",
			value: {
				name: "worktree",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "session_groups",
			kind: "primaryKey",
			value: ["name"]
		},
		{
			table: "session_groups",
			kind: "indexes",
			value: 1
		},
		{
			table: "session_groups",
			kind: "checks",
			value: 0
		},
		{
			table: "session_repository_workspaces",
			kind: "table",
			value: null
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "workspace_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "url",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "requested_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "run_setup_script",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 6
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "base_commit",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "base_manifest_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "checkpoint_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "manifest_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "revision",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "session_repository_workspaces",
			kind: "primaryKey",
			value: ["workspace_id"]
		},
		{
			table: "session_repository_workspaces",
			kind: "unique",
			value: ["agent_id", "session_key"]
		},
		{
			table: "session_repository_workspaces",
			kind: "indexes",
			value: 2
		},
		{
			table: "session_repository_workspaces",
			kind: "checks",
			value: 11
		},
		{
			table: "session_state_events",
			kind: "table",
			value: null
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "sequence",
				type: "bigint",
				nullable: false,
				identity: true,
				default: null,
				position: 1
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "dedupe_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "actor_type",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "actor_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "occurred_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "summary",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "session_state_events",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "session_state_events",
			kind: "primaryKey",
			value: ["sequence"]
		},
		{
			table: "session_state_events",
			kind: "unique",
			value: ["dedupe_key"]
		},
		{
			table: "session_state_events",
			kind: "indexes",
			value: 4
		},
		{
			table: "session_state_events",
			kind: "checks",
			value: 0
		},
		{
			table: "session_state_heads",
			kind: "table",
			value: null
		},
		{
			table: "session_state_heads",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "session_state_heads",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_state_heads",
			kind: "column",
			value: {
				name: "last_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_state_heads",
			kind: "column",
			value: {
				name: "pruned_max_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 4
			}
		},
		{
			table: "session_state_heads",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "session_state_heads",
			kind: "primaryKey",
			value: ["session_key", "agent_id"]
		},
		{
			table: "session_state_heads",
			kind: "indexes",
			value: 1
		},
		{
			table: "session_state_heads",
			kind: "checks",
			value: 0
		},
		{
			table: "session_upstream_links",
			kind: "table",
			value: null
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "catalog_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "host_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "thread_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "upstream_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "upstream_ref_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "last_marker_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "last_scanned_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "session_upstream_links",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "session_upstream_links",
			kind: "primaryKey",
			value: ["session_key", "agent_id"]
		},
		{
			table: "session_upstream_links",
			kind: "indexes",
			value: 2
		},
		{
			table: "session_upstream_links",
			kind: "checks",
			value: 0
		},
		{
			table: "session_watch_cursors",
			kind: "table",
			value: null
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "watcher_session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "watcher_store_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "target_session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "last_seen_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 4
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "notified_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 5
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "material_sequence",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 6
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "provenance",
				type: "text",
				nullable: false,
				identity: false,
				default: "'explicit'",
				position: 7
			}
		},
		{
			table: "session_watch_cursors",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "session_watch_cursors",
			kind: "primaryKey",
			value: ["watcher_session_key", "target_session_key"]
		},
		{
			table: "session_watch_cursors",
			kind: "indexes",
			value: 2
		},
		{
			table: "session_watch_cursors",
			kind: "checks",
			value: 1
		},
		{
			table: "skill_library_entries",
			kind: "table",
			value: null
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "skill_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "owner_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "author_profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "slug",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "current_revision",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "shared",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "enabled",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "removed",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "skill_library_entries",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "skill_library_entries",
			kind: "primaryKey",
			value: ["skill_id"]
		},
		{
			table: "skill_library_entries",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_library_entries",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_library_events",
			kind: "table",
			value: null
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "event_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "skill_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "revision",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "action",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "actor_profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_library_events",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_library_events",
			kind: "primaryKey",
			value: ["event_id"]
		},
		{
			table: "skill_library_events",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_library_events",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_library_revisions",
			kind: "table",
			value: null
		},
		{
			table: "skill_library_revisions",
			kind: "column",
			value: {
				name: "skill_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_library_revisions",
			kind: "column",
			value: {
				name: "revision",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_library_revisions",
			kind: "column",
			value: {
				name: "description",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_library_revisions",
			kind: "column",
			value: {
				name: "files_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_library_revisions",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_library_revisions",
			kind: "primaryKey",
			value: ["skill_id", "revision"]
		},
		{
			table: "skill_library_revisions",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_library_revisions",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_library_uploads",
			kind: "table",
			value: null
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "upload_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "owner_profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "slug",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "sha256",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "archive_blob",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "skill_library_uploads",
			kind: "column",
			value: {
				name: "published_skill_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "skill_library_uploads",
			kind: "primaryKey",
			value: ["upload_id"]
		},
		{
			table: "skill_library_uploads",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_library_uploads",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_upload_chunks",
			kind: "table",
			value: null
		},
		{
			table: "skill_upload_chunks",
			kind: "column",
			value: {
				name: "upload_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_upload_chunks",
			kind: "column",
			value: {
				name: "byte_offset",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_upload_chunks",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_upload_chunks",
			kind: "column",
			value: {
				name: "chunk_blob",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_upload_chunks",
			kind: "primaryKey",
			value: ["upload_id", "byte_offset"]
		},
		{
			table: "skill_upload_chunks",
			kind: "foreignKey",
			value: {
				columns: ["upload_id"],
				target: "skill_uploads",
				targetColumns: ["upload_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "skill_upload_chunks",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_upload_chunks",
			kind: "checks",
			value: 3
		},
		{
			table: "skill_uploads",
			kind: "table",
			value: null
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "upload_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "slug",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "force",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "size_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "actual_sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "received_bytes",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "archive_blob",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "committed",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "committed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "skill_uploads",
			kind: "column",
			value: {
				name: "idempotency_key_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "skill_uploads",
			kind: "primaryKey",
			value: ["upload_id"]
		},
		{
			table: "skill_uploads",
			kind: "unique",
			value: ["idempotency_key_hash"]
		},
		{
			table: "skill_uploads",
			kind: "indexes",
			value: 4
		},
		{
			table: "skill_uploads",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_usage",
			kind: "table",
			value: null
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "skill_file",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "skill_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "skill_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "skill_source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "first_used_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "last_used_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "use_count",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "skill_usage",
			kind: "column",
			value: {
				name: "last_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "skill_usage",
			kind: "primaryKey",
			value: ["skill_file"]
		},
		{
			table: "skill_usage",
			kind: "indexes",
			value: 1
		},
		{
			table: "skill_usage",
			kind: "checks",
			value: 0
		},
		{
			table: "skill_workshop_changes",
			kind: "table",
			value: null
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "cursor_id",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "change_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "skill_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "action",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "actor",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "summary",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "version_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "skill_workshop_changes",
			kind: "primaryKey",
			value: ["change_id"]
		},
		{
			table: "skill_workshop_changes",
			kind: "indexes",
			value: 3
		},
		{
			table: "skill_workshop_changes",
			kind: "checks",
			value: 2
		},
		{
			table: "state_leases",
			kind: "table",
			value: null
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "scope",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "lease_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "owner",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "expires_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "heartbeat_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "state_leases",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "state_leases",
			kind: "primaryKey",
			value: ["scope", "lease_key"]
		},
		{
			table: "state_leases",
			kind: "indexes",
			value: 3
		},
		{
			table: "state_leases",
			kind: "checks",
			value: 0
		},
		{
			table: "subagent_runs",
			kind: "table",
			value: null
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "child_session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "controller_session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "controller_store_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "requester_session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "requester_store_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "subagent_runs",
			kind: "column",
			value: {
				name: "payload_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'{}'",
				position: 8
			}
		},
		{
			table: "subagent_runs",
			kind: "primaryKey",
			value: ["run_id"]
		},
		{
			table: "subagent_runs",
			kind: "indexes",
			value: 4
		},
		{
			table: "subagent_runs",
			kind: "checks",
			value: 0
		},
		{
			table: "task_delivery_state",
			kind: "table",
			value: null
		},
		{
			table: "task_delivery_state",
			kind: "column",
			value: {
				name: "task_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "task_delivery_state",
			kind: "column",
			value: {
				name: "requester_origin_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "task_delivery_state",
			kind: "column",
			value: {
				name: "last_notified_event_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "task_delivery_state",
			kind: "primaryKey",
			value: ["task_id"]
		},
		{
			table: "task_delivery_state",
			kind: "foreignKey",
			value: {
				columns: ["task_id"],
				target: "task_runs",
				targetColumns: ["task_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "task_delivery_state",
			kind: "indexes",
			value: 1
		},
		{
			table: "task_delivery_state",
			kind: "checks",
			value: 0
		},
		{
			table: "task_runs",
			kind: "table",
			value: null
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "task_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "runtime",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "task_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "source_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "requester_session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "owner_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "scope_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "child_session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "parent_flow_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "parent_task_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "requester_agent_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "execution_owner_host",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "execution_owner_pid",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "execution_owner_start_identity",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "label",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "task",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "delivery_status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "notify_policy",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "started_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "ended_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "last_event_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "cleanup_after",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 26
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "tool_use_count",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "last_tool_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 28
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "progress_summary",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "terminal_summary",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "terminal_outcome",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 32
			}
		},
		{
			table: "task_runs",
			kind: "column",
			value: {
				name: "detail_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 33
			}
		},
		{
			table: "task_runs",
			kind: "primaryKey",
			value: ["task_id"]
		},
		{
			table: "task_runs",
			kind: "indexes",
			value: 4
		},
		{
			table: "task_runs",
			kind: "checks",
			value: 0
		},
		{
			table: "template_cron_refs",
			kind: "table",
			value: null
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "manifest_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "schema_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "declaration_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "scheduler_job_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "job_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "template_cron_refs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "template_cron_refs",
			kind: "primaryKey",
			value: ["agent_id", "manifest_id"]
		},
		{
			table: "template_cron_refs",
			kind: "unique",
			value: ["declaration_key"]
		},
		{
			table: "template_cron_refs",
			kind: "unique",
			value: ["scheduler_job_id"]
		},
		{
			table: "template_cron_refs",
			kind: "indexes",
			value: 3
		},
		{
			table: "template_cron_refs",
			kind: "checks",
			value: 0
		},
		{
			table: "template_installs",
			kind: "table",
			value: null
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "schema_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "source_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "template_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "template_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "package_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "manifest_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "integrity_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "integrity",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "source_byte_length",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "manifest_schema_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "plan_integrity",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "workspace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "agent_config_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "agent_owned_paths_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "bootstrap_source_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "bootstrap_content_digest",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "added_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "template_installs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "template_installs",
			kind: "primaryKey",
			value: ["agent_id"]
		},
		{
			table: "template_installs",
			kind: "unique",
			value: ["workspace"]
		},
		{
			table: "template_installs",
			kind: "indexes",
			value: 2
		},
		{
			table: "template_installs",
			kind: "checks",
			value: 1
		},
		{
			table: "template_mcp_server_refs",
			kind: "table",
			value: null
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "schema_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "config_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "relationship",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "origin",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "independent_owner",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 7
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "template_mcp_server_refs",
			kind: "primaryKey",
			value: ["agent_id", "name"]
		},
		{
			table: "template_mcp_server_refs",
			kind: "indexes",
			value: 1
		},
		{
			table: "template_mcp_server_refs",
			kind: "checks",
			value: 3
		},
		{
			table: "template_package_refs",
			kind: "table",
			value: null
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_source",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_integrity",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "schema_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "template_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "package_status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "relationship",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "origin",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "independent_owner",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_format",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_detected_format",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_mapped_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_unavailable_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "extension_adapter_identity",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "installed_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "template_package_refs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "template_package_refs",
			kind: "primaryKey",
			value: [
				"agent_id",
				"package_kind",
				"package_source",
				"package_ref",
				"package_version"
			]
		},
		{
			table: "template_package_refs",
			kind: "indexes",
			value: 1
		},
		{
			table: "template_package_refs",
			kind: "checks",
			value: 3
		},
		{
			table: "template_workspace_files",
			kind: "table",
			value: null
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "target_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "schema_version",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "workspace",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "source_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "content_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "template_workspace_files",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "template_workspace_files",
			kind: "primaryKey",
			value: ["agent_id", "target_path"]
		},
		{
			table: "template_workspace_files",
			kind: "indexes",
			value: 1
		},
		{
			table: "template_workspace_files",
			kind: "checks",
			value: 0
		},
		{
			table: "update_runs",
			kind: "table",
			value: null
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "trigger",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "phase",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "origin_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "target_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "before_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "after_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "steps_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "verification_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "repair_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "confirmed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "finished_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "update_runs",
			kind: "column",
			value: {
				name: "downtime_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "update_runs",
			kind: "primaryKey",
			value: ["run_id"]
		},
		{
			table: "update_runs",
			kind: "indexes",
			value: 3
		},
		{
			table: "update_runs",
			kind: "checks",
			value: 11
		},
		{
			table: "user_background_images",
			kind: "table",
			value: null
		},
		{
			table: "user_background_images",
			kind: "column",
			value: {
				name: "profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "user_background_images",
			kind: "column",
			value: {
				name: "asset_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "user_background_images",
			kind: "column",
			value: {
				name: "image",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "user_background_images",
			kind: "column",
			value: {
				name: "width",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "user_background_images",
			kind: "column",
			value: {
				name: "height",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "user_background_images",
			kind: "primaryKey",
			value: ["profile_id"]
		},
		{
			table: "user_background_images",
			kind: "unique",
			value: ["asset_id"]
		},
		{
			table: "user_background_images",
			kind: "foreignKey",
			value: {
				columns: ["profile_id"],
				target: "user_profiles",
				targetColumns: ["id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "user_background_images",
			kind: "indexes",
			value: 2
		},
		{
			table: "user_background_images",
			kind: "checks",
			value: 3
		},
		{
			table: "user_preferences",
			kind: "table",
			value: null
		},
		{
			table: "user_preferences",
			kind: "column",
			value: {
				name: "profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "user_preferences",
			kind: "column",
			value: {
				name: "pref_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "user_preferences",
			kind: "column",
			value: {
				name: "value_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "user_preferences",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "user_preferences",
			kind: "primaryKey",
			value: ["profile_id", "pref_key"]
		},
		{
			table: "user_preferences",
			kind: "indexes",
			value: 1
		},
		{
			table: "user_preferences",
			kind: "checks",
			value: 0
		},
		{
			table: "user_profile_emails",
			kind: "table",
			value: null
		},
		{
			table: "user_profile_emails",
			kind: "column",
			value: {
				name: "email",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "user_profile_emails",
			kind: "column",
			value: {
				name: "profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "user_profile_emails",
			kind: "column",
			value: {
				name: "binding_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "user_profile_emails",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "user_profile_emails",
			kind: "primaryKey",
			value: ["email"]
		},
		{
			table: "user_profile_emails",
			kind: "indexes",
			value: 2
		},
		{
			table: "user_profile_emails",
			kind: "checks",
			value: 0
		},
		{
			table: "user_profile_identities",
			kind: "table",
			value: null
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "provider",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "subject",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "canonical_login",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "verified_email_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "authorization_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "user_profile_identities",
			kind: "column",
			value: {
				name: "authorization_basis_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "user_profile_identities",
			kind: "primaryKey",
			value: ["provider", "subject"]
		},
		{
			table: "user_profile_identities",
			kind: "indexes",
			value: 3
		},
		{
			table: "user_profile_identities",
			kind: "checks",
			value: 0
		},
		{
			table: "user_profiles",
			kind: "table",
			value: null
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "display_name",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "primary_github_account_id",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "avatar",
				type: "bytea",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "avatar_mime",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "avatar_sha256",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "merged_into",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "role",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "user_profiles",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "user_profiles",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "user_profiles",
			kind: "indexes",
			value: 1
		},
		{
			table: "user_profiles",
			kind: "checks",
			value: 0
		},
		{
			table: "web_push_approval_deliveries",
			kind: "table",
			value: null
		},
		{
			table: "web_push_approval_deliveries",
			kind: "column",
			value: {
				name: "approval_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "column",
			value: {
				name: "subscription_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "column",
			value: {
				name: "user_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "column",
			value: {
				name: "prepared_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "primaryKey",
			value: ["approval_id", "subscription_id"]
		},
		{
			table: "web_push_approval_deliveries",
			kind: "foreignKey",
			value: {
				columns: ["subscription_id"],
				target: "web_push_subscriptions",
				targetColumns: ["subscription_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "foreignKey",
			value: {
				columns: ["approval_id"],
				target: "operator_approvals",
				targetColumns: ["approval_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "web_push_approval_deliveries",
			kind: "indexes",
			value: 2
		},
		{
			table: "web_push_approval_deliveries",
			kind: "checks",
			value: 0
		},
		{
			table: "web_push_subscriptions",
			kind: "table",
			value: null
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "endpoint_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "subscription_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "endpoint",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "p256dh",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "auth",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "device_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "user_profile_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "preferences_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "web_push_subscriptions",
			kind: "primaryKey",
			value: ["endpoint_hash"]
		},
		{
			table: "web_push_subscriptions",
			kind: "unique",
			value: ["subscription_id"]
		},
		{
			table: "web_push_subscriptions",
			kind: "indexes",
			value: 3
		},
		{
			table: "web_push_subscriptions",
			kind: "checks",
			value: 0
		},
		{
			table: "worker_environment_credentials",
			kind: "table",
			value: null
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "credential_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "bundle_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "rpc_set_version",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "expires_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "column",
			value: {
				name: "delivered_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "primaryKey",
			value: ["environment_id"]
		},
		{
			table: "worker_environment_credentials",
			kind: "unique",
			value: ["credential_hash"]
		},
		{
			table: "worker_environment_credentials",
			kind: "foreignKey",
			value: {
				columns: ["environment_id"],
				target: "worker_environments",
				targetColumns: ["environment_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_environment_credentials",
			kind: "indexes",
			value: 2
		},
		{
			table: "worker_environment_credentials",
			kind: "checks",
			value: 4
		},
		{
			table: "worker_environment_session_attachments",
			kind: "table",
			value: null
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "session_lifecycle_revision",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "last_used_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "column",
			value: {
				name: "closed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "worker_environment_session_attachments",
			kind: "unique",
			value: ["environment_id"]
		},
		{
			table: "worker_environment_session_attachments",
			kind: "foreignKey",
			value: {
				columns: ["environment_id"],
				target: "worker_environments",
				targetColumns: ["environment_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_environment_session_attachments",
			kind: "indexes",
			value: 3
		},
		{
			table: "worker_environment_session_attachments",
			kind: "checks",
			value: 1
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "table",
			value: null
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "column",
			value: {
				name: "position",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "column",
			value: {
				name: "port",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "primaryKey",
			value: ["environment_id", "position"]
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "unique",
			value: ["environment_id", "port"]
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "foreignKey",
			value: {
				columns: ["environment_id"],
				target: "worker_environments",
				targetColumns: ["environment_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "indexes",
			value: 2
		},
		{
			table: "worker_environment_ssh_fallback_ports",
			kind: "checks",
			value: 2
		},
		{
			table: "worker_environments",
			kind: "table",
			value: null
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "provider_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "profile_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "profile_snapshot_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "last_activated_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "preparation_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "preparation_purpose",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "preparation_demand_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "preparation_expires_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "preparation_consumed_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "provision_operation_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "lease_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "node_setup_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "node_device_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "ssh_host",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "ssh_port",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "ssh_user",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "ssh_host_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "ssh_key_ref_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "desktop_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "bootstrap_bundle_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "bootstrap_openclaw_version",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "bootstrap_protocol_features_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "bootstrap_install_kind",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 25
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 26
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "teardown_terminal_state",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 27
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "attached_session_ids_json",
				type: "text",
				nullable: false,
				identity: false,
				default: "'[]'",
				position: 28
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 29
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 30
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "state_changed_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 31
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "idle_since_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 32
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "destroy_requested_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 33
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "last_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 34
			}
		},
		{
			table: "worker_environments",
			kind: "column",
			value: {
				name: "shared_host",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 35
			}
		},
		{
			table: "worker_environments",
			kind: "primaryKey",
			value: ["environment_id"]
		},
		{
			table: "worker_environments",
			kind: "unique",
			value: ["provision_operation_id"]
		},
		{
			table: "worker_environments",
			kind: "indexes",
			value: 4
		},
		{
			table: "worker_environments",
			kind: "checks",
			value: 5
		},
		{
			table: "worker_inference_turns",
			kind: "table",
			value: null
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "run_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "turn_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "request_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "terminal_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_inference_turns",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_inference_turns",
			kind: "primaryKey",
			value: [
				"session_id",
				"run_epoch",
				"run_id",
				"turn_id"
			]
		},
		{
			table: "worker_inference_turns",
			kind: "foreignKey",
			value: {
				columns: ["environment_id"],
				target: "worker_environments",
				targetColumns: ["environment_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_inference_turns",
			kind: "indexes",
			value: 2
		},
		{
			table: "worker_inference_turns",
			kind: "checks",
			value: 5
		},
		{
			table: "worker_session_placement_moves",
			kind: "table",
			value: null
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "operation_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "source_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "source_environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "source_owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "target_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "target_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "target_machine_class",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "target_os",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "abandon_source",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "last_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "primaryKey",
			value: ["operation_id"]
		},
		{
			table: "worker_session_placement_moves",
			kind: "unique",
			value: ["session_id"]
		},
		{
			table: "worker_session_placement_moves",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "worker_session_placements",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_session_placement_moves",
			kind: "indexes",
			value: 2
		},
		{
			table: "worker_session_placement_moves",
			kind: "checks",
			value: 5
		},
		{
			table: "worker_session_placements",
			kind: "table",
			value: null
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "agent_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "session_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "execution_mode",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "transition_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: "0",
				position: 7
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "active_owner_epoch",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "workspace_base_manifest_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "remote_workspace_dir",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "worker_bundle_hash",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "last_transcript_ack_cursor",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "last_live_event_ack_cursor",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "recovery_error",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "turn_claim_owner",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "turn_claim_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 16
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "turn_claim_run_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 17
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "turn_claim_generation",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 18
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "turn_claim_owner_epoch",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 19
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 20
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 21
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "state_changed_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 22
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "terminal_reason",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 23
			}
		},
		{
			table: "worker_session_placements",
			kind: "column",
			value: {
				name: "terminal_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 24
			}
		},
		{
			table: "worker_session_placements",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "worker_session_placements",
			kind: "indexes",
			value: 4
		},
		{
			table: "worker_session_placements",
			kind: "checks",
			value: 12
		},
		{
			table: "worker_session_tool_operations",
			kind: "table",
			value: null
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "source_session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "source_claim_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "tool_call_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "tool_name",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "request_digest",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "operation_seed",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "child_session_key",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "result_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "gateway_instance_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "primaryKey",
			value: [
				"source_session_id",
				"source_claim_id",
				"tool_call_id"
			]
		},
		{
			table: "worker_session_tool_operations",
			kind: "foreignKey",
			value: {
				columns: ["source_session_id"],
				target: "worker_session_placements",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_session_tool_operations",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_session_tool_operations",
			kind: "checks",
			value: 2
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "table",
			value: null
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "column",
			value: {
				name: "run_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "column",
			value: {
				name: "next_seq",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "primaryKey",
			value: ["session_id", "run_epoch"]
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_transcript_commit_heads",
			kind: "checks",
			value: 3
		},
		{
			table: "worker_transcript_commits",
			kind: "table",
			value: null
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "run_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "seq",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "request_hash",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "state",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "result_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "primaryKey",
			value: [
				"session_id",
				"run_epoch",
				"seq"
			]
		},
		{
			table: "worker_transcript_commits",
			kind: "foreignKey",
			value: {
				columns: ["session_id", "run_epoch"],
				target: "worker_transcript_commit_heads",
				targetColumns: ["session_id", "run_epoch"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_transcript_commits",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_transcript_commits",
			kind: "checks",
			value: 6
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "table",
			value: null
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "claim_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "tool_names_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "worker_session_placements",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_turn_tool_authorities",
			kind: "checks",
			value: 2
		},
		{
			table: "worker_workspace_pending_results",
			kind: "table",
			value: null
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "claim_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "run_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "gateway_instance_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "recovery_requested_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "workspace_accepted_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "staged_result_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "repository_workspace_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "worker_workspace_pending_results",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "worker_session_placements",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_workspace_pending_results",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_workspace_pending_results",
			kind: "checks",
			value: 2
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "table",
			value: null
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "session_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "environment_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "owner_epoch",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "placement_generation",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "base_manifest_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "current_manifest_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "plan_json",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "base_pack",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "column",
			value: {
				name: "created_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "primaryKey",
			value: ["session_id"]
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "foreignKey",
			value: {
				columns: ["session_id"],
				target: "worker_session_placements",
				targetColumns: ["session_id"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "indexes",
			value: 1
		},
		{
			table: "worker_workspace_reconciliations",
			kind: "checks",
			value: 3
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "table",
			value: null
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "column",
			value: {
				name: "workspace_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "column",
			value: {
				name: "filename",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "column",
			value: {
				name: "sha256",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "primaryKey",
			value: ["workspace_key", "filename"]
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "foreignKey",
			value: {
				columns: ["workspace_key"],
				target: "workspace_setup_state",
				targetColumns: ["workspace_key"],
				onUpdate: "NO ACTION",
				onDelete: "CASCADE",
				deferrable: false,
				deferred: false
			}
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "indexes",
			value: 1
		},
		{
			table: "workspace_generated_bootstrap_hashes",
			kind: "checks",
			value: 0
		},
		{
			table: "workspace_path_aliases",
			kind: "table",
			value: null
		},
		{
			table: "workspace_path_aliases",
			kind: "column",
			value: {
				name: "alias_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "workspace_path_aliases",
			kind: "column",
			value: {
				name: "alias_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "workspace_path_aliases",
			kind: "column",
			value: {
				name: "workspace_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "workspace_path_aliases",
			kind: "column",
			value: {
				name: "workspace_path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "workspace_path_aliases",
			kind: "column",
			value: {
				name: "updated_at_ms",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "workspace_path_aliases",
			kind: "primaryKey",
			value: ["alias_key"]
		},
		{
			table: "workspace_path_aliases",
			kind: "indexes",
			value: 2
		},
		{
			table: "workspace_path_aliases",
			kind: "checks",
			value: 0
		},
		{
			table: "workspace_setup_state",
			kind: "table",
			value: null
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "workspace_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "workspace_path",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "version",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "bootstrap_seeded_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "setup_completed_at",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "updated_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "attested_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "workspace_setup_state",
			kind: "column",
			value: {
				name: "attestation_updated_at_ms",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "workspace_setup_state",
			kind: "primaryKey",
			value: ["workspace_key"]
		},
		{
			table: "workspace_setup_state",
			kind: "indexes",
			value: 2
		},
		{
			table: "workspace_setup_state",
			kind: "checks",
			value: 1
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "table",
			value: null
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "column",
			value: {
				name: "worktree_id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "column",
			value: {
				name: "chunk_index",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "column",
			value: {
				name: "data",
				type: "bytea",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "primaryKey",
			value: [
				"worktree_id",
				"path",
				"chunk_index"
			]
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "indexes",
			value: 1
		},
		{
			table: "worktree_provisioned_file_chunks",
			kind: "checks",
			value: 1
		},
		{
			table: "worktree_templates",
			kind: "table",
			value: null
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "cache_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "repo_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "common_dir",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "worktree_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "backend",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "source_commit",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "content_key",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "status",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worktree_templates",
			kind: "column",
			value: {
				name: "last_used_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worktree_templates",
			kind: "primaryKey",
			value: ["cache_key"]
		},
		{
			table: "worktree_templates",
			kind: "unique",
			value: ["id"]
		},
		{
			table: "worktree_templates",
			kind: "indexes",
			value: 2
		},
		{
			table: "worktree_templates",
			kind: "checks",
			value: 1
		},
		{
			table: "worktrees",
			kind: "table",
			value: null
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "id",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 1
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "repo_fingerprint",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 2
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "repo_root",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 3
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "path",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 4
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "branch",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 5
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "base_ref",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 6
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "owner_kind",
				type: "text",
				nullable: false,
				identity: false,
				default: null,
				position: 7
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "owner_id",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 8
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "snapshot_ref",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 9
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "provisioned_paths_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 10
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "created_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 11
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "last_active_at",
				type: "bigint",
				nullable: false,
				identity: false,
				default: null,
				position: 12
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "removed_at",
				type: "bigint",
				nullable: true,
				identity: false,
				default: null,
				position: 13
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "run_end_cleanup_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 14
			}
		},
		{
			table: "worktrees",
			kind: "column",
			value: {
				name: "gc_protection_json",
				type: "text",
				nullable: true,
				identity: false,
				default: null,
				position: 15
			}
		},
		{
			table: "worktrees",
			kind: "primaryKey",
			value: ["id"]
		},
		{
			table: "worktrees",
			kind: "indexes",
			value: 3
		},
		{
			table: "worktrees",
			kind: "checks",
			value: 1
		}
	]
};
//#endregion
//#region src/state/openclaw-state-db-engine.ts
const recovery = "Use the matching OpenClaw version or restore the matching PostgreSQL schema and anchor.";
function isStatePostgres() {
	return stateEngineInput() !== void 0;
}
function assertStateFileSnapshotAllowed() {
	if (stateEngineInput()) requireNativeDatabaseFile("postgres", "file-snapshot");
}
function inspectStateSqlite(e) {
	const t = getAdmittedSqliteSchemaFacts(e) ?? captureSqliteSchemaFacts(e);
	return {
		hasEngineAnchor: t.tables.has("openclaw_engine_anchor"),
		hasExistingData: [
			...t.tables,
			...t.views,
			...t.triggers.keys()
		].some((e) => e !== "openclaw_engine_anchor" && !e.startsWith("sqlite_"))
	};
}
function admitStatePostgres(e, t) {
	if (!t && getStateRuntimeSchemaAdmission(e)?.startupReady) return;
	const n = withPostgresSchemaAdmissionRetry(e, () => {
		const t = getPostgresPhysicalFacts(e);
		if (!t) throw new PostgresSchemaAdmissionUnavailableError(`Missing PostgreSQL state admission. ${recovery}`);
		return t;
	});
	const r = new Set(n.catalog.filter((e) => e.kind === "table").map((e) => e.table));
	const i = new Set(statePostgresRuntime.fragments.flatMap((e) => e.tables.some((e) => r.has(e)) ? [] : e.tables));
	if (n.version === 36) assertPostgresCatalog(n.catalog.filter((e) => !e.kind.endsWith("Definition") && e.table !== "openclaw_schema_meta"), statePostgresRuntime.expectedCatalog.filter((e) => !i.has(e.table)));
	if (t) {
		const t = Date.now();
		e.prepare(`INSERT INTO schema_meta
        (meta_key, role, schema_version, agent_id, app_version, created_at, updated_at)
        VALUES ('primary', 'global', ?, NULL, ?, ?, ?)`).run(36, VERSION, t, t);
		writeStateSchemaContentVersion(e);
	}
	const a = e.prepare("SELECT schema_version, role, agent_id FROM schema_meta WHERE meta_key = 'primary'").get();
	const o = e.prepare("SELECT value_json FROM config_machine_state WHERE state_key = 'state.schema.contentVersion'").get();
	let s;
	try {
		const e = o?.value_json;
		if (e !== void 0 && e !== null && typeof e !== "string") throw new Error("Invalid PostgreSQL state content marker");
		s = parseStateSchemaContentVersion(e);
	} catch {
		throw new Error("PostgreSQL state metadata mismatch. " + recovery);
	}
	if (a?.schema_version !== n.version || a.role !== "global" || a.agent_id !== null || s > n.version) throw new Error(`PostgreSQL state metadata mismatch. ${recovery}`);
	publishStateSchemaVersionAdmission(e, {
		userVersion: n.version,
		contentVersion: n.version
	});
	publishStateRuntimeSchemaAdmission(e, true);
}
const statePostgresSchema = {
	postgres: statePostgresRuntime.eagerSql,
	postgresFragments: statePostgresRuntime.fragments.map((e) => {
		const { activation: t } = e;
		if (t !== "first-use" && t !== "version-additive") throw new Error(`Unknown PostgreSQL state fragment activation: ${t}`);
		return {
			id: e.id,
			tables: e.tables,
			sql: e.sql,
			dependencies: e.dependencies,
			activation: t
		};
	})
};
function statePostgresVersionSql(e) {
	return `UPDATE schema_meta
        SET schema_version = ${e},
          app_version = '${VERSION.replaceAll("'", "''")}',
          updated_at = CAST(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000 AS bigint)
        WHERE meta_key = 'primary';
        INSERT INTO config_machine_state (state_key, value_json, updated_at_ms)
        VALUES ('state.schema.contentVersion', '${e}',
          CAST(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000 AS bigint))
        ON CONFLICT (state_key) DO UPDATE
          SET value_json = EXCLUDED.value_json, updated_at_ms = EXCLUDED.updated_at_ms;`;
}
function createStatePostgresMigrations() {
	const e = {
		postgres: withLegacyTemplateStateSchema(statePostgresSchema.postgres),
		postgresFragments: statePostgresSchema.postgresFragments.map((e) => ({
			...e,
			tables: e.tables.map(legacyTemplateStateIdentifier),
			sql: withLegacyTemplateStateSchema(e.sql)
		}))
	};
	const t = {
		postgres: withLegacyLocalWorkspaceCas(e.postgres),
		postgresFragments: e.postgresFragments.map((e) => ({
			...e,
			tables: e.tables.filter((e) => !WORKSPACE_CAS_TABLES.some((t) => t === e)),
			sql: withLegacyLocalWorkspaceCas(e.sql)
		}))
	};
	const n = {
		postgres: withLegacyPostgresIndexOrdering(t.postgres, "schema-nullability"),
		postgresFragments: t.postgresFragments.map((e) => ({
			...e,
			sql: withLegacyPostgresIndexOrdering(e.sql, "schema-nullability")
		}))
	};
	const r = {
		postgres: withLegacyPostgresIndexOrdering(n.postgres),
		postgresFragments: n.postgresFragments.map((e) => ({
			...e,
			sql: withLegacyPostgresIndexOrdering(e.sql)
		}))
	};
	const i = {
		postgres: withLegacyLocalWorkspaceManifests(r.postgres),
		postgresFragments: r.postgresFragments.map((e) => ({
			...e,
			tables: e.tables.filter((e) => e !== "local_workspace_manifest_nodes"),
			sql: withLegacyLocalWorkspaceManifests(e.sql)
		}))
	};
	const a = {
		...i,
		postgres: `${i.postgres}\n${statePostgresRuntime.clientCredentialSource.sql}`
	};
	const o = {
		postgres: withLegacyPublicationDraft(a.postgres),
		postgresFragments: a.postgresFragments.map((e) => ({
			...e,
			sql: withLegacyPublicationDraft(e.sql)
		}))
	};
	const s = {
		...o,
		postgres: o.postgres.replace(/CREATE INDEX "idx_state_leases_owner"[^;]*;/u, statePostgresRuntime.preWriteIndexesV27Sql.state_leases) + statePostgresRuntime.preWriteIndexesV27Sql.skill_usage + statePostgresRuntime.preWriteIndexesV27Sql.acp_replay_events,
		postgresFragments: o.postgresFragments
	};
	return [
		{
			version: 25,
			sql: statePostgresRuntime.operatorRecoveryV25Sql,
			fromSchema: s,
			schema: s
		},
		{
			version: 26,
			fromSchema: s,
			schema: s,
			sql: statePostgresVersionSql(26)
		},
		{
			version: 27,
			fromSchema: s,
			schema: o,
			sql: `${statePostgresRuntime.writeIndexesV27Sql}
        ${statePostgresVersionSql(27)}`
		},
		{
			version: 28,
			fromSchema: o,
			schema: a,
			sql: `ALTER TABLE IF EXISTS github_publication_requests ADD COLUMN draft bigint;
        ALTER TABLE IF EXISTS github_personal_publication_requests ADD COLUMN draft bigint;
        ALTER TABLE IF EXISTS github_repository_publication_requests ADD COLUMN draft bigint;
        ${statePostgresVersionSql(28)}`
		},
		{
			version: 29,
			fromSchema: a,
			schema: i,
			sql: statePostgresRuntime.clientCredentialV29Sql
		},
		{
			version: 30,
			fromSchema: i,
			schema: i,
			sql: statePostgresVersionSql(30)
		},
		{
			version: 31,
			fromSchema: i,
			schema: r,
			sql: `DO $workspace$
        DECLARE baseline_constraint text;
        BEGIN
          IF to_regclass('local_workspace_projections') IS NOT NULL THEN
            SELECT conname INTO STRICT baseline_constraint FROM pg_constraint
              WHERE conrelid = 'local_workspace_projections'::regclass AND contype = 'c'
                AND pg_get_constraintdef(oid) LIKE '%baseline_json%baseline_ref%';
            EXECUTE format('ALTER TABLE local_workspace_projections DROP CONSTRAINT %I', baseline_constraint);
            ALTER TABLE local_workspace_projections
              ADD COLUMN checkpoint_json text COLLATE "C",
              ADD CHECK (baseline_json IS NULL OR baseline_ref IS NOT NULL);
            CREATE TABLE local_workspace_manifest_nodes (
              worktree_id text COLLATE "C" NOT NULL,
              path text COLLATE "C" NOT NULL,
              node_json text COLLATE "C" NOT NULL,
              PRIMARY KEY (worktree_id, path),
              FOREIGN KEY (worktree_id) REFERENCES local_workspace_projections(worktree_id)
                ON DELETE CASCADE
            );
          END IF;
        END $workspace$;
        ${statePostgresVersionSql(31)}`
		},
		{
			version: 32,
			fromSchema: r,
			schema: n,
			sql: `${postgresIndexOrderingMigration([n.postgres, ...n.postgresFragments.map((e) => e.sql)].join("\n"))}
        ${statePostgresVersionSql(32)}`
		},
		{
			version: 33,
			fromSchema: n,
			schema: t,
			sql: `${postgresIndexOrderingMigration([t.postgres, ...t.postgresFragments.map((e) => e.sql)].join("\n"), "schema-nullability")}
        ${statePostgresVersionSql(33)}`
		},
		{
			version: 34,
			fromSchema: t,
			schema: t,
			sql: statePostgresVersionSql(34)
		},
		{
			version: 35,
			fromSchema: t,
			schema: e,
			sql: `${statePostgresRuntime.workspaceCasV35Sql}\n${statePostgresVersionSql(35)}`
		},
		{
			version: 36,
			fromSchema: e,
			schema: statePostgresSchema,
			sql: `${TEMPLATE_STATE_POSTGRES_MIGRATION_SQL}\n${statePostgresVersionSql(36)}`
		}
	];
}
const stateEngineSchema = {
	id: "state",
	version: 36,
	sqlite: "",
	...statePostgresSchema,
	get postgresMigrations() {
		const e = createStatePostgresMigrations();
		Object.defineProperty(this, "postgresMigrations", {
			value: e,
			enumerable: true,
			configurable: true,
			writable: true
		});
		return e;
	}
};
function ensureStatePostgresFragment(e, t) {
	const n = getPostgresPhysicalFacts(e);
	if (!n) throw new PostgresSchemaAdmissionUnavailableError(`Missing PostgreSQL state admission. ${recovery}`);
	const r = statePostgresRuntime.fragments.find((e) => e.tables.includes(t));
	if (!r) {
		if (statePostgresRuntime.expectedCatalog.some((e) => e.kind === "table" && e.table === t) && n.catalog.some((e) => e.kind === "table" && e.table === t)) return;
		throw new Error(`No PostgreSQL state fragment owns ${t}`);
	}
	if (r.tables.filter((e) => n.version >= 35 || !WORKSPACE_CAS_TABLES.some((t) => t === e)).every((e) => n.catalog.some((t) => t.kind === "table" && t.table === e))) return;
	for (const t of r.dependencies) {
		const n = statePostgresRuntime.fragments.find((e) => e.id === t);
		if (!n) throw new Error(`Unknown state fragment dependency ${t}`);
		ensureStatePostgresFragment(e, n.tables[0]);
	}
	if (!stageSqliteTransactionState(e, {
		commit: () => publishSqliteDatabaseSchemaChange(e),
		invalidate: () => publishSqliteDatabaseSchemaChange(e)
	})) throw new Error("PostgreSQL state fragments require the owner's transaction");
	invalidateLocalSqliteSchemaAdmissions(e);
	const i = n.version < 36 ? withLegacyTemplateStateSchema(r.sql) : r.sql;
	const a = n.version < 35 ? withLegacyLocalWorkspaceCas(i) : i;
	e.exec(n.version < 33 ? withLegacyPostgresIndexOrdering(a, n.version < 32 ? "sqlite" : "schema-nullability") : a);
	admitPostgresPhysicalFacts({
		db: e,
		namespace: n.namespace,
		storeId: n.storeId,
		store: n.store,
		version: n.version,
		schema: stateEngineSchema,
		recordSchema: true
	});
	admitStatePostgres(e, false);
}
function openExistingStatePostgresConnection(e, t) {
	if (!stateEngineInput()) return;
	return openExistingStatePostgresConnectionFromAnchor(openTrackedStateDatabase(e, {
		existingOnly: true,
		expectedIdentity: t
	}), e);
}
/** Consumes an anchor whose caller owns path admission, including updater read-only custody. */
function openExistingStatePostgresConnectionFromAnchor(e, t) {
	let n;
	try {
		const r = stateEngineInput();
		if (!r) throw new Error("PostgreSQL state inspection requires the configured state connection.");
		admitStateSchemaFacts(e, t);
		const i = openEngineStore({
			anchor: e,
			schema: stateEngineSchema,
			input: r,
			inspectSqlite: () => inspectStateSqlite(e),
			prepareAnchor: () => {},
			openSqlite: () => {},
			existingOnly: true,
			reusePostgresConnection: true,
			existingVersion: true,
			admitPostgres: admitStatePostgres,
			closeOnFailure: (e, t) => {
				n = e;
				throw t;
			}
		});
		if (!isPostgresSqlConnection(i)) throw new Error("Expected PostgreSQL state connection");
		n = i;
		return {
			database: {
				db: n,
				path: t
			},
			close() {
				throwSqliteLifecycleErrors(openClawStateDatabaseCache.closeUnpublishedOpenClawStateDatabaseHandle({
					db: i,
					path: t
				}), "PostgreSQL state connection cleanup failed.");
				return !i.isOpen && !e.isOpen;
			}
		};
	} catch (r) {
		const i = openClawStateDatabaseCache.closeUnpublishedOpenClawStateDatabaseHandle({
			db: n ?? e,
			path: t
		});
		if (i.length) throw createSqliteLifecycleAggregateError([r, ...i], "PostgreSQL state connection acquisition and cleanup failed.", r);
		throw r;
	}
}
//#endregion
export { WORKSPACE_CAS_COLUMNS as _, isStatePostgres as a, withLegacyLocalWorkspaceCas as b, stateEngineSchema as c, isUnfencedUpdateDriver as d, readStateSchemaPublicationBlocker as f, withLegacyLocalWorkspaceManifests as g, stateLocalWorkspaceManifestMigration as h, inspectStateSqlite as i, statePostgresRuntime as l, withPostgresSchemaAdmissionRetry as m, assertStateFileSnapshotAllowed as n, openExistingStatePostgresConnection as o, resolveStateSchemaVersionToPublish as p, ensureStatePostgresFragment as r, openExistingStatePostgresConnectionFromAnchor as s, admitStatePostgres as t, advanceStateSchemaContentVersion as u, WORKSPACE_CAS_TABLES as v, stateLocalWorkspaceCasMigration as y };