@opengeni/sdk 0.57.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 (291) hide show
  1. package/README.md +1017 -26
  2. package/dist/accounts.d.ts +153 -0
  3. package/dist/accounts.js +307 -0
  4. package/dist/accounts.js.map +1 -0
  5. package/dist/adapters/express.d.ts +31 -0
  6. package/dist/adapters/express.js +87 -0
  7. package/dist/adapters/express.js.map +1 -0
  8. package/dist/adapters/hono.d.ts +16 -0
  9. package/dist/adapters/hono.js +8 -0
  10. package/dist/adapters/hono.js.map +1 -0
  11. package/dist/adapters/next.d.ts +29 -0
  12. package/dist/adapters/next.js +22 -0
  13. package/dist/adapters/next.js.map +1 -0
  14. package/dist/allowance-refusal.d.ts +2 -0
  15. package/dist/allowance-refusal.js +50 -0
  16. package/dist/allowance-refusal.js.map +1 -0
  17. package/dist/artifact-catalog.d.ts +31 -0
  18. package/dist/artifact-client.d.ts +23 -11
  19. package/dist/artifacts.d.ts +1 -1
  20. package/dist/artifacts.js +7 -5
  21. package/dist/automations-client.d.ts +17 -0
  22. package/dist/automations.d.ts +3 -0
  23. package/dist/automations.js +84 -0
  24. package/dist/automations.js.map +1 -0
  25. package/dist/browser.d.ts +11 -0
  26. package/dist/browser.js +47 -0
  27. package/dist/browser.js.map +1 -0
  28. package/dist/chat/fold.d.ts +75 -0
  29. package/dist/chat/handler.d.ts +41 -0
  30. package/dist/chat/http.d.ts +67 -0
  31. package/dist/chat/ids.d.ts +34 -0
  32. package/dist/chat/index.d.ts +9 -0
  33. package/dist/chat/index.js +1694 -0
  34. package/dist/chat/index.js.map +1 -0
  35. package/dist/chat/openai.d.ts +30 -0
  36. package/dist/chat/opengeni.d.ts +128 -0
  37. package/dist/chat/types.d.ts +207 -0
  38. package/dist/chat/vercel.d.ts +49 -0
  39. package/dist/chats.d.ts +8 -0
  40. package/dist/{chunk-JDLDDRNE.js → chunk-2UXZUCEZ.js} +291 -34
  41. package/dist/chunk-2UXZUCEZ.js.map +1 -0
  42. package/dist/chunk-4SMEOV3P.js +246 -0
  43. package/dist/chunk-4SMEOV3P.js.map +1 -0
  44. package/dist/{chunk-JRPFWI6T.js → chunk-AH5D5Q5V.js} +31 -35
  45. package/dist/chunk-AH5D5Q5V.js.map +1 -0
  46. package/dist/chunk-APXVSSSY.js +301 -0
  47. package/dist/chunk-APXVSSSY.js.map +1 -0
  48. package/dist/chunk-DUVIYER4.js +639 -0
  49. package/dist/chunk-DUVIYER4.js.map +1 -0
  50. package/dist/{chunk-PKQ377ED.js → chunk-FG3OO5LM.js} +2686 -611
  51. package/dist/chunk-FG3OO5LM.js.map +1 -0
  52. package/dist/chunk-GZYZT22T.js +260 -0
  53. package/dist/chunk-GZYZT22T.js.map +1 -0
  54. package/dist/chunk-HMGADJGZ.js +150 -0
  55. package/dist/chunk-HMGADJGZ.js.map +1 -0
  56. package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
  57. package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
  58. package/dist/chunk-LY2K6ELJ.js +126 -0
  59. package/dist/chunk-LY2K6ELJ.js.map +1 -0
  60. package/dist/chunk-MOTJYIYL.js +340 -0
  61. package/dist/chunk-MOTJYIYL.js.map +1 -0
  62. package/dist/{chunk-ST5DDKJP.js → chunk-NC57YMUO.js} +121 -3
  63. package/dist/chunk-NC57YMUO.js.map +1 -0
  64. package/dist/chunk-RWKB6YZG.js +1270 -0
  65. package/dist/chunk-RWKB6YZG.js.map +1 -0
  66. package/dist/chunk-U6CV2SXO.js +195 -0
  67. package/dist/chunk-U6CV2SXO.js.map +1 -0
  68. package/dist/chunk-UM4ZXXJR.js +9 -0
  69. package/dist/chunk-UM4ZXXJR.js.map +1 -0
  70. package/dist/chunk-V6GIY62B.js +229 -0
  71. package/dist/chunk-V6GIY62B.js.map +1 -0
  72. package/dist/chunk-WU6GQG25.js +268 -0
  73. package/dist/chunk-WU6GQG25.js.map +1 -0
  74. package/dist/{chunk-VWE2QIVO.js → chunk-XNG7YGR3.js} +23 -6
  75. package/dist/chunk-XNG7YGR3.js.map +1 -0
  76. package/dist/{chunk-HJ3HHUT5.js → chunk-YIKA2QT4.js} +33 -2
  77. package/dist/chunk-YIKA2QT4.js.map +1 -0
  78. package/dist/chunk-ZKPY6YAJ.js +135 -0
  79. package/dist/chunk-ZKPY6YAJ.js.map +1 -0
  80. package/dist/client.d.ts +740 -94
  81. package/dist/codex-realtime-controller.d.ts +3 -0
  82. package/dist/codex-realtime-controller.js +2 -2
  83. package/dist/codex-realtime-v3.d.ts +13 -2
  84. package/dist/company-brain.d.ts +22 -0
  85. package/dist/company-profile.d.ts +14 -1
  86. package/dist/core.d.ts +9 -3
  87. package/dist/core.js +25 -6
  88. package/dist/deprecation.d.ts +47 -0
  89. package/dist/document-authority-client.d.ts +51 -0
  90. package/dist/document-authority.d.ts +2 -0
  91. package/dist/document-authority.js +12 -0
  92. package/dist/document-authority.js.map +1 -0
  93. package/dist/editable-artifacts/browser-session.d.ts +7 -3
  94. package/dist/editable-artifacts/controller.d.ts +4 -1
  95. package/dist/editable-artifacts/errors.d.ts +1 -1
  96. package/dist/editable-artifacts/http-live-transport.d.ts +6 -2
  97. package/dist/editable-artifacts/index.d.ts +2 -0
  98. package/dist/editable-artifacts/open-failure.d.ts +9 -0
  99. package/dist/editable-artifacts/types.d.ts +6 -3
  100. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +1 -1
  101. package/dist/editable-artifacts-worker.js +44 -17
  102. package/dist/editable-artifacts-worker.js.map +1 -1
  103. package/dist/editable-artifacts.js +240 -121
  104. package/dist/editable-artifacts.js.map +1 -1
  105. package/dist/embedding-client.d.ts +129 -0
  106. package/dist/errors.d.ts +36 -1
  107. package/dist/feedback.d.ts +23 -0
  108. package/dist/gateway-realtime-transport.js +1 -1
  109. package/dist/github-repositories.d.ts +10 -0
  110. package/dist/github-repositories.js +36 -0
  111. package/dist/github-repositories.js.map +1 -0
  112. package/dist/index.d.ts +56 -11
  113. package/dist/index.js +242 -125
  114. package/dist/index.js.map +1 -1
  115. package/dist/interaction.d.ts +84 -1
  116. package/dist/interaction.js +6 -1
  117. package/dist/knowledge.d.ts +7 -0
  118. package/dist/knowledge.js +20 -0
  119. package/dist/knowledge.js.map +1 -0
  120. package/dist/message-links.d.ts +68 -0
  121. package/dist/model-context.d.ts +68 -0
  122. package/dist/model-display.d.ts +2 -0
  123. package/dist/model-display.js +15 -0
  124. package/dist/model-display.js.map +1 -0
  125. package/dist/model-picker-order.d.ts +1 -0
  126. package/dist/model-picker-order.js +10 -0
  127. package/dist/model-picker-order.js.map +1 -0
  128. package/dist/organization-integration-policy.d.ts +26 -0
  129. package/dist/organization-integration-policy.js +26 -0
  130. package/dist/organization-integration-policy.js.map +1 -0
  131. package/dist/organization-private-session-settings.d.ts +6 -0
  132. package/dist/organization-private-session-settings.js +22 -0
  133. package/dist/organization-private-session-settings.js.map +1 -0
  134. package/dist/organization-user-setup.d.ts +8 -0
  135. package/dist/organization-user-setup.js +16 -0
  136. package/dist/organization-user-setup.js.map +1 -0
  137. package/dist/pr-review-client.d.ts +16 -0
  138. package/dist/pr-review.d.ts +4 -0
  139. package/dist/pr-review.js +62 -0
  140. package/dist/pr-review.js.map +1 -0
  141. package/dist/preference-registry.d.ts +9 -1
  142. package/dist/proxy.d.ts +7 -5
  143. package/dist/realtime.d.ts +3 -1
  144. package/dist/realtime.js +6 -6
  145. package/dist/realtime.js.map +1 -1
  146. package/dist/retained-artifacts.d.ts +5 -1
  147. package/dist/session-history-import.d.ts +22 -0
  148. package/dist/session-history-import.js +36 -0
  149. package/dist/session-history-import.js.map +1 -0
  150. package/dist/session-list-entries.d.ts +1 -0
  151. package/dist/session-list-entries.js +7 -0
  152. package/dist/session-list-entries.js.map +1 -0
  153. package/dist/session-message-search.d.ts +53 -0
  154. package/dist/session-proxy-client.d.ts +24 -0
  155. package/dist/session-proxy.d.ts +245 -0
  156. package/dist/session-proxy.js +24 -0
  157. package/dist/session-proxy.js.map +1 -0
  158. package/dist/session-titles.d.ts +2 -0
  159. package/dist/site-browser-entry.d.ts +1 -0
  160. package/dist/site-browser-runtime.gen.d.ts +1 -0
  161. package/dist/site-document.d.ts +5 -0
  162. package/dist/site-document.js +20 -0
  163. package/dist/site-document.js.map +1 -0
  164. package/dist/site-document.test.d.ts +1 -0
  165. package/dist/site-http.d.ts +16 -0
  166. package/dist/site-tool-bridge.d.ts +44 -0
  167. package/dist/site.d.ts +101 -0
  168. package/dist/site.js +49 -0
  169. package/dist/site.js.map +1 -0
  170. package/dist/skills.d.ts +75 -0
  171. package/dist/stream.d.ts +2 -0
  172. package/dist/tenant-workspaces.d.ts +47 -0
  173. package/dist/tenant-workspaces.js +8 -0
  174. package/dist/tenant-workspaces.js.map +1 -0
  175. package/dist/tool-auth.d.ts +87 -0
  176. package/dist/tool-auth.js +23 -0
  177. package/dist/tool-auth.js.map +1 -0
  178. package/dist/tool-display-metadata.d.ts +3 -0
  179. package/dist/tools-FXBLUWAE.js +12 -0
  180. package/dist/tools-FXBLUWAE.js.map +1 -0
  181. package/dist/tools.d.ts +61 -0
  182. package/dist/types.d.ts +2863 -424
  183. package/dist/usage-allowances.d.ts +36 -0
  184. package/dist/usage-allowances.js +80 -0
  185. package/dist/usage-allowances.js.map +1 -0
  186. package/dist/workspace-artifacts.d.ts +33 -5
  187. package/dist/workspace-instruction-policies.d.ts +24 -2
  188. package/dist/workspace-integrations.d.ts +74 -0
  189. package/dist/workspace-integrations.js +65 -0
  190. package/dist/workspace-integrations.js.map +1 -0
  191. package/dist/workspace-learning.d.ts +124 -0
  192. package/dist/workspace-state.d.ts +8 -71
  193. package/package.json +108 -3
  194. package/src/accounts.ts +443 -0
  195. package/src/adapters/express.ts +136 -0
  196. package/src/adapters/hono.ts +18 -0
  197. package/src/adapters/next.ts +42 -0
  198. package/src/allowance-refusal.ts +5 -0
  199. package/src/artifact-catalog.ts +41 -0
  200. package/src/artifact-client.ts +43 -52
  201. package/src/artifacts.ts +7 -1
  202. package/src/automations-client.ts +124 -0
  203. package/src/automations.ts +15 -0
  204. package/src/browser.ts +54 -0
  205. package/src/chat/fold.ts +431 -0
  206. package/src/chat/handler.ts +240 -0
  207. package/src/chat/http.ts +257 -0
  208. package/src/chat/ids.ts +85 -0
  209. package/src/chat/index.ts +87 -0
  210. package/src/chat/openai.ts +439 -0
  211. package/src/chat/opengeni.ts +722 -0
  212. package/src/chat/types.ts +219 -0
  213. package/src/chat/vercel.ts +204 -0
  214. package/src/chats.ts +16 -0
  215. package/src/client.ts +4084 -515
  216. package/src/codex-realtime-controller.ts +235 -5
  217. package/src/codex-realtime-v3.ts +162 -31
  218. package/src/codex-realtime.ts +1 -1
  219. package/src/company-brain.ts +59 -0
  220. package/src/company-profile.ts +17 -1
  221. package/src/core.ts +23 -1
  222. package/src/deprecation.ts +149 -0
  223. package/src/document-authority-client.ts +219 -0
  224. package/src/document-authority.ts +17 -0
  225. package/src/editable-artifacts/browser-session.ts +36 -22
  226. package/src/editable-artifacts/controller.ts +102 -47
  227. package/src/editable-artifacts/errors.ts +2 -0
  228. package/src/editable-artifacts/http-live-transport.ts +62 -37
  229. package/src/editable-artifacts/index.ts +6 -0
  230. package/src/editable-artifacts/open-failure.ts +79 -0
  231. package/src/editable-artifacts/storage.ts +31 -40
  232. package/src/editable-artifacts/types.ts +6 -3
  233. package/src/editable-artifacts/worker/kernel-adapter.ts +23 -7
  234. package/src/editable-artifacts/worker/runtime.ts +26 -13
  235. package/src/editable-artifacts/worker/wire-codec.ts +23 -5
  236. package/src/embedding-client.ts +519 -0
  237. package/src/errors.ts +169 -2
  238. package/src/feedback.ts +20 -0
  239. package/src/gateway-realtime-transport.ts +3 -3
  240. package/src/github-repositories.ts +60 -0
  241. package/src/index.ts +561 -41
  242. package/src/interaction.ts +276 -4
  243. package/src/knowledge.ts +72 -0
  244. package/src/message-links.ts +178 -0
  245. package/src/model-context.ts +112 -0
  246. package/src/model-display.ts +10 -0
  247. package/src/model-picker-order.ts +6 -0
  248. package/src/organization-integration-policy.ts +54 -0
  249. package/src/organization-private-session-settings.ts +33 -0
  250. package/src/organization-user-setup.ts +31 -0
  251. package/src/pr-review-client.ts +92 -0
  252. package/src/pr-review.ts +17 -0
  253. package/src/preference-registry.ts +11 -0
  254. package/src/proxy.ts +17 -6
  255. package/src/realtime.ts +1 -0
  256. package/src/retained-artifacts.ts +101 -0
  257. package/src/session-history-import.ts +84 -0
  258. package/src/session-list-entries.ts +1 -0
  259. package/src/session-message-search.ts +47 -0
  260. package/src/session-proxy-client.ts +64 -0
  261. package/src/session-proxy.ts +1473 -0
  262. package/src/session-titles.ts +10 -0
  263. package/src/site-browser-entry.ts +6 -0
  264. package/src/site-browser-runtime.gen.ts +2 -0
  265. package/src/site-document.test.ts +64 -0
  266. package/src/site-document.ts +18 -0
  267. package/src/site-http.ts +162 -0
  268. package/src/site-tool-bridge.ts +146 -0
  269. package/src/site.ts +585 -0
  270. package/src/skills.ts +69 -0
  271. package/src/sse.ts +8 -2
  272. package/src/stream.ts +38 -4
  273. package/src/tenant-workspaces.ts +148 -0
  274. package/src/tool-auth.ts +301 -0
  275. package/src/tool-display-metadata.ts +19 -0
  276. package/src/tools.ts +396 -0
  277. package/src/types.ts +3346 -501
  278. package/src/usage-allowances.ts +189 -0
  279. package/src/workspace-artifacts.ts +40 -6
  280. package/src/workspace-instruction-policies.ts +26 -1
  281. package/src/workspace-integrations.ts +402 -0
  282. package/src/workspace-learning.ts +138 -0
  283. package/src/workspace-state.ts +8 -82
  284. package/dist/chunk-GU6JF75T.js +0 -119
  285. package/dist/chunk-GU6JF75T.js.map +0 -1
  286. package/dist/chunk-HJ3HHUT5.js.map +0 -1
  287. package/dist/chunk-JDLDDRNE.js.map +0 -1
  288. package/dist/chunk-JRPFWI6T.js.map +0 -1
  289. package/dist/chunk-PKQ377ED.js.map +0 -1
  290. package/dist/chunk-ST5DDKJP.js.map +0 -1
  291. package/dist/chunk-VWE2QIVO.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { WorkspaceTranscriptionPolicy } from "./transcription.js";
2
+ export type { ClaudeSubscriptionOAuthStartResponse, ClaudeSubscriptionOAuthCompleteRequest, ClaudeSubscriptionOAuthCompleteResponse, } from "@opengeni/contracts";
3
+ export type { SessionMessageSearchRequest, SessionMessageSearchMatch, SessionMessageSearchResponse, SessionMessagePreview, SessionMessagePreviewReference, } from "./session-message-search.js";
4
+ export type BundledSkillId = "builtin:opengeni-help" | "builtin:opengeni-client" | "builtin:opengeni-visualize" | "builtin:document-parsing" | "builtin:opengeni-skills" | "builtin:opengeni-projects" | "builtin:opengeni-schedules" | "builtin:opengeni-documents" | "builtin:opengeni-spreadsheets" | "builtin:opengeni-presentations" | "builtin:opengeni-sites" | "builtin:opengeni-video-generation";
2
5
  export type CodexRealtimeWebrtcVersion = "v3";
3
6
  export type CodexRealtimeVoice = "juniper" | "maple" | "spruce" | "ember" | "vale" | "breeze" | "arbor" | "sol" | "cove";
