@opengeni/db 5.0.1 → 6.0.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 (212) hide show
  1. package/dist/automations.d.ts +0 -2
  2. package/dist/canonical-human-identities.d.ts +4 -0
  3. package/dist/canonical-human-identities.js +3 -3
  4. package/dist/capability-components.d.ts +5 -13
  5. package/dist/capability-integrations.d.ts +23 -8
  6. package/dist/capability-reconciliation.d.ts +5 -0
  7. package/dist/capability-reconciliation.js +21 -0
  8. package/dist/capability-reconciliation.js.map +1 -0
  9. package/dist/{chunk-6T2GGYWE.js → chunk-4UJCXBR2.js} +4 -5800
  10. package/dist/chunk-4UJCXBR2.js.map +1 -0
  11. package/dist/{chunk-MWMXWHJD.js → chunk-7JCDSMX2.js} +2 -2
  12. package/dist/chunk-AJA2ZIUW.js +219 -0
  13. package/dist/chunk-AJA2ZIUW.js.map +1 -0
  14. package/dist/chunk-CDAT6EKW.js +247 -0
  15. package/dist/chunk-CDAT6EKW.js.map +1 -0
  16. package/dist/{chunk-DPONPYJD.js → chunk-CJI6G254.js} +70 -18
  17. package/dist/chunk-CJI6G254.js.map +1 -0
  18. package/dist/chunk-G32NVMRJ.js +276 -0
  19. package/dist/chunk-G32NVMRJ.js.map +1 -0
  20. package/dist/chunk-GABXCG3N.js +5811 -0
  21. package/dist/chunk-GABXCG3N.js.map +1 -0
  22. package/dist/{chunk-ERKVSPDX.js → chunk-LVY33EWL.js} +3 -3
  23. package/dist/{chunk-45CP2YKY.js → chunk-MAMBI2HR.js} +9 -3
  24. package/dist/{chunk-45CP2YKY.js.map → chunk-MAMBI2HR.js.map} +1 -1
  25. package/dist/{chunk-F73UKJY6.js → chunk-MN5PZMEK.js} +91 -108
  26. package/dist/chunk-MN5PZMEK.js.map +1 -0
  27. package/dist/chunk-PJI4MUZ7.js +131 -0
  28. package/dist/chunk-PJI4MUZ7.js.map +1 -0
  29. package/dist/{chunk-T6BWIGWJ.js → chunk-RIYHP2WU.js} +2 -2
  30. package/dist/{chunk-7HMK3B45.js → chunk-RL2MUXM3.js} +16 -7
  31. package/dist/chunk-RL2MUXM3.js.map +1 -0
  32. package/dist/{chunk-HQDVI2DB.js → chunk-SYKHLPTK.js} +4 -3
  33. package/dist/{chunk-HQDVI2DB.js.map → chunk-SYKHLPTK.js.map} +1 -1
  34. package/dist/{chunk-T6YLHJLS.js → chunk-XIXVVBW2.js} +198 -51
  35. package/dist/chunk-XIXVVBW2.js.map +1 -0
  36. package/dist/chunk-ZPJ6V2VG.js +156 -0
  37. package/dist/chunk-ZPJ6V2VG.js.map +1 -0
  38. package/dist/codex-capacity-recovery.d.ts +12 -0
  39. package/dist/codex-failure-eligibility.d.ts +9 -0
  40. package/dist/company-profile-schema.d.ts +4 -2
  41. package/dist/connect-attempts.d.ts +15 -0
  42. package/dist/connect-attempts.js +25 -0
  43. package/dist/connect-attempts.js.map +1 -0
  44. package/dist/connection-authority.d.ts +7 -63
  45. package/dist/connection-refresh-lock.d.ts +4 -0
  46. package/dist/connection-token-resolver.d.ts +8 -43
  47. package/dist/database-timing.d.ts +10 -0
  48. package/dist/database.d.ts +4 -0
  49. package/dist/editable-artifact-durable-export.js +2 -2
  50. package/dist/editable-artifacts.d.ts +9 -0
  51. package/dist/editable-artifacts.js +7 -5
  52. package/dist/index.d.ts +447 -78
  53. package/dist/index.js +12705 -12872
  54. package/dist/index.js.map +1 -1
  55. package/dist/insights-usage-bundle.d.ts +3 -0
  56. package/dist/integration-bindings.d.ts +1 -1
  57. package/dist/integration-facets.d.ts +18 -1
  58. package/dist/knowledge-entries-schema.d.ts +2 -0
  59. package/dist/knowledge-entries.d.ts +1 -0
  60. package/dist/knowledge-indexing.d.ts +1 -0
  61. package/dist/live-session-attempt.d.ts +35 -137
  62. package/dist/managed-auth-session-sets.js +3 -3
  63. package/dist/mcp-account-bindings.d.ts +4 -0
  64. package/dist/mcp-oauth.d.ts +11 -0
  65. package/dist/mcp-operations.js +2 -2
  66. package/dist/migrate.js +1 -1
  67. package/dist/organization-integration-policy.d.ts +51 -0
  68. package/dist/organization-integration-policy.js +18 -0
  69. package/dist/organization-integration-policy.js.map +1 -0
  70. package/dist/organization-usage.d.ts +20 -0
  71. package/dist/plugin-packages.d.ts +9 -12
  72. package/dist/pr-review.d.ts +0 -11
  73. package/dist/preference-registry-schema.d.ts +17 -0
  74. package/dist/provision-roles.js +1 -1
  75. package/dist/retained-provider-commands.d.ts +124 -6
  76. package/dist/retained-provider-commands.js +29 -97
  77. package/dist/retained-provider-commands.js.map +1 -1
  78. package/dist/retired-session-create-metadata.d.ts +4 -0
  79. package/dist/runtime-posture.d.ts +7 -5
  80. package/dist/schema.d.ts +876 -656
  81. package/dist/schema.js +5 -7
  82. package/dist/session-admission-block.d.ts +32 -0
  83. package/dist/session-attempt-writers.d.ts +4 -0
  84. package/dist/session-background-commands.js +5 -4
  85. package/dist/session-command-output.js +8 -126
  86. package/dist/session-command-output.js.map +1 -1
  87. package/dist/session-control.d.ts +5 -1
  88. package/dist/session-event-slices.d.ts +10 -0
  89. package/dist/session-event-slices.js +8 -222
  90. package/dist/session-event-slices.js.map +1 -1
  91. package/dist/session-file-attachments.d.ts +28 -0
  92. package/dist/session-goal-reports.d.ts +43 -0
  93. package/dist/session-mcp-approval.d.ts +4 -0
  94. package/dist/session-mcp-credential-rotation.js +5 -4
  95. package/dist/session-mcp-credential-rotation.js.map +1 -1
  96. package/dist/session-message-search.d.ts +22 -0
  97. package/dist/session-queue-commands.d.ts +2 -6
  98. package/dist/session-retry.d.ts +36 -0
  99. package/dist/session-tenancy.js +3 -3
  100. package/dist/skill-source-release-impact.d.ts +18 -0
  101. package/dist/skill-source-release.d.ts +9 -0
  102. package/dist/skills.d.ts +7 -1
  103. package/dist/user-resource-authority.d.ts +0 -8
  104. package/dist/video-generation.js +3 -3
  105. package/dist/workspace-tool-defaults.js +5 -4
  106. package/dist/workspace-tool-defaults.js.map +1 -1
  107. package/drizzle/0468_knowledge_relationship_projection.sql +30 -0
  108. package/drizzle/0469_knowledge_source_discovery.sql +85 -0
  109. package/drizzle/0470_organization_integration_policy.sql +151 -0
  110. package/drizzle/0471_usage_events_account_recent_index.sql +4 -0
  111. package/drizzle/0472_usage_events_workspace_recent_index.sql +4 -0
  112. package/drizzle/0473_organization_usage_analytical_capability.sql +237 -0
  113. package/drizzle/0474_goal_report_requirements.sql +156 -0
  114. package/drizzle/0475_session_event_history_statistics.sql +15 -0
  115. package/drizzle/0476_session_event_history_policy_planning.sql +29 -0
  116. package/drizzle/0477_managed_sign_in_methods.sql +303 -0
  117. package/drizzle/0478_sender_owned_connections.sql +2772 -0
  118. package/drizzle/0479_connection_create_idempotency.sql +16 -0
  119. package/drizzle/0480_private_session_organization_key_administration.sql +154 -0
  120. package/drizzle/0481_personal_connection_visibility_cleanup.sql +45 -0
  121. package/drizzle/0482_remove_packs.sql +417 -0
  122. package/drizzle/0483_preclaim_admission_block.sql +85 -0
  123. package/drizzle/0484_insights_usage_projection.sql +211 -0
  124. package/drizzle/0485_inherited_mcp_approval_policies.sql +6 -0
  125. package/drizzle/0486_reasoning_configuration_message_forks.sql +35 -0
  126. package/drizzle/0487_skill_catalog_message_forks.sql +26 -0
  127. package/drizzle/0488_permanent_skill_removal.sql +207 -0
  128. package/drizzle/0489_modal_command_byte_offsets.sql +17 -0
  129. package/drizzle/0490_periodic_capture_attempt_cadence.sql +6 -0
  130. package/drizzle/0491_warm_capture_holder_reclamation.sql +57 -0
  131. package/drizzle/0492_codex_accepted_source_authority.sql +249 -0
  132. package/drizzle/0493_stopping_command_error_containment.sql +58 -0
  133. package/drizzle/0494_mcp_account_bindings.sql +334 -0
  134. package/drizzle/0495_consented_sandbox_recovery.sql +220 -0
  135. package/drizzle/0496_supervised_command_settlement.sql +386 -0
  136. package/drizzle/0497_modal_inventory_owner_read_capability.sql +112 -0
  137. package/drizzle/0498_enrollment_membership_fence.sql +87 -0
  138. package/drizzle/0499_session_attachment_access.sql +224 -0
  139. package/drizzle/0500_session_execution_epoch.sql +37 -0
  140. package/drizzle/0501_session_sharing_execution.sql +591 -0
  141. package/drizzle/0502_active_message_boundary_forks.sql +30 -0
  142. package/package.json +17 -5
  143. package/src/automations.ts +17 -73
  144. package/src/canonical-human-identities.ts +17 -5
  145. package/src/capability-components.ts +7 -24
  146. package/src/capability-integrations.ts +301 -21
  147. package/src/capability-reconciliation.ts +19 -0
  148. package/src/codex-capacity-recovery.ts +47 -0
  149. package/src/codex-failure-eligibility.ts +93 -0
  150. package/src/connect-attempts.ts +49 -18
  151. package/src/connection-authority.ts +12 -158
  152. package/src/connection-refresh-lock.ts +22 -0
  153. package/src/connection-token-resolver.ts +58 -530
  154. package/src/database-timing.ts +43 -0
  155. package/src/database.ts +61 -26
  156. package/src/editable-artifacts.ts +1 -1
  157. package/src/index.ts +3578 -1273
  158. package/src/insights-model-bundle.ts +19 -7
  159. package/src/insights-usage-bundle.ts +16 -19
  160. package/src/integration-bindings.ts +2 -7
  161. package/src/integration-facets.ts +73 -6
  162. package/src/knowledge-entries.ts +8 -1
  163. package/src/live-session-attempt.ts +0 -22
  164. package/src/mcp-account-bindings.ts +12 -0
  165. package/src/mcp-oauth.ts +26 -0
  166. package/src/organization-integration-policy.ts +235 -0
  167. package/src/organization-usage.ts +83 -0
  168. package/src/plugin-packages.ts +226 -42
  169. package/src/pr-review.ts +7 -69
  170. package/src/preference-registry-schema.ts +1 -0
  171. package/src/provision-roles.ts +50 -37
  172. package/src/retained-provider-commands.ts +286 -9
  173. package/src/retired-session-create-metadata.ts +16 -0
  174. package/src/runtime-posture.ts +217 -13
  175. package/src/schema.ts +104 -120
  176. package/src/session-admission-block.ts +29 -0
  177. package/src/session-attempt-writers.ts +48 -0
  178. package/src/session-control.ts +21 -5
  179. package/src/session-event-slices.ts +76 -26
  180. package/src/session-file-attachments.ts +66 -0
  181. package/src/session-goal-reports.ts +255 -0
  182. package/src/session-mcp-approval.ts +30 -0
  183. package/src/session-message-search.ts +348 -0
  184. package/src/session-queue-commands.ts +60 -36
  185. package/src/session-retry.ts +319 -0
  186. package/src/skill-config-migration.ts +11 -2
  187. package/src/skill-source-release-impact.ts +33 -0
  188. package/src/skill-source-release.ts +67 -26
  189. package/src/skills.ts +44 -6
  190. package/src/user-resource-authority.ts +0 -56
  191. package/dist/chunk-6T2GGYWE.js.map +0 -1
  192. package/dist/chunk-7HMK3B45.js.map +0 -1
  193. package/dist/chunk-DPONPYJD.js.map +0 -1
  194. package/dist/chunk-F73UKJY6.js.map +0 -1
  195. package/dist/chunk-T6YLHJLS.js.map +0 -1
  196. package/dist/host-mcp-binding-match.d.ts +0 -5
  197. package/dist/host-mcp-bindings.d.ts +0 -79
  198. package/dist/host-mcp-resolvers.d.ts +0 -47
  199. package/dist/host-mcp-task-authority.d.ts +0 -43
  200. package/dist/host-selection-identity.d.ts +0 -6
  201. package/dist/pack-components.d.ts +0 -83
  202. package/dist/pack-installations.d.ts +0 -86
  203. package/src/host-mcp-binding-match.ts +0 -34
  204. package/src/host-mcp-bindings.ts +0 -777
  205. package/src/host-mcp-resolvers.ts +0 -266
  206. package/src/host-mcp-task-authority.ts +0 -384
  207. package/src/host-selection-identity.ts +0 -29
  208. package/src/pack-components.ts +0 -980
  209. package/src/pack-installations.ts +0 -950
  210. /package/dist/{chunk-MWMXWHJD.js.map → chunk-7JCDSMX2.js.map} +0 -0
  211. /package/dist/{chunk-ERKVSPDX.js.map → chunk-LVY33EWL.js.map} +0 -0
  212. /package/dist/{chunk-T6BWIGWJ.js.map → chunk-RIYHP2WU.js.map} +0 -0
