@opengeni/core 0.28.0 → 1.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 (224) hide show
  1. package/README.md +1 -1
  2. package/dist/access/external-actor-authority.d.ts +47 -0
  3. package/dist/access/index.d.ts +182 -3
  4. package/dist/access/service-initiator.d.ts +3 -0
  5. package/dist/application/api-integration-servers.d.ts +20 -0
  6. package/dist/application/archived-session-imports.d.ts +6 -0
  7. package/dist/application/composer-submit.d.ts +24 -0
  8. package/dist/application/connect-authority.d.ts +13 -0
  9. package/dist/application/connect-operation.d.ts +31 -0
  10. package/dist/application/external-continuation.d.ts +15 -0
  11. package/dist/application/external-identity-lifecycle.d.ts +20 -0
  12. package/dist/application/external-link-work-admission.d.ts +12 -0
  13. package/dist/application/external-workspace-members.d.ts +34 -0
  14. package/dist/application/modal-native-worker-host-transport.d.ts +297 -0
  15. package/dist/application/new-session-drafts.d.ts +39 -2
  16. package/dist/application/sandbox-recovery.d.ts +58 -0
  17. package/dist/application/session-commands.d.ts +26 -13
  18. package/dist/application/session-mcp-credential-rotation.d.ts +29 -0
  19. package/dist/application/session-tenancy.d.ts +19 -0
  20. package/dist/application/user-resource-grants.d.ts +20 -0
  21. package/dist/billing/limits.d.ts +11 -0
  22. package/dist/canonical-human-identities.d.ts +7 -2
  23. package/dist/canonical-human-identities.js +17 -4
  24. package/dist/canonical-human-identities.js.map +1 -1
  25. package/dist/{chunk-6WKPWE5S.js → chunk-2MKMRGSY.js} +108 -24
  26. package/dist/chunk-2MKMRGSY.js.map +1 -0
  27. package/dist/{chunk-NYPMQ7NO.js → chunk-GVO3N37G.js} +205 -37
  28. package/dist/chunk-GVO3N37G.js.map +1 -0
  29. package/dist/{chunk-JJU6I5XD.js → chunk-LCQXNR62.js} +36 -10
  30. package/dist/chunk-LCQXNR62.js.map +1 -0
  31. package/dist/chunk-MM6N7CTO.js +387 -0
  32. package/dist/chunk-MM6N7CTO.js.map +1 -0
  33. package/dist/chunk-QO5GVFFO.js +235 -0
  34. package/dist/chunk-QO5GVFFO.js.map +1 -0
  35. package/dist/codex-model-availability.d.ts +14 -0
  36. package/dist/default-session-model.d.ts +139 -0
  37. package/dist/dependencies.d.ts +87 -4
  38. package/dist/developer-setup-credential-ceiling.d.ts +10 -0
  39. package/dist/domain/agent-config-resolution.d.ts +49 -0
  40. package/dist/domain/automations.d.ts +58 -0
  41. package/dist/domain/capabilities.d.ts +22 -4
  42. package/dist/domain/company-profile-agent-admin.d.ts +25 -0
  43. package/dist/domain/connection-account-selection-error.d.ts +8 -0
  44. package/dist/domain/connector-tool-permissions.d.ts +36 -0
  45. package/dist/domain/direct-model-provider.d.ts +3 -0
  46. package/dist/domain/editable-artifacts/agent-application.d.ts +10 -1
  47. package/dist/domain/editable-artifacts/durable-export.d.ts +22 -1
  48. package/dist/domain/editable-artifacts/ports.d.ts +10 -0
  49. package/dist/domain/editable-artifacts/service.d.ts +4 -3
  50. package/dist/domain/environments.d.ts +5 -9
  51. package/dist/domain/external-creation-attribution.d.ts +6 -0
  52. package/dist/domain/file-owner.d.ts +8 -0
  53. package/dist/domain/github-action-policies.d.ts +36 -0
  54. package/dist/domain/github-repository-bindings.d.ts +117 -0
  55. package/dist/domain/github-skill-source.d.ts +5 -0
  56. package/dist/domain/governed-learning-slack-publication.d.ts +45 -0
  57. package/dist/domain/insights-timing.d.ts +16 -0
  58. package/dist/domain/insights-usage.d.ts +27 -0
  59. package/dist/domain/insights.d.ts +28 -1
  60. package/dist/domain/knowledge-files.d.ts +20 -0
  61. package/dist/domain/knowledge-messages.d.ts +39 -0
  62. package/dist/domain/knowledge-messages.test.d.ts +1 -0
  63. package/dist/domain/knowledge-preparation.d.ts +10 -0
  64. package/dist/domain/knowledge-preparation.test.d.ts +1 -0
  65. package/dist/domain/knowledge-search.d.ts +15 -0
  66. package/dist/domain/knowledge-search.test.d.ts +1 -0
  67. package/dist/domain/knowledge.d.ts +9 -0
  68. package/dist/domain/mcp-account-bindings.d.ts +19 -0
  69. package/dist/domain/mcp-account-routes.d.ts +21 -0
  70. package/dist/domain/native-mcp-connection-admission.d.ts +3 -0
  71. package/dist/domain/organization-integration-catalog.d.ts +15 -0
  72. package/dist/domain/organization-membership-lifecycle.d.ts +1 -0
  73. package/dist/domain/personal-connection-delegations.d.ts +87 -4
  74. package/dist/domain/pr-review.d.ts +249 -0
  75. package/dist/domain/resources.d.ts +24 -3
  76. package/dist/domain/scheduled-task-access.d.ts +247 -0
  77. package/dist/domain/scheduled-tasks.d.ts +103 -6
  78. package/dist/domain/session-connection-accounts.d.ts +16 -0
  79. package/dist/domain/session-file-access.d.ts +4 -0
  80. package/dist/domain/session-native-connection-replacement.d.ts +14 -0
  81. package/dist/domain/session-start-timing.d.ts +7 -0
  82. package/dist/domain/session-tool-policy.d.ts +93 -4
  83. package/dist/domain/sessions.d.ts +275 -28
  84. package/dist/domain/skill-imports.d.ts +1 -0
  85. package/dist/domain/skill-search.d.ts +30 -0
  86. package/dist/domain/skills.d.ts +117 -0
  87. package/dist/domain/slack-bot.d.ts +46 -1
  88. package/dist/domain/workspace-members.d.ts +8 -1
  89. package/dist/editable-artifact-live/application.d.ts +12 -3
  90. package/dist/editable-artifact-live/ports.d.ts +0 -1
  91. package/dist/editable-artifact-live/server.d.ts +5 -2
  92. package/dist/editable-artifact-live/ticket.d.ts +2 -2
  93. package/dist/editable-artifact-live/types.d.ts +14 -2
  94. package/dist/editable-artifact-live.js +2 -2
  95. package/dist/editable-artifacts.js +10 -4
  96. package/dist/index.d.ts +49 -3
  97. package/dist/index.js +18826 -6847
  98. package/dist/index.js.map +1 -1
  99. package/dist/managed-auth-session-sets.d.ts +131 -0
  100. package/dist/managed-auth-session-sets.js +51 -0
  101. package/dist/managed-auth-session-sets.js.map +1 -0
  102. package/dist/managed-session.d.ts +98 -11
  103. package/dist/model-catalog.d.ts +117 -0
  104. package/dist/product-usage-metrics.d.ts +30 -0
  105. package/dist/rigs/index.d.ts +22 -5
  106. package/dist/rigs/provider-images.d.ts +1 -1
  107. package/dist/sandbox/fleet.d.ts +59 -10
  108. package/dist/sandbox/routing.d.ts +22 -2
  109. package/dist/sandbox/runtime-settings.d.ts +56 -0
  110. package/dist/session-authorization.d.ts +38 -1
  111. package/dist/site-session-origin.d.ts +9 -0
  112. package/dist/transcription.d.ts +12 -1
  113. package/dist/turn-surface.d.ts +18 -0
  114. package/dist/user-presence.d.ts +32 -0
  115. package/package.json +18 -11
  116. package/src/access/external-actor-authority.ts +94 -0
  117. package/src/access/index.ts +1386 -44
  118. package/src/access/service-initiator.ts +50 -0
  119. package/src/application/api-integration-servers.ts +215 -0
  120. package/src/application/archived-session-imports.ts +161 -0
  121. package/src/application/composer-submit.ts +77 -0
  122. package/src/application/connect-authority.ts +77 -0
  123. package/src/application/connect-operation.ts +80 -0
  124. package/src/application/external-continuation.ts +129 -0
  125. package/src/application/external-identity-lifecycle.ts +48 -0
  126. package/src/application/external-link-work-admission.ts +90 -0
  127. package/src/application/external-workspace-members.ts +232 -0
  128. package/src/application/modal-native-worker-host-transport.ts +263 -0
  129. package/src/application/new-session-drafts.ts +222 -29
  130. package/src/application/sandbox-recovery.ts +78 -0
  131. package/src/application/session-commands.ts +430 -73
  132. package/src/application/session-mcp-credential-rotation.ts +217 -0
  133. package/src/application/session-tenancy.ts +445 -0
  134. package/src/application/user-resource-grants.ts +154 -0
  135. package/src/billing/limits.ts +103 -24
  136. package/src/canonical-human-identities.ts +22 -3
  137. package/src/codex-model-availability.ts +136 -0
  138. package/src/default-session-model.ts +656 -0
  139. package/src/dependencies.ts +97 -5
  140. package/src/developer-setup-credential-ceiling.ts +60 -0
  141. package/src/domain/agent-config-resolution.ts +148 -0
  142. package/src/domain/automations.ts +270 -0
  143. package/src/domain/capabilities.ts +244 -151
  144. package/src/domain/company-profile-agent-admin.ts +56 -0
  145. package/src/domain/connection-account-selection-error.ts +19 -0
  146. package/src/domain/connector-tool-permissions.ts +371 -0
  147. package/src/domain/direct-model-provider.ts +62 -0
  148. package/src/domain/editable-artifacts/agent-application.ts +61 -15
  149. package/src/domain/editable-artifacts/durable-export.ts +100 -5
  150. package/src/domain/editable-artifacts/in-memory.ts +6 -0
  151. package/src/domain/editable-artifacts/ports.ts +11 -0
  152. package/src/domain/editable-artifacts/service.ts +32 -1
  153. package/src/domain/editable-artifacts/snapshot-compaction.ts +9 -5
  154. package/src/domain/editable-artifacts/snapshot-verifier-genesis.ts +10 -8
  155. package/src/domain/editable-artifacts/snapshot-verifier.ts +10 -3
  156. package/src/domain/environments.ts +25 -45
  157. package/src/domain/external-creation-attribution.ts +22 -0
  158. package/src/domain/file-owner.ts +67 -0
  159. package/src/domain/github-action-policies.ts +169 -0
  160. package/src/domain/github-repository-bindings.ts +295 -0
  161. package/src/domain/github-skill-source.ts +233 -0
  162. package/src/domain/governed-learning-slack-publication.ts +157 -0
  163. package/src/domain/insights-timing.ts +95 -0
  164. package/src/domain/insights-usage.ts +67 -0
  165. package/src/domain/insights.ts +270 -169
  166. package/src/domain/knowledge-files.ts +46 -0
  167. package/src/domain/knowledge-messages.test.ts +91 -0
  168. package/src/domain/knowledge-messages.ts +106 -0
  169. package/src/domain/knowledge-preparation.test.ts +276 -0
  170. package/src/domain/knowledge-preparation.ts +147 -0
  171. package/src/domain/knowledge-search.test.ts +561 -0
  172. package/src/domain/knowledge-search.ts +256 -0
  173. package/src/domain/knowledge.ts +133 -0
  174. package/src/domain/mcp-account-bindings.ts +171 -0
  175. package/src/domain/mcp-account-routes.ts +121 -0
  176. package/src/domain/native-mcp-connection-admission.ts +14 -0
  177. package/src/domain/organization-integration-catalog.ts +88 -0
  178. package/src/domain/organization-membership-lifecycle.ts +10 -0
  179. package/src/domain/personal-connection-delegations.ts +758 -115
  180. package/src/domain/pr-review.ts +687 -0
  181. package/src/domain/resources.ts +182 -25
  182. package/src/domain/scheduled-task-access.ts +1052 -0
  183. package/src/domain/scheduled-tasks.ts +1952 -215
  184. package/src/domain/session-connection-accounts.ts +67 -0
  185. package/src/domain/session-file-access.ts +47 -0
  186. package/src/domain/session-native-connection-replacement.ts +64 -0
  187. package/src/domain/session-start-timing.ts +55 -0
  188. package/src/domain/session-tool-policy.ts +443 -19
  189. package/src/domain/sessions.ts +3417 -619
  190. package/src/domain/skill-imports.ts +137 -17
  191. package/src/domain/skill-search.ts +221 -0
  192. package/src/domain/skills.ts +104 -0
  193. package/src/domain/slack-bot.ts +128 -3
  194. package/src/domain/workspace-members.ts +34 -2
  195. package/src/editable-artifact-live/application.ts +29 -4
  196. package/src/editable-artifact-live/ports.ts +0 -1
  197. package/src/editable-artifact-live/server.ts +167 -13
  198. package/src/editable-artifact-live/ticket.ts +87 -6
  199. package/src/editable-artifact-live/types.ts +16 -2
  200. package/src/editable-artifact-live/wire.ts +0 -10
  201. package/src/index.ts +69 -4
  202. package/src/managed-auth-session-sets.ts +371 -0
  203. package/src/managed-session.ts +520 -2
  204. package/src/model-catalog.ts +873 -0
  205. package/src/product-usage-metrics.ts +101 -0
  206. package/src/rigs/index.ts +179 -63
  207. package/src/rigs/provider-images.ts +2 -3
  208. package/src/sandbox/fleet.ts +471 -59
  209. package/src/sandbox/routing.ts +160 -33
  210. package/src/sandbox/runtime-settings.ts +281 -0
  211. package/src/session-authorization.ts +262 -78
  212. package/src/site-session-origin.ts +22 -0
  213. package/src/transcription.ts +13 -1
  214. package/src/turn-surface.ts +45 -0
  215. package/src/user-presence.ts +134 -0
  216. package/dist/chunk-6WKPWE5S.js.map +0 -1
  217. package/dist/chunk-IBOEYG6N.js +0 -34
  218. package/dist/chunk-IBOEYG6N.js.map +0 -1
  219. package/dist/chunk-JJU6I5XD.js.map +0 -1
  220. package/dist/chunk-NYPMQ7NO.js.map +0 -1
  221. package/dist/domain/durable-learning-slack-publication.d.ts +0 -72
  222. package/dist/domain/packs.d.ts +0 -55
  223. package/src/domain/durable-learning-slack-publication.ts +0 -202
  224. package/src/domain/packs.ts +0 -556
