@opengeni/db 0.9.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/{chunk-4LG5NBTC.js → chunk-VUKRIBO5.js} +577 -12
  2. package/dist/chunk-VUKRIBO5.js.map +1 -0
  3. package/dist/{chunk-KW526IJA.js → chunk-Y5WZZVQK.js} +80 -4
  4. package/dist/chunk-Y5WZZVQK.js.map +1 -0
  5. package/dist/index.d.ts +4 -2
  6. package/dist/index.js +6372 -2189
  7. package/dist/index.js.map +1 -1
  8. package/dist/migrate.d.ts +6 -3
  9. package/dist/migrate.js +1 -1
  10. package/dist/provision-roles.d.ts +1122 -91
  11. package/dist/{schema-CdPGTHlD.d.ts → schema-CnpD6BcX.d.ts} +5908 -3626
  12. package/dist/schema.d.ts +1 -1
  13. package/dist/schema.js +19 -1
  14. package/drizzle/0053_codex_credential_leases.sql +2 -2
  15. package/drizzle/0057_durable_queue_control.sql +1 -1
  16. package/drizzle/0061_session_workflow_wake_outbox.sql +1 -1
  17. package/drizzle/0062_session_list_snapshot_reaper.sql +1 -1
  18. package/drizzle/0063_session_control_mega_foundation.sql +1 -1
  19. package/drizzle/0064_rotation_strategy_sharded_backfill.sql +1 -1
  20. package/drizzle/0065_codex_subscription_overview.sql +168 -0
  21. package/drizzle/0065_session_tool_policy.sql +38 -0
  22. package/drizzle/0067_session_event_payload_bounds.sql +2 -2
  23. package/drizzle/0068_workspace_control_event_bounds.sql +2 -2
  24. package/drizzle/0069_session_event_history_backfill.sql +2 -2
  25. package/drizzle/0074_session_activity_revisions.sql +2 -2
  26. package/drizzle/0106_session_attempt_mcp_approval_policies.sql +29 -0
  27. package/drizzle/0107_host_export_lineage_contract.sql +381 -0
  28. package/drizzle/0108_fence_invalidated_warming_epochs.sql +76 -0
  29. package/drizzle/0109_nested_agent_depth_expand.sql +42 -0
  30. package/drizzle/0110_nested_agent_depth_boundary.sql +480 -0
  31. package/drizzle/0111_nested_agent_depth_backfill.sql +49 -0
  32. package/drizzle/0112_nested_agent_depth_contract.sql +38 -0
  33. package/drizzle/0113_nested_agent_depth_validate.sql +13 -0
  34. package/drizzle/0114_nested_agent_depth_contract.sql +49 -0
  35. package/drizzle/0115_nested_agent_depth_validate.sql +11 -0
  36. package/drizzle/0116_nested_agent_depth_index.sql +4 -0
  37. package/drizzle/0117_sandbox_recovery_generations.sql +699 -0
  38. package/drizzle/0118_new_session_drafts.sql +59 -0
  39. package/drizzle/0119_pending_tool_output_policy.sql +5 -0
  40. package/drizzle/0120_durable_goal_wake.sql +360 -0
  41. package/drizzle/0121_goal_update_idempotency.sql +11 -0
  42. package/package.json +5 -4
  43. package/src/codex-token-resolver.ts +175 -14
  44. package/src/connection-token-resolver.ts +143 -120
  45. package/src/event-payload-sanitizer.ts +32 -2
  46. package/src/index.ts +7734 -1330
  47. package/src/migrate.ts +131 -2
  48. package/src/new-session-drafts.ts +144 -0
  49. package/src/schema.ts +626 -16
  50. package/src/session-control.ts +44 -18
  51. package/src/session-queue-commands.ts +94 -21
  52. package/src/session-tool-call-settlement.ts +6 -1
  53. package/dist/chunk-4LG5NBTC.js.map +0 -1
  54. package/dist/chunk-KW526IJA.js.map +0 -1
@@ -4,6 +4,9 @@ import { dirname, join } from "path";
4
4
  import { fileURLToPath } from "url";
5
5
  import postgres from "postgres";
6
6
  var DEFAULT_DATABASE_URL = "postgres://opengeni:opengeni@127.0.0.1:5432/opengeni";
7
+ var DEFAULT_MAX_NESTED_AGENT_DEPTH = 3;
8
+ var MAX_NESTED_AGENT_DEPTH = 2147483647;
9
+ var batchedBackfillDirective = /^-- opengeni:batched-backfill batch-size=(\d+) lock-timeout=(\d+(?:ms|s|min)) statement-timeout=(\d+(?:ms|s|min))$/;
7
10
  var concurrentIndexDirective = /^-- opengeni:concurrent-index lock-timeout=(\d+(?:ms|s|min))$/;
8
11
  var concurrentIndexStatement = /^CREATE\s+(?:UNIQUE\s+)?INDEX\s+CONCURRENTLY\s+(?:(IF\s+NOT\s+EXISTS)\s+)?(?:"((?:[^"]|"")+)"|([A-Za-z_][A-Za-z0-9_]*))\s+ON\b/is;