@@ -1,13 +1,22 @@
1
- import { SandboxProviderCommand } from "@opengeni/contracts";
1
+ import { SandboxProviderCommand, ModalRouterProviderCommand, CommandSupervisionReceipt, type SessionEvent } from "@opengeni/contracts";
2
2
  import { type Database } from "./database.js";
3
- type ProcessScope = {
3
+ export type ProcessScope = {
4
4
  accountId: string;
5
5
  workspaceId: string;
6
6
  sessionId: string;
7
7
  processId: string;
8
8
  };
9
9
  /** Bound to an already-authorized exact process scope by runtime wiring. */
10
- export declare function retainedProviderCommandPersistence(db: Database, scope: ProcessScope): {
10
+ export declare function retainedProviderCommandPersistence(db: Database, scope: ProcessScope, publish?: (events: SessionEvent[]) => Promise<void>): {
11
+ recordSupervisionReceipt: (receipt: SupervisionReceipt) => Promise<void>;
12
+ loadSupervisionReceipt: () => Promise<{
13
+ protocol: "native-subreaper-v1";
14
+ invocationId: string;
15
+ receiptId: string;
16
+ leaderExitCode: number;
17
+ } | null>;
18
+ requestCancellation: (reason: "provider_deadline" | "explicit_stop") => Promise<void>;
19
+ cancellationRequested: () => Promise<boolean>;
11
20
  load: () => Promise<{
12
21
  kind: "modal-control-v1";
13
22
  sandboxId: string;
@@ -26,6 +35,32 @@ export declare function retainedProviderCommandPersistence(db: Database, scope:
26
35
  exitCode: number | null;
27
36
  };
28
37
  };
38
+ } | {
39
+ kind: "modal-router-v1";
40
+ sandboxId: string;
41
+ taskId: string;
42
+ execId: string;
43
+ pty?: boolean | undefined;
44
+ supervision?: {
45
+ protocol: "native-subreaper-v1";
46
+ invocationId: string;
47
+ nonce: string;
48
+ controlPath: string;
49
+ } | undefined;
50
+ streams: {
51
+ stdout: {
52
+ byteOffset: number;
53
+ utf8Remainder: string;
54
+ eof: boolean;
55
+ exitCode: number | null;
56
+ };
57
+ stderr: {
58
+ byteOffset: number;
59
+ utf8Remainder: string;
60
+ eof: boolean;
61
+ exitCode: number | null;
62
+ };
63
+ };
29
64
  } | null>;
30
65
  acknowledge: (command: SandboxProviderCommand) => Promise<{
31
66
  kind: "modal-control-v1";
@@ -45,8 +80,64 @@ export declare function retainedProviderCommandPersistence(db: Database, scope:
45
80
  exitCode: number | null;
46
81
  };
47
82
  };
83
+ } | {
84
+ kind: "modal-router-v1";
85
+ sandboxId: string;
86
+ taskId: string;
87
+ execId: string;
88
+ pty?: boolean | undefined;
89
+ supervision?: {
90
+ protocol: "native-subreaper-v1";
91
+ invocationId: string;
92
+ nonce: string;
93
+ controlPath: string;
94
+ } | undefined;
95
+ streams: {
96
+ stdout: {
97
+ byteOffset: number;
98
+ utf8Remainder: string;
99
+ eof: boolean;
100
+ exitCode: number | null;
101
+ };
102
+ stderr: {
103
+ byteOffset: number;
104
+ utf8Remainder: string;
105
+ eof: boolean;
106
+ exitCode: number | null;
107
+ };
108
+ };
109
+ }>;
110
+ reserveInput: (byteLength?: number) => Promise<number>;
111
+ captureRouterPage: (page: RetainedRouterOutputPage) => Promise<{
112
+ command: {
113
+ kind: "modal-router-v1";
114
+ sandboxId: string;
115
+ taskId: string;
116
+ execId: string;
117
+ pty?: boolean | undefined;
118
+ supervision?: {
119
+ protocol: "native-subreaper-v1";
120
+ invocationId: string;
121
+ nonce: string;
122
+ controlPath: string;
123
+ } | undefined;
124
+ streams: {
125
+ stdout: {
126
+ byteOffset: number;
127
+ utf8Remainder: string;
128
+ eof: boolean;
129
+ exitCode: number | null;
130
+ };
131
+ stderr: {
132
+ byteOffset: number;
133
+ utf8Remainder: string;
134
+ eof: boolean;
135
+ exitCode: number | null;
136
+ };
137
+ };
138
+ };
139
+ captured: boolean;
48
140
  }>;
49
- reserveInput: () => Promise<number>;
50
141
  };
51
142
  /** Promotion and the opaque provider locator commit together. Preserve the
52
143
  * existing durable-but-output-rejected promotion contract: its typed rejection
@@ -58,7 +149,34 @@ export declare function getRetainedProviderCommand(db: Database, scope: ProcessS
58
149
  /** Call only after all output in this provider page has been durably captured.
59
150
  * A stale acknowledgment cannot roll back a cursor or erase terminal evidence. */
60
151
  export declare function acknowledgeRetainedProviderOutput(db: Database, scope: ProcessScope, candidate: SandboxProviderCommand): Promise<SandboxProviderCommand>;
152
+ export type RetainedRouterOutputPage = {
153
+ expected: ModalRouterProviderCommand;
154
+ command: ModalRouterProviderCommand;
155
+ stdout: string;
156
+ stderr: string;
157
+ };
158
+ export declare function validateRouterOutputAdvance(page: RetainedRouterOutputPage): void;
159
+ /** Capture and offsets commit atomically. The session lock is acquired before
160
+ * the process lock, matching the event-write lock order. A concurrent reader
161
+ * with a stale cursor discards its page and reloads; it never appends overlapping
162
+ * output or silently advances the other reader's cursor. */
163
+ export declare function captureRetainedRouterOutput(db: Database, scope: ProcessScope, page: RetainedRouterOutputPage): Promise<{
164
+ command: ModalRouterProviderCommand;
165
+ events: SessionEvent[];
166
+ captured: boolean;
167
+ }>;
61
168
  /** Reserve a strictly increasing provider stdin index before dispatch. An
62
169
  * ambiguous send consumes its index and is never silently replayed. */
63
- export declare function reserveRetainedProviderInput(db: Database, scope: ProcessScope): Promise<number>;
64
- export {};
170
+ export declare function reserveRetainedProviderInput(db: Database, scope: ProcessScope, byteLength?: number): Promise<number>;
171
+ export type SupervisionReceipt = CommandSupervisionReceipt;
172
+ /** Fail before provider start, not after discovering an unprotected DB at retention. */
173
+ export declare function supervisedCommandProtocolReady(db: Database): Promise<boolean>;
174
+ /** Only an authenticated control-channel receipt; never parsed stdout/stderr.
175
+ * ACK the supervisor only after this transaction returns successfully. */
176
+ export declare function recordRetainedSupervisionReceipt(db: Database, scope: ProcessScope, receipt: SupervisionReceipt): Promise<void>;
177
+ export declare function loadRetainedSupervisionReceipt(db: Database, scope: ProcessScope): Promise<SupervisionReceipt | null>;
178
+ export declare function requestRetainedProcessCancellation(db: Database, scope: ProcessScope, reason: "provider_deadline" | "explicit_stop"): Promise<void>;
179
+ export declare function retainedProcessCancellationRequested(db: Database, scope: ProcessScope): Promise<boolean>;
180
+ /** Called by the reaper for an exact retained command. Ordinary completed turns
181
+ * are intentionally irrelevant. Lock order remains process -> lease. */
182
+ export declare function requestRetainedProcessDeadlineCancellation(db: Database, scope: ProcessScope): Promise<boolean>;
@@ -1,107 +1,39 @@
1
1
  import {
2
- withRlsContext
3
- } from "./chunk-DPONPYJD.js";
4
- import {
5
- sandboxRetainedProcesses
6
- } from "./chunk-F73UKJY6.js";
2
+ acknowledgeRetainedProviderOutput,
3
+ captureRetainedRouterOutput,
4
+ createProviderCommandRetainer,
5
+ getRetainedProviderCommand,
6
+ loadRetainedSupervisionReceipt,
7
+ recordRetainedSupervisionReceipt,
8
+ requestRetainedProcessCancellation,
9
+ requestRetainedProcessDeadlineCancellation,
10
+ reserveRetainedProviderInput,
11
+ retainedProcessCancellationRequested,
12
+ retainedProviderCommandPersistence,
13
+ supervisedCommandProtocolReady,
14
+ validateRouterOutputAdvance
15
+ } from "./chunk-G32NVMRJ.js";
16
+ import "./chunk-PJI4MUZ7.js";
17
+ import "./chunk-GABXCG3N.js";
18
+ import "./chunk-LVY33EWL.js";
19
+ import "./chunk-4UJCXBR2.js";
20
+ import "./chunk-CJI6G254.js";
21
+ import "./chunk-MN5PZMEK.js";
7
22
  import "./chunk-S2TZ3F4L.js";