@@ -0,0 +1,131 @@
1
+ import type { ManagedAuthSessionSetMode, ManagedAuthSessionSetProjection } from "@opengeni/contracts/managed-auth-session-sets";
2
+ import { type Database, type ManagedAuthDatabaseProjection, type ManagedAuthSelectedSession } from "@opengeni/db";
3
+ export declare const MANAGED_AUTH_SESSION_SET_COOKIE: "opengeni.session_set";
4
+ export declare const MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE: "opengeni.login_transaction";
5
+ export declare const MANAGED_AUTH_CSRF_HEADER: "x-opengeni-session-csrf";
6
+ export declare const MANAGED_AUTH_ACTOR_EPOCH_HEADER: "x-opengeni-actor-epoch";
7
+ export declare const MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE_PATH: "/v1/auth/session-set/transactions";
8
+ export type ManagedAuthResolvedSession = {
9
+ session: {
10
+ id: string;
11
+ userId: string;
12
+ [key: string]: unknown;
13
+ };
14
+ user: {
15
+ id: string;
16
+ email: string;
17
+ name: string;
18
+ emailVerified: boolean;
19
+ [key: string]: unknown;
20
+ };
21
+ };
22
+ /** Provider-neutral boundary; provider credentials and tokens never cross its output. */
23
+ export interface ManagedAuthSessionAdapter {
24
+ authenticate(input: {
25
+ provider: "email_password";
26
+ transactionId: string;
27
+ credentials: {
28
+ email: string;
29
+ password: string;
30
+ };
31
+ headers: Headers;
32
+ }): Promise<{
33
+ authSessionId: string;
34
+ }>;
35
+ /** Verify an ambient provider cookie without sliding expiry or emitting cookies. */
36
+ resolveAmbientSession(headers: Headers): Promise<ManagedAuthResolvedSession | null>;
37
+ resolveSelectedSession(input: ManagedAuthSelectedSession): Promise<ManagedAuthResolvedSession | null>;
38
+ refreshSelectedSession(input: ManagedAuthSelectedSession): Promise<ManagedAuthResolvedSession | null>;
39
+ revokeSession(input: {
40
+ authSessionId: string;
41
+ }): Promise<void>;
42
+ /** Dual-mode exact selected-session cookie plus stale provider-cache invalidations. */
43
+ createLegacySelectedSessionCookies(input: ManagedAuthSelectedSession | null, currentCookieHeader?: string | null): Promise<string[]>;
44
+ }
45
+ export declare class ManagedAuthActorChangeError extends Error {
46
+ readonly name = "ManagedAuthActorChangeError";
47
+ readonly code = "actor_change_required";
48
+ constructor();
49
+ }
50
+ export declare class ManagedAuthRequestAdmissionError extends Error {
51
+ readonly name = "ManagedAuthRequestAdmissionError";
52
+ readonly code = "origin_rejected";
53
+ }
54
+ export declare class ManagedAuthCompletionOutcomeUnknownError extends Error {
55
+ readonly name = "ManagedAuthCompletionOutcomeUnknownError";
56
+ readonly code = "operation_outcome_unknown";
57
+ constructor(options?: ErrorOptions);
58
+ }
59
+ export declare function requireManagedAuthActorFence(input: {
60
+ mode: ManagedAuthSessionSetMode;
61
+ actorEpoch: string;
62
+ expectedActorEpoch: string | null;
63
+ selectedAuthSessionId: string | null;
64
+ legacyAmbientSessionId?: string | null;
65
+ }): void;
66
+ export declare function managedAuthRandomAuthority(): string;
67
+ export declare function managedAuthSha256(value: string): string;
68
+ export declare function managedAuthCsrfHash(authority: string): string;
69
+ export declare function managedAuthCsrfToken(signingSecret: string, authority: string, generation: string): string;
70
+ export declare function managedAuthTransactionSecret(signingSecret: string, authority: string, operationId: string): string;
71
+ export declare function managedAuthDerivedUuid(namespace: string, value: string): string;
72
+ export declare function managedAuthRequestDigest(value: unknown): string;
73
+ export declare function managedAuthSecretRequestDigest(signingSecret: string, value: unknown): string;
74
+ export declare function withManagedAuthCsrfToken(projection: ManagedAuthDatabaseProjection, signingSecret: string, authority: string): ManagedAuthSessionSetProjection;
75
+ export declare function requireManagedAuthMutationAdmission(input: {
76
+ request: Request;
77
+ allowedOrigins: readonly string[];
78
+ authority: string;
79
+ signingSecret: string;
80
+ expectedGeneration: string;
81
+ }): void;
82
+ export declare function resolveManagedAuthSelectedSession(input: {
83
+ db: Database;
84
+ adapter: ManagedAuthSessionAdapter;
85
+ authority: string;
86
+ mode: ManagedAuthSessionSetMode;
87
+ expectedActorEpoch: string | null;
88
+ legacyAmbientSessionId?: string | null;
89
+ allowRecovery?: boolean;
90
+ }): Promise<{
91
+ session: ManagedAuthResolvedSession | null;
92
+ projection: ManagedAuthDatabaseProjection;
93
+ } | null>;
94
+ export declare function authenticateAndAdoptManagedAuthSession(input: {
95
+ db: Database;
96
+ adapter: ManagedAuthSessionAdapter;
97
+ isolatedHeaders: Headers;
98
+ authority: string;
99
+ csrfHash: string;
100
+ operationId: string;
101
+ requestDigest: string;
102
+ expectedGeneration: string;
103
+ expectedActorEpoch: string;
104
+ transactionId: string;
105
+ transactionSecret: string;
106
+ email: string;
107
+ password: string;
108
+ mode: ManagedAuthSessionSetMode;
109
+ }): Promise<{
110
+ projection: ManagedAuthDatabaseProjection;
111
+ returnIntent: string | null;
112
+ }>;
113
+ export declare function adoptManagedAuthSession(input: {
114
+ db: Database;
115
+ adapter: ManagedAuthSessionAdapter;
116
+ authority: string;
117
+ authorityHash: string;
118
+ csrfHash: string;
119
+ operationId: string;
120
+ requestDigest: string;
121
+ expectedGeneration: string;
122
+ expectedActorEpoch: string;
123
+ transactionId: string;
124
+ transactionSecretHash: string;
125
+ authSessionId: string;
126
+ mode: ManagedAuthSessionSetMode;
127
+ }): Promise<{
128
+ projection: ManagedAuthDatabaseProjection;
129
+ returnIntent: string | null;
130
+ }>;
131
+ export declare function isolatedManagedAuthHeaders(request: Request): Headers;
@@ -0,0 +1,51 @@
1
+ import {
2
+ MANAGED_AUTH_ACTOR_EPOCH_HEADER,
3
+ MANAGED_AUTH_CSRF_HEADER,
4
+ MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE,
5
+ MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE_PATH,
6
+ MANAGED_AUTH_SESSION_SET_COOKIE,
7
+ ManagedAuthActorChangeError,
8
+ ManagedAuthCompletionOutcomeUnknownError,
9
+ ManagedAuthRequestAdmissionError,
10
+ adoptManagedAuthSession,
11
+ authenticateAndAdoptManagedAuthSession,
12
+ isolatedManagedAuthHeaders,
13
+ managedAuthCsrfHash,
14
+ managedAuthCsrfToken,
15
+ managedAuthDerivedUuid,
16
+ managedAuthRandomAuthority,
17
+ managedAuthRequestDigest,
18
+ managedAuthSecretRequestDigest,
19
+ managedAuthSha256,
20
+ managedAuthTransactionSecret,
21
+ requireManagedAuthActorFence,
22
+ requireManagedAuthMutationAdmission,
23
+ resolveManagedAuthSelectedSession,
24
+ withManagedAuthCsrfToken
25
+ } from "./chunk-QO5GVFFO.js";
26
+ export {
27
+ MANAGED_AUTH_ACTOR_EPOCH_HEADER,
28
+ MANAGED_AUTH_CSRF_HEADER,
29
+ MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE,
30
+ MANAGED_AUTH_LOGIN_TRANSACTION_COOKIE_PATH,
31
+ MANAGED_AUTH_SESSION_SET_COOKIE,
32
+ ManagedAuthActorChangeError,
33
+ ManagedAuthCompletionOutcomeUnknownError,
34
+ ManagedAuthRequestAdmissionError,
35
+ adoptManagedAuthSession,
36
+ authenticateAndAdoptManagedAuthSession,
37
+ isolatedManagedAuthHeaders,
38
+ managedAuthCsrfHash,
39
+ managedAuthCsrfToken,
40
+ managedAuthDerivedUuid,
41
+ managedAuthRandomAuthority,
42
+ managedAuthRequestDigest,
43
+ managedAuthSecretRequestDigest,
44
+ managedAuthSha256,
45
+ managedAuthTransactionSecret,
46
+ requireManagedAuthActorFence,
47
+ requireManagedAuthMutationAdmission,
48
+ resolveManagedAuthSelectedSession,
49
+ withManagedAuthCsrfToken
50
+ };
51
+ //# sourceMappingURL=managed-auth-session-sets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,17 +1,17 @@
1
1
  import type { Context } from "hono";