4
7
  export type CodexRealtimeWebrtcRequest = {
@@ -51,6 +54,74 @@ export type GatewayRealtimeConnectResponse = {
51
54
  instructions: string;
52
55
  replay: false;
53
56
  };
57
+ export type ToolGatewayIdentity = {
58
+ serverId: string;
59
+ toolName: string;
60
+ };
61
+ export type ToolGatewayCatalogEntry = {
62
+ identity: ToolGatewayIdentity;
63
+ modelName: string;
64
+ codemodePath: string[];
65
+ title?: string | undefined;
66
+ description?: string | undefined;
67
+ inputSchema: Record<string, unknown>;
68
+ outputSchema?: Record<string, unknown> | undefined;
69
+ annotations?: Record<string, unknown> | undefined;
70
+ icons?: Array<Record<string, unknown>> | undefined;
71
+ source: "opengeni" | "files" | "docs" | "mcp" | "codex_apps" | "interaction";
72
+ approval: "none" | "human" | "policy";
73
+ };
74
+ export type ToolGatewayCatalog = {
75
+ version: 1;
76
+ accountId: string;
77
+ workspaceId: string;
78
+ generation: number;
79
+ digest: string;
80
+ createdAt: string;
81
+ entries: ToolGatewayCatalogEntry[];
82
+ };
83
+ export type ToolGatewayResult = {
84
+ content: Array<{
85
+ type: string;
86
+ [key: string]: unknown;
87
+ }>;
88
+ structuredContent?: Record<string, unknown> | undefined;
89
+ isError?: boolean | undefined;
90
+ _meta?: Record<string, unknown> | undefined;
91
+ [key: string]: unknown;
92
+ };
93
+ export type ToolGatewayCallRequest = {
94
+ operationId?: string | undefined;
95
+ catalogDigest: string;
96
+ identity: ToolGatewayIdentity;
97
+ arguments: Record<string, unknown>;
98
+ siteArtifactId?: string | undefined;
99
+ siteVersionId?: string | undefined;
100
+ approvalToken?: string | undefined;
101
+ };
102
+ export type ToolGatewayApprovalRequest = {
103
+ operationId: string;
104
+ catalogDigest: string;
105
+ identity: ToolGatewayIdentity;
106
+ arguments: Record<string, unknown>;
107
+ };
108
+ export type ToolGatewayApprovalResponse = {
109
+ operationId: string;
110
+ catalogDigest: string;
111
+ identity: ToolGatewayIdentity;
112
+ approvalToken: string;
113
+ expiresAt: string;
114
+ };
115
+ export type ToolGatewayCallResponse = {
116
+ operationId: string;
117
+ catalogDigest: string;
118
+ result: ToolGatewayResult;
119
+ };
120
+ export type ToolGatewayDeclarationsResponse = {
121
+ catalogDigest: string;
122
+ moduleSpecifier: string;
123
+ source: string;
124
+ };
54
125
  export type ActivateCodexRealtimeConnectionRequest = {
55
126
  operationId: string;
56
127
  browserInstanceId: string;
@@ -90,6 +161,8 @@ export type SessionRealtimeInboundEntry = {
90
161
  delegationItemId?: string | null | undefined;
91
162
  text?: string | null | undefined;
92
163
  payload?: Record<string, unknown> | undefined;
164
+ /** Model-visible application context attached to this exact realtime message. */
165
+ modelContext?: string | undefined;
93
166
  };
94
167
  export type SyncSessionRealtimeLedgerRequest = {
95
168
  browserInstanceId: string;
@@ -126,7 +199,7 @@ export type WorkspaceRealtimeModelCatalogResponse = {
126
199
  models: WorkspaceRealtimeModelCatalogItem[];
127
200
  };
128
201
  export type SessionRealtimeState = "active" | "ended";
129
- export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired";
202
+ export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired" | "authority_revoked";
130
203
  export type SessionRealtimeMode = {
131
204
  id: string;
132
205
  sessionId: string;
@@ -161,7 +234,7 @@ export type SessionRealtimeMutationResponse = {
161
234
  replay: boolean;
162
235
  };
163
236
  export type SessionStatus = "queued" | "running" | "idle" | "requires_action" | "recovering" | "waiting_capacity" | "failed" | "cancelled";
164
- export type SandboxBackend = "docker" | "modal" | "local" | "none" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted";
237
+ export type SandboxBackend = "docker" | "modal" | "local" | "none" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
165
238
  export type SandboxOs = "linux" | "macos" | "windows";
166
239
  export type SandboxCapabilityName = "FileSystem" | "Terminal" | "Git" | "DesktopStream" | "Recording";
167
240
  export type CapabilityUnavailableReason = "backend_unsupported" | "os_unsupported" | "not_provisioned" | "disabled_by_policy" | "lease_cold" | "tier_headless" | "agent_offline" | "agent_reconnecting" | "consent_required" | "display_unavailable";
@@ -218,6 +291,7 @@ export type SessionCapabilities = {
218
291
  codecs: ("h264-mp4" | "vp9-webm")[];
219
292
  reason: CapabilityUnavailableReason | null;
220
293
  };
294
+ /** @deprecated Use the managed ComputerSession interaction tools. */
221
295
  ComputerUse: {
222
296
  available: boolean;
223
297
  readOnly: boolean;
@@ -230,6 +304,7 @@ export type TerminalCapability = SessionCapabilities["Terminal"];
230
304
  export type GitCapability = SessionCapabilities["Git"];
231
305
  export type DesktopStreamCapability = SessionCapabilities["DesktopStream"];
232
306
  export type RecordingCapability = SessionCapabilities["Recording"];
307
+ /** @deprecated Use the managed ComputerSession interaction tools. */
233
308
  export type ComputerUseCapability = SessionCapabilities["ComputerUse"];
234
309
  export type StreamUrlRotatedPayload = {
235
310
  url: string;
@@ -304,6 +379,8 @@ export type RepositoryResourceRef = {
304
379
  kind: "repository";
305
380
  uri: string;
306
381
  ref: string;
382
+ /** Exact immutable commit that repository materialization must produce. */
383
+ expectedCommitSha?: string | undefined;
307
384
  /**
308
385
  * Optional workspace-relative override. When omitted, OpenGeni persists
309
386
  * `repos/<encoded-host>/<owner>/<repo>` so equal names on different Git
@@ -313,6 +390,7 @@ export type RepositoryResourceRef = {
313
390
  mountPath?: string | undefined;
314
391
  subpath?: string | undefined;
315
392
  provider?: GitCredentialProvider | undefined;
393
+ connectionType?: "github_personal" | undefined;
316
394
  credentialBindingId?: GitCredentialBindingId | undefined;
317
395
  access?: GitRepositoryAccess | undefined;
318
396
  repositoryId?: number | string | undefined;
@@ -321,6 +399,12 @@ export type RepositoryResourceRef = {
321
399
  connectionId?: string | undefined;
322
400
  githubInstallationId?: number | undefined;
323
401
  githubRepositoryId?: number | undefined;
402
+ /**
403
+ * Best-effort materialization: a failed clone logs a warning and the
404
+ * session continues without this repository instead of failing sandbox
405
+ * setup. Omit it to keep a failed clone fatal.
406
+ */
407
+ optional?: boolean | undefined;
324
408
  };
325
409
  /** Value mirror of `@opengeni/contracts`; parity-tested without importing it from ordinary SDK entries. */
326
410
  export declare const DEFAULT_FILE_RESOURCE_MOUNT_ROOT: ".opengeni/files";
@@ -334,14 +418,22 @@ export type ResourceRef = RepositoryResourceRef | FileResourceRef;
334
418
  export type ToolRef = {
335
419
  kind: "mcp";
336
420
  id: string;
421
+ /** Skip this server when its connect/tools-list fails instead of failing the turn. */
337
422
  optional?: boolean | undefined;
423
+ /**
424
+ * Put this server's tool schemas on the first model request instead of behind
425
+ * `tool_search` progressive discovery. A startup choice only; grants nothing.
426
+ */
427
+ eager?: boolean | undefined;
338
428
  };
339
429
  export type SessionToolPolicy = {
340
430
  mode: "workspace_default" | "explicit" | "inherited";
341
431
  inheritedFromSessionId: string | null;
432
+ excludedMcpServerIds?: string[] | undefined;
342
433
  };
343
434
  export type UpdateSessionToolPolicyRequest = {
344
435
  mode: "workspace_default";
436
+ excludedMcpServerIds?: string[] | undefined;
345
437
  expectedVersion: number;
346
438
  } | {
347
439
  mode: "explicit";
@@ -371,9 +463,20 @@ export type SessionEffectiveToolPolicy = {
371
463
  };
372
464
  idsTruncated: boolean;
373
465
  };
466
+ export type SessionGoalReportRequirement = {
467
+ id: string;
468
+ title: string;
469
+ };
470
+ export type SessionGoalReportDelivery = {
471
+ requirementId: string;
472
+ artifactId: string;
473
+ inspectionReceiptId: string;
474
+ };
374
475
  export type GoalSpec = {
375
476
  text: string;
376
477
  successCriteria?: string | undefined;
478
+ rootConstraints?: string[] | undefined;
479
+ reportRequirements?: SessionGoalReportRequirement[] | undefined;
377
480
  maxAutoContinuations?: number | undefined;
378
481
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
379
482
  };
@@ -393,6 +496,28 @@ export type SessionMcpCredentialUpdateInput = {
393
496
  id: string;
394
497
  headers: Record<string, string>;
395
498
  };
499
+ export type RotateSessionMcpCredentialsRequest = {
500
+ operationKey: string;
501
+ updates: Array<{
502
+ id: string;
503
+ expectedCredentialVersion: number;
504
+ expectedServerUrl: string;
505
+ } & ({
506
+ headers: Record<string, string>;
507
+ } | {
508
+ nativeConnectionId: string;
509
+ replacementServerUrl?: string | undefined;
510
+ })>;
511
+ };
512
+ export type RotateSessionMcpCredentialsReceipt = {
513
+ operationKey: string;
514
+ sessionId: string;
515
+ servers: Array<{
516
+ id: string;
517
+ credentialVersion: number;
518
+ }>;
519
+ appliedAt: string;
520
+ };
396
521
  export type SessionMcpApprovalPolicy = boolean | string[];
397
522
  export type SessionMcpServerMetadata = {
398
523
  id: string;
@@ -407,13 +532,45 @@ export type UpdateSessionMcpApprovalPolicyRequest = {
407
532
  requireApproval: SessionMcpApprovalPolicy;
408
533
  };
409
534
  export type UpdateSessionMcpApprovalPolicyResponse = {
410
- server: SessionMcpServerMetadata;
535
+ server: SessionMcpApprovalPolicyTarget;
411
536
  effectiveFrom: "next_attempt";
412
537
  };
538
+ export type SessionMcpApprovalPolicyTarget = SessionMcpServerMetadata | {
539
+ id: string;
540
+ source: "workspace";
541
+ requireApproval: SessionMcpApprovalPolicy;
542
+ };
413
543
  export type ConnectionKind = "oauth2" | "api_key" | "app_install" | "delegated";
414
544
  export type ConnectionStatus = "active" | "needs_reauth" | "revoked" | "error";
545
+ export type UserResourceDelegation = {
546
+ authorityId: string;
547
+ grantId: string;
548
+ organizationId: string;
549
+ workspaceId: string;
550
+ sessionId: string | null;
551
+ action: string;
552
+ mode: "once" | "session" | "always";
553
+ context: "user_private" | "workspace_shared";
554
+ authorityEpoch: number | null;
555
+ authorityGeneration: number;
556
+ grantGeneration: number;
557
+ resourceVersionId?: string | null | undefined;
558
+ };
559
+ export type McpConnectionAccountSelection = {
560
+ serverId: string;
561
+ connectionId: string;
562
+ };
415
563
  export type McpServerConnectionRef = {
416
564
  connectionId?: string | undefined;
565
+ accountSelection?: "all_eligible" | undefined;
566
+ authoritySource?: "host" | undefined;
567
+ /** accepted_turn is configuration-only; each accepted owner must select a grant. */
568
+ hostBinding?: {
569
+ bindingId: string;
570
+ generation: number;
571
+ } | {
572
+ selection: "accepted_turn";
573
+ } | undefined;
417
574
  provider?: string | undefined;
418
575
  providerDomain: string;
419
576
  kind?: ConnectionKind | undefined;
@@ -435,6 +592,7 @@ export type McpPersonalConnectionDelegation = {
435
592
  export type McpPersonalConnectionSummary = Pick<McpPersonalConnectionDelegation, "serverId" | "providerDomain">;
436
593
  export type ConnectionMetadata = {
437
594
  id: string;
595
+ authorityId?: string | undefined;
438
596
  accountId: string;
439
597
  workspaceId: string;
440
598
  subjectId: string | null;
@@ -455,16 +613,154 @@ export type ConnectionMetadata = {
455
613
  createdAt: string;
456
614
  updatedAt: string;
457
615
  };
458
- export type CreateConnectionRequest = {
616
+ /** Where a brokered credential is written on each outbound provider request. */
617
+ export type ConnectionCredentialPlacement = {
618
+ carrier: "header" | "query" | "cookie";
619
+ name: string;
620
+ value: string;
621
+ /** Prepended to `value`, for example `"Bearer "` or `"Token "`. */
622
+ prefix?: string | undefined;
623
+ };
624
+ /**
625
+ * Write-only secret for a brokered `api_key` Connection (API Integrations and
626
+ * MCP servers). The broker never infers a location: use exact `headers`, or
627
+ * `placements` when the provider expects a query parameter or cookie (API
628
+ * Integrations only) or a prefixed value. Match the carrier/name reported by
629
+ * `previewApiIntegration().auth`. A bare `{ apiKey }` is rejected with 422.
630
+ *
631
+ * @example { headers: { Authorization: "Token abc123" } }
632
+ * @example { placements: [{ carrier: "header", name: "X-Api-Key", value: "abc123" }] }
633
+ */
634
+ export type ApiKeyConnectionCredential = {
635
+ headers: Record<string, string>;
636
+ placements?: never;
637
+ } | {
638
+ placements: ConnectionCredentialPlacement[];
639
+ headers?: never;
640
+ };
641
+ type CreateConnectionRequestBase = {
459
642
  providerDomain: string;
460
- kind: ConnectionKind;
461
643
  ownership?: ConnectionOwnership | undefined;
462
644
  /** @deprecated use ownership */
463
645
  subjectId?: string | null | undefined;
464
- credential: Record<string, unknown>;
465
646
  grantedScopes?: string[] | undefined;
466
647
  expiresAt?: string | null | undefined;
648
+ operationId?: string | undefined;
649
+ /** Direct OpenAI/Azure keys only: verify the provider/model before saving. */
650
+ verifyModelAccess?: boolean | undefined;
651
+ };
652
+ export type CreateConnectionRequest = CreateConnectionRequestBase & ({
653
+ kind: "api_key";
654
+ credential: ApiKeyConnectionCredential;
655
+ metadata?: Record<string, unknown> | undefined;
656
+ } | {
657
+ /**
658
+ * Workspace model-provider key lane (Vercel AI Gateway / OpenRouter),
659
+ * selected by `metadata.credentialRole`; not usable by integrations.
660
+ */
661
+ kind: "api_key";
662
+ credential: {
663
+ apiKey: string;
664
+ };
665
+ metadata: {
666
+ credentialRole: string;
667
+ } & Record<string, unknown>;
668
+ } | {
669
+ kind: Exclude<ConnectionKind, "api_key">;
670
+ credential: Record<string, unknown>;
467
671
  metadata?: Record<string, unknown> | undefined;
672
+ });
673
+ export type PersonalGitHubConnectionMetadata = {
674
+ credentialRole: "opengeni_github_personal";
675
+ providerFamily: "github";
676
+ providerPrincipalId: string;
677
+ githubUserId: string;
678
+ githubLogin: string;
679
+ oauthEnvironment: string;
680
+ oauthClientMarker: string;
681
+ credentialBindingId: string;
682
+ connectedAt: string;
683
+ lastVerifiedAt: string;
684
+ refreshTokenExpiresAt?: string | null | undefined;
685
+ disconnectedAt?: string | null | undefined;
686
+ [key: string]: unknown;
687
+ };
688
+ export type PersonalGitHubOAuthStartRequest = {
689
+ connectionId?: string | undefined;
690
+ returnPath?: string | undefined;
691
+ };
692
+ export type PersonalGitHubOAuthStartResponse = {
693
+ authorizationUrl: string;
694
+ expiresAt: string;
695
+ };
696
+ export type PersonalGitHubConnectionStatusResponse = {
697
+ enabled: boolean;
698
+ connection: ConnectionMetadata | null;
699
+ reviewUrl: string | null;
700
+ };
701
+ export type PersonalGitHubDisconnectRequest = {
702
+ expectedVersion: number;
703
+ idempotencyKey: string;
704
+ };
705
+ export type PersonalGitHubRepositoryAccess = "read" | "write";
706
+ export type PersonalGitHubRepositoryPermissions = {
707
+ pull: boolean;
708
+ push: boolean;
709
+ admin: boolean;
710
+ maintain: boolean;
711
+ triage: boolean;
712
+ };
713
+ export type PersonalGitHubRepository = {
714
+ repositoryId: string;
715
+ fullName: string;
716
+ canonicalUrl: string;
717
+ defaultBranch: string;
718
+ visibility: "public" | "private" | "internal";
719
+ private: boolean;
720
+ archived: boolean;
721
+ disabled: boolean;
722
+ permissions: PersonalGitHubRepositoryPermissions;
723
+ };
724
+ export type PersonalGitHubSelectedRepository = PersonalGitHubRepository & {
725
+ selectedAccess: PersonalGitHubRepositoryAccess;
726
+ selectionGeneration: number;
727
+ selectedAt: string;
728
+ lastVerifiedAt: string;
729
+ };
730
+ export type PersonalGitHubRepositorySelectionState = {
731
+ connectionAuthorityGeneration: number;
732
+ credentialBindingId: string;
733
+ providerPrincipalId: string;
734
+ selectionGeneration: number;
735
+ repositories: PersonalGitHubSelectedRepository[];
736
+ };
737
+ export type PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository & {
738
+ selectedAccess: PersonalGitHubRepositoryAccess | null;
739
+ };
740
+ export type ListPersonalGitHubRepositoriesOptions = {
741
+ cursor?: number | undefined;
742
+ limit?: number | undefined;
743
+ };
744
+ export type ListPersonalGitHubRepositoriesResponse = {
745
+ repositories: PersonalGitHubRepositoryCatalogItem[];
746
+ nextCursor: number | null;
747
+ selection: PersonalGitHubRepositorySelectionState;
748
+ };
749
+ export type PersonalGitHubRepositorySelectionInput = {
750
+ repositoryId: string;
751
+ fullName: string;
752
+ access: PersonalGitHubRepositoryAccess;
753
+ };
754
+ export type ReplacePersonalGitHubRepositorySelectionsRequest = {
755
+ expectedConnectionAuthorityGeneration: number;
756
+ expectedSelectionGeneration: number;
757
+ idempotencyKey: string;
758
+ repositories: PersonalGitHubRepositorySelectionInput[];
759
+ };
760
+ export type VerifyPersonalGitHubRepositorySelectionsRequest = {
761
+ expectedConnectionAuthorityGeneration: number;
762
+ expectedSelectionGeneration: number;
763
+ idempotencyKey: string;
468
764
  };
469
765
  export type OpenGeniSlackBotInstallRequest = {
470
766
  /** Existing OpenGeni Slack bot connection to reinstall in place. */
@@ -477,6 +773,7 @@ export type FikenInstallRequest = {
477
773
  connectionId?: string | undefined;
478
774
  };
479
775
  export type FikenOAuthStartRequest = {
776
+ returnPath?: string | undefined;
480
777
  /** Existing Fiken connection to re-authorize in place (reconnect). */
481
778
  connectionId?: string | undefined;
482
779
  };
@@ -502,7 +799,7 @@ export type SlackInstallationBinding = {
502
799
  slackTeamName: string;
503
800
  botId: string;
504
801
  botUserId: string;
505
- botDisplayName: "OpenGeni";
802
+ botDisplayName: "OpenGeni" | "OpenGeni Staging";
506
803
  state: SlackInstallationBindingState;
507
804
  quarantineReason: string | null;
508
805
  version: number;
@@ -556,16 +853,25 @@ export type GoogleDriveConnectionMetadata = {
556
853
  googleEmail: string;
557
854
  googleDisplayName: string | null;
558
855
  verifiedAt: string;
559
- accessMode: "metadata_readonly" | "readonly";
856
+ accessMode: "file_only" | "metadata_readonly" | "readonly";
560
857
  lifecycle?: GoogleDriveConnectionLifecycle | undefined;
858
+ outputDestination?: GoogleDriveOutputDestination | undefined;
561
859
  documentDestination?: ConnectorDocumentDestination | undefined;
562
860
  selectedSources?: GoogleDriveSelectedSource[] | undefined;
563
861
  /** @deprecated Read selectedSources; retained while existing connections migrate. */
564
862
  selectedSource?: GoogleDriveSelectedSource | null | undefined;
565
863
  [key: string]: unknown;
566
864
  };
865
+ export type GoogleDriveOutputDestination = {
866
+ folderId: string;
867
+ folderName: string;
868
+ driveId: string | null;
869
+ location: "my_drive" | "shared_drive";
870
+ selectedAt: string;
871
+ };
567
872
  export type GoogleDriveOAuthStartRequest = {
568
873
  connectionId?: string | undefined;
874
+ capability?: "source_read" | "publish" | undefined;
569
875
  };
570
876
  export type GoogleDriveOAuthStartResponse = {
571
877
  authorizationUrl: string;
@@ -711,6 +1017,8 @@ export type UpdateConnectionRequest = {
711
1017
  grantedScopes?: string[] | undefined;
712
1018
  expiresAt?: string | null | undefined;
713
1019
  metadata?: Record<string, unknown> | undefined;
1020
+ expectedVersion?: number | undefined;
1021
+ operationId?: string | undefined;
714
1022
  };
715
1023
  export type ConnectionResponse = {
716
1024
  connection: ConnectionMetadata;
@@ -725,6 +1033,8 @@ export type OAuthStartRequest = {
725
1033
  resource?: string | undefined;
726
1034
  requestedScopes?: string[] | undefined;
727
1035
  returnPath?: string | undefined;
1036
+ /** Exact trusted-host destination; requires verified external-user mode. */
1037
+ returnUrl?: string | undefined;
728
1038
  connectionId?: string | undefined;
729
1039
  ownership?: ConnectionOwnership | undefined;
730
1040
  oauthClient?: {
@@ -785,11 +1095,123 @@ export type IntegrationClientMetadata = {
785
1095
  grant_types: Array<"authorization_code" | "refresh_token">;
786
1096
  response_types: ["code"];
787
1097
  };
1098
+ export type SessionVisibility = "private" | "workspace";
1099
+ export type SessionTenancyCreateCapabilities = {
1100
+ activated: boolean;
1101
+ canCreatePrivate: boolean;
1102
+ reason: "available" | "not_activated" | "managed_session_required" | "unavailable";
1103
+ };
1104
+ export type SessionTenancyPublicProjection = {
1105
+ visibility: SessionVisibility;
1106
+ authorityEpoch: number;
1107
+ ownedByCurrentUser: boolean;
1108
+ fork: {
1109
+ sourceVisibility: SessionVisibility;
1110
+ sourceAuthorityEpoch: number;
1111
+ forkedAt: string;
1112
+ } | null;
1113
+ };
1114
+ export type UpdateSessionVisibilityRequest = {
1115
+ visibility: SessionVisibility;
1116
+ expectedAuthorityEpoch: number;
1117
+ idempotencyKey: string;
1118
+ };
1119
+ export type UpdateSessionVisibilityResponse = {
1120
+ operationId: string;
1121
+ eventId: string | null;
1122
+ eventSequence: number | null;
1123
+ visibility: SessionVisibility;
1124
+ authorityEpoch: number;
1125
+ changed: boolean;
1126
+ replay: boolean;
1127
+ revokedGrantCount: number;
1128
+ };
1129
+ export type ForkSessionRequest = {
1130
+ idempotencyKey: string;
1131
+ visibility: SessionVisibility;
1132
+ workspaceSharedAcknowledged: boolean;
1133
+ rigId?: string | null | undefined;
1134
+ variableSetIds?: string[] | undefined;
1135
+ };
1136
+ export type ForkSessionResponse = {
1137
+ operationId: string;
1138
+ eventId: string;
1139
+ eventSequence: number;
1140
+ sessionId: string;
1141
+ workspaceId: string;
1142
+ visibility: SessionVisibility;
1143
+ authorityEpoch: 1;
1144
+ copiedHistoryItemCount: number;
1145
+ replay: boolean;
1146
+ };
1147
+ export type SessionBackgroundCommandActivity = {
1148
+ unavailableCount?: number | undefined;
1149
+ state: "running" | "stopping";
1150
+ count: number;
1151
+ };
1152
+ /** Stored reconciliation checkpoints, not a live provider probe or native ACK. */
1153
+ export type SessionBackgroundCommandReconciliation = {
1154
+ lastOutcome: string | null;
1155
+ attempts: number;
1156
+ dueAt: string;
1157
+ claimedAt: string | null;
1158
+ terminalProof: {
1159
+ outcome: "exited";
1160
+ exitCode: number;
1161
+ observedAt: string;
1162
+ } | {
1163
+ outcome: "lost";
1164
+ exitCode: null;
1165
+ observedAt: string;
1166
+ } | null;
1167
+ };
1168
+ export type SessionBackgroundCommand = {
1169
+ observationStatus?: "unavailable" | undefined;
1170
+ reconciliation?: SessionBackgroundCommandReconciliation | undefined;
1171
+ id: string;
1172
+ workspaceId: string;
1173
+ sessionId: string;
1174
+ provider: "managed" | "connected_machine";
1175
+ state: "running" | "stopping" | "exited" | "lost";
1176
+ commandPreview: string;
1177
+ commandText?: string | undefined;
1178
+ cancelRequestedAt: string | null;
1179
+ exitCode: number | null;
1180
+ settlementReason: string | null;
1181
+ startedAt: string;
1182
+ settledAt: string | null;
1183
+ updatedAt: string;
1184
+ };
1185
+ export type SessionBackgroundCommandListResponse = {
1186
+ commands: SessionBackgroundCommand[];
1187
+ };
1188
+ export type CancelSessionBackgroundCommandResult = {
1189
+ command: SessionBackgroundCommand;
1190
+ accepted: boolean;
1191
+ };
788
1192
  export type Session = {
1193
+ /** Detail-only dispatch evidence; delivery does not prove turn execution. */
1194
+ dispatchWait?: {
1195
+ state: "pending" | "acknowledged" | "unavailable";
1196
+ attempts: number;
1197
+ nextAttemptAt: string | null;
1198
+ lastError: string | null;
1199
+ } | null | undefined;
1200
+ /** Detail-only failure evidence through lastSequence; independent of timeline paging. */
1201
+ failureDiagnostics?: {
1202
+ eventId: string;
1203
+ sequence: number;
1204
+ turnId: string | null;
1205
+ occurredAt: string;
1206
+ payload: unknown;
1207
+ } | null | undefined;
1208
+ bundledSkillIds?: BundledSkillId[] | undefined;
789
1209
  id: string;
790
1210
  workspaceId: string;
791
1211
  accountId: string;
792
1212
  status: SessionStatus;
1213
+ backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
1214
+ hasSchedules?: boolean | undefined;
793
1215
  initialMessage: string;
794
1216
  title: string | null;
795
1217
  titleSource: "user" | "agent" | null;
@@ -803,10 +1225,14 @@ export type Session = {
803
1225
  toolPolicyVersion: number;
804
1226
  effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
805
1227
  metadata: Record<string, unknown>;
1228
+ /** Present only when session-tenancy product activation is enabled for the organization. */
1229
+ tenancy?: SessionTenancyPublicProjection | undefined;
806
1230
  /** Frozen creator fact; later turns carry their own independent initiator. */
807
1231
  createdBy: TurnInitiator;
808
1232
  createdByContext: Record<string, unknown>;
809
1233
  model: string;
1234
+ reasoningEffort: ReasoningEffort;
1235
+ latencyMode: LatencyMode;
810
1236
  sandboxBackend: SandboxBackend;
811
1237
  sandboxOs: SandboxOs;
812
1238
  sandboxGroupId: string;
@@ -814,6 +1240,8 @@ export type Session = {
814
1240
  activeEpoch: number;
815
1241
  /** Explicit connected-machine project root; null uses the agent launch root. */
816
1242
  workingDir: string | null;
1243
+ /** Ordered low-to-high precedence; the final entry is the legacy singular alias. */
1244
+ variableSetIds?: string[] | undefined;
817
1245
  variableSetId: string | null;
818
1246
  /** @deprecated use variableSetId */
819
1247
  environmentId: string | null;
@@ -823,7 +1251,15 @@ export type Session = {
823
1251
  channelId: string | null;
824
1252
  firstPartyMcpPermissions: string[] | null;
825
1253
  firstPartyMcpTools: FirstPartyMcpToolName[];
1254
+ /**
1255
+ * Frozen agent configuration; null for sessions created without one (legacy
1256
+ * behavior). Omitted by older servers.
1257
+ */
1258
+ agent?: ResolvedAgentConfig | null | undefined;
1259
+ /** Capability-level view of what a configured session can use; null for legacy. */
1260
+ effectiveTools?: AgentEffectiveTools | null | undefined;
826
1261
  mcpServers: SessionMcpServerMetadata[];
1262
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
827
1263
  parentSessionId: string | null;
828
1264
  /** Immutable server-authored nested-agent lineage and policy snapshot. */
829
1265
  rootSessionId: string;
@@ -839,34 +1275,90 @@ export type Session = {
839
1275
  queueHeadPosition: number;
840
1276
  queueTailPosition: number;
841
1277
  effectiveControl: EffectiveSessionControl;
1278
+ /** Current durable input wait; an elapsed deadline does not prove a new turn started. */
1279
+ inputWait?: {
1280
+ deadlineAt: string;
1281
+ reason: string;
1282
+ } | null | undefined;
842
1283
  lastSequence: number;
843
1284
  /** Multi-account Codex (P1): the account this session is pinned to (null ⇒ follow workspace active). */
844
1285
  codexPinnedCredentialId?: string | null;
845
1286
  /** Multi-account Codex (P1): the account the most recent turn ran on (the "Running on:" indicator). */
846
1287
  codexLastCredentialId?: string | null;
1288
+ /** Accepted current-turn account, separate from future session preferences. */
1289
+ codexCurrentSelection?: {
1290
+ credentialId: string | null;
1291
+ waiting: boolean;
1292
+ } | null | undefined;
847
1293
  /**
848
1294
  * Frozen at create. `remote_v2` ⇒ Codex remote compaction + Codex-only model
849
1295
  * admission; `portable` ⇒ plaintext compaction and free provider switching.
850
1296
  */
851
1297
  codexCompactionMode: "remote_v2" | "portable";
1298
+ /**
1299
+ * The `code_search` decision frozen at create. A turn gets the tool only when
1300
+ * this is true, the deployment still offers it, the workspace is not Off, and
1301
+ * the turn has POSIX compute.
1302
+ */
1303
+ codeSearchEnabled?: boolean;
852
1304
  /** Personal (authenticated subject) workspace pin state, never workspace-global. */
853
1305
  pinned?: boolean;
854
1306
  /** Stable pin ordering key; null when this subject has not pinned the session. */
855
1307
  pinnedAt?: string | null;
856
1308
  /** Optimistic pin-state revision; zero represents an absent pin relation. */
857
1309
  pinVersion?: number;
1310
+ /** Personal explicit acknowledgment state. */
1311
+ unread?: boolean;
1312
+ /** Personal actively-working label. */
1313
+ activelyWorking?: boolean;
1314
+ /** Optimistic unread/actively-working revision. */
1315
+ attentionVersion?: number;
1316
+ /** Personal archive state. */
1317
+ archived?: boolean;
1318
+ archivedAt?: string | null;
1319
+ /**
1320
+ * Read-only imported timeline, independent of personal archive/restore state.
1321
+ * Never model-facing conversation history.
1322
+ */
1323
+ importedArchive?: {
1324
+ importId: string;
1325
+ importedAt: string;
1326
+ readOnly: true;
1327
+ } | undefined;
1328
+ /** Optimistic archive-state revision. */
1329
+ archiveVersion?: number;
858
1330
  /** Server-authoritative descendant counts populated by session-list reads. */
859
1331
  treeStats?: {
860
1332
  directChildren: number;
861
1333
  totalDescendants: number;
862
1334
  runningDescendants: number;
863
1335
  queuedDescendants: number;
1336
+ waitingDescendants?: number | undefined;
864
1337
  attentionDescendants: number;
865
1338
  pausedDescendants: number;
866
1339
  failedDescendants: number;
1340
+ unreadDescendants?: number | undefined;
1341
+ unreadFailedDescendants?: number | undefined;
1342
+ activelyWorkingDescendants?: number | undefined;
1343
+ /**
1344
+ * Earliest moment one of the counted `attentionDescendants` entered
1345
+ * `requires_action`; null when none is waiting, absent on older servers.
1346
+ */
1347
+ attentionSince?: string | null | undefined;
867
1348
  /** Counts are lower bounds rather than exact totals when true. */
868
1349
  truncated: boolean;
869
1350
  } | undefined;
1351
+ /**
1352
+ * When this session's own open turn entered `requires_action`. Populated by
1353
+ * list and lineage reads for `requires_action` sessions; null otherwise.
1354
+ */
1355
+ requiresActionSince?: string | null | undefined;
1356
+ /** Agent access scope; absent on servers before the agent-access release. */
1357
+ agentAccess?: SessionAgentAccess | undefined;
1358
+ /** Opaque end-user label; null when the session carries none. */
1359
+ scopeSubjectId?: SessionScopeSubjectId | null | undefined;
1360
+ /** Memory scope; absent on servers before the agent-access release. */
1361
+ memoryScope?: SessionMemoryScope | undefined;
870
1362
  createdAt: string;
871
1363
  updatedAt: string;
872
1364
  };
@@ -875,14 +1367,88 @@ export type CreateSessionResponse = Session & {
875
1367
  initialTurnId: string | null;
876
1368
  };
877
1369
  export type SessionSummary = Session;
878
- /** Canonical session-list page; pinned rows are excluded from ordinary pages. */
1370
+ /** Compact list-only record, excluding prompts and execution configuration. */
1371
+ export type SessionListEntry = Pick<Session, "id" | "workspaceId" | "accountId" | "status" | "backgroundCommandActivity" | "hasSchedules" | "title" | "titleSource" | "createdBy" | "channelId" | "parentSessionId" | "rootSessionId" | "effectiveControl" | "inputWait" | "lastSequence" | "pinned" | "pinnedAt" | "pinVersion" | "unread" | "activelyWorking" | "attentionVersion" | "archived" | "archivedAt" | "importedArchive" | "archiveVersion" | "treeStats" | "requiresActionSince" | "createdAt" | "updatedAt"> & {
1372
+ displayTitle: string;
1373
+ renameSeed: string;
1374
+ scheduledTaskId: string | null;
1375
+ siteOrigin: {
1376
+ siteId: string;
1377
+ title: string;
1378
+ } | null;
1379
+ };
1380
+ export type SessionListEntryResponse = Omit<SessionListResponse, "pinned" | "sessions"> & {
1381
+ projection: "summary";
1382
+ pinned: SessionListEntry[];
1383
+ sessions: SessionListEntry[];
1384
+ };
1385
+ /** Complete metadata for authorized roots and ordinary project trees. */
1386
+ export type SessionListTotals = {
1387
+ needsYouCount: number;
1388
+ groups: Array<{
1389
+ channelId: string | null;
1390
+ total: number;
1391
+ attention: number;
1392
+ attentionSince: string | null;
1393
+ failed: number;
1394
+ active: number;
1395
+ queued: number;
1396
+ unread: number;
1397
+ activeWork: number;
1398
+ }>;
1399
+ };
879
1400
  export type SessionListResponse = {
1401
+ totals?: SessionListTotals;
1402
+ needsYouOnly?: true;
880
1403
  pinned: Session[];
881
1404
  /** True when the server omitted older pins from its bounded pinned section. */
882
1405
  pinnedTruncated?: boolean;
1406
+ /** Present only when the server recognized and applied additive list filters. */
1407
+ filtersApplied?: true;
1408
+ /** Effective server ordering. Name: ASCII-space trim, ASCII case fold,
1409
+ * UTF-8 byte order, id ASC. Date keys and id ties are DESC. */
1410
+ sortBy?: "updatedAt" | "createdAt" | "name" | "archivedAt";
1411
+ archiveStatus?: "active" | "archived" | "all";
1412
+ /** Server-resolved Site origin filter, when requested. */
1413
+ originSiteId?: string;
883
1414
  sessions: Session[];
884
1415
  nextCursor: string | null;
885
1416
  };
1417
+ export type WorkClaimSubjectType = "repository" | "branch" | "pull_request" | "issue" | "artifact" | "release" | "ci_run" | "other";
1418
+ export type WorkClaimDiscoverySummary = {
1419
+ id: string;
1420
+ sessionId: string;
1421
+ subject: {
1422
+ namespace: string;
1423
+ type: WorkClaimSubjectType;
1424
+ canonicalKey: string;
1425
+ displayLabel: string | null;
1426
+ };
1427
+ role: "working" | "reviewing" | "monitoring" | "delivering";
1428
+ state: "active" | "released" | "superseded" | "stale";
1429
+ revision: number;
1430
+ provenance: "explicit_agent" | "user_api" | "trusted_integration" | "session_resource" | "system_lifecycle";
1431
+ version: {
1432
+ kind: "git_commit" | "branch_head" | "pull_request_head" | "artifact_version" | "release_version" | "ci_run" | "other";
1433
+ value: string;
1434
+ } | null;
1435
+ observedAt: string;
1436
+ updatedAt: string;
1437
+ settledAt: string | null;
1438
+ };
1439
+ export type WorkDiscoveryProjection = {
1440
+ claims: WorkClaimDiscoverySummary[];
1441
+ claimsTruncated: boolean;
1442
+ match: {
1443
+ class: "exact_subject" | "title" | "goal" | "fuzzy";
1444
+ field: "subject" | "title" | "goal" | "claim_key" | "claim_label";
1445
+ scoreBand: "exact" | "strong" | "related";
1446
+ claimId: string | null;
1447
+ } | null;
1448
+ possibleOverlap: boolean;
1449
+ advisoryOnly: true;
1450
+ noAdditionalAccess: true;
1451
+ };
886
1452
  /** Compact, bounded session projection for workspace agent-topology browsers. */
887
1453
  export type AgentTopologySession = {
888
1454
  id: string;
@@ -897,6 +1463,11 @@ export type AgentTopologySession = {
897
1463
  titleTruncated: boolean;
898
1464
  }>;
899
1465
  status: SessionStatus;
1466
+ goal: {
1467
+ status: SessionGoalStatus;
1468
+ summary: string;
1469
+ summaryTruncated: boolean;
1470
+ } | null;
900
1471
  pause: {
901
1472
  state: "active" | "paused";
902
1473
  additionalBlockerCount: number;
@@ -917,6 +1488,7 @@ export type AgentTopologySession = {
917
1488
  failedDescendants: number;
918
1489
  truncated: boolean;
919
1490
  };
1491
+ relatedWork: WorkDiscoveryProjection;
920
1492
  createdAt: string;
921
1493
  updatedAt: string;
922
1494
  };
@@ -924,17 +1496,30 @@ export type AgentTopologyPageResponse = {
924
1496
  sessions: AgentTopologySession[];
925
1497
  total: number;
926
1498
  hasMore: boolean;
1499
+ /** Operator rollout decision for human advisory presentation. */
1500
+ humanAdvisoriesEnabled?: boolean | undefined;
927
1501
  nextCursor: string | null;
928
1502
  };
929
1503
  export type UpdateSessionPinRequest = {
930
1504
  pinned: boolean;
931
1505
  expectedVersion?: number;
932
1506
  };
1507
+ export type UpdateSessionAttentionRequest = {
1508
+ unread?: boolean;
1509
+ acknowledgedThroughSequence?: number;
1510
+ activelyWorking?: boolean;
1511
+ expectedVersion?: number;
1512
+ };
1513
+ export type UpdateSessionArchiveRequest = {
1514
+ archived: boolean;
1515
+ expectedVersion?: number;
1516
+ };
933
1517
  export type LineageNode = {
934
1518
  session: SessionSummary;
935
1519
  children: LineageNode[];
936
1520
  };
937
1521
  export type SessionLineageResponse = {
1522
+ sessionHasSchedules?: boolean | undefined;
938
1523
  ancestors: SessionSummary[];
939
1524
  children: LineageNode[];
940
1525
  truncated: boolean;
@@ -965,6 +1550,21 @@ export type SubmittedTimelineAnnotation = DraftTimelineAnnotation;
965
1550
  export type TimelineAnnotation = DraftTimelineAnnotation & {
966
1551
  ordinal: number;
967
1552
  };
1553
+ export declare const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING_VERSION: 1;
1554
+ export declare const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING = "Personal resources used in a workspace-shared session may influence outputs visible to other workspace members. The underlying credentials and secret values are not shared by the attachment itself.";
1555
+ export type PersonalResourceAttachmentIntent = {
1556
+ mode: "once" | "session" | "always";
1557
+ expectedAuthorityEpoch?: number | undefined;
1558
+ workspaceSharedAcknowledged?: boolean | undefined;
1559
+ sharedOutputWarningVersion: 1;
1560
+ };
1561
+ export type PersonalResourceAttachmentSummary = {
1562
+ mode: "once" | "session" | "always";
1563
+ context: "user_private" | "workspace_shared";
1564
+ resourceCount: number;
1565
+ resourceKinds: Array<"variable_set" | "rig" | "connected_machine">;
1566
+ sharedOutputWarningVersion: 1;
1567
+ };
968
1568
  export type SessionTurn = {
969
1569
  id: string;
970
1570
  workspaceId: string;
@@ -992,6 +1592,7 @@ export type SessionTurn = {
992
1592
  initiator: TurnInitiator;
993
1593
  initiatorContext: Record<string, unknown>;
994
1594
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
1595
+ personalResources?: PersonalResourceAttachmentSummary | null | undefined;
995
1596
  cancelledBy?: string | null;
996
1597
  cancelReason?: string | null;
997
1598
  startedAt: string | null;
@@ -1005,7 +1606,16 @@ export type HumanInputOption = {
1005
1606
  label: string;
1006
1607
  description?: string | null | undefined;
1007
1608
  };
1609
+ export type SkillReviewReference = {
1610
+ removalOperationId?: string | undefined;
1611
+ sourceOperationId: string;
1612
+ skillId: string;
1613
+ revisionId: string;
1614
+ expectedRevisionId: string | null;
1615
+ expectedScopeVersion: number;
1616
+ };
1008
1617
  export type HumanInputQuestion = {
1618
+ skillReview?: SkillReviewReference | null | undefined;
1009
1619
  id: string;
1010
1620
  kind: HumanInputQuestionKind;
1011
1621
  prompt: string;
@@ -1054,7 +1664,7 @@ export type SessionHumanInputRequest = {
1054
1664
  createdAt: string;
1055
1665
  updatedAt: string;
1056
1666
  };
1057
- export declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.progress", "goal.rewrite.proposed", "goal.rewrite.rejected", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.visibility.changed", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1667
+ export declare const SESSION_EVENT_TYPES: readonly ["usage.threshold_reached", "usage.exhausted", "usage.period_reset", "session.created", "session.variable_sets.updated", "session.runtime.configured", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.dispatch.expired", "turn.capacity_waiting", "turn.startup.phase.started", "turn.startup.phase.completed", "turn.startup.phase.failed", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "session.command.backgrounded", "session.command.finished", "session.wait.started", "session.wait.finished", "sandbox.command.output.delta", "artifact.created", "knowledge.confirmation.recovered", "instruction.confirmation.recovered", "knowledge.source.prepared", "knowledge.source.failed", "goal.set", "goal.updated", "goal.progress", "goal.rewrite.proposed", "goal.rewrite.rejected", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.held", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.visibility.changed", "session.personal_resources.attached", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "session.agent.updated", "session.model_settings.updated", "codex.account.switched", "codex.account.selection.changed", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1058
1668
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1059
1669
  /**
1060
1670
  * Event types the SDK knows about today, kept open so a newer OpenGeni server
@@ -1067,6 +1677,8 @@ export type SessionEvent = {
1067
1677
  sessionId: string;
1068
1678
  /** Per-session sequence number: positive, contiguous, strictly increasing. */
1069
1679
  sequence: number;
1680
+ /** Server-owned durable high-water mark for a synthetic compact event. */
1681
+ coveredThrough?: number | undefined;
1070
1682
  type: SessionEventType;
1071
1683
  payload: unknown;
1072
1684
  occurredAt: string;
@@ -1178,11 +1790,17 @@ export type SessionEventPage = {
1178
1790
  };
1179
1791
  export type ToolAuthNeededPayload = {
1180
1792
  serverId: string;
1793
+ /** Configured connector for recovery; serverId retains the execution alias. */
1794
+ canonicalServerId?: string | undefined;
1795
+ /** Scope of the exact failed account, not the canonical catalog default. */
1796
+ connectionSubjectScope?: "workspace" | "subject" | undefined;
1181
1797
  toolName?: string | null | undefined;
1182
1798
  providerDomain: string;
1183
1799
  provider?: string | undefined;
1184
1800
  connectionId?: string | null | undefined;
1801
+ authoritySource?: "host" | undefined;
1185
1802
  reason: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable";
1803
+ hostReason?: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable" | undefined;
1186
1804
  scopes?: string[] | undefined;
1187
1805
  resource?: string | undefined;
1188
1806
  selectedResources?: Array<{
@@ -1200,6 +1818,13 @@ export type ToolAuthNeededPayload = {
1200
1818
  rationale: string;
1201
1819
  requiredVariables: string[];
1202
1820
  } | undefined;
1821
+ /** Agent suggestion; never a connection or permission grant. */
1822
+ setupRequest?: {
1823
+ kind: "mcp";
1824
+ name: string;
1825
+ endpointUrl: string;
1826
+ rationale: string;
1827
+ } | undefined;
1203
1828
  };
1204
1829
  export type AgentTextDeltaPayload = {
1205
1830
  text: string;
@@ -1212,6 +1837,11 @@ export type AgentToolCallCreatedPayload = {
1212
1837
  name: string;
1213
1838
  arguments: unknown;
1214
1839
  raw?: unknown | undefined;
1840
+ /**
1841
+ * Content-free analytics family: an OpenGeni first-party tool name,
1842
+ * `integration:<reviewed domain>`, or `custom`. Absent when unclassified.
1843
+ */
1844
+ toolFamily?: string | undefined;
1215
1845
  };
1216
1846
  export type AgentToolCallOutputPayload = {
1217
1847
  id: string | null;
@@ -1245,7 +1875,7 @@ export type CodexFleetDecisionEventPayload = {
1245
1875
  actual: {
1246
1876
  outcome: "selected" | "waiting" | "none";
1247
1877
  candidateKey: string | null;
1248
- reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "none";
1878
+ reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "allocator_disabled" | "none";
1249
1879
  };
1250
1880
  comparison: CodexFleetShadowComparison;
1251
1881
  replay: {
@@ -1365,11 +1995,16 @@ export type FsTreeNode = {
1365
1995
  truncated: boolean;
1366
1996
  };
1367
1997
  export type FsEncoding = "utf8" | "base64";
1998
+ export type FileSystemRouteIdentity = {
1999
+ epoch: number;
2000
+ root: string;
2001
+ };
1368
2002
  export type FsListRequest = {
1369
2003
  path?: string;
1370
2004
  depth?: number;
1371
2005
  maxEntries?: number;
1372
2006
  includeHidden?: boolean;
2007
+ route?: FileSystemRouteIdentity;
1373
2008
  };
1374
2009
  export type FsListResponse = {
1375
2010
  root: FsTreeNode;
@@ -1384,8 +2019,11 @@ export type FsListBatchResponse = {
1384
2019
  };
1385
2020
  export type FsReadRequest = {
1386
2021
  path: string;
2022
+ /** Confine this read to the session's working directory, refusing symlinks. */
2023
+ workspaceOnly?: boolean;
1387
2024
  encoding?: FsEncoding;
1388
2025
  maxBytes?: number;
2026
+ route?: FileSystemRouteIdentity;
1389
2027
  };
1390
2028
  export type FsReadResponse = {
1391
2029
  path: string;
@@ -1396,12 +2034,23 @@ export type FsReadResponse = {
1396
2034
  isBinary: boolean;
1397
2035
  revision: number;
1398
2036
  };
2037
+ export declare const SANDBOX_FILE_ARTIFACT_MAX_BYTES: number;
2038
+ export type PublishSandboxFileArtifactRequest = {
2039
+ path: string;
2040
+ };
2041
+ export type SandboxFileArtifactReceipt = {
2042
+ type: "sandbox_file";
2043
+ sandboxPath: string;
2044
+ filename: string;
2045
+ artifact: RetainedArtifactReference;
2046
+ };
1399
2047
  export type FsWriteRequest = {
1400
2048
  path: string;
1401
2049
  encoding?: FsEncoding;
1402
2050
  content: string;
1403
2051
  overwrite?: boolean;
1404
2052
  createParents?: boolean;
2053
+ route?: FileSystemRouteIdentity;
1405
2054
  };
1406
2055
  export type FsWriteResponse = {
1407
2056
  path: string;
@@ -1411,6 +2060,7 @@ export type FsWriteResponse = {
1411
2060
  export type FsDeleteRequest = {
1412
2061
  path: string;
1413
2062
  recursive?: boolean;
2063
+ route?: FileSystemRouteIdentity;
1414
2064
  };
1415
2065
  export type FsDeleteResponse = {
1416
2066
  revision: number;
@@ -1420,6 +2070,7 @@ export type FsMoveRequest = {
1420
2070
  newPath: string;
1421
2071
  overwrite?: boolean;
1422
2072
  createParents?: boolean;
2073
+ route?: FileSystemRouteIdentity;
1423
2074
  };
1424
2075
  export type FsMoveResponse = {
1425
2076
  path: string;
@@ -1429,6 +2080,7 @@ export type FsMoveResponse = {
1429
2080
  export type FsMkdirRequest = {
1430
2081
  path: string;
1431
2082
  recursive?: boolean;
2083
+ route?: FileSystemRouteIdentity;
1432
2084
  };
1433
2085
  export type FsMkdirResponse = {
1434
2086
  path: string;
@@ -1737,17 +2389,87 @@ export type ScheduledTaskScheduleSpec = {
1737
2389
  minute: number;
1738
2390
  daysOfWeek?: ScheduledTaskDayOfWeek[] | undefined;
1739
2391
  };
2392
+ export type IncidentTelemetrySeriesMetadata = {
2393
+ metric: string;
2394
+ labels: string[];
2395
+ };
2396
+ export type IncidentTelemetryDataRoute = {
2397
+ kind: "mcp";
2398
+ serverId: string;
2399
+ } | {
2400
+ kind: "first_party";
2401
+ tool: FirstPartyMcpToolName;
2402
+ } | {
2403
+ kind: "variable_set";
2404
+ variableSetName: string;
2405
+ variableNames: string[];
2406
+ } | {
2407
+ kind: "rig_credential_hook";
2408
+ credentialHookId: string;
2409
+ };
2410
+ export type IncidentTelemetryPreflight = {
2411
+ requiredResources: ResourceRef[];
2412
+ requiredMcpServerIds: string[];
2413
+ requiredFirstPartyMcpTools: FirstPartyMcpToolName[];
2414
+ requiredFirstPartyMcpPermissions: Permission[];
2415
+ requiredRig: {
2416
+ name: string;
2417
+ credentialHookIds: string[];
2418
+ } | null;
2419
+ requiredVariableSetNames: string[];
2420
+ requiredVariableNames: string[];
2421
+ dataSource: {
2422
+ kind: "prometheus";
2423
+ queryPath: "/api/v1/query" | "/api/v1/query_range";
2424
+ workspaceLabel: string;
2425
+ alertSelectorLabels: string[];
2426
+ route: IncidentTelemetryDataRoute;
2427
+ requiredSeries: IncidentTelemetrySeriesMetadata[];
2428
+ availableSeries: IncidentTelemetrySeriesMetadata[];
2429
+ };
2430
+ };
2431
+ export type IncidentTelemetryPreflightInput = Omit<IncidentTelemetryPreflight, "requiredResources" | "requiredMcpServerIds" | "requiredFirstPartyMcpTools" | "requiredFirstPartyMcpPermissions" | "requiredRig" | "requiredVariableSetNames" | "requiredVariableNames"> & {
2432
+ requiredResources?: ResourceRef[] | undefined;
2433
+ requiredMcpServerIds?: string[] | undefined;
2434
+ requiredFirstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2435
+ requiredFirstPartyMcpPermissions?: Permission[] | undefined;
2436
+ requiredRig?: {
2437
+ name: string;
2438
+ credentialHookIds?: string[] | undefined;
2439
+ } | null | undefined;
2440
+ requiredVariableSetNames?: string[] | undefined;
2441
+ requiredVariableNames?: string[] | undefined;
2442
+ };
1740
2443
  export type ScheduledTaskAgentConfig = {
2444
+ /** Agent configuration for every generated session; omitted keeps legacy behavior. */
2445
+ agent?: AgentConfigRequest | undefined;
2446
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2447
+ /** Read-only: the complete accepted account set, including an empty set. */
2448
+ connectionAccountsFrozen?: true | undefined;
2449
+ knowledgeSource?: Extract<ScheduledTaskAction, {
2450
+ kind: "knowledge_source_sync";
2451
+ }> | undefined;
2452
+ bundledSkillIds?: BundledSkillId[] | undefined;
1741
2453
  prompt: string;
1742
2454
  resources: ResourceRef[];
1743
2455
  tools: ToolRef[];
1744
2456
  metadata: Record<string, unknown>;
1745
2457
  slackBotConnectionId?: string | undefined;
2458
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
2459
+ slackBotChannelId?: string | undefined;
1746
2460
  model?: string | undefined;
1747
2461
  reasoningEffort?: ReasoningEffort | undefined;
1748
2462
  sandboxBackend?: SandboxBackend | undefined;
2463
+ machineTarget?: {
2464
+ targetSandboxId: string;
2465
+ workingDir?: string | undefined;
2466
+ } | undefined;
1749
2467
  goal?: GoalSpec | undefined;
2468
+ executionClass?: "incident_telemetry" | undefined;
2469
+ incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
1750
2470
  maxNestedAgentDepth?: number | undefined;
2471
+ /** Seconds a run may wait on a person before the scheduler answers for it. */
2472
+ approvalTimeoutSeconds?: number | undefined;
1751
2473
  };
1752
2474
  export type ScopedKnowledgeScope = {
1753
2475
  kind: "organization";
@@ -1798,6 +2520,8 @@ export type ScheduledTask = {
1798
2520
  accountId: string;
1799
2521
  workspaceId: string;
1800
2522
  name: string;
2523
+ /** Immutable execution owner; null for workspace/service tasks. */
2524
+ ownerSubjectId: string | null;
1801
2525
  status: ScheduledTaskStatus;
1802
2526
  schedule: ScheduledTaskScheduleSpec;
1803
2527
  temporalScheduleId: string;
@@ -1807,7 +2531,8 @@ export type ScheduledTask = {
1807
2531
  agentConfig: ScheduledTaskAgentConfig;
1808
2532
  createdBy?: TurnInitiator | undefined;
1809
2533
  createdByContext?: TurnInitiatorContext | undefined;
1810
- personalConnections?: McpPersonalConnectionSummary[] | undefined;
2534
+ authorityRevision: number;
2535
+ executionDigest: string;
1811
2536
  targetSessionId: string | null;
1812
2537
  reusableSessionId: string | null;
1813
2538
  variableSetId: string | null;
@@ -1817,20 +2542,66 @@ export type ScheduledTask = {
1817
2542
  metadata: Record<string, unknown>;
1818
2543
  createdAt: string;
1819
2544
  updatedAt: string;
2545
+ /** Read-only: what `refreshScheduledTaskAccess` would change, for a viewer who can act on it. */
2546
+ policyDrift?: ScheduledTaskPolicyDrift | null | undefined;
2547
+ };
2548
+ /** One connector named in a scheduled task's access report. */
2549
+ export type ScheduledTaskAccessConnector = {
2550
+ id: string;
2551
+ name: string;
2552
+ };
2553
+ /**
2554
+ * What a scheduled task's frozen connectors, connector accounts and OpenGeni
2555
+ * tools lack compared with what its owner would get by saving it again now.
2556
+ */
2557
+ export type ScheduledTaskPolicyDrift = {
2558
+ /** Workspace default connectors that new schedules get and this one lacks. */
2559
+ missingConnectors: ScheduledTaskAccessConnector[];
2560
+ /** Connectors this schedule names that this workspace no longer sets up; refresh drops them. */
2561
+ unavailableConnectors: ScheduledTaskAccessConnector[];
2562
+ /** Default OpenGeni tools missing from an agent-created task's frozen tools. */
2563
+ missingOpenGeniTools: FirstPartyMcpToolName[];
2564
+ /** Connectors whose chosen account can no longer be used by this schedule. */
2565
+ unavailableAccounts: ScheduledTaskAccessConnector[];
2566
+ /** Connectors this schedule has no account for, although one is now available. */
2567
+ attachableAccounts: ScheduledTaskAccessConnector[];
2568
+ /** Whether this viewer may run the refresh (a signed-in person, not a key or agent). */
2569
+ canRefresh: boolean;
2570
+ };
2571
+ /** Re-freeze with the caller's current authority; `executionDigest` is the reviewed head. */
2572
+ export type RefreshScheduledTaskAccessRequest = {
2573
+ executionDigest: string;
2574
+ /** Default connectors and OpenGeni tools to keep off; only narrows what the refresh adds. */
2575
+ leaveOut?: {
2576
+ connectors?: string[] | undefined;
2577
+ openGeniTools?: FirstPartyMcpToolName[] | undefined;
2578
+ } | undefined;
1820
2579
  };
1821
2580
  export type CreateSessionRequest = {
2581
+ /** Omitted: defaults/inheritance; []: no bundled guidance. Children cannot widen. */
2582
+ bundledSkillIds?: BundledSkillId[] | undefined;
2583
+ excludedMcpServerIds?: string[] | undefined;
1822
2584
  requestedSessionId?: string | undefined;
2585
+ visibility?: SessionVisibility | undefined;
1823
2586
  initialMessage?: string | undefined;
1824
2587
  /** Create an idle session shell so realtime voice can be the first interaction. */
1825
2588
  startMode?: "realtime" | undefined;
1826
- /** System instructions scoped to the initial turn; never visible timeline text. */
1827
- turnInstructions?: string | undefined;
2589
+ /** Model-visible application context attached to the initial user message; omitted by standard timeline rendering. */
2590
+ modelContext?: string | undefined;
1828
2591
  instructions?: string | undefined;
1829
2592
  /** Immutable normalized prompt-policy role; distinct from membership roles. */
1830
2593
  policyRole?: string | undefined;
1831
2594
  resources?: ResourceRef[] | undefined;
1832
2595
  /** Inline skills fixed onto this session; omitted children inherit them. */
1833
- skills?: SessionSkill[] | undefined;
2596
+ skills?: SessionSkillInput[] | undefined;
2597
+ /** Installed session-selected Skill identities to freeze onto this session at creation. */
2598
+ installedSkillIds?: string[] | undefined;
2599
+ /**
2600
+ * MCP servers to select. Omitted follows the workspace defaults; an explicit
2601
+ * array (including `[]`) is an exact allow-list over workspace/deployment
2602
+ * servers. Servers attached in this request's `mcpServers` are always
2603
+ * selected; list one here only to set `eager`/`optional`.
2604
+ */
1834
2605
  tools?: ToolRef[] | undefined;
1835
2606
  metadata?: Record<string, unknown> | undefined;
1836
2607
  model?: string | undefined;
@@ -1839,6 +2610,8 @@ export type CreateSessionRequest = {
1839
2610
  sandboxBackend?: SandboxBackend | undefined;
1840
2611
  targetSandboxId?: string | undefined;
1841
2612
  workingDir?: string | undefined;
2613
+ /** Ordered low-to-high precedence; later sets win name collisions. */
2614
+ variableSetIds?: string[] | undefined;
1842
2615
  variableSetId?: string | undefined;
1843
2616
  /** @deprecated use variableSetId */
1844
2617
  environmentId?: string | undefined;
@@ -1847,22 +2620,42 @@ export type CreateSessionRequest = {
1847
2620
  clientEventId?: string | undefined;
1848
2621
  idempotencyKey?: string | undefined;
1849
2622
  expectedNewSessionDraftRevision?: number | undefined;
2623
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
1850
2624
  maxNestedAgentDepth?: number | undefined;
1851
2625
  firstPartyMcpPermissions?: string[] | undefined;
1852
2626
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2627
+ /**
2628
+ * One agent configuration: capabilities, identity, instructions alias and
2629
+ * renderer. Omission keeps today's behavior (a child inherits its parent's).
2630
+ * Children may only narrow. Requires the server's admission switch.
2631
+ */
2632
+ agent?: AgentConfigRequest | undefined;
1853
2633
  mcpServers?: SessionMcpServerInput[] | undefined;
2634
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
2635
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2636
+ /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2637
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
1854
2638
  sandbox?: "shared" | "new" | {
1855
2639
  groupId: string;
1856
2640
  } | undefined;
1857
- };
1858
- export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
2641
+ agentAccess?: SessionAgentAccess | undefined;
2642
+ /** Opaque end-user label inside the workspace. Not a subject, not authority. */
2643
+ /** Select identity with server-side asUser(), not session creation data. */
2644
+ scopeSubjectId?: never;
2645
+ /** Which Memory the agent reads and where it saves; "user" requires `scopeSubjectId`. */
2646
+ memoryScope?: SessionMemoryScope | undefined;
2647
+ };
2648
+ export type SessionAgentAccess = "session" | "user" | "workspace";
2649
+ export type SessionScopeSubjectId = string;
2650
+ export type SessionMemoryScope = "workspace" | "user" | "off";
2651
+ export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "usage_allowances:manage", "connections:read", "connections:write", "capabilities:manage", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:attach", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
1859
2652
  export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
1860
2653
  /**
1861
2654
  * Permissions the SDK knows about today, kept open so a newer OpenGeni server
1862
2655
  * can introduce permissions without breaking older SDK consumers.
1863
2656
  */
1864
2657
  export type Permission = KnownPermission | (string & {});
1865
- export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "task_notes_list" | "task_note_save" | "task_note_archive" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_clipboard" | "browser_debug" | "browser_auth" | "interaction_request_human" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_clipboard" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "fiken_companies_list" | "fiken_contacts_list" | "fiken_contact_create" | "fiken_products_list" | "fiken_invoices_list" | "fiken_invoice_get" | "fiken_invoice_draft_create" | "fiken_bank_accounts_list" | "fiken_purchases_list" | "fiken_sales_list" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
2658
+ export type FirstPartyMcpToolName = "knowledge_search" | "knowledge_prepare_save" | "knowledge_get" | "knowledge_browse" | "knowledge_save" | "knowledge_retain_file" | "knowledge_retain_message" | "knowledge_archive" | "instruction_policy_save" | "instruction_policy_get" | "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "wait_for_input" | "goal_complete" | "goal_pause" | "goal_resume" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "task_notes_list" | "task_note_save" | "task_note_archive" | "task_note_replace" | "work_claim_upsert" | "work_claim_release" | "knowledge_propose" | "knowledge_correct" | "task_note_promote_knowledge" | "task_note_promote_instruction_policy" | "task_note_promote_preference" | "instruction_policy_propose" | "preference_propose" | "remember" | "remember_confirm" | "company_profile_propose" | "company_profile_confirm" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "connected_machine_enroll_token" | "project_list" | "project_get" | "project_create" | "project_update" | "project_reorder" | "project_delete" | "session_set_project" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_set_model" | "session_events" | "session_wait" | "command_read" | "command_wait" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "session_human_input_respond" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_read" | "browser_screenshot" | "browser_clipboard" | "browser_debug" | "browser_downloads" | "browser_download_save" | "browser_auth" | "interaction_request_human" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_clipboard" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "custom_mcp_setup_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_search" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_upload_file" | "slack_bot_post_message" | "slack_bot_delete_message" | "slack_bot_prepare_message" | "slack_bot_send_prepared_message" | "fiken_companies_list" | "fiken_contacts_list" | "fiken_contact_create" | "fiken_products_list" | "fiken_invoices_list" | "fiken_invoice_get" | "fiken_invoice_draft_create" | "fiken_bank_accounts_list" | "fiken_purchases_list" | "fiken_sales_list" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "sandbox_file_publish" | "artifacts_list" | "artifacts_get_source" | "artifacts_prepare_upload" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "artifacts_archive" | "artifacts_restore" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
1866
2659
  export type ProductAccessMode = "local" | "configured" | "managed";
1867
2660
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
1868
2661
  export type ModelCapabilityStateV1 = {
@@ -1905,18 +2698,23 @@ export type ModelCredentialSourceV1 = {
1905
2698
  mechanism: "api_key" | "azure_ad_bearer";
1906
2699
  } | {
1907
2700
  kind: "connected_subscription";
1908
- provider: "codex" | "xai";
2701
+ provider: "codex" | "xai" | "claude";
1909
2702
  } | {
1910
2703
  kind: "workspace_connection";
1911
2704
  mechanism: "api_key";
2705
+ } | {
2706
+ kind: "organization_connection";
2707
+ mechanism: "api_key";
1912
2708
  };
1913
2709
  export type ModelBillingAttributionV1 = {
1914
- upstreamPayer: "deployment" | "workspace" | "connected_subscription";
2710
+ upstreamPayer: "deployment" | "workspace" | "organization" | "connected_subscription";
1915
2711
  metering: "opengeni_credits" | "external";
1916
2712
  };
2713
+ export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace" | "organization";
1917
2714
  export type ModelPricingV1 = {
1918
2715
  inputMicrosPerMillionTokens: number;
1919
2716
  cachedInputMicrosPerMillionTokens?: number | undefined;
2717
+ cacheWriteMicrosPerMillionTokens?: number | undefined;
1920
2718
  outputMicrosPerMillionTokens: number;
1921
2719
  marginBps?: number | undefined;
1922
2720
  };
@@ -1941,14 +2739,14 @@ export type ClientModel = {
1941
2739
  /** Provider id (e.g. `openai`, `azure`, or a registry provider id). */
1942
2740
  provider: string;
1943
2741
  providerLabel: string;
1944
- api: "responses" | "chat";
1945
- source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | undefined;
2742
+ api: "responses" | "chat" | "anthropic-messages";
2743
+ source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | "openrouter" | undefined;
1946
2744
  contextWindowTokens?: number | undefined;
1947
2745
  schemaVersion?: 1 | undefined;
1948
2746
  aliases?: string[] | undefined;
1949
2747
  deployment?: {
1950
2748
  upstreamModelId: string;
1951
- wireApi: "responses" | "chat";
2749
+ wireApi: "responses" | "chat" | "anthropic-messages";
1952
2750
  } | undefined;
1953
2751
  executionLimits?: {
1954
2752
  contextWindowTokens: number | null;
@@ -1958,6 +2756,7 @@ export type ClientModel = {
1958
2756
  } | undefined;
1959
2757
  credentialSource?: ModelCredentialSourceV1 | undefined;
1960
2758
  billing?: ModelBillingAttributionV1 | undefined;
2759
+ cost?: ModelCostClassV1 | undefined;
1961
2760
  capabilities?: ModelCapabilitiesV1 | undefined;
1962
2761
  pricing?: ModelPricingScheduleV1 | undefined;
1963
2762
  definitionVersion?: string | undefined;
@@ -1976,32 +2775,160 @@ export type ModelCredentialReadinessV1 = {
1976
2775
  };
1977
2776
  export type WorkspaceModelCatalogModel = ClientModel & {
1978
2777
  credentialReadiness: ModelCredentialReadinessV1;
2778
+ /** Exact workspace-policy verdict without exposing provider identity. */
2779
+ policyAllowed?: boolean | undefined;
1979
2780
  availability: ModelAvailabilityV1;
1980
2781
  };
2782
+ /** Why a new chat or scheduled task without an explicit model gets its default. */
2783
+ export type DefaultModelSelectionSource = "workspace" | "subscription" | "credits" | "deployment";
2784
+ export type DefaultModelSelection = {
2785
+ model: string;
2786
+ reasoningEffort: ReasoningEffort;
2787
+ source: DefaultModelSelectionSource;
2788
+ };
1981
2789
  export type WorkspaceModelCatalogResponse = {
1982
2790
  models: WorkspaceModelCatalogModel[];
2791
+ /** Default for new chats and scheduled tasks that name no model. */
2792
+ defaultSelection?: DefaultModelSelection | undefined;
2793
+ /**
2794
+ * The default this workspace would use once its organization holds an
2795
+ * OpenGeni credit balance. Null when the deployment does not bill credits.
2796
+ */
2797
+ creditsSelection?: DefaultModelSelection | null | undefined;
1983
2798
  };
1984
- /**
1985
- * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
1986
- * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
1987
- * workspace can select (projected as ClientModel under their own "no credits"
1988
- * provider group), present only while connected.
1989
- */
1990
- export type CodexConnectionStatus = {
1991
- connected: boolean;
1992
- plan?: string | null;
1993
- valid?: boolean;
1994
- expiresAt?: string | null;
1995
- lastError?: string | null;
1996
- models?: ClientModel[];
1997
- /** The account a session runs on when unpinned (label for the in-session indicator). */
1998
- activeAccount?: {
1999
- id: string;
2000
- label?: string | null;
2001
- chatgptAccountId?: string | null;
2002
- } | null;
2003
- /** How many Codex accounts the workspace has connected. */
2004
- accountCount?: number;
2799
+ export type WorkspaceGatewayCustomModel = {
2800
+ id: string;
2801
+ upstreamModelId: string;
2802
+ label: string | null;
2803
+ version: number;
2804
+ createdAt: string;
2805
+ updatedAt: string;
2806
+ };
2807
+ export type WorkspaceGatewayCustomModelsResponse = {
2808
+ models: WorkspaceGatewayCustomModel[];
2809
+ };
2810
+ export type CreateWorkspaceGatewayCustomModelRequest = {
2811
+ operationId: string;
2812
+ upstreamModelId: string;
2813
+ label?: string | undefined;
2814
+ };
2815
+ export type DeleteWorkspaceGatewayCustomModelRequest = {
2816
+ expectedVersion: number;
2817
+ operationId: string;
2818
+ };
2819
+ export type WorkspaceOpenRouterCustomModel = WorkspaceGatewayCustomModel;
2820
+ export type WorkspaceOpenRouterCustomModelsResponse = {
2821
+ models: WorkspaceOpenRouterCustomModel[];
2822
+ };
2823
+ export type CreateWorkspaceOpenRouterCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
2824
+ export type DeleteWorkspaceOpenRouterCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
2825
+ export type OrganizationModelProviderKind = "vercel_gateway" | "openrouter" | "anthropic" | "claude_subscription";
2826
+ export type ClaudeUsageWindow = {
2827
+ id: "five_hour" | "seven_day" | "seven_day_opus" | "seven_day_sonnet" | "seven_day_overage_included" | "overage";
2828
+ usedPercent: number | null;
2829
+ resetsAt: string | null;
2830
+ status: "allowed" | "allowed_warning" | "rejected" | null;
2831
+ observedAt: string;
2832
+ source?: "response_headers" | "provider" | undefined;
2833
+ };
2834
+ export type ClaudeUsageRequestStatus = {
2835
+ status: ClaudeUsageWindow["status"];
2836
+ resetsAt: string | null;
2837
+ representativeClaim: ClaudeUsageWindow["id"] | null;
2838
+ overageStatus: ClaudeUsageWindow["status"];
2839
+ overageResetsAt: string | null;
2840
+ upstreamModelId: string | null;
2841
+ observedAt: string;
2842
+ source?: "response_headers" | "provider" | undefined;
2843
+ };
2844
+ export type ClaudeSubscriptionUsage = {
2845
+ connected: boolean;
2846
+ credentialVersion: number | null;
2847
+ windows: ClaudeUsageWindow[];
2848
+ observedAt: string | null;
2849
+ source: "response_headers" | "provider" | null;
2850
+ refreshStatus: "not_checked" | "available" | "scope_required" | "unavailable" | "reconnect";
2851
+ refreshCheckedAt: string | null;
2852
+ requestStatus?: ClaudeUsageRequestStatus | null | undefined;
2853
+ requestRestrictions?: ClaudeUsageRequestStatus[] | undefined;
2854
+ };
2855
+ export type OrganizationModelProviderConnection = {
2856
+ providerKind: OrganizationModelProviderKind;
2857
+ status: "active" | "revoked";
2858
+ version: number;
2859
+ createdAt: string;
2860
+ updatedAt: string;
2861
+ };
2862
+ export type UpsertOrganizationModelProviderConnectionRequest = {
2863
+ operationId: string;
2864
+ expectedVersion?: number | undefined;
2865
+ apiKey: string;
2866
+ claudeIdentity?: {
2867
+ accountUuid: string;
2868
+ deviceId: string;
2869
+ } | undefined;
2870
+ };
2871
+ export type RevokeOrganizationModelProviderConnectionRequest = {
2872
+ operationId: string;
2873
+ expectedVersion: number;
2874
+ };
2875
+ export type OrganizationProviderCustomModel = WorkspaceGatewayCustomModel;
2876
+ export type OrganizationProviderCustomModelsResponse = {
2877
+ models: OrganizationProviderCustomModel[];
2878
+ };
2879
+ export type CreateOrganizationProviderCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
2880
+ export type DeleteOrganizationProviderCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
2881
+ /**
2882
+ * The workspace's hard model/provider allowlist. `null` means unrestricted for
2883
+ * that dimension; an empty array is an explicit total block.
2884
+ */
2885
+ export type WorkspaceModelAccessPolicy = {
2886
+ allowedProviders: string[] | null;
2887
+ allowedModels: string[] | null;
2888
+ };
2889
+ /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
2890
+ export type UpdateWorkspaceModelAccessPolicyRequest = {
2891
+ allowedProviders?: string[] | null | undefined;
2892
+ allowedModels?: string[] | null | undefined;
2893
+ };
2894
+ /**
2895
+ * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
2896
+ * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
2897
+ * workspace can select (projected as ClientModel under their own "no credits"
2898
+ * provider group), present only while connected.
2899
+ */
2900
+ export type CodexConnectionStatus = {
2901
+ connected: boolean;
2902
+ plan?: string | null;
2903
+ valid?: boolean;
2904
+ expiresAt?: string | null;
2905
+ lastError?: string | null;
2906
+ models?: ClientModel[];
2907
+ /** The account a session runs on when unpinned (label for the in-session indicator). */
2908
+ activeAccount?: {
2909
+ id: string;
2910
+ label?: string | null;
2911
+ chatgptAccountId?: string | null;
2912
+ } | null;
2913
+ /** Live model-catalog probe result for the active account only. */
2914
+ activeAccountValid?: boolean;
2915
+ /** Cached readiness of any account in the effective worker pool. */
2916
+ poolReady?: boolean;
2917
+ /** Cached unpinned worker routability; rotation-off remains active-pointer-only. */
2918
+ workerRoutable?: boolean;
2919
+ /** How many Codex accounts the workspace has connected. */
2920
+ accountCount?: number;
2921
+ source?: WorkspaceCodexSubscriptionSource;
2922
+ };
2923
+ export type WorkspaceCodexSubscriptionMode = "automatic" | "workspace" | "organization" | "disabled";
2924
+ export type WorkspaceCodexSubscriptionSource = {
2925
+ accountId: string;
2926
+ workspaceId: string;
2927
+ workspaceKind: "personal" | "shared";
2928
+ mode: WorkspaceCodexSubscriptionMode;
2929
+ effectiveSource: "workspace" | "organization" | "disabled";
2930
+ workspaceAvailable: boolean;
2931
+ organizationAvailable: boolean;
2005
2932
  };
2006
2933
  /**
2007
2934
  * One normalized Codex usage window (5h or weekly), camelCase end-to-end (the
@@ -2040,6 +2967,7 @@ export type CodexUsagePayload = {
2040
2967
  meteredFeature: string;
2041
2968
  fiveHour: CodexUsageWindow | null;
2042
2969
  weekly: CodexUsageWindow | null;
2970
+ unknownWindowExhausted: boolean;
2043
2971
  }>;
2044
2972
  credits?: {
2045
2973
  hasCredits: boolean;
@@ -2048,13 +2976,34 @@ export type CodexUsagePayload = {
2048
2976
  balance: string;
2049
2977
  };
2050
2978
  };
2979
+ /** One model a Codex account's current ChatGPT plan was proven not to include. */
2980
+ export type CodexPlanExcludedModel = {
2981
+ /** Product model id, for example `codex/gpt-6-sol`. */
2982
+ model: string;
2983
+ /** Display name, for example "GPT-6 Sol". */
2984
+ label: string;
2985
+ excludedAt: string;
2986
+ retryAfter: string;
2987
+ };
2051
2988
  /** One connected Codex (ChatGPT) account in a workspace (multi-account P1). Metadata only. */
2052
2989
  export type CodexAccount = {
2053
2990
  id: string;
2991
+ source?: "workspace" | "organization";
2054
2992
  chatgptAccountId?: string | null;
2055
2993
  label?: string | null;
2056
2994
  email?: string | null;
2057
2995
  plan?: string | null;
2996
+ /** When the provider last confirmed `plan` (connect, token refresh, or usage read). */
2997
+ planCheckedAt?: string | null;
2998
+ /** Plan before the most recent observed plan change, and when that change was seen. */
2999
+ planChangedFrom?: string | null;
3000
+ planChangedAt?: string | null;
3001
+ /**
3002
+ * Models the current plan was proven not to include. Each is skipped by
3003
+ * automatic selection until `retryAfter` (one request then re-checks it), or
3004
+ * until a different plan is observed, for example after refreshing usage.
3005
+ */
3006
+ planExcludedModels?: CodexPlanExcludedModel[];
2058
3007
  status: "active" | "needs_relogin" | "error";
2059
3008
  active: boolean;
2060
3009
  expiresAt?: string | null;
@@ -2121,6 +3070,12 @@ export type CodexAccountOverview = {
2121
3070
  credits: CodexResetCredit[];
2122
3071
  };
2123
3072
  canRedeem: boolean;
3073
+ /** Secret-free reason redemption is owner-actionable or view-only. */
3074
+ redemptionAccess: {
3075
+ ownership: "current_human" | "unowned" | "different_human" | "managed_human_unavailable";
3076
+ /** A direct managed-cookie admin may claim only an unowned same-provider row by reconnecting. */
3077
+ canClaimUnownedViaReconnect: boolean;
3078
+ };
2124
3079
  /** Owning managed-cookie human may replay durable completion without a healthy provider token. */
2125
3080
  canResumeRedemption: boolean;
2126
3081
  /** Durable owner-scoped ambiguity/completion discovery; never redemption authority for agents. */
@@ -2146,6 +3101,7 @@ export type CodexRotationSettings = {
2146
3101
  export type CodexAccountsResponse = {
2147
3102
  accounts: CodexAccount[];
2148
3103
  activeAccountId: string | null;
3104
+ source?: WorkspaceCodexSubscriptionSource;
2149
3105
  /** Added by Apps-aware servers; absent on older same-major deployments. */
2150
3106
  apps?: {
2151
3107
  available: boolean;
@@ -2156,6 +3112,18 @@ export type CodexAccountsResponse = {
2156
3112
  };
2157
3113
  settings: CodexRotationSettings;
2158
3114
  };
3115
+ export type OrganizationCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source">;
3116
+ /** Session-authorized choices: the accepted pool for a capacity wait, otherwise
3117
+ * the current pool for the next turn. Current execution may use another pool. */
3118
+ export type SessionCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source"> & {
3119
+ currentSelection: {
3120
+ credentialId: string | null;
3121
+ waiting: boolean;
3122
+ } | null;
3123
+ currentAccount: CodexAccount | null;
3124
+ pinnedAccountId: string | null;
3125
+ lastAccountId: string | null;
3126
+ };
2159
3127
  export type CodexAppsUpdate = {
2160
3128
  credentialId: string | null;
2161
3129
  version: number;
@@ -2187,10 +3155,11 @@ export type CodexConnectPoll = {
2187
3155
  isActive?: boolean;
2188
3156
  };
2189
3157
  /** Explicit authority of one connected SuperGrok/xAI subscription account. */
2190
- export type SuperGrokAccountScope = "workspace" | "user";
3158
+ export type SuperGrokAccountScope = "workspace" | "user" | "organization";
2191
3159
  /** Metadata-only connected SuperGrok account. Secret OAuth material never crosses the API. */
2192
3160
  export type SuperGrokAccount = {
2193
3161
  id: string;
3162
+ plan?: string | null;
2194
3163
  scope: SuperGrokAccountScope;
2195
3164
  subject: string;
2196
3165
  email?: string | null;
@@ -2219,6 +3188,8 @@ export type SuperGrokRotationSettings = {
2219
3188
  };
2220
3189
  /** GET /supergrok/accounts — visible accounts plus the workspace active pointer. */
2221
3190
  export type SuperGrokAccountsResponse = {
3191
+ source?: "workspace" | "user" | "organization";
3192
+ organizationId?: string;
2222
3193
  accounts: SuperGrokAccount[];
2223
3194
  activeAccountId: string | null;
2224
3195
  settings: SuperGrokRotationSettings;
@@ -2287,8 +3258,17 @@ export type ClientAuthConfig = {
2287
3258
  } | {
2288
3259
  mode: "managedSession";
2289
3260
  session: "cookie";
3261
+ /** Defaults to true when omitted by an older deployment. */
3262
+ emailVerificationRequired?: boolean;
3263
+ /** Configured managed sign-in providers; omitted by older deployments. */
3264
+ socialProviders?: ("google" | "github")[];
3265
+ /**
3266
+ * False while the deployment has paused new account creation; existing
3267
+ * accounts can still sign in. Omitted (treat as true) by older deployments.
3268
+ */
3269
+ newSignupsEnabled?: boolean;
2290
3270
  };
2291
- export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-social-provider-tools-v1";
3271
+ export declare const OPENGENI_API_CONTRACT_REVISION: "2026-09-plugins-and-skills-v1";
2292
3272
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2293
3273
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2294
3274
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2301,13 +3281,20 @@ export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
2301
3281
  */
2302
3282
  export type ClientConfig = {
2303
3283
  deploymentRevision: string;
2304
- apiContractRevision: typeof OPENGENI_API_CONTRACT_REVISION;
3284
+ /**
3285
+ * The API's contract revision. Equals `OPENGENI_API_CONTRACT_REVISION` for a
3286
+ * `"strict"` client (it throws otherwise); a `"compatible"` client may
3287
+ * receive a newer revision from an additive deployment within its major.
3288
+ */
3289
+ apiContractRevision: string;
2305
3290
  serverVersion?: string | undefined;
3291
+ claudeSubscriptionEnabled?: boolean | undefined;
2306
3292
  defaultModel: string;
2307
3293
  allowedModels: string[];
2308
3294
  models: ClientModel[];
2309
3295
  defaultReasoningEffort: ReasoningEffort;
2310
3296
  allowedReasoningEfforts: ReasoningEffort[];
3297
+ defaultSandboxBackend?: SandboxBackend | undefined;
2311
3298
  mcpServers: {
2312
3299
  id: string;
2313
3300
  name: string;
@@ -2321,10 +3308,56 @@ export type ClientConfig = {
2321
3308
  enabled: boolean;
2322
3309
  maxSizeBytes: number;
2323
3310
  };
3311
+ /**
3312
+ * `false` when a host's session proxy fixes the model policy
3313
+ * (`createSessionProxyHandler({ modelSelection: false })`), so UIs hide the
3314
+ * model picker; `true` when the host explicitly offers end users model
3315
+ * choice (embedded stock UIs then show the picker). OpenGeni itself omits it.
3316
+ */
3317
+ modelSelection?: boolean | undefined;
3318
+ /** Session proxy sandbox-path download opt-in; absent on native deployments. */
3319
+ sandboxFiles?: boolean | undefined;
3320
+ /**
3321
+ * Session proxy only: the workspace the proxy resolved for this user, so a
3322
+ * browser pointed at the proxy (`<OpenGeniChat baseUrl=... />`) needs no
3323
+ * workspace id. Absent on native deployments and older proxies.
3324
+ */
3325
+ workspaceId?: string | undefined;
3326
+ /**
3327
+ * Session proxy capability for the embedded artifact viewer; absent on
3328
+ * native deployments. The live socket is ticket-authenticated and reached
3329
+ * directly; the cache partition identifies the proxied user.
3330
+ */
3331
+ artifacts?: {
3332
+ editableLiveUrl: string;
3333
+ cachePartition: {
3334
+ accountId: string;
3335
+ principalId: string;
3336
+ authorizationEpoch: string;
3337
+ };
3338
+ } | undefined;
2324
3339
  /** Native browser microphone capture + server-side transcription capability. */
2325
3340
  voiceInput?: ClientVoiceInputConfig | undefined;
3341
+ /**
3342
+ * Whether the deployment offers the Jev-backed code_search agent tool and
3343
+ * what workspaces without their own setting get (`split` = half of sessions).
3344
+ */
3345
+ codeSearch?: {
3346
+ available: boolean;
3347
+ workspaceDefault: "off" | "on" | "split";
3348
+ } | undefined;
3349
+ /** Agent configuration rollout and per-capability availability. */
3350
+ agentConfig?: ClientAgentConfig | undefined;
2326
3351
  productAccessMode: ProductAccessMode;
3352
+ /** Client-safe hint for whether the console should offer Stripe checkout. */
3353
+ billingMode?: BillingMode | undefined;
3354
+ managedAuthSessionSetMode: "legacy" | "dual" | "broker";
2327
3355
  auth: ClientAuthConfig;
3356
+ /**
3357
+ * Product documentation for a console Help link. `null` means the deployment
3358
+ * hides the link; absent means a server that predates the field.
3359
+ */
3360
+ documentationUrl?: string | null | undefined;
2328
3361
  analytics: {
2329
3362
  consentRequired: boolean;
2330
3363
  providers: {
@@ -2340,6 +3373,13 @@ export type ClientConfig = {
2340
3373
  } | undefined;
2341
3374
  };
2342
3375
  };
3376
+ /** Operator-owned legal documents the signed-out console links to, when configured. */
3377
+ legal?: {
3378
+ privacyPolicyUrl?: string | undefined;
3379
+ termsOfServiceUrl?: string | undefined;
3380
+ } | undefined;
3381
+ /** Operator support address the console offers as a mailto link, when configured. */
3382
+ supportEmail?: string | undefined;
2343
3383
  structuredServices: {
2344
3384
  fileSystem: boolean;
2345
3385
  git: boolean;
@@ -2349,6 +3389,7 @@ export type ClientConfig = {
2349
3389
  /** Client-safe voice-input capability projection. */
2350
3390
  export type ClientVoiceInputConfig = {
2351
3391
  available: boolean;
3392
+ providers?: VoiceInputProviderId[] | undefined;
2352
3393
  maxDurationSeconds: number;
2353
3394
  maxSizeBytes: number;
2354
3395
  acceptedMimeTypes: string[];
@@ -2433,11 +3474,43 @@ export type AccessGrant = {
2433
3474
  subjectId: string;
2434
3475
  subjectLabel?: string | undefined;
2435
3476
  permissions: Permission[];
3477
+ /** Explicit policies never expand `workspace:admin` into unselected permissions. */
3478
+ permissionMode?: "legacy" | "explicit" | undefined;
2436
3479
  principalKind?: AccessPrincipalKind | undefined;
2437
3480
  metadata?: Record<string, unknown> | undefined;
2438
3481
  serviceInitiator?: ServiceTurnInitiator | undefined;
2439
3482
  serviceInitiatorContext?: ServiceTurnInitiatorContext | undefined;
2440
3483
  };
3484
+ /**
3485
+ * Authority of a directly used organization or workspace API key, separate
3486
+ * from the caller's account and workspace grants. Full organization keys can
3487
+ * provision shared workspaces, external members, and sessions through `asUser`;
3488
+ * those user requests additionally need the user's live membership.
3489
+ * Organization-key scope excludes Personal workspaces. Neither key kind bypasses
3490
+ * session visibility or the explicit `secrets:read` permission requirement.
3491
+ */
3492
+ export type AccessCredential = {
3493
+ kind: "organization_api_key" | "workspace_api_key";
3494
+ /** Organization keys only; omitted for workspace keys. */
3495
+ access?: OrganizationApiKeyAccess | undefined;
3496
+ /** The key's organization id. */
3497
+ accountId: string;
3498
+ /** Null for an organization key; `workspaceScope` selects shared workspaces, never Personal. */
3499
+ workspaceId: string | null;
3500
+ /**
3501
+ * Effective workspace permissions, with admin expansion only for legacy keys. Excludes
3502
+ * account-only permissions and includes `secrets:read` only when explicitly
3503
+ * granted. Explicit policies grant exactly their selected permissions.
3504
+ */
3505
+ effectiveWorkspacePermissions: Permission[];
3506
+ /** Organization keys only; the preset label never adds permissions. */
3507
+ policy?: OrganizationAccessPolicy | undefined;
3508
+ /** Organization keys only; omitted on older servers. */
3509
+ workspaceScope?: OrganizationWorkspaceScope | undefined;
3510
+ /** Plain-language explanation of the key's scope and limits. */
3511
+ note: string;
3512
+ };
3513
+ /** Caller identity, grants, defaults, and optional direct API-key authority. */
2441
3514
  export type AccessContext = {
2442
3515
  mode: ProductAccessMode;
2443
3516
  subjectId: string;
@@ -2446,6 +3519,15 @@ export type AccessContext = {
2446
3519
  workspaceGrants: AccessGrant[];
2447
3520
  defaultAccountId: string | null;
2448
3521
  defaultWorkspaceId: string | null;
3522
+ /**
3523
+ * Direct API-key authority; omitted for `asUser`/external actors, humans,
3524
+ * delegated tokens, other caller contexts, and older servers. Existing grants
3525
+ * are unchanged. Full organization keys can provision shared workspaces,
3526
+ * external members, and `asUser` sessions; user requests still need live
3527
+ * membership. Organization-key scope excludes Personal workspaces. Neither key
3528
+ * kind bypasses session visibility or the explicit `secrets:read` requirement.
3529
+ */
3530
+ credential?: AccessCredential | undefined;
2449
3531
  };
2450
3532
  export type ManagedOrganizationMembership = {
2451
3533
  id: string;
@@ -2456,9 +3538,396 @@ export type ManagedOrganizationMembership = {
2456
3538
  export type ListManagedOrganizationMembershipsResponse = {
2457
3539
  memberships: ManagedOrganizationMembership[];
2458
3540
  };
3541
+ export type UserResourceKind = "connection" | "document" | "variable_set" | "rig" | "connected_machine";
3542
+ export type UserResourceGrantAction = "connection.use" | "document.read" | "variable_set.use" | "rig.use" | "connected_machine.use";
3543
+ export type UserResourceAuthorityGrant = {
3544
+ grantId: string;
3545
+ targetWorkspaceId: string;
3546
+ targetSessionId: string | null;
3547
+ action: UserResourceGrantAction;
3548
+ mode: "once" | "session" | "always";
3549
+ context: "user_private" | "workspace_shared";
3550
+ authorityEpoch: number | null;
3551
+ generation: number;
3552
+ status: "active" | "consumed" | "revoked" | "expired";
3553
+ expiresAt: string | null;
3554
+ delegation: UserResourceDelegation;
3555
+ };
3556
+ export type UserResourceAuthoritySummary = {
3557
+ authorityId: string;
3558
+ resourceKind: UserResourceKind;
3559
+ resourceId: string;
3560
+ originWorkspaceId: string | null;
3561
+ generation: number;
3562
+ status: "active" | "retained" | "revoked";
3563
+ grants: UserResourceAuthorityGrant[];
3564
+ };
3565
+ export type ListUserResourceAuthoritiesOptions = {
3566
+ resourceKind: Exclude<UserResourceKind, "connection">;
3567
+ cursor?: string | undefined;
3568
+ limit?: number | undefined;
3569
+ };
3570
+ export type ListUserResourceAuthoritiesResponse = {
3571
+ scope: "user";
3572
+ authorities: UserResourceAuthoritySummary[];
3573
+ nextCursor: string | null;
3574
+ };
3575
+ export type IssueUserResourceGrantRequest = {
3576
+ scope: "user";
3577
+ resourceKind: Exclude<UserResourceKind, "connection">;
3578
+ mode: "session";
3579
+ context: "user_private" | "workspace_shared";
3580
+ sessionId: string;
3581
+ expectedAuthorityEpoch: number;
3582
+ workspaceSharedAcknowledged?: boolean | undefined;
3583
+ } | {
3584
+ scope: "user";
3585
+ resourceKind: Exclude<UserResourceKind, "connection">;
3586
+ mode: "always";
3587
+ context: "user_private" | "workspace_shared";
3588
+ sessionId?: null | undefined;
3589
+ expectedAuthorityEpoch?: null | undefined;
3590
+ workspaceSharedAcknowledged?: boolean | undefined;
3591
+ };
3592
+ export type UserResourceGrantMutationResponse = {
3593
+ scope: "user";
3594
+ grant: UserResourceAuthorityGrant;
3595
+ };
3596
+ export type RevokeUserResourceGrantResponse = {
3597
+ scope: "user";
3598
+ grant: {
3599
+ grantId: string;
3600
+ generation: number;
3601
+ status: "revoked";
3602
+ revokedAt: string;
3603
+ };
3604
+ };
3605
+ export type OrganizationMembershipRole = "owner" | "admin" | "member";
3606
+ export type WorkspaceMemberRole = "viewer" | "member" | "admin" | "custom";
3607
+ export type AssignableWorkspaceMemberRole = "viewer" | "member" | "admin";
3608
+ export type OrganizationUserSetupDelivery = {
3609
+ id: string;
3610
+ state: "pending" | "sent" | "failed" | "outcome_unknown" | "revoked";
3611
+ attemptCount: number;
3612
+ revision: number;
3613
+ errorClass: string | null;
3614
+ retryState: "available" | "reconciliation_required" | "unavailable";
3615
+ sentAt: string | null;
3616
+ updatedAt: string;
3617
+ };
3618
+ export type OrganizationInvitation = {
3619
+ id: string;
3620
+ organizationId: string;
3621
+ organizationName: string | null;
3622
+ targetEmail: string;
3623
+ targetName: string | null;
3624
+ initialWorkspaceIds: string[];
3625
+ role: OrganizationMembershipRole;
3626
+ status: "pending" | "accepted" | "revoked" | "expired";
3627
+ revision: number;
3628
+ expiresAt: string;
3629
+ acceptedMembershipId: string | null;
3630
+ createdAt: string;
3631
+ updatedAt: string;
3632
+ delivery: OrganizationUserSetupDelivery | null;
3633
+ };
3634
+ export type OrganizationMember = {
3635
+ id: string;
3636
+ organizationId: string;
3637
+ subjectId: string;
3638
+ name: string | null;
3639
+ email: string | null;
3640
+ role: OrganizationMembershipRole;
3641
+ status: "provisioning" | "active" | "suspended" | "revoked";
3642
+ authorizationRevision: number;
3643
+ personalWorkspaceId: string | null;
3644
+ revokedAt: string | null;
3645
+ personalRetentionUntil: string | null;
3646
+ createdAt: string;
3647
+ updatedAt: string;
3648
+ };
3649
+ export type OrganizationAdministrationMemberWorkspaceAccess = {
3650
+ workspaceId: string;
3651
+ workspaceName: string;
3652
+ membershipId: string;
3653
+ role: WorkspaceMemberRole;
3654
+ updatedAt: string;
3655
+ };
3656
+ export type OrganizationAdministrationMember = {
3657
+ id: string;
3658
+ organizationId: string;
3659
+ subjectId: string;
3660
+ name: string | null;
3661
+ email: string | null;
3662
+ role: OrganizationMembershipRole;
3663
+ status: "provisioning" | "active" | "suspended" | "revoked";
3664
+ authorizationRevision: number;
3665
+ sharedWorkspaceAccess: OrganizationAdministrationMemberWorkspaceAccess[];
3666
+ revokedAt: string | null;
3667
+ createdAt: string;
3668
+ updatedAt: string;
3669
+ };
3670
+ export type OrganizationSummary = {
3671
+ id: string;
3672
+ name: string;
3673
+ createdAt: string;
3674
+ updatedAt: string;
3675
+ };
3676
+ export type OrganizationWorkspaceAccessMember = {
3677
+ membershipId: string;
3678
+ organizationMembershipId: string | null;
3679
+ subjectId: string;
3680
+ name: string | null;
3681
+ email: string | null;
3682
+ subjectLabel: string | null;
3683
+ principalKind: "human" | "service";
3684
+ organizationRole: OrganizationMembershipRole | null;
3685
+ role: WorkspaceMemberRole;
3686
+ permissions: string[];
3687
+ createdAt: string;
3688
+ updatedAt: string;
3689
+ };
3690
+ export type OrganizationWorkspaceAccess = {
3691
+ id: string;
3692
+ name: string;
3693
+ slug: string | null;
3694
+ createdAt: string;
3695
+ updatedAt: string;
3696
+ members: OrganizationWorkspaceAccessMember[];
3697
+ };
3698
+ export type OrganizationAdministrationOverview = {
3699
+ organization: OrganizationSummary;
3700
+ roles: OrganizationWorkspaceRoleDefinition[];
3701
+ workspaces: OrganizationWorkspaceAccess[];
3702
+ };
3703
+ export type OrganizationWorkspaceRoleDefinition = {
3704
+ role: AssignableWorkspaceMemberRole;
3705
+ label: string;
3706
+ description: string;
3707
+ permissions: Permission[];
3708
+ };
3709
+ export type OrganizationPrivateSessionSettings = {
3710
+ organizationId: string;
3711
+ enabled: boolean;
3712
+ available: boolean;
3713
+ version: number;
3714
+ updatedAt: string;
3715
+ changed?: boolean;
3716
+ };
3717
+ export type CreateOrganizationWorkspaceRequest = {
3718
+ name: string;
3719
+ operationId: string;
3720
+ };
3721
+ export type UpdateOrganizationWorkspaceRequest = {
3722
+ name: string;
3723
+ expectedUpdatedAt: string;
3724
+ operationId: string;
3725
+ };
3726
+ export type PutOrganizationWorkspaceMemberRequest = {
3727
+ role: AssignableWorkspaceMemberRole;
3728
+ expectedUpdatedAt: string | null;
3729
+ operationId: string;
3730
+ } | {
3731
+ role: "custom";
3732
+ permissions: Permission[];
3733
+ expectedUpdatedAt: string | null;
3734
+ operationId: string;
3735
+ };
3736
+ export type RevokeOrganizationWorkspaceMemberRequest = {
3737
+ expectedUpdatedAt: string;
3738
+ operationId: string;
3739
+ };
3740
+ export type RevokeOrganizationWorkspaceMemberResponse = {
3741
+ removed: boolean;
3742
+ replay: boolean;
3743
+ };
3744
+ export type CreateOrganizationRequest = {
3745
+ name: string;
3746
+ operationId: string;
3747
+ };
3748
+ export type CreateOrganizationResponse = {
3749
+ organization: OrganizationSummary;
3750
+ workspaceId: string;
3751
+ };
3752
+ export type CreateAdditionalOrganizationRequest = {
3753
+ name: string;
3754
+ workspaceName: string;
3755
+ operationId: string;
3756
+ };
3757
+ export type CreateAdditionalOrganizationResponse = {
3758
+ organization: OrganizationSummary;
3759
+ workspaceId: string;
3760
+ personalWorkspaceId: string;
3761
+ };
3762
+ export type UpdateOrganizationNameRequest = {
3763
+ name: string;
3764
+ expectedUpdatedAt: string;
3765
+ operationId: string;
3766
+ };
3767
+ export type UpdateOrganizationPrivateSessionSettingsRequest = {
3768
+ enabled: boolean;
3769
+ expectedVersion: number;
3770
+ operationId: string;
3771
+ };
3772
+ export type OrganizationRetentionPolicy = {
3773
+ organizationId: string;
3774
+ mode: "retain" | "delete_after";
3775
+ retentionDays: number | null;
3776
+ version: number;
3777
+ updatedAt: string;
3778
+ };
3779
+ export type OrganizationRecoveryPolicyState = "pending_acceptance" | "active" | "degraded" | "superseded" | "disabled";
3780
+ export type OrganizationRecoveryOperationState = "collecting" | "cooling" | "executed" | "cancelled" | "expired" | "superseded";
3781
+ export type OrganizationRecoveryUnavailableReason = "no_policy" | "pending_acceptance" | "degraded" | "disabled" | "identity_unavailable";
3782
+ export type OrganizationRecoveryMemberSummary = {
3783
+ membershipId: string;
3784
+ name: string | null;
3785
+ email: string | null;
3786
+ };
3787
+ export type OrganizationRecoveryCustodian = OrganizationRecoveryMemberSummary & {
3788
+ ordinal: number;
3789
+ enrollmentState: "pending_acceptance" | "accepted" | "ineligible";
3790
+ acceptedAt: string | null;
3791
+ };
3792
+ export type OrganizationRecoveryPolicy = {
3793
+ id: string;
3794
+ organizationId: string;
3795
+ revision: number;
3796
+ state: OrganizationRecoveryPolicyState;
3797
+ custodians: OrganizationRecoveryCustodian[];
3798
+ createdAt: string;
3799
+ updatedAt: string;
3800
+ };
3801
+ export type OrganizationRecoveryApproval = OrganizationRecoveryMemberSummary & {
3802
+ approvedAt: string;
3803
+ };
3804
+ export type OrganizationRecoveryOperation = {
3805
+ id: string;
3806
+ organizationId: string;
3807
+ policyId: string;
3808
+ policyRevision: number;
3809
+ revision: number;
3810
+ state: OrganizationRecoveryOperationState;
3811
+ target: OrganizationRecoveryMemberSummary;
3812
+ approvals: OrganizationRecoveryApproval[];
3813
+ approvalCount: number;
3814
+ quorumAt: string | null;
3815
+ executableAt: string | null;
3816
+ expiresAt: string;
3817
+ executedAt: string | null;
3818
+ cancelledAt: string | null;
3819
+ notificationJournaled: boolean;
3820
+ createdAt: string;
3821
+ updatedAt: string;
3822
+ };
3823
+ export type OrganizationRecoveryCapabilities = {
3824
+ configure: boolean;
3825
+ accept: boolean;
3826
+ disable: boolean;
3827
+ start: boolean;
3828
+ approve: boolean;
3829
+ cancel: boolean;
3830
+ execute: boolean;
3831
+ };
3832
+ export type OrganizationRecoveryOverview = {
3833
+ organizationId: string;
3834
+ availability: "available" | "recovery_unavailable";
3835
+ unavailableReason: OrganizationRecoveryUnavailableReason | null;
3836
+ recentReauthenticationAt: string | null;
3837
+ eligibleMembers: OrganizationRecoveryMemberSummary[];
3838
+ policy: OrganizationRecoveryPolicy | null;
3839
+ operation: OrganizationRecoveryOperation | null;
3840
+ capabilities: OrganizationRecoveryCapabilities;
3841
+ };
3842
+ export type ConfigureOrganizationRecoveryPolicyRequest = {
3843
+ custodianMembershipIds: [string, string, string];
3844
+ expectedPolicyRevision: number;
3845
+ operationId: string;
3846
+ };
3847
+ export type AcceptOrganizationRecoveryCustodyRequest = {
3848
+ expectedPolicyRevision: number;
3849
+ operationId: string;
3850
+ };
3851
+ export type DisableOrganizationRecoveryPolicyRequest = AcceptOrganizationRecoveryCustodyRequest;
3852
+ export type StartOrganizationRecoveryOperationRequest = {
3853
+ targetMembershipId: string;
3854
+ expectedPolicyRevision: number;
3855
+ operationId: string;
3856
+ };
3857
+ export type OrganizationRecoveryOperationCommandRequest = {
3858
+ expectedOperationRevision: number;
3859
+ operationId: string;
3860
+ };
3861
+ export type OrganizationRecoveryMutationResponse = {
3862
+ replay: boolean;
3863
+ overview: OrganizationRecoveryOverview;
3864
+ };
3865
+ export type CreateOrganizationInvitationRequest = {
3866
+ email: string;
3867
+ name?: string;
3868
+ initialWorkspaceIds?: string[];
3869
+ role?: OrganizationMembershipRole;
3870
+ expiresAt: string;
3871
+ operationId: string;
3872
+ };
3873
+ export type AcceptOrganizationInvitationRequest = {
3874
+ expectedRevision: number;
3875
+ operationId: string;
3876
+ };
3877
+ export type RevokeOrganizationInvitationRequest = AcceptOrganizationInvitationRequest;
3878
+ export type PreviewOrganizationUserSetupRequest = {
3879
+ token: string;
3880
+ };
3881
+ export type OrganizationUserSetupPreview = {
3882
+ state: "unavailable" | "expired" | "revoked" | "completed";
3883
+ } | {
3884
+ state: "pending";
3885
+ organizationId: string;
3886
+ organizationName: string;
3887
+ targetEmail: string;
3888
+ targetName: string | null;
3889
+ organizationRole: OrganizationMembershipRole;
3890
+ sharedWorkspaceAccess: Array<{
3891
+ workspaceId: string;
3892
+ workspaceName: string;
3893
+ role: AssignableWorkspaceMemberRole;
3894
+ }>;
3895
+ expiresAt: string;
3896
+ };
3897
+ export type RetryOrganizationUserSetupDeliveryRequest = {
3898
+ operationId: string;
3899
+ };
3900
+ export type UpdateOrganizationMemberRequest = {
3901
+ kind: "change_role" | "suspend" | "reactivate" | "offboard";
3902
+ role?: OrganizationMembershipRole;
3903
+ expectedAuthorizationRevision: number;
3904
+ operationId: string;
3905
+ reason?: string;
3906
+ };
3907
+ export type UpdateOrganizationRetentionPolicyRequest = {
3908
+ mode: "retain" | "delete_after";
3909
+ retentionDays: number | null;
3910
+ expectedVersion: number;
3911
+ operationId: string;
3912
+ };
3913
+ export type ListOrganizationInvitationsPageResponse = {
3914
+ invitations: OrganizationInvitation[];
3915
+ nextCursor: string | null;
3916
+ };
3917
+ export type ListOrganizationMembersResponse = {
3918
+ members: OrganizationAdministrationMember[];
3919
+ };
3920
+ export type ListOrganizationAdministrationMembersResponse = {
3921
+ members: OrganizationAdministrationMember[];
3922
+ };
3923
+ export type AcceptOrganizationInvitationResponse = {
3924
+ invitation: OrganizationInvitation;
3925
+ membership: OrganizationMember;
3926
+ };
2459
3927
  export type Workspace = {
2460
3928
  id: string;
2461
3929
  accountId: string;
3930
+ kind: "personal" | "shared";
2462
3931
  name: string;
2463
3932
  slug: string | null;
2464
3933
  externalSource: string | null;
@@ -2466,6 +3935,8 @@ export type Workspace = {
2466
3935
  agentInstructions: string | null;
2467
3936
  settings: Record<string, unknown>;
2468
3937
  inferenceControl: {
3938
+ timer?: WorkspacePauseTimer | null | undefined;
3939
+ serverTime?: string | undefined;
2469
3940
  state: "active" | "paused";
2470
3941
  revision: number;
2471
3942
  reason: string | null;
@@ -2480,6 +3951,12 @@ export type WorkspaceSettings = {
2480
3951
  memoryEnabled?: boolean | undefined;
2481
3952
  /** Reversible Memory V1 prompt composition rollout. */
2482
3953
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3954
+ /** Model policy inherited by new chats and scheduled tasks. */
3955
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3956
+ /** Exact capability selection inherited by new top-level sessions. */
3957
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
3958
+ /** Allowlisted sandbox image for new managed boxes; absent uses the deployment image. */
3959
+ defaultSandboxImage?: string | null | undefined;
2483
3960
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2484
3961
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2485
3962
  maxNestedAgentDepth?: number | null | undefined;
@@ -2487,9 +3964,22 @@ export type WorkspaceSettings = {
2487
3964
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2488
3965
  /** Whether agents may invoke the built-in structured human-input tool. */
2489
3966
  agentHumanInputEnabled?: boolean | undefined;
3967
+ /** Whether agents get the Jev-backed code_search tool; absent or null follows the deployment. */
3968
+ codeSearchEnabled?: boolean | null | undefined;
2490
3969
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3970
+ /** Slack orchestration notices; both default off when absent or invalid. */
3971
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
2491
3972
  [key: string]: unknown;
2492
3973
  };
3974
+ export type WorkspaceSessionDefaults = {
3975
+ model: string;
3976
+ reasoningEffort: ReasoningEffort;
3977
+ };
3978
+ export type WorkspaceSessionToolDefaults = {
3979
+ inheritConnectedMcpServers?: boolean | undefined;
3980
+ mcpServerIds?: string[];
3981
+ firstPartyMcpTools?: FirstPartyMcpToolName[];
3982
+ };
2493
3983
  export type WorkspaceSlackReactionSummonSettings = {
2494
3984
  enabled: boolean;
2495
3985
  emoji: "genie";
@@ -2500,6 +3990,16 @@ export type WorkspaceSlackReactionSummonSettings = {
2500
3990
  channelIds: string[];
2501
3991
  };
2502
3992
  };
3993
+ /**
3994
+ * Per-workspace switches for the two Slack orchestration notices. Both are off
3995
+ * unless the workspace explicitly turned them on.
3996
+ */
3997
+ export type WorkspaceSlackOrchestrationNoticeSettings = {
3998
+ /** Post a pointer card when a child worker blocks on input or an approval. */
3999
+ childRequiresAction?: boolean | undefined;
4000
+ /** Post one line when a goal pauses for budget or the continuation cap. */
4001
+ goalPaused?: boolean | undefined;
4002
+ };
2503
4003
  export type SlackReactionChannel = {
2504
4004
  id: string;
2505
4005
  name: string | null;
@@ -2509,18 +4009,51 @@ export type SlackReactionChannelListResponse = {
2509
4009
  channels: SlackReactionChannel[];
2510
4010
  nextCursor: string | null;
2511
4011
  };
4012
+ export type SlackChannelRoute = {
4013
+ slackChannelId: string;
4014
+ targetWorkspaceId: string;
4015
+ targetWorkspaceName: string | null;
4016
+ source: "picker" | "admin";
4017
+ updatedAt: string;
4018
+ };
4019
+ export type SlackChannelRouteListResponse = {
4020
+ routes: SlackChannelRoute[];
4021
+ routingEnabled: boolean;
4022
+ };
4023
+ export type UpdateSlackChannelRoutesRequest = {
4024
+ connectionId: string;
4025
+ routes: Array<{
4026
+ slackChannelId: string;
4027
+ targetWorkspaceId: string | null;
4028
+ }>;
4029
+ };
4030
+ export type VoiceInputProviderId = "supergrok-subscription" | "codex-subscription" | "openai" | "azure-openai";
2512
4031
  export type WorkspaceVoiceInputSettings = {
2513
4032
  enabled: boolean;
4033
+ preferredProvider?: VoiceInputProviderId | null | undefined;
4034
+ fallbackEnabled?: boolean | undefined;
2514
4035
  };
2515
4036
  export type UpdateWorkspaceSettingsRequest = {
2516
4037
  memoryEnabled?: boolean | undefined;
2517
4038
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
4039
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
4040
+ sessionToolDefaults?: {
4041
+ mcpServerIds?: string[] | null;
4042
+ firstPartyMcpTools?: FirstPartyMcpToolName[] | null;
4043
+ inheritConnectedMcpServers?: boolean | null;
4044
+ } | undefined;
2518
4045
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2519
4046
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2520
4047
  maxNestedAgentDepth?: number | null | undefined;
2521
4048
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2522
4049
  agentHumanInputEnabled?: boolean | undefined;
4050
+ codeSearchEnabled?: boolean | null | undefined;
2523
4051
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
4052
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
4053
+ /** One of `listWorkspaceSandboxImages().images`, or null for the deployment image. */
4054
+ defaultSandboxImage?: string | null | undefined;
4055
+ /** Agent defaults for new sessions; null clears. Requires the admission switch. */
4056
+ sessionAgentDefaults?: WorkspaceAgentDefaults | null | undefined;
2524
4057
  [key: string]: unknown;
2525
4058
  };
2526
4059
  export type SetWorkspaceDefaultRigRequest = {
@@ -2534,18 +4067,76 @@ export type CreateWorkspaceRequest = {
2534
4067
  externalId?: string | undefined;
2535
4068
  agentInstructions?: string | null | undefined;
2536
4069
  };
4070
+ export type EnsureWorkspaceRequest = {
4071
+ /**
4072
+ * Owning organization id. An organization API key may omit it and the
4073
+ * workspace is created in the key's own organization; every other caller
4074
+ * must send it.
4075
+ */
4076
+ accountId?: string | undefined;
4077
+ externalSource: string;
4078
+ externalId: string;
4079
+ name: string;
4080
+ slug?: string | undefined;
4081
+ agentInstructions?: string | null | undefined;
4082
+ };
4083
+ export type EnsureWorkspaceResponse = {
4084
+ workspace: Workspace;
4085
+ created: boolean;
4086
+ };
2537
4087
  export type UpdateWorkspaceRequest = {
2538
4088
  name?: string | undefined;
2539
4089
  slug?: string | null | undefined;
2540
4090
  agentInstructions?: string | null | undefined;
2541
4091
  };
4092
+ /**
4093
+ * Legacy organization API key access tier, derived by the server from the key's
4094
+ * permissions: `full` can provision shared workspaces, external members, and
4095
+ * `asUser` sessions (user requests additionally need live membership);
4096
+ * `read` only inventories shared workspaces and reads their sessions, events,
4097
+ * and files. `developer_setup` configures shared workspaces and budgets without
4098
+ * API-key management or credential delegation; its default expiry is 24 hours.
4099
+ * Organization-key scope excludes Personal workspaces and bypasses neither
4100
+ * session visibility nor the explicit `secrets:read` permission requirement.
4101
+ */
4102
+ export type OrganizationApiKeyAccess = "full" | "read" | "developer_setup";
4103
+ /** Informational preset label; the server recomputes it from explicit permissions. */
4104
+ export type OrganizationAccessPreset = "read_only" | "full" | "custom";
4105
+ /** Organization-key scope always excludes Personal workspaces. */
4106
+ export type OrganizationWorkspaceScope = {
4107
+ kind: "all";
4108
+ } | {
4109
+ kind: "selected";
4110
+ /** Up to 500 unique shared-workspace IDs in the same organization. Empty reaches none. */
4111
+ workspaceIds: string[];
4112
+ };
4113
+ export type OrganizationAccessPolicy = {
4114
+ preset: OrganizationAccessPreset;
4115
+ /** Exact grants, including `workspace:admin` individually; no implicit wildcard. */
4116
+ permissions: Permission[];
4117
+ workspaceScope: OrganizationWorkspaceScope;
4118
+ };
4119
+ export type OrganizationActor = "user" | "organization";
2542
4120
  export type ApiKey = {
2543
4121
  id: string;
2544
4122
  accountId: string;
2545
4123
  workspaceId: string | null;
2546
4124
  name: string;
4125
+ description: string | null;
2547
4126
  prefix: string;
2548
4127
  permissions: Permission[];
4128
+ /** Organization keys only; omitted for workspace-scoped keys. */
4129
+ access?: OrganizationApiKeyAccess | undefined;
4130
+ policy?: OrganizationAccessPolicy | undefined;
4131
+ workspaceScope?: OrganizationWorkspaceScope | undefined;
4132
+ /** Legacy keys retain their historical workspace-admin wildcard. */
4133
+ permissionMode?: "legacy" | "explicit" | undefined;
4134
+ /** Organization keys: the service account that holds the key. */
4135
+ serviceAccount?: {
4136
+ id: string;
4137
+ name: string;
4138
+ role: OrganizationServiceAccountRole;
4139
+ } | null | undefined;
2549
4140
  expiresAt: string | null;
2550
4141
  revokedAt: string | null;
2551
4142
  lastUsedAt: string | null;
@@ -2554,6 +4145,7 @@ export type ApiKey = {
2554
4145
  };
2555
4146
  export type CreateApiKeyRequest = {
2556
4147
  name: string;
4148
+ description?: string | undefined;
2557
4149
  permissions: Permission[];
2558
4150
  expiresAt?: string | undefined;
2559
4151
  };
@@ -2562,9 +4154,137 @@ export type CreateApiKeyResponse = {
2562
4154
  /** The full secret token — shown once at creation, never returned again. */
2563
4155
  token: string;
2564
4156
  };
4157
+ export type CreateOrganizationApiKeyRequest = {
4158
+ name: string;
4159
+ description?: string | undefined;
4160
+ expiresAt?: string | undefined;
4161
+ /** With no policy, omitted means legacy `full`. */
4162
+ access?: OrganizationApiKeyAccess | undefined;
4163
+ /** Optional creation alias for the developer_setup access tier. */
4164
+ preset?: "developer_setup" | undefined;
4165
+ /** Explicit grants and shared-workspace scope; do not combine with legacy access/preset. */
4166
+ policy?: OrganizationAccessPolicy | undefined;
4167
+ /** The service account that holds the key; omitted creates one named after the key. */
4168
+ serviceAccountId?: string | undefined;
4169
+ };
4170
+ /** The server requires at least one change. Omitted fields stay unchanged. */
4171
+ export type UpdateOrganizationApiKeyRequest = {
4172
+ name?: string | undefined;
4173
+ description?: string | null | undefined;
4174
+ /** Replaces the policy and transitions a legacy key to explicit permission semantics. */
4175
+ policy?: OrganizationAccessPolicy | undefined;
4176
+ };
2565
4177
  export type ListApiKeysResponse = {
2566
4178
  apiKeys: ApiKey[];
2567
4179
  };
4180
+ /** Up to admin, never owner. A member's keys never hold administrator permissions. */
4181
+ export type OrganizationServiceAccountRole = "admin" | "member";
4182
+ /** An organization identity with no person behind it; it holds organization API keys. */
4183
+ export type OrganizationServiceAccount = {
4184
+ id: string;
4185
+ organizationId: string;
4186
+ name: string;
4187
+ description: string | null;
4188
+ role: OrganizationServiceAccountRole;
4189
+ /** Keys that are not revoked, including expired ones. */
4190
+ activeKeyCount: number;
4191
+ createdAt: string;
4192
+ updatedAt: string;
4193
+ };
4194
+ export type ListOrganizationServiceAccountsResponse = {
4195
+ serviceAccounts: OrganizationServiceAccount[];
4196
+ };
4197
+ export type CreateOrganizationServiceAccountRequest = {
4198
+ name: string;
4199
+ description?: string | undefined;
4200
+ /** Defaults to member. Only an organization administrator can choose admin. */
4201
+ role?: OrganizationServiceAccountRole | undefined;
4202
+ };
4203
+ /** The server requires at least one change. Making it a member narrows its keys. */
4204
+ export type UpdateOrganizationServiceAccountRequest = {
4205
+ name?: string | undefined;
4206
+ description?: string | null | undefined;
4207
+ role?: OrganizationServiceAccountRole | undefined;
4208
+ };
4209
+ /** An outside agent a person connected to the organization MCP server. */
4210
+ export type OrganizationMcpConnection = {
4211
+ id: string;
4212
+ /** The name the client registered with ("Claude Code"). */
4213
+ clientName: string;
4214
+ /** Where its sign-in returned to ("127.0.0.1:4567", "cursor.com"). */
4215
+ clientHost: string | null;
4216
+ /** Signed-in agents act as the person who connected them. */
4217
+ actor: "user";
4218
+ connectedBy: {
4219
+ subjectId: string;
4220
+ name: string;
4221
+ };
4222
+ /** What it can do and where. The person's own live access still caps it. */
4223
+ policy: OrganizationAccessPolicy;
4224
+ createdAt: string;
4225
+ lastUsedAt: string | null;
4226
+ expiresAt: string;
4227
+ revokedAt: null;
4228
+ };
4229
+ export type OrganizationMcpConnectionList = {
4230
+ connections: OrganizationMcpConnection[];
4231
+ /** Owners and admins see and can disconnect everyone's agents. */
4232
+ canManageAll: boolean;
4233
+ };
4234
+ export type UpdateOrganizationMcpConnectionRequest = {
4235
+ access: OrganizationAccessPolicy;
4236
+ };
4237
+ /** A pending agent sign-in, as the web app's sign-in page shows it. */
4238
+ export type McpConnectionRequest = {
4239
+ client: {
4240
+ name: string;
4241
+ host: string | null;
4242
+ };
4243
+ person: {
4244
+ name: string | null;
4245
+ };
4246
+ organizations: Array<{
4247
+ id: string;
4248
+ name: string;
4249
+ workspaces: Array<{
4250
+ id: string;
4251
+ name: string;
4252
+ personal: boolean;
4253
+ }>;
4254
+ /** Everything the person can do there; the most an agent can get. */
4255
+ grantable: Permission[];
4256
+ }>;
4257
+ defaultOrganizationId: string | null;
4258
+ };
4259
+ export type McpConnectionDecision = {
4260
+ decision: "deny";
4261
+ } | {
4262
+ decision: "approve";
4263
+ organizationId: string;
4264
+ access: OrganizationAccessPolicy;
4265
+ };
4266
+ export type ListOrganizationSessionsOptions = {
4267
+ /** Page size, 1..200; the server default is 50. */
4268
+ limit?: number | undefined;
4269
+ /** `nextCursor` from the previous page. */
4270
+ cursor?: string | undefined;
4271
+ /** Keep only sessions labelled with this exact end user. */
4272
+ scopeSubjectId?: string | undefined;
4273
+ /** Keep only sessions in this exact lifecycle state. */
4274
+ status?: SessionStatus | undefined;
4275
+ signal?: AbortSignal | undefined;
4276
+ };
4277
+ /**
4278
+ * One page of `GET /v1/organizations/:organizationId/sessions`. Rows come from
4279
+ * every shared workspace the caller may read, each carrying its
4280
+ * `workspaceId`; personal workspaces are never included and private sessions
4281
+ * stay invisible. A page may be shorter than `limit` while `nextCursor` is
4282
+ * still set, so follow `nextCursor` until it is null.
4283
+ */
4284
+ export type OrganizationSessionListResponse = {
4285
+ sessions: Session[];
4286
+ nextCursor: string | null;
4287
+ };
2568
4288
  export type WorkspaceMember = {
2569
4289
  subjectId: string;
2570
4290
  subjectLabel: string | null;
@@ -2575,8 +4295,18 @@ export type WorkspaceMember = {
2575
4295
  export type ListWorkspaceMembersResponse = {
2576
4296
  members: WorkspaceMember[];
2577
4297
  };
4298
+ export type WorkspaceMemberCandidate = {
4299
+ organizationMembershipId: string;
4300
+ subjectId: string;
4301
+ name: string | null;
4302
+ email: string | null;
4303
+ organizationRole: "owner" | "admin" | "member";
4304
+ };
4305
+ export type ListWorkspaceMemberCandidatesResponse = {
4306
+ members: WorkspaceMemberCandidate[];
4307
+ };
2578
4308
  export type AddWorkspaceMemberRequest = {
2579
- email: string;
4309
+ organizationMembershipId: string;
2580
4310
  role?: string | undefined;
2581
4311
  permissions: Permission[];
2582
4312
  };
@@ -2630,20 +4360,43 @@ export type SessionGoalRevision = {
2630
4360
  resultObjectiveRevision: number | null;
2631
4361
  text: string;
2632
4362
  successCriteria: string | null;
4363
+ rootConstraints: string[];
2633
4364
  mutationPolicy: SessionGoalMutationPolicy;
2634
4365
  rationale: string;
2635
4366
  actor: "agent" | "api" | "scheduled_task";
2636
4367
  actorTurnId: string | null;
2637
4368
  actorAttemptId: string | null;
2638
4369
  proposalId: string | null;
4370
+ rollbackOfRevisionId: string | null;
2639
4371
  createdAt: string;
2640
4372
  };
2641
4373
  export type ApplySessionGoalRevisionRequest = {
2642
4374
  expectedObjectiveRevision: number;
2643
4375
  rationale?: string | undefined;
2644
4376
  };
4377
+ export type ListSessionGoalRevisionsOptions = {
4378
+ limit?: number | undefined;
4379
+ before?: string | undefined;
4380
+ };
4381
+ export type ListSessionGoalRevisionsResponse = {
4382
+ revisions: SessionGoalRevision[];
4383
+ hasMore: boolean;
4384
+ nextCursor: string | null;
4385
+ };
4386
+ export type RejectSessionGoalRevisionRequest = {
4387
+ expectedObjectiveRevision: number;
4388
+ rationale: string;
4389
+ };
4390
+ export type RejectSessionGoalRevisionResponse = {
4391
+ revision: SessionGoalRevision;
4392
+ replay: boolean;
4393
+ };
4394
+ export type RollbackSessionGoalRevisionRequest = {
4395
+ expectedObjectiveRevision: number;
4396
+ rationale: string;
4397
+ };
2645
4398
  export type SessionGoalContinuationState = "inactive" | "scheduled" | "running" | "blocked" | "invariant_broken";
2646
- export type SessionGoalContinuationReason = "goal_inactive" | "wake_pending" | "continuation_pending" | "human_work_pending" | "goal_turn_running" | "human_turn_running" | "workstream_paused" | "approval_required" | "provider_backpressure" | "session_cancelled" | "system_work_pending" | "missing_obligation";
4399
+ export type SessionGoalContinuationReason = "goal_inactive" | "wake_pending" | "continuation_pending" | "human_work_pending" | "goal_turn_running" | "human_turn_running" | "workstream_paused" | "approval_required" | "provider_backpressure" | "session_cancelled" | "system_work_pending" | "held_for_input" | "backoff_pending" | "missing_obligation";
2647
4400
  export type SessionGoalContinuation = {
2648
4401
  state: SessionGoalContinuationState;
2649
4402
  reason: SessionGoalContinuationReason;
@@ -2651,6 +4404,8 @@ export type SessionGoalContinuation = {
2651
4404
  observedRevision: number;
2652
4405
  nextAttemptAt: string | null;
2653
4406
  lastError: string | null;
4407
+ /** Agent-stated reason for a `wait_for_input` hold; null otherwise. */
4408
+ holdReason?: string | null | undefined;
2654
4409
  };
2655
4410
  export type SessionGoal = {
2656
4411
  id: string;
@@ -2660,6 +4415,9 @@ export type SessionGoal = {
2660
4415
  status: SessionGoalStatus;
2661
4416
  text: string;
2662
4417
  successCriteria: string | null;
4418
+ rootConstraints: string[];
4419
+ /** Optional for older-server/source compatibility; current servers always supply this projection. */
4420
+ reportRequirements?: SessionGoalReportRequirement[] | undefined;
2663
4421
  evidence: string | null;
2664
4422
  rationale: string | null;
2665
4423
  pausedReason: string | null;
@@ -2682,6 +4440,7 @@ export type UpdateSessionGoalRequest = {
2682
4440
  } | {
2683
4441
  text: string;
2684
4442
  successCriteria?: string | null | undefined;
4443
+ rootConstraints?: string[] | undefined;
2685
4444
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
2686
4445
  rationale: string;
2687
4446
  expectedObjectiveRevision: number;
@@ -2689,6 +4448,10 @@ export type UpdateSessionGoalRequest = {
2689
4448
  export type UpdateSessionRequest = {
2690
4449
  title: string;
2691
4450
  };
4451
+ /** Replace the complete ordered low-to-high precedence Variable Set selection. */
4452
+ export type UpdateSessionVariableSetsRequest = {
4453
+ variableSetIds: string[];
4454
+ };
2692
4455
  /** Outcome of a manual /compact trigger. */
2693
4456
  export type CompactSessionContextResult = {
2694
4457
  /** pending waits for the current safe boundary; completed ran while idle. */
@@ -2730,6 +4493,10 @@ export type EffectiveSessionControl = {
2730
4493
  interruptionPendingCount: number;
2731
4494
  quiescencePendingCount: number;
2732
4495
  } | null;
4496
+ backgroundCommandSettlement?: {
4497
+ state: "stopping";
4498
+ commandCount: number;
4499
+ } | null | undefined;
2733
4500
  };
2734
4501
  export type SessionCommandReceipt = {
2735
4502
  id: string;
@@ -2743,6 +4510,7 @@ export type SessionCommandReceipt = {
2743
4510
  appliedDraftRevision: number | null;
2744
4511
  createdAt: string;
2745
4512
  };
4513
+ export type SessionPromptRouting = "accepted_for_execution" | "queued_for_execution" | "accepted_for_steering";
2746
4514
  export type ComposerDraft = {
2747
4515
  revision: number;
2748
4516
  text: string;
@@ -2750,20 +4518,38 @@ export type ComposerDraft = {
2750
4518
  resources: ResourceRef[];
2751
4519
  model: string;
2752
4520
  reasoningEffort: ReasoningEffort;
2753
- latencyMode?: LatencyMode | undefined;
4521
+ latencyMode: LatencyMode;
2754
4522
  sourceTurnId: string | null;
2755
4523
  sourceTurnVersion: number | null;
2756
4524
  updatedAt: string | null;
2757
4525
  };
2758
4526
  export type NewSessionDraftOptions = {
4527
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
4528
+ excludedMcpServerIds?: string[] | undefined;
4529
+ visibility?: SessionVisibility | undefined;
2759
4530
  sandboxBackend?: SandboxBackend | undefined;
2760
4531
  targetSandboxId?: string | undefined;
2761
4532
  workingDir?: string | undefined;
4533
+ variableSetIds?: string[] | undefined;
2762
4534
  variableSetId?: string | undefined;
2763
4535
  rigId?: string | undefined;
2764
4536
  goal?: GoalSpec | undefined;
2765
4537
  firstPartyMcpPermissions?: Permission[] | undefined;
2766
4538
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
4539
+ agent?: AgentConfigRequest | undefined;
4540
+ };
4541
+ export type NewSessionSelectionHistory = {
4542
+ /** Most-recently used project first. Null channelId is the Default project. */
4543
+ projects: Array<{
4544
+ channelId: string | null;
4545
+ /** Null means the managed sandbox was used most recently in this project. */
4546
+ targetSandboxId: string | null;
4547
+ /** Most-recently used machine in this project first. */
4548
+ machines: Array<{
4549
+ sandboxId: string;
4550
+ workingDir: string | null;
4551
+ }>;
4552
+ }>;
2767
4553
  };
2768
4554
  export type NewSessionDraft = {
2769
4555
  revision: number;
@@ -2774,8 +4560,16 @@ export type NewSessionDraft = {
2774
4560
  toolsProvided: boolean;
2775
4561
  model: string;
2776
4562
  reasoningEffort: ReasoningEffort;
2777
- latencyMode?: LatencyMode | undefined;
4563
+ latencyMode: LatencyMode;
4564
+ /**
4565
+ * True when the person chose this model policy; false follows the resolved
4566
+ * default for new chats. Absent from older servers.
4567
+ */
4568
+ modelProvided?: boolean | undefined;
4569
+ /** Absent on legacy drafts; null records an explicit Default-project selection. */
4570
+ selectedProjectChannelId?: string | null | undefined;
2778
4571
  options: NewSessionDraftOptions;
4572
+ selectionHistory: NewSessionSelectionHistory;
2779
4573
  updatedAt: string | null;
2780
4574
  };
2781
4575
  export type SessionQueueSnapshot = {
@@ -2796,8 +4590,28 @@ export type SessionQueueSnapshot = {
2796
4590
  };
2797
4591
  export type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
2798
4592
  export type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
2799
- export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result";
4593
+ export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "session_wait_timeout" | "background_command_result" | "child_terminal_result" | "media_generation_result" | "child_requires_action" | "child_requires_action_resolved" | "child_paused" | "child_waiting_capacity" | "child_progress";
2800
4594
  export type SessionSystemUpdateState = "pending" | "delivered" | "cancelled" | "superseded" | "failed";
4595
+ export type SessionSystemUpdatePayload = {
4596
+ type: "session_wait_timeout";
4597
+ waitTurnId: string;
4598
+ deadlineAt: string;
4599
+ reason: string;
4600
+ [key: string]: unknown;
4601
+ } | {
4602
+ type: "background_command_result";
4603
+ commandId: string;
4604
+ state: "exited" | "lost";
4605
+ exitCode: number | null;
4606
+ reason: string;
4607
+ outputLocator: {
4608
+ eventType: "sandbox.command.output.delta";
4609
+ commandId: string;
4610
+ };
4611
+ [key: string]: unknown;
4612
+ } | ({
4613
+ type: Exclude<SessionSystemUpdateKind, "session_wait_timeout" | "background_command_result">;
4614
+ } & Record<string, unknown>);
2801
4615
  export type SessionSystemUpdate = {
2802
4616
  id: string;
2803
4617
  sessionId: string;
@@ -2806,7 +4620,7 @@ export type SessionSystemUpdate = {
2806
4620
  sourceId: string;
2807
4621
  dedupeKey: string;
2808
4622
  summary: string;
2809
- payload: Record<string, unknown>;
4623
+ payload: SessionSystemUpdatePayload;
2810
4624
  lineage: Record<string, unknown>;
2811
4625
  state: SessionSystemUpdateState;
2812
4626
  deliveredTurnId: string | null;
@@ -2814,6 +4628,56 @@ export type SessionSystemUpdate = {
2814
4628
  deliveredAt: string | null;
2815
4629
  createdAt: string;
2816
4630
  };
4631
+ export type SessionRetryRequest = {
4632
+ clientEventId: string;
4633
+ failureEventId: string;
4634
+ model?: string;
4635
+ reasoningEffort?: ReasoningEffort;
4636
+ latencyMode?: LatencyMode;
4637
+ };
4638
+ export type SandboxRecoverySelection = {
4639
+ version: 1;
4640
+ sessionId: string;
4641
+ sandboxGroupId: string;
4642
+ leaseId: string;
4643
+ routeEpoch: number;
4644
+ authorityEpoch: number;
4645
+ leaseEpoch: number;
4646
+ workspaceGeneration: number;
4647
+ archiveGeneration: number;
4648
+ artifactId: string;
4649
+ revision: string;
4650
+ capturedAt: string;
4651
+ };
4652
+ export type SandboxRecoveryProjection = {
4653
+ version: 1;
4654
+ status: "unsupported" | "blocked" | "eligible" | "consent_accepted" | "restoring" | "restored";
4655
+ reason: string | null;
4656
+ checkpoint: SandboxRecoverySelection | null;
4657
+ operationId: string | null;
4658
+ automaticAvailable?: boolean;
4659
+ /** What an automatic Retry does: restore `checkpoint`, or continue on a new
4660
+ * empty workspace because no usable checkpoint survived the sandbox loss. */
4661
+ automaticLane?: "checkpoint" | "fresh_workspace";
4662
+ /** For a timed recovery wait: the earliest time a Retry or a new message can
4663
+ * let OpenGeni decide again. Nothing proceeds by itself before then. */
4664
+ availableAt?: string;
4665
+ };
4666
+ export type SandboxRecoveryRequest = {
4667
+ operationId: string;
4668
+ acceptHistoricalCheckpoint: true;
4669
+ selection: SandboxRecoverySelection;
4670
+ };
4671
+ export type SandboxRecoveryResponse = {
4672
+ outcome: "accepted" | "replayed";
4673
+ operationId: string;
4674
+ recovery: SandboxRecoveryProjection;
4675
+ };
4676
+ export type SessionRetryResponse = {
4677
+ outcome: "accepted" | "replayed";
4678
+ turnId: string;
4679
+ failureEventId: string;
4680
+ };
2817
4681
  export type SessionControlResponse = {
2818
4682
  receipt: SessionCommandReceipt;
2819
4683
  effectiveControl: EffectiveSessionControl;
@@ -2822,6 +4686,19 @@ export type SessionControlResponse = {
2822
4686
  cancelledSessionCount: number;
2823
4687
  cancelledTurnCount: number;
2824
4688
  };
4689
+ export type WorkspacePauseTimer = {
4690
+ id: string;
4691
+ action: "pause" | "resume";
4692
+ dueAt: string;
4693
+ pauseForSeconds: number | null;
4694
+ };
4695
+ export type WorkspacePauseTimerRequest = {
4696
+ action: "set" | "cancel";
4697
+ pauseInSeconds?: number | undefined;
4698
+ pauseForSeconds?: number | null | undefined;
4699
+ clientEventId: string;
4700
+ expectedRevision: number;
4701
+ };
2825
4702
  export type WorkspaceInferenceControlResponse = {
2826
4703
  receipt: SessionCommandReceipt;
2827
4704
  state: "active" | "paused";
@@ -2838,7 +4715,7 @@ export type WorkspaceControlEvent = {
2838
4715
  type: "workspace.control.changed";
2839
4716
  scope: "workspace" | "session";
2840
4717
  rootSessionId: string | null;
2841
- action: "pause" | "resume";
4718
+ action: "pause" | "resume" | "timer_set" | "timer_cancelled";
2842
4719
  automatic: boolean;
2843
4720
  reason: string | null;
2844
4721
  actor: string;
@@ -2888,23 +4765,68 @@ export type DeleteSessionQueueItemRequest = {
2888
4765
  export type SaveComposerDraftRequest = Omit<ComposerDraft, "revision" | "sourceTurnId" | "sourceTurnVersion" | "updatedAt"> & {
2889
4766
  expectedRevision: number;
2890
4767
  };
2891
- export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "updatedAt"> & {
4768
+ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expectedRevision"> & {
4769
+ expectedDraftRevision: number;
4770
+ clientEventId: string;
4771
+ delivery: "send" | "steer";
4772
+ controlEtag?: string;
4773
+ modelContext?: string;
4774
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
4775
+ connectionAccounts?: McpConnectionAccountSelection[];
4776
+ personalResourceAttachment?: PersonalResourceAttachmentIntent;
4777
+ };
4778
+ export type SubmitComposerDraftResponse = {
4779
+ accepted: SessionEvent;
4780
+ turn: SessionTurn;
4781
+ draft: ComposerDraft;
4782
+ receipt: SessionCommandReceipt;
4783
+ routing: SessionPromptRouting;
4784
+ interruptionCount: number;
4785
+ replay: boolean;
4786
+ };
4787
+ export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "selectionHistory" | "updatedAt"> & {
2892
4788
  expectedRevision: number;
2893
4789
  };
2894
4790
  /** Input shape for agent config on create/update (server applies defaults). */
2895
4791
  export type ScheduledTaskAgentConfigInput = {
4792
+ /**
4793
+ * Agent configuration frozen into the schedule and used by every run;
4794
+ * omitted runs follow the workspace's agent defaults.
4795
+ */
4796
+ agent?: AgentConfigRequest | undefined;
4797
+ knowledgeSource?: Extract<ScheduledTaskAction, {
4798
+ kind: "knowledge_source_sync";
4799
+ }> | undefined;
2896
4800
  prompt: string;
2897
4801
  resources?: ResourceRef[] | undefined;
2898
4802
  tools?: ToolRef[] | undefined;
2899
4803
  metadata?: Record<string, unknown> | undefined;
2900
4804
  slackBotConnectionId?: string | undefined;
4805
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
4806
+ slackBotChannelId?: string | undefined;
2901
4807
  model?: string | undefined;
2902
4808
  reasoningEffort?: ReasoningEffort | undefined;
2903
4809
  sandboxBackend?: SandboxBackend | undefined;
4810
+ machineTarget?: {
4811
+ targetSandboxId: string;
4812
+ workingDir?: string | undefined;
4813
+ } | undefined;
2904
4814
  goal?: GoalSpec | undefined;
4815
+ executionClass?: "incident_telemetry" | undefined;
4816
+ incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
2905
4817
  maxNestedAgentDepth?: number | undefined;
4818
+ /**
4819
+ * Seconds a run's own turn may wait on a person (tool approval or structured
4820
+ * question, 60 s - 30 days) before the scheduler rejects the approval / skips
4821
+ * the question as a labelled system decision. Omitted: waits indefinitely.
4822
+ */
4823
+ approvalTimeoutSeconds?: number | undefined;
2906
4824
  };
2907
4825
  export type CreateAgentScheduledTaskRequest = {
4826
+ agentLearning?: {
4827
+ scope: "workspace" | "personal";
4828
+ settings: import("./knowledge.js").AgentLearningOverrides;
4829
+ };
2908
4830
  name: string;
2909
4831
  schedule: ScheduledTaskScheduleSpec;
2910
4832
  action?: {
@@ -2912,12 +4834,19 @@ export type CreateAgentScheduledTaskRequest = {
2912
4834
  } | undefined;
2913
4835
  runMode?: ScheduledTaskRunMode | undefined;
2914
4836
  targetSessionId?: string | null | undefined;
4837
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2915
4838
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2916
4839
  agentConfig: ScheduledTaskAgentConfigInput;
2917
4840
  status?: ScheduledTaskStatus | undefined;
2918
4841
  variableSetId?: string | null | undefined;
2919
4842
  /** @deprecated use variableSetId */
2920
4843
  environmentId?: string | null | undefined;
4844
+ /**
4845
+ * Sandbox Environment each run binds to; its active version is resolved per
4846
+ * fire. Omit to resolve it once at create: the workspace default (none for a
4847
+ * Connected Machine task), or the target session's own environment for an
4848
+ * existing-session task. `null` means none.
4849
+ */
2921
4850
  rigId?: string | null | undefined;
2922
4851
  metadata?: Record<string, unknown> | undefined;
2923
4852
  };
@@ -2931,15 +4860,39 @@ export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
2931
4860
  status?: ScheduledTaskStatus | undefined;
2932
4861
  metadata?: Record<string, unknown> | undefined;
2933
4862
  };
2934
- export type CreateScheduledTaskRequest = CreateAgentScheduledTaskRequest | CreateKnowledgeSourceSyncScheduledTaskRequest;
4863
+ /** Send a scheduled message using the destination chat’s current execution settings. */
4864
+ export type CreateSessionScheduledTaskRequest = {
4865
+ name: string;
4866
+ schedule: ScheduledTaskScheduleSpec;
4867
+ prompt: string;
4868
+ targetSessionId: string;
4869
+ runMode?: "existing_session" | undefined;
4870
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
4871
+ overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
4872
+ status?: ScheduledTaskStatus | undefined;
4873
+ metadata?: Record<string, unknown> | undefined;
4874
+ };
4875
+ export type CreateScheduledTaskRequest = CreateSessionScheduledTaskRequest | CreateAgentScheduledTaskRequest | CreateKnowledgeSourceSyncScheduledTaskRequest;
2935
4876
  export type UpdateScheduledTaskRequest = {
4877
+ expectedExecutionDigest?: string | undefined;
4878
+ adoptSessionSettings?: true | undefined;
4879
+ /** Lossless message edit. All omitted configuration is preserved. */
4880
+ prompt?: string | undefined;
2936
4881
  name?: string | undefined;
2937
4882
  schedule?: ScheduledTaskScheduleSpec | undefined;
2938
4883
  runMode?: ScheduledTaskRunMode | undefined;
2939
4884
  targetSessionId?: string | null | undefined;
4885
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2940
4886
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2941
4887
  action?: ScheduledTaskAction | undefined;
2942
4888
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
4889
+ /** Lossless model defaults patch; cannot be combined with agentConfig replacement.
4890
+ * Existing target/reusable sessions retain their own model and reasoning. */
4891
+ agentConfigPatch?: {
4892
+ prompt?: string | undefined;
4893
+ model?: string | undefined;
4894
+ reasoningEffort?: ReasoningEffort | undefined;
4895
+ } | undefined;
2943
4896
  status?: ScheduledTaskStatus | undefined;
2944
4897
  variableSetId?: string | null | undefined;
2945
4898
  /** @deprecated use variableSetId */
@@ -2977,6 +4930,8 @@ export type ScheduledTaskRun = {
2977
4930
  accountId: string;
2978
4931
  workspaceId: string;
2979
4932
  taskId: string;
4933
+ taskAuthorityRevision: number | null;
4934
+ taskExecutionDigest: string | null;
2980
4935
  status: ScheduledTaskRunStatus;
2981
4936
  triggerType: ScheduledTaskTriggerType;
2982
4937
  scheduledAt: string | null;
@@ -2988,8 +4943,72 @@ export type ScheduledTaskRun = {
2988
4943
  knowledgeSummary: KnowledgeSourceSyncRunSummary | null;
2989
4944
  completedAt: string | null;
2990
4945
  error: string | null;
4946
+ admissionDiagnostic?: {
4947
+ version: 1;
4948
+ reason: "selected_account_unavailable" | "owner_access_unavailable" | "ambiguous_account" | "parent_accounts_required" | "selection_unavailable";
4949
+ accounts: Array<{
4950
+ serverId: string;
4951
+ connectionId: string | null;
4952
+ reason: "connector_unavailable" | "account_not_visible" | "account_inactive" | "account_mismatch" | "selection_unavailable";
4953
+ }>;
4954
+ } | null | undefined;
4955
+ /**
4956
+ * Why the scheduler refused this occurrence before running it; `error`
4957
+ * equals `reason`. `retryable: true` (status `skipped`): a later occurrence
4958
+ * runs once the condition clears. `retryable: false` (status `failed`):
4959
+ * every occurrence is refused until the task or a resource it names changes.
4960
+ */
4961
+ admissionRefusal?: ScheduledTaskAdmissionRefusal | null | undefined;
4962
+ /**
4963
+ * This dispatched run's own turn is waiting on a person (tool approval or
4964
+ * structured question) since `since`; `expiresAt` is when the task's
4965
+ * `approvalTimeoutSeconds` answers for it (null: waits indefinitely).
4966
+ */
4967
+ awaitingHuman?: ScheduledTaskRunAwaitingHuman | null | undefined;
2991
4968
  createdAt: string;
2992
4969
  updatedAt: string;
4970
+ /** Connectors this run could not use; projected only for a viewer who can act on the task. */
4971
+ accessFailures?: ScheduledTaskRunAccessFailure[] | undefined;
4972
+ };
4973
+ export type ScheduledTaskRunAwaitingHuman = {
4974
+ since: string;
4975
+ expiresAt: string | null;
4976
+ };
4977
+ export type ScheduledTaskAdmissionRefusal = {
4978
+ version: 1;
4979
+ reason: "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | (string & {});
4980
+ retryable: boolean;
4981
+ };
4982
+ export type ScheduledTaskAccessFailureReason = "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable";
4983
+ /** A connector a scheduled run's own turn could not use (a `tool.auth_needed` fact). */
4984
+ export type ScheduledTaskRunAccessFailure = {
4985
+ serverId: string;
4986
+ name: string;
4987
+ providerDomain: string;
4988
+ reason: ScheduledTaskAccessFailureReason;
4989
+ count: number;
4990
+ firstOccurredAt: string;
4991
+ };
4992
+ /**
4993
+ * A schedule that needs its owner's attention: its latest run failed closed on
4994
+ * connector access (`runId`, `failures`), and/or a chosen connector account can
4995
+ * no longer be used so new runs cannot start (`unavailableAccounts`; `runId`
4996
+ * and `firedAt` are null when only this applies).
4997
+ */
4998
+ export type ScheduledTaskAccessAttention = {
4999
+ taskId: string;
5000
+ taskName: string;
5001
+ /** The task head this item was computed against; a new head is a new notice. */
5002
+ executionDigest: string;
5003
+ runId: string | null;
5004
+ firedAt: string | null;
5005
+ failures: ScheduledTaskRunAccessFailure[];
5006
+ unavailableAccounts: ScheduledTaskAccessConnector[];
5007
+ /** The latest run is waiting on a person (tool approval or question) right now. */
5008
+ awaitingHuman?: ScheduledTaskRunAwaitingHuman | null | undefined;
5009
+ };
5010
+ export type ListScheduledTaskAccessAttentionResponse = {
5011
+ tasks: ScheduledTaskAccessAttention[];
2993
5012
  };
2994
5013
  /** Generic variable-set reads expose name + version metadata only. */
2995
5014
  export type VariableSetVariableMetadata = {
@@ -3009,17 +5028,33 @@ export type VariableSet = {
3009
5028
  id: string;
3010
5029
  accountId: string;
3011
5030
  workspaceId: string;
5031
+ scope: "organization" | "workspace" | "user";
5032
+ generation: number;
5033
+ status: "active" | "revoked";
3012
5034
  name: string;
3013
5035
  description: string | null;
3014
5036
  variables: VariableSetVariableMetadata[];
3015
5037
  createdAt: string;
3016
5038
  updatedAt: string;
3017
5039
  };
5040
+ /** Exact-ID attachment metadata; intentionally excludes catalog and secret metadata. */
5041
+ export type VariableSetAttachmentMetadata = {
5042
+ id: string;
5043
+ scope: "organization" | "workspace" | "user";
5044
+ };
5045
+ export type ResolveVariableSetAttachmentsRequest = {
5046
+ variableSetIds: string[];
5047
+ };
5048
+ export type ResolveVariableSetAttachmentsResponse = {
5049
+ variableSets: VariableSetAttachmentMetadata[];
5050
+ };
3018
5051
  /** @deprecated use VariableSetVariableMetadata */
3019
5052
  export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3020
5053
  /** @deprecated use VariableSet */
3021
5054
  export type WorkspaceEnvironment = VariableSet;
3022
5055
  export type CreateVariableSetRequest = {
5056
+ /** Omitted remains the legacy workspace-owned path. */
5057
+ scope?: "organization" | "workspace" | "user" | undefined;
3023
5058
  name: string;
3024
5059
  description?: string | undefined;
3025
5060
  /** Initial variables. Values are write-only: they never come back on reads. */
@@ -3104,6 +5139,8 @@ export type Channel = {
3104
5139
  workspaceId: string;
3105
5140
  name: string;
3106
5141
  description: string | null;
5142
+ pinned: boolean;
5143
+ sortOrder: number;
3107
5144
  createdBy: string | null;
3108
5145
  createdAt: string;
3109
5146
  updatedAt: string;
@@ -3115,6 +5152,11 @@ export type CreateChannelRequest = {
3115
5152
  export type UpdateChannelRequest = {
3116
5153
  name?: string;
3117
5154
  description?: string | null;
5155
+ pinned?: boolean;
5156
+ };
5157
+ /** Complete workspace project order. It is replaced atomically after a drag. */
5158
+ export type ReorderChannelsRequest = {
5159
+ channelIds: string[];
3118
5160
  };
3119
5161
  /** Re-files one session; null moves it back to the unfiled inbox. */
3120
5162
  export type UpdateSessionChannelRequest = {
@@ -3124,6 +5166,9 @@ export type Rig = {
3124
5166
  id: string;
3125
5167
  accountId: string;
3126
5168
  workspaceId: string;
5169
+ scope: ResourceAuthorityScope;
5170
+ generation: number;
5171
+ status: "active" | "revoked";
3127
5172
  name: string;
3128
5173
  description: string | null;
3129
5174
  createdBy: string | null;
@@ -3145,6 +5190,7 @@ export type RigChangeVerification = {
3145
5190
  startedAt?: string | undefined;
3146
5191
  finishedAt?: string | undefined;
3147
5192
  log?: string | undefined;
5193
+ platformCheckResults?: RigCheckResult[] | undefined;
3148
5194
  checkResults?: RigCheckResult[] | undefined;
3149
5195
  [key: string]: unknown;
3150
5196
  };
@@ -3162,9 +5208,10 @@ export type RigChange = {
3162
5208
  updatedAt: string;
3163
5209
  };
3164
5210
  export type CreateRigRequest = {
5211
+ scope?: ResourceAuthorityScope;
3165
5212
  name: string;
3166
5213
  description?: string | undefined;
3167
- image?: string | undefined;
5214
+ image?: never;
3168
5215
  setupScript?: string | undefined;
3169
5216
  checks?: RigCheck[] | undefined;
3170
5217
  credentialHooks?: string[] | undefined;
@@ -3179,7 +5226,7 @@ export type RigSetupAppendPayload = {
3179
5226
  note?: string | undefined;
3180
5227
  };
3181
5228
  export type RigDefinitionEditPayload = {
3182
- image?: string | null | undefined;
5229
+ image?: never;
3183
5230
  setupScript?: string | null | undefined;
3184
5231
  checks?: RigCheck[] | undefined;
3185
5232
  credentialHooks?: string[] | undefined;
@@ -3194,7 +5241,17 @@ export type ProposeRigChangeRequest = {
3194
5241
  payload: RigDefinitionEditPayload;
3195
5242
  };
3196
5243
  export type FileStatus = "pending_upload" | "ready" | "failed" | "expired" | "deleted";
5244
+ export type FileListRequest = {
5245
+ scope?: "all" | "workspace" | "personal";
5246
+ limit?: number;
5247
+ cursor?: string;
5248
+ };
5249
+ export type FileListResponse = {
5250
+ files: FileAsset[];
5251
+ nextCursor: string | null;
5252
+ };
3197
5253
  export type FileAsset = {
5254
+ scope?: "workspace" | "personal" | undefined;
3198
5255
  id: string;
3199
5256
  workspaceId: string;
3200
5257
  status: FileStatus;
@@ -3214,7 +5271,7 @@ export declare const RETAINED_OUTPUT_MAX_PAGE_BYTES: number;
3214
5271
  export declare const COMPUTER_SCREENSHOT_MAX_BYTES: number;
3215
5272
  export declare const GENERATED_IMAGE_MAX_BYTES: number;
3216
5273
  export declare const GENERATED_VIDEO_MAX_BYTES: number;
3217
- export type RetainedOutputKind = "tool_result" | "assistant_completion" | "internal_update" | "event_media" | "computer_screenshot" | "generated_image" | "generated_video" | "file";
5274
+ export type RetainedOutputKind = "tool_result" | "assistant_completion" | "internal_update" | "event_media" | "computer_screenshot" | "browser_screenshot" | "generated_image" | "generated_video" | "file";
3218
5275
  export type RetainedOutputUnavailableReason = "not_retained" | "pending" | "failed" | "expired" | "deleted" | "missing_storage" | "storage_write_failed" | "quota_exceeded" | "invalid_content" | "oversized" | "unsupported";
3219
5276
  export type RetainedArtifactReference = {
3220
5277
  available: true;
@@ -3385,6 +5442,7 @@ export type RetainedArtifactDownload = {
3385
5442
  bytes: Uint8Array;
3386
5443
  };
3387
5444
  export type CreateFileUploadRequest = {
5445
+ scope?: "workspace" | "personal";
3388
5446
  filename: string;
3389
5447
  contentType: string;
3390
5448
  sizeBytes: number;
@@ -3410,6 +5468,7 @@ export type FileDownloadUrlResponse = {
3410
5468
  /** Bytes accepted by the `uploadFile` helper. */
3411
5469
  export type FileUploadData = Blob | ArrayBuffer | Uint8Array | string;
3412
5470
  export type UploadFileInput = {
5471
+ scope?: "workspace" | "personal";
3413
5472
  filename: string;
3414
5473
  contentType: string;
3415
5474
  data: FileUploadData;
@@ -3461,6 +5520,7 @@ export type Document = {
3461
5520
  authorityKind: DocumentAuthorityKind;
3462
5521
  authorityWorkspaceId: string | null;
3463
5522
  authoritySubjectId: string | null;
5523
+ authorityId?: string | null | undefined;
3464
5524
  visibility: DocumentVisibility;
3465
5525
  createdBy: string | null;
3466
5526
  agentAccess: boolean;
@@ -3530,393 +5590,304 @@ export type CreateKnowledgeDropRequest = {
3530
5590
  export type MoveDocumentRequest = {
3531
5591
  targetBaseId?: string | undefined;
3532
5592
  };
3533
- export type DocumentSearchRequest = {
3534
- query: string;
3535
- baseIds?: string[] | undefined;
3536
- mode?: DocumentSearchMode | undefined;
3537
- sourceKinds?: KnowledgeSourceKind[] | undefined;
3538
- aclTags?: string[] | undefined;
3539
- limit?: number | undefined;
3540
- };
3541
- export type DocumentSearchResponse = {
3542
- results: DocumentSearchResult[];
5593
+ export type DocumentAuthorityTuple = {
5594
+ kind: DocumentAuthorityKind;
5595
+ workspaceId: string | null;
5596
+ subjectId: string | null;
5597
+ authorityId: string | null;
3543
5598
  };
3544
- export type KnowledgeMemoryStatus = "proposed" | "approved" | "rejected" | "active" | "superseded" | "archived";
3545
- export type KnowledgeMemoryKind = "semantic" | "episodic" | "procedural" | "decision" | "preference";
3546
- export type KnowledgeSourceRef = {
3547
- kind: "document_chunk" | "document" | "session_event" | "memory" | "external";
3548
- id: string;
3549
- uri?: string | undefined;
3550
- title?: string | undefined;
3551
- metadata?: Record<string, unknown> | undefined;
5599
+ export type ReclassifyDocumentAuthorityRequest = {
5600
+ operationId: string;
5601
+ expectedAuthority: DocumentAuthorityTuple;
5602
+ targetAuthorityKind: DocumentAuthorityKind;
3552
5603
  };
3553
- export type KnowledgeMemory = {
3554
- id: string;
3555
- workspaceId: string;
3556
- status: KnowledgeMemoryStatus;
3557
- kind: KnowledgeMemoryKind;
3558
- scope: string;
3559
- text: string;
3560
- sourceRefs: KnowledgeSourceRef[];
3561
- confidence: number;
3562
- metadata: Record<string, unknown>;
3563
- createdBySessionId: string | null;
3564
- reviewedBy: string | null;
3565
- reviewedAt: string | null;
3566
- pinned: boolean;
3567
- usageCount: number;
3568
- lastUsedAt: string | null;
3569
- supersedesId: string | null;
3570
- supersededById: string | null;
3571
- validFrom: string;
3572
- validUntil: string | null;
5604
+ export type DocumentAuthorityReclassification = {
5605
+ operationId: string;
5606
+ documentId: string;
5607
+ previousAuthority: DocumentAuthorityTuple;
5608
+ authority: DocumentAuthorityTuple;
3573
5609
  createdAt: string;
3574
- updatedAt: string;
3575
- };
3576
- export type CreateKnowledgeMemoryRequest = {
3577
- status?: KnowledgeMemoryStatus | undefined;
3578
- kind?: KnowledgeMemoryKind | undefined;
3579
- scope?: string | undefined;
3580
- text: string;
3581
- sourceRefs?: KnowledgeSourceRef[] | undefined;
3582
- confidence?: number | undefined;
3583
- metadata?: Record<string, unknown> | undefined;
3584
- createdBySessionId?: string | undefined;
3585
- pinned?: boolean | undefined;
3586
- replacesId?: string | undefined;
3587
- };
3588
- export type UpdateKnowledgeMemoryRequest = {
3589
- status?: KnowledgeMemoryStatus | undefined;
3590
- kind?: KnowledgeMemoryKind | undefined;
3591
- scope?: string | undefined;
3592
- text?: string | undefined;
3593
- sourceRefs?: KnowledgeSourceRef[] | undefined;
3594
- confidence?: number | undefined;
3595
- metadata?: Record<string, unknown> | undefined;
3596
- reviewedBy?: string | undefined;
3597
- pinned?: boolean | undefined;
3598
5610
  };
3599
- export type KnowledgeMemorySearchRequest = {
3600
- query?: string | undefined;
3601
- status?: KnowledgeMemoryStatus | undefined;
3602
- kind?: KnowledgeMemoryKind | undefined;
3603
- scope?: string | undefined;
5611
+ export type ListDocumentAuthorityReclassificationsOptions = {
3604
5612
  limit?: number | undefined;
5613
+ cursor?: string | undefined;
3605
5614
  };
3606
- export type WorkspaceMemorySearchMode = "hybrid" | "vector" | "keyword";
3607
- export type WorkspaceMemorySearchRequest = {
3608
- query: string;
3609
- kind?: KnowledgeMemoryKind | undefined;
3610
- limit?: number | undefined;
3611
- mode?: WorkspaceMemorySearchMode | undefined;
5615
+ export type ListDocumentAuthorityReclassificationsResponse = {
5616
+ receipts: DocumentAuthorityReclassification[];
5617
+ hasMore: boolean;
5618
+ nextCursor: string | null;
3612
5619
  };
3613
- export type WorkspaceMemorySearchResult = {
3614
- memory: KnowledgeMemory;
3615
- score: number;
3616
- matchType: WorkspaceMemorySearchMode;
3617
- vectorScore: number | null;
3618
- keywordScore: number | null;
5620
+ export type RunDocumentDefaultCollectionBackfillRequest = {
5621
+ runId: string;
5622
+ operationId: string;
5623
+ batchSize?: number | undefined;
3619
5624
  };
3620
- export type WorkspaceMemorySearchResponse = {
3621
- results: WorkspaceMemorySearchResult[];
5625
+ export type DocumentDefaultCollectionBackfill = {
5626
+ runId: string;
5627
+ operationId: string;
5628
+ status: "running" | "completed";
5629
+ lastWorkspaceId: string | null;
5630
+ processedCount: number;
5631
+ createdCount: number;
5632
+ adoptedCount: number;
5633
+ completedAt: string | null;
3622
5634
  };
3623
- export type CapabilityPackConnectorAuthModel = "oauth2_authorization_code_pkce" | "oauth2_authorization_code" | "api_key" | "credential_ref";
3624
- export type CapabilityPackConnector = {
3625
- id: string;
3626
- name: string;
3627
- category: string;
3628
- authModel: CapabilityPackConnectorAuthModel;
3629
- providers: string[];
3630
- scopes: string[];
3631
- required: boolean;
3632
- metadata: Record<string, unknown>;
5635
+ export type DocumentDefaultCollectionBackfillRunAudit = Omit<DocumentDefaultCollectionBackfill, "operationId"> & {
5636
+ actorSubjectId: string;
5637
+ startedAt: string;
5638
+ updatedAt: string;
3633
5639
  };
3634
- export type CapabilityPackKnowledge = {
3635
- type: "document_base";
3636
- id: string;
3637
- name: string;
3638
- description: string | null;
3639
- required: boolean;
5640
+ export type DocumentDefaultCollectionBackfillOperationAudit = {
5641
+ operationId: string;
5642
+ result: DocumentDefaultCollectionBackfill;
5643
+ createdAt: string;
3640
5644
  };
3641
- export type CapabilityPackScheduledTaskTemplate = {
3642
- id: string;
3643
- name: string;
3644
- description: string;
3645
- defaultSchedule: ScheduledTaskScheduleSpec;
3646
- defaultRunMode: ScheduledTaskRunMode;
3647
- defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
3648
- prompt?: string | undefined;
5645
+ export type DocumentDefaultCollectionBackfillReceiptAudit = {
5646
+ workspaceId: string;
5647
+ baseId: string;
5648
+ outcome: "created" | "adopted";
5649
+ createdAt: string;
3649
5650
  };
3650
- export type CapabilityPackSkillFile = {
3651
- path: string;
3652
- content: string;
5651
+ export type ListDocumentDefaultCollectionBackfillRunsResponse = {
5652
+ runs: DocumentDefaultCollectionBackfillRunAudit[];
5653
+ hasMore: boolean;
5654
+ nextCursor: string | null;
3653
5655
  };
3654
- export type CapabilityPackSkill = {
3655
- name: string;
3656
- description?: string | undefined;
3657
- files: CapabilityPackSkillFile[];
5656
+ export type DocumentDefaultCollectionBackfillAudit = {
5657
+ run: DocumentDefaultCollectionBackfillRunAudit;
5658
+ operations: DocumentDefaultCollectionBackfillOperationAudit[];
5659
+ receipts: DocumentDefaultCollectionBackfillReceiptAudit[];
5660
+ operationsHasMore: boolean;
5661
+ operationsNextCursor: string | null;
5662
+ receiptsHasMore: boolean;
5663
+ receiptsNextCursor: string | null;
3658
5664
  };
3659
- export type SessionSkill = CapabilityPackSkill;
3660
- export type CapabilityPackVariableSetSpec = {
3661
- description: string;
3662
- requiredVariables: string[];
3663
- required: boolean;
5665
+ export type GetDocumentDefaultCollectionBackfillAuditOptions = {
5666
+ limit?: number | undefined;
5667
+ operationCursor?: string | undefined;
5668
+ receiptCursor?: string | undefined;
3664
5669
  };
3665
- export type CapabilityPackComponentReference = {
3666
- key: string;
3667
- kind: "plugin";
3668
- pluginKey: string;
3669
- version: string;
3670
- manifestDigest: string;
3671
- required: boolean;
3672
- } | {
3673
- key: string;
3674
- kind: "skill";
3675
- capabilityId: string;
3676
- contentSha256: string;
3677
- required: boolean;
3678
- } | {
3679
- key: string;
3680
- kind: "integration";
3681
- capabilityId: string;
3682
- instanceKey: string;
3683
- revisionId: string;
3684
- contentSha256: string;
3685
- required: boolean;
3686
- } | {
3687
- key: string;
3688
- kind: "facet";
3689
- capabilityId: string;
3690
- instanceKey: string;
3691
- facetKey: string;
3692
- bindingKey: string;
3693
- configDigest: string;
3694
- required: boolean;
5670
+ export type OrganizationDocumentAuthorityReclassification = DocumentAuthorityReclassification & {
5671
+ actorSubjectId: string;
5672
+ requestWorkspaceId: string;
3695
5673
  };
3696
- export type CapabilityPackRigRequirement = {
3697
- description?: string | undefined;
3698
- required: boolean;
3699
- rigId?: string | undefined;
3700
- requireVerified: boolean;
5674
+ export type ListOrganizationDocumentAuthorityReclassificationsResponse = {
5675
+ receipts: OrganizationDocumentAuthorityReclassification[];
5676
+ hasMore: boolean;
5677
+ nextCursor: string | null;
3701
5678
  };
3702
- export type CapabilityPack = {
3703
- id: string;
3704
- name: string;
3705
- description: string;
3706
- role: string;
3707
- category: string;
3708
- version: string;
3709
- sandboxImage?: string | undefined;
3710
- sandboxProviderImages?: {
3711
- modal?: {
3712
- imageId: string;
3713
- } | undefined;
3714
- } | undefined;
3715
- skills: CapabilityPackSkill[];
3716
- components: CapabilityPackComponentReference[];
3717
- rig?: CapabilityPackRigRequirement | undefined;
3718
- tools: ToolRef[];
3719
- connectors: CapabilityPackConnector[];
3720
- knowledge: CapabilityPackKnowledge[];
3721
- scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
3722
- variableSet?: CapabilityPackVariableSetSpec | undefined;
3723
- metadata: Record<string, unknown>;
5679
+ export type DocumentSearchRequest = {
5680
+ query: string;
5681
+ baseIds?: string[] | undefined;
5682
+ mode?: DocumentSearchMode | undefined;
5683
+ sourceKinds?: KnowledgeSourceKind[] | undefined;
5684
+ authorityKinds?: DocumentAuthorityKind[] | undefined;
5685
+ aclTags?: string[] | undefined;
5686
+ limit?: number | undefined;
3724
5687
  };
3725
- /** Input shape for registering a pack manifest (server applies defaults). */
3726
- export type RegisterCapabilityPackRequest = {
3727
- id: string;
3728
- name: string;
3729
- description: string;
3730
- role: string;
3731
- category: string;
3732
- version: string;
3733
- sandboxImage?: string | undefined;
3734
- sandboxProviderImages?: {
3735
- modal?: {
3736
- imageId: string;
3737
- } | undefined;
3738
- } | undefined;
3739
- skills?: {
3740
- name: string;
3741
- description?: string | undefined;
3742
- files: CapabilityPackSkillFile[];
3743
- }[] | undefined;
3744
- components?: ({
3745
- key: string;
3746
- kind: "plugin";
3747
- pluginKey: string;
3748
- version: string;
3749
- manifestDigest: string;
3750
- required?: boolean | undefined;
3751
- } | {
3752
- key: string;
3753
- kind: "skill";
3754
- capabilityId: string;
3755
- contentSha256: string;
3756
- required?: boolean | undefined;
3757
- } | {
3758
- key: string;
3759
- kind: "integration";
3760
- capabilityId: string;
3761
- instanceKey: string;
3762
- revisionId: string;
3763
- contentSha256: string;
3764
- required?: boolean | undefined;
3765
- } | {
3766
- key: string;
3767
- kind: "facet";
3768
- capabilityId: string;
3769
- instanceKey: string;
3770
- facetKey: string;
3771
- bindingKey: string;
3772
- configDigest: string;
3773
- required?: boolean | undefined;
3774
- })[] | undefined;
3775
- rig?: {
3776
- description?: string | undefined;
3777
- required?: boolean | undefined;
3778
- rigId?: string | undefined;
3779
- requireVerified?: boolean | undefined;
3780
- } | undefined;
3781
- tools?: ToolRef[] | undefined;
3782
- connectors?: {
3783
- id: string;
3784
- name: string;
3785
- category: string;
3786
- authModel: CapabilityPackConnectorAuthModel;
3787
- providers?: string[] | undefined;
3788
- scopes?: string[] | undefined;
3789
- required?: boolean | undefined;
3790
- metadata?: Record<string, unknown> | undefined;
3791
- }[] | undefined;
3792
- knowledge?: {
3793
- type: "document_base";
3794
- id: string;
3795
- name: string;
3796
- description?: string | null | undefined;
3797
- required?: boolean | undefined;
3798
- }[] | undefined;
3799
- scheduledTaskTemplates?: {
3800
- id: string;
3801
- name: string;
3802
- description: string;
3803
- defaultSchedule: ScheduledTaskScheduleSpec;
3804
- defaultRunMode?: ScheduledTaskRunMode | undefined;
3805
- defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3806
- prompt?: string | undefined;
3807
- }[] | undefined;
3808
- variableSet?: {
3809
- description: string;
3810
- requiredVariables?: string[] | undefined;
3811
- required?: boolean | undefined;
3812
- } | undefined;
3813
- metadata?: Record<string, unknown> | undefined;
5688
+ export type DocumentSearchResponse = {
5689
+ results: DocumentSearchResult[];
3814
5690
  };
3815
- export type WorkspaceRegisteredPack = {
3816
- accountId: string;
3817
- workspaceId: string;
3818
- pack: CapabilityPack;
3819
- createdAt: string;
3820
- updatedAt: string;
5691
+ export type KnowledgeMemoryStatus = "proposed" | "approved" | "rejected" | "active" | "superseded" | "archived";
5692
+ export type KnowledgeMemoryKind = "semantic" | "episodic" | "procedural" | "decision" | "preference";
5693
+ export type KnowledgeSourceRef = {
5694
+ kind: "document_chunk" | "document" | "session_event" | "memory" | "external";
5695
+ id: string;
5696
+ uri?: string | undefined;
5697
+ title?: string | undefined;
5698
+ metadata?: Record<string, unknown> | undefined;
3821
5699
  };
3822
- export type PackInstallationStatus = "installing" | "active" | "needs_attention" | "disabled";
3823
- export type PackInstallation = {
5700
+ export type KnowledgeMemory = {
3824
5701
  id: string;
3825
- accountId: string;
3826
5702
  workspaceId: string;
3827
- packId: string;
3828
- status: PackInstallationStatus;
3829
- version: number;
3830
- manifestSnapshot: CapabilityPack | null;
3831
- manifestDigest: string | null;
3832
- selectedRigId: string | null;
3833
- installedBySubjectId: string | null;
5703
+ status: KnowledgeMemoryStatus;
5704
+ kind: KnowledgeMemoryKind;
5705
+ scope: string;
5706
+ text: string;
5707
+ sourceRefs: KnowledgeSourceRef[];
5708
+ confidence: number;
3834
5709
  metadata: Record<string, unknown>;
3835
- enabledAt: string;
5710
+ createdBySessionId: string | null;
5711
+ reviewedBy: string | null;
5712
+ reviewedAt: string | null;
5713
+ pinned: boolean;
5714
+ usageCount: number;
5715
+ lastUsedAt: string | null;
5716
+ supersedesId: string | null;
5717
+ supersededById: string | null;
5718
+ validFrom: string;
5719
+ validUntil: string | null;
5720
+ createdAt: string;
3836
5721
  updatedAt: string;
3837
5722
  };
3838
- export type EnablePackRequest = {
3839
- variableSetId?: string | undefined;
3840
- /** @deprecated use variableSetId */
3841
- environmentId?: string | undefined;
5723
+ export type CreateKnowledgeMemoryRequest = {
5724
+ status?: KnowledgeMemoryStatus | undefined;
5725
+ kind?: KnowledgeMemoryKind | undefined;
5726
+ scope?: string | undefined;
5727
+ text: string;
5728
+ sourceRefs?: KnowledgeSourceRef[] | undefined;
5729
+ confidence?: number | undefined;
3842
5730
  metadata?: Record<string, unknown> | undefined;
5731
+ createdBySessionId?: string | undefined;
5732
+ pinned?: boolean | undefined;
5733
+ replacesId?: string | undefined;
3843
5734
  };
3844
- export type PackComponentResolutionStatus = "ready" | "missing" | "mismatch";
3845
- export type PackComponentResolution = {
3846
- key: string;
3847
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
3848
- capabilityId: string;
3849
- required: boolean;
3850
- status: PackComponentResolutionStatus;
3851
- expectedDigest: string;
3852
- actualDigest: string | null;
3853
- resolvedId: string | null;
3854
- label: string;
5735
+ export type UpdateKnowledgeMemoryRequest = {
5736
+ status?: KnowledgeMemoryStatus | undefined;
5737
+ kind?: KnowledgeMemoryKind | undefined;
5738
+ scope?: string | undefined;
5739
+ text?: string | undefined;
5740
+ sourceRefs?: KnowledgeSourceRef[] | undefined;
5741
+ confidence?: number | undefined;
5742
+ metadata?: Record<string, unknown> | undefined;
5743
+ reviewedBy?: string | undefined;
5744
+ pinned?: boolean | undefined;
3855
5745
  };
3856
- export type PackRigResolution = {
3857
- required: boolean;
3858
- status: "not_required" | "ready" | "missing" | "mismatch" | "unverified";
3859
- requestedRigId: string | null;
3860
- rigId: string | null;
3861
- rigVersionId: string | null;
3862
- name: string | null;
3863
- image: string | null;
5746
+ export type KnowledgeMemorySearchRequest = {
5747
+ query?: string | undefined;
5748
+ status?: KnowledgeMemoryStatus | undefined;
5749
+ kind?: KnowledgeMemoryKind | undefined;
5750
+ scope?: string | undefined;
5751
+ limit?: number | undefined;
3864
5752
  };
3865
- export type PreviewPackInstallationRequest = {
3866
- rigId?: string | undefined;
3867
- variableSetId?: string | undefined;
5753
+ export type WorkspaceMemorySearchMode = "hybrid" | "vector" | "keyword";
5754
+ export type WorkspaceMemorySearchRequest = {
5755
+ query: string;
5756
+ kind?: KnowledgeMemoryKind | undefined;
5757
+ limit?: number | undefined;
5758
+ mode?: WorkspaceMemorySearchMode | undefined;
3868
5759
  };
3869
- export type PackInstallationPreview = {
3870
- packId: string;
3871
- packVersion: string;
3872
- manifestDigest: string;
3873
- installationVersion: number | null;
3874
- action: "install" | "update" | "repair";
3875
- ready: boolean;
3876
- blockers: string[];
3877
- components: PackComponentResolution[];
3878
- rig: PackRigResolution;
3879
- variableSetId: string | null;
3880
- legacyInlineSkillCount: number;
3881
- legacySandboxImage: string | null;
5760
+ export type WorkspaceMemorySearchResult = {
5761
+ memory: KnowledgeMemory;
5762
+ score: number;
5763
+ matchType: WorkspaceMemorySearchMode;
5764
+ vectorScore: number | null;
5765
+ keywordScore: number | null;
3882
5766
  };
3883
- export type InstallPackRequest = {
3884
- expectedManifestDigest: string;
3885
- expectedInstallationVersion?: number | undefined;
3886
- rigId?: string | undefined;
3887
- variableSetId?: string | undefined;
3888
- idempotencyKey: string;
3889
- metadata?: Record<string, unknown> | undefined;
5767
+ export type WorkspaceMemorySearchResponse = {
5768
+ results: WorkspaceMemorySearchResult[];
3890
5769
  };
3891
- export type PackUninstallPreview = {
3892
- packId: string;
3893
- installed: boolean;
3894
- installationVersion: number | null;
3895
- components: Array<{
3896
- key: string;
3897
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
3898
- capabilityId: string;
3899
- retainedByOtherOwners: boolean;
3900
- }>;
5770
+ export type SkillArtifactFile = {
5771
+ path: string;
5772
+ content: string;
3901
5773
  };
3902
- export type UninstallPackRequest = {
3903
- expectedInstallationVersion: number;
3904
- idempotencyKey: string;
5774
+ export type SkillArtifactDefinition = {
5775
+ name: string;
5776
+ description?: string | undefined;
5777
+ /** Omitted means workspace-wide; session_selected requires explicit session attachment. */
5778
+ activationMode?: "workspace_managed" | "session_selected" | undefined;
5779
+ files: SkillArtifactFile[];
3905
5780
  };
3906
- export type UninstallPackResult = {
3907
- packId: string;
3908
- status: "not_installed" | "uninstalled";
3909
- retainedComponents: string[];
5781
+ export type SessionSkill = Omit<SkillArtifactDefinition, "activationMode">;
5782
+ /** SKILL.md owns metadata; supplied legacy fields must exactly match it. */
5783
+ export type SkillArtifactDefinitionInput = Omit<SkillArtifactDefinition, "name" | "description"> & {
5784
+ name?: string | undefined;
5785
+ description?: string | undefined;
5786
+ };
5787
+ export type SessionSkillInput = Omit<SkillArtifactDefinitionInput, "activationMode">;
5788
+ export type PrReviewProvider = GitCredentialProvider;
5789
+ export type PrReviewCredentialKind = "github_app" | "managed_github_app" | "provider_token";
5790
+ export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
5791
+ export type CreatePrReviewAppRegistrationRequest = {
5792
+ name: string;
5793
+ provider: PrReviewProvider;
5794
+ providerBaseUrl?: string | undefined;
5795
+ appId?: string | undefined;
5796
+ credentialKind: PrReviewCredentialKind;
5797
+ privateKey?: string | undefined;
5798
+ accessToken?: string | undefined;
5799
+ accessTokenExpiresAt?: string | null | undefined;
5800
+ webhookSecret: string;
5801
+ webhookUsername?: string | undefined;
5802
+ };
5803
+ export type UpdatePrReviewAppRegistrationRequest = {
5804
+ name?: string | undefined;
5805
+ privateKey?: string | undefined;
5806
+ accessToken?: string | undefined;
5807
+ accessTokenExpiresAt?: string | null | undefined;
5808
+ webhookSecret?: string | undefined;
5809
+ webhookUsername?: string | undefined;
5810
+ status?: "active" | "disabled" | undefined;
5811
+ };
5812
+ export type PrReviewAppRegistration = {
5813
+ id: string;
5814
+ sourceId: string;
5815
+ accountId: string;
5816
+ workspaceId: string;
5817
+ name: string;
5818
+ provider: PrReviewProvider;
5819
+ providerBaseUrl: string;
5820
+ appId: string | null;
5821
+ installationId: string | null;
5822
+ providerAccountLogin: string | null;
5823
+ providerAccountType: "User" | "Organization" | null;
5824
+ credentialKind: PrReviewCredentialKind;
5825
+ hasCredential: boolean;
5826
+ accessTokenExpiresAt: string | null;
5827
+ webhookAuthKind: PrReviewWebhookAuthKind;
5828
+ hasWebhookSecret: boolean;
5829
+ webhookUsername: string | null;
5830
+ webhookPath: string;
5831
+ status: "active" | "disabled";
5832
+ createdBySubjectId: string;
5833
+ createdAt: string;
5834
+ updatedAt: string;
5835
+ };
5836
+ export type CreatePrReviewRepositoryBindingRequest = {
5837
+ registrationId: string;
5838
+ repositoryUri: string;
5839
+ repositoryFullName: string;
5840
+ providerRepositoryId: string | number;
5841
+ installationId?: string | number | undefined;
5842
+ projectId?: string | number | undefined;
5843
+ model?: string | null | undefined;
5844
+ additionalInstructions?: string | null | undefined;
5845
+ status?: "active" | "disabled" | undefined;
5846
+ };
5847
+ export type UpdatePrReviewRepositoryBindingRequest = {
5848
+ model?: string | null | undefined;
5849
+ additionalInstructions?: string | null | undefined;
5850
+ status?: "active" | "disabled" | undefined;
5851
+ };
5852
+ export type PrReviewRepositoryBinding = {
5853
+ id: string;
5854
+ triggerId: string;
5855
+ accountId: string;
5856
+ workspaceId: string;
5857
+ registrationId: string;
5858
+ provider: PrReviewProvider;
5859
+ repositoryUri: string;
5860
+ repositoryFullName: string;
5861
+ providerRepositoryId: string;
5862
+ installationId: string | null;
5863
+ projectId: string | null;
5864
+ model: string | null;
5865
+ additionalInstructions: string | null;
5866
+ status: "active" | "disabled";
5867
+ createdBySubjectId: string;
5868
+ createdAt: string;
5869
+ updatedAt: string;
3910
5870
  };
3911
- export type ListPacksResponse = {
3912
- packs: CapabilityPack[];
3913
- installations: PackInstallation[];
5871
+ export type ListPrReviewConfigurationResponse = {
5872
+ registrations: PrReviewAppRegistration[];
5873
+ repositories: PrReviewRepositoryBinding[];
5874
+ };
5875
+ export type PrReviewManagedGitHubInstallation = {
5876
+ registrationId: string;
5877
+ installationId: string;
5878
+ accountLogin: string | null;
5879
+ configureUrl: string | null;
5880
+ repositoryCount: number;
3914
5881
  };
3915
- export type GetPackResponse = {
3916
- pack: CapabilityPack;
3917
- installation: PackInstallation | null;
5882
+ export type PrReviewManagedGitHubSetup = {
5883
+ configured: boolean;
5884
+ status: "unavailable" | "not_connected" | "connected";
5885
+ appName: "OpenGeni Lens";
5886
+ connectUrl: string | null;
5887
+ installations: PrReviewManagedGitHubInstallation[];
5888
+ missing: string[];
3918
5889
  };
3919
- export type CapabilityKind = "pack" | "mcp" | "api" | "skill" | "plugin";
5890
+ export type CapabilityKind = "mcp" | "api" | "skill" | "plugin";
3920
5891
  export type CapabilitySource = "built_in" | "library" | "configured" | "public_registry" | "registry" | "manual";
3921
5892
  export type CapabilityInstallationStatus = "active" | "disabled";
3922
5893
  export type CapabilityCatalogAuthKind = "oauth2" | "api_key" | "none" | "unknown";
@@ -3978,6 +5949,8 @@ export type CapabilityCatalogItem = {
3978
5949
  /** The connection backing this enabled installation, or null when none is involved. */
3979
5950
  connectionRef: {
3980
5951
  connectionId?: string | undefined;
5952
+ accountSelection?: "all_eligible" | undefined;
5953
+ authoritySource?: "host" | undefined;
3981
5954
  providerDomain: string;
3982
5955
  kind: string;
3983
5956
  subjectScope?: "subject" | "workspace" | undefined;
@@ -4017,6 +5990,7 @@ export type CreateCapabilityCatalogItemRequest = {
4017
5990
  metadata?: Record<string, unknown> | undefined;
4018
5991
  };
4019
5992
  export type EnableCapabilityRequest = {
5993
+ onlyIfUninstalled?: boolean | undefined;
4020
5994
  config?: Record<string, unknown> | undefined;
4021
5995
  metadata?: Record<string, unknown> | undefined;
4022
5996
  connectionRef?: McpServerConnectionRef | undefined;
@@ -4033,7 +6007,7 @@ export type DiscoverMcpCapabilitiesResponse = {
4033
6007
  sourceUrl: string;
4034
6008
  };
4035
6009
  export type SkillImportSource = "github" | "skills_sh";
4036
- export type SkillInstallationSource = "library" | "github" | "skills_sh" | "pack";
6010
+ export type SkillInstallationSource = "library" | "github" | "skills_sh";
4037
6011
  export type PreviewSkillImportRequest = {
4038
6012
  url: string;
4039
6013
  };
@@ -4043,6 +6017,7 @@ export type SkillImportFileSummary = {
4043
6017
  contentSha256: string;
4044
6018
  };
4045
6019
  export type SkillImportPreview = {
6020
+ markdown?: string;
4046
6021
  source: SkillImportSource;
4047
6022
  sourceUrl: string;
4048
6023
  repositoryUrl: string;
@@ -4071,6 +6046,7 @@ export type InstallLibrarySkillRequest = {
4071
6046
  expectedInstallationVersion?: number | undefined;
4072
6047
  };
4073
6048
  export type InstalledSkill = {
6049
+ skillReceipt?: import("./skills.js").SkillWriteReceipt | undefined;
4074
6050
  capabilityId: string;
4075
6051
  pluginId: string;
4076
6052
  pluginVersionId: string;
@@ -4087,7 +6063,7 @@ export type InstalledSkill = {
4087
6063
  status: "installed";
4088
6064
  };
4089
6065
  export type CapabilityComponentOwner = {
4090
- kind: "direct" | "plugin" | "pack" | "migration";
6066
+ kind: "direct" | "plugin" | "migration";
4091
6067
  id: string;
4092
6068
  removable: boolean;
4093
6069
  };
@@ -4129,6 +6105,7 @@ export type UninstallSkillRequest = {
4129
6105
  expectedInstallationVersion: number;
4130
6106
  };
4131
6107
  export type UninstallSkillResult = {
6108
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
4132
6109
  capabilityId: string;
4133
6110
  status: "not_installed" | "uninstalled" | "retained_by_other_owners";
4134
6111
  remainingOwners: CapabilityComponentOwner[];
@@ -4158,6 +6135,8 @@ export type IntegrationFacetBindingSummary = {
4158
6135
  lastErrorCode: string | null;
4159
6136
  createdAt: string;
4160
6137
  updatedAt: string;
6138
+ directlyOwned: boolean;
6139
+ owners: CapabilityComponentOwner[];
4161
6140
  };
4162
6141
  export type IntegrationInstanceFacetsResponse = {
4163
6142
  capabilityId: string;
@@ -4194,6 +6173,25 @@ export type IntegrationFacetRemovalResult = {
4194
6173
  binding: IntegrationFacetBindingSummary | null;
4195
6174
  remainingOwners: CapabilityComponentOwner[];
4196
6175
  };
6176
+ /**
6177
+ * Presentation-only consent copy served with an integration or connector.
6178
+ * Never grants a scope or replaces server-side authorization; the UI keeps a
6179
+ * generic fallback for any omitted field.
6180
+ */
6181
+ export type IntegrationPresentation = {
6182
+ providerName?: string | undefined;
6183
+ icon?: "calendar" | "cloud" | "contacts" | "files" | "mail" | undefined;
6184
+ introduction?: string | undefined;
6185
+ capabilities?: {
6186
+ title: string;
6187
+ description: string;
6188
+ }[] | undefined;
6189
+ permissionSummary?: string | undefined;
6190
+ scopeLabels?: Record<string, {
6191
+ label: string;
6192
+ description: string;
6193
+ }> | undefined;
6194
+ };
4197
6195
  export type IntegrationDefinitionSummary = {
4198
6196
  id: string;
4199
6197
  name: string;
@@ -4207,6 +6205,7 @@ export type IntegrationDefinitionSummary = {
4207
6205
  kind: "oauth2";
4208
6206
  scopes: string[];
4209
6207
  };
6208
+ presentation?: IntegrationPresentation | undefined;
4210
6209
  facets: IntegrationFacetDefinitionSummary[];
4211
6210
  };
4212
6211
  export type ListIntegrationDefinitionsResponse = {
@@ -4228,8 +6227,31 @@ export type IntegrationSource = {
4228
6227
  url: string;
4229
6228
  baseUrl?: string | undefined;
4230
6229
  };
6230
+ /**
6231
+ * OpenAPI 3.x text (JSON or YAML, at most 8 MiB) sent in the request instead
6232
+ * of a URL. `sourceKey` is your stable identity for the Integration: reuse it
6233
+ * to update the same installation. Server URLs must be absolute or `baseUrl`
6234
+ * given. Calls still obey the deployment network policy, so an API on
6235
+ * localhost or a private address needs a public tunnel unless the operator
6236
+ * enables private targets. Send the same document again on install.
6237
+ */
6238
+ export type InlineOpenApiDocumentSource = {
6239
+ kind: "openapi_document";
6240
+ sourceKey: string;
6241
+ document: string;
6242
+ baseUrl?: string | undefined;
6243
+ };
6244
+ /** Preview/install input sources. */
6245
+ export type IntegrationSourceInput = IntegrationSource | InlineOpenApiDocumentSource;
6246
+ /** Preview echo: an inline document is reported by digest, never its text. */
6247
+ export type IntegrationSourceProjection = IntegrationSource | {
6248
+ kind: "openapi_document";
6249
+ sourceKey: string;
6250
+ documentSha256: string;
6251
+ baseUrl?: string | undefined;
6252
+ };
4231
6253
  export type PreviewApiIntegrationRequest = {
4232
- source: IntegrationSource;
6254
+ source: IntegrationSourceInput;
4233
6255
  connectionId?: string | undefined;
4234
6256
  ownership?: ConnectionOwnership | undefined;
4235
6257
  };
@@ -4265,7 +6287,7 @@ export type ApiIntegrationToolPreview = {
4265
6287
  deprecated: boolean;
4266
6288
  };
4267
6289
  export type ApiIntegrationPreview = {
4268
- source: IntegrationSource;
6290
+ source: IntegrationSourceProjection;
4269
6291
  definitionId: string;
4270
6292
  definitionProvenance: IntegrationDefinitionProvenance;
4271
6293
  protocol: ApiIntegrationProtocol;
@@ -4287,7 +6309,7 @@ export type ApiIntegrationPreview = {
4287
6309
  warnings: string[];
4288
6310
  };
4289
6311
  export type InstallApiIntegrationRequest = {
4290
- source: IntegrationSource;
6312
+ source: IntegrationSourceInput;
4291
6313
  expectedRevisionId: string;
4292
6314
  expectedContentSha256: string;
4293
6315
  connectionId?: string | undefined;
@@ -4296,6 +6318,14 @@ export type InstallApiIntegrationRequest = {
4296
6318
  displayName?: string | undefined;
4297
6319
  expectedInstanceVersion?: number | undefined;
4298
6320
  allowedTools?: string[] | undefined;
6321
+ /**
6322
+ * Selected tools whose preview `approvalMode` is `"ask"` that should run
6323
+ * without per-call human approval (for example in scheduled or other
6324
+ * unattended sessions). Needs `capabilities:manage`; a curated definition
6325
+ * may forbid exempting specific operations (422). Declarative: omit it and every write tool asks
6326
+ * again. Connector Block and session approval policies still apply.
6327
+ */
6328
+ autoApprovedTools?: string[] | undefined;
4299
6329
  };
4300
6330
  export type InstalledApiIntegration = {
4301
6331
  capabilityId: string;
@@ -4441,6 +6471,9 @@ export type InstallPluginRequest = {
4441
6471
  expectedInstallationVersion?: number | undefined;
4442
6472
  };
4443
6473
  export type InstalledPlugin = {
6474
+ skillPublications?: import("./skills.js").SkillPublicationReceipt[] | undefined;
6475
+ skillWrites?: import("./skills.js").SkillWriteReceipt[] | undefined;
6476
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
4444
6477
  pluginKey: string;
4445
6478
  version: string;
4446
6479
  pluginId: string;
@@ -4457,6 +6490,7 @@ export type PluginInstallationSummary = {
4457
6490
  description: string;
4458
6491
  category: string;
4459
6492
  tags: string[];
6493
+ logoUrl?: string | null | undefined;
4460
6494
  sourceUrl: string | null;
4461
6495
  manifestDigest: string;
4462
6496
  installationVersion: number;
@@ -4468,22 +6502,34 @@ export type PluginInstallationSummary = {
4468
6502
  export type ListInstalledPluginsResponse = {
4469
6503
  plugins: PluginInstallationSummary[];
4470
6504
  };
6505
+ export type PluginUninstallComponentImpact = {
6506
+ capabilityId: string;
6507
+ kind: "skill" | "integration" | "mcp";
6508
+ retainedByOtherOwners: boolean;
6509
+ name: string;
6510
+ disposition: "removed" | "retained" | "inactive";
6511
+ retentionReasons: Array<"other_owners" | "customized" | "re_scoped" | "registry_unavailable">;
6512
+ remainingOwners: Array<{
6513
+ kind: "direct" | "plugin" | "migration";
6514
+ name: string;
6515
+ }>;
6516
+ skillId?: string | undefined;
6517
+ };
4471
6518
  export type PluginUninstallPreview = {
4472
6519
  pluginKey: string;
4473
6520
  installed: boolean;
4474
6521
  version: string | null;
4475
6522
  installationVersion: number | null;
4476
- components: Array<{
4477
- capabilityId: string;
4478
- kind: "skill" | "integration" | "mcp";
4479
- retainedByOtherOwners: boolean;
4480
- }>;
6523
+ previewToken?: string | undefined;
6524
+ components: PluginUninstallComponentImpact[];
4481
6525
  };
4482
6526
  export type UninstallPluginRequest = {
4483
6527
  expectedInstallationVersion: number;
6528
+ expectedPreviewToken?: string | undefined;
4484
6529
  idempotencyKey: string;
4485
6530
  };
4486
6531
  export type UninstallPluginResult = {
6532
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
4487
6533
  pluginKey: string;
4488
6534
  status: "not_installed" | "uninstalled";
4489
6535
  retainedComponents: string[];
@@ -4499,6 +6545,10 @@ export type GitHubRepository = {
4499
6545
  defaultBranch: string;
4500
6546
  accountLogin: string;
4501
6547
  accountType: string | null;
6548
+ /** GitHub's archived flag, when the provider reported it. */
6549
+ archived?: boolean | undefined;
6550
+ /** GitHub's reported size in kilobytes, when reported. Zero means empty. */
6551
+ sizeKb?: number | undefined;
4502
6552
  };
4503
6553
  export type GitHubRepositoryScope = "all" | "selected";
4504
6554
  export type GitHubBindingStatus = "disabled" | "unbound" | "bound";
@@ -4538,6 +6588,55 @@ export type GitHubAppInfo = {
4538
6588
  export type GitHubRepositoriesResponse = {
4539
6589
  repositories: GitHubRepository[];
4540
6590
  };
6591
+ export type GitHubActionPolicyDecision = "allow" | "ask" | "block";
6592
+ export type GitHubActionPolicyEffectiveDecision = GitHubActionPolicyDecision | "mixed";
6593
+ export type GitHubActionPolicyGroup = "routine" | "review" | "merge";
6594
+ export type GitHubActionPolicyActor = {
6595
+ kind: "workspace_app";
6596
+ installationId: number;
6597
+ } | {
6598
+ kind: "personal";
6599
+ connectionId: string;
6600
+ };
6601
+ export type GitHubActionPolicyActorState = GitHubActionPolicyActor & {
6602
+ label: string;
6603
+ groups: Record<GitHubActionPolicyGroup, GitHubActionPolicyEffectiveDecision>;
6604
+ };
6605
+ export type GitHubActionPoliciesResponse = {
6606
+ enabled: boolean;
6607
+ actors: GitHubActionPolicyActorState[];
6608
+ };
6609
+ export type UpdateGitHubActionPolicyRequest = {
6610
+ actor: GitHubActionPolicyActor;
6611
+ group: GitHubActionPolicyGroup;
6612
+ decision: GitHubActionPolicyDecision;
6613
+ };
6614
+ export type VerifyPublicGitHubRepositoryRefRequest = {
6615
+ url: string;
6616
+ ref: string;
6617
+ };
6618
+ export type VerifyPublicGitHubRepositoryRefResponse = {
6619
+ owner: string;
6620
+ name: string;
6621
+ fullName: string;
6622
+ canonicalUrl: string;
6623
+ cloneUrl: string;
6624
+ defaultBranch: string;
6625
+ ref: string;
6626
+ commitSha: string;
6627
+ };
6628
+ export type GitHubRepositoryBranch = {
6629
+ name: string;
6630
+ isDefault: boolean;
6631
+ };
6632
+ export type ListGitHubRepositoryBranchesOptions = {
6633
+ cursor?: number | undefined;
6634
+ limit?: number | undefined;
6635
+ };
6636
+ export type GitHubRepositoryBranchesResponse = {
6637
+ branches: GitHubRepositoryBranch[];
6638
+ nextCursor: number | null;
6639
+ };
4541
6640
  export type CreateGitHubAppManifestRequest = {
4542
6641
  appName?: string | undefined;
4543
6642
  organization?: string | undefined;
@@ -4608,12 +6707,16 @@ export type InsightsModelUsageRow = {
4608
6707
  creditUsd: number;
4609
6708
  estimatedProviderUsd: number;
4610
6709
  estimatedProviderCostKnownCalls: number;
6710
+ equivalentCreditUsd: number;
6711
+ equivalentCreditCostKnownCalls: number;
4611
6712
  };
4612
6713
  export type InsightsSeriesPoint = {
4613
6714
  label: string;
4614
6715
  modelCostUsd: number;
4615
6716
  estimatedProviderUsd: number;
4616
6717
  estimatedProviderCostKnownCalls: number;
6718
+ equivalentCreditUsd: number;
6719
+ equivalentCreditCostKnownCalls: number;
4617
6720
  warmSeconds: number;
4618
6721
  inputTokens: number;
4619
6722
  outputTokens: number;
@@ -4627,6 +6730,10 @@ export type InsightsSeriesPoint = {
4627
6730
  cacheHitPct: number;
4628
6731
  calls: number;
4629
6732
  };
6733
+ export type InsightsScope = {
6734
+ rootSessionId: string | null;
6735
+ sessionId: string | null;
6736
+ };
4630
6737
  export type InsightsDepthBucket = {
4631
6738
  depth: number;
4632
6739
  sessions: number;
@@ -4642,12 +6749,27 @@ export type InsightsSpendDriver = {
4642
6749
  creditUsd: number;
4643
6750
  estimatedProviderUsd: number;
4644
6751
  estimatedProviderCostKnownCalls: number;
6752
+ equivalentCreditUsd: number;
6753
+ equivalentCreditCostKnownCalls: number;
4645
6754
  tokens: number;
4646
6755
  cacheHitPct: number;
4647
6756
  pctOfCreditUsd: number;
4648
6757
  pctOfTokens: number;
4649
6758
  deltaUsdVsPrior: number;
4650
6759
  };
6760
+ export type InsightsProjectRow = {
6761
+ id: string;
6762
+ kind: "project" | "other" | "unfiled" | "unavailable" | "deleted";
6763
+ label: string;
6764
+ projects: number;
6765
+ rootSessions: number;
6766
+ calls: number;
6767
+ creditUsd: number;
6768
+ estimatedProviderUsd: number;
6769
+ estimatedProviderCostKnownCalls: number;
6770
+ tokens: number;
6771
+ cacheHitPct: number | null;
6772
+ };
4651
6773
  export type InsightsWarmGroupRow = {
4652
6774
  id: string;
4653
6775
  groupId: string;
@@ -4683,6 +6805,8 @@ export type InsightsScheduleRow = {
4683
6805
  creditUsd: number | null;
4684
6806
  estimatedProviderUsd: number | null;
4685
6807
  estimatedProviderCostKnownCalls: number | null;
6808
+ equivalentCreditUsd: number | null;
6809
+ equivalentCreditCostKnownCalls: number | null;
4686
6810
  tokens: number | null;
4687
6811
  cacheHitPct: number | null;
4688
6812
  billing: InsightsBillingPath | null;
@@ -4706,8 +6830,24 @@ export type InsightsModelCallRow = {
4706
6830
  totalTokens: number | null;
4707
6831
  creditUsd: number;
4708
6832
  estimatedProviderUsd: number | null;
6833
+ equivalentCreditUsd: number | null;
4709
6834
  pricingSource: InsightsPricingSource | null;
4710
6835
  };
6836
+ export type ModelContextContributionSource = "workspace_instruction_policy" | "legacy_workspace_instructions" | "preference_registry_descriptor" | "company_profile" | "legacy_memory_v1" | "runtime_skill_catalog";
6837
+ export type InsightsPromptContributionRow = {
6838
+ source: ModelContextContributionSource;
6839
+ items: number;
6840
+ utf8Bytes: number;
6841
+ estimatedTokens: number;
6842
+ calls: number;
6843
+ };
6844
+ export type InsightsPromptContributions = {
6845
+ estimatedTokens: number;
6846
+ utf8Bytes: number;
6847
+ coveredCalls: number;
6848
+ totalCalls: number;
6849
+ sources: InsightsPromptContributionRow[];
6850
+ };
4711
6851
  export type WorkspaceInsightsSnapshot = {
4712
6852
  range: InsightsRange;
4713
6853
  rangeLabel: string;
@@ -4723,8 +6863,21 @@ export type WorkspaceInsightsSnapshot = {
4723
6863
  series: InsightsSeriesPoint[];
4724
6864
  depth: InsightsDepthBucket[];
4725
6865
  drivers: InsightsSpendDriver[];
6866
+ projects: InsightsProjectRow[];
6867
+ privateChats: {
6868
+ ownerKey: string;
6869
+ name: string | null;
6870
+ you: boolean;
6871
+ calls: number;
6872
+ tokens: number;
6873
+ creditUsd: number;
6874
+ estimatedProviderUsd: number;
6875
+ estimatedProviderCostKnownCalls: number;
6876
+ }[];
6877
+ privateChatsTruncated: boolean;
4726
6878
  schedules: InsightsScheduleRow[];
4727
6879
  recentCalls: InsightsModelCallRow[];
6880
+ promptContributions: InsightsPromptContributions;
4728
6881
  warmSeconds: number;
4729
6882
  priorWarmSeconds: number;
4730
6883
  warmGroups: InsightsWarmGroupRow[];
@@ -4740,6 +6893,10 @@ export type WorkspaceInsightsSnapshot = {
4740
6893
  priorEstimatedProviderUsd: number;
4741
6894
  estimatedProviderCostKnownCalls: number;
4742
6895
  priorEstimatedProviderCostKnownCalls: number;
6896
+ equivalentCreditUsd: number;
6897
+ priorEquivalentCreditUsd: number;
6898
+ equivalentCreditCostKnownCalls: number;
6899
+ priorEquivalentCreditCostKnownCalls: number;
4743
6900
  modelCalls: number;
4744
6901
  priorInputTokens: number;
4745
6902
  priorTotalTokens: number;
@@ -4758,6 +6915,13 @@ export type WorkspaceInsightsSnapshot = {
4758
6915
  agentRunsUsed: number;
4759
6916
  agentRunCap: number | null;
4760
6917
  modelFilterActive: boolean;
6918
+ dataThrough: string | null;
6919
+ cacheHitPct: number;
6920
+ scope: InsightsScope;
6921
+ driverGroups: number;
6922
+ driversTruncated: boolean;
6923
+ facetsTruncated: boolean;
6924
+ recentCallsTruncated: boolean;
4761
6925
  };
4762
6926
  export type WorkspaceInsightsResponse = {
4763
6927
  snapshot: WorkspaceInsightsSnapshot;
@@ -4769,14 +6933,42 @@ export type BillingEntitlementsResponse = {
4769
6933
  };
4770
6934
  export type CreateCheckoutRequest = {
4771
6935
  accountId?: string | undefined;
4772
- /** USD amount with cent precision (server enforces min/max). */
4773
- amountUsd: number;
6936
+ /**
6937
+ * USD amount with cent precision (server enforces min/max). Required unless
6938
+ * `promotionCode` is given; a fixed-amount USD code then sets the amount.
6939
+ */
6940
+ amountUsd?: number | undefined;
6941
+ /** A Stripe promotion code to apply up front, as the customer typed it. */
6942
+ promotionCode?: string | undefined;
4774
6943
  successUrl?: string | undefined;
4775
6944
  cancelUrl?: string | undefined;
4776
6945
  };
4777
6946
  export type CreateCheckoutResponse = {
4778
6947
  checkoutSessionId: string;
4779
6948
  url: string;
6949
+ /** The credits this checkout grants once it completes. */
6950
+ amountUsd?: number | undefined;
6951
+ };
6952
+ /** Where one checkout stands, and whether its credits reached the balance. */
6953
+ export type BillingCheckoutStatus = {
6954
+ checkoutSessionId: string;
6955
+ status: "open" | "complete" | "expired";
6956
+ credit: {
6957
+ state: "pending" | "granted";
6958
+ amountMicros: number;
6959
+ currency: "usd";
6960
+ /** True when a coupon covered the whole checkout, so nothing was charged. */
6961
+ free: boolean;
6962
+ };
6963
+ balance: BillingBalance | null;
6964
+ };
6965
+ export type CreateBillingPortalRequest = {
6966
+ accountId?: string | undefined;
6967
+ returnUrl?: string | undefined;
6968
+ };
6969
+ export type CreateBillingPortalResponse = {
6970
+ portalSessionId: string;
6971
+ url: string;
4780
6972
  };
4781
6973
  export type UserMessageEventInput = {
4782
6974
  type: "user.message";
@@ -4784,21 +6976,44 @@ export type UserMessageEventInput = {
4784
6976
  payload: {
4785
6977
  text: string;
4786
6978
  annotations?: SubmittedTimelineAnnotation[] | undefined;
4787
- turnInstructions?: string | undefined;
6979
+ modelContext?: string | undefined;
4788
6980
  resources?: ResourceRef[] | undefined;
4789
6981
  model?: string | undefined;
4790
6982
  reasoningEffort?: ReasoningEffort | undefined;
4791
6983
  latencyMode?: LatencyMode | undefined;
6984
+ controlEtag?: string | undefined;
6985
+ expectedDraftRevision?: number | undefined;
4792
6986
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6987
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
6988
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
4793
6989
  };
4794
6990
  };
6991
+ /**
6992
+ * Stable fields of each `session.requiresAction` `payload.approvals[]` entry.
6993
+ * Entries also carry producer-specific compatibility fields (`rawItem` on a
6994
+ * turn's first pause, `raw` on later ones); read only these three. Events
6995
+ * written before these fields existed need `approvalsFromRequiresAction`
6996
+ * from `@opengeni/react` or `approvalIdentifier` from `@opengeni/contracts`.
6997
+ */
6998
+ export type SessionApprovalRequest = {
6999
+ /** Pass as `sendApprovalDecision({ approvalId })`; this is the tool call id. */
7000
+ id: string;
7001
+ /** Model-visible tool name, for example `crm__update_record`. */
7002
+ name: string;
7003
+ /** Tool arguments as the model produced them (usually a JSON string). */
7004
+ arguments: unknown;
7005
+ [compatibilityField: string]: unknown;
7006
+ };
4795
7007
  export type UserApprovalDecisionEventInput = {
4796
7008
  type: "user.approvalDecision";
4797
7009
  clientEventId?: string | undefined;
4798
7010
  payload: {
7011
+ /** `session.requiresAction` `approvals[].id` (the pending tool call id). */
4799
7012
  approvalId: string;
4800
7013
  decision: "approve" | "reject";
4801
7014
  message?: string | undefined;
7015
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7016
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
4802
7017
  };
4803
7018
  };
4804
7019
  export type UserHumanInputResponseEventInput = {
@@ -4807,6 +7022,8 @@ export type UserHumanInputResponseEventInput = {
4807
7022
  payload: {
4808
7023
  requestId: string;
4809
7024
  response: SubmitHumanInputResponseRequest;
7025
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7026
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
4810
7027
  };
4811
7028
  };
4812
7029
  /** Control/user events a client may POST to a session's event log. */
@@ -4831,12 +7048,77 @@ export type MetricSample = {
4831
7048
  /** The derived dashboard state of a machine (M3 liveness + consent/display
4832
7049
  * reasons + the in-flight device-flow). */
4833
7050
  export type MachineState = "online" | "reconnecting" | "offline" | "consent_required" | "display_unavailable" | "enrolling";
4834
- export type MachineKind = "modal" | "selfhosted";
7051
+ export type MachineKind = "docker" | "modal" | "local" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
7052
+ export type MachineConnectionAuthority = {
7053
+ state: "not_applicable" | "unclaimed" | "active" | "expired";
7054
+ generation: number;
7055
+ supersededCount: number;
7056
+ leaseExpiresAt: string | null;
7057
+ duplicateRunnerDeniedCount: number;
7058
+ duplicateRunnerDeniedAt: string | null;
7059
+ };
7060
+ export type MachineRuntimeCapabilities = {
7061
+ exec: boolean;
7062
+ filesystem: boolean;
7063
+ git: boolean;
7064
+ pty: boolean;
7065
+ desktop: boolean;
7066
+ opStream: boolean;
7067
+ browserBridge: boolean;
7068
+ operationResourcePolicy: boolean;
7069
+ operationCpuQuota: boolean;
7070
+ transactionalFsWrite: boolean;
7071
+ };
7072
+ export type MachineUpdateStatus = "requested" | "accepted" | "waiting_for_idle" | "downloading" | "verifying" | "applying" | "restarting" | "succeeded" | "failed";
7073
+ export type MachineUpdateState = {
7074
+ operationId: string;
7075
+ status: MachineUpdateStatus;
7076
+ targetVersion: string;
7077
+ expectedBinarySha256: string | null;
7078
+ errorCode: string | null;
7079
+ retryable: boolean;
7080
+ rolledBack: boolean;
7081
+ requestedAt: string;
7082
+ updatedAt: string;
7083
+ completedAt: string | null;
7084
+ };
7085
+ export type MachineRuntime = {
7086
+ installedVersion: string | null;
7087
+ binarySha256: string | null;
7088
+ updateChannel: "stable" | "beta" | null;
7089
+ desiredVersion: string | null;
7090
+ versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
7091
+ /** Required installer bootstrap when a legacy updater cannot safely replace the install. */
7092
+ updateBlockedReason?: string | null | undefined;
7093
+ capabilities: MachineRuntimeCapabilities;
7094
+ update: MachineUpdateState | null;
7095
+ };
7096
+ export type UpdateMachineAgentResponse = {
7097
+ operationId: string;
7098
+ accepted: boolean;
7099
+ targetVersion: string;
7100
+ };
7101
+ export type MachineOperationPolicy = {
7102
+ memoryMaxBytes: number | null;
7103
+ memoryHighBytes: number | null;
7104
+ cpuMaxMillicores: number | null;
7105
+ revision: number;
7106
+ updatedAt: string | null;
7107
+ };
7108
+ export type UpdateMachineOperationPolicyRequest = {
7109
+ memoryMaxBytes: number | null;
7110
+ memoryHighBytes: number | null;
7111
+ /** Omitted preserves the current CPU limit for older/partial clients; null clears. */
7112
+ cpuMaxMillicores?: number | null;
7113
+ expectedRevision: number;
7114
+ };
4835
7115
  /** A machine as the Machines dashboard renders it (an enrolled selfhosted machine
4836
7116
  * or the session's synthetic Modal group box, `isSessionGroup: true`). */
4837
7117
  export type MachineView = {
4838
7118
  sandboxId: string;
4839
7119
  enrollmentId: string | null;
7120
+ scope: ResourceAuthorityScope;
7121
+ generation: number;
4840
7122
  name: string;
4841
7123
  kind: MachineKind;
4842
7124
  state: MachineState;
@@ -4855,6 +7137,14 @@ export type MachineView = {
4855
7137
  allowScreenControl: boolean;
4856
7138
  sharedSessionCount: number;
4857
7139
  lastSeenAt: string | null;
7140
+ /** Secret-free single-runner authority diagnostics. */
7141
+ connectionAuthority: MachineConnectionAuthority;
7142
+ /** Exact build/update truth. Null means the runner predates runtime Hello
7143
+ * reporting or this is a managed-session group without a connected agent. */
7144
+ runtime: MachineRuntime | null;
7145
+ /** Explicit per-enrollment command memory policy. Null only for managed
7146
+ * session boxes; null limits on a real machine mean unrestricted. */
7147
+ operationPolicy: MachineOperationPolicy | null;
4858
7148
  metrics: MetricSample | null;
4859
7149
  };
4860
7150
  /** GET /v1/workspaces/:ws/machines — the dashboard list + the active-sandbox
@@ -4909,6 +7199,7 @@ export type SwapActiveSandboxResponse = {
4909
7199
  };
4910
7200
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
4911
7201
  export type EnrollmentOs = "linux" | "macos" | "windows";
7202
+ export type ResourceAuthorityScope = "organization" | "workspace" | "user";
4912
7203
  /** POST /v1/enrollments/device/lookup body. */
4913
7204
  export type DeviceEnrollmentLookupRequest = {
4914
7205
  userCode: string;
@@ -4932,6 +7223,7 @@ export type DeviceEnrollmentLookupResponse = {
4932
7223
  export type DeviceEnrollmentApproveRequest = {
4933
7224
  userCode: string;
4934
7225
  allowScreenControl?: boolean;
7226
+ scope?: ResourceAuthorityScope;
4935
7227
  };
4936
7228
  /** POST /v1/workspaces/:ws/enrollments/device/approve response. */
4937
7229
  export type DeviceEnrollmentApproveResponse = {
@@ -4988,4 +7280,151 @@ export type EnrollTokenExchangeRequest = {
4988
7280
  export type EnrollTokenExchangeResponse = {
4989
7281
  credentials: EnrollmentCredentials;
4990
7282
  };
4991
- export {};
7283
+ export type ModelConnectionAccessPolicy = {
7284
+ allowedModels: string[] | null;
7285
+ allowedWorkspaces: string[] | null;
7286
+ allowPersonalWorkspaces: boolean;
7287
+ version: number;
7288
+ };
7289
+ export type ModelConnectionAccessResponse = {
7290
+ policy: ModelConnectionAccessPolicy;
7291
+ models: Array<{
7292
+ id: string;
7293
+ label: string;
7294
+ }>;
7295
+ workspaces: Array<{
7296
+ id: string;
7297
+ name: string;
7298
+ }>;
7299
+ personalWorkspacesSupported: boolean;
7300
+ };
7301
+ export type ConnectorToolPermission = "allow" | "ask" | "block";
7302
+ export type ConnectorToolPermissionEntry = {
7303
+ name: string;
7304
+ title?: string | undefined;
7305
+ description?: string | undefined;
7306
+ group: "read" | "write" | "other";
7307
+ permission: ConnectorToolPermission;
7308
+ inherited: boolean;
7309
+ approvalRequired: boolean;
7310
+ };
7311
+ export type ConnectorToolPermissionsResponse = {
7312
+ connectionId: string;
7313
+ serverId: string;
7314
+ defaultPermission: ConnectorToolPermission | null;
7315
+ tools: ConnectorToolPermissionEntry[];
7316
+ discoveryError: string | null;
7317
+ canManage: boolean;
7318
+ };
7319
+ export type UpdateConnectorToolPermissionsRequest = {
7320
+ connectionId: string;
7321
+ permission: ConnectorToolPermission;
7322
+ } & ({
7323
+ target: "default";
7324
+ } | {
7325
+ target: "tools";
7326
+ toolNames: string[];
7327
+ });
7328
+ /** Agent capability ids (see `@opengeni/contracts` agent-config). */
7329
+ export type AgentCapabilityId = "webSearch" | "humanInput" | "skills" | "goals" | "subagents" | "knowledge" | "schedules" | "artifacts" | "browser" | "media" | "workspaceFiles" | "workspaceConnectors" | "workspaceAdmin";
7330
+ /** `read` reads installed Skills; `manage` also changes them. */
7331
+ export type AgentSkillsCapability = "read" | "manage" | false;
7332
+ export type AgentCapabilityToggles = {
7333
+ webSearch?: boolean | undefined;
7334
+ humanInput?: boolean | undefined;
7335
+ skills?: AgentSkillsCapability | undefined;
7336
+ goals?: boolean | undefined;
7337
+ subagents?: boolean | undefined;
7338
+ knowledge?: boolean | undefined;
7339
+ schedules?: boolean | undefined;
7340
+ artifacts?: boolean | undefined;
7341
+ browser?: boolean | undefined;
7342
+ media?: boolean | undefined;
7343
+ workspaceFiles?: boolean | undefined;
7344
+ workspaceConnectors?: boolean | undefined;
7345
+ workspaceAdmin?: boolean | undefined;
7346
+ };
7347
+ /**
7348
+ * `"all"`: everything this workspace offers (today's behavior). `"none"`: the
7349
+ * session's own tools plus essentials. An object starts from one and toggles.
7350
+ */
7351
+ export type AgentCapabilities = "all" | "none" | ({
7352
+ from: "all" | "none";
7353
+ } & AgentCapabilityToggles);
7354
+ export type AgentRenderer = "opengeni" | "markdown";
7355
+ export type AgentConfigRequest = {
7356
+ capabilities?: AgentCapabilities | undefined;
7357
+ /** Replaces only OpenGeni's identity lines (max 8,000 chars); null = default identity. */
7358
+ identity?: string | null | undefined;
7359
+ /** Alias of the session `instructions` field. */
7360
+ instructions?: string | undefined;
7361
+ renderer?: AgentRenderer | undefined;
7362
+ };
7363
+ export type WorkspaceAgentDefaults = {
7364
+ capabilities?: AgentCapabilities | undefined;
7365
+ identity?: string | null | undefined;
7366
+ renderer?: AgentRenderer | undefined;
7367
+ };
7368
+ export type ResolvedAgentCapabilities = {
7369
+ webSearch: boolean;
7370
+ humanInput: boolean;
7371
+ skills: AgentSkillsCapability;
7372
+ goals: boolean;
7373
+ subagents: boolean;
7374
+ knowledge: boolean;
7375
+ schedules: boolean;
7376
+ artifacts: boolean;
7377
+ browser: boolean;
7378
+ media: boolean;
7379
+ workspaceFiles: boolean;
7380
+ workspaceConnectors: boolean;
7381
+ workspaceAdmin: boolean;
7382
+ };
7383
+ export type ResolvedAgentConfig = {
7384
+ version: 1;
7385
+ from: "all" | "none";
7386
+ capabilities: ResolvedAgentCapabilities;
7387
+ /** Capabilities wanted on but not offered by this deployment. */
7388
+ unavailable: AgentCapabilityId[];
7389
+ identity: string | null;
7390
+ renderer: AgentRenderer;
7391
+ source: "request" | "workspace_default" | "deployment_default" | "inherited" | "legacy_conversion";
7392
+ };
7393
+ export type AgentEffectiveTools = {
7394
+ capabilities: ResolvedAgentCapabilities;
7395
+ unavailable: AgentCapabilityId[];
7396
+ /** False until exact runtime media adapters (including credential identity) are resolved. */
7397
+ mediaToolsKnown?: boolean | undefined;
7398
+ tools: Array<{
7399
+ name: string;
7400
+ capability: AgentCapabilityId | "runtime" | "sandbox" | "product";
7401
+ source: "first_party" | "runtime" | "hosted" | "sandbox" | "mcp";
7402
+ visibility?: "upfront" | "search" | undefined;
7403
+ }>;
7404
+ mcpServers: Array<{
7405
+ id: string;
7406
+ capability: AgentCapabilityId | "runtime" | "product";
7407
+ toolsKnown: boolean;
7408
+ }>;
7409
+ };
7410
+ /** `PUT .../sessions/:id/agent`. Omitted agent fields keep their current values. */
7411
+ export type UpdateSessionAgentRequest = {
7412
+ agent: AgentConfigRequest;
7413
+ /** The session's current `toolPolicyVersion` (shared CAS). */
7414
+ expectedVersion: number;
7415
+ };
7416
+ export type ClientAgentConfig = {
7417
+ /** @deprecated Agent configuration is always on; current servers always report `true`. */
7418
+ enabled: boolean;
7419
+ /** @deprecated Omitted `agent` always resolves `{ capabilities: "all" }`; always `true`. */
7420
+ defaultForNewSessions: boolean;
7421
+ capabilities: Array<{
7422
+ id: AgentCapabilityId;
7423
+ available: boolean;
7424
+ reason?: string | undefined;
7425
+ }>;
7426
+ };
7427
+ /** `error.details.code` of a 422 agent-configuration failure. */
7428
+ export type AgentConfigErrorCode = "agent_capability_unavailable" | "agent_config_conflict" | "agent_config_widening"
7429
+ /** Returned only by older servers that predate always-on agent configuration. */
7430
+ | "agent_config_not_enabled";