8
23
  import "./chunk-PZ5AY32C.js";
9
-
10
- // src/retained-provider-commands.ts
11
- import { and, eq } from "drizzle-orm";
12
- import { isDeepStrictEqual } from "util";
13
- import { SandboxProviderCommand } from "@opengeni/contracts";
14
- function retainedProviderCommandPersistence(db, scope) {
15
- return {
16
- load: () => getRetainedProviderCommand(db, scope),
17
- acknowledge: (command) => acknowledgeRetainedProviderOutput(db, scope, command),
18
- reserveInput: () => reserveRetainedProviderInput(db, scope)
19
- };
20
- }
21
- function processWhere(scope) {
22
- return and(
23
- eq(sandboxRetainedProcesses.accountId, scope.accountId),
24
- eq(sandboxRetainedProcesses.workspaceId, scope.workspaceId),
25
- eq(sandboxRetainedProcesses.sessionId, scope.sessionId),
26
- eq(sandboxRetainedProcesses.id, scope.processId)
27
- );
28
- }
29
- function sameExecution(a, b) {
30
- return a.kind === b.kind && a.sandboxId === b.sandboxId && a.taskId === b.taskId && a.execId === b.execId && Boolean(a.pty) === Boolean(b.pty);
31
- }
32
- function createProviderCommandRetainer(promote, recoverDurablePromotion) {
33
- return async function retainWorkspaceProviderCommand(db, input) {
34
- if (!input.providerCommand) return promote(db, input);
35
- const command = SandboxProviderCommand.parse(input.providerCommand);
36
- const result = await withRlsContext(db, input, async (tx) => {
37
- let process;
38
- let rejection = null;
39
- try {
40
- process = await promote(tx, input);
41
- } catch (error) {
42
- const durable = recoverDurablePromotion(error);
43
- if (durable === null) throw error;
44
- process = durable;
45
- rejection = error;
46
- }
47
- const [row] = await tx.select().from(sandboxRetainedProcesses).where(processWhere(input)).for("update").limit(1);
48
- if (!row || row.providerBackend !== "modal" || row.providerInstanceId !== command.sandboxId)
49
- throw new Error("Provider command does not match its retained sandbox");
50
- if (row.providerCommand) {
51
- if (!sameExecution(SandboxProviderCommand.parse(row.providerCommand), command))
52
- throw new Error("Retained process already has a different provider execution");
53
- } else {
54
- await tx.update(sandboxRetainedProcesses).set({ providerCommand: command }).where(processWhere(input));
55
- }
56
- return { process, rejection };
57
- });
58
- if (result.rejection) throw result.rejection;
59
- return result.process;
60
- };
61
- }
62
- async function getRetainedProviderCommand(db, scope) {
63
- return withRlsContext(db, scope, async (tx) => {
64
- const [row] = await tx.select({ command: sandboxRetainedProcesses.providerCommand }).from(sandboxRetainedProcesses).where(processWhere(scope)).limit(1);
65
- return row?.command ? SandboxProviderCommand.parse(row.command) : null;
66
- });
67
- }
68
- async function acknowledgeRetainedProviderOutput(db, scope, candidate) {
69
- const next = SandboxProviderCommand.parse(candidate);
70
- return withRlsContext(db, scope, async (tx) => {
71
- const [row] = await tx.select().from(sandboxRetainedProcesses).where(processWhere(scope)).for("update").limit(1);
72
- if (!row?.providerCommand) throw new Error("Retained provider command is unavailable");
73
- const previous = SandboxProviderCommand.parse(row.providerCommand);
74
- if (!sameExecution(previous, next))
75
- throw new Error("Output acknowledgment changed provider execution identity");
76
- const merged = structuredClone(previous);
77
- for (const stream of ["stdout", "stderr"]) {
78
- const oldCursor = previous.streams[stream];
79
- const newCursor = next.streams[stream];
80
- if (newCursor.batchIndex < oldCursor.batchIndex) continue;
81
- if ((newCursor.batchIndex === oldCursor.batchIndex || oldCursor.exitCode !== null) && !isDeepStrictEqual(oldCursor, newCursor))
82
- throw new Error("Provider output acknowledgment conflicts with retained evidence");
83
- merged.streams[stream] = newCursor;
84
- }
85
- await tx.update(sandboxRetainedProcesses).set({ providerCommand: merged }).where(processWhere(scope));
86
- return merged;
87
- });
88
- }
89
- async function reserveRetainedProviderInput(db, scope) {
90
- return withRlsContext(db, scope, async (tx) => {
91
- const [row] = await tx.select().from(sandboxRetainedProcesses).where(processWhere(scope)).for("update").limit(1);
92
- if (!row?.providerCommand || row.state !== "active")
93
- throw new Error("Active retained provider command is unavailable");
94
- const index = row.providerCommandInputIndex + 1;
95
- if (!Number.isSafeInteger(index)) throw new Error("Provider stdin sequence exhausted");
96
- await tx.update(sandboxRetainedProcesses).set({ providerCommandInputIndex: index }).where(processWhere(scope));
97
- return index;
98
- });
99
- }
100
24
  export {
101
25
  acknowledgeRetainedProviderOutput,
26
+ captureRetainedRouterOutput,
102
27
  createProviderCommandRetainer,
103
28
  getRetainedProviderCommand,
29
+ loadRetainedSupervisionReceipt,
30
+ recordRetainedSupervisionReceipt,
31
+ requestRetainedProcessCancellation,
32
+ requestRetainedProcessDeadlineCancellation,
104
33
  reserveRetainedProviderInput,
105
- retainedProviderCommandPersistence
34
+ retainedProcessCancellationRequested,
35
+ retainedProviderCommandPersistence,
36
+ supervisedCommandProtocolReady,
37
+ validateRouterOutputAdvance
106
38
  };