2
2
  import type { ManagedAuth } from "./managed-auth-type.js";
3
3
  import type { Database } from "@opengeni/db";
4
- /**
5
- * Read a Better Auth session without bypassing its sliding-cookie renewal.
6
- *
7
- * Better Auth can refresh the durable session while resolving `getSession`.
8
- * Programmatic callers must explicitly request and forward the returned cookie
9
- * headers; the HTTP handler does this automatically, but direct API calls do not.
10
- */
11
- export declare function getManagedSession(c: Context, auth: ManagedAuth, options?: {
12
- db?: Database;
13
- allowIdentityRecovery?: boolean;
14
- }): Promise<{
4
+ import type { ManagedAuthSessionSetMode } from "@opengeni/contracts/managed-auth-session-sets";
5
+ import { type ManagedAuthSessionAdapter } from "./managed-auth-session-sets.js";
6
+ type ActorMutationLeaseRuntime = {
7
+ monotonicNow: () => number;
8
+ schedule: (callback: () => void, delayMs: number) => ReturnType<typeof setTimeout>;
9
+ cancel: (timer: ReturnType<typeof setTimeout>) => void;
10
+ terminate: () => void;
11
+ };
12
+ /** Bind admission to this auth instance, including all session-set modes. */
13
+ export declare function configureManagedUserAdmission(auth: ManagedAuth, emails: readonly string[] | undefined): void;
14
+ export declare function getManagedSession(...args: Parameters<typeof resolveManagedSession>): Promise<import("./managed-auth-session-sets.js").ManagedAuthResolvedSession | {
15
15
  session: {
16
16
  id: string;
17
17
  createdAt: Date;
@@ -55,3 +55,90 @@ export declare function getManagedSession(c: Context, auth: ManagedAuth, options
55
55
  image?: string | null | undefined;
56
56
  };
57
57
  } | null>;
58
+ export declare function assertManagedUserAdmission(auth: ManagedAuth, user: {
59
+ email: string;
60
+ emailVerified: boolean;
61
+ } | null | undefined): void;
62
+ declare function resolveManagedSession(c: Context, auth: ManagedAuth, options?: {
63
+ db?: Database | undefined;
64
+ allowIdentityRecovery?: boolean | undefined;
65
+ sessionSetMode?: ManagedAuthSessionSetMode | undefined;
66
+ sessionAdapter?: ManagedAuthSessionAdapter | null | undefined;
67
+ }): Promise<import("./managed-auth-session-sets.js").ManagedAuthResolvedSession | {
68
+ session: {
69
+ id: string;
70
+ createdAt: Date;
71
+ updatedAt: Date;
72
+ userId: string;
73
+ expiresAt: Date;
74
+ token: string;
75
+ ipAddress?: string | null | undefined;
76
+ userAgent?: string | null | undefined;
77
+ } | {
78
+ [x: string]: any;
79
+ [x: number]: any;
80
+ [x: symbol]: any;
81
+ id: string;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ userId: string;
85
+ expiresAt: Date;
86
+ token: string;
87
+ ipAddress?: string | null | undefined;
88
+ userAgent?: string | null | undefined;
89
+ };
90
+ user: {
91
+ id: string;
92
+ createdAt: Date;
93
+ updatedAt: Date;
94
+ email: string;
95
+ emailVerified: boolean;
96
+ name: string;
97
+ image?: string | null | undefined;
98
+ } | {
99
+ [x: string]: any;
100
+ [x: number]: any;
101
+ [x: symbol]: any;
102
+ id: string;
103
+ createdAt: Date;
104
+ updatedAt: Date;
105
+ email: string;
106
+ emailVerified: boolean;
107
+ name: string;
108
+ image?: string | null | undefined;
109
+ };
110
+ } | null>;
111
+ /** Safe response provenance for a request authenticated through session-set authority. */
112
+ export declare function getManagedAuthRequestActorEpoch(request: Request): string | null;
113
+ /** Release the multi-replica actor fence after the outer HTTP handler settles. */
114
+ export declare function releaseManagedAuthRequestActorLease(request: Request): Promise<void>;
115
+ /** Cooperative cancellation signal for actor-scoped provider/external I/O. */
116
+ export declare function getManagedAuthRequestActorAbortSignal(request: Request): AbortSignal | null;
117
+ /** @internal Deterministic lease-clock seam used only by direct lifecycle tests. */
118
+ export declare function installManagedAuthActorLeaseRuntimeForTest(overrides: Partial<ActorMutationLeaseRuntime>): () => void;
119
+ /**
120
+ * Exact post-handler fence. A finite unsafe response is not released unless
121
+ * its request-owned lease is still live at the same actor epoch.
122
+ */
123
+ export declare function validateManagedAuthRequestActorLease(request: Request): Promise<void>;
124
+ export declare class ManagedAuthActorLeaseOutcomeUnknownError extends Error {
125
+ readonly name = "ManagedAuthActorLeaseOutcomeUnknownError";
126
+ readonly code = "operation_outcome_unknown";
127
+ constructor(options?: ErrorOptions);
128
+ }
129
+ /** A known-applied same-request canonical transition intentionally consumes its lease. */
130
+ export declare function markManagedAuthRequestActorTransitionApplied(request: Request): void;
131
+ export type ManagedAuthActorMutationLeaseStamp = {
132
+ authorityHash: string;
133
+ actorEpoch: string;
134
+ requestId: string;
135
+ };
136
+ export type ManagedAuthActorAdmissionStamp = {
137
+ authorityHash: string;
138
+ actorEpoch: string;
139
+ };
140
+ /** Verified server-owned actor evidence available to both reads and mutations. */
141
+ export declare function getManagedAuthRequestActorAdmissionStamp(request: Request): ManagedAuthActorAdmissionStamp | null;
142
+ /** Exact request-owned fence passed into a same-transaction actor transition. */
143
+ export declare function getManagedAuthRequestActorLeaseStamp(request: Request): ManagedAuthActorMutationLeaseStamp | null;
144
+ export {};
@@ -0,0 +1,117 @@
1
+ import { type ConnectionModelRestrictions } from "@opengeni/db";
2
+ import { type ClaudeConnectionCatalog, type ConfiguredModel, type Settings } from "@opengeni/config";
3
+ import { type ModelAvailabilityV1, type ModelCredentialReadinessV1, type WorkspaceModelPolicyContract } from "@opengeni/contracts";
4
+ import { type OrganizationClaudeModelAdmissionAuthority, type Database } from "@opengeni/db";
5
+ export type ResolvedCatalogSettings = {
6
+ settings: Settings;
7
+ source: "code" | "database";
8
+ version: number | null;
9
+ modelNotes: Record<string, string>;
10
+ };
11
+ /**
12
+ * Curated workspace Gateway products and workspace-owned custom slugs share
13
+ * one public prefix. Only the latter have a mutable catalog row whose active
14
+ * generation must be rechecked at a fresh acceptance commit boundary.
15
+ */
16
+ export declare function isWorkspaceGatewayCustomModelId(settings: Settings, modelId: string): boolean;
17
+ export declare function isWorkspaceOpenRouterCustomModelId(settings: Settings, modelId: string): boolean;
18
+ export type WorkspaceCustomModelReference = {
19
+ scope: "workspace" | "organization";
20
+ providerKind: "vercel_gateway" | "openrouter" | "anthropic" | "claude_subscription";
21
+ upstreamModelId: string;
22
+ };
23
+ export declare function workspaceCustomModelReference(settings: Settings, modelId: string): WorkspaceCustomModelReference | null;
24
+ export declare function isWorkspaceCustomModelId(settings: Settings, modelId: string): boolean;
25
+ export declare function lockActiveCustomModelForAdmission(db: Database, input: {
26
+ accountId: string;
27
+ workspaceId: string;
28
+ reference: WorkspaceCustomModelReference;
29
+ claudeAuthority?: OrganizationClaudeModelAdmissionAuthority;
30
+ }): Promise<boolean>;
31
+ /**
32
+ * Resolve the deployment catalog without making synchronous env settings read
33
+ * Postgres. Database mode fails closed when the singleton is absent or invalid;
34
+ * code mode preserves the already-validated env catalog.
35
+ */
36
+ export declare function resolveCatalogSettings(db: Database, envSettings: Settings): Promise<ResolvedCatalogSettings>;
37
+ /**
38
+ * Resolve the deployment catalog and add only the custom Gateway slugs owned by
39
+ * one workspace. Use this at model-bearing workspace boundaries; public config
40
+ * and deployment-operator surfaces must continue to use `resolveCatalogSettings`.
41
+ */
42
+ export declare function resolveWorkspaceCatalogSettings(db: Database, envSettings: Settings, input: {
43
+ accountId: string;
44
+ workspaceId: string;
45
+ retainedProductModelId?: string | null;
46
+ retainedProductModelIds?: readonly (string | null | undefined)[];
47
+ }): Promise<ResolvedCatalogSettings>;
48
+ export type ModelAvailabilityObservation = {
49
+ status: "available" | "degraded" | "unavailable";
50
+ reason: "not_entitled" | "provider_unhealthy" | null;
51
+ checkedAt: string;
52
+ };
53
+ export type ModelCredentialReadinessObservation = {
54
+ status: "ready";
55
+ checkedAt: string;
56
+ } | {
57
+ status: "not_ready";
58
+ reason: "prerequisites_missing" | "needs_reauth";
59
+ checkedAt: string;
60
+ } | {
61
+ status: "error";
62
+ reason: "resolver_error";
63
+ checkedAt: string;
64
+ };
65
+ export declare const MODEL_CREDENTIAL_READINESS_OBSERVATION_MAX_AGE_MS: number;
66
+ export type WorkspaceModelSelectionInput = {
67
+ connectionModelRestrictions?: ConnectionModelRestrictions;
68
+ settings: Settings;
69
+ policy: WorkspaceModelPolicyContract | null;
70
+ codexSubscriptionActive: boolean;
71
+ xaiSubscriptionActive?: boolean;
72
+ workspaceGatewayConnectionActive?: boolean;
73
+ workspaceOpenRouterConnectionActive?: boolean;
74
+ claudeConnections?: ClaudeConnectionCatalog;
75
+ workspaceClaudeConnections?: ClaudeConnectionCatalog;
76
+ organizationGatewayConnectionActive?: boolean;
77
+ organizationOpenRouterConnectionActive?: boolean;
78
+ workspaceGatewayCustomModels?: readonly {
79
+ upstreamModelId: string;
80
+ label?: string | null;
81
+ }[];
82
+ workspaceOpenRouterCustomModels?: readonly {
83
+ upstreamModelId: string;
84
+ label?: string | null;
85
+ }[];
86
+ organizationGatewayCustomModels?: readonly {
87
+ upstreamModelId: string;
88
+ label?: string | null;
89
+ }[];
90
+ organizationOpenRouterCustomModels?: readonly {
91
+ upstreamModelId: string;
92
+ label?: string | null;
93
+ }[];
94
+ credentialReadinessObservations?: Readonly<Record<string, ModelCredentialReadinessObservation>> | undefined;
95
+ observations?: Readonly<Record<string, ModelAvailabilityObservation>> | undefined;
96
+ now?: Date | undefined;
97
+ credentialReadinessMaxAgeMs?: number | undefined;
98
+ };
99
+ export type WorkspaceModelSelection = {
100
+ model: ConfiguredModel;
101
+ credentialReadiness: ModelCredentialReadinessV1;
102
+ policyAllowed: boolean;
103
+ availability: ModelAvailabilityV1;
104
+ };
105
+ /**
106
+ * Stable fresh-selection admission, independent of transient observations.
107
+ * Missing catalog membership is handled by the caller's lookup. Resolver-based
108
+ * deployment credentials (Azure AD/managed identity) are resolved at execution;
109
+ * absent, stale or failed observations cannot make their definition uncreatable.
110
+ */
111
+ export declare function isWorkspaceModelAdmissible(selection: WorkspaceModelSelection): boolean;
112
+ /**
113
+ * One shared picker/tool decision. Catalog membership, credential readiness,
114
+ * workspace policy, and optional provider-health observations are evaluated in
115
+ * configured catalog order so every consumer exposes the same selectable set.
116
+ */
117
+ export declare function resolveWorkspaceModelSelection(input: WorkspaceModelSelectionInput): WorkspaceModelSelection[];
@@ -0,0 +1,30 @@
1
+ import { type SessionTurnSurface } from "@opengeni/contracts";
2
+ import type { Observability } from "@opengeni/observability";
3
+ /**
4
+ * Live, content-free product usage counters recorded where work is accepted.
5
+ * Every label is a closed set: the product surface (or `unknown` when no
6
+ * surface was captured), who created a session (`subject` or `service`), and
7
+ * whether the session is a root. No workspace, user, model or text value ever
8
+ * becomes a label.
9
+ */
10
+ export type ProductUsageMetricsSink = Pick<Observability, "incrementCounter">;
11
+ export declare const PRODUCT_USAGE_SURFACE_LABELS: readonly ["web", "slack", "api_key", "embedded", "scheduled", "agent", "voice", "site", "automation", "mcp", "system", "unknown"];
12
+ export type ProductUsageSurfaceLabel = (typeof PRODUCT_USAGE_SURFACE_LABELS)[number];
13
+ export declare const SESSION_CREATED_BY_KINDS: readonly ["subject", "service"];
14
+ export type SessionCreatedByKind = (typeof SESSION_CREATED_BY_KINDS)[number];
15
+ export declare function productUsageSurfaceLabel(surface: SessionTurnSurface | null | undefined): ProductUsageSurfaceLabel;
16
+ /** Count one newly created session. Never throws; replays must not call it. */
17
+ export declare function recordSessionCreated(sink: ProductUsageMetricsSink | null | undefined, input: {
18
+ surface: SessionTurnSurface | null | undefined;
19
+ createdByKind: string | null | undefined;
20
+ parentSessionId: string | null | undefined;
21
+ }): void;
22
+ /** Count one newly accepted user message. Never throws; replays must not call it. */
23
+ export declare function recordUserMessageAccepted(sink: ProductUsageMetricsSink | null | undefined, input: {
24
+ surface: SessionTurnSurface | null | undefined;
25
+ }): void;
26
+ /**
27
+ * Publish every closed series at zero so dashboards can tell a quiet surface
28
+ * from missing instrumentation. Never throws.
29
+ */
30
+ export declare function registerProductUsageMetricBaselines(sink: ProductUsageMetricsSink | null | undefined): void;
@@ -1,10 +1,18 @@
1
- import type { AccessGrant, CreateRigRequest, RigDefinitionEditPayload, ProposeRigChangeRequest, Rig, RigChange, RigVersion, UpdateRigRequest } from "@opengeni/contracts";
1
+ import type { AccessGrant, CreateRigRequest, RigDefinitionEditPayload, ProposeRigChangeRequest, Rig, RigChange, ResourceAuthorityScope, RigVersion, UpdateRigRequest } from "@opengeni/contracts";
2
2
  import { type Database } from "@opengeni/db";
3
3
  export * from "./provider-images.js";
4
4
  export declare const MAX_RIGS_PER_WORKSPACE = 50;
5
5
  export declare const MAX_CHECKS_PER_RIG = 100;
6
6
  export declare const MAX_CREDENTIAL_HOOKS_PER_RIG = 50;
7
7
  export declare const MAX_DEFAULT_VARIABLE_SETS_PER_RIG = 25;
8
+ export declare const RIG_DEFAULT_VARIABLE_SET_LOAD_CONCURRENCY = 4;
9
+ type VariableSetEnvironment = {
10
+ values: Record<string, string>;
11
+ } | null;
12
+ /** Load complete rig defaults concurrently while preserving listed precedence. */
13
+ export declare function loadRigDefaultVariableSetEnvironment(variableSetIds: readonly string[], load: (variableSetId: string) => Promise<VariableSetEnvironment>): Promise<Record<string, string>>;
14
+ /** Rig defaults layer below the session's explicitly selected variable set. */
15
+ export declare function mergeRigDefaultVariableSetEnvironment(rigDefaultValues: Record<string, string>, sessionValues: Record<string, string>): Record<string, string>;
8
16
  export type RigServices = {
9
17
  db: Database;
10
18
  };
@@ -16,11 +24,20 @@ export declare function recordRigAuditEvent(db: Database, input: {
16
24
  metadata?: Record<string, unknown>;
17
25
  }): Promise<void>;
18
26
  export declare function rigActorForGrant(grant: AccessGrant): string;
19
- export declare function requireRigForApi(db: Database, workspaceId: string, rigId: string): Promise<Rig>;
27
+ export declare function requireRigForApi(db: Database, grant: AccessGrant, rigId: string): Promise<Rig>;
20
28
  export declare function requireRigChangeForApi(db: Database, workspaceId: string, rigId: string, changeId: string): Promise<RigChange>;
21
- export declare function createRigForApi(deps: RigServices, grant: AccessGrant, payload: CreateRigRequest): Promise<Rig>;
22
- export declare function updateRigForApi(deps: RigServices, grant: AccessGrant, rig: Rig, payload: UpdateRigRequest): Promise<Rig>;
23
- export declare function deleteRigForApi(deps: RigServices, grant: AccessGrant, rig: Rig): Promise<void>;
29
+ /** A resource may depend only on Variable Sets whose audience is no narrower
30
+ * than its own. User-owned rigs may use anything visible to their owner. */
31
+ export declare function variableSetScopeAllowedForRig(rigScope: ResourceAuthorityScope, variableSetScope: ResourceAuthorityScope): boolean;
32
+ export declare function createRigForApi(deps: RigServices, grant: AccessGrant, payload: CreateRigRequest, options?: {
33
+ allowOrganization?: boolean;
34
+ }): Promise<Rig>;
35
+ export declare function updateRigForApi(deps: RigServices, grant: AccessGrant, rig: Rig, payload: UpdateRigRequest, options?: {
36
+ allowOrganization?: boolean;
37
+ }): Promise<Rig>;
38
+ export declare function deleteRigForApi(deps: RigServices, grant: AccessGrant, rig: Rig, options?: {
39
+ allowOrganization?: boolean;
40
+ }): Promise<void>;
24
41
  export declare function proposeRigChangeForApi(deps: RigServices, grant: AccessGrant, rig: Rig, request: ProposeRigChangeRequest, options?: {
25
42
  proposedBy?: string;
26
43
  }): Promise<RigChange>;
@@ -1,5 +1,5 @@
1
1
  import { type RigChangeVerification, type RigProviderImage, type RigProviderImages, type RigVersion, type SandboxBackend } from "@opengeni/contracts";
2
- export type RigProviderImageDefinition = Pick<RigVersion, "image" | "setupScript" | "checks" | "credentialHooks" | "defaultVariableSetIds">;
2
+ export type RigProviderImageDefinition = Pick<RigVersion, "setupScript" | "checks" | "credentialHooks" | "defaultVariableSetIds">;
3
3
  export declare function rigProviderImageProviderBindingKeyHash(bindingKey: string): string;
4
4
  export declare function rigProviderImageSetupHash(definition: Pick<RigProviderImageDefinition, "setupScript">): string;
5
5
  /**
@@ -1,7 +1,8 @@
1
1
  import type { Settings } from "@opengeni/config";
2
+ import type { SandboxBackend } from "@opengeni/contracts";
2
3
  import { type Database, type SandboxRecord } from "@opengeni/db";
3
4
  import type { EventBus } from "@opengeni/events";
4
- import { type BackendUnresolvableCode, type ControlRpc, type SelfhostedRelayConfig, type SelfhostedOpStreamDeps } from "@opengeni/runtime/sandbox";
5
+ import { type BackendUnresolvableCode, type ControlRpc, type SelfhostedRelayConfig, type SelfhostedOpStreamDeps, type SelfhostedOperationAdmission, type SelfhostedOperationResourcePolicy } from "@opengeni/runtime/sandbox";
5
6
  export type FleetServices = {
6
7
  db: Database;
7
8
  settings: Settings;
@@ -18,11 +19,18 @@ export type FleetReadinessHold = {
18
19
  export type FleetContext = {
19
20
  accountId: string;
20
21
  workspaceId: string;
22
+ subjectId?: string;
23
+ attemptAuthority?: {
24
+ turnId: string;
25
+ attemptId: string;
26
+ executionGeneration: number;
27
+ initiatingHumanSubjectId: string;
28
+ };
21
29
  /** The calling session (the pointer the attach/swap mutates + whose group box
22
30
  * is the default fleet member). */
23
31
  sessionId: string;
24
- /** The session's own group sandbox backend (modal/selfhosted/…). */
25
- sessionBackend: string;
32
+ /** The session's durable home-compute policy. */
33
+ sessionBackend: SandboxBackend;
26
34
  /** The session's own group sandbox id (the lease group). */
27
35
  sessionGroupId: string;
28
36
  };
@@ -42,6 +50,8 @@ export declare function buildFleetContextForSession(deps: {
42
50
  accountId: string;
43
51
  workspaceId: string;
44
52
  sessionId: string;
53
+ subjectId?: string;
54
+ attemptAuthority?: FleetContext["attemptAuthority"];
45
55
  }): Promise<FleetContext>;
46
56
  /** The dominant liveness of a fleet member, surfaced to the dock + the agent. */
47
57
  export type FleetLiveness = "online" | "reconnecting" | "offline";
@@ -50,14 +60,15 @@ export type FleetOperationAvailability = "ready" | "wakeable" | "recovering" | "
50
60
  * A fleet member as the agent + the dock see it (the M8b/M9 UI seam — the
51
61
  * `sandboxes_list` response entry the dock renders). STABLE shape: the dock keys
52
62
  * on `id`, renders `name`/`kind`/`liveness`, and marks `active`. The session's own
53
- * Modal group box is a synthetic entry with `id: groupId`, `kind: "modal"`, and a
54
- * null `enrollmentId`; an enrolled machine carries its sandbox + enrollment ids.
63
+ * managed group box is a synthetic entry with `id: groupId`, its actual
64
+ * provisioned backend kind, and a null `enrollmentId`; an enrolled machine
65
+ * carries its sandbox + enrollment ids.
55
66
  */
56
67
  export type FleetSandboxEntry = {
57
68
  /** The sandbox id used as the attach/swap/run_on `target`. For the session's
58
69
  * own group box this is the group id (a null active pointer == this box). */
59
70
  id: string;
60
- kind: "modal" | "selfhosted";
71
+ kind: Exclude<SandboxBackend, "none">;
61
72
  name: string;
62
73
  liveness: FleetLiveness;
63
74
  /** True for the session's currently-active sandbox (the routing target). */
@@ -106,16 +117,35 @@ export type FleetSwapResult = {
106
117
  activeSandboxId: string | null;
107
118
  activeEpoch: number;
108
119
  reason?: string;
109
- code?: BackendUnresolvableCode | "concurrent_swap" | "recovery_in_progress" | "recovery_degraded" | "recovery_unrecoverable";
120
+ code?: BackendUnresolvableCode | "invalid_working_directory" | "concurrent_swap" | "recovery_in_progress" | "recovery_degraded" | "recovery_unrecoverable";
110
121
  };
111
122
  /**
112
123
  * List the fleet: the session's own group box when it has one (a synthetic
113
124
  * entry) + the workspace's first-class selfhosted sandboxes (each probed for
114
125
  * liveness), each with an `active` marker derived from the session's active
115
- * pointer. A backend:none session has no synthetic home entry; a null pointer
116
- * then means no compute is attached.
126
+ * pointer. A backend:none session and a machine-home session on a deployment
127
+ * without a managed provider have no synthetic group entry; a null pointer then
128
+ * means no compute is attached.
117
129
  */
118
130
  export declare function listFleet(services: FleetServices, ctx: FleetContext): Promise<FleetListResult>;
131
+ type FleetResourceContext = Pick<FleetContext, "accountId" | "workspaceId" | "subjectId">;
132
+ export type CreateTimeSandboxTargetPreflight = {
133
+ ok: true;
134
+ targetSandboxId: string;
135
+ workingDir: string | null;
136
+ } | {
137
+ ok: false;
138
+ reason: string;
139
+ code: BackendUnresolvableCode | "invalid_working_directory";
140
+ };
141
+ /**
142
+ * Validate a named create-time machine target before any session row exists.
143
+ * The caller still commits the pointer with `setActiveSandbox` inside the
144
+ * session-create transaction, which rechecks durable ownership/enrollment
145
+ * authority and closes the remove/revoke race without holding database locks
146
+ * across the liveness probe.
147
+ */
148
+ export declare function preflightCreateTimeSandboxTarget(services: FleetServices, ctx: FleetResourceContext, target: string, workingDir: string | null): Promise<CreateTimeSandboxTargetPreflight>;
119
149
  /**
120
150
  * THE SWAP (and attach — identical mechanic). Validate the target's ownership +
121
151
  * liveness, then repoint the session via the epoch-fenced CAS `setActiveSandbox`:
@@ -157,6 +187,9 @@ export type RunOnResult = {
157
187
  export type RunOnSelfhostedMachine = {
158
188
  workspaceId: string;
159
189
  agentId: string;
190
+ /** Exact live daemon pinned for this operation. */
191
+ connectionInstanceId: string;
192
+ workspaceRoot: string;
160
193
  controlRpc: ControlRpc;
161
194
  relay: SelfhostedRelayConfig;
162
195
  /** Short request/reply deadline for read/write and other control operations. */
@@ -165,6 +198,21 @@ export type RunOnSelfhostedMachine = {
165
198
  execTimeoutMs: number;
166
199
  /** Streaming transport required when execTimeoutMs is 0 (unbounded). */
167
200
  opStream?: SelfhostedOpStreamDeps;
201
+ operationResourcePolicy?: SelfhostedOperationResourcePolicy;
202
+ operationResourcePolicySupported?: boolean;
203
+ operationCpuQuotaSupported?: boolean;
204
+ /** Last-boundary authority/connection resolver invoked before every physical
205
+ * provider operation. */
206
+ resolveOperationAdmission?: () => Promise<SelfhostedOperationAdmission | null>;
207
+ /**
208
+ * Exact-attempt values for this one child process. Never persisted on the
209
+ * enrollment or machine. The caller may supply these only after authenticating
210
+ * the active attempt that owns the one-off operation.
211
+ */
212
+ transientExecEnvironment?: Readonly<Record<string, string>>;
213
+ };
214
+ export type RunOnOptions = {
215
+ transientExecEnvironment?: Readonly<Record<string, string>>;
168
216
  };
169
217
  /**
170
218
  * Execute the one-off machine operation once the workspace/enrollment lookup has
@@ -182,7 +230,7 @@ export declare function executeRunOnSelfhostedMachine(machine: RunOnSelfhostedMa
182
230
  * agent subject; an offline machine surfaces a clear reason, never a wrong-box
183
231
  * landing.
184
232
  */
185
- export declare function runOnSandbox(services: FleetServices, ctx: FleetContext, target: string, op: RunOnOp): Promise<RunOnResult>;
233
+ export declare function runOnSandbox(services: FleetServices, ctx: FleetContext, target: string, op: RunOnOp, options?: RunOnOptions): Promise<RunOnResult>;
186
234
  export type ProvisionResult = {
187
235
  kind: "selfhosted";
188
236
  instructions: string;
@@ -208,3 +256,4 @@ export declare function provisionSandbox(services: FleetServices, ctx: FleetCont
208
256
  kind: "selfhosted" | "modal";
209
257
  name?: string;
210
258
  }): Promise<ProvisionResult>;
259
+ export {};