9
12
  var governedLegacyConcurrentIndexMigrations = /* @__PURE__ */ new Set([
@@ -56,7 +59,44 @@ function parseConcurrentIndexMigration(file, sqlText) {
56
59
  statement
57
60
  };
58
61
  }
62
+ function parseBatchedBackfillMigration(file, sqlText) {
63
+ const lines = sqlText.replaceAll("\r\n", "\n").split("\n");
64
+ const directiveIndex = /^-- deployment-mode: (?:rolling|maintenance)$/.test(
65
+ lines[0]?.trim() ?? ""
66
+ ) ? 1 : 0;
67
+ const directive = batchedBackfillDirective.exec(lines[directiveIndex]?.trim() ?? "");
68
+ if (!directive) return null;
69
+ const statement = lines.slice(directiveIndex + 1).filter((line) => !line.trim().startsWith("--")).join("\n").trim();
70
+ const withoutTrailingSemicolon = statement.endsWith(";") ? statement.slice(0, -1).trimEnd() : statement;
71
+ const batchSize = Number(directive[1]);
72
+ if (!Number.isSafeInteger(batchSize) || batchSize < 1 || batchSize > 1e4 || !/^WITH\b/is.test(withoutTrailingSemicolon) || !/\bUPDATE\b/is.test(withoutTrailingSemicolon) || !/\bRETURNING\b/is.test(withoutTrailingSemicolon) || !new RegExp(`\\bLIMIT\\s+${batchSize}\\b`, "i").test(withoutTrailingSemicolon) || withoutTrailingSemicolon.includes(";")) {
73
+ throw new Error(
74
+ `${file}: opengeni:batched-backfill requires one bounded WITH ... UPDATE ... RETURNING statement whose LIMIT matches batch-size`
75
+ );
76
+ }
77
+ return {
78
+ batchSize,
79
+ lockTimeout: directive[2],
80
+ statementTimeout: directive[3],
81
+ statement
82
+ };
83
+ }
59
84
  async function executeMigrationFile(sql, file, sqlText) {
85
+ const batchedBackfill = parseBatchedBackfillMigration(file, sqlText);
86
+ if (batchedBackfill) {
87
+ await sql`select set_config('lock_timeout', ${batchedBackfill.lockTimeout}, false)`;
88
+ await sql`select set_config('statement_timeout', ${batchedBackfill.statementTimeout}, false)`;
89
+ try {
90
+ for (; ; ) {
91
+ const result = await sql.unsafe(batchedBackfill.statement);
92
+ if (result.length === 0) break;
93
+ }
94
+ } finally {
95
+ await sql`select set_config('statement_timeout', '0', false)`;
96
+ await sql`select set_config('lock_timeout', '0', false)`;
97
+ }
98
+ return;
99
+ }
60
100
  const concurrentIndex = parseConcurrentIndexMigration(file, sqlText);
61
101
  if (!concurrentIndex) {
62
102
  await sql.unsafe(sqlText);
@@ -82,9 +122,42 @@ async function executeMigrationFile(sql, file, sqlText) {
82
122
  await sql`select set_config('lock_timeout', '0', false)`;
83
123
  }
84
124
  }
85
- async function migrate(databaseUrl = process.env.OPENGENI_MIGRATIONS_DATABASE_URL ?? process.env.OPENGENI_DATABASE_URL ?? DEFAULT_DATABASE_URL, schema = process.env.OPENGENI_DB_SCHEMA?.trim() || void 0) {
125
+ function deploymentDepthPolicy(options) {
126
+ const raw = options === void 0 ? process.env.OPENGENI_MAX_NESTED_AGENT_DEPTH?.trim() || void 0 : options.maxNestedAgentDepth;
127
+ if (raw === void 0) {
128
+ return { maxNestedAgentDepth: DEFAULT_MAX_NESTED_AGENT_DEPTH, source: "default" };
129
+ }
130
+ const value = typeof raw === "number" ? raw : Number(raw);
131
+ if (!Number.isSafeInteger(value) || value < 0 || value > MAX_NESTED_AGENT_DEPTH || typeof raw === "string" && !/^(0|[1-9][0-9]*)$/.test(raw)) {
132
+ throw new Error(
133
+ `OPENGENI_MAX_NESTED_AGENT_DEPTH must be a non-negative 32-bit integer: ${raw}`
134
+ );
135
+ }
136
+ return { maxNestedAgentDepth: value, source: "deployment" };
137
+ }
138
+ async function persistDeploymentDepthPolicy(sql, policy) {
139
+ const [relation] = await sql`
140
+ select to_regclass('nested_agent_depth_configuration') is not null as exists
141
+ `;
142
+ if (!relation?.exists) return;
143
+ await sql`
144
+ insert into "nested_agent_depth_configuration" (
145
+ "singleton", "max_nested_agent_depth", "policy_source", "updated_at"
146
+ ) values (true, ${policy.maxNestedAgentDepth}, ${policy.source}, now())
147
+ on conflict ("singleton") do update
148
+ set "max_nested_agent_depth" = excluded."max_nested_agent_depth",
149
+ "policy_source" = excluded."policy_source",
150
+ "updated_at" = now()
151
+ where "nested_agent_depth_configuration"."max_nested_agent_depth"
152
+ is distinct from excluded."max_nested_agent_depth"
153
+ or "nested_agent_depth_configuration"."policy_source"
154
+ is distinct from excluded."policy_source"
155
+ `;
156
+ }
157
+ async function migrate(databaseUrl = process.env.OPENGENI_MIGRATIONS_DATABASE_URL ?? process.env.OPENGENI_DATABASE_URL ?? DEFAULT_DATABASE_URL, schema = process.env.OPENGENI_DB_SCHEMA?.trim() || void 0, runtimeOptions) {
86
158
  const migrationsDir = join(dirname(fileURLToPath(import.meta.url)), "../drizzle");
87
159
  const files = (await readdir(migrationsDir)).filter((file) => file.endsWith(".sql")).sort();
160
+ const depthPolicy = deploymentDepthPolicy(runtimeOptions);
88
161
  const sql = postgres(databaseUrl, { max: 1 });
89
162
  try {
90
163
  await sql`SELECT pg_advisory_lock(727458)`;
@@ -94,6 +167,8 @@ async function migrate(databaseUrl = process.env.OPENGENI_MIGRATIONS_DATABASE_UR
94
167
  await sql.unsafe(`CREATE SCHEMA IF NOT EXISTS "opengeni_private"`);
95
168
  await sql.unsafe(`SET search_path = "${schema}", "opengeni_private", "public"`);
96
169
  }
170
+ await sql`select set_config('opengeni.max_nested_agent_depth', ${String(depthPolicy.maxNestedAgentDepth)}, false)`;
171
+ await sql`select set_config('opengeni.nested_agent_depth_policy_source', ${depthPolicy.source}, false)`;
97
172
  await sql.unsafe(
98
173
  `CREATE TABLE IF NOT EXISTS "schema_migrations" ("name" text PRIMARY KEY, "applied_at" timestamptz NOT NULL DEFAULT now())`
99
174
  );
@@ -107,12 +182,13 @@ async function migrate(databaseUrl = process.env.OPENGENI_MIGRATIONS_DATABASE_UR
107
182
  await executeMigrationFile(sql, file, sqlText);
108
183
  await sql`INSERT INTO "schema_migrations" ("name") VALUES (${file}) ON CONFLICT DO NOTHING`;
109
184
  }
185
+ await persistDeploymentDepthPolicy(sql, depthPolicy);
110
186
  } finally {
111
187
  await sql.end();
112
188
  }
113
189
  }
114
- async function runMigrations(adminConnection, targetSchema) {
115
- await migrate(adminConnection, targetSchema);
190
+ async function runMigrations(adminConnection, targetSchema, runtimeOptions) {
191
+ await migrate(adminConnection, targetSchema, runtimeOptions);
116
192
  }
117
193
  if (import.meta.main) {
118
194
  await migrate();
@@ -124,4 +200,4 @@ export {
124
200
  migrate,
125
201
  runMigrations
126
202
  };
127
- //# sourceMappingURL=chunk-KW526IJA.js.map
203
+ //# sourceMappingURL=chunk-Y5WZZVQK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/migrate.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport postgres from \"postgres\";\n\nconst DEFAULT_DATABASE_URL = \"postgres://opengeni:opengeni@127.0.0.1:5432/opengeni\";\nconst DEFAULT_MAX_NESTED_AGENT_DEPTH = 3;\nconst MAX_NESTED_AGENT_DEPTH = 2_147_483_647;\nconst batchedBackfillDirective =\n /^-- opengeni:batched-backfill batch-size=(\\d+) lock-timeout=(\\d+(?:ms|s|min)) statement-timeout=(\\d+(?:ms|s|min))$/;\nconst concurrentIndexDirective = /^-- opengeni:concurrent-index lock-timeout=(\\d+(?:ms|s|min))$/;\nconst concurrentIndexStatement =\n /^CREATE\\s+(?:UNIQUE\\s+)?INDEX\\s+CONCURRENTLY\\s+(?:(IF\\s+NOT\\s+EXISTS)\\s+)?(?:\"((?:[^\"]|\"\")+)\"|([A-Za-z_][A-Za-z0-9_]*))\\s+ON\\b/is;\nconst governedLegacyConcurrentIndexMigrations = new Set([\n \"0066_session_interruption_attempt_lookup.sql\",\n \"0070_session_event_type_sequence_lookup.sql\",\n \"0071_session_event_monitoring_tail.sql\",\n \"0072_sessions_workspace_created_id_idx.sql\",\n \"0073_sessions_workspace_updated_id_idx.sql\",\n \"0075_sessions_workspace_activity_revision_idx.sql\",\n \"0077_session_attempt_latest_lookup.sql\",\n]);\n\nexport interface ConcurrentIndexMigration {\n indexName: string;\n lockTimeout: string;\n skipWhenValid: boolean;\n statement: string;\n}\n\nexport type MigrationRuntimeOptions = {\n maxNestedAgentDepth?: number;\n};\n\ntype DeploymentDepthPolicy = {\n maxNestedAgentDepth: number;\n source: \"deployment\" | \"default\";\n};\n\n/** A bare Postgres identifier (schema/role name) safe to interpolate into DDL. */\nfunction assertIdentifier(name: string, value: string): string {\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(value)) {\n throw new Error(`${name} is not a valid Postgres identifier: ${value}`);\n }\n return value;\n}\n\n/**\n * Most migration files intentionally execute as one implicit transaction.\n * PostgreSQL forbids CREATE INDEX CONCURRENTLY there, so a migration may opt\n * into one narrowly validated transactionless statement with:\n *\n * -- opengeni:concurrent-index lock-timeout=5s\n * CREATE [UNIQUE] INDEX CONCURRENTLY IF NOT EXISTS ...;\n *\n * The directive is deliberately not a generic \"no transaction\" escape hatch:\n * only one idempotent concurrent-index statement is accepted, lock acquisition\n * is always bounded, and an invalid artifact left by a failed concurrent build\n * is removed before retry. Seven governed historical migrations predate the\n * IF NOT EXISTS rule; only those exact filenames may use their immutable bare\n * statements, and the runner makes their retries idempotent by skipping an\n * already-valid index. This keeps additive large-table indexes online without\n * rewriting shipped history or making arbitrary partially-applied migration\n * scripts possible.\n */\nexport function parseConcurrentIndexMigration(\n file: string,\n sqlText: string,\n): ConcurrentIndexMigration | null {\n const lines = sqlText.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n const firstLine = lines[0]?.trim() ?? \"\";\n const deploymentPrefixed = /^-- deployment-mode: (?:rolling|maintenance)$/.test(firstLine);\n const directiveIndex = deploymentPrefixed ? 1 : 0;\n const directiveLine = lines[directiveIndex]?.trim() ?? \"\";\n const directive = concurrentIndexDirective.exec(directiveLine);\n if (!directive) {\n if (directiveLine.startsWith(\"-- opengeni:\")) {\n throw new Error(`Unsupported OpenGeni migration directive in ${file}`);\n }\n return null;\n }\n\n const lockTimeout = directive[1]!;\n const statement = lines\n .slice(directiveIndex + 1)\n .join(\"\\n\")\n .trim();\n const withoutTrailingSemicolon = statement.endsWith(\";\")\n ? statement.slice(0, -1).trimEnd()\n : statement;\n const parsedStatement = concurrentIndexStatement.exec(withoutTrailingSemicolon);\n if (!parsedStatement || withoutTrailingSemicolon.includes(\";\")) {\n throw new Error(\n `${file}: opengeni:concurrent-index requires exactly one CREATE [UNIQUE] INDEX CONCURRENTLY IF NOT EXISTS statement with an unqualified index name`,\n );\n }\n const idempotentInSql = parsedStatement[1] !== undefined;\n if (!idempotentInSql && !governedLegacyConcurrentIndexMigrations.has(file)) {\n throw new Error(\n `${file}: opengeni:concurrent-index requires IF NOT EXISTS; bare statements are supported only for governed historical migrations`,\n );\n }\n return {\n indexName: (parsedStatement[2] ?? parsedStatement[3]!).replaceAll('\"\"', '\"'),\n lockTimeout,\n skipWhenValid: !idempotentInSql,\n statement,\n };\n}\n\nfunction parseBatchedBackfillMigration(\n file: string,\n sqlText: string,\n): { batchSize: number; lockTimeout: string; statementTimeout: string; statement: string } | null {\n const lines = sqlText.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n const directiveIndex = /^-- deployment-mode: (?:rolling|maintenance)$/.test(\n lines[0]?.trim() ?? \"\",\n )\n ? 1\n : 0;\n const directive = batchedBackfillDirective.exec(lines[directiveIndex]?.trim() ?? \"\");\n if (!directive) return null;\n const statement = lines\n .slice(directiveIndex + 1)\n .filter((line) => !line.trim().startsWith(\"--\"))\n .join(\"\\n\")\n .trim();\n const withoutTrailingSemicolon = statement.endsWith(\";\")\n ? statement.slice(0, -1).trimEnd()\n : statement;\n const batchSize = Number(directive[1]!);\n if (\n !Number.isSafeInteger(batchSize) ||\n batchSize < 1 ||\n batchSize > 10_000 ||\n !/^WITH\\b/is.test(withoutTrailingSemicolon) ||\n !/\\bUPDATE\\b/is.test(withoutTrailingSemicolon) ||\n !/\\bRETURNING\\b/is.test(withoutTrailingSemicolon) ||\n !new RegExp(`\\\\bLIMIT\\\\s+${batchSize}\\\\b`, \"i\").test(withoutTrailingSemicolon) ||\n withoutTrailingSemicolon.includes(\";\")\n ) {\n throw new Error(\n `${file}: opengeni:batched-backfill requires one bounded WITH ... UPDATE ... RETURNING statement whose LIMIT matches batch-size`,\n );\n }\n return {\n batchSize,\n lockTimeout: directive[2]!,\n statementTimeout: directive[3]!,\n statement,\n };\n}\n\nasync function executeMigrationFile(\n sql: postgres.Sql,\n file: string,\n sqlText: string,\n): Promise<void> {\n const batchedBackfill = parseBatchedBackfillMigration(file, sqlText);\n if (batchedBackfill) {\n await sql`select set_config('lock_timeout', ${batchedBackfill.lockTimeout}, false)`;\n await sql`select set_config('statement_timeout', ${batchedBackfill.statementTimeout}, false)`;\n try {\n for (;;) {\n const result = await sql.unsafe(batchedBackfill.statement);\n if (result.length === 0) break;\n }\n } finally {\n await sql`select set_config('statement_timeout', '0', false)`;\n await sql`select set_config('lock_timeout', '0', false)`;\n }\n return;\n }\n const concurrentIndex = parseConcurrentIndexMigration(file, sqlText);\n if (!concurrentIndex) {\n await sql.unsafe(sqlText);\n return;\n }\n\n await sql`select set_config('lock_timeout', ${concurrentIndex.lockTimeout}, false)`;\n try {\n const [existing] = await sql<Array<{ valid: boolean; ready: boolean }>>`\n select i.indisvalid as valid, i.indisready as ready\n from pg_catalog.pg_class c\n join pg_catalog.pg_namespace n on n.oid = c.relnamespace\n join pg_catalog.pg_index i on i.indexrelid = c.oid\n where n.nspname = current_schema() and c.relname = ${concurrentIndex.indexName}\n `;\n if (existing && (!existing.valid || !existing.ready)) {\n const quotedIndexName = `\"${concurrentIndex.indexName.replaceAll('\"', '\"\"')}\"`;\n await sql.unsafe(`DROP INDEX CONCURRENTLY ${quotedIndexName}`);\n } else if (existing && concurrentIndex.skipWhenValid) {\n return;\n }\n await sql.unsafe(concurrentIndex.statement);\n } finally {\n await sql`select set_config('lock_timeout', '0', false)`;\n }\n}\n\nfunction deploymentDepthPolicy(\n options: MigrationRuntimeOptions | undefined,\n): DeploymentDepthPolicy {\n const raw =\n options === undefined\n ? process.env.OPENGENI_MAX_NESTED_AGENT_DEPTH?.trim() || undefined\n : options.maxNestedAgentDepth;\n if (raw === undefined) {\n return { maxNestedAgentDepth: DEFAULT_MAX_NESTED_AGENT_DEPTH, source: \"default\" };\n }\n const value = typeof raw === \"number\" ? raw : Number(raw);\n if (\n !Number.isSafeInteger(value) ||\n value < 0 ||\n value > MAX_NESTED_AGENT_DEPTH ||\n (typeof raw === \"string\" && !/^(0|[1-9][0-9]*)$/.test(raw))\n ) {\n throw new Error(\n `OPENGENI_MAX_NESTED_AGENT_DEPTH must be a non-negative 32-bit integer: ${raw}`,\n );\n }\n return { maxNestedAgentDepth: value, source: \"deployment\" };\n}\n\nasync function persistDeploymentDepthPolicy(\n sql: postgres.Sql,\n policy: DeploymentDepthPolicy,\n): Promise<void> {\n const [relation] = await sql<{ exists: boolean }[]>`\n select to_regclass('nested_agent_depth_configuration') is not null as exists\n `;\n if (!relation?.exists) return;\n await sql`\n insert into \"nested_agent_depth_configuration\" (\n \"singleton\", \"max_nested_agent_depth\", \"policy_source\", \"updated_at\"\n ) values (true, ${policy.maxNestedAgentDepth}, ${policy.source}, now())\n on conflict (\"singleton\") do update\n set \"max_nested_agent_depth\" = excluded.\"max_nested_agent_depth\",\n \"policy_source\" = excluded.\"policy_source\",\n \"updated_at\" = now()\n where \"nested_agent_depth_configuration\".\"max_nested_agent_depth\"\n is distinct from excluded.\"max_nested_agent_depth\"\n or \"nested_agent_depth_configuration\".\"policy_source\"\n is distinct from excluded.\"policy_source\"\n `;\n}\n\n/**\n * Apply the OpenGeni SQL migration chain.\n *\n * STANDALONE (default, unchanged): `migrate()` / `migrate(databaseUrl)` runs the\n * whole chain with NO search_path manipulation, so every unqualified\n * table/index/policy lands in the server default schema (`public`). This is the\n * byte-for-byte historical behavior — the migration test suite calls\n * `migrate(DB_URL)` and is unaffected.\n *\n * EMBEDDED SCHEMA MODE: pass a `schema` (or set\n * `OPENGENI_DB_SCHEMA`). The migrate session then `CREATE SCHEMA IF NOT EXISTS`\n * for both `<schema>` and `opengeni_private`, and sets\n * `search_path = \"<schema>\", \"opengeni_private\", \"public\"`, so EVERY unqualified\n * DDL statement lands in the dedicated schema with NO per-statement SQL rewrite\n * (the schema-isolation contract). Two things make this work and stay idempotent:\n * 1. The policy-existence guards in the migration SQL use `current_schema()`\n * (not a hardcoded `'public'`) — so a re-run finds the policy it already\n * created in `<schema>` and DROP/CREATEs idempotently instead of failing\n * with \"policy already exists\". (This guard substitution is the migrate-\n * time enabler for the runtime search_path approach; without it the SDK\n * entry point silently fails on re-run — the migration replay hazard.)\n * 2. `public` stays LAST on the path so `gen_random_uuid()` (pgcrypto) and the\n * `vector` type — both installed into `public` by 0000 — still resolve. The\n * `opengeni_private.*` helpers are always called with an absolute prefix.\n *\n * `OPENGENI_DB_SCHEMA` defaults UNSET → `public` → standalone, so the default\n * binding never regresses.\n */\nexport async function migrate(\n databaseUrl = process.env.OPENGENI_MIGRATIONS_DATABASE_URL ??\n process.env.OPENGENI_DATABASE_URL ??\n DEFAULT_DATABASE_URL,\n schema: string | undefined = process.env.OPENGENI_DB_SCHEMA?.trim() || undefined,\n runtimeOptions?: MigrationRuntimeOptions,\n): Promise<void> {\n const migrationsDir = join(dirname(fileURLToPath(import.meta.url)), \"../drizzle\");\n const files = (await readdir(migrationsDir)).filter((file) => file.endsWith(\".sql\")).sort();\n const depthPolicy = deploymentDepthPolicy(runtimeOptions);\n const sql = postgres(databaseUrl, { max: 1 });\n try {\n // Serialize concurrent migrate() runs; the session-level lock is released\n // when the connection closes.\n await sql`SELECT pg_advisory_lock(727458)`;\n if (schema) {\n assertIdentifier(\"OPENGENI_DB_SCHEMA\", schema);\n await sql.unsafe(`CREATE SCHEMA IF NOT EXISTS \"${schema}\"`);\n // opengeni_private is also created by 0001 with an absolute prefix, but the\n // session search_path must already resolve it for the policy predicates\n // and the SECURITY DEFINER functions that inherit the caller's path.\n await sql.unsafe(`CREATE SCHEMA IF NOT EXISTS \"opengeni_private\"`);\n await sql.unsafe(`SET search_path = \"${schema}\", \"opengeni_private\", \"public\"`);\n }\n await sql`select set_config('opengeni.max_nested_agent_depth', ${String(depthPolicy.maxNestedAgentDepth)}, false)`;\n await sql`select set_config('opengeni.nested_agent_depth_policy_source', ${depthPolicy.source}, false)`;\n await sql.unsafe(\n `CREATE TABLE IF NOT EXISTS \"schema_migrations\" (\"name\" text PRIMARY KEY, \"applied_at\" timestamptz NOT NULL DEFAULT now())`,\n );\n const appliedRows = await sql`SELECT \"name\" FROM \"schema_migrations\"`;\n const applied = new Set(appliedRows.map((row) => row.name as string));\n for (const file of files) {\n if (applied.has(file)) {\n continue;\n }\n const sqlText = await readFile(join(migrationsDir, file), \"utf8\");\n await executeMigrationFile(sql, file, sqlText);\n await sql`INSERT INTO \"schema_migrations\" (\"name\") VALUES (${file}) ON CONFLICT DO NOTHING`;\n }\n // Reconcile even when all migration names were already recorded. This is\n // the only supported way to change deployment policy in a live database.\n await persistDeploymentDepthPolicy(sql, depthPolicy);\n } finally {\n await sql.end();\n }\n}\n\n/**\n * SDK entry point (Step I): run the migration chain over a host-supplied admin\n * connection string against an explicit target schema. This is the embedded\n * topology's named entry — a host calls `runMigrations(adminConnection,\n * targetSchema)` from its own provisioning code instead of relying on env vars.\n * `targetSchema` undefined → `public` → standalone behavior. Thin wrapper over\n * `migrate` so there is one migration engine.\n */\nexport async function runMigrations(\n adminConnection: string,\n targetSchema?: string,\n runtimeOptions?: MigrationRuntimeOptions,\n): Promise<void> {\n await migrate(adminConnection, targetSchema, runtimeOptions);\n}\n\nif (import.meta.main) {\n await migrate();\n console.log(\"Applied Drizzle SQL migrations.\");\n}\n"],"mappings":"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","names":[]}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,9 @@ import '@opengeni/contracts';
2
2
  import '@opengeni/config';
3
3
  export { isCodexBilledModel } from '@opengeni/codex';
4
4
  export { sql as dbSql } from 'drizzle-orm';
5
- export { A as AGENT_VISIBLE_MEMORY_STATUSES, a as AcceptSessionApprovalDecisionResult, b as AcceptSessionHumanInputResponseResult, c as AccrueWarmSecondsResult, d as AcquireLeaseInput, e as AcquireLeaseResult, f as ActiveSandboxPointer, g as AddSessionSystemUpdateInput, h as AddSessionSystemUpdateResult, i as AgentCommandAuthorityError, j as AgentInternalUpdateCommandResult, k as AppendEventInput, l as ApplyContextCompactionResult, m as ApplySessionTurnSettlementInput, n as ApplySessionTurnSettlementResult, o as ArmCodexCapacityWaitResult, B as BootstrapWorkspaceInput, C as CODEX_CAPACITY_REFRESH_MAX_MS, p as CODEX_CAPACITY_REFRESH_MIN_MS, q as CODEX_CREDENTIAL_LEASE_TTL_MS, r as CODEX_ROTATION_STRATEGIES, s as ClaimSessionWorkForAttemptInput, t as ClaimSessionWorkForAttemptResult, u as ClearSessionContextResult, v as CodexAccountStatus, w as CodexAccountUsageSnapshot, x as CodexAuthDeps, y as CodexCapacityAvailabilityDecision, z as CodexCapacityMutationResult, D as CodexCapacityResetKind, E as CodexCapacitySelectionContext, F as CodexCapacityWait, G as CodexCapacityWaitStatus, H as CodexCapacityWakeTarget, I as CodexCredentialForRun, J as CodexCredentialLeaseCandidateFilter, K as CodexCredentialLeaseCandidateFilterResult, L as CodexCredentialLeasePolicyScopeResolver, M as CodexCredentialLeaseQuarantine, N as CodexCredentialLeaseResult, O as CodexCredentialLeaseSelection, P as CodexCredentialLeaseSelectionContext, Q as CodexCredentialStatus, R as CodexCredentialTokens, S as CodexLeaseAccountStatus, T as CodexPinSource, U as CodexRotationSettings, V as CodexRotationStrategy, W as ComposerDraftRow, X as ConnectionBrokerDeps, Y as ConnectionCredentialForBroker, Z as ConnectionRefreshHttpError, _ as ConsumeOAuthStateNonceInput, $ as CorrectWorkspaceMemoryInput, a0 as CorrectWorkspaceMemoryResult, a1 as CreateCapabilityCatalogItemInput, a2 as CreateConnectionInput, a3 as CreateDbOptions, a4 as CreateImportBatchInput, a5 as CreateKnowledgeMemoryInput, a6 as CreatePackInstallationInput, a7 as CreateScheduledTaskInput, a8 as CreateSessionGoalInput, a9 as CreateSessionMcpServerInput, aa as CreateSocialConnectionInput, ab as CreateSocialPostInput, ac as CreditBalanceByAccount, ad as Database, ae as DatabaseFailureCode, af as DbClient, ag as DeviceEnrollmentRequestRecord, ah as DeviceEnrollmentStatus, ai as EditQueueCommandResult, aj as EffectiveControlBlocker, ak as EffectiveControlResumeOption, al as EffectiveControlState, am as EffectiveSessionControl, an as EnableCapabilityInstallationInput, ao as EnabledMcpCapabilityServer, ap as EnqueueSessionTurnInput, aq as EnrollmentExposure, ar as EnrollmentOs, as as EnrollmentRecord, at as EnrollmentStatus, au as ExpiredFileUploadCleanupClaim, av as FileUploadCleanupClaimResult, aw as ForceDrainResult, ax as FrozenTurnInitiator, ay as GitHubInstallation, az as GitHubInstallationAccess, aA as GoalContinuationDecision, aB as HostExportConsumerStatus, aC as HostExportKind, aD as HostExportPayloadError, aE as HostMcpCredentialBindingError, aF as HostMcpCredentialResolverContext, aG as HostMcpCredentialScopeError, aH as HumanInputResponseValidationError, aI as IdempotentPersistenceTransactionOptions, aJ as ImportBatch, aK as InitializeSessionStartInput, aL as InitializeSessionStartResult, aM as IntegrationOAuthClientForUse, aN as LeaseHolderKind, aO as LeaseSnapshot, aP as ListKnowledgeMemoryOptions, aQ as ListSessionEventPageOptions, aR as ListSessionEventsOptions, aS as ListSessionsForSubjectOptions, aT as ListSessionsOptions, aU as LiveModalSandboxLeaseAttribution, aV as MACHINE_METRICS_SERIES_INTERVAL_MS, aW as MAX_INTERNAL_UPDATE_BATCH_BYTES, aX as MAX_INTERNAL_UPDATE_BATCH_MEMBERS, aY as MAX_INTERNAL_UPDATE_BYTES, aZ as MEMORY_ACTIVE_RECORD_CAP, a_ as MEMORY_BLOCK_KIND_ORDER, a$ as MEMORY_BLOCK_RECORD_LIMIT, b0 as MEMORY_CORRECT_TOOL_DESCRIPTION, b1 as MEMORY_KIND_SECTION_TITLES, b2 as MEMORY_NEAR_DUP_COSINE_THRESHOLD, b3 as MEMORY_NEAR_DUP_NEIGHBORS, b4 as MEMORY_SAVE_TOOL_DESCRIPTION, b5 as MEMORY_SEARCH_DEFAULT_LIMIT, b6 as MEMORY_SEARCH_MAX_LIMIT, b7 as MEMORY_SEARCH_TOOL_DESCRIPTION, b8 as MEMORY_TEXT_MAX_CHARS, b9 as MEMORY_VISIBLE_RECORD_CAP, ba as MachineMetricsRow, bb as MachineMetricsSample, bc as MarkWarmLeaseInstanceLostResult, bd as MemoryBlockRecord, be as MemoryEmbedder, bf as MemorySanitizeResult, bg as MeterableWarmLease, bh as PendingSessionToolCallInput, bi as PersistenceFailureDetails, bj as PersistenceRetryOutcome, ProvisionResult, ProvisionRolesOptions, bk as QueueCommandConflictCode, bl as QueueCommandConflictError, bm as QueueCommandResult, bn as QueuedTurnRow, bo as ReapDrainable, bp as ReconcileCodexCapacityWaitResult, bq as RecoverSessionDispatchInput, br as RecoverSessionDispatchResult, bs as RegisterWorkspacePackInput, bt as RegistryCapabilityCatalogItemInput, bu as RegistryCatalogSurfaceKey, bv as ReplaceIntegrationOAuthClientInput, bw as RequestSessionTurnRecoveryInput, bx as RequestSessionTurnRecoveryResult, by as ResolveConnectionCredentialInput, bz as ResolveConnectionCredentialResult, bA as RigActiveVersionChangedError, bB as RigChangeAlreadyVerifyingError, bC as RigChangeMonitoringSummary, bD as RigChangeTransitionError, bE as RigVersionContentInput, bF as RigVersionMonitoringSummary, bG as RlsContext, bH as RlsStrategy, bI as SESSION_ANCESTRY_LIMIT, bJ as SESSION_DISCOVERY_CONTROL_TARGET_LIMIT, bK as SESSION_DISCOVERY_CONTROL_TITLE_MAX_CHARS, bL as SESSION_DISCOVERY_GOAL_MAX_CHARS, bM as SESSION_DISCOVERY_MESSAGE_MAX_CHARS, bN as SESSION_EVENT_DB_PAGE_MAX_BYTES, bO as SafeDatabaseErrorFacts, bP as SandboxImageConflictError, bQ as SandboxKind, bR as SandboxLeaseLiveness, bS as SandboxLeaseSupersededError, bT as SandboxPtySessionRow, bU as SandboxRecord, bV as SandboxRigConflictError, bW as SanitizedDatabasePersistenceCause, bX as SaveWorkspaceMemoryInput, bY as SaveWorkspaceMemoryResult, bZ as SessionAttemptInterruptionSettlement, b_ as SessionCodexState, b$ as SessionCommandActor, c0 as SessionCommandIdempotencyError, c1 as SessionCommandReceiptRow, c2 as SessionContextBusyError, c3 as SessionControlConflictError, c4 as SessionControlInvariantError, c5 as SessionControlMutationResult, c6 as SessionDiscoveryControl, c7 as SessionDiscoveryCursor, c8 as SessionDiscoveryOrderBy, c9 as SessionDiscoverySummary, ca as SessionEventPage, cb as SessionEventPersistenceError, cc as SessionEventWriteLockInput, cd as SessionEventWriteLocks, ce as SessionIdConflictError, cf as SessionLineage, cg as SessionListAccessError, ch as SessionListCursor, ci as SessionListCursorError, cj as SessionMcpServerForRun, ck as SessionPinAccessError, cl as SessionPinVersionConflictError, cm as SessionRecordingCodec, cn as SessionRecordingMode, co as SessionRecordingRow, cp as SessionRecordingState, cq as SessionSystemUpdateOutboxDelivery, cr as SessionTurnAttemptOutcome, cs as SessionTurnForExecution, ct as SessionTurnRecordingSettlement, cu as SessionWorkPeek, cv as SessionWorkTrigger, cw as SessionWorkflowWake, cx as SetSessionCodexPinOptions, cy as SettleCodexCredentialFailoverResult, cz as SettleCodexCredentialLeaseLossResult, cA as SteerQueueCommandResult, cB as StoreIntegrationOAuthClientInput, cC as StoredIntegrationOAuthClient, cD as StreamAcknowledgment, cE as SubmitHumanPromptResult, cF as ToolspaceCallReservation, cG as TurnAttemptFenceRejectReason, cH as UpdateConnectionInput, cI as UpdateImportBatchCountsInput, cJ as UpdateKnowledgeMemoryInput, cK as UpdateScheduledTaskInput, cL as UpdateSessionMcpServerCredentialsInput, cM as UpdateSessionMcpServerCredentialsResult, cN as UserLookup, cO as VariableSetForRun, cP as WORKSPACE_MEMORY_BLOCK_EMPTY, cQ as WORKSPACE_MEMORY_BLOCK_HEADER_POPULATED, cR as WORKSPACE_MEMORY_BLOCK_TOKEN_BUDGET, cS as WorkspaceCaptureCommitResult, cT as WorkspaceCaptureGcPlan, cU as WorkspaceCaptureGcRow, cV as WorkspaceCaptureRow, cW as WorkspaceControlLockMode, cX as WorkspaceControlMutationResult, cY as WorkspaceControlRow, cZ as WorkspaceEnvironmentForRun, c_ as WorkspaceMemoryOrigin, c$ as WorkspaceMemorySearchInput, d0 as WorkspaceMemorySearchMode, d1 as WorkspaceMemorySearchResult, d2 as WorkspaceModelPolicy, d3 as abandonRecordingForTurnAttempt, d4 as acceptSessionApprovalDecision, d5 as acceptSessionHumanInputResponse, d6 as accrueWarmSeconds, d7 as acknowledgeHostExportBatch, d8 as acquireCodexCredentialLease, d9 as acquireLease, da as activateRigVersion, db as addSessionSystemUpdate, dc as addSessionSystemUpdateWithSourceMutation, dd as allAccountPermissions, de as allWorkspacePermissions, df as appendSessionEventToSandboxGroup, dg as appendSessionEvents, dh as appendSessionEventsAndUpdateSession, di as appendSessionEventsForTurnAttempt, dj as appendSessionEventsWithLockedSessionUpdate, dk as appendSessionHistoryItems, dl as applyContextCompaction, dm as applyCreditDebitUpToBalance, dn as applyCreditLedgerEntry, dp as applySessionTurnSettlement, dq as approveDeviceEnrollmentRequest, dr as areGitHubRepositoriesAllowedForWorkspace, ds as armCodexCapacityWait, dt as assertAgentCommandAuthorityInTransaction, du as autoResumeSessionBranchInTransaction, dv as beginRigChangeVerificationAttempt, dw as bindGitHubInstallationRepositories, dx as bootstrapWorkspace, dy as buildChildCompletionDigest, dz as buildCodexTokenResolver, dA as buildConnectionTokenResolver, dB as buildHostConnectionTokenResolver, dC as canonicalSessionCommandHash, dD as claimExpiredFileUploadCleanup, dE as claimFileUploadCleanup, dF as claimHostExportBatch, dG as claimPendingSessionSystemUpdateOutbox, dH as claimPendingSessionWorkflowWakes, dI as claimSessionWorkForAttempt, dJ as clearDurablePendingSessionToolCalls, dK as clearEnrollmentWentOffline, dL as clearSessionContext, dM as clearSessionGoal, dN as clearedContextMarkerItem, dO as closePtySession, dP as closeSessionTurnAttemptInTransaction, dQ as codexCapacityRefreshBackoffMs, dR as commitWarmingToWarm, dS as completeExpiredFileUploadCleanup, dT as completeFileUpload, dU as completeFileUploadCleanup, dV as computeWorkspaceCaptureGcPlan, dW as confirmDrainCold, dX as consumeDeviceEnrollmentRequest, dY as consumeIntegrationOAuthStateNonce, dZ as correctWorkspaceMemory, d_ as countActiveApiKeysForWorkspace, d$ as countActiveSessionHistoryItems, e0 as countActiveSessionsForWorkspace, e1 as countActiveSessionsUsingEnvironment, e2 as countActiveSessionsUsingVariableSet, e3 as countConsecutiveReactiveRotations, e4 as countQueuedTurns, e5 as countRigs, e6 as countSandboxLeasesByLiveness, e7 as countScheduledTasksForWorkspace, e8 as countScheduledTasksUsingEnvironment, e9 as countScheduledTasksUsingVariableSet, ea as countSessionHistoryItems, eb as countSessionsUsingRig, ec as countVariableSets, ed as countWorkspaceEnvironments, ee as countWorkspacesForAccount, ef as createApiKey, eg as createConnection, eh as createDb, ei as createDeviceEnrollmentRequest, ej as createEnrollment, ek as createFileUpload, el as createImportBatch, em as createKnowledgeMemory, en as createRig, eo as createRigChange, ep as createRigVersion, eq as createRigVersionForChangePromotion, er as createSandbox, es as createScheduledTask, et as createScheduledTaskRun, eu as createSession, ev as createSessionGoal, ew as createSessionMcpServers, ex as createSessionWithIdempotencyKey, ey as createSocialConnection, ez as createSocialPost, eA as createVariableSet, eB as createWorkspace, eC as createWorkspaceEnvironment, eD as databaseFailureCode, eE as deadLetterHostExportHead, eF as decodeSessionListCursor, eG as decryptEnvironmentValue, eG as decryptVariableSetValue, eH as decryptedCapabilityHeaders, eI as deleteGitHubInstallationBinding, eJ as deleteRecording, eK as deleteRig, eL as deleteRigIfNoActiveSessions, eM as deleteScheduledTask, eN as deleteSessionQueueItemInTransaction, eO as deleteVariableSet, eP as deleteVariableSetVariable, eQ as deleteWorkspace, eR as deleteWorkspaceCaptureRows, eS as deleteWorkspaceEnvironment, eT as deleteWorkspaceEnvironmentVariable, eU as deleteWorkspacePack, eV as denyDeviceEnrollmentRequest, eW as disableCapabilityInstallation, eX as disableHostExportConsumer, eY as disconnectAllCodexAccounts, eZ as disconnectCodexAccount, e_ as editQueuedTurnInTransaction, e$ as enableCapabilityInstallation, f0 as enablePackInstallation, f1 as encodeSessionListCursor, f2 as encryptEnvironmentValue, f2 as encryptVariableSetValue, f3 as enqueueSessionTurn, f4 as enqueueSessionWorkflowWake, f5 as enqueueSessionWorkflowWakeIfRunnable, f6 as enqueueSessionWorkflowWakeInTransaction, f7 as ensureCodexRotationSettings, f8 as ensureManagedAccessForUser, f9 as estimateMemoryTokens, fa as evaluateGoalContinuation, fb as evaluateSessionControl, fc as evaluateSessionControls, fd as evaluateSessionDiscoveryControls, fe as expireSessionHumanInputRequest, ff as failHostExportBatch, fg as failWarmingToCold, fh as fetchCodexUsageForAccount, fi as finalizeEnrollmentByToken, fj as findActiveApiKeyByHash, fk as forceDrainOverLimitViewerOnlyBoxes, fl as frozenInitiatorForCommandActor, fm as getActiveSessionHistoryItems, fn as getAnySessionInGroup, fo as getBillingBalance, fp as getBillingCustomer, fq as getCapabilityCatalogItem, fr as getCapabilityInstallation, fs as getCodexCapacityWaitForSession, ft as getCodexCredentialStatus, fu as getCodexRotationSettings, fv as getComposerDraftInTransaction, fw as getConnectionMetadata, fx as getDeviceEnrollmentRequestByDeviceCode, fy as getEnrollment, fz as getFile, fA as getFileUpload, fB as getHostExportConsumerStatus, fC as getHumanInputResumeForEvent, fD as getKnowledgeMemory, fE as getLatestRunState, fF as getLatestStartedSessionTurn, fG as getManagedAccount, fH as getManagedUserByEmail, fI as getMaterializedSandboxFileResources, fJ as getOpenPtySession, fK as getOrCreateSessionSystemUpdateOutbox, fL as getPackInstallation, fM as getPendingDeviceEnrollmentRequestByUserCode, fN as getPendingDeviceEnrollmentRequestByUserCodeGlobal, fO as getRecording, fP as getRig, fQ as getRigByName, fR as getRigChange, fS as getRigName, fT as getRigVersion, fU as getRigVersionById, fV as getSandbox, fW as getSandboxSessionEnvelope, fX as getScheduledTask, fY as getSession, fZ as getSessionByCreateIdempotencyKey, f_ as getSessionCodexState, f$ as getSessionEvent, g0 as getSessionEventByClientEventId, g1 as getSessionForSubject, g2 as getSessionGoal, g3 as getSessionHistoryItems, g4 as getSessionHumanInputRequest, g5 as getSessionLineage, g6 as getSessionQueueSnapshot, g7 as getSessionRootId, g8 as getSessionSystemUpdateOutboxByDedupeKey, g9 as getSessionTurn, ga as getSessionTurnForAttempt, gb as getSocialConnection, gc as getStoredCapabilityHeaderCiphertext, gd as getStreamAcknowledgment, ge as getVariableSet, gf as getVariableSetByName, gg as getVariableSetValuesForRun, gh as getWorkspace, gi as getWorkspaceControlEvent, gj as getWorkspaceDefaultRigId, gk as getWorkspaceEnvironment, gl as getWorkspaceEnvironmentByName, gm as getWorkspaceEnvironmentValuesForRun, gn as getWorkspaceGrant, go as getWorkspaceModelPolicy, gp as getWorkspacePack, gq as grantWorkspaceAccess, gr as hasCreditLedgerEntry, gs as hashMemoryText, gt as heartbeatCodexCredentialLease, gu as heartbeatCodexCredentialLeaseUntil, gv as heartbeatLeaseHolder, gw as ingestMachineMetricsSample, gx as initializeSessionStartAtomically, gy as insertFailedWorkspaceCapture, gz as insertMachineMetricsSeries, gA as insertPtySession, gB as insertRecording, gC as insertWorkspaceCapture, gD as interruptedToolCallResult, gE as isCodexBilledTurn, gF as isDatabasePersistenceFailure, gG as isMemoryTextTooLong, gH as isPrivateAddress, gI as isRetryablePersistenceSqlState, gJ as isSessionCompactionRequested, gK as isSessionEventPersistenceError, gL as isStripeWebhookProcessed, gM as latestWorkspaceCapture, gN as listApiKeys, gO as listCapabilityCatalogItems, gP as listCapabilityInstallations, gQ as listCodexAccountStatuses, gR as listConnectionsMetadata, gS as listCreditBalancesByAccount, gT as listDistinctRigVersionIdsInGroup, gU as listDistinctVariableSetIdsInGroup, gV as listEnabledMcpCapabilityServers, gW as listEnrollments, gX as listGitHubInstallationAccessForWorkspace, gY as listGitHubInstallationIdsForWorkspace, gZ as listGitHubInstallationsForWorkspace, g_ as listKnowledgeMemories, g$ as listLiveModalSandboxLeaseAttributions, h0 as listMeterableWarmLeases, h1 as listOpenPtySessions, h2 as listOutstandingSessionSystemUpdates, h3 as listPackInstallations, h4 as listPendingCodexCapacityWakeTargets, h5 as listPendingSessionTurns, h6 as listRecordings, h7 as listRegistryCatalogSurfaceKeys, h8 as listRigChangeMonitoringSummaries, h9 as listRigChanges, ha as listRigVersionMonitoringSummaries, hb as listRigVersions, hc as listRigs, hd as listSandboxes, he as listScheduledTaskRuns, hf as listScheduledTasks, hg as listSessionDiscoverySummaries, hh as listSessionEventPage, hi as listSessionEvents, hj as listSessionHumanInputRequests, hk as listSessionIdsInGroup, hl as listSessionMcpServerMetadata, hm as listSessionMcpServersForChildInheritance, hn as listSessionMcpServersForRun, ho as listSessionSystemUpdatesForTurn, hp as listSessionTurns, hq as listSessions, hr as listSessionsForSubject, hs as listSocialConnections, ht as listSocialPosts, hu as listUsageEvents, hv as listVariableSets, hw as listWorkspaceControlEvents, hx as listWorkspaceEnvironments, hy as listWorkspaceMembers, hz as listWorkspacePacks, hA as listWorkspacesForSubject, hB as loadCodexCredentialForRun, hC as loadConnectionCredentialForBroker, hD as loadIntegrationOAuthClient, hE as loadVariableSetForRun, hF as loadWorkspaceEnvironmentForRun, hG as lockSessionEventWriteRows, hH as lockWorkspaceInferenceControl, hI as markFileUploadFailed, hJ as markSandboxFileResourcesMaterialized, hK as markScheduledTaskRunFailedIfQueued, hL as markSessionAttemptQuiesced, hM as markSessionSystemUpdateOutboxDeliveredInTransaction, hN as markSessionSystemUpdateOutboxFailed, hO as markSessionWorkflowWakeDelivered, hP as markSessionWorkflowWakeFailed, hQ as markStaleRegistryCatalogItems, hR as markStripeWebhookProcessed, hS as markWarmLeaseInstanceLost, hT as mcpServerIdForCapability, hU as moveQueuedTurnInTransaction, hV as mutateSessionControlInTransaction, hW as mutateWorkspaceControlInTransaction, hX as nestedPostgresSqlState, hY as nextSessionHistoryPosition, hZ as normalizeBearerScheme, h_ as normalizeMemoryText, h$ as orphanedResultRowIndicesForRepair, i0 as peekSessionWork, i1 as persistDrainSnapshot, i2 as persistWarmSnapshot, i3 as planWorkspaceCaptureGc, i4 as projectEffectiveControlForRelatedAccess, i5 as projectSessionForRelatedAccess, provisionRoles, i6 as pruneHostExportOutbox, i7 as quarantineCodexCredentialForLease, i8 as reArmDrainingLease, i9 as readActiveSandbox, ia as readLease, ib as readMachineMetricsLatest, ic as readMachineMetricsLatestForWorkspace, id as readMachineMetricsSeries, ie as reapExpiredSessionListSnapshots, ig as reapStaleLeaseHolders, ih as reapStaleLeaseHoldersGlobal, ii as reconcileCodexCapacityWait, ij as recordAuditEvent, ik as recordCodexAccountConnectors, il as recordCodexAccountUsage, im as recordCodexAccountUsageWithWakeTargets, io as recordCodexTokenRefresh, ip as recordConnectionTokenRefresh, iq as recordConnectionUsed, ir as recordLeaseDataPlaneUrl, is as recordLeaseTerminalDataPlaneUrl, it as recordPendingSessionToolCallResult, iu as recordSessionActiveCodexCredential, iv as recordSkippedContextCompaction, iw as recordStreamAcknowledgment, ix as recordStripeWebhookEvent, iy as recordUsageEvent, iz as recordWarmingSandboxCreated, iA as recoverSessionDispatch, iB as refreshOAuthConnectionCredential, iC as registerDbBinding, iD as registerHostExportConsumer, iE as registerInternalUpdateWakeInTransaction, iF as registerPendingSessionToolCall, iG as registerSessionTurnAttemptClaim, iH as registerSessionWorkflowWakeInTransaction, iI as registerWorkspacePack, iJ as releaseCodexCredentialLease, iK as releaseLeaseHolder, iL as removeWorkspaceMember, iM as renameCodexAccount, iN as renderWorkspaceMemoryBlock, iO as replaceIntegrationOAuthClient, iP as requestSessionCompaction, iQ as requestSessionTurnRecovery, iR as requireFile, iS as requireScheduledTask, iT as requireSession, iU as requireSocialConnection, iV as requireWorkspace, iW as reserveSessionCommandReceipt, iX as reserveToolspaceCallForTurn, iY as resolveWorkspaceMemoryBlock, iZ as resumeHostExportConsumer, i_ as retireHostExportConsumer, i$ as revokeApiKey, j0 as revokeConnection, j1 as revokeEnrollment, j2 as revokeViewer, j3 as rewindHostExportConsumer, j4 as rlsContextForWorkspace, j5 as rlsStrategyFor, j6 as runIdempotentPersistenceTransaction, j7 as safeDatabaseErrorFacts, j8 as sanitizeEventPayload, j9 as sanitizeEventString, ja as sanitizeMemoryText, jb as sanitizeModelPayload, jc as saveComposerDraftInTransaction, jd as saveRunState, je as saveWorkspaceMemory, jf as searchWorkspaceMemories, jg as sendAgentMessageInTransaction, jh as serializeEffectiveSessionControl, ji as sessionAuthorizationScopeFilter, jj as sessionSubject, jk as sessionTreeStatsForSessions, jl as sessionsWithActiveOpOnEnrollment, jm as setActiveCodexCredential, jn as setActiveSandbox, jo as setCodexCredentialExhausted, jp as setCodexCredentialExhaustedWithWakeTargets, jq as setCodexCredentialStatus, jr as setCodexCredentialStatusById, js as setConnectionStatus, jt as setEnrollmentDisplayState, ju as setEnrollmentOpStreamState, jv as setEnrollmentWentOffline, jw as setInitialActiveCodexCredential, jx as setRlsContext, jy as setSessionCodexPin, jz as setSessionGoalLastContinuationTurn, jA as setSessionGoalStatus, jB as setSessionLastInputTokensForTurnAttempt, jC as setSessionPin, jD as setTemporalWorkflowId, jE as setVariableSetVariable, jF as setWorkspaceDefaultRig, jG as setWorkspaceEnvironmentVariable, jH as settleCodexCredentialFailover, jI as settleCodexCredentialLeaseLoss, jJ as settleScheduledTaskRunInTransaction, jK as settleSessionAttemptInterruptions, jL as settleSessionIdleWithParentOutbox, jM as shortMemoryId, jN as steerAgentSessionInTransaction, jO as steerQueuedTurnInTransaction, jP as storeIntegrationOAuthClient, jQ as submitHumanPromptInTransaction, jR as sumUsageQuantity, jS as supersedeSessionCurrentDirectionInTransaction, jT as touchEnrollmentLastSeen, jU as touchLeaseHolder, jV as updateCodexRotationSettings, jW as updateConnection, jX as updateImportBatchCounts, jY as updateKnowledgeMemory, jZ as updatePackInstallationStatus, j_ as updatePtySessionActivity, j$ as updateRecording, k0 as updateRig, k1 as updateRigChangeStatus, k2 as updateScheduledTask, k3 as updateScheduledTaskRun, k4 as updateSessionCommandReceiptResult, k5 as updateSessionGoal, k6 as updateSessionMcpServerCredentials, k7 as updateSessionTitle, k8 as updateVariableSet, k9 as updateWorkspace, ka as updateWorkspaceEnvironment, kb as updateWorkspaceSettings, kc as upsertBillingCustomer, kd as upsertCapabilityCatalogItem, ke as upsertCodexSubscriptionCredential, kf as upsertGitHubInstallation, kg as upsertMachineMetricsLatest, kh as upsertRegistryCapabilityCatalogItem, ki as upsertSandboxSessionEnvelope, kj as upsertSessionGoal, kk as upsertWorkspaceModelPolicy, kl as validateHumanInputResponse, km as withAccountRls, kn as withCodexCapacityMutation, ko as withCodexCredentialRefreshLock, kp as withRlsContext, kq as withWorkspaceRls, kr as withWorkspaceSubjectRls, ks as withWorkspaceUsageLock, kt as workspaceCaptureAtRevision, ku as workspaceCodexSubscriptionActive } from './provision-roles.js';
5
+ export { A as AGENT_VISIBLE_MEMORY_STATUSES, a as AcceptSessionApprovalDecisionResult, b as AcceptSessionHumanInputResponseResult, c as AccrueWarmSecondsResult, d as AcquireLeaseInput, e as AcquireLeaseResult, f as ActiveSandboxPointer, g as AddSessionSystemUpdateInput, h as AddSessionSystemUpdateResult, i as AdoptCodexResetRedemptionResult, j as AgentCommandAuthorityError, k as AgentInternalUpdateCommandResult, l as AppendEventInput, m as ApplyContextCompactionResult, n as ApplySessionTurnSettlementInput, o as ApplySessionTurnSettlementResult, p as ArmCodexCapacityWaitResult, B as BeginSandboxRematerializationResult, q as BootstrapWorkspaceInput, C as CODEX_CAPACITY_REFRESH_MAX_MS, r as CODEX_CAPACITY_REFRESH_MIN_MS, s as CODEX_CREDENTIAL_LEASE_TTL_MS, t as CODEX_RESET_REDEMPTION_OUTCOMES, u as CODEX_ROTATION_STRATEGIES, v as ClaimCodexResetRedemptionResult, w as ClaimSessionWorkForAttemptInput, x as ClaimSessionWorkForAttemptResult, y as ClearSessionContextResult, z as CodexAccountStatus, D as CodexAccountUsageSnapshot, E as CodexAllocatorUpdateResult, F as CodexAuthDeps, G as CodexCapacityAvailabilityDecision, H as CodexCapacityMutationResult, I as CodexCapacityResetKind, J as CodexCapacitySelectionContext, K as CodexCapacityWait, L as CodexCapacityWaitStatus, M as CodexCapacityWakeTarget, N as CodexCredentialForRun, O as CodexCredentialLeaseCandidateFilter, P as CodexCredentialLeaseCandidateFilterResult, Q as CodexCredentialLeasePolicyScopeResolver, R as CodexCredentialLeaseQuarantine, S as CodexCredentialLeaseResult, T as CodexCredentialLeaseSelection, U as CodexCredentialLeaseSelectionContext, V as CodexCredentialStatus, W as CodexCredentialTokens, X as CodexLeaseAccountStatus, Y as CodexPinSource, Z as CodexRateLimitResetCreditsAccountResult, _ as CodexResetRedemptionAttempt, $ as CodexResetRedemptionOutcome, a0 as CodexResetRedemptionRecovery, a1 as CodexResetRedemptionSendNotReadyReason, a2 as CodexResetRedemptionStatus, a3 as CodexRotationSettings, a4 as CodexRotationStrategy, a5 as CodexTokenDeadlineClock, a6 as CodexTokenDeadlineOptions, a7 as ComposerDraftRow, a8 as ConnectionBrokerDeps, a9 as ConnectionCredentialForBroker, aa as ConnectionRefreshHttpError, ab as ConsumeOAuthStateNonceInput, ac as CorrectWorkspaceMemoryInput, ad as CorrectWorkspaceMemoryResult, ae as CreateCapabilityCatalogItemInput, af as CreateConnectionInput, ag as CreateDbOptions, ah as CreateImportBatchInput, ai as CreateKnowledgeMemoryInput, aj as CreatePackInstallationInput, ak as CreateScheduledTaskInput, al as CreateSessionGoalInput, am as CreateSessionMcpServerInput, an as CreateSocialConnectionInput, ao as CreateSocialPostInput, ap as CreditBalanceByAccount, aq as Database, ar as DatabaseFailureCode, as as DbClient, at as DbSession, au as DeviceEnrollmentRequestRecord, av as DeviceEnrollmentStatus, aw as EditQueueCommandResult, ax as EffectiveControlBlocker, ay as EffectiveControlResumeOption, az as EffectiveControlState, aA as EffectiveSessionControl, aB as EnableCapabilityInstallationInput, aC as EnabledMcpCapabilityServer, aD as EnqueueSessionTurnInput, aE as EnrollmentExposure, aF as EnrollmentOs, aG as EnrollmentRecord, aH as EnrollmentStatus, aI as ExpiredFileUploadCleanupClaim, aJ as FenceCodexResetRedemptionSendResult, aK as FileUploadCleanupClaimResult, aL as ForceDrainResult, aM as FrozenTurnInitiator, aN as GitHubInstallation, aO as GitHubInstallationAccess, aP as GoalContinuationDecision, aQ as HostExportConsumerStatus, aR as HostExportKind, aS as HostExportPayloadError, aT as HostMcpCredentialBindingError, aU as HostMcpCredentialResolverContext, aV as HostMcpCredentialScopeError, aW as HumanInputResponseValidationError, aX as IdempotentPersistenceTransactionOptions, aY as ImportBatch, aZ as InitializeSessionStartInput, a_ as InitializeSessionStartResult, a$ as InstallOrReadTurnExecutionPolicyForAttemptResult, b0 as IntegrationOAuthClientForUse, b1 as LeaseHolderKind, b2 as LeaseSnapshot, b3 as ListKnowledgeMemoryOptions, b4 as ListSessionEventPageOptions, b5 as ListSessionEventsOptions, b6 as ListSessionsForSubjectOptions, b7 as ListSessionsOptions, b8 as LiveModalSandboxLeaseAttribution, b9 as MACHINE_METRICS_SERIES_INTERVAL_MS, ba as MAX_INTERNAL_UPDATE_BATCH_BYTES, bb as MAX_INTERNAL_UPDATE_BATCH_MEMBERS, bc as MAX_INTERNAL_UPDATE_BYTES, bd as MEMORY_ACTIVE_RECORD_CAP, be as MEMORY_BLOCK_KIND_ORDER, bf as MEMORY_BLOCK_RECORD_LIMIT, bg as MEMORY_CORRECT_TOOL_DESCRIPTION, bh as MEMORY_KIND_SECTION_TITLES, bi as MEMORY_NEAR_DUP_COSINE_THRESHOLD, bj as MEMORY_NEAR_DUP_NEIGHBORS, bk as MEMORY_SAVE_TOOL_DESCRIPTION, bl as MEMORY_SEARCH_DEFAULT_LIMIT, bm as MEMORY_SEARCH_MAX_LIMIT, bn as MEMORY_SEARCH_TOOL_DESCRIPTION, bo as MEMORY_TEXT_MAX_CHARS, bp as MEMORY_VISIBLE_RECORD_CAP, bq as MachineMetricsRow, br as MachineMetricsSample, bs as MarkWarmLeaseInstanceLostResult, bt as MaterializeGoalContinuationResult, bu as MemoryBlockRecord, bv as MemoryEmbedder, bw as MemorySanitizeResult, bx as MeterableWarmLease, by as NestedAgentDepthDeploymentPolicy, bz as NestedAgentDepthPolicySource, bA as NewSessionDraftAccessError, bB as NewSessionDraftConflictError, bC as NewSessionDraftRow, bD as PendingSessionToolCallInput, bE as PersistenceFailureDetails, bF as PersistenceRetryOutcome, ProvisionResult, ProvisionRolesOptions, bG as QueueCommandConflictCode, bH as QueueCommandConflictError, bI as QueueCommandResult, bJ as QueuedTurnRow, bK as ReapDrainable, bL as ReconcileCodexCapacityWaitResult, bM as RecoverSessionDispatchInput, bN as RecoverSessionDispatchResult, bO as RefreshTransportOptions, bP as RegisterWorkspacePackInput, bQ as RegistryCapabilityCatalogItemInput, bR as RegistryCatalogSurfaceKey, bS as ReplaceIntegrationOAuthClientInput, bT as RequestSessionTurnRecoveryInput, bU as RequestSessionTurnRecoveryResult, bV as ResolveConnectionCredentialInput, bW as ResolveConnectionCredentialResult, bX as RetainedFileArtifact, bY as RigActiveVersionChangedError, bZ as RigChangeAlreadyVerifyingError, b_ as RigChangeMonitoringSummary, b$ as RigChangeTransitionError, c0 as RigVersionContentInput, c1 as RigVersionMonitoringSummary, c2 as RlsContext, c3 as RlsStrategy, c4 as SESSION_ANCESTRY_LIMIT, c5 as SESSION_DISCOVERY_CONTROL_TARGET_LIMIT, c6 as SESSION_DISCOVERY_CONTROL_TITLE_MAX_CHARS, c7 as SESSION_DISCOVERY_GOAL_MAX_CHARS, c8 as SESSION_DISCOVERY_MESSAGE_MAX_CHARS, c9 as SESSION_EVENT_DB_PAGE_MAX_BYTES, ca as SESSION_LIST_SNAPSHOT_MAX_ACTIVE_PER_SUBJECT, cb as SESSION_LIST_SNAPSHOT_MAX_IDS, cc as SafeDatabaseErrorFacts, cd as SandboxArchiveAvailability, ce as SandboxArchiveRevision, cf as SandboxImageConflictError, cg as SandboxKind, ch as SandboxLeaseLiveness, ci as SandboxLeaseRecoveryBlockedError, cj as SandboxLeaseSupersededError, ck as SandboxOpenPtySessionRow, cl as SandboxProviderExistence, cm as SandboxPtyProcessIdentity, cn as SandboxPtySessionRow, co as SandboxRecord, cp as SandboxRecoveryState, cq as SandboxRestoreStatus, cr as SandboxRetainedProcess, cs as SandboxRetainedProcessState, ct as SandboxRigConflictError, cu as SandboxWorkspaceMutationAdmission, cv as SandboxWorkspaceMutationFencedError, cw as SandboxWorkspaceMutationProviderOutcome, cx as SandboxWorkspaceReadiness, cy as SanitizedDatabasePersistenceCause, cz as SaveWorkspaceMemoryInput, cA as SaveWorkspaceMemoryResult, cB as SessionAttemptInterruptionSettlement, cC as SessionCodexState, cD as SessionCommandActor, cE as SessionCommandIdempotencyError, cF as SessionCommandReceiptRow, cG as SessionContextBusyError, cH as SessionControlConflictError, cI as SessionControlInvariantError, cJ as SessionControlMutationResult, cK as SessionCreateDeniedResult, cL as SessionCreateInput, cM as SessionCreateResult, cN as SessionCreateSuccessResult, cO as SessionDepthPolicy, cP as SessionDiscoveryControl, cQ as SessionDiscoveryCursor, cR as SessionDiscoveryOrderBy, cS as SessionDiscoverySummary, cT as SessionEventPage, cU as SessionEventPersistenceError, cV as SessionEventWriteLockInput, cW as SessionEventWriteLocks, cX as SessionGoalContinuationProjection, cY as SessionIdConflictError, cZ as SessionLineage, c_ as SessionListAccessError, c$ as SessionListCursor, d0 as SessionListCursorError, d1 as SessionListCursorExpiredError, d2 as SessionListSnapshotLimitError, d3 as SessionMcpServerForRun, d4 as SessionPinAccessError, d5 as SessionPinVersionConflictError, d6 as SessionRecordingCodec, d7 as SessionRecordingMode, d8 as SessionRecordingRow, d9 as SessionRecordingState, da as SessionSpawnDenial, db as SessionSpawnDenialCode, dc as SessionSpawnDeniedDbError, dd as SessionSystemUpdateOutboxDelivery, de as SessionTurnAttemptOutcome, df as SessionTurnForExecution, dg as SessionTurnRecordingSettlement, dh as SessionWorkPeek, di as SessionWorkTrigger, dj as SessionWorkflowWake, dk as SessionWorkflowWakeDeliveryResult, dl as SetSessionCodexPinOptions, dm as SetSessionGoalStatusEvent, dn as SettleCodexCredentialFailoverResult, dp as SettleCodexCredentialLeaseLossResult, dq as SteerQueueCommandResult, dr as StoreIntegrationOAuthClientInput, ds as StoredIntegrationOAuthClient, dt as StreamAcknowledgment, du as SubmitHumanPromptResult, dv as ToolspaceCallReservation, dw as ToolspaceTurnAttemptClaims, dx as TurnAttemptFenceRejectReason, dy as UpdateConnectionInput, dz as UpdateImportBatchCountsInput, dA as UpdateKnowledgeMemoryInput, dB as UpdateScheduledTaskInput, dC as UpdateSessionMcpApprovalPolicyResult, dD as UpdateSessionMcpServerCredentialsInput, dE as UpdateSessionMcpServerCredentialsResult, dF as UpsertCodexSubscriptionCredentialResult, dG as UserLookup, dH as VariableSetForRun, dI as WORKSPACE_MEMORY_BLOCK_EMPTY, dJ as WORKSPACE_MEMORY_BLOCK_HEADER_POPULATED, dK as WORKSPACE_MEMORY_BLOCK_TOKEN_BUDGET, dL as WorkspaceCaptureCommitResult, dM as WorkspaceCaptureGcPlan, dN as WorkspaceCaptureGcRow, dO as WorkspaceCaptureRow, dP as WorkspaceControlLockMode, dQ as WorkspaceControlMutationResult, dR as WorkspaceControlRow, dS as WorkspaceEnvironmentForRun, dT as WorkspaceMemoryOrigin, dU as WorkspaceMemorySearchInput, dV as WorkspaceMemorySearchMode, dW as WorkspaceMemorySearchResult, dX as WorkspaceModelPolicy, dY as abandonCodexResetRedemptionBeforeProvider, dZ as abandonRecordingForTurnAttempt, d_ as acceptSessionApprovalDecision, d$ as acceptSessionHumanInputResponse, e0 as accrueWarmSeconds, e1 as acknowledgeHostExportBatch, e2 as acquireCodexCredentialLease, e3 as acquireLease, e4 as activateRigVersion, e5 as addSessionSystemUpdate, e6 as addSessionSystemUpdateWithSourceMutation, e7 as admitToolspaceTurnAttempt, e8 as adoptCodexResetRedemptionAttempt, e9 as advanceWorkspaceGeneration, ea as advanceWorkspaceGenerationForDirectRequest, eb as advanceWorkspaceGenerationForRetainedProcess, ec as allAccountPermissions, ed as allWorkspacePermissions, ee as appendSessionEventToSandboxGroup, ef as appendSessionEvents, eg as appendSessionEventsAndUpdateSession, eh as appendSessionEventsForTurnAttempt, ei as appendSessionEventsWithLockedSessionUpdate, ej as appendSessionHistoryItems, ek as applyContextCompaction, el as applyCreditDebitUpToBalance, em as applyCreditLedgerEntry, en as applySessionTurnSettlement, eo as approveDeviceEnrollmentRequest, ep as areGitHubRepositoriesAllowedForWorkspace, eq as armCodexCapacityWait, er as assertAgentCommandAuthorityInTransaction, es as autoResumeSessionBranchInTransaction, et as beginRigChangeVerificationAttempt, eu as beginSandboxRematerialization, ev as bindGitHubInstallationRepositories, ew as bootstrapWorkspace, ex as buildChildCompletionDigest, ey as buildCodexTokenResolver, ez as buildConnectionTokenResolver, eA as buildHostConnectionTokenResolver, eB as canonicalSessionCommandHash, eC as claimCodexResetRedemption, eD as claimExpiredFileUploadCleanup, eE as claimFileUploadCleanup, eF as claimHostExportBatch, eG as claimPendingSessionSystemUpdateOutbox, eH as claimPendingSessionWorkflowWakes, eI as claimSessionWorkForAttempt, eJ as clearDurablePendingSessionToolCalls, eK as clearEnrollmentWentOffline, eL as clearPendingSessionToolspaceCall, eM as clearSessionContext, eN as clearSessionGoal, eO as clearedContextMarkerItem, eP as closePtySession, eQ as closeSessionTurnAttemptInTransaction, eR as codexCapacityRefreshBackoffMs, eS as commitWarmingToWarm, eT as completeCodexResetRedemption, eU as completeExpiredFileUploadCleanup, eV as completeFileUpload, eW as completeFileUploadCleanup, eX as computeWorkspaceCaptureGcPlan, eY as confirmDrainCold, eZ as consumeDeviceEnrollmentRequest, e_ as consumeIntegrationOAuthStateNonce, e$ as consumeNewSessionDraftInTransaction, f0 as correctWorkspaceMemory, f1 as countActiveApiKeysForWorkspace, f2 as countActiveSessionHistoryItems, f3 as countActiveSessionsForWorkspace, f4 as countActiveSessionsUsingEnvironment, f5 as countActiveSessionsUsingVariableSet, f6 as countConsecutiveReactiveRotations, f7 as countQueuedTurns, f8 as countRigs, f9 as countSandboxLeasesByLiveness, fa as countScheduledTasksForWorkspace, fb as countScheduledTasksUsingEnvironment, fc as countScheduledTasksUsingVariableSet, fd as countSessionHistoryItems, fe as countSessionsUsingRig, ff as countVariableSets, fg as countWorkspaceEnvironments, fh as countWorkspacesForAccount, fi as createApiKey, fj as createConnection, fk as createDb, fl as createDeviceEnrollmentRequest, fm as createEnrollment, fn as createFileUpload, fo as createImportBatch, fp as createKnowledgeMemory, fq as createRig, fr as createRigChange, fs as createRigVersion, ft as createRigVersionForChangePromotion, fu as createSandbox, fv as createScheduledTask, fw as createScheduledTaskRun, fx as createSession, fy as createSessionGoal, fz as createSessionMcpServers, fA as createSessionWithIdempotencyKey, fB as createSessionWithIdempotencyKeyResult, fC as createSocialConnection, fD as createSocialPost, fE as createVariableSet, fF as createWorkspace, fG as createWorkspaceEnvironment, fH as databaseFailureCode, fI as deadLetterHostExportHead, fJ as decodeSessionListCursor, fK as decryptEnvironmentValue, fK as decryptVariableSetValue, fL as decryptedCapabilityHeaders, fM as deleteGitHubInstallationBinding, fN as deleteRecording, fO as deleteRig, fP as deleteRigIfNoActiveSessions, fQ as deleteScheduledTask, fR as deleteSessionQueueItemInTransaction, fS as deleteVariableSet, fT as deleteVariableSetVariable, fU as deleteWorkspace, fV as deleteWorkspaceCaptureRows, fW as deleteWorkspaceEnvironment, fX as deleteWorkspaceEnvironmentVariable, fY as deleteWorkspacePack, fZ as denyDeviceEnrollmentRequest, f_ as disableCapabilityInstallation, f$ as disableHostExportConsumer, g0 as disconnectAllCodexAccounts, g1 as disconnectCodexAccount, g2 as editQueuedTurnInTransaction, g3 as enableCapabilityInstallation, g4 as enablePackInstallation, g5 as encodeSessionListCursor, g6 as encryptEnvironmentValue, g6 as encryptVariableSetValue, g7 as enqueueSessionTurn, g8 as enqueueSessionWorkflowWake, g9 as enqueueSessionWorkflowWakeIfRunnable, ga as enqueueSessionWorkflowWakeInTransaction, gb as ensureCodexRotationSettings, gc as ensureManagedAccessForUser, gd as estimateMemoryTokens, ge as evaluateGoalContinuation, gf as evaluateSessionControl, gg as evaluateSessionControls, gh as evaluateSessionDiscoveryControls, gi as expireSessionHumanInputRequest, gj as failHostExportBatch, gk as failSandboxRematerialization, gl as failWarmingToCold, gm as fenceCodexResetRedemptionSend, gn as fetchCodexRateLimitResetCreditsForAccount, go as fetchCodexUsageForAccount, gp as finalizeEnrollmentByToken, gq as findActiveApiKeyByHash, gr as forceDrainOverLimitViewerOnlyBoxes, gs as frozenInitiatorForCommandActor, gt as getActiveSessionHistoryItems, gu as getActiveSessionTurnForExecution, gv as getAnySessionInGroup, gw as getBillingBalance, gx as getBillingCustomer, gy as getCapabilityCatalogItem, gz as getCapabilityInstallation, gA as getCodexCapacityWaitForSession, gB as getCodexCredentialStatus, gC as getCodexResetRedemptionAttempt, gD as getCodexRotationSettings, gE as getComposerDraftInTransaction, gF as getConnectionMetadata, gG as getDeviceEnrollmentRequestByDeviceCode, gH as getEnrollment, gI as getFile, gJ as getFileUpload, gK as getHostExportConsumerStatus, gL as getHumanInputResumeForEvent, gM as getKnowledgeMemory, gN as getLatestRunState, gO as getLatestStartedSessionTurn, gP as getManagedAccount, gQ as getManagedUserByEmail, gR as getMaterializedSandboxFileResources, gS as getNestedAgentDepthDeploymentPolicy, gT as getNewSessionDraftInTransaction, gU as getOpenPtySession, gV as getOrCreateSessionSystemUpdateOutbox, gW as getPackInstallation, gX as getPendingDeviceEnrollmentRequestByUserCode, gY as getPendingDeviceEnrollmentRequestByUserCodeGlobal, gZ as getRecording, g_ as getRetainedFileArtifact, g$ as getRetainedProcess, h0 as getRig, h1 as getRigByName, h2 as getRigChange, h3 as getRigName, h4 as getRigVersion, h5 as getRigVersionById, h6 as getSandbox, h7 as getSandboxSessionEnvelope, h8 as getScheduledTask, h9 as getSession, ha as getSessionByCreateIdempotencyKey, hb as getSessionCodexState, hc as getSessionEvent, hd as getSessionEventByClientEventId, he as getSessionForSubject, hf as getSessionGoal, hg as getSessionGoalWithContinuation, hh as getSessionHistoryItems, hi as getSessionHumanInputRequest, hj as getSessionLineage, hk as getSessionQueueSnapshot, hl as getSessionRootId, hm as getSessionSpawnDenial, hn as getSessionSpawnDenialByIdempotencyKey, ho as getSessionSystemUpdateOutboxByDedupeKey, hp as getSessionTurn, hq as getSessionTurnForAttempt, hr as getSocialConnection, hs as getStoredCapabilityHeaderCiphertext, ht as getStreamAcknowledgment, hu as getVariableSet, hv as getVariableSetByName, hw as getVariableSetValuesForRun, hx as getWorkspace, hy as getWorkspaceControlEvent, hz as getWorkspaceDefaultRigId, hA as getWorkspaceEnvironment, hB as getWorkspaceEnvironmentByName, hC as getWorkspaceEnvironmentValuesForRun, hD as getWorkspaceGrant, hE as getWorkspaceModelPolicy, hF as getWorkspacePack, hG as grantWorkspaceAccess, hH as hasCreditLedgerEntry, hI as hashMemoryText, hJ as heartbeatCodexCredentialLease, hK as heartbeatCodexCredentialLeaseUntil, hL as heartbeatLeaseHolder, hM as ingestMachineMetricsSample, hN as initializeSessionStartAtomically, hO as insertFailedWorkspaceCapture, hP as insertMachineMetricsSeries, hQ as insertPtySession, hR as insertRecording, hS as insertWorkspaceCapture, hT as installOrReadTurnExecutionPolicyForAttempt, hU as interruptedToolCallResult, hV as isCodexBilledTurn, hW as isDatabasePersistenceFailure, hX as isMemoryTextTooLong, hY as isRetryablePersistenceSqlState, hZ as isSessionCompactionRequested, h_ as isSessionEventPersistenceError, h$ as isStripeWebhookProcessed, i0 as latestWorkspaceCapture, i1 as listApiKeys, i2 as listCapabilityCatalogItems, i3 as listCapabilityInstallations, i4 as listCodexAccountStatuses, i5 as listCodexResetRedemptionRecoveries, i6 as listConnectionsMetadata, i7 as listCreditBalancesByAccount, i8 as listDistinctRigVersionIdsInGroup, i9 as listDistinctVariableSetIdsInGroup, ia as listEnabledMcpCapabilityServers, ib as listEnrollments, ic as listGitHubInstallationAccessForWorkspace, id as listGitHubInstallationIdsForWorkspace, ie as listGitHubInstallationsForWorkspace, ig as listKnowledgeMemories, ih as listLiveModalSandboxLeaseAttributions, ii as listMeterableWarmLeases, ij as listOpenPtySessions, ik as listOutstandingSessionSystemUpdates, il as listPackInstallations, im as listPendingCodexCapacityWakeTargets, io as listPendingSessionTurns, ip as listRecordings, iq as listRegistryCatalogSurfaceKeys, ir as listRigChangeMonitoringSummaries, is as listRigChanges, it as listRigVersionMonitoringSummaries, iu as listRigVersions, iv as listRigs, iw as listSandboxes, ix as listScheduledTaskRuns, iy as listScheduledTasks, iz as listSessionDiscoverySummaries, iA as listSessionEventPage, iB as listSessionEvents, iC as listSessionHumanInputRequests, iD as listSessionIdsInGroup, iE as listSessionMcpServerMetadata, iF as listSessionMcpServersForChildInheritance, iG as listSessionMcpServersForRun, iH as listSessionSpawnDenials, iI as listSessionSystemUpdatesForTurn, iJ as listSessionTurns, iK as listSessions, iL as listSessionsForSubject, iM as listSocialConnections, iN as listSocialPosts, iO as listUsageEvents, iP as listVariableSets, iQ as listWorkspaceControlEvents, iR as listWorkspaceEnvironments, iS as listWorkspaceMembers, iT as listWorkspacePacks, iU as listWorkspacesForSubject, iV as loadCodexCredentialForRun, iW as loadConnectionCredentialForBroker, iX as loadIntegrationOAuthClient, iY as loadVariableSetForRun, iZ as loadWorkspaceEnvironmentForRun, i_ as lockSessionEventWriteRows, i$ as lockWorkspaceInferenceControl, j0 as markFileUploadFailed, j1 as markSandboxFileResourcesMaterialized, j2 as markSandboxProviderReady, j3 as markSandboxRestoreVerifying, j4 as markScheduledTaskRunFailedIfQueued, j5 as markSessionAttemptQuiesced, j6 as markSessionSystemUpdateOutboxDeliveredInTransaction, j7 as markSessionSystemUpdateOutboxFailed, j8 as markSessionWorkflowWakeDelivered, j9 as markSessionWorkflowWakeFailed, ja as markStaleRegistryCatalogItems, jb as markStripeWebhookProcessed, jc as markWarmLeaseInstanceLost, jd as materializeGoalContinuation, je as mcpServerIdForCapability, jf as moveQueuedTurnInTransaction, jg as mutateSessionControlInTransaction, jh as mutateWorkspaceControlInTransaction, ji as nestedPostgresSqlState, jj as nextSessionHistoryPosition, jk as normalizeBearerScheme, jl as normalizeMemoryText, jm as orphanedResultRowIndicesForRepair, jn as peekSessionWork, jo as persistDrainSnapshot, jp as persistWarmSnapshot, jq as planWorkspaceCaptureGc, jr as projectEffectiveControlForRelatedAccess, js as projectSessionForRelatedAccess, provisionRoles, jt as pruneHostExportOutbox, ju as quarantineCodexCredentialForLease, jv as reArmDrainingLease, jw as readActiveSandbox, jx as readLease, jy as readMachineMetricsLatest, jz as readMachineMetricsLatestForWorkspace, jA as readMachineMetricsSeries, jB as readWorkspaceArchiveCapturePreflight, jC as reapExpiredSessionListSnapshots, jD as reapStaleLeaseHolders, jE as reapStaleLeaseHoldersGlobal, jF as reconcileCodexCapacityWait, jG as recordAuditEvent, jH as recordCodexAccountConnectors, jI as recordCodexAccountUsage, jJ as recordCodexAccountUsageWithWakeTargets, jK as recordCodexTokenRefresh, jL as recordConnectionTokenRefresh, jM as recordConnectionUsed, jN as recordLeaseDataPlaneUrl, jO as recordLeaseTerminalDataPlaneUrl, jP as recordPendingSessionToolCallResult, jQ as recordSessionActiveCodexCredential, jR as recordSkippedContextCompaction, jS as recordStreamAcknowledgment, jT as recordStripeWebhookEvent, jU as recordUsageEvent, jV as recordWarmingSandboxCreated, jW as recoverSessionDispatch, jX as refreshOAuthConnectionCredential, jY as registerDbBinding, jZ as registerHostExportConsumer, j_ as registerInternalUpdateWakeInTransaction, j$ as registerPendingSessionToolCall, k0 as registerSessionTurnAttemptClaim, k1 as registerSessionWorkflowWakeInTransaction, k2 as registerWorkspacePack, k3 as releaseCodexCredentialLease, k4 as releaseCodexResetRedemptionClaim, k5 as releaseLeaseHolder, k6 as removeWorkspaceMember, k7 as renameCodexAccount, k8 as renderWorkspaceMemoryBlock, k9 as replaceIntegrationOAuthClient, ka as requestSessionCompaction, kb as requestSessionTurnRecovery, kc as requireFile, kd as requireScheduledTask, ke as requireSession, kf as requireSocialConnection, kg as requireWorkspace, kh as reserveSessionCommandReceipt, ki as reserveToolspaceCallForAttempt, kj as resolveWorkspaceMemoryBlock, kk as resumeHostExportConsumer, kl as retainWorkspaceMutationProcess, km as retireHostExportConsumer, kn as revokeApiKey, ko as revokeConnection, kp as revokeEnrollment, kq as revokeViewer, kr as rewindHostExportConsumer, ks as rlsContextForWorkspace, kt as rlsStrategyFor, ku as rotateWorkspaceArchives, kv as runIdempotentPersistenceTransaction, kw as safeDatabaseErrorFacts, kx as sanitizeEventPayload, ky as sanitizeEventString, kz as sanitizeMemoryText, kA as sanitizeModelPayload, kB as saveComposerDraftInTransaction, kC as saveNewSessionDraftInTransaction, kD as saveRunState, kE as saveWorkspaceMemory, kF as searchWorkspaceMemories, kG as sendAgentMessageInTransaction, kH as serializeEffectiveSessionControl, kI as sessionAuthorizationScopeFilter, kJ as sessionSubject, kK as sessionTreeStatsForSessions, kL as sessionsWithActiveOpOnEnrollment, kM as setActiveCodexCredential, kN as setActiveSandbox, kO as setCodexCredentialExhausted, kP as setCodexCredentialExhaustedWithWakeTargets, kQ as setCodexCredentialStatus, kR as setCodexCredentialStatusById, kS as setConnectionStatus, kT as setEnrollmentDisplayState, kU as setEnrollmentOpStreamState, kV as setEnrollmentWentOffline, kW as setInitialActiveCodexCredential, kX as setRlsContext, kY as setSessionCodexPin, kZ as setSessionGoalLastContinuationTurn, k_ as setSessionGoalStatus, k$ as setSessionGoalStatusWithEvent, l0 as setSessionLastInputTokensForTurnAttempt, l1 as setSessionPin, l2 as setSubjectRlsContext, l3 as setTemporalWorkflowId, l4 as setVariableSetVariable, l5 as setWorkspaceDefaultRig, l6 as setWorkspaceEnvironmentVariable, l7 as settleCodexCredentialFailover, l8 as settleCodexCredentialLeaseLoss, l9 as settleRetainedProcess, la as settleScheduledTaskRunInTransaction, lb as settleSessionAttemptInterruptions, lc as settleSessionIdleWithParentOutbox, ld as shortMemoryId, le as steerAgentSessionInTransaction, lf as steerQueuedTurnInTransaction, lg as storeIntegrationOAuthClient, lh as submitHumanPromptInTransaction, li as sumUsageQuantity, lj as supersedeSessionCurrentDirectionInTransaction, lk as touchEnrollmentLastSeen, ll as touchLeaseHolder, lm as updateCodexAllocatorEligibility, ln as updateCodexRotationSettings, lo as updateConnection, lp as updateImportBatchCounts, lq as updateKnowledgeMemory, lr as updatePackInstallationStatus, ls as updatePtySessionActivity, lt as updateRecording, lu as updateRig, lv as updateRigChangeStatus, lw as updateScheduledTask, lx as updateScheduledTaskRun, ly as updateSessionCommandReceiptResult, lz as updateSessionGoal, lA as updateSessionGoalWithEvent, lB as updateSessionMcpApprovalPolicy, lC as updateSessionMcpServerCredentials, lD as updateSessionTitle, lE as updateVariableSet, lF as updateWorkspace, lG as updateWorkspaceEnvironment, lH as updateWorkspaceSettings, lI as upsertBillingCustomer, lJ as upsertCapabilityCatalogItem, lK as upsertCodexSubscriptionCredential, lL as upsertGitHubInstallation, lM as upsertMachineMetricsLatest, lN as upsertRegistryCapabilityCatalogItem, lO as upsertSandboxSessionEnvelope, lP as upsertSessionGoal, lQ as upsertSessionGoalWithEvent, lR as upsertWorkspaceModelPolicy, lS as validateHumanInputResponse, lT as verifyDirectWorkspaceMutationSettlement, lU as verifyRetainedProcessMutationSettlement, lV as verifyWorkspaceMutationSettlement, lW as withAccountRls, lX as withCodexCapacityMutation, lY as withCodexCredentialRefreshLock, lZ as withCodexTokenDeadline, l_ as withRlsContext, l$ as withWorkspaceRls, m0 as withWorkspaceSubjectRls, m1 as withWorkspaceUsageLock, m2 as workspaceCaptureAtRevision, m3 as workspaceCodexSubscriptionActive } from './provision-roles.js';
6
6
  import 'drizzle-orm/pg-core';
7
- import './schema-CdPGTHlD.js';
7
+ import 'postgres';
8
+ import './schema-CnpD6BcX.js';
8
9
  export { migrate, runMigrations } from './migrate.js';
10
+ export { isPrivateAddress } from '@opengeni/network';