107
39
  //# sourceMappingURL=retained-provider-commands.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/retained-provider-commands.ts"],"sourcesContent":["import { and, eq } from \"drizzle-orm\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { SandboxProviderCommand } from \"@opengeni/contracts\";\nimport { withRlsContext, type Database } from \"./database\";\nimport * as schema from \"./schema\";\n\ntype ProcessScope = {\n accountId: string;\n workspaceId: string;\n sessionId: string;\n processId: string;\n};\n\n/** Bound to an already-authorized exact process scope by runtime wiring. */\nexport function retainedProviderCommandPersistence(db: Database, scope: ProcessScope) {\n return {\n load: () => getRetainedProviderCommand(db, scope),\n acknowledge: (command: SandboxProviderCommand) =>\n acknowledgeRetainedProviderOutput(db, scope, command),\n reserveInput: () => reserveRetainedProviderInput(db, scope),\n };\n}\n\nfunction processWhere(scope: ProcessScope) {\n return and(\n eq(schema.sandboxRetainedProcesses.accountId, scope.accountId),\n eq(schema.sandboxRetainedProcesses.workspaceId, scope.workspaceId),\n eq(schema.sandboxRetainedProcesses.sessionId, scope.sessionId),\n eq(schema.sandboxRetainedProcesses.id, scope.processId),\n );\n}\n\nfunction sameExecution(a: SandboxProviderCommand, b: SandboxProviderCommand): boolean {\n return (\n a.kind === b.kind &&\n a.sandboxId === b.sandboxId &&\n a.taskId === b.taskId &&\n a.execId === b.execId &&\n Boolean(a.pty) === Boolean(b.pty)\n );\n}\n\n/** Promotion and the opaque provider locator commit together. Preserve the\n * existing durable-but-output-rejected promotion contract: its typed rejection\n * is rethrown only AFTER this outer transaction has committed the locator. */\nexport function createProviderCommandRetainer<Input extends ProcessScope, Process>(\n promote: (db: Database, input: Input) => Promise<Process>,\n recoverDurablePromotion: (error: unknown) => Process | null,\n) {\n return async function retainWorkspaceProviderCommand(\n db: Database,\n input: Input & { providerCommand?: SandboxProviderCommand | null },\n ): Promise<Process> {\n if (!input.providerCommand) return promote(db, input);\n const command = SandboxProviderCommand.parse(input.providerCommand);\n const result = await withRlsContext(db, input, async (tx) => {\n let process: Process;\n let rejection: unknown = null;\n try {\n process = await promote(tx, input);\n } catch (error) {\n const durable = recoverDurablePromotion(error);\n if (durable === null) throw error;\n process = durable;\n rejection = error;\n }\n const [row] = await tx\n .select()\n .from(schema.sandboxRetainedProcesses)\n .where(processWhere(input))\n .for(\"update\")\n .limit(1);\n if (!row || row.providerBackend !== \"modal\" || row.providerInstanceId !== command.sandboxId)\n throw new Error(\"Provider command does not match its retained sandbox\");\n if (row.providerCommand) {\n if (!sameExecution(SandboxProviderCommand.parse(row.providerCommand), command))\n throw new Error(\"Retained process already has a different provider execution\");\n } else {\n await tx\n .update(schema.sandboxRetainedProcesses)\n .set({ providerCommand: command })\n .where(processWhere(input));\n }\n return { process, rejection };\n });\n if (result.rejection) throw result.rejection;\n return result.process;\n };\n}\n\nexport async function getRetainedProviderCommand(\n db: Database,\n scope: ProcessScope,\n): Promise<SandboxProviderCommand | null> {\n return withRlsContext(db, scope, async (tx) => {\n const [row] = await tx\n .select({ command: schema.sandboxRetainedProcesses.providerCommand })\n .from(schema.sandboxRetainedProcesses)\n .where(processWhere(scope))\n .limit(1);\n return row?.command ? SandboxProviderCommand.parse(row.command) : null;\n });\n}\n\n/** Call only after all output in this provider page has been durably captured.\n * A stale acknowledgment cannot roll back a cursor or erase terminal evidence. */\nexport async function acknowledgeRetainedProviderOutput(\n db: Database,\n scope: ProcessScope,\n candidate: SandboxProviderCommand,\n): Promise<SandboxProviderCommand> {\n const next = SandboxProviderCommand.parse(candidate);\n return withRlsContext(db, scope, async (tx) => {\n const [row] = await tx\n .select()\n .from(schema.sandboxRetainedProcesses)\n .where(processWhere(scope))\n .for(\"update\")\n .limit(1);\n if (!row?.providerCommand) throw new Error(\"Retained provider command is unavailable\");\n const previous = SandboxProviderCommand.parse(row.providerCommand);\n if (!sameExecution(previous, next))\n throw new Error(\"Output acknowledgment changed provider execution identity\");\n const merged = structuredClone(previous);\n for (const stream of [\"stdout\", \"stderr\"] as const) {\n const oldCursor = previous.streams[stream];\n const newCursor = next.streams[stream];\n if (newCursor.batchIndex < oldCursor.batchIndex) continue;\n if (\n (newCursor.batchIndex === oldCursor.batchIndex || oldCursor.exitCode !== null) &&\n !isDeepStrictEqual(oldCursor, newCursor)\n )\n throw new Error(\"Provider output acknowledgment conflicts with retained evidence\");\n merged.streams[stream] = newCursor;\n }\n await tx\n .update(schema.sandboxRetainedProcesses)\n .set({ providerCommand: merged })\n .where(processWhere(scope));\n return merged;\n });\n}\n\n/** Reserve a strictly increasing provider stdin index before dispatch. An\n * ambiguous send consumes its index and is never silently replayed. */\nexport async function reserveRetainedProviderInput(\n db: Database,\n scope: ProcessScope,\n): Promise<number> {\n return withRlsContext(db, scope, async (tx) => {\n const [row] = await tx\n .select()\n .from(schema.sandboxRetainedProcesses)\n .where(processWhere(scope))\n .for(\"update\")\n .limit(1);\n if (!row?.providerCommand || row.state !== \"active\")\n throw new Error(\"Active retained provider command is unavailable\");\n const index = row.providerCommandInputIndex + 1;\n if (!Number.isSafeInteger(index)) throw new Error(\"Provider stdin sequence exhausted\");\n await tx\n .update(schema.sandboxRetainedProcesses)\n .set({ providerCommandInputIndex: index })\n .where(processWhere(scope));\n return index;\n });\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,KAAK,UAAU;AACxB,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AAYhC,SAAS,mCAAmC,IAAc,OAAqB;AACpF,SAAO;AAAA,IACL,MAAM,MAAM,2BAA2B,IAAI,KAAK;AAAA,IAChD,aAAa,CAAC,YACZ,kCAAkC,IAAI,OAAO,OAAO;AAAA,IACtD,cAAc,MAAM,6BAA6B,IAAI,KAAK;AAAA,EAC5D;AACF;AAEA,SAAS,aAAa,OAAqB;AACzC,SAAO;AAAA,IACL,GAAU,yBAAyB,WAAW,MAAM,SAAS;AAAA,IAC7D,GAAU,yBAAyB,aAAa,MAAM,WAAW;AAAA,IACjE,GAAU,yBAAyB,WAAW,MAAM,SAAS;AAAA,IAC7D,GAAU,yBAAyB,IAAI,MAAM,SAAS;AAAA,EACxD;AACF;AAEA,SAAS,cAAc,GAA2B,GAAoC;AACpF,SACE,EAAE,SAAS,EAAE,QACb,EAAE,cAAc,EAAE,aAClB,EAAE,WAAW,EAAE,UACf,EAAE,WAAW,EAAE,UACf,QAAQ,EAAE,GAAG,MAAM,QAAQ,EAAE,GAAG;AAEpC;AAKO,SAAS,8BACd,SACA,yBACA;AACA,SAAO,eAAe,+BACpB,IACA,OACkB;AAClB,QAAI,CAAC,MAAM,gBAAiB,QAAO,QAAQ,IAAI,KAAK;AACpD,UAAM,UAAU,uBAAuB,MAAM,MAAM,eAAe;AAClE,UAAM,SAAS,MAAM,eAAe,IAAI,OAAO,OAAO,OAAO;AAC3D,UAAI;AACJ,UAAI,YAAqB;AACzB,UAAI;AACF,kBAAU,MAAM,QAAQ,IAAI,KAAK;AAAA,MACnC,SAAS,OAAO;AACd,cAAM,UAAU,wBAAwB,KAAK;AAC7C,YAAI,YAAY,KAAM,OAAM;AAC5B,kBAAU;AACV,oBAAY;AAAA,MACd;AACA,YAAM,CAAC,GAAG,IAAI,MAAM,GACjB,OAAO,EACP,KAAY,wBAAwB,EACpC,MAAM,aAAa,KAAK,CAAC,EACzB,IAAI,QAAQ,EACZ,MAAM,CAAC;AACV,UAAI,CAAC,OAAO,IAAI,oBAAoB,WAAW,IAAI,uBAAuB,QAAQ;AAChF,cAAM,IAAI,MAAM,sDAAsD;AACxE,UAAI,IAAI,iBAAiB;AACvB,YAAI,CAAC,cAAc,uBAAuB,MAAM,IAAI,eAAe,GAAG,OAAO;AAC3E,gBAAM,IAAI,MAAM,6DAA6D;AAAA,MACjF,OAAO;AACL,cAAM,GACH,OAAc,wBAAwB,EACtC,IAAI,EAAE,iBAAiB,QAAQ,CAAC,EAChC,MAAM,aAAa,KAAK,CAAC;AAAA,MAC9B;AACA,aAAO,EAAE,SAAS,UAAU;AAAA,IAC9B,CAAC;AACD,QAAI,OAAO,UAAW,OAAM,OAAO;AACnC,WAAO,OAAO;AAAA,EAChB;AACF;AAEA,eAAsB,2BACpB,IACA,OACwC;AACxC,SAAO,eAAe,IAAI,OAAO,OAAO,OAAO;AAC7C,UAAM,CAAC,GAAG,IAAI,MAAM,GACjB,OAAO,EAAE,SAAgB,yBAAyB,gBAAgB,CAAC,EACnE,KAAY,wBAAwB,EACpC,MAAM,aAAa,KAAK,CAAC,EACzB,MAAM,CAAC;AACV,WAAO,KAAK,UAAU,uBAAuB,MAAM,IAAI,OAAO,IAAI;AAAA,EACpE,CAAC;AACH;AAIA,eAAsB,kCACpB,IACA,OACA,WACiC;AACjC,QAAM,OAAO,uBAAuB,MAAM,SAAS;AACnD,SAAO,eAAe,IAAI,OAAO,OAAO,OAAO;AAC7C,UAAM,CAAC,GAAG,IAAI,MAAM,GACjB,OAAO,EACP,KAAY,wBAAwB,EACpC,MAAM,aAAa,KAAK,CAAC,EACzB,IAAI,QAAQ,EACZ,MAAM,CAAC;AACV,QAAI,CAAC,KAAK,gBAAiB,OAAM,IAAI,MAAM,0CAA0C;AACrF,UAAM,WAAW,uBAAuB,MAAM,IAAI,eAAe;AACjE,QAAI,CAAC,cAAc,UAAU,IAAI;AAC/B,YAAM,IAAI,MAAM,2DAA2D;AAC7E,UAAM,SAAS,gBAAgB,QAAQ;AACvC,eAAW,UAAU,CAAC,UAAU,QAAQ,GAAY;AAClD,YAAM,YAAY,SAAS,QAAQ,MAAM;AACzC,YAAM,YAAY,KAAK,QAAQ,MAAM;AACrC,UAAI,UAAU,aAAa,UAAU,WAAY;AACjD,WACG,UAAU,eAAe,UAAU,cAAc,UAAU,aAAa,SACzE,CAAC,kBAAkB,WAAW,SAAS;AAEvC,cAAM,IAAI,MAAM,iEAAiE;AACnF,aAAO,QAAQ,MAAM,IAAI;AAAA,IAC3B;AACA,UAAM,GACH,OAAc,wBAAwB,EACtC,IAAI,EAAE,iBAAiB,OAAO,CAAC,EAC/B,MAAM,aAAa,KAAK,CAAC;AAC5B,WAAO;AAAA,EACT,CAAC;AACH;AAIA,eAAsB,6BACpB,IACA,OACiB;AACjB,SAAO,eAAe,IAAI,OAAO,OAAO,OAAO;AAC7C,UAAM,CAAC,GAAG,IAAI,MAAM,GACjB,OAAO,EACP,KAAY,wBAAwB,EACpC,MAAM,aAAa,KAAK,CAAC,EACzB,IAAI,QAAQ,EACZ,MAAM,CAAC;AACV,QAAI,CAAC,KAAK,mBAAmB,IAAI,UAAU;AACzC,YAAM,IAAI,MAAM,iDAAiD;AACnE,UAAM,QAAQ,IAAI,4BAA4B;AAC9C,QAAI,CAAC,OAAO,cAAc,KAAK,EAAG,OAAM,IAAI,MAAM,mCAAmC;AACrF,UAAM,GACH,OAAc,wBAAwB,EACtC,IAAI,EAAE,2BAA2B,MAAM,CAAC,EACxC,MAAM,aAAa,KAAK,CAAC;AAC5B,WAAO;AAAA,EACT,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,4 @@
1
+ /** New creates cannot write a retired authority-selection identity. */
2
+ export declare function withoutRetiredSessionCreateMetadata(metadata: Record<string, unknown>): Record<string, unknown>;
3
+ /** Historical nonempty or malformed selections must not replay as native creates. */
4
+ export declare function hasRetiredSessionCreateSelection(metadata: Record<string, unknown>): boolean;
@@ -1,7 +1,7 @@
1
1
  import type { Database, RlsStrategy } from "./database.js";
2
2
  export declare const SANDBOX_FILE_PUBLICATION_RUNTIME_ROUTINES: readonly ["record_sandbox_file_publication(uuid, uuid, uuid, uuid)", "list_sandbox_file_publications(uuid, uuid, jsonb)"];
3
3
  export declare const WORK_CLAIM_CAPABILITY_ROUTINES: readonly ["upsert_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text, text, text, text, text)", "release_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)"];
4
- export declare const RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES: readonly ["knowledge_index_claim(text, integer, integer)", "knowledge_index_work(uuid, uuid, uuid, jsonb)", "knowledge_entry_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_confirm_legacy(uuid, uuid, jsonb, jsonb)", "agent_instruction_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_read(uuid, uuid, jsonb, jsonb)", "knowledge_entry_prepare_file(uuid, uuid, jsonb, jsonb)", "knowledge_document_prepare(uuid, uuid, uuid, jsonb)", "agent_learning_manage(uuid, uuid, jsonb, jsonb)", "mcp_operation_command(jsonb, text, jsonb)", "skill_apply_lifecycle(uuid, uuid, jsonb, jsonb)", "company_brain_inspect_context_receipts(uuid, uuid, text, uuid, timestamp with time zone, uuid, integer)", "company_brain_context_get_or_create_selection(uuid, uuid, uuid, uuid, uuid, integer)", "propose_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, text)", "propose_company_profile_for_attempt_v2(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, text, text, text)", "confirm_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid)", "get_company_profile_agent_policy(uuid, uuid, text)", "update_company_profile_agent_policy(uuid, uuid, text, text, bigint, uuid)", "undo_governed_learning_activation(uuid, uuid, uuid, uuid)", "inspect_governed_learning_decisions(uuid, uuid, text, integer)", "inspect_governed_learning_activations(uuid, uuid, text, integer)", "inspect_governed_learning_activation_undos(uuid, uuid, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer, uuid)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text, integer)", "replay_applied_session_fork(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "session_tenancy_product_activated(uuid, integer)", "session_tenancy_any_product_activation()", "xai_subscription_authority_live(uuid, uuid, text, uuid, text, uuid, uuid, bigint)", "create_xai_subscription_credential(uuid, uuid, text, text, text, text, text, text, text, timestamp with time zone)", "disconnect_xai_subscription_credential(uuid, uuid, text, uuid, jsonb)", "google_drive_document_citation(uuid, uuid, text, uuid, uuid)", "google_drive_file_authorized(uuid, uuid, text, uuid)", "knowledge_source_sync_lock_authority(uuid, uuid, uuid)", "ensure_managed_human_personal_workspace(uuid, text, uuid)", "get_external_identity_link_reference(uuid, uuid, text)", "get_external_identity_link_inventory_references(uuid, uuid[])", "ensure_external_identity(uuid, text, text)", "lookup_external_identity(uuid, text, text, text)", "prepare_external_workspace_membership_operation(jsonb)", "record_external_workspace_membership_operation(jsonb, jsonb)", "list_self_organization_memberships(text)", "list_self_organization_invitations(text)", "list_self_organization_invitations(text, uuid, integer)", "get_self_organization_invitation(text, uuid)", "list_organization_invitations(uuid, text, uuid, integer)", "list_organization_members(uuid, text)", "list_organization_administration_members(uuid, text)", "get_organization_administration_overview(uuid, text)", "get_workspace_kind(uuid, uuid)", "resolve_workspace_codex_subscription_source(uuid, uuid)", "list_organization_workspace_ids(uuid)", "list_organization_codex_workspace_ids(uuid)", "organization_workspace_command(jsonb)", "authorize_organization_shared_workspace_administration(uuid, uuid, text)", "resolve_organization_workspace_removal_subject(uuid, text, uuid)", "prepare_organization_workspace_member_removal(jsonb)", "record_organization_workspace_member_removal(jsonb, uuid, uuid)", "create_additional_managed_organization(text, text, text, text, uuid)", "create_managed_organization(text, text, text, uuid)", "assert_organization_shared_workspace_administrator(uuid, uuid, text)", "open_organization_shared_workspace_administration_capability(uuid, uuid, text)", "close_organization_shared_workspace_administration_capability(uuid)", "create_organization_shared_workspace(uuid, text, text, text, text, uuid)", "upsert_organization_shared_workspace_member(uuid, uuid, text, uuid, text, text, jsonb, boolean)", "update_organization_name(uuid, text, text, timestamp with time zone, uuid)", "create_organization_invitation_v2(jsonb)", "bind_pending_organization_invitations_for_verified_email(text, text)", "has_pending_organization_invitation_for_subject(text)", "accept_organization_invitation_v2(jsonb)", "complete_self_service_organization_setup(jsonb)", "ensure_organization_user_setup_intent(jsonb)", "claim_organization_user_setup_delivery(jsonb)", "claim_organization_user_setup_delivery_v2(jsonb)", "prepare_organization_user_setup_delivery(jsonb)", "prepare_organization_user_setup_delivery_v2(jsonb)", "settle_organization_user_setup_delivery(jsonb)", "preview_organization_user_setup(text)", "get_organization_invitation_for_administration(uuid, text, uuid)", "preflight_organization_user_setup(text)", "complete_organization_user_setup(jsonb)", "organization_membership_command(jsonb)", "prepare_organization_membership_protocol_settlements(jsonb)", "assert_active_managed_human_organization_membership(uuid, text)", "resolve_workspace_writer_grant_identity(uuid, text)", "prepare_workspace_membership_removal_settlements(jsonb)", "workspace_membership_removal_command(jsonb)", "get_organization_retention_policy(uuid, text)", "preview_organization_retention_deletions(uuid, integer)", "claim_organization_retention_deletion(uuid, uuid, uuid[])", "list_organization_retention_deletion_objects(uuid, uuid, uuid, text, integer)", "record_organization_retention_object_deleted(uuid, uuid, uuid, text, text, text, text)", "fail_organization_retention_deletion(uuid, uuid, uuid, text)", "finalize_organization_retention_deletion(uuid, uuid, uuid, text)", "complete_organization_retention_deletion(uuid, uuid, uuid, text)", ...string[], "open_private_session_create_capability(uuid, uuid, uuid, text)", "open_private_child_session_create_capability(uuid, uuid, uuid, uuid, uuid, uuid, integer)", "close_private_session_create_capability(uuid)", "resolve_session_attempt_personal_resources(uuid, uuid, uuid)", "accept_turn_personal_resource_attachment(uuid, uuid, uuid, uuid, text, integer, boolean, integer)", "list_self_user_resource_authorities(uuid, uuid, text, uuid, integer)", "issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, integer, boolean)", "issue_self_local_connection_use_grant(uuid, uuid, uuid, text, boolean)", "revoke_self_user_resource_grant(uuid, uuid, uuid)", "authorize_session_attempt_personal_resource_reads(uuid, uuid, uuid)", "preference_registry_create_knowledge_proposal_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, uuid, text, text, text, text, integer, text, jsonb, timestamp with time zone, text)", "create_scoped_variable_set(uuid, uuid, text, text, text, jsonb, boolean)", "list_scoped_variable_sets(uuid, uuid, uuid, text, text)", "count_scoped_variable_sets(uuid, uuid, text)", "mutate_scoped_variable_set(uuid, uuid, uuid, text, text, boolean, text, boolean, text, text, boolean)", "read_scoped_variable_set_secret(uuid, uuid, uuid, text, text, text, uuid, uuid, uuid, integer)", "materialize_scoped_variable_set_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "materialize_scoped_variable_set_for_session(uuid, uuid, uuid, uuid)", "connection_authority_convergence_audit_capability_active(uuid)", "resolve_personal_connection_authority_selection(uuid, uuid, text, uuid, jsonb)", "resolve_accepted_connection_use(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, uuid, text, text, text, text)", "resolve_connection_use_authority(uuid, uuid, uuid, jsonb)", "inspect_organization_connection_authority_convergence(uuid, integer, uuid)", "get_self_personal_github_repository_selection(uuid, uuid, text, uuid)", "mutate_self_personal_github_repository_selection(uuid, uuid, text, uuid, bigint, bigint, text, jsonb, boolean)", "create_personal_document_authority(uuid, uuid, uuid)", "resolve_document_original_file(uuid, uuid, text, uuid)", "resolve_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid)", "list_document_authority_reclassifications(uuid, uuid, text, uuid, integer, timestamp with time zone, uuid)", "reclassify_document_authority(jsonb)", "run_document_default_collection_backfill(jsonb)", "list_document_default_collection_backfill_runs(jsonb)", "get_document_default_collection_backfill_audit(jsonb)", "list_organization_document_authority_reclassifications(jsonb)", "create_scoped_rig(uuid, uuid, text, text, text, text, jsonb, boolean)", "list_scoped_rigs(uuid, uuid, uuid, text, text)", "count_scoped_rigs(uuid, uuid, text)", "mutate_scoped_rig(uuid, uuid, uuid, text, text, boolean, text, boolean, boolean)", "finalize_scoped_enrollment(uuid, uuid, text, text, boolean, boolean, text, text, text, boolean)", "list_scoped_enrollments(uuid, uuid, uuid, text)", "get_scoped_sandbox(uuid, uuid, uuid)", "authorize_scoped_sandbox_attach(uuid, uuid, uuid)", "materialize_scoped_rig_version_for_attempt(uuid, uuid, uuid, uuid, uuid, integer)", "authorize_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "assert_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid, boolean)", "list_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "detach_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "freeze_scheduled_task_personal_resources(uuid, uuid, uuid, bigint)", "clone_scheduled_task_personal_resource_authority(uuid, uuid, uuid, bigint, bigint)", "refresh_scheduled_task_personal_resources_clone_connections(uuid, uuid, uuid, bigint, bigint)", "create_scheduled_agent_run_with_admission(uuid, uuid, uuid, uuid, bigint, text, text, text, timestamp with time zone, timestamp with time zone, jsonb)", "materialize_scheduled_task_reusable_session_from_run(uuid, uuid, uuid, uuid, uuid, bigint, text)", "scheduled_task_run_personal_resource_authority(uuid, uuid, uuid)", "scheduled_task_run_connection_authority_subject(uuid, uuid, uuid)", "scheduled_task_personal_resource_authority_subject(uuid, uuid, uuid, bigint)", "record_scheduled_task_revision_authority(uuid, uuid, uuid, bigint)", "clone_scheduled_task_revision_authority(uuid, uuid, uuid, bigint, bigint)", "scheduled_task_revision_authority_subject(uuid, uuid, uuid, bigint)", "scheduled_task_revision_authority_snapshot(uuid, uuid, uuid, bigint)", "validate_scheduled_agent_run_live_authority(uuid, uuid, uuid)", "scheduled_scoped_rig_version_metadata(uuid, uuid, text, uuid, uuid)", "scheduled_variable_set_expected_generation_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "bind_scheduled_task_run_session(uuid, uuid, uuid, uuid)", "transition_scheduled_agent_run(uuid, uuid, uuid, uuid, uuid, text, text)", "ensure_canonical_human_identity(text, text)", "validate_canonical_human_session(text, text, boolean)", "get_canonical_human_identity_projection(text)", "apply_canonical_human_identity_operation(uuid, text, bigint, text, uuid, text, text, text)", "get_canonical_human_exact_login_binding(text, text)", "managed_auth_session_set_authority_state(text)", "managed_auth_session_set_snapshot(text, text, boolean, boolean, boolean)", "managed_auth_session_set_bootstrap(text, text, text, text, uuid, text, bigint, bigint)", "managed_auth_session_set_begin_transaction(text, text, text, uuid, text, bigint, uuid, bigint, text, text, uuid, uuid, text, timestamp with time zone)", "managed_auth_session_set_complete_transaction(text, text, uuid, text, bigint, bigint, uuid, text, text, text)", "managed_auth_session_set_mutate(text, text, uuid, text, bigint, bigint, text, uuid, uuid, uuid, text, text)", "managed_auth_actor_mutation_fence(text, bigint, uuid)", "managed_auth_actor_mutation_lease_acquire(text, bigint, uuid, integer)", "managed_auth_actor_mutation_lease_release(text, uuid)", "managed_auth_actor_mutation_lease_validate(text, bigint, uuid)", "managed_auth_adopted_session_snapshot(text)", "managed_auth_isolated_session_reap(integer)", "managed_auth_expired_session_set_reap(integer)", "managed_auth_session_set_operation_receipt(text, uuid, text, text)", "get_organization_recovery_overview(uuid, text, jsonb, text, text)", "organization_recovery_command(jsonb)", "create_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, integer)", "archive_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "list_task_notes_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, boolean, integer)", "replace_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid, uuid, integer, text, text, integer, text)", "resolve_task_note_knowledge_promotion_source(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text)", "upsert_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text, text, text, text, text)", "release_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "session_private_actor_visible(uuid, uuid, uuid, text)", "session_reference_visible(uuid, uuid, uuid)", "session_visibility_lifecycle_capability_held()", "transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text, integer)", "xai_subscription_pool_visible(uuid, uuid, text, text, uuid)", "resolve_xai_authority_pool(uuid, uuid, text, jsonb)", "revalidate_xai_subscription_authority(uuid, text, uuid, jsonb)", "xai_provider_account_authority_snapshot_v1_valid(jsonb)"];
4
+ export declare const RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES: readonly ["knowledge_index_claim(text, integer, integer)", "knowledge_index_work(uuid, uuid, uuid, jsonb)", "knowledge_entry_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_confirm_legacy(uuid, uuid, jsonb, jsonb)", "agent_instruction_apply(uuid, uuid, jsonb, jsonb)", "knowledge_entry_read(uuid, uuid, jsonb, jsonb)", "knowledge_entry_prepare_file(uuid, uuid, jsonb, jsonb)", "knowledge_document_prepare(uuid, uuid, uuid, jsonb)", "agent_learning_manage(uuid, uuid, jsonb, jsonb)", "mcp_operation_command(jsonb, text, jsonb)", "skill_apply_lifecycle(uuid, uuid, jsonb, jsonb)", "company_brain_inspect_context_receipts(uuid, uuid, text, uuid, timestamp with time zone, uuid, integer)", "company_brain_context_get_or_create_selection(uuid, uuid, uuid, uuid, uuid, integer)", "propose_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, text)", "propose_company_profile_for_attempt_v2(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, text, text, text)", "confirm_company_profile_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid)", "get_company_profile_agent_policy(uuid, uuid, text)", "update_company_profile_agent_policy(uuid, uuid, text, text, bigint, uuid)", "undo_governed_learning_activation(uuid, uuid, uuid, uuid)", "inspect_governed_learning_decisions(uuid, uuid, text, integer)", "inspect_governed_learning_activations(uuid, uuid, text, integer)", "inspect_governed_learning_activation_undos(uuid, uuid, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer, uuid)", "fork_session_content(uuid, uuid, uuid, text, uuid, text, text, text, integer)", "replay_applied_session_fork(uuid, uuid, uuid, text, uuid, text, boolean, text, text, integer)", "session_tenancy_product_activated(uuid, integer)", "session_tenancy_any_product_activation()", "xai_subscription_authority_live(uuid, uuid, text, uuid, text, uuid, uuid, bigint)", "create_xai_subscription_credential(uuid, uuid, text, text, text, text, text, text, text, timestamp with time zone)", "disconnect_xai_subscription_credential(uuid, uuid, text, uuid, jsonb)", "google_drive_document_citation(uuid, uuid, text, uuid, uuid)", "google_drive_file_authorized(uuid, uuid, text, uuid)", "knowledge_source_sync_lock_authority(uuid, uuid, uuid)", "ensure_managed_human_personal_workspace(uuid, text, uuid)", "get_external_identity_link_reference(uuid, uuid, text)", "get_external_identity_link_inventory_references(uuid, uuid[])", "ensure_external_identity(uuid, text, text)", "lookup_external_identity(uuid, text, text, text)", "prepare_external_workspace_membership_operation(jsonb)", "record_external_workspace_membership_operation(jsonb, jsonb)", "list_self_organization_memberships(text)", "list_self_organization_invitations(text)", "list_self_organization_invitations(text, uuid, integer)", "get_self_organization_invitation(text, uuid)", "list_organization_invitations(uuid, text, uuid, integer)", "list_organization_members(uuid, text)", "list_organization_administration_members(uuid, text)", "get_organization_administration_overview(uuid, text)", "get_workspace_kind(uuid, uuid)", "resolve_workspace_codex_subscription_source(uuid, uuid)", "capture_legacy_codex_turn_sources(uuid, uuid)", "list_organization_workspace_ids(uuid)", "list_organization_codex_workspace_ids(uuid)", "organization_workspace_command(jsonb)", "authorize_organization_shared_workspace_administration(uuid, uuid, text)", "resolve_organization_workspace_removal_subject(uuid, text, uuid)", "prepare_organization_workspace_member_removal(jsonb)", "record_organization_workspace_member_removal(jsonb, uuid, uuid)", "create_additional_managed_organization(text, text, text, text, uuid)", "create_managed_organization(text, text, text, uuid)", "assert_organization_shared_workspace_administrator(uuid, uuid, text)", "open_organization_shared_workspace_administration_capability(uuid, uuid, text)", "close_organization_shared_workspace_administration_capability(uuid)", "create_organization_shared_workspace(uuid, text, text, text, text, uuid)", "upsert_organization_shared_workspace_member(uuid, uuid, text, uuid, text, text, jsonb, boolean)", "update_organization_name(uuid, text, text, timestamp with time zone, uuid)", "create_organization_invitation_v2(jsonb)", "bind_pending_organization_invitations_for_verified_email(text, text)", "has_pending_organization_invitation_for_subject(text)", "accept_organization_invitation_v2(jsonb)", "complete_self_service_organization_setup(jsonb)", "ensure_organization_user_setup_intent(jsonb)", "claim_organization_user_setup_delivery(jsonb)", "claim_organization_user_setup_delivery_v2(jsonb)", "prepare_organization_user_setup_delivery(jsonb)", "prepare_organization_user_setup_delivery_v2(jsonb)", "settle_organization_user_setup_delivery(jsonb)", "preview_organization_user_setup(text)", "get_organization_invitation_for_administration(uuid, text, uuid)", "preflight_organization_user_setup(text)", "complete_organization_user_setup(jsonb)", "organization_membership_command(jsonb)", "prepare_organization_membership_protocol_settlements(jsonb)", "assert_active_managed_human_organization_membership(uuid, text)", "resolve_workspace_writer_grant_identity(uuid, text)", "prepare_workspace_membership_removal_settlements(jsonb)", "workspace_membership_removal_command(jsonb)", "get_organization_retention_policy(uuid, text)", "preview_organization_retention_deletions(uuid, integer)", "claim_organization_retention_deletion(uuid, uuid, uuid[])", "list_organization_retention_deletion_objects(uuid, uuid, uuid, text, integer)", "record_organization_retention_object_deleted(uuid, uuid, uuid, text, text, text, text)", "fail_organization_retention_deletion(uuid, uuid, uuid, text)", "finalize_organization_retention_deletion(uuid, uuid, uuid, text)", "complete_organization_retention_deletion(uuid, uuid, uuid, text)", ...string[], "open_private_session_create_capability(uuid, uuid, uuid, text)", "open_private_child_session_create_capability(uuid, uuid, uuid, uuid, uuid, uuid, integer)", "close_private_session_create_capability(uuid)", "resolve_session_attempt_personal_resources(uuid, uuid, uuid)", "list_owned_connection_accounts(uuid, uuid)", "accept_turn_personal_resource_attachment(uuid, uuid, uuid, uuid, text, integer, boolean, integer)", "list_self_user_resource_authorities(uuid, uuid, text, uuid, integer)", "issue_self_user_resource_grant(uuid, uuid, uuid, text, text, text, uuid, integer, boolean)", "revoke_self_user_resource_grant(uuid, uuid, uuid)", "authorize_session_attempt_personal_resource_reads(uuid, uuid, uuid)", "preference_registry_create_knowledge_proposal_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, uuid, text, text, text, text, integer, text, jsonb, timestamp with time zone, text)", "create_scoped_variable_set(uuid, uuid, text, text, text, jsonb, boolean)", "list_scoped_variable_sets(uuid, uuid, uuid, text, text)", "count_scoped_variable_sets(uuid, uuid, text)", "mutate_scoped_variable_set(uuid, uuid, uuid, text, text, boolean, text, boolean, text, text, boolean)", "read_scoped_variable_set_secret(uuid, uuid, uuid, text, text, text, uuid, uuid, uuid, integer)", "materialize_scoped_variable_set_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "materialize_scoped_variable_set_for_session(uuid, uuid, uuid, uuid)", "connection_authority_convergence_audit_capability_active(uuid)", "resolve_accepted_connection_use(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, uuid, text, text, text, text)", "inspect_organization_connection_authority_convergence(uuid, integer, uuid)", "get_self_personal_github_repository_selection(uuid, uuid, text, uuid)", "mutate_self_personal_github_repository_selection(uuid, uuid, text, uuid, bigint, bigint, text, jsonb, boolean)", "create_personal_document_authority(uuid, uuid, uuid)", "resolve_document_original_file(uuid, uuid, text, uuid)", "resolve_session_attempt_personal_document_reads(uuid, uuid, uuid, uuid)", "list_document_authority_reclassifications(uuid, uuid, text, uuid, integer, timestamp with time zone, uuid)", "reclassify_document_authority(jsonb)", "run_document_default_collection_backfill(jsonb)", "list_document_default_collection_backfill_runs(jsonb)", "get_document_default_collection_backfill_audit(jsonb)", "list_organization_document_authority_reclassifications(jsonb)", "create_scoped_rig(uuid, uuid, text, text, text, text, jsonb, boolean)", "list_scoped_rigs(uuid, uuid, uuid, text, text)", "count_scoped_rigs(uuid, uuid, text)", "mutate_scoped_rig(uuid, uuid, uuid, text, text, boolean, text, boolean, boolean)", "finalize_scoped_enrollment(uuid, uuid, text, text, boolean, boolean, text, text, text, boolean)", "list_scoped_enrollments(uuid, uuid, uuid, text)", "get_scoped_sandbox(uuid, uuid, uuid)", "authorize_scoped_sandbox_attach(uuid, uuid, uuid)", "materialize_scoped_rig_version_for_attempt(uuid, uuid, uuid, uuid, uuid, integer)", "authorize_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "assert_session_attempt_personal_machine(uuid, uuid, uuid, uuid, uuid, integer, uuid, boolean)", "list_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "detach_scoped_machine_dependent_sessions(uuid, uuid, uuid)", "freeze_scheduled_task_personal_resources(uuid, uuid, uuid, bigint)", "clone_scheduled_task_personal_resource_authority(uuid, uuid, uuid, bigint, bigint)", "create_scheduled_agent_run_with_admission(uuid, uuid, uuid, uuid, bigint, text, text, text, timestamp with time zone, timestamp with time zone, jsonb)", "materialize_scheduled_task_reusable_session_from_run(uuid, uuid, uuid, uuid, uuid, bigint, text)", "scheduled_task_run_personal_resource_authority(uuid, uuid, uuid)", "scheduled_task_run_connection_authority_subject(uuid, uuid, uuid)", "scheduled_task_personal_resource_authority_subject(uuid, uuid, uuid, bigint)", "record_scheduled_task_revision_authority(uuid, uuid, uuid, bigint)", "clone_scheduled_task_revision_authority(uuid, uuid, uuid, bigint, bigint)", "scheduled_task_revision_authority_subject(uuid, uuid, uuid, bigint)", "scheduled_task_revision_authority_snapshot(uuid, uuid, uuid, bigint)", "validate_scheduled_agent_run_live_authority(uuid, uuid, uuid)", "scheduled_scoped_rig_version_metadata(uuid, uuid, text, uuid, uuid)", "scheduled_variable_set_expected_generation_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid)", "bind_scheduled_task_run_session(uuid, uuid, uuid, uuid)", "transition_scheduled_agent_run(uuid, uuid, uuid, uuid, uuid, text, text)", "mutate_managed_sign_in_method(text, text, jsonb)", "assert_managed_sign_in_recovery(text, text, uuid, jsonb)", "replay_managed_sign_in_method(text, text, jsonb)", "claim_managed_sign_in_notification(uuid, text, text, integer)", "settle_managed_sign_in_notification(uuid, uuid, text)", "ensure_canonical_human_identity(text, text)", "validate_canonical_human_session(text, text, boolean)", "get_canonical_human_identity_projection(text)", "apply_canonical_human_identity_operation(uuid, text, bigint, text, uuid, text, text, text)", "get_canonical_human_exact_login_binding(text, text)", "managed_auth_session_set_authority_state(text)", "managed_auth_session_set_snapshot(text, text, boolean, boolean, boolean)", "managed_auth_session_set_bootstrap(text, text, text, text, uuid, text, bigint, bigint)", "managed_auth_session_set_begin_transaction(text, text, text, uuid, text, bigint, uuid, bigint, text, text, uuid, uuid, text, timestamp with time zone)", "managed_auth_session_set_complete_transaction(text, text, uuid, text, bigint, bigint, uuid, text, text, text)", "managed_auth_session_set_mutate(text, text, uuid, text, bigint, bigint, text, uuid, uuid, uuid, text, text)", "managed_auth_actor_mutation_fence(text, bigint, uuid)", "managed_auth_actor_mutation_lease_acquire(text, bigint, uuid, integer)", "managed_auth_actor_mutation_lease_release(text, uuid)", "managed_auth_actor_mutation_lease_validate(text, bigint, uuid)", "managed_auth_adopted_session_snapshot(text)", "managed_auth_isolated_session_reap(integer)", "managed_auth_expired_session_set_reap(integer)", "managed_auth_session_set_operation_receipt(text, uuid, text, text)", "get_organization_recovery_overview(uuid, text, jsonb, text, text)", "organization_recovery_command(jsonb)", "create_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, text, text, integer)", "archive_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "list_task_notes_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, boolean, integer)", "replace_task_note_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, uuid, uuid, integer, text, text, integer, text)", "resolve_task_note_knowledge_promotion_source(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text)", "upsert_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, integer, text, text, text, text, text, text, text)", "release_session_work_claim_for_attempt(uuid, uuid, uuid, uuid, uuid, integer, uuid, uuid, integer, text)", "session_private_actor_visible(uuid, uuid, uuid, text)", "session_reference_visible(uuid, uuid, uuid)", "session_visibility_lifecycle_capability_held()", "transition_session_visibility(uuid, uuid, uuid, text, text, integer, text, text, integer)", "xai_subscription_pool_visible(uuid, uuid, text, text, uuid)", "resolve_xai_authority_pool(uuid, uuid, text, jsonb)", "revalidate_xai_subscription_authority(uuid, text, uuid, jsonb)", "xai_provider_account_authority_snapshot_v1_valid(jsonb)"];
5
5
  /**
6
6
  * Boolean-only predicates that shared-table RLS policies must be able to
7
7
  * evaluate under table owners and SECURITY DEFINER roles unknown at migration
@@ -17,7 +17,7 @@ export declare const RUNTIME_TARGET_SCHEMA_INVOKER_ROUTINES: readonly ["resolve_
17
17
  * FORCE-RLS table is an architectural change: update this list in the same
18
18
  * commit as the migration so startup cannot silently accept an unreviewed gap.
19
19
  */
20
- export declare const FORCE_RLS_TABLES: readonly ["additional_organization_creation_receipts", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "agent_run_states", "api_keys", "attached_browser_devices", "attached_browser_inventories", "audit_events", "auth_runs", "automation_run_event_links", "automation_runs", "automation_sources", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "billing_customers", "browser_identities", "browser_revision_components", "browser_revisions", "browser_session_associations", "browser_sessions", "browser_state_artifacts", "browser_state_uploads", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "capability_api_facets", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_facets", "capability_installations", "capability_integration_facets", "capability_mcp_facets", "capability_operations", "capability_plugin_installations", "capability_plugin_versions", "capability_plugins", "capability_skill_facets", "capability_skill_files", "channels", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_activation_events", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "company_profile_heads", "company_profile_revisions", "company_profile_snapshots", "composer_drafts", "computer_session_associations", "computer_sessions", "connect_attempts", "connection_disconnect_operations", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_authority_reclassifications", "document_bases", "document_chunks", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "documents", "editable_artifact_blob_refs", "editable_artifact_idempotency_receipts", "editable_artifact_live_outbox", "editable_artifact_live_tickets", "editable_artifact_materialization_jobs", "editable_artifact_materialization_results", "editable_artifact_operations", "editable_artifact_replica_leases", "editable_artifact_scope_authorization_heads", "editable_artifact_sequence_checkpoints", "editable_artifact_session_links", "editable_artifact_snapshots", "editable_artifact_transactions", "editable_artifact_undo_claims", "editable_artifact_versions", "editable_artifacts", "enrollments", "external_identities", "external_identity_links", "external_link_task_authorities", "external_link_turn_authorities", "feedback_submissions", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installations", "google_drive_object_acl_evidence", "google_drive_object_acl_principals", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "host_mcp_bindings", "host_mcp_delegations", "host_mcp_resolver_operations", "host_mcp_resolvers", "host_mcp_task_authorities", "host_mcp_turn_authorities", "image_generation_operations", "import_batches", "integration_facet_binding_owners", "integration_facet_bindings", "integration_facet_definitions", "integration_oauth_state_nonces", "integration_spec_revisions", "integration_tools", "interaction_interventions", "interaction_operations", "interaction_resource_operations", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_facts", "knowledge_index_jobs", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "knowledge_operation_receipts", "knowledge_providers", "knowledge_review_batches", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_source_sync_index_obligations", "knowledge_source_sync_item_outcomes", "knowledge_source_sync_object_observations", "knowledge_source_sync_states", "knowledge_source_sync_wakes", "knowledge_sources", "knowledge_sync_runs", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "mcp_operations", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_facts", "network_routes", "new_session_drafts", "organization_codex_rotation_settings", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_invitation_binding_events", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_shared_workspace_administration_capabilities", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "pack_installation_components", "pack_installations", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "pr_review_app_registrations", "pr_review_managed_github_authority_nonces", "pr_review_repository_bindings", "preference_registry_events", "preference_registry_preferences", "preference_registry_revisions", "preference_registry_snapshots", "private_session_create_capabilities", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_connection_authority_snapshots", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "scheduled_task_runs", "scheduled_tasks", "self_service_organization_setup_receipts", "session_attempt_codemode_calls", "session_attempt_connected_machine_authorizations", "session_attempt_interruptions", "session_attempt_model_context_snapshots", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_attempt_tool_catalogs", "session_background_commands", "session_command_receipts", "session_event_cursors", "session_events", "session_goal_revisions", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_spawn_denials", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_tenancy_activations", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_turn_attempts", "session_turn_startup_milestones", "session_turns", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "session_work_claims", "session_workflow_wake_outbox", "sessions", "site_auth_connections", "skill_config_conversion_receipts", "skill_source_bindings", "skill_write_receipts", "slack_app_home_refreshes", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_installation_bindings", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_shared_task_origins", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "slack_user_dm_routes", "slack_user_link_access_request_operations", "slack_user_link_access_requests", "social_connections", "social_posts", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "temporal_schedule_cleanup_outbox", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "usage_events", "video_generation_operations", "video_generation_references", "workspace_artifact_events", "workspace_artifact_uploads", "workspace_artifact_versions", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_heads", "workspace_instruction_policy_onboarding_proposals", "workspace_instruction_policy_revisions", "workspace_instruction_policy_snapshots", "workspace_interaction_revisions", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots", "workspace_model_policies", "workspace_packs", "workspace_screenshot_quotas", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets", "workspace_video_generation_policies", "workspace_video_generation_quotas", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"];
20
+ export declare const FORCE_RLS_TABLES: readonly ["additional_organization_creation_receipts", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "agent_run_states", "api_keys", "attached_browser_devices", "attached_browser_inventories", "audit_events", "auth_runs", "automation_run_event_links", "automation_runs", "automation_sources", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "billing_customers", "browser_identities", "browser_revision_components", "browser_revisions", "browser_session_associations", "browser_sessions", "browser_state_artifacts", "browser_state_uploads", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "capability_api_facets", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_facets", "capability_installations", "capability_integration_facets", "capability_mcp_facets", "capability_operations", "capability_plugin_installations", "capability_plugin_versions", "capability_plugins", "capability_skill_facets", "capability_skill_files", "channels", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "codex_turn_source_bindings", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_activation_events", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "company_profile_heads", "company_profile_revisions", "company_profile_snapshots", "composer_drafts", "computer_session_associations", "computer_sessions", "connect_attempts", "connection_disconnect_operations", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_authority_reclassifications", "document_bases", "document_chunks", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "documents", "editable_artifact_blob_refs", "editable_artifact_idempotency_receipts", "editable_artifact_live_outbox", "editable_artifact_live_tickets", "editable_artifact_materialization_jobs", "editable_artifact_materialization_results", "editable_artifact_operations", "editable_artifact_replica_leases", "editable_artifact_scope_authorization_heads", "editable_artifact_sequence_checkpoints", "editable_artifact_session_links", "editable_artifact_snapshots", "editable_artifact_transactions", "editable_artifact_undo_claims", "editable_artifact_versions", "editable_artifacts", "enrollments", "external_identities", "external_identity_links", "external_link_task_authorities", "external_link_turn_authorities", "feedback_submissions", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installations", "google_drive_object_acl_evidence", "google_drive_object_acl_principals", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "host_mcp_bindings", "host_mcp_delegations", "host_mcp_resolver_operations", "host_mcp_resolvers", "host_mcp_task_authorities", "host_mcp_turn_authorities", "image_generation_operations", "import_batches", "integration_facet_binding_owners", "integration_facet_bindings", "integration_facet_definitions", "integration_oauth_state_nonces", "integration_spec_revisions", "integration_tools", "interaction_interventions", "interaction_operations", "interaction_resource_operations", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_facts", "knowledge_index_jobs", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "knowledge_operation_receipts", "knowledge_providers", "knowledge_review_batches", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_source_sync_index_obligations", "knowledge_source_sync_item_outcomes", "knowledge_source_sync_object_observations", "knowledge_source_sync_states", "knowledge_source_sync_wakes", "knowledge_sources", "knowledge_sync_runs", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "managed_sign_in_method_operations", "mcp_operations", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_facts", "network_routes", "new_session_drafts", "organization_codex_rotation_settings", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_integration_policies", "organization_integration_policy_operations", "organization_invitation_binding_events", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_shared_workspace_administration_capabilities", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "pr_review_app_registrations", "pr_review_managed_github_authority_nonces", "pr_review_repository_bindings", "preference_registry_events", "preference_registry_preferences", "preference_registry_revisions", "preference_registry_snapshots", "private_session_create_capabilities", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_connection_authority_snapshots", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "scheduled_task_runs", "scheduled_tasks", "self_service_organization_setup_receipts", "session_attempt_codemode_calls", "session_attempt_connected_machine_authorizations", "session_attempt_interruptions", "session_attempt_model_context_snapshots", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_attempt_tool_catalogs", "session_background_commands", "session_command_receipts", "session_event_cursors", "session_events", "session_goal_revisions", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_spawn_denials", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_tenancy_activations", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_turn_attempts", "session_turn_startup_milestones", "session_turns", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "session_work_claims", "session_workflow_wake_outbox", "sessions", "site_auth_connections", "skill_config_conversion_receipts", "skill_source_bindings", "skill_write_receipts", "slack_app_home_refreshes", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_installation_bindings", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_shared_task_origins", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "slack_user_dm_routes", "slack_user_link_access_request_operations", "slack_user_link_access_requests", "social_connections", "social_posts", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "temporal_schedule_cleanup_outbox", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "usage_events", "video_generation_operations", "video_generation_references", "workspace_artifact_events", "workspace_artifact_uploads", "workspace_artifact_versions", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_heads", "workspace_instruction_policy_onboarding_proposals", "workspace_instruction_policy_revisions", "workspace_instruction_policy_snapshots", "workspace_interaction_revisions", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots", "workspace_model_policies", "workspace_screenshot_quotas", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets", "workspace_video_generation_policies", "workspace_video_generation_quotas", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"];
21
21
  /**
22
22
  * Deployment-global and authentication tables used by ordinary API/worker
23
23
  * traffic. They intentionally do not carry workspace RLS: their access model
@@ -29,9 +29,9 @@ export declare const NON_RLS_RUNTIME_TABLES: readonly ["auth_identities", "auth_
29
29
  * explicit instead of being derived from FORCE_RLS_TABLES: adding a protected
30
30
  * table must not silently grant it broader DML than its migration intended.
31
31
  */
32
- export declare const RUNTIME_FULL_DML_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "auth_identities", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "automation_run_event_links", "automation_runs", "automation_sources", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "automation_webhook_endpoints", "billing_customers", "browser_session_associations", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_installations", "capability_operations", "capability_plugin_installations", "channels", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "computer_session_associations", "connect_attempts", "connection_disconnect_operations", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "editable_artifact_replica_leases", "enrollments", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installations", "host_mcp_bindings", "host_mcp_delegations", "image_generation_operations", "import_batches", "integration_facet_binding_owners", "integration_facet_bindings", "integration_oauth_clients", "integration_oauth_state_nonces", "knowledge_source_sync_index_obligations", "knowledge_source_sync_item_outcomes", "knowledge_source_sync_object_observations", "knowledge_source_sync_states", "knowledge_source_sync_wakes", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_accounts", "mcp_oauth_access_tokens", "mcp_oauth_authorization_codes", "mcp_oauth_authorization_requests", "mcp_oauth_clients", "mcp_oauth_refresh_tokens", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_facts", "new_session_drafts", "organization_codex_rotation_settings", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "pack_installation_components", "pack_installations", "pr_review_app_registrations", "pr_review_managed_github_routes", "pr_review_repository_bindings", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "session_attempt_interruptions", "session_background_commands", "session_command_receipts", "session_event_cursors", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_app_home_refreshes", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_user_dm_routes", "social_connections", "social_posts", "stripe_webhook_events", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "usage_events", "video_generation_operations", "video_generation_references", "workspace_artifact_uploads", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_heads", "workspace_memberships", "workspace_model_policies", "workspace_packs", "workspace_screenshot_quotas", "workspace_video_generation_policies", "workspace_video_generation_quotas", "workspaces", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"];
32
+ export declare const RUNTIME_FULL_DML_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "auth_identities", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "automation_run_event_links", "automation_runs", "automation_sources", "automation_trigger_events", "automation_trigger_revisions", "automation_triggers", "automation_webhook_endpoints", "billing_customers", "browser_session_associations", "capability_catalog_items", "capability_component_owners", "capability_facet_installations", "capability_installations", "capability_operations", "capability_plugin_installations", "channels", "codex_apps_settings", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "computer_session_associations", "connect_attempts", "connection_disconnect_operations", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "editable_artifact_replica_leases", "enrollments", "file_uploads", "files", "generated_image_artifacts", "generated_video_artifacts", "github_installation_repositories", "github_installations", "host_mcp_bindings", "host_mcp_delegations", "image_generation_operations", "import_batches", "integration_facet_binding_owners", "integration_facet_bindings", "integration_oauth_clients", "integration_oauth_state_nonces", "knowledge_source_sync_index_obligations", "knowledge_source_sync_item_outcomes", "knowledge_source_sync_object_observations", "knowledge_source_sync_states", "knowledge_source_sync_wakes", "machine_metrics_latest", "machine_metrics_series", "machine_removal_operations", "managed_accounts", "mcp_oauth_access_tokens", "mcp_oauth_authorization_codes", "mcp_oauth_authorization_requests", "mcp_oauth_clients", "mcp_oauth_refresh_tokens", "memory_slack_publication_configurations", "memory_slack_publication_receipts", "memory_slack_publications", "model_call_facts", "new_session_drafts", "organization_codex_rotation_settings", "organization_model_provider_connection_operations", "organization_model_provider_connections", "organization_model_provider_custom_models", "pr_review_app_registrations", "pr_review_managed_github_routes", "pr_review_repository_bindings", "retained_screenshot_artifacts", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "session_attempt_interruptions", "session_background_commands", "session_command_receipts", "session_event_cursors", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_app_home_refreshes", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_update_operations", "slack_bot_user_links", "slack_channel_routes", "slack_interaction_action_handles", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "slack_route_prompt_options", "slack_route_prompts", "slack_user_dm_routes", "social_connections", "social_posts", "stripe_webhook_events", "tool_gateway_approval_capabilities", "transcription_recording_chunks", "transcription_recording_objects", "transcription_recording_segments", "transcription_recordings", "usage_events", "video_generation_operations", "video_generation_references", "workspace_artifact_uploads", "workspace_artifacts", "workspace_captures", "workspace_codex_subscription_preferences", "workspace_control_events", "workspace_gateway_custom_models", "workspace_inference_controls", "workspace_instruction_policy_heads", "workspace_memberships", "workspace_model_policies", "workspace_screenshot_quotas", "workspace_video_generation_policies", "workspace_video_generation_quotas", "workspaces", "xai_capacity_waiters", "xai_credential_leases", "xai_rotation_settings", "xai_session_account_pins", "xai_subscription_credentials"];
33
33
  /** Configuration and lifecycle-owned audit rows are read-only at runtime. */
34
- export declare const RUNTIME_READ_ONLY_TABLES: readonly ["company_profile_activation_events", "company_profile_heads", "company_profile_snapshots", "deployment_model_catalog", "document_authority_reclassifications", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "nested_agent_depth_configuration", "preference_registry_events", "preference_registry_snapshots", "session_tenancy_activations", "session_work_claims", "skill_source_bindings", "skill_write_receipts", "slack_installation_bindings", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_snapshots", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots"];
34
+ export declare const RUNTIME_READ_ONLY_TABLES: readonly ["codex_turn_source_bindings", "company_profile_activation_events", "company_profile_heads", "company_profile_snapshots", "deployment_model_catalog", "document_authority_reclassifications", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "nested_agent_depth_configuration", "organization_integration_policies", "organization_integration_policy_operations", "preference_registry_events", "preference_registry_snapshots", "session_tenancy_activations", "session_work_claims", "skill_source_bindings", "skill_write_receipts", "slack_installation_bindings", "slack_task_policy_activation_events", "slack_task_policy_heads", "slack_task_policy_revisions", "workspace_instruction_policy_deactivation_events", "workspace_instruction_policy_snapshots", "workspace_learning_policy_activation_events", "workspace_learning_policy_heads", "workspace_learning_policy_revisions", "workspace_learning_policy_snapshots"];
35
35
  /** Existing runtime authorities that may be observed and advanced, never created or deleted. */
36
36
  export declare const RUNTIME_READ_UPDATE_TABLES: readonly ["workspace_session_activity_revisions"];
37
37
  /** Append-only evidence/revision tables are insertable and queryable, never mutable. */
@@ -42,7 +42,7 @@ export declare const RUNTIME_READ_INSERT_UPDATE_TABLES: readonly ["attached_brow
42
42
  * These FORCE-RLS tables are owned by security-definer host-export routines.
43
43
  * The ordinary application role must have no direct table privileges on them.
44
44
  */
45
- export declare const PROTECTED_NO_DIRECT_DML_TABLES: readonly ["additional_organization_creation_receipts", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "editable_artifact_live_tickets", "editable_artifact_scope_authorization_heads", "external_identities", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_index_jobs", "knowledge_review_batches", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "mcp_operations", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_invitation_binding_events", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_shared_workspace_administration_capabilities", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "private_session_create_capabilities", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "scheduled_task_connection_authority_snapshots", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "self_service_organization_setup_receipts", "session_attempt_connected_machine_authorizations", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "skill_config_conversion_receipts", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "workspace_variable_set_variables", "workspace_variable_sets"];
45
+ export declare const PROTECTED_NO_DIRECT_DML_TABLES: readonly ["additional_organization_creation_receipts", "agent_instruction_operations", "agent_learning_revisions", "agent_learning_snapshots", "canonical_human_identities", "canonical_human_identity_operations", "canonical_human_identity_subjects", "canonical_human_login_bindings", "company_brain_context_selection_receipts", "company_brain_preference_proposal_receipts", "company_brain_turn_context_snapshots", "company_profile_agent_automatic_activation_receipts", "company_profile_agent_confirmation_receipts", "company_profile_agent_proposal_receipts", "connection_use_audit_facts", "connection_use_once_consumption_receipts", "document_default_collection_backfill_operations", "document_default_collection_backfill_receipts", "document_default_collection_backfill_runs", "editable_artifact_live_tickets", "editable_artifact_scope_authorization_heads", "external_identities", "governed_learning_activation_receipts", "governed_learning_activation_undo_receipts", "governed_learning_decision_receipts", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "knowledge_entries", "knowledge_entry_decisions", "knowledge_entry_links", "knowledge_entry_operations", "knowledge_entry_revisions", "knowledge_entry_search", "knowledge_entry_vectors", "knowledge_index_jobs", "knowledge_review_batches", "managed_auth_actor_mutation_leases", "managed_auth_browser_installations", "managed_auth_login_return_intents", "managed_auth_login_slots", "managed_auth_login_transaction_rate_limits", "managed_auth_login_transactions", "managed_auth_session_set_operations", "managed_auth_session_sets", "managed_sign_in_method_operations", "mcp_operations", "organization_company_profile_agent_policies", "organization_company_profile_agent_policy_events", "organization_invitation_binding_events", "organization_membership_invitations", "organization_membership_lifecycle_events", "organization_membership_operation_receipts", "organization_memberships", "organization_private_session_setting_events", "organization_private_session_settings", "organization_profile_events", "organization_recovery_approvals", "organization_recovery_command_receipts", "organization_recovery_custodian_acceptances", "organization_recovery_custodians", "organization_recovery_events", "organization_recovery_notification_attempts", "organization_recovery_notification_outbox", "organization_recovery_operations", "organization_recovery_policies", "organization_recovery_policy_heads", "organization_shared_workspace_administration_capabilities", "organization_user_resource_authorities", "organization_user_resource_grants", "organization_user_retention_deletion_events", "organization_user_retention_deletions", "organization_user_retention_object_deletion_receipts", "organization_user_retention_object_obligations", "organization_user_retention_policies", "organization_user_setup_deliveries", "organization_user_setup_delivery_attempts", "organization_user_setup_intents", "organization_workspace_lifecycle_events", "organization_workspace_operation_receipts", "personal_document_once_consumption_receipts", "personal_github_repository_selection_heads", "personal_github_repository_selection_operations", "personal_github_repository_selections", "personal_resource_once_consumption_receipts", "private_session_create_capabilities", "remember_knowledge_confirmation_receipts", "remember_knowledge_memory_materializations", "scheduled_task_connection_authority_snapshots", "scheduled_task_personal_resource_authorities", "scheduled_task_personal_resource_snapshots", "scheduled_task_reusable_connection_materializations", "scheduled_task_revision_authorities", "scheduled_task_run_connection_authority_snapshots", "scheduled_task_run_personal_resource_admissions", "scheduled_task_run_personal_resource_once_receipts", "scheduled_task_run_personal_resource_snapshots", "self_service_organization_setup_receipts", "session_attempt_connected_machine_authorizations", "session_attempt_personal_document_admissions", "session_attempt_personal_document_snapshots", "session_attempt_personal_resource_admissions", "session_attempt_personal_resource_snapshots", "session_tenancy_additional_organization_activation_evidence", "session_tenancy_greenfield_activation_evidence", "session_variable_set_attachments", "session_visibility_write_capabilities", "session_work_claim_revisions", "session_work_claim_write_capabilities", "skill_config_conversion_receipts", "task_note_events", "task_note_knowledge_promotion_capabilities", "task_note_replacement_receipts", "task_note_write_capabilities", "task_notes", "tenancy_backfill_receipts", "tenancy_backfill_unresolved_rows", "turn_connection_authority_snapshots", "turn_personal_resource_attachment_receipts", "turn_personal_resource_once_receipts", "turn_personal_resource_snapshots", "workspace_variable_set_variables", "workspace_variable_sets"];
46
46
  export type RuntimeTableDmlPrivilege = "SELECT" | "INSERT" | "UPDATE" | "DELETE";
47
47
  export type RuntimeTablePrivilegeContract = Readonly<Record<string, readonly RuntimeTableDmlPrivilege[]>>;
48
48
  /** Exact per-table DML contract. Absence means no direct table privileges. */
@@ -139,6 +139,8 @@ export declare class RuntimeDatabasePostureError extends Error {
139
139
  readonly violations: readonly string[];
140
140
  constructor(violations: readonly string[]);
141
141
  }
142
+ /** Posture/configuration mismatches cannot heal through connection backoff. */
143
+ export declare function isRetryableRuntimeDatabaseStartupError(error: unknown): boolean;
142
144
  /** Inspect PostgreSQL catalogs plus one value-free global activation predicate; no tenant content. */
143
145
  export declare function inspectRuntimeDatabasePosture(db: Database, options: RuntimeDatabasePostureOptions): Promise<RuntimeDatabasePosture>;
144
146
  /** Pure deterministic evaluator used by startup/readiness and unit tests. */