@opengeni/sdk 3.3.2 → 3.4.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 (299) hide show
  1. package/README.md +1007 -72
  2. package/dist/adapters/express.d.ts +31 -0
  3. package/dist/adapters/express.js +87 -0
  4. package/dist/adapters/express.js.map +1 -0
  5. package/dist/adapters/hono.d.ts +16 -0
  6. package/dist/adapters/hono.js +8 -0
  7. package/dist/adapters/hono.js.map +1 -0
  8. package/dist/adapters/next.d.ts +29 -0
  9. package/dist/adapters/next.js +22 -0
  10. package/dist/adapters/next.js.map +1 -0
  11. package/dist/allowance-refusal.d.ts +2 -0
  12. package/dist/allowance-refusal.js +50 -0
  13. package/dist/allowance-refusal.js.map +1 -0
  14. package/dist/app-links.d.ts +42 -0
  15. package/dist/app-links.js +66 -0
  16. package/dist/app-links.js.map +1 -0
  17. package/dist/artifact-catalog.d.ts +40 -0
  18. package/dist/artifact-client.d.ts +20 -8
  19. package/dist/artifacts.d.ts +1 -1
  20. package/dist/artifacts.js +8 -6
  21. package/dist/automations.js +8 -2
  22. package/dist/automations.js.map +1 -1
  23. package/dist/azure-live-transport.d.ts +32 -0
  24. package/dist/browser.d.ts +7 -2
  25. package/dist/browser.js +27 -5
  26. package/dist/chat/fold.d.ts +75 -0
  27. package/dist/chat/handler.d.ts +41 -0
  28. package/dist/chat/http.d.ts +67 -0
  29. package/dist/chat/ids.d.ts +34 -0
  30. package/dist/chat/index.d.ts +9 -0
  31. package/dist/chat/index.js +1369 -0
  32. package/dist/chat/index.js.map +1 -0
  33. package/dist/chat/openai.d.ts +30 -0
  34. package/dist/chat/opengeni.d.ts +129 -0
  35. package/dist/chat/types.d.ts +207 -0
  36. package/dist/chat/vercel.d.ts +49 -0
  37. package/dist/chats.d.ts +8 -0
  38. package/dist/chunk-4AHR4KGA.js +301 -0
  39. package/dist/chunk-4AHR4KGA.js.map +1 -0
  40. package/dist/chunk-6GYGMLX4.js +332 -0
  41. package/dist/chunk-6GYGMLX4.js.map +1 -0
  42. package/dist/chunk-7EWT3PV6.js +368 -0
  43. package/dist/chunk-7EWT3PV6.js.map +1 -0
  44. package/dist/chunk-FTWVVPR6.js +1665 -0
  45. package/dist/chunk-FTWVVPR6.js.map +1 -0
  46. package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
  47. package/dist/chunk-GZQSWAKD.js.map +1 -0
  48. package/dist/chunk-KGEABAID.js +71 -0
  49. package/dist/chunk-KGEABAID.js.map +1 -0
  50. package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
  51. package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
  52. package/dist/{chunk-JUS2UYRP.js → chunk-NCU5OAN7.js} +27 -2
  53. package/dist/chunk-NCU5OAN7.js.map +1 -0
  54. package/dist/{chunk-YXQX7RQT.js → chunk-OI5YLASH.js} +73 -2
  55. package/dist/chunk-OI5YLASH.js.map +1 -0
  56. package/dist/chunk-OV3POE62.js +359 -0
  57. package/dist/chunk-OV3POE62.js.map +1 -0
  58. package/dist/chunk-P7UWKORG.js +561 -0
  59. package/dist/chunk-P7UWKORG.js.map +1 -0
  60. package/dist/chunk-QGEIL4TR.js +195 -0
  61. package/dist/chunk-QGEIL4TR.js.map +1 -0
  62. package/dist/{chunk-TRNI7KEO.js → chunk-S2NLS3ES.js} +3669 -1281
  63. package/dist/chunk-S2NLS3ES.js.map +1 -0
  64. package/dist/chunk-UM4ZXXJR.js +9 -0
  65. package/dist/chunk-UM4ZXXJR.js.map +1 -0
  66. package/dist/{chunk-QT3KFVDP.js → chunk-UME3X7CP.js} +28 -32
  67. package/dist/chunk-UME3X7CP.js.map +1 -0
  68. package/dist/chunk-VT4YM4XQ.js +210 -0
  69. package/dist/chunk-VT4YM4XQ.js.map +1 -0
  70. package/dist/chunk-WSYYXONG.js +1602 -0
  71. package/dist/chunk-WSYYXONG.js.map +1 -0
  72. package/dist/{chunk-C2H7HBNP.js → chunk-WVCJRSGJ.js} +119 -14
  73. package/dist/chunk-WVCJRSGJ.js.map +1 -0
  74. package/dist/chunk-X5ITQVXE.js +15 -0
  75. package/dist/chunk-X5ITQVXE.js.map +1 -0
  76. package/dist/chunk-XA7HVIHI.js +126 -0
  77. package/dist/chunk-XA7HVIHI.js.map +1 -0
  78. package/dist/{chunk-KKRO2VCP.js → chunk-YJCHB7R3.js} +60 -12
  79. package/dist/chunk-YJCHB7R3.js.map +1 -0
  80. package/dist/chunk-YKIHNLWD.js +153 -0
  81. package/dist/chunk-YKIHNLWD.js.map +1 -0
  82. package/dist/chunk-ZDUBPV33.js +277 -0
  83. package/dist/chunk-ZDUBPV33.js.map +1 -0
  84. package/dist/client.d.ts +1068 -118
  85. package/dist/codex-realtime-controller.d.ts +13 -0
  86. package/dist/codex-realtime-controller.js +4 -2
  87. package/dist/codex-realtime-v3-wire.d.ts +3 -2
  88. package/dist/codex-realtime.d.ts +5 -1
  89. package/dist/company-brain.d.ts +1 -11
  90. package/dist/core.d.ts +7 -2
  91. package/dist/core.js +25 -6
  92. package/dist/deprecation.d.ts +47 -0
  93. package/dist/document-authority-client.d.ts +24 -2
  94. package/dist/document-authority.js +7 -5
  95. package/dist/editable-artifacts/index.d.ts +1 -1
  96. package/dist/editable-artifacts/types.d.ts +12 -2
  97. package/dist/editable-artifacts.js +19 -3
  98. package/dist/editable-artifacts.js.map +1 -1
  99. package/dist/embedding-client.d.ts +129 -0
  100. package/dist/errors.d.ts +76 -1
  101. package/dist/external-vault-receiver.d.ts +203 -0
  102. package/dist/external-vault-receiver.js +564 -0
  103. package/dist/external-vault-receiver.js.map +1 -0
  104. package/dist/feedback.d.ts +23 -0
  105. package/dist/gateway-realtime-transport.js +1 -1
  106. package/dist/github-repositories.d.ts +10 -0
  107. package/dist/github-repositories.js +36 -0
  108. package/dist/github-repositories.js.map +1 -0
  109. package/dist/index.d.ts +62 -11
  110. package/dist/index.js +557 -338
  111. package/dist/index.js.map +1 -1
  112. package/dist/insights-usage.d.ts +33 -0
  113. package/dist/insights-usage.js +7 -0
  114. package/dist/insights-usage.js.map +1 -0
  115. package/dist/interaction.d.ts +165 -71
  116. package/dist/interaction.js +2 -2
  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/known-tools.d.ts +4 -0
  121. package/dist/message-links.d.ts +68 -0
  122. package/dist/model-context.d.ts +68 -0
  123. package/dist/model-display.d.ts +2 -0
  124. package/dist/model-display.js +17 -0
  125. package/dist/model-display.js.map +1 -0
  126. package/dist/model-picker-order.d.ts +1 -0
  127. package/dist/model-picker-order.js +10 -0
  128. package/dist/model-picker-order.js.map +1 -0
  129. package/dist/organization-integration-policy.d.ts +26 -0
  130. package/dist/organization-integration-policy.js +26 -0
  131. package/dist/organization-integration-policy.js.map +1 -0
  132. package/dist/pr-review-client.d.ts +1 -1
  133. package/dist/pr-review.d.ts +1 -1
  134. package/dist/pr-review.js.map +1 -1
  135. package/dist/preference-registry.d.ts +1 -1
  136. package/dist/prepared-mcp-setup.d.ts +5 -0
  137. package/dist/proxy.d.ts +13 -11
  138. package/dist/realtime.d.ts +1 -1
  139. package/dist/realtime.js +253 -7
  140. package/dist/realtime.js.map +1 -1
  141. package/dist/session-history-import.d.ts +22 -0
  142. package/dist/session-history-import.js +36 -0
  143. package/dist/session-history-import.js.map +1 -0
  144. package/dist/session-list-entries.d.ts +1 -0
  145. package/dist/session-list-entries.js +7 -0
  146. package/dist/session-list-entries.js.map +1 -0
  147. package/dist/session-message-search.d.ts +53 -0
  148. package/dist/session-proxy-client.d.ts +28 -0
  149. package/dist/session-proxy.d.ts +334 -0
  150. package/dist/session-proxy.js +24 -0
  151. package/dist/session-proxy.js.map +1 -0
  152. package/dist/session-titles.d.ts +2 -28
  153. package/dist/session-usage-limits.d.ts +10 -0
  154. package/dist/session-usage-limits.js +43 -0
  155. package/dist/session-usage-limits.js.map +1 -0
  156. package/dist/shared-catalog-loader.d.ts +34 -0
  157. package/dist/site-ai.d.ts +35 -0
  158. package/dist/site-bridge-host.d.ts +112 -0
  159. package/dist/site-bridge-host.js +286 -0
  160. package/dist/site-bridge-host.js.map +1 -0
  161. package/dist/site-browser-entry.d.ts +1 -0
  162. package/dist/site-browser-runtime.gen.d.ts +1 -0
  163. package/dist/site-data.d.ts +178 -0
  164. package/dist/site-document.d.ts +5 -0
  165. package/dist/site-document.js +20 -0
  166. package/dist/site-document.js.map +1 -0
  167. package/dist/site-document.test.d.ts +1 -0
  168. package/dist/site-http.d.ts +17 -0
  169. package/dist/site-sql.d.ts +31 -0
  170. package/dist/site-tool-bridge.d.ts +57 -0
  171. package/dist/site.d.ts +186 -0
  172. package/dist/site.js +63 -0
  173. package/dist/site.js.map +1 -0
  174. package/dist/skills.d.ts +75 -0
  175. package/dist/sse.d.ts +1 -1
  176. package/dist/stream.d.ts +2 -0
  177. package/dist/tenant-workspaces.d.ts +47 -0
  178. package/dist/tenant-workspaces.js +8 -0
  179. package/dist/tenant-workspaces.js.map +1 -0
  180. package/dist/tool-auth.d.ts +87 -0
  181. package/dist/tool-auth.js +23 -0
  182. package/dist/tool-auth.js.map +1 -0
  183. package/dist/tool-display-metadata.d.ts +3 -0
  184. package/dist/tools-37DCTCNZ.js +12 -0
  185. package/dist/tools-37DCTCNZ.js.map +1 -0
  186. package/dist/tools.d.ts +81 -0
  187. package/dist/transcription.d.ts +1 -1
  188. package/dist/types.d.ts +2807 -583
  189. package/dist/usage-allowances.d.ts +36 -0
  190. package/dist/usage-allowances.js +80 -0
  191. package/dist/usage-allowances.js.map +1 -0
  192. package/dist/vault-types.d.ts +324 -0
  193. package/dist/vaults-api.d.ts +65 -0
  194. package/dist/workspace-artifacts.d.ts +47 -5
  195. package/dist/workspace-instruction-policies.d.ts +2 -2
  196. package/dist/workspace-integrations.d.ts +74 -0
  197. package/dist/workspace-integrations.js +67 -0
  198. package/dist/workspace-integrations.js.map +1 -0
  199. package/dist/workspace-state.d.ts +8 -71
  200. package/package.json +103 -5
  201. package/src/adapters/express.ts +136 -0
  202. package/src/adapters/hono.ts +18 -0
  203. package/src/adapters/next.ts +42 -0
  204. package/src/allowance-refusal.ts +5 -0
  205. package/src/app-links.ts +117 -0
  206. package/src/artifact-catalog.ts +51 -0
  207. package/src/artifact-client.ts +40 -49
  208. package/src/artifacts.ts +1 -0
  209. package/src/automations-client.ts +8 -2
  210. package/src/azure-live-transport.ts +286 -0
  211. package/src/browser.ts +37 -0
  212. package/src/chat/fold.ts +431 -0
  213. package/src/chat/handler.ts +240 -0
  214. package/src/chat/http.ts +257 -0
  215. package/src/chat/ids.ts +85 -0
  216. package/src/chat/index.ts +88 -0
  217. package/src/chat/openai.ts +439 -0
  218. package/src/chat/opengeni.ts +737 -0
  219. package/src/chat/types.ts +219 -0
  220. package/src/chat/vercel.ts +204 -0
  221. package/src/chats.ts +16 -0
  222. package/src/client.ts +5697 -1833
  223. package/src/codex-realtime-controller.ts +163 -8
  224. package/src/codex-realtime-v3-wire.ts +4 -3
  225. package/src/codex-realtime-v3.ts +12 -3
  226. package/src/codex-realtime.ts +11 -3
  227. package/src/company-brain.ts +0 -40
  228. package/src/core.ts +20 -0
  229. package/src/deprecation.ts +149 -0
  230. package/src/document-authority-client.ts +104 -1
  231. package/src/editable-artifacts/controller.ts +36 -2
  232. package/src/editable-artifacts/index.ts +1 -0
  233. package/src/editable-artifacts/types.ts +29 -16
  234. package/src/embedding-client.ts +519 -0
  235. package/src/errors.ts +303 -4
  236. package/src/external-vault-receiver.ts +914 -0
  237. package/src/feedback.ts +20 -0
  238. package/src/gateway-realtime-transport.ts +3 -3
  239. package/src/github-repositories.ts +60 -0
  240. package/src/index.ts +603 -65
  241. package/src/insights-usage.ts +64 -0
  242. package/src/interaction.ts +315 -93
  243. package/src/knowledge.ts +72 -0
  244. package/src/known-tools.ts +279 -0
  245. package/src/message-links.ts +178 -0
  246. package/src/model-context.ts +113 -0
  247. package/src/model-display.ts +11 -0
  248. package/src/model-picker-order.ts +6 -0
  249. package/src/organization-integration-policy.ts +54 -0
  250. package/src/pr-review-client.ts +1 -1
  251. package/src/pr-review.ts +1 -1
  252. package/src/preference-registry.ts +2 -0
  253. package/src/prepared-mcp-setup.ts +123 -0
  254. package/src/proxy.ts +23 -12
  255. package/src/realtime.ts +15 -6
  256. package/src/session-history-import.ts +84 -0
  257. package/src/session-list-entries.ts +1 -0
  258. package/src/session-message-search.ts +47 -0
  259. package/src/session-proxy-client.ts +68 -0
  260. package/src/session-proxy.ts +2098 -0
  261. package/src/session-titles.ts +8 -82
  262. package/src/session-usage-limits.ts +71 -0
  263. package/src/shared-catalog-loader.ts +169 -0
  264. package/src/site-ai.ts +284 -0
  265. package/src/site-bridge-host.ts +422 -0
  266. package/src/site-browser-entry.ts +6 -0
  267. package/src/site-browser-runtime.gen.ts +2 -0
  268. package/src/site-data.ts +372 -0
  269. package/src/site-document.test.ts +64 -0
  270. package/src/site-document.ts +18 -0
  271. package/src/site-http.ts +171 -0
  272. package/src/site-sql.ts +153 -0
  273. package/src/site-tool-bridge.ts +401 -0
  274. package/src/site.ts +878 -0
  275. package/src/skills.ts +69 -0
  276. package/src/sse.ts +9 -3
  277. package/src/stream.ts +33 -10
  278. package/src/tenant-workspaces.ts +148 -0
  279. package/src/tool-auth.ts +301 -0
  280. package/src/tool-display-metadata.ts +27 -0
  281. package/src/tools.ts +452 -0
  282. package/src/transcription.ts +3 -0
  283. package/src/types.ts +3170 -582
  284. package/src/usage-allowances.ts +189 -0
  285. package/src/vault-types.ts +379 -0
  286. package/src/vaults-api.ts +339 -0
  287. package/src/workspace-artifacts.ts +55 -6
  288. package/src/workspace-instruction-policies.ts +2 -1
  289. package/src/workspace-integrations.ts +402 -0
  290. package/src/workspace-state.ts +8 -82
  291. package/dist/chunk-C2H7HBNP.js.map +0 -1
  292. package/dist/chunk-C4DJPZRU.js +0 -119
  293. package/dist/chunk-C4DJPZRU.js.map +0 -1
  294. package/dist/chunk-JUS2UYRP.js.map +0 -1
  295. package/dist/chunk-KKRO2VCP.js.map +0 -1
  296. package/dist/chunk-QT3KFVDP.js.map +0 -1
  297. package/dist/chunk-TRNI7KEO.js.map +0 -1
  298. package/dist/chunk-VYCTL62C.js.map +0 -1
  299. package/dist/chunk-YXQX7RQT.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -1,4 +1,10 @@
1
1
  import type { WorkspaceTranscriptionPolicy } from "./transcription.js";
2
+ import type { SessionUsageLimit } from "@opengeni/contracts/session-usage-limits";
3
+ export type { SessionUsageLimit, SessionUsageLimitHistory, SessionUsageLimitReachedRefusal, SessionUsageLimitStatus, SetSessionUsageLimitRequest, } from "@opengeni/contracts/session-usage-limits";
4
+ export type { InsightsUsageRange, InsightsUsageGroupBy, InsightsUsagePayer, InsightsUsageSource, InsightsUsageTokens, InsightsUsageClassMicros, InsightsUsageMeasures, InsightsUsageScope, InsightsUsageGroup, InsightsUsageSeriesPoint, InsightsUsageFacets, InsightsUsageResponse, InsightsCall, InsightsCallsResponse, InsightsUsageWindowOptions, WorkspaceInsightsUsageOptions, OrganizationInsightsUsageOptions, WorkspaceInsightsCallsOptions, OrganizationInsightsCallsOptions, InsightsCallsScope, } from "./insights-usage.js";
5
+ export type { ClaudeSubscriptionOAuthStartResponse, ClaudeSubscriptionOAuthCompleteRequest, ClaudeSubscriptionOAuthCompleteResponse, } from "@opengeni/contracts";
6
+ export type { SessionMessageSearchRequest, SessionMessageSearchMatch, SessionMessageSearchResponse, SessionMessagePreview, SessionMessagePreviewReference, } from "./session-message-search.js";
7
+ 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" | "builtin:opengeni-secrets";
2
8
  export type CodexRealtimeWebrtcVersion = "v3";
3
9
  export type CodexRealtimeVoice = "juniper" | "maple" | "spruce" | "ember" | "vale" | "breeze" | "arbor" | "sol" | "cove";
4
10
  export type CodexRealtimeWebrtcRequest = {
@@ -18,7 +24,7 @@ export type CodexRealtimeWebrtcRequest = {
18
24
  export type CodexRealtimeWebrtcResponse = {
19
25
  sdp: string;
20
26
  version: CodexRealtimeWebrtcVersion;
21
- model: "gpt-live-1-boulder-alpha";
27
+ model: "gpt-live-1-boulder-alpha" | "opengeni-azure/gpt-live-1";
22
28
  connectionId: string;
23
29
  connectionEpoch: number;
24
30
  startupFenceSequence: number;
@@ -51,6 +57,125 @@ export type GatewayRealtimeConnectResponse = {
51
57
  instructions: string;
52
58
  replay: false;
53
59
  };
60
+ export type ToolGatewayIdentity = {
61
+ serverId: string;
62
+ toolName: string;
63
+ };
64
+ export type ToolGatewayCatalogEntry = {
65
+ identity: ToolGatewayIdentity;
66
+ modelName: string;
67
+ codemodePath: string[];
68
+ title?: string | undefined;
69
+ description?: string | undefined;
70
+ inputSchema: Record<string, unknown>;
71
+ outputSchema?: Record<string, unknown> | undefined;
72
+ annotations?: Record<string, unknown> | undefined;
73
+ icons?: Array<Record<string, unknown>> | undefined;
74
+ source: "opengeni" | "files" | "docs" | "mcp" | "codex_apps" | "interaction";
75
+ approval: "none" | "human" | "policy";
76
+ };
77
+ export type ToolGatewayCatalog = {
78
+ version: 1;
79
+ accountId: string;
80
+ workspaceId: string;
81
+ generation: number;
82
+ digest: string;
83
+ createdAt: string;
84
+ entries: ToolGatewayCatalogEntry[];
85
+ };
86
+ export type ToolGatewayResult = {
87
+ content: Array<{
88
+ type: string;
89
+ [key: string]: unknown;
90
+ }>;
91
+ structuredContent?: Record<string, unknown> | undefined;
92
+ isError?: boolean | undefined;
93
+ _meta?: Record<string, unknown> | undefined;
94
+ [key: string]: unknown;
95
+ };
96
+ export type ToolGatewayCallRequest = {
97
+ operationId?: string | undefined;
98
+ catalogDigest: string;
99
+ identity: ToolGatewayIdentity;
100
+ arguments: Record<string, unknown>;
101
+ siteArtifactId?: string | undefined;
102
+ siteVersionId?: string | undefined;
103
+ approvalToken?: string | undefined;
104
+ };
105
+ export type ToolGatewayApprovalRequest = {
106
+ operationId: string;
107
+ catalogDigest: string;
108
+ identity: ToolGatewayIdentity;
109
+ arguments: Record<string, unknown>;
110
+ };
111
+ export type ToolGatewayApprovalResponse = {
112
+ operationId: string;
113
+ catalogDigest: string;
114
+ identity: ToolGatewayIdentity;
115
+ approvalToken: string;
116
+ expiresAt: string;
117
+ };
118
+ export type ToolGatewayCallResponse = {
119
+ operationId: string;
120
+ catalogDigest: string;
121
+ result: ToolGatewayResult;
122
+ };
123
+ export type ToolGatewayTarget = {
124
+ identity: ToolGatewayIdentity;
125
+ } | {
126
+ path: string[];
127
+ };
128
+ export type ToolGatewayResolvedTool = {
129
+ version: 1;
130
+ definitionDigest: string;
131
+ entry: ToolGatewayCatalogEntry;
132
+ };
133
+ export type ToolGatewayResolveRequest = {
134
+ target: ToolGatewayTarget;
135
+ siteArtifactId?: string;
136
+ siteVersionId?: string;
137
+ };
138
+ export type ToolGatewayInvokeRequest = ToolGatewayResolveRequest & {
139
+ operationId: string;
140
+ arguments: Record<string, unknown>;
141
+ expectedDefinitionDigest?: string;
142
+ approvalToken?: string;
143
+ };
144
+ export type ToolGatewayInvokeResponse = {
145
+ operationId: string;
146
+ tool: ToolGatewayResolvedTool;
147
+ result: ToolGatewayResult;
148
+ };
149
+ export type ToolGatewayTargetApprovalRequest = {
150
+ identity: ToolGatewayIdentity;
151
+ operationId: string;
152
+ arguments: Record<string, unknown>;
153
+ expectedDefinitionDigest: string;
154
+ siteArtifactId?: string;
155
+ siteVersionId?: string;
156
+ };
157
+ export type ToolGatewayTargetApprovalResponse = {
158
+ bindingVersion: 2;
159
+ operationId: string;
160
+ tool: ToolGatewayResolvedTool;
161
+ approvalToken: string;
162
+ expiresAt: string;
163
+ };
164
+ export type ToolGatewayManifestRequest = {
165
+ identities: ToolGatewayIdentity[];
166
+ siteArtifactId?: string;
167
+ siteVersionId?: string;
168
+ };
169
+ export type ToolGatewayManifestResponse = {
170
+ version: 1;
171
+ digest: string;
172
+ tools: ToolGatewayResolvedTool[];
173
+ };
174
+ export type ToolGatewayDeclarationsResponse = {
175
+ catalogDigest: string;
176
+ moduleSpecifier: string;
177
+ source: string;
178
+ };
54
179
  export type ActivateCodexRealtimeConnectionRequest = {
55
180
  operationId: string;
56
181
  browserInstanceId: string;
@@ -114,7 +239,7 @@ export type SyncSessionRealtimeLedgerResponse = {
114
239
  }>;
115
240
  outbound: SessionRealtimeLedgerEntry[];
116
241
  };
117
- export type SessionRealtimeModel = "gpt-live-1-boulder-alpha" | "supergrok/grok-voice-think-fast-2.0" | "opengeni-gateway/openai/gpt-realtime-2.1" | "opengeni-gateway/openai/gpt-realtime-mini" | "opengeni-gateway/xai/grok-voice-think-fast-2.0" | "workspace-gateway/openai/gpt-realtime-2.1" | "workspace-gateway/openai/gpt-realtime-mini" | "workspace-gateway/xai/grok-voice-think-fast-2.0";
242
+ export type SessionRealtimeModel = "opengeni-azure/gpt-live-1" | "gpt-live-1-boulder-alpha" | "supergrok/grok-voice-think-fast-2.0" | "opengeni-gateway/openai/gpt-realtime-2.1" | "opengeni-gateway/openai/gpt-realtime-mini" | "opengeni-gateway/xai/grok-voice-think-fast-2.0" | "workspace-gateway/openai/gpt-realtime-2.1" | "workspace-gateway/openai/gpt-realtime-mini" | "workspace-gateway/xai/grok-voice-think-fast-2.0";
118
243
  export type WorkspaceRealtimeModelCatalogItem = {
119
244
  id: SessionRealtimeModel;
120
245
  label: string;
@@ -122,6 +247,8 @@ export type WorkspaceRealtimeModelCatalogItem = {
122
247
  description: string;
123
248
  available: boolean;
124
249
  unavailableReason: string | null;
250
+ /** Machine-readable reason when unavailable, e.g. `insufficient_credits`. */
251
+ unavailableCode?: string | null | undefined;
125
252
  recommended: boolean;
126
253
  };
127
254
  export type WorkspaceRealtimeModelCatalogResponse = {
@@ -158,9 +285,16 @@ export type RenewSessionRealtimeRequest = {
158
285
  export type EndSessionRealtimeRequest = RenewSessionRealtimeRequest & {
159
286
  reason: Extract<SessionRealtimeEndReason, "user_stop" | "browser_unload">;
160
287
  };
288
+ /** Server instruction to end a live call now (for example, out of credits). */
289
+ export type SessionRealtimeStopInstruction = {
290
+ code: string;
291
+ message: string;
292
+ };
161
293
  export type SessionRealtimeMutationResponse = {
162
294
  mode: SessionRealtimeMode;
163
295
  replay: boolean;
296
+ /** Present on a heartbeat when the server stopped extending the lease. */
297
+ stop?: SessionRealtimeStopInstruction | undefined;
164
298
  };
165
299
  export type SessionStatus = "queued" | "running" | "idle" | "requires_action" | "recovering" | "waiting_capacity" | "failed" | "cancelled";
166
300
  export type SandboxBackend = "docker" | "modal" | "local" | "none" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
@@ -311,7 +445,7 @@ export type RepositoryResourceRef = {
311
445
  /** Exact immutable commit that repository materialization must produce. */
312
446
  expectedCommitSha?: string | undefined;
313
447
  /**
314
- * Optional workspace-relative override. When omitted, OpenGeni persists
448
+ * Optional workspace-relative override. When omitted, Opengeni persists
315
449
  * `repos/<encoded-host>/<owner>/<repo>` so equal names on different Git
316
450
  * providers do not collide. Explicit paths are portable, traversal-free, and
317
451
  * collision-checked case-insensitively before sandbox execution.
@@ -328,6 +462,12 @@ export type RepositoryResourceRef = {
328
462
  connectionId?: string | undefined;
329
463
  githubInstallationId?: number | undefined;
330
464
  githubRepositoryId?: number | undefined;
465
+ /**
466
+ * Best-effort materialization: a failed clone logs a warning and the
467
+ * session continues without this repository instead of failing sandbox
468
+ * setup. Omit it to keep a failed clone fatal.
469
+ */
470
+ optional?: boolean | undefined;
331
471
  };
332
472
  /** Value mirror of `@opengeni/contracts`; parity-tested without importing it from ordinary SDK entries. */
333
473
  export declare const DEFAULT_FILE_RESOURCE_MOUNT_ROOT: ".opengeni/files";
@@ -341,15 +481,24 @@ export type ResourceRef = RepositoryResourceRef | FileResourceRef;
341
481
  export type ToolRef = {
342
482
  kind: "mcp";
343
483
  id: string;
484
+ /** Narrow this connection's authorized tool names; an empty list allows none. */
485
+ allowedTools?: string[] | undefined;
486
+ /** Skip this server when its connect/tools-list fails instead of failing the turn. */
344
487
  optional?: boolean | undefined;
488
+ /**
489
+ * Put this server's tool schemas on the first model request instead of behind
490
+ * `tool_search` progressive discovery. A startup choice only; grants nothing.
491
+ */
345
492
  eager?: boolean | undefined;
346
493
  };
347
494
  export type SessionToolPolicy = {
348
495
  mode: "workspace_default" | "explicit" | "inherited";
349
496
  inheritedFromSessionId: string | null;
497
+ excludedMcpServerIds?: string[] | undefined;
350
498
  };
351
499
  export type UpdateSessionToolPolicyRequest = {
352
500
  mode: "workspace_default";
501
+ excludedMcpServerIds?: string[] | undefined;
353
502
  expectedVersion: number;
354
503
  } | {
355
504
  mode: "explicit";
@@ -379,10 +528,20 @@ export type SessionEffectiveToolPolicy = {
379
528
  };
380
529
  idsTruncated: boolean;
381
530
  };
531
+ export type SessionGoalReportRequirement = {
532
+ id: string;
533
+ title: string;
534
+ };
535
+ export type SessionGoalReportDelivery = {
536
+ requirementId: string;
537
+ artifactId: string;
538
+ inspectionReceiptId: string;
539
+ };
382
540
  export type GoalSpec = {
383
541
  text: string;
384
542
  successCriteria?: string | undefined;
385
543
  rootConstraints?: string[] | undefined;
544
+ reportRequirements?: SessionGoalReportRequirement[] | undefined;
386
545
  maxAutoContinuations?: number | undefined;
387
546
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
388
547
  };
@@ -402,6 +561,28 @@ export type SessionMcpCredentialUpdateInput = {
402
561
  id: string;
403
562
  headers: Record<string, string>;
404
563
  };
564
+ export type RotateSessionMcpCredentialsRequest = {
565
+ operationKey: string;
566
+ updates: Array<{
567
+ id: string;
568
+ expectedCredentialVersion: number;
569
+ expectedServerUrl: string;
570
+ } & ({
571
+ headers: Record<string, string>;
572
+ } | {
573
+ nativeConnectionId: string;
574
+ replacementServerUrl?: string | undefined;
575
+ })>;
576
+ };
577
+ export type RotateSessionMcpCredentialsReceipt = {
578
+ operationKey: string;
579
+ sessionId: string;
580
+ servers: Array<{
581
+ id: string;
582
+ credentialVersion: number;
583
+ }>;
584
+ appliedAt: string;
585
+ };
405
586
  export type SessionMcpApprovalPolicy = boolean | string[];
406
587
  export type SessionMcpServerMetadata = {
407
588
  id: string;
@@ -416,9 +597,14 @@ export type UpdateSessionMcpApprovalPolicyRequest = {
416
597
  requireApproval: SessionMcpApprovalPolicy;
417
598
  };
418
599
  export type UpdateSessionMcpApprovalPolicyResponse = {
419
- server: SessionMcpServerMetadata;
600
+ server: SessionMcpApprovalPolicyTarget;
420
601
  effectiveFrom: "next_attempt";
421
602
  };
603
+ export type SessionMcpApprovalPolicyTarget = SessionMcpServerMetadata | {
604
+ id: string;
605
+ source: "workspace";
606
+ requireApproval: SessionMcpApprovalPolicy;
607
+ };
422
608
  export type ConnectionKind = "oauth2" | "api_key" | "app_install" | "delegated";
423
609
  export type ConnectionStatus = "active" | "needs_reauth" | "revoked" | "error";
424
610
  export type UserResourceDelegation = {
@@ -435,13 +621,21 @@ export type UserResourceDelegation = {
435
621
  grantGeneration: number;
436
622
  resourceVersionId?: string | null | undefined;
437
623
  };
438
- export type McpConnectionAuthoritySelection = {
624
+ export type McpConnectionAccountSelection = {
439
625
  serverId: string;
440
626
  connectionId: string;
441
- userDelegation: UserResourceDelegation;
442
627
  };
443
628
  export type McpServerConnectionRef = {
444
629
  connectionId?: string | undefined;
630
+ accountSelection?: "all_eligible" | undefined;
631
+ authoritySource?: "host" | undefined;
632
+ /** accepted_turn is configuration-only; each accepted owner must select a grant. */
633
+ hostBinding?: {
634
+ bindingId: string;
635
+ generation: number;
636
+ } | {
637
+ selection: "accepted_turn";
638
+ } | undefined;
445
639
  provider?: string | undefined;
446
640
  providerDomain: string;
447
641
  kind?: ConnectionKind | undefined;
@@ -484,17 +678,63 @@ export type ConnectionMetadata = {
484
678
  createdAt: string;
485
679
  updatedAt: string;
486
680
  };
487
- export type CreateConnectionRequest = {
681
+ /** Where a brokered credential is written on each outbound provider request. */
682
+ export type ConnectionCredentialPlacement = {
683
+ carrier: "header" | "query" | "cookie";
684
+ name: string;
685
+ value: string;
686
+ /** Prepended to `value`, for example `"Bearer "` or `"Token "`. */
687
+ prefix?: string | undefined;
688
+ };
689
+ /**
690
+ * Write-only secret for a brokered `api_key` Connection (API Integrations and
691
+ * MCP servers). The broker never infers a location: use exact `headers`, or
692
+ * `placements` when the provider expects a query parameter or cookie (API
693
+ * Integrations only) or a prefixed value. Match the carrier/name reported by
694
+ * `previewApiIntegration().auth`. A bare `{ apiKey }` is rejected with 422.
695
+ *
696
+ * @example { headers: { Authorization: "Token abc123" } }
697
+ * @example { placements: [{ carrier: "header", name: "X-Api-Key", value: "abc123" }] }
698
+ */
699
+ export type ApiKeyConnectionCredential = {
700
+ headers: Record<string, string>;
701
+ placements?: never;
702
+ } | {
703
+ placements: ConnectionCredentialPlacement[];
704
+ headers?: never;
705
+ };
706
+ type CreateConnectionRequestBase = {
488
707
  providerDomain: string;
489
- kind: ConnectionKind;
490
708
  ownership?: ConnectionOwnership | undefined;
491
709
  /** @deprecated use ownership */
492
710
  subjectId?: string | null | undefined;
493
- credential: Record<string, unknown>;
494
711
  grantedScopes?: string[] | undefined;
495
712
  expiresAt?: string | null | undefined;
496
- metadata?: Record<string, unknown> | undefined;
713
+ operationId?: string | undefined;
714
+ /** Direct OpenAI/Azure keys only: verify the provider/model before saving. */
715
+ verifyModelAccess?: boolean | undefined;
497
716
  };
717
+ export type CreateConnectionRequest = CreateConnectionRequestBase & ({
718
+ kind: "api_key";
719
+ credential: ApiKeyConnectionCredential;
720
+ metadata?: Record<string, unknown> | undefined;
721
+ } | {
722
+ /**
723
+ * Workspace model-provider key lane (Vercel AI Gateway / OpenRouter),
724
+ * selected by `metadata.credentialRole`; not usable by integrations.
725
+ */
726
+ kind: "api_key";
727
+ credential: {
728
+ apiKey: string;
729
+ };
730
+ metadata: {
731
+ credentialRole: string;
732
+ } & Record<string, unknown>;
733
+ } | {
734
+ kind: Exclude<ConnectionKind, "api_key">;
735
+ credential: Record<string, unknown>;
736
+ metadata?: Record<string, unknown> | undefined;
737
+ });
498
738
  export type PersonalGitHubConnectionMetadata = {
499
739
  credentialRole: "opengeni_github_personal";
500
740
  providerFamily: "github";
@@ -588,9 +828,20 @@ export type VerifyPersonalGitHubRepositorySelectionsRequest = {
588
828
  idempotencyKey: string;
589
829
  };
590
830
  export type OpenGeniSlackBotInstallRequest = {
591
- /** Existing OpenGeni Slack bot connection to reinstall in place. */
831
+ /** Existing Opengeni Slack bot connection to reinstall in place. */
592
832
  connectionId?: string | undefined;
593
833
  };
834
+ export type AvailableOpenGeniSlackBots = {
835
+ connections: ConnectionMetadata[];
836
+ organizationSharedConnectionIds: string[];
837
+ };
838
+ export type UpdateOpenGeniSlackBotOrganizationAccess = {
839
+ enabled: boolean;
840
+ };
841
+ export type OpenGeniSlackBotOrganizationAccess = {
842
+ enabled: boolean;
843
+ generation: number;
844
+ };
594
845
  export type FikenInstallRequest = {
595
846
  apiToken: string;
596
847
  defaultCompanySlug?: string | undefined;
@@ -598,6 +849,7 @@ export type FikenInstallRequest = {
598
849
  connectionId?: string | undefined;
599
850
  };
600
851
  export type FikenOAuthStartRequest = {
852
+ returnPath?: string | undefined;
601
853
  /** Existing Fiken connection to re-authorize in place (reconnect). */
602
854
  connectionId?: string | undefined;
603
855
  };
@@ -623,7 +875,7 @@ export type SlackInstallationBinding = {
623
875
  slackTeamName: string;
624
876
  botId: string;
625
877
  botUserId: string;
626
- botDisplayName: "OpenGeni" | "OpenGeni Staging";
878
+ botDisplayName: "Opengeni" | "Opengeni Staging" | "OpenGeni" | "OpenGeni Staging";
627
879
  state: SlackInstallationBindingState;
628
880
  quarantineReason: string | null;
629
881
  version: number;
@@ -841,6 +1093,8 @@ export type UpdateConnectionRequest = {
841
1093
  grantedScopes?: string[] | undefined;
842
1094
  expiresAt?: string | null | undefined;
843
1095
  metadata?: Record<string, unknown> | undefined;
1096
+ expectedVersion?: number | undefined;
1097
+ operationId?: string | undefined;
844
1098
  };
845
1099
  export type ConnectionResponse = {
846
1100
  connection: ConnectionMetadata;
@@ -855,7 +1109,12 @@ export type OAuthStartRequest = {
855
1109
  resource?: string | undefined;
856
1110
  requestedScopes?: string[] | undefined;
857
1111
  returnPath?: string | undefined;
1112
+ /** Exact trusted-host destination; requires verified external-user mode. */
1113
+ returnUrl?: string | undefined;
858
1114
  connectionId?: string | undefined;
1115
+ /** Sign in a further account instead of refreshing your existing active one.
1116
+ * Never combined with connectionId. */
1117
+ newAccount?: true | undefined;
859
1118
  ownership?: ConnectionOwnership | undefined;
860
1119
  oauthClient?: {
861
1120
  clientId: string;
@@ -905,11 +1164,11 @@ export type ServiceTurnInitiator = TurnInitiator & {
905
1164
  kind: "service";
906
1165
  };
907
1166
  export type TurnInitiatorContext = Record<string, unknown>;
908
- /** Bounded host provenance; OpenGeni-owned lineage keys are reserved. */
1167
+ /** Bounded host provenance; Opengeni-owned lineage keys are reserved. */
909
1168
  export type ServiceTurnInitiatorContext = TurnInitiatorContext;
910
1169
  export type IntegrationClientMetadata = {
911
1170
  client_id: string;
912
- client_name: "OpenGeni";
1171
+ client_name: "Opengeni" | "OpenGeni";
913
1172
  redirect_uris: string[];
914
1173
  token_endpoint_auth_method: "none";
915
1174
  grant_types: Array<"authorization_code" | "refresh_token">;
@@ -920,6 +1179,11 @@ export type SessionTenancyCreateCapabilities = {
920
1179
  activated: boolean;
921
1180
  canCreatePrivate: boolean;
922
1181
  reason: "available" | "not_activated" | "managed_session_required" | "unavailable";
1182
+ /**
1183
+ * Who sees a new chat or schedule unless the person picks otherwise. Absent
1184
+ * from older servers, which means "workspace".
1185
+ */
1186
+ defaultVisibility?: SessionVisibility;
923
1187
  };
924
1188
  export type SessionTenancyPublicProjection = {
925
1189
  visibility: SessionVisibility;
@@ -935,6 +1199,38 @@ export type UpdateSessionVisibilityRequest = {
935
1199
  visibility: SessionVisibility;
936
1200
  expectedAuthorityEpoch: number;
937
1201
  idempotencyKey: string;
1202
+ /**
1203
+ * "Make private anyway": stop the chat's work in progress (the running or
1204
+ * parked response, queued messages, an active goal) as part of the change.
1205
+ * Without it such work refuses the change with reason `active_work`.
1206
+ */
1207
+ stopActiveWork?: boolean;
1208
+ };
1209
+ /** What still refuses a visibility change after the chat's own work stops. */
1210
+ export type SessionTenancyBlocker = "nonterminal_turn" | "nonterminal_attempt" | "unsettled_interruption" | "pending_system_update" | "pending_human_input" | "pending_tool_receipt" | "run_state" | "active_goal" | "capacity_waiter" | "active_realtime" | "active_scheduled_task" | "workspace_mutation_admission" | "retained_process" | "active_sandbox_access" | "shared_sandbox_group";
1211
+ /**
1212
+ * What a change to Only me stops or removes when `stopActiveWork` is sent:
1213
+ * the chat's visible work and anything that carries another person's access.
1214
+ */
1215
+ export type SessionVisibilityWork = {
1216
+ runningTurnCount: number;
1217
+ queuedTurnCount: number;
1218
+ activeGoal: boolean;
1219
+ /** A voice session is live in the chat. */
1220
+ liveVoice: boolean;
1221
+ /** Pending updates that carry another person's access. */
1222
+ otherPeoplePendingUpdateCount: number;
1223
+ /** Account choices for the chat that only another person may use. */
1224
+ otherPeopleAccountChoiceCount: number;
1225
+ };
1226
+ export type SessionVisibilityChangePreview = {
1227
+ visibility: SessionVisibility;
1228
+ targetVisibility: SessionVisibility;
1229
+ authorityEpoch: number;
1230
+ /** Nothing else refuses the change; an empty value means it just happens. */
1231
+ work: SessionVisibilityWork;
1232
+ /** @deprecated Always `null`: nothing refuses a change to Only me any more. */
1233
+ blocker: SessionTenancyBlocker | null;
938
1234
  };
939
1235
  export type UpdateSessionVisibilityResponse = {
940
1236
  operationId: string;
@@ -951,7 +1247,6 @@ export type ForkSessionRequest = {
951
1247
  visibility: SessionVisibility;
952
1248
  workspaceSharedAcknowledged: boolean;
953
1249
  rigId?: string | null | undefined;
954
- variableSetIds?: string[] | undefined;
955
1250
  };
956
1251
  export type ForkSessionResponse = {
957
1252
  operationId: string;
@@ -965,16 +1260,36 @@ export type ForkSessionResponse = {
965
1260
  replay: boolean;
966
1261
  };
967
1262
  export type SessionBackgroundCommandActivity = {
1263
+ unavailableCount?: number | undefined;
968
1264
  state: "running" | "stopping";
969
1265
  count: number;
970
1266
  };
1267
+ /** Stored reconciliation checkpoints, not a live provider probe or native ACK. */
1268
+ export type SessionBackgroundCommandReconciliation = {
1269
+ lastOutcome: string | null;
1270
+ attempts: number;
1271
+ dueAt: string;
1272
+ claimedAt: string | null;
1273
+ terminalProof: {
1274
+ outcome: "exited";
1275
+ exitCode: number;
1276
+ observedAt: string;
1277
+ } | {
1278
+ outcome: "lost";
1279
+ exitCode: null;
1280
+ observedAt: string;
1281
+ } | null;
1282
+ };
971
1283
  export type SessionBackgroundCommand = {
1284
+ observationStatus?: "unavailable" | undefined;
1285
+ reconciliation?: SessionBackgroundCommandReconciliation | undefined;
972
1286
  id: string;
973
1287
  workspaceId: string;
974
1288
  sessionId: string;
975
1289
  provider: "managed" | "connected_machine";
976
1290
  state: "running" | "stopping" | "exited" | "lost";
977
1291
  commandPreview: string;
1292
+ commandText?: string | undefined;
978
1293
  cancelRequestedAt: string | null;
979
1294
  exitCode: number | null;
980
1295
  settlementReason: string | null;
@@ -989,12 +1304,36 @@ export type CancelSessionBackgroundCommandResult = {
989
1304
  command: SessionBackgroundCommand;
990
1305
  accepted: boolean;
991
1306
  };
1307
+ /** Why the runtime refused to start a session's next turn. */
1308
+ export type SessionAdmissionBlock = {
1309
+ reason: "database_claim_rejected" | "initiator_membership_required" | "personal_resource_grant_required";
1310
+ sqlState: string | null;
1311
+ retryPolicy: "explicit_recheck";
1312
+ blockedAt: string;
1313
+ };
992
1314
  export type Session = {
1315
+ /** Detail-only dispatch evidence; delivery does not prove turn execution. */
1316
+ dispatchWait?: {
1317
+ state: "pending" | "acknowledged" | "unavailable";
1318
+ attempts: number;
1319
+ nextAttemptAt: string | null;
1320
+ lastError: string | null;
1321
+ } | null | undefined;
1322
+ /** Detail-only failure evidence through lastSequence; independent of timeline paging. */
1323
+ failureDiagnostics?: {
1324
+ eventId: string;
1325
+ sequence: number;
1326
+ turnId: string | null;
1327
+ occurredAt: string;
1328
+ payload: unknown;
1329
+ } | null | undefined;
1330
+ bundledSkillIds?: BundledSkillId[] | undefined;
993
1331
  id: string;
994
1332
  workspaceId: string;
995
1333
  accountId: string;
996
1334
  status: SessionStatus;
997
1335
  backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
1336
+ hasSchedules?: boolean | undefined;
998
1337
  initialMessage: string;
999
1338
  title: string | null;
1000
1339
  titleSource: "user" | "agent" | null;
@@ -1023,10 +1362,11 @@ export type Session = {
1023
1362
  activeEpoch: number;
1024
1363
  /** Explicit connected-machine project root; null uses the agent launch root. */
1025
1364
  workingDir: string | null;
1026
- /** Ordered low-to-high precedence; the final entry is the legacy singular alias. */
1365
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. Use `vaultPolicy`. */
1027
1366
  variableSetIds?: string[] | undefined;
1367
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
1028
1368
  variableSetId: string | null;
1029
- /** @deprecated use variableSetId */
1369
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
1030
1370
  environmentId: string | null;
1031
1371
  rigId: string | null;
1032
1372
  rigVersionId: string | null;
@@ -1034,10 +1374,24 @@ export type Session = {
1034
1374
  channelId: string | null;
1035
1375
  firstPartyMcpPermissions: string[] | null;
1036
1376
  firstPartyMcpTools: FirstPartyMcpToolName[];
1377
+ /**
1378
+ * Frozen agent configuration; null for sessions created without one (legacy
1379
+ * behavior). Omitted by older servers.
1380
+ */
1381
+ agent?: ResolvedAgentConfig | null | undefined;
1382
+ /** Capability-level view of what a configured session can use; null for legacy. */
1383
+ effectiveTools?: AgentEffectiveTools | null | undefined;
1037
1384
  mcpServers: SessionMcpServerMetadata[];
1385
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
1038
1386
  parentSessionId: string | null;
1039
1387
  /** Immutable server-authored nested-agent lineage and policy snapshot. */
1040
1388
  rootSessionId: string;
1389
+ /**
1390
+ * The task root's usage limit and recorded API-equivalent model usage, on
1391
+ * detail reads and create responses. Omitted by older servers and list
1392
+ * reads: omission never means "no limit".
1393
+ */
1394
+ usageLimit?: SessionUsageLimit | undefined;
1041
1395
  nestedAgentDepth: number;
1042
1396
  maxNestedAgentDepthOverride: number | null;
1043
1397
  effectiveMaxNestedAgentDepth: number;
@@ -1050,16 +1404,32 @@ export type Session = {
1050
1404
  queueHeadPosition: number;
1051
1405
  queueTailPosition: number;
1052
1406
  effectiveControl: EffectiveSessionControl;
1407
+ /** Current durable input wait; an elapsed deadline does not prove a new turn started. */
1408
+ inputWait?: {
1409
+ deadlineAt: string;
1410
+ reason: string;
1411
+ } | null | undefined;
1053
1412
  lastSequence: number;
1054
1413
  /** Multi-account Codex (P1): the account this session is pinned to (null ⇒ follow workspace active). */
1055
1414
  codexPinnedCredentialId?: string | null;
1056
1415
  /** Multi-account Codex (P1): the account the most recent turn ran on (the "Running on:" indicator). */
1057
1416
  codexLastCredentialId?: string | null;
1417
+ /** Accepted current-turn account, separate from future session preferences. */
1418
+ codexCurrentSelection?: {
1419
+ credentialId: string | null;
1420
+ waiting: boolean;
1421
+ } | null | undefined;
1058
1422
  /**
1059
1423
  * Frozen at create. `remote_v2` ⇒ Codex remote compaction + Codex-only model
1060
1424
  * admission; `portable` ⇒ plaintext compaction and free provider switching.
1061
1425
  */
1062
1426
  codexCompactionMode: "remote_v2" | "portable";
1427
+ /**
1428
+ * The `code_search` decision frozen at create. A turn gets the tool only when
1429
+ * this is true, the deployment still offers it, the workspace is not Off, and
1430
+ * the turn has POSIX compute.
1431
+ */
1432
+ codeSearchEnabled?: boolean;
1063
1433
  /** Personal (authenticated subject) workspace pin state, never workspace-global. */
1064
1434
  pinned?: boolean;
1065
1435
  /** Stable pin ordering key; null when this subject has not pinned the session. */
@@ -1075,6 +1445,20 @@ export type Session = {
1075
1445
  /** Personal archive state. */
1076
1446
  archived?: boolean;
1077
1447
  archivedAt?: string | null;
1448
+ /**
1449
+ * Read-only imported timeline, independent of personal archive/restore state.
1450
+ * Never model-facing conversation history.
1451
+ */
1452
+ importedArchive?: {
1453
+ importId: string;
1454
+ importedAt: string;
1455
+ readOnly: true;
1456
+ } | undefined;
1457
+ /**
1458
+ * Idle-session archive state and keep-live exemption, workspace-wide and
1459
+ * independent of the personal `archived` flag. Absent on older servers.
1460
+ */
1461
+ retention?: SessionRetention | undefined;
1078
1462
  /** Optimistic archive-state revision. */
1079
1463
  archiveVersion?: number;
1080
1464
  /** Server-authoritative descendant counts populated by session-list reads. */
@@ -1083,6 +1467,7 @@ export type Session = {
1083
1467
  totalDescendants: number;
1084
1468
  runningDescendants: number;
1085
1469
  queuedDescendants: number;
1470
+ waitingDescendants?: number | undefined;
1086
1471
  attentionDescendants: number;
1087
1472
  pausedDescendants: number;
1088
1473
  failedDescendants: number;
@@ -1102,6 +1487,18 @@ export type Session = {
1102
1487
  * list and lineage reads for `requires_action` sessions; null otherwise.
1103
1488
  */
1104
1489
  requiresActionSince?: string | null | undefined;
1490
+ /**
1491
+ * Set while the runtime refuses to start this session's next turn (status
1492
+ * `requires_action`, but nothing is asked of a person). Accepted work is
1493
+ * kept; Resume or a new Send/Steer rechecks admission. Absent on older servers.
1494
+ */
1495
+ admissionBlock?: SessionAdmissionBlock | null | undefined;
1496
+ /** Agent access scope; absent on servers before the agent-access release. */
1497
+ agentAccess?: SessionAgentAccess | undefined;
1498
+ /** Opaque end-user label; null when the session carries none. */
1499
+ scopeSubjectId?: SessionScopeSubjectId | null | undefined;
1500
+ /** Memory scope; absent on servers before the agent-access release. */
1501
+ memoryScope?: SessionMemoryScope | undefined;
1105
1502
  createdAt: string;
1106
1503
  updatedAt: string;
1107
1504
  };
@@ -1110,11 +1507,66 @@ export type CreateSessionResponse = Session & {
1110
1507
  initialTurnId: string | null;
1111
1508
  };
1112
1509
  export type SessionSummary = Session;
1113
- /** Canonical session-list page; pinned rows are excluded from ordinary pages. */
1510
+ /**
1511
+ * Compact list-only record, excluding prompts and execution configuration
1512
+ * other than the model and reasoning effort shown with a row.
1513
+ */
1514
+ 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" | "retention" | "archiveVersion" | "treeStats" | "requiresActionSince" | "admissionBlock" | "createdAt" | "updatedAt"> & {
1515
+ displayTitle: string;
1516
+ renameSeed: string;
1517
+ scheduledTaskId: string | null;
1518
+ siteOrigin: {
1519
+ siteId: string;
1520
+ title: string;
1521
+ } | null;
1522
+ /**
1523
+ * Display-only: the latest started turn's model, or the session's stored
1524
+ * default when an explicit settings change is newer or no turn has started.
1525
+ * Rows the SDK projects from an older server's full pages carry the
1526
+ * session's effective model instead. `getSession` remains authoritative for
1527
+ * the composer default.
1528
+ */
1529
+ model?: string | undefined;
1530
+ reasoningEffort?: ReasoningEffort | undefined;
1531
+ };
1532
+ export type SessionListEntryResponse = Omit<SessionListResponse, "pinned" | "sessions"> & {
1533
+ projection: "summary";
1534
+ pinned: SessionListEntry[];
1535
+ sessions: SessionListEntry[];
1536
+ };
1537
+ /** Complete metadata for authorized roots and ordinary project trees. */
1538
+ export type SessionListTotals = {
1539
+ needsYouCount: number;
1540
+ groups: Array<{
1541
+ channelId: string | null;
1542
+ total: number;
1543
+ attention: number;
1544
+ attentionSince: string | null;
1545
+ failed: number;
1546
+ active: number;
1547
+ queued: number;
1548
+ unread: number;
1549
+ activeWork: number;
1550
+ }>;
1551
+ };
1114
1552
  export type SessionListResponse = {
1553
+ totals?: SessionListTotals;
1554
+ needsYouOnly?: true;
1555
+ /** Receipt for the read-only (archived idle session) filter. */
1556
+ contentArchivedOnly?: true;
1557
+ /** Receipt for the started-or-messaged-by-you filter. */
1558
+ mineOnly?: true;
1115
1559
  pinned: Session[];
1116
1560
  /** True when the server omitted older pins from its bounded pinned section. */
1117
1561
  pinnedTruncated?: boolean;
1562
+ /** Present only when the server recognized and applied additive list filters. */
1563
+ filtersApplied?: true;
1564
+ /** Effective server ordering. Name: ASCII-space trim, ASCII case fold,
1565
+ * UTF-8 byte order, id ASC. Date keys and id ties are DESC. */
1566
+ sortBy?: "updatedAt" | "createdAt" | "name" | "archivedAt";
1567
+ archiveStatus?: "active" | "archived" | "all";
1568
+ /** Server-resolved Site origin filter, when requested. */
1569
+ originSiteId?: string;
1118
1570
  sessions: Session[];
1119
1571
  nextCursor: string | null;
1120
1572
  };
@@ -1214,6 +1666,21 @@ export type UpdateSessionAttentionRequest = {
1214
1666
  activelyWorking?: boolean;
1215
1667
  expectedVersion?: number;
1216
1668
  };
1669
+ /**
1670
+ * Idle-session archive state. `archive` is null while the session is live; an
1671
+ * archived session keeps its readable timeline but is read-only.
1672
+ */
1673
+ export type SessionRetention = {
1674
+ /** Never archive this session, however long it stays idle. */
1675
+ keepLive: boolean;
1676
+ archive: {
1677
+ state: "archiving" | "archived";
1678
+ archivedAt: string | null;
1679
+ } | null;
1680
+ };
1681
+ export type UpdateSessionRetentionRequest = {
1682
+ keepLive: boolean;
1683
+ };
1217
1684
  export type UpdateSessionArchiveRequest = {
1218
1685
  archived: boolean;
1219
1686
  expectedVersion?: number;
@@ -1223,6 +1690,7 @@ export type LineageNode = {
1223
1690
  children: LineageNode[];
1224
1691
  };
1225
1692
  export type SessionLineageResponse = {
1693
+ sessionHasSchedules?: boolean | undefined;
1226
1694
  ancestors: SessionSummary[];
1227
1695
  children: LineageNode[];
1228
1696
  truncated: boolean;
@@ -1303,19 +1771,78 @@ export type SessionTurn = {
1303
1771
  createdAt: string;
1304
1772
  updatedAt: string;
1305
1773
  };
1306
- export type HumanInputQuestionKind = "text" | "single_select" | "multi_select";
1774
+ export type HumanInputQuestionKind = "text" | "single_select" | "multi_select" | "secret";
1775
+ /** Options for a generated password (see `@opengeni/contracts` GeneratePasswordSpec). */
1776
+ export type GeneratePasswordSpec = {
1777
+ length?: number | undefined;
1778
+ lowercase?: boolean | undefined;
1779
+ uppercase?: boolean | undefined;
1780
+ digits?: boolean | undefined;
1781
+ symbols?: boolean | undefined;
1782
+ symbolSet?: string | undefined;
1783
+ excludeAmbiguous?: boolean | undefined;
1784
+ requireEachClass?: boolean | undefined;
1785
+ };
1786
+ export type HumanInputSecretSaveTo = "user" | "task" | "workspace";
1787
+ /** A secret question's spec; the value is saved to a vault, never to the response. */
1788
+ export type HumanInputSecretSpec = {
1789
+ item: string;
1790
+ field?: string | undefined;
1791
+ fieldKind?: "concealed" | "totp" | "text" | undefined;
1792
+ itemType?: "login" | "api_key" | "note" | undefined;
1793
+ username?: {
1794
+ prompt: string;
1795
+ value?: string | null | undefined;
1796
+ } | null | undefined;
1797
+ website?: string | null | undefined;
1798
+ looksLike?: string | null | undefined;
1799
+ pattern?: string | null | undefined;
1800
+ saveTo?: HumanInputSecretSaveTo | undefined;
1801
+ vault?: string | null | undefined;
1802
+ allowGenerate?: boolean | undefined;
1803
+ generate?: GeneratePasswordSpec | null | undefined;
1804
+ autocomplete?: "current-password" | "new-password" | "one-time-code" | "off" | undefined;
1805
+ };
1806
+ /** Write-only secret value for one secret question: exactly one of `value` or `generate`. */
1807
+ export type HumanInputSecretAnswer = {
1808
+ questionId: string;
1809
+ value?: string | undefined;
1810
+ generate?: GeneratePasswordSpec | undefined;
1811
+ username?: string | undefined;
1812
+ saveTo: HumanInputSecretSaveTo;
1813
+ vaultId?: string | undefined;
1814
+ };
1815
+ /** What the agent and timeline see for an answered secret question. */
1816
+ export type HumanInputSecretAnswerResult = {
1817
+ reference: string;
1818
+ username: string | null;
1819
+ vaultName: string;
1820
+ itemName: string;
1821
+ saveTo: HumanInputSecretSaveTo;
1822
+ };
1307
1823
  export type HumanInputOption = {
1308
1824
  id: string;
1309
1825
  label: string;
1310
1826
  description?: string | null | undefined;
1311
1827
  };
1828
+ export type SkillReviewReference = {
1829
+ removalOperationId?: string | undefined;
1830
+ sourceOperationId: string;
1831
+ skillId: string;
1832
+ revisionId: string;
1833
+ expectedRevisionId: string | null;
1834
+ expectedScopeVersion: number;
1835
+ };
1312
1836
  export type HumanInputQuestion = {
1837
+ skillReview?: SkillReviewReference | null | undefined;
1313
1838
  id: string;
1314
1839
  kind: HumanInputQuestionKind;
1315
1840
  prompt: string;
1316
1841
  label?: string | null | undefined;
1317
1842
  helpText?: string | null | undefined;
1318
1843
  options: HumanInputOption[];
1844
+ /** Required exactly when `kind` is "secret"; null otherwise. */
1845
+ secret?: HumanInputSecretSpec | null | undefined;
1319
1846
  required: boolean;
1320
1847
  allowOther: boolean;
1321
1848
  validation?: {
@@ -1327,6 +1854,8 @@ export type HumanInputAnswer = {
1327
1854
  questionId: string;
1328
1855
  values: string[];
1329
1856
  other?: string | null | undefined;
1857
+ /** Secret questions: the saved reference, never the value. */
1858
+ secret?: HumanInputSecretAnswerResult | undefined;
1330
1859
  };
1331
1860
  export type HumanInputResponse = {
1332
1861
  outcome: "answered";
@@ -1337,6 +1866,8 @@ export type HumanInputResponse = {
1337
1866
  export type SubmitHumanInputResponseRequest = {
1338
1867
  outcome: "answered";
1339
1868
  answers: HumanInputAnswer[];
1869
+ /** Write-only secret values; never echoed in events or responses. */
1870
+ secretAnswers?: HumanInputSecretAnswer[] | undefined;
1340
1871
  } | {
1341
1872
  outcome: "skipped";
1342
1873
  };
@@ -1358,10 +1889,10 @@ export type SessionHumanInputRequest = {
1358
1889
  createdAt: string;
1359
1890
  updatedAt: string;
1360
1891
  };
1361
- export declare const SESSION_EVENT_TYPES: readonly ["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.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", "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.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", "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"];
1892
+ 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.notification.posted", "session.notification.withdrawn", "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.skills.updated", "session.model_settings.updated", "session.usage_limit.updated", "codex.account.switched", "subscription.account.selected", "subscription.account.switched", "codex.account.selection.changed", "model_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"];
1362
1893
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1363
1894
  /**
1364
- * Event types the SDK knows about today, kept open so a newer OpenGeni server
1895
+ * Event types the SDK knows about today, kept open so a newer Opengeni server
1365
1896
  * can introduce event types without breaking older SDK consumers.
1366
1897
  */
1367
1898
  export type SessionEventType = KnownSessionEventType | (string & {});
@@ -1371,6 +1902,8 @@ export type SessionEvent = {
1371
1902
  sessionId: string;
1372
1903
  /** Per-session sequence number: positive, contiguous, strictly increasing. */
1373
1904
  sequence: number;
1905
+ /** Server-owned durable high-water mark for a synthetic compact event. */
1906
+ coveredThrough?: number | undefined;
1374
1907
  type: SessionEventType;
1375
1908
  payload: unknown;
1376
1909
  occurredAt: string;
@@ -1482,11 +2015,17 @@ export type SessionEventPage = {
1482
2015
  };
1483
2016
  export type ToolAuthNeededPayload = {
1484
2017
  serverId: string;
2018
+ /** Configured connector for recovery; serverId retains the execution alias. */
2019
+ canonicalServerId?: string | undefined;
2020
+ /** Scope of the exact failed account, not the canonical catalog default. */
2021
+ connectionSubjectScope?: "workspace" | "subject" | undefined;
1485
2022
  toolName?: string | null | undefined;
1486
2023
  providerDomain: string;
1487
2024
  provider?: string | undefined;
1488
2025
  connectionId?: string | null | undefined;
1489
- reason: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable";
2026
+ authoritySource?: "host" | undefined;
2027
+ reason: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable" | "designated_credential_unavailable";
2028
+ hostReason?: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable" | "designated_credential_unavailable" | undefined;
1490
2029
  scopes?: string[] | undefined;
1491
2030
  resource?: string | undefined;
1492
2031
  selectedResources?: Array<{
@@ -1504,6 +2043,15 @@ export type ToolAuthNeededPayload = {
1504
2043
  rationale: string;
1505
2044
  requiredVariables: string[];
1506
2045
  } | undefined;
2046
+ /** Agent suggestion; never a connection or permission grant. */
2047
+ setupRequest?: {
2048
+ kind: "mcp";
2049
+ ownership?: "personal" | "workspace" | undefined;
2050
+ mcpSetup?: import("@opengeni/contracts/prepared-mcp-setup").PreparedMcpSetup | undefined;
2051
+ name: string;
2052
+ endpointUrl: string;
2053
+ rationale: string;
2054
+ } | undefined;
1507
2055
  };
1508
2056
  export type AgentTextDeltaPayload = {
1509
2057
  text: string;
@@ -1516,6 +2064,11 @@ export type AgentToolCallCreatedPayload = {
1516
2064
  name: string;
1517
2065
  arguments: unknown;
1518
2066
  raw?: unknown | undefined;
2067
+ /**
2068
+ * Content-free analytics family: an Opengeni first-party tool name,
2069
+ * `integration:<reviewed domain>`, or `custom`. Absent when unclassified.
2070
+ */
2071
+ toolFamily?: string | undefined;
1519
2072
  };
1520
2073
  export type AgentToolCallOutputPayload = {
1521
2074
  id: string | null;
@@ -1549,7 +2102,7 @@ export type CodexFleetDecisionEventPayload = {
1549
2102
  actual: {
1550
2103
  outcome: "selected" | "waiting" | "none";
1551
2104
  candidateKey: string | null;
1552
- reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "none";
2105
+ reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "allocator_disabled" | "none";
1553
2106
  };
1554
2107
  comparison: CodexFleetShadowComparison;
1555
2108
  replay: {
@@ -1669,11 +2222,16 @@ export type FsTreeNode = {
1669
2222
  truncated: boolean;
1670
2223
  };
1671
2224
  export type FsEncoding = "utf8" | "base64";
2225
+ export type FileSystemRouteIdentity = {
2226
+ epoch: number;
2227
+ root: string;
2228
+ };
1672
2229
  export type FsListRequest = {
1673
2230
  path?: string;
1674
2231
  depth?: number;
1675
2232
  maxEntries?: number;
1676
2233
  includeHidden?: boolean;
2234
+ route?: FileSystemRouteIdentity;
1677
2235
  };
1678
2236
  export type FsListResponse = {
1679
2237
  root: FsTreeNode;
@@ -1688,8 +2246,11 @@ export type FsListBatchResponse = {
1688
2246
  };
1689
2247
  export type FsReadRequest = {
1690
2248
  path: string;
2249
+ /** Confine this read to the session's working directory, refusing symlinks. */
2250
+ workspaceOnly?: boolean;
1691
2251
  encoding?: FsEncoding;
1692
2252
  maxBytes?: number;
2253
+ route?: FileSystemRouteIdentity;
1693
2254
  };
1694
2255
  export type FsReadResponse = {
1695
2256
  path: string;
@@ -1716,6 +2277,7 @@ export type FsWriteRequest = {
1716
2277
  content: string;
1717
2278
  overwrite?: boolean;
1718
2279
  createParents?: boolean;
2280
+ route?: FileSystemRouteIdentity;
1719
2281
  };
1720
2282
  export type FsWriteResponse = {
1721
2283
  path: string;
@@ -1725,6 +2287,7 @@ export type FsWriteResponse = {
1725
2287
  export type FsDeleteRequest = {
1726
2288
  path: string;
1727
2289
  recursive?: boolean;
2290
+ route?: FileSystemRouteIdentity;
1728
2291
  };
1729
2292
  export type FsDeleteResponse = {
1730
2293
  revision: number;
@@ -1734,6 +2297,7 @@ export type FsMoveRequest = {
1734
2297
  newPath: string;
1735
2298
  overwrite?: boolean;
1736
2299
  createParents?: boolean;
2300
+ route?: FileSystemRouteIdentity;
1737
2301
  };
1738
2302
  export type FsMoveResponse = {
1739
2303
  path: string;
@@ -1743,6 +2307,7 @@ export type FsMoveResponse = {
1743
2307
  export type FsMkdirRequest = {
1744
2308
  path: string;
1745
2309
  recursive?: boolean;
2310
+ route?: FileSystemRouteIdentity;
1746
2311
  };
1747
2312
  export type FsMkdirResponse = {
1748
2313
  path: string;
@@ -2103,11 +2668,32 @@ export type IncidentTelemetryPreflightInput = Omit<IncidentTelemetryPreflight, "
2103
2668
  requiredVariableNames?: string[] | undefined;
2104
2669
  };
2105
2670
  export type ScheduledTaskAgentConfig = {
2671
+ /** Agent configuration for every generated session; omitted keeps legacy behavior. */
2672
+ agent?: AgentConfigRequest | undefined;
2673
+ /**
2674
+ * Connector accounts a person pinned for a schedule that starts its own
2675
+ * session. Each pinned pair narrows its connector; every other connector
2676
+ * uses the owner's current accounts at each run.
2677
+ */
2678
+ pinnedAccounts?: McpConnectionAccountSelection[] | undefined;
2679
+ /** Skip an occurrence instead of running without an unusable pinned account. */
2680
+ pinnedAccountsRequired?: true | undefined;
2681
+ knowledgeSource?: Extract<ScheduledTaskAction, {
2682
+ kind: "knowledge_source_sync";
2683
+ }> | undefined;
2684
+ bundledSkillIds?: BundledSkillId[] | undefined;
2106
2685
  prompt: string;
2107
2686
  resources: ResourceRef[];
2108
2687
  tools: ToolRef[];
2688
+ /**
2689
+ * Present when runs follow the workspace's default connectors (minus the
2690
+ * excluded ones) plus `tools`; absent when runs get exactly `tools`.
2691
+ */
2692
+ toolPolicy?: ScheduledTaskToolPolicy | undefined;
2109
2693
  metadata: Record<string, unknown>;
2110
2694
  slackBotConnectionId?: string | undefined;
2695
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
2696
+ slackBotChannelId?: string | undefined;
2111
2697
  model?: string | undefined;
2112
2698
  reasoningEffort?: ReasoningEffort | undefined;
2113
2699
  sandboxBackend?: SandboxBackend | undefined;
@@ -2119,6 +2705,8 @@ export type ScheduledTaskAgentConfig = {
2119
2705
  executionClass?: "incident_telemetry" | undefined;
2120
2706
  incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
2121
2707
  maxNestedAgentDepth?: number | undefined;
2708
+ /** Seconds a run may wait on a person before the scheduler answers for it. */
2709
+ approvalTimeoutSeconds?: number | undefined;
2122
2710
  };
2123
2711
  export type ScopedKnowledgeScope = {
2124
2712
  kind: "organization";
@@ -2169,6 +2757,13 @@ export type ScheduledTask = {
2169
2757
  accountId: string;
2170
2758
  workspaceId: string;
2171
2759
  name: string;
2760
+ /** Immutable execution owner; null for workspace/service tasks. */
2761
+ ownerSubjectId: string | null;
2762
+ /**
2763
+ * Who can see this schedule. `workspace`: everyone in the workspace.
2764
+ * `private`: only its owner; its runs create Only me chats owned by them.
2765
+ */
2766
+ visibility: SessionVisibility;
2172
2767
  status: ScheduledTaskStatus;
2173
2768
  schedule: ScheduledTaskScheduleSpec;
2174
2769
  temporalScheduleId: string;
@@ -2178,25 +2773,155 @@ export type ScheduledTask = {
2178
2773
  agentConfig: ScheduledTaskAgentConfig;
2179
2774
  createdBy?: TurnInitiator | undefined;
2180
2775
  createdByContext?: TurnInitiatorContext | undefined;
2181
- personalConnections?: McpPersonalConnectionSummary[] | undefined;
2182
2776
  authorityRevision: number;
2183
2777
  executionDigest: string;
2184
2778
  targetSessionId: string | null;
2185
2779
  reusableSessionId: string | null;
2780
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. Use `vaultPolicy`. */
2186
2781
  variableSetId: string | null;
2187
- /** @deprecated use variableSetId */
2782
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
2188
2783
  environmentId: string | null;
2189
2784
  rigId: string | null;
2785
+ /** Vaults every run may resolve secret references from (the task vault is always included). */
2786
+ vaultPolicy?: VaultPolicy | undefined;
2190
2787
  metadata: Record<string, unknown>;
2191
2788
  createdAt: string;
2192
2789
  updatedAt: string;
2790
+ /** Read-only: what `refreshScheduledTaskAccess` would change, for a viewer who can act on it. */
2791
+ policyDrift?: ScheduledTaskPolicyDrift | null | undefined;
2792
+ /** Read-only: which accounts a run would use if it started now, for a viewer who can act on it. */
2793
+ accountPlan?: ScheduledTaskAccountPlan | undefined;
2794
+ /** Read-only: why it paused itself, or why its owner was told its runs keep failing. */
2795
+ blocker?: ScheduledTaskBlocker | undefined;
2796
+ };
2797
+ /**
2798
+ * What blocks a schedule. `paused`: no later run could start until a person
2799
+ * acts, so it paused itself; resume it once the cause is fixed. `notified`:
2800
+ * its scheduled runs kept failing or being skipped and its owner was told
2801
+ * once; it keeps running. `message` says what would unblock it.
2802
+ */
2803
+ export type ScheduledTaskBlocker = {
2804
+ state: "paused" | "notified";
2805
+ /** Stable machine reason, such as `scheduled_session_paused`; tolerate new ones. */
2806
+ reason: string;
2807
+ message: string;
2808
+ /** The run that showed the blocker (the first of a failing streak). */
2809
+ runId: string;
2810
+ since: string;
2811
+ };
2812
+ /**
2813
+ * What an admin sees of someone else's Only me schedule: that it exists, whose
2814
+ * it is, how often it runs and what it costs. Never its name, prompt, settings
2815
+ * or runs.
2816
+ */
2817
+ export type PrivateScheduledTaskSummary = {
2818
+ id: string;
2819
+ ownerSubjectId: string;
2820
+ /** The owner's display name or email, when known. */
2821
+ ownerName: string | null;
2822
+ status: ScheduledTaskStatus;
2823
+ schedule: ScheduledTaskScheduleSpec;
2824
+ lastRunAt: string | null;
2825
+ /** Usage of this schedule's runs over the last 30 days. */
2826
+ last30Days: {
2827
+ runs: number;
2828
+ creditUsd: number;
2829
+ estimatedProviderUsd: number;
2830
+ };
2831
+ createdAt: string;
2832
+ };
2833
+ /** One connector named in a scheduled task's access report. */
2834
+ export type ScheduledTaskAccessConnector = {
2835
+ id: string;
2836
+ name: string;
2837
+ };
2838
+ /**
2839
+ * A schedule that follows the workspace's default connectors at each run,
2840
+ * the way a new chat does. Connectors a person turned off stay off.
2841
+ */
2842
+ export type ScheduledTaskToolPolicy = {
2843
+ mode: "workspace_default";
2844
+ excludedMcpServerIds: string[];
2845
+ };
2846
+ /**
2847
+ * What a scheduled task's saved connectors and Opengeni tools lack compared
2848
+ * with what its owner would get by saving it again now, plus pinned accounts
2849
+ * that can no longer be used.
2850
+ */
2851
+ export type ScheduledTaskPolicyDrift = {
2852
+ /** Workspace default connectors that new schedules get and this one lacks. */
2853
+ missingConnectors: ScheduledTaskAccessConnector[];
2854
+ /** Connectors this schedule names that this workspace no longer sets up; refresh drops them. */
2855
+ unavailableConnectors: ScheduledTaskAccessConnector[];
2856
+ /** Default Opengeni tools missing from an agent-created task's frozen tools. */
2857
+ missingOpenGeniTools: FirstPartyMcpToolName[];
2858
+ /** Connectors whose pinned account can no longer be used; runs continue without them. */
2859
+ unavailableAccounts: ScheduledTaskAccessConnector[];
2860
+ /** Whether this viewer may run the refresh (a signed-in person, not a key or agent). */
2861
+ canRefresh: boolean;
2862
+ };
2863
+ /** One connector account a scheduled run would act as. */
2864
+ export type ScheduledTaskAccountPlanAccount = {
2865
+ connectionId: string;
2866
+ label: string;
2867
+ /** `personal`: the schedule owner's own account. `shared`: a workspace account. */
2868
+ scope: "personal" | "shared";
2869
+ };
2870
+ export type ScheduledTaskAccountPlanConnector = {
2871
+ id: string;
2872
+ name: string;
2873
+ /** `default`: the owner's current accounts at each run. `pinned`: only the accounts a person chose. */
2874
+ mode: "default" | "pinned";
2875
+ /** Accounts a run would use if it started now; empty when none can be used. */
2876
+ accounts: ScheduledTaskAccountPlanAccount[];
2877
+ /** Pinned accounts that can no longer be used; always empty in `default` mode. */
2878
+ unavailablePins: Array<{
2879
+ connectionId: string;
2880
+ }>;
2881
+ };
2882
+ /**
2883
+ * Which connector accounts a run of this schedule would use if it started
2884
+ * now, resolved at read time from the owner's live connections. Nothing here
2885
+ * is stored.
2886
+ */
2887
+ export type ScheduledTaskAccountPlan = {
2888
+ connectors: ScheduledTaskAccountPlanConnector[];
2889
+ };
2890
+ /** Re-freeze with the caller's current authority; `executionDigest` is the reviewed head. */
2891
+ export type RefreshScheduledTaskAccessRequest = {
2892
+ executionDigest: string;
2893
+ /** Default connectors and Opengeni tools to keep off; only narrows what the refresh adds. */
2894
+ leaveOut?: {
2895
+ connectors?: string[] | undefined;
2896
+ openGeniTools?: FirstPartyMcpToolName[] | undefined;
2897
+ } | undefined;
2193
2898
  };
2194
2899
  export type CreateSessionRequest = {
2900
+ /** Omitted: defaults/inheritance; []: no bundled guidance. Children cannot widen. */
2901
+ bundledSkillIds?: BundledSkillId[] | undefined;
2902
+ excludedMcpServerIds?: string[] | undefined;
2195
2903
  requestedSessionId?: string | undefined;
2904
+ /**
2905
+ * Optional usage limit for a new root task in USD micros of API-equivalent
2906
+ * model usage (null/omitted: no limit; 0: stop before the first model
2907
+ * request). Person or trusted host only. `OpenGeniClient.createSession`
2908
+ * sends a limited create with `startMode: "standard"`, which servers that
2909
+ * predate usage limits reject before creating or starting anything; it then
2910
+ * throws `OpenGeniSessionUsageLimitUnsupportedError`, as it does for a
2911
+ * response that does not echo the requested limit.
2912
+ */
2913
+ usageLimitMicros?: number | null | undefined;
2196
2914
  visibility?: SessionVisibility | undefined;
2197
2915
  initialMessage?: string | undefined;
2198
- /** Create an idle session shell so realtime voice can be the first interaction. */
2199
- startMode?: "realtime" | undefined;
2916
+ /** Exempt the new session from the idle-session archive, e.g. for a persistent agent. */
2917
+ keepLive?: boolean | undefined;
2918
+ /**
2919
+ * `realtime` creates an idle session shell so realtime voice can be the
2920
+ * first interaction. `standard` is the explicit default; `createSession`
2921
+ * sends it with a usage limit so servers that predate limits reject the
2922
+ * create instead of starting uncapped work.
2923
+ */
2924
+ startMode?: "realtime" | "standard" | undefined;
2200
2925
  /** Model-visible application context attached to the initial user message; omitted by standard timeline rendering. */
2201
2926
  modelContext?: string | undefined;
2202
2927
  instructions?: string | undefined;
@@ -2204,7 +2929,15 @@ export type CreateSessionRequest = {
2204
2929
  policyRole?: string | undefined;
2205
2930
  resources?: ResourceRef[] | undefined;
2206
2931
  /** Inline skills fixed onto this session; omitted children inherit them. */
2207
- skills?: SessionSkill[] | undefined;
2932
+ skills?: SessionSkillInput[] | undefined;
2933
+ /** Installed session-selected Skill identities to freeze onto this session at creation. */
2934
+ installedSkillIds?: string[] | undefined;
2935
+ /**
2936
+ * MCP servers to select. Omitted follows the workspace defaults; an explicit
2937
+ * array (including `[]`) is an exact allow-list over workspace/deployment
2938
+ * servers. Servers attached in this request's `mcpServers` are always
2939
+ * selected; list one here only to set `eager`/`optional`.
2940
+ */
2208
2941
  tools?: ToolRef[] | undefined;
2209
2942
  metadata?: Record<string, unknown> | undefined;
2210
2943
  model?: string | undefined;
@@ -2213,34 +2946,47 @@ export type CreateSessionRequest = {
2213
2946
  sandboxBackend?: SandboxBackend | undefined;
2214
2947
  targetSandboxId?: string | undefined;
2215
2948
  workingDir?: string | undefined;
2216
- /** Ordered low-to-high precedence; later sets win name collisions. */
2217
- variableSetIds?: string[] | undefined;
2218
- variableSetId?: string | undefined;
2219
- /** @deprecated use variableSetId */
2220
- environmentId?: string | undefined;
2221
2949
  rigId?: string | undefined;
2222
2950
  goal?: GoalSpec | undefined;
2223
2951
  clientEventId?: string | undefined;
2224
2952
  idempotencyKey?: string | undefined;
2225
2953
  expectedNewSessionDraftRevision?: number | undefined;
2954
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
2226
2955
  maxNestedAgentDepth?: number | undefined;
2227
2956
  firstPartyMcpPermissions?: string[] | undefined;
2228
2957
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2958
+ /**
2959
+ * One agent configuration: capabilities, identity, instructions alias and
2960
+ * renderer. Omission keeps today's behavior (a child inherits its parent's).
2961
+ * Children may only narrow. Requires the server's admission switch.
2962
+ */
2963
+ agent?: AgentConfigRequest | undefined;
2229
2964
  mcpServers?: SessionMcpServerInput[] | undefined;
2965
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
2966
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2230
2967
  /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2231
2968
  personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
2232
2969
  sandbox?: "shared" | "new" | {
2233
2970
  groupId: string;
2234
2971
  } | undefined;
2235
- };
2236
- 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", "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"];
2972
+ agentAccess?: SessionAgentAccess | undefined;
2973
+ /** Opaque end-user label inside the workspace. Not a subject, not authority. */
2974
+ /** Select identity with server-side asUser(), not session creation data. */
2975
+ scopeSubjectId?: never;
2976
+ /** Which Memory the agent reads and where it saves; "user" requires `scopeSubjectId`. */
2977
+ memoryScope?: SessionMemoryScope | undefined;
2978
+ };
2979
+ export type SessionAgentAccess = "session" | "user" | "workspace";
2980
+ export type SessionScopeSubjectId = string;
2981
+ export type SessionMemoryScope = "workspace" | "user" | "off";
2982
+ 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", "secrets:use", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
2237
2983
  export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
2238
2984
  /**
2239
- * Permissions the SDK knows about today, kept open so a newer OpenGeni server
2985
+ * Permissions the SDK knows about today, kept open so a newer Opengeni server
2240
2986
  * can introduce permissions without breaking older SDK consumers.
2241
2987
  */
2242
2988
  export type Permission = KnownPermission | (string & {});
2243
- export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "goal_wait" | "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" | "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" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_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_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_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_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" | "sandbox_file_publish" | "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";
2989
+ 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" | "notify_user" | "notification_withdraw" | "inbox_tidy" | "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" | "connected_machine_enable_screen_control" | "project_list" | "project_get" | "project_create" | "project_update" | "project_reorder" | "project_delete" | "session_set_project" | "admin_actions_search" | "admin_action_describe" | "admin_action_call" | "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_message_status" | "session_target_get" | "session_target_set" | "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" | "secret_search" | "secret_save" | "secret_get" | "secret_move" | "secret_delete" | "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" | "site_data_describe" | "site_data_define_collection" | "site_data_query" | "site_data_write" | "site_data_import" | "site_data_export" | "site_data_reset" | "site_files_list" | "site_files_upload" | "site_files_delete" | "site_publication_get" | "site_publication_update" | "site_publication_apply_fix" | "site_hostname_check" | "site_sql_inspect" | "site_sql_enable" | "site_sql_migrate" | "site_sql_define_query" | "site_sql_query" | "site_sql_run" | "site_sql_execute" | "site_sql_export" | "site_sql_import" | "site_sql_reset" | "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";
2244
2990
  export type ProductAccessMode = "local" | "configured" | "managed";
2245
2991
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
2246
2992
  export type ModelCapabilityStateV1 = {
@@ -2283,18 +3029,23 @@ export type ModelCredentialSourceV1 = {
2283
3029
  mechanism: "api_key" | "azure_ad_bearer";
2284
3030
  } | {
2285
3031
  kind: "connected_subscription";
2286
- provider: "codex" | "xai";
3032
+ provider: "codex" | "xai" | "claude";
2287
3033
  } | {
2288
3034
  kind: "workspace_connection";
2289
3035
  mechanism: "api_key";
3036
+ } | {
3037
+ kind: "organization_connection";
3038
+ mechanism: "api_key";
2290
3039
  };
2291
3040
  export type ModelBillingAttributionV1 = {
2292
- upstreamPayer: "deployment" | "workspace" | "connected_subscription";
3041
+ upstreamPayer: "deployment" | "workspace" | "organization" | "connected_subscription";
2293
3042
  metering: "opengeni_credits" | "external";
2294
3043
  };
3044
+ export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace" | "organization";
2295
3045
  export type ModelPricingV1 = {
2296
3046
  inputMicrosPerMillionTokens: number;
2297
3047
  cachedInputMicrosPerMillionTokens?: number | undefined;
3048
+ cacheWriteMicrosPerMillionTokens?: number | undefined;
2298
3049
  outputMicrosPerMillionTokens: number;
2299
3050
  marginBps?: number | undefined;
2300
3051
  };
@@ -2316,17 +3067,19 @@ export type ClientModel = {
2316
3067
  label: string;
2317
3068
  /** Optional curated compact label for dense UI (e.g. mobile composer). */
2318
3069
  shortLabel?: string | undefined;
3070
+ /** Optional HTTPS maker logo supplied by the model catalog. */
3071
+ logoUrl?: string | undefined;
2319
3072
  /** Provider id (e.g. `openai`, `azure`, or a registry provider id). */
2320
3073
  provider: string;
2321
3074
  providerLabel: string;
2322
- api: "responses" | "chat";
2323
- source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | undefined;
3075
+ api: "responses" | "chat" | "anthropic-messages";
3076
+ source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | "openrouter" | undefined;
2324
3077
  contextWindowTokens?: number | undefined;
2325
3078
  schemaVersion?: 1 | undefined;
2326
3079
  aliases?: string[] | undefined;
2327
3080
  deployment?: {
2328
3081
  upstreamModelId: string;
2329
- wireApi: "responses" | "chat";
3082
+ wireApi: "responses" | "chat" | "anthropic-messages";
2330
3083
  } | undefined;
2331
3084
  executionLimits?: {
2332
3085
  contextWindowTokens: number | null;
@@ -2336,6 +3089,7 @@ export type ClientModel = {
2336
3089
  } | undefined;
2337
3090
  credentialSource?: ModelCredentialSourceV1 | undefined;
2338
3091
  billing?: ModelBillingAttributionV1 | undefined;
3092
+ cost?: ModelCostClassV1 | undefined;
2339
3093
  capabilities?: ModelCapabilitiesV1 | undefined;
2340
3094
  pricing?: ModelPricingScheduleV1 | undefined;
2341
3095
  definitionVersion?: string | undefined;
@@ -2343,7 +3097,7 @@ export type ClientModel = {
2343
3097
  export type ModelAvailabilityV1 = {
2344
3098
  status: "available" | "unavailable" | "degraded" | "unknown";
2345
3099
  selectable: boolean;
2346
- reason: "missing_credential" | "needs_reauth" | "credential_not_ready" | "not_entitled" | "provider_unhealthy" | "policy_blocked" | "unsupported" | null;
3100
+ reason: "missing_credential" | "needs_reauth" | "credential_not_ready" | "not_entitled" | "provider_unhealthy" | "policy_blocked" | "unsupported" | "credits_disabled" | null;
2347
3101
  checkedAt: string | null;
2348
3102
  };
2349
3103
  export type ModelCredentialReadinessV1 = {
@@ -2353,33 +3107,450 @@ export type ModelCredentialReadinessV1 = {
2353
3107
  checkedAt: string | null;
2354
3108
  };
2355
3109
  export type WorkspaceModelCatalogModel = ClientModel & {
3110
+ /** Workspace preference, separate from immutable model execution limits. */
3111
+ compactionPolicy?: {
3112
+ defaultTokens: number;
3113
+ /** This workspace's own limit; null follows the organization's or the model's default. */
3114
+ overrideTokens: number | null;
3115
+ /** The organization's limit this workspace follows while it sets none. */
3116
+ organizationTokens?: number | null | undefined;
3117
+ effectiveTokens: number;
3118
+ minimumTokens: number;
3119
+ maximumTokens: number;
3120
+ } | undefined;
2356
3121
  credentialReadiness: ModelCredentialReadinessV1;
3122
+ creditFunding?: "promotional" | "general" | "unavailable" | undefined;
2357
3123
  /** Exact workspace-policy verdict without exposing provider identity. */
2358
3124
  policyAllowed?: boolean | undefined;
2359
3125
  availability: ModelAvailabilityV1;
2360
3126
  };
3127
+ /** Why a new chat or scheduled task without an explicit model gets its default. */
3128
+ export type DefaultModelSelectionSource = "workspace" | "organization" | "subscription" | "credits" | "deployment";
3129
+ export type DefaultModelSelection = {
3130
+ model: string;
3131
+ reasoningEffort: ReasoningEffort;
3132
+ source: DefaultModelSelectionSource;
3133
+ };
2361
3134
  export type WorkspaceModelCatalogResponse = {
2362
3135
  models: WorkspaceModelCatalogModel[];
3136
+ /** Default for new chats and scheduled tasks that name no model. */
3137
+ defaultSelection?: DefaultModelSelection | undefined;
3138
+ /**
3139
+ * The default this workspace would use once its organization holds an
3140
+ * Opengeni credit balance. Null when the deployment does not bill credits.
3141
+ */
3142
+ creditsSelection?: DefaultModelSelection | null | undefined;
2363
3143
  };
2364
- /**
2365
- * The workspace's hard model/provider allowlist. `null` means unrestricted for
2366
- * that dimension; an empty array is an explicit total block.
2367
- */
2368
- export type WorkspaceModelAccessPolicy = {
2369
- allowedProviders: string[] | null;
2370
- allowedModels: string[] | null;
3144
+ export type WorkspaceGatewayCustomModel = {
3145
+ id: string;
3146
+ upstreamModelId: string;
3147
+ label: string | null;
3148
+ version: number;
3149
+ createdAt: string;
3150
+ updatedAt: string;
2371
3151
  };
2372
- /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
2373
- export type UpdateWorkspaceModelAccessPolicyRequest = {
2374
- allowedProviders?: string[] | null | undefined;
2375
- allowedModels?: string[] | null | undefined;
3152
+ export type WorkspaceGatewayCustomModelsResponse = {
3153
+ models: WorkspaceGatewayCustomModel[];
2376
3154
  };
2377
- /**
2378
- * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
2379
- * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
2380
- * workspace can select (projected as ClientModel under their own "no credits"
2381
- * provider group), present only while connected.
2382
- */
3155
+ export type CreateWorkspaceGatewayCustomModelRequest = {
3156
+ operationId: string;
3157
+ upstreamModelId: string;
3158
+ label?: string | undefined;
3159
+ };
3160
+ export type DeleteWorkspaceGatewayCustomModelRequest = {
3161
+ expectedVersion: number;
3162
+ operationId: string;
3163
+ };
3164
+ export type WorkspaceOpenRouterCustomModel = WorkspaceGatewayCustomModel;
3165
+ export type WorkspaceOpenRouterCustomModelsResponse = {
3166
+ models: WorkspaceOpenRouterCustomModel[];
3167
+ };
3168
+ export type CreateWorkspaceOpenRouterCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3169
+ export type DeleteWorkspaceOpenRouterCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3170
+ export type WorkspaceOpperCustomModel = WorkspaceGatewayCustomModel;
3171
+ export type WorkspaceOpperCustomModelsResponse = {
3172
+ models: WorkspaceOpperCustomModel[];
3173
+ };
3174
+ export type CreateWorkspaceOpperCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3175
+ export type DeleteWorkspaceOpperCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3176
+ /** Model connection kinds that carry a per-connection access policy. */
3177
+ export type ModelConnectionAccessKind = "codex" | "supergrok" | "vercel_gateway" | "openrouter" | "anthropic" | "claude_subscription" | "opper";
3178
+ export type OrganizationModelProviderKind = "vercel_gateway" | "openrouter" | "anthropic" | "claude_subscription" | "opper";
3179
+ export type ClaudeUsageWindow = {
3180
+ id: "five_hour" | "seven_day" | "seven_day_opus" | "seven_day_sonnet" | "seven_day_overage_included" | "overage";
3181
+ usedPercent: number | null;
3182
+ resetsAt: string | null;
3183
+ status: "allowed" | "allowed_warning" | "rejected" | null;
3184
+ observedAt: string;
3185
+ source?: "response_headers" | "provider" | undefined;
3186
+ };
3187
+ export type ClaudeUsageRequestStatus = {
3188
+ status: ClaudeUsageWindow["status"];
3189
+ resetsAt: string | null;
3190
+ representativeClaim: ClaudeUsageWindow["id"] | null;
3191
+ overageStatus: ClaudeUsageWindow["status"];
3192
+ overageResetsAt: string | null;
3193
+ upstreamModelId: string | null;
3194
+ observedAt: string;
3195
+ source?: "response_headers" | "provider" | undefined;
3196
+ };
3197
+ export type ClaudeSubscriptionUsage = {
3198
+ connected: boolean;
3199
+ credentialVersion: number | null;
3200
+ windows: ClaudeUsageWindow[];
3201
+ observedAt: string | null;
3202
+ source: "response_headers" | "provider" | null;
3203
+ refreshStatus: "not_checked" | "available" | "scope_required" | "unavailable" | "reconnect";
3204
+ refreshCheckedAt: string | null;
3205
+ requestStatus?: ClaudeUsageRequestStatus | null | undefined;
3206
+ requestRestrictions?: ClaudeUsageRequestStatus[] | undefined;
3207
+ };
3208
+ export type OrganizationModelProviderConnection = {
3209
+ providerKind: OrganizationModelProviderKind;
3210
+ status: "active" | "revoked";
3211
+ version: number;
3212
+ createdAt: string;
3213
+ updatedAt: string;
3214
+ };
3215
+ export type UpsertOrganizationModelProviderConnectionRequest = {
3216
+ operationId: string;
3217
+ expectedVersion?: number | undefined;
3218
+ apiKey: string;
3219
+ claudeIdentity?: {
3220
+ accountUuid: string;
3221
+ deviceId: string;
3222
+ } | undefined;
3223
+ };
3224
+ export type RevokeOrganizationModelProviderConnectionRequest = {
3225
+ operationId: string;
3226
+ expectedVersion: number;
3227
+ };
3228
+ export type OrganizationProviderCustomModel = WorkspaceGatewayCustomModel;
3229
+ export type OrganizationProviderCustomModelsResponse = {
3230
+ models: OrganizationProviderCustomModel[];
3231
+ };
3232
+ export type CreateOrganizationProviderCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3233
+ export type DeleteOrganizationProviderCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3234
+ /**
3235
+ * The workspace's hard model/provider allowlist. `null` means unrestricted for
3236
+ * that dimension; an empty array is an explicit total block.
3237
+ */
3238
+ export type WorkspaceModelAccessPolicy = {
3239
+ allowedProviders: string[] | null;
3240
+ allowedModels: string[] | null;
3241
+ /**
3242
+ * Where the policy comes from: the workspace's own, the organization's
3243
+ * default it follows, or no restriction. Absent from older servers.
3244
+ */
3245
+ source?: "workspace" | "organization" | "none" | undefined;
3246
+ /** The organization default the workspace follows without its own policy. */
3247
+ organization?: {
3248
+ allowedProviders: string[] | null;
3249
+ allowedModels: string[] | null;
3250
+ } | null;
3251
+ /**
3252
+ * The workspace's credit switch (its `allowCreditModels` setting). False
3253
+ * blocks every model billed in Opengeni credits, including ones added later,
3254
+ * whichever allowlist applies. Absent from older servers; treat as true.
3255
+ */
3256
+ allowCreditModels?: boolean | undefined;
3257
+ };
3258
+ /**
3259
+ * Model defaults every workspace in an organization follows until it sets its
3260
+ * own (`GET/PATCH /v1/organizations/:id/model-defaults`, owners and admins).
3261
+ */
3262
+ export type OrganizationModelDefaults = {
3263
+ sessionDefaults: {
3264
+ model: string;
3265
+ reasoningEffort: ReasoningEffort;
3266
+ } | null;
3267
+ allowedProviders: string[] | null;
3268
+ allowedModels: string[] | null;
3269
+ modelCompactionThresholds: Record<string, number>;
3270
+ updatedAt: string | null;
3271
+ };
3272
+ /** Field-by-field update; compaction merges by model id and null resets one model. */
3273
+ export type UpdateOrganizationModelDefaultsRequest = {
3274
+ sessionDefaults?: {
3275
+ model: string;
3276
+ reasoningEffort: ReasoningEffort;
3277
+ } | null | undefined;
3278
+ modelPolicy?: {
3279
+ allowedProviders?: string[] | null | undefined;
3280
+ allowedModels?: string[] | null;
3281
+ } | null | undefined;
3282
+ modelCompactionThresholds?: Record<string, number | null> | undefined;
3283
+ };
3284
+ /** A model-account setting an organization sets, and may lock for every workspace. */
3285
+ export type ModelAccountSettingKey = "rotation" | "providers" | "crossProviderFailover" | "fallbackOrder" | "personalConnectionsAllowed" | "personalFallbackAllowed";
3286
+ /**
3287
+ * Where an effective value comes from: the organization, this workspace's
3288
+ * override, or the organization with a lock workspaces cannot override.
3289
+ */
3290
+ export type ModelAccountSettingSource = "organization" | "workspace" | "locked";
3291
+ export type ModelAccountRotationMode = "spread" | "primary_first";
3292
+ /** Effective model-account settings. */
3293
+ export type ModelAccountSettingValues = {
3294
+ /** How the shared core spreads load across eligible accounts, per provider. */
3295
+ rotation: Record<string, {
3296
+ mode: ModelAccountRotationMode;
3297
+ primaryConnectionId?: string | null | undefined;
3298
+ }>;
3299
+ providers: Record<string, {
3300
+ inferenceSource?: "automatic" | "workspace" | "organization" | undefined;
3301
+ useOrganizationAccounts: boolean;
3302
+ enabled: boolean;
3303
+ }>;
3304
+ crossProviderFailover: boolean;
3305
+ /** Ordered fallback models for a preferred model. */
3306
+ fallbackOrder: Record<string, string[]>;
3307
+ personalConnectionsAllowed: boolean;
3308
+ /** Permit a person's opt-in fallback; accepted background work retains its captured authority. */
3309
+ personalFallbackAllowed: boolean;
3310
+ };
3311
+ /** One source per setting and, for map-valued settings, per entry. */
3312
+ export type ModelAccountSettingsView = {
3313
+ values: ModelAccountSettingValues;
3314
+ sources: Record<ModelAccountSettingKey, ModelAccountSettingSource>;
3315
+ entrySources: {
3316
+ rotation: Record<string, "organization" | "workspace">;
3317
+ providers: Record<string, "organization" | "workspace">;
3318
+ fallbackOrder: Record<string, "organization" | "workspace">;
3319
+ };
3320
+ };
3321
+ /** `GET/PATCH /v1/organizations/:id/model-account-settings` (owners and admins). */
3322
+ export type OrganizationModelAccountSettings = {
3323
+ organizationId: string;
3324
+ values: ModelAccountSettingValues;
3325
+ locked: ModelAccountSettingKey[];
3326
+ version: number;
3327
+ updatedAt: string | null;
3328
+ };
3329
+ /**
3330
+ * Organization change: omitted fields are kept; `fallbackOrder` and `locked`
3331
+ * replace the stored value. Locking a setting clears every workspace override of it.
3332
+ */
3333
+ export type UpdateOrganizationModelAccountSettingsRequest = {
3334
+ crossProviderFailover?: boolean | undefined;
3335
+ fallbackOrder?: Record<string, string[]> | undefined;
3336
+ personalConnectionsAllowed?: boolean | undefined;
3337
+ personalFallbackAllowed?: boolean | undefined;
3338
+ rotation?: Record<string, {
3339
+ mode: ModelAccountRotationMode;
3340
+ }> | undefined;
3341
+ locked?: ModelAccountSettingKey[] | undefined;
3342
+ /** Refuse the write (409) if the settings changed since this version was read. */
3343
+ expectedVersion?: number | undefined;
3344
+ };
3345
+ /** `GET/PATCH /v1/workspaces/:id/model-account-settings`. */
3346
+ export type WorkspaceModelAccountSettings = ModelAccountSettingsView & {
3347
+ workspaceId: string;
3348
+ locked: ModelAccountSettingKey[];
3349
+ /** The workspace's stored overrides; null follows the organization. */
3350
+ overrides: {
3351
+ rotation: Record<string, unknown> | null;
3352
+ providers: Record<string, unknown> | null;
3353
+ crossProviderFailover: boolean | null;
3354
+ fallbackOrder: Record<string, string[]> | null;
3355
+ personalConnectionsAllowed: boolean | null;
3356
+ personalFallbackAllowed: boolean | null;
3357
+ };
3358
+ version: number;
3359
+ updatedAt: string | null;
3360
+ canEdit: boolean;
3361
+ };
3362
+ /**
3363
+ * Workspace change: `null` follows the organization again; `fallbackOrder`
3364
+ * and `rotation` change entry by entry. A locked setting answers 409.
3365
+ */
3366
+ export type UpdateWorkspaceModelAccountSettingsRequest = {
3367
+ crossProviderFailover?: boolean | null | undefined;
3368
+ personalConnectionsAllowed?: boolean | null | undefined;
3369
+ personalFallbackAllowed?: boolean | null | undefined;
3370
+ fallbackOrder?: Record<string, string[] | null> | null | undefined;
3371
+ rotation?: Record<string, {
3372
+ mode: ModelAccountRotationMode;
3373
+ } | null> | null | undefined;
3374
+ expectedVersion?: number | undefined;
3375
+ };
3376
+ /** Every shared workspace's effective settings and sources, one page. */
3377
+ export type ModelAccountSettingsOverview = {
3378
+ organization: OrganizationModelAccountSettings;
3379
+ workspaces: (ModelAccountSettingsView & {
3380
+ workspaceId: string;
3381
+ name: string;
3382
+ })[];
3383
+ nextCursor: string | null;
3384
+ };
3385
+ /** Why a listed model account cannot be chosen for this session. */
3386
+ export type ModelAccountChoiceRefusal = "inactive" | "personal_not_allowed" | "personal_not_owner_work" | "session_has_no_owner";
3387
+ /**
3388
+ * Cached usage, not a live check or a promise of available capacity. Source/time
3389
+ * describe the snapshot, not each retained window. A past reset does not prove replenishment.
3390
+ */
3391
+ export type ModelAccountUsageSnapshot = {
3392
+ /** Snapshot-level time, not the observation time of every retained window. */
3393
+ observedAt: string | null;
3394
+ source: "usage_endpoint" | "response_headers" | "refusal" | null;
3395
+ windows: Array<{
3396
+ id: string;
3397
+ /** Null means unknown; values over 100 can represent overage. */
3398
+ usedPercent: number | null;
3399
+ resetsAt: string | null;
3400
+ status: "ok" | "warning" | "exhausted" | "unknown";
3401
+ }>;
3402
+ exhaustedUntil: string | null;
3403
+ exhaustedKind: "quota" | "rate_limit" | null;
3404
+ };
3405
+ /** An already-visible account, with optional cached usage (never an eligibility decision). */
3406
+ export type ModelAccountChoiceOption = {
3407
+ provider: string;
3408
+ connectionId: string;
3409
+ label: string | null;
3410
+ accountEmail: string | null;
3411
+ planType: string | null;
3412
+ status: string;
3413
+ personal: boolean;
3414
+ source: "workspace" | "organization" | "personal";
3415
+ allowedModelIds: string[] | null;
3416
+ choosable: boolean;
3417
+ refusal: ModelAccountChoiceRefusal | null;
3418
+ /** Omitted on older servers; null means no decodable stored snapshot. Readings may be partial or stale. */
3419
+ usage?: ModelAccountUsageSnapshot | null | undefined;
3420
+ };
3421
+ /** A session's current account, what it may switch to, and the effective personal settings. */
3422
+ export type SessionModelAccountChoiceResponse = {
3423
+ /** Last committed placement; neither queued account choices nor unplaced proposals are serving truth. */
3424
+ serving?: {
3425
+ turnId: string;
3426
+ provider: string;
3427
+ connectionId: string | null;
3428
+ modelId: string;
3429
+ preferredModelId: string;
3430
+ reasoningEffort: ReasoningEffort;
3431
+ latencyMode: LatencyMode;
3432
+ } | null | undefined;
3433
+ /** The session's account when it has bindings for one provider only; else null (see `bindings`). */
3434
+ binding: {
3435
+ provider: string;
3436
+ connectionId: string | null;
3437
+ choice: "explicit" | "automatic";
3438
+ } | null;
3439
+ /** One binding per provider. */
3440
+ bindings: {
3441
+ provider: string;
3442
+ connectionId: string | null;
3443
+ choice: "explicit" | "automatic";
3444
+ }[];
3445
+ accounts: ModelAccountChoiceOption[];
3446
+ personal: {
3447
+ connectionsAllowed: boolean;
3448
+ fallbackAllowed: boolean;
3449
+ fallbackOptIn: boolean;
3450
+ };
3451
+ };
3452
+ /**
3453
+ * A connection becomes the choice for its provider; other providers' choices
3454
+ * stay. `connectionId: null` returns `provider`'s choice to automatic, or
3455
+ * every provider's when `provider` is omitted.
3456
+ */
3457
+ export type SetSessionModelAccountChoiceRequest = {
3458
+ connectionId: string | null;
3459
+ provider?: string;
3460
+ };
3461
+ export type SetSessionModelAccountChoiceResponse = {
3462
+ changed: boolean;
3463
+ appliedTo: "waiting_turn" | "next_turn";
3464
+ provider: string | null;
3465
+ connectionId: string | null;
3466
+ choice: "explicit" | "automatic";
3467
+ };
3468
+ /** The caller's own model-account preferences in an organization. */
3469
+ export type ModelAccountPreferences = {
3470
+ personalFallbackOptIn: boolean;
3471
+ version: number;
3472
+ };
3473
+ export type UpdateModelAccountPreferencesRequest = {
3474
+ personalFallbackOptIn: boolean;
3475
+ expectedVersion?: number;
3476
+ };
3477
+ /**
3478
+ * Whether owners and admins may give agent sessions admin access. Off by
3479
+ * default; turning it off ends every session's admin access.
3480
+ */
3481
+ export type OrganizationAgentAdminAccess = {
3482
+ sessionAdminAccessAllowed: boolean;
3483
+ updatedAt: string | null;
3484
+ };
3485
+ export type UpdateOrganizationAgentAdminAccessRequest = {
3486
+ sessionAdminAccessAllowed: boolean;
3487
+ };
3488
+ /**
3489
+ * An organization's privacy choices, after the deployment's limits. A product
3490
+ * that embeds Opengeni can only narrow these; `limits` says which are fixed.
3491
+ */
3492
+ export type OrganizationPrivacySettings = {
3493
+ organizationId: string;
3494
+ /** Who sees new chats and schedules unless the person picks otherwise. */
3495
+ defaultVisibility: "private" | "workspace";
3496
+ /** Whether admins see that other people's Only me schedules exist, and can pause them. */
3497
+ adminsSeePrivateSchedules: boolean;
3498
+ limits: {
3499
+ /** False when this deployment turns Only me off in shared workspaces. */
3500
+ onlyMeAllowed: boolean;
3501
+ /** True when new chats and schedules always start as Workspace. */
3502
+ defaultVisibilityLocked: boolean;
3503
+ /** True when admins always see that other people's Only me schedules exist. */
3504
+ adminsSeePrivateSchedulesLocked: boolean;
3505
+ };
3506
+ updatedAt: string | null;
3507
+ };
3508
+ export type UpdateOrganizationPrivacySettingsRequest = {
3509
+ defaultVisibility?: "private" | "workspace";
3510
+ adminsSeePrivateSchedules?: boolean;
3511
+ };
3512
+ /**
3513
+ * A session's admin access as the viewer sees it. While `active`, the agent
3514
+ * in this session can do what `grantedBy` can manage across the
3515
+ * organization, checked live on every action.
3516
+ */
3517
+ export type SessionAdminAccess = {
3518
+ active: boolean;
3519
+ grantedBy: {
3520
+ subjectId: string;
3521
+ name: string | null;
3522
+ } | null;
3523
+ grantedAt: string | null;
3524
+ /** While active: when it ends by itself, or null for no time limit. */
3525
+ expiresAt: string | null;
3526
+ /** The organization allows admin access for sessions. */
3527
+ allowed: boolean;
3528
+ /**
3529
+ * The viewer may turn it on, or choose a new time limit while it is on: an
3530
+ * owner or admin, in person, on their own session.
3531
+ */
3532
+ canGrant: boolean;
3533
+ /** The viewer may turn it off. */
3534
+ canRevoke: boolean;
3535
+ };
3536
+ /**
3537
+ * How long a session's admin access lasts from now: whole hours from 1 to
3538
+ * 720, or null for no time limit. Omitted means one hour.
3539
+ */
3540
+ export type GrantSessionAdminAccessRequest = {
3541
+ durationHours?: number | null;
3542
+ };
3543
+ /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
3544
+ export type UpdateWorkspaceModelAccessPolicyRequest = {
3545
+ allowedProviders?: string[] | null | undefined;
3546
+ allowedModels?: string[] | null | undefined;
3547
+ };
3548
+ /**
3549
+ * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
3550
+ * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
3551
+ * workspace can select (projected as ClientModel under their own "no credits"
3552
+ * provider group), present only while connected.
3553
+ */
2383
3554
  export type CodexConnectionStatus = {
2384
3555
  connected: boolean;
2385
3556
  plan?: string | null;
@@ -2393,6 +3564,12 @@ export type CodexConnectionStatus = {
2393
3564
  label?: string | null;
2394
3565
  chatgptAccountId?: string | null;
2395
3566
  } | null;
3567
+ /** Live model-catalog probe result for the active account only. */
3568
+ activeAccountValid?: boolean;
3569
+ /** Cached readiness of any account in the effective worker pool. */
3570
+ poolReady?: boolean;
3571
+ /** Cached unpinned worker routability; rotation-off remains active-pointer-only. */
3572
+ workerRoutable?: boolean;
2396
3573
  /** How many Codex accounts the workspace has connected. */
2397
3574
  accountCount?: number;
2398
3575
  source?: WorkspaceCodexSubscriptionSource;
@@ -2406,6 +3583,13 @@ export type WorkspaceCodexSubscriptionSource = {
2406
3583
  effectiveSource: "workspace" | "organization" | "disabled";
2407
3584
  workspaceAvailable: boolean;
2408
3585
  organizationAvailable: boolean;
3586
+ /** Some of the workspace's own accounts are not in use here. Absent from older servers. */
3587
+ workspaceSetAside?: boolean;
3588
+ /**
3589
+ * How many organization accounts other than the workspace's own reach this
3590
+ * workspace (accounts limited to chosen people aside). Absent from older servers.
3591
+ */
3592
+ organizationCount?: number;
2409
3593
  };
2410
3594
  /**
2411
3595
  * One normalized Codex usage window (5h or weekly), camelCase end-to-end (the
@@ -2444,22 +3628,48 @@ export type CodexUsagePayload = {
2444
3628
  meteredFeature: string;
2445
3629
  fiveHour: CodexUsageWindow | null;
2446
3630
  weekly: CodexUsageWindow | null;
3631
+ unknownWindowExhausted: boolean;
2447
3632
  }>;
2448
3633
  credits?: {
2449
3634
  hasCredits: boolean;
2450
3635
  unlimited: boolean;
2451
3636
  overageLimitReached: boolean;
2452
- balance: string;
3637
+ balance: string | null;
2453
3638
  };
2454
3639
  };
3640
+ /** One model a Codex account's current ChatGPT plan was proven not to include. */
3641
+ export type CodexPlanExcludedModel = {
3642
+ /** Product model id, for example `codex/gpt-6-sol`. */
3643
+ model: string;
3644
+ /** Display name, for example "GPT-6 Sol". */
3645
+ label: string;
3646
+ excludedAt: string;
3647
+ retryAfter: string;
3648
+ };
2455
3649
  /** One connected Codex (ChatGPT) account in a workspace (multi-account P1). Metadata only. */
2456
3650
  export type CodexAccount = {
2457
3651
  id: string;
2458
3652
  source?: "workspace" | "organization";
3653
+ /**
3654
+ * Organization list only: shared workspaces that list the account among
3655
+ * their own (it was connected there).
3656
+ */
3657
+ ownInWorkspaceIds?: string[];
2459
3658
  chatgptAccountId?: string | null;
2460
3659
  label?: string | null;
2461
3660
  email?: string | null;
2462
3661
  plan?: string | null;
3662
+ /** When the provider last confirmed `plan` (connect, token refresh, or usage read). */
3663
+ planCheckedAt?: string | null;
3664
+ /** Plan before the most recent observed plan change, and when that change was seen. */
3665
+ planChangedFrom?: string | null;
3666
+ planChangedAt?: string | null;
3667
+ /**
3668
+ * Models the current plan was proven not to include. Each is skipped by
3669
+ * automatic selection until `retryAfter` (one request then re-checks it), or
3670
+ * until a different plan is observed, for example after refreshing usage.
3671
+ */
3672
+ planExcludedModels?: CodexPlanExcludedModel[];
2463
3673
  status: "active" | "needs_relogin" | "error";
2464
3674
  active: boolean;
2465
3675
  expiresAt?: string | null;
@@ -2470,6 +3680,9 @@ export type CodexAccount = {
2470
3680
  usageCheckedAt?: string | null;
2471
3681
  exhaustedUntil?: string | null;
2472
3682
  /** Controls only NEW automatic allocations. */
3683
+ extraCreditsEnabled?: boolean;
3684
+ extraCreditsVersion?: number;
3685
+ extraCreditsUpdatedAt?: string | null;
2473
3686
  allocatorEnabled: boolean;
2474
3687
  /** Independent OCC sequence; credential/token `version` is never exposed. */
2475
3688
  allocatorVersion: number;
@@ -2569,6 +3782,17 @@ export type CodexAccountsResponse = {
2569
3782
  settings: CodexRotationSettings;
2570
3783
  };
2571
3784
  export type OrganizationCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source">;
3785
+ /** Session-authorized choices: the accepted pool for a capacity wait, otherwise
3786
+ * the current pool for the next turn. Current execution may use another pool. */
3787
+ export type SessionCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source"> & {
3788
+ currentSelection: {
3789
+ credentialId: string | null;
3790
+ waiting: boolean;
3791
+ } | null;
3792
+ currentAccount: CodexAccount | null;
3793
+ pinnedAccountId: string | null;
3794
+ lastAccountId: string | null;
3795
+ };
2572
3796
  export type CodexAppsUpdate = {
2573
3797
  credentialId: string | null;
2574
3798
  version: number;
@@ -2600,10 +3824,11 @@ export type CodexConnectPoll = {
2600
3824
  isActive?: boolean;
2601
3825
  };
2602
3826
  /** Explicit authority of one connected SuperGrok/xAI subscription account. */
2603
- export type SuperGrokAccountScope = "workspace" | "user";
3827
+ export type SuperGrokAccountScope = "workspace" | "user" | "organization";
2604
3828
  /** Metadata-only connected SuperGrok account. Secret OAuth material never crosses the API. */
2605
3829
  export type SuperGrokAccount = {
2606
3830
  id: string;
3831
+ plan?: string | null;
2607
3832
  scope: SuperGrokAccountScope;
2608
3833
  subject: string;
2609
3834
  email?: string | null;
@@ -2632,6 +3857,8 @@ export type SuperGrokRotationSettings = {
2632
3857
  };
2633
3858
  /** GET /supergrok/accounts — visible accounts plus the workspace active pointer. */
2634
3859
  export type SuperGrokAccountsResponse = {
3860
+ source?: "workspace" | "user" | "organization";
3861
+ organizationId?: string;
2635
3862
  accounts: SuperGrokAccount[];
2636
3863
  activeAccountId: string | null;
2637
3864
  settings: SuperGrokRotationSettings;
@@ -2704,8 +3931,13 @@ export type ClientAuthConfig = {
2704
3931
  emailVerificationRequired?: boolean;
2705
3932
  /** Configured managed sign-in providers; omitted by older deployments. */
2706
3933
  socialProviders?: ("google" | "github")[];
3934
+ /**
3935
+ * False while the deployment has paused new account creation; existing
3936
+ * accounts can still sign in. Omitted (treat as true) by older deployments.
3937
+ */
3938
+ newSignupsEnabled?: boolean;
2707
3939
  };
2708
- export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-organization-recovery-custody-v1";
3940
+ export declare const OPENGENI_API_CONTRACT_REVISION: "2026-09-plugins-and-skills-v1";
2709
3941
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2710
3942
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2711
3943
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2718,8 +3950,16 @@ export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
2718
3950
  */
2719
3951
  export type ClientConfig = {
2720
3952
  deploymentRevision: string;
2721
- apiContractRevision: typeof OPENGENI_API_CONTRACT_REVISION;
3953
+ /**
3954
+ * The API's contract revision. Equals `OPENGENI_API_CONTRACT_REVISION` for a
3955
+ * `"strict"` client (it throws otherwise); a `"compatible"` client may
3956
+ * receive a newer revision from an additive deployment within its major.
3957
+ */
3958
+ apiContractRevision: string;
2722
3959
  serverVersion?: string | undefined;
3960
+ claudeSubscriptionEnabled?: boolean | undefined;
3961
+ /** Whether people can connect their own computers; absent on older servers. */
3962
+ connectedMachines?: boolean | undefined;
2723
3963
  defaultModel: string;
2724
3964
  allowedModels: string[];
2725
3965
  models: ClientModel[];
@@ -2730,7 +3970,7 @@ export type ClientConfig = {
2730
3970
  id: string;
2731
3971
  name: string;
2732
3972
  }[];
2733
- /** Deployment defaults and hard maximum for built-in OpenGeni session tools. */
3973
+ /** Deployment defaults and hard maximum for built-in Opengeni session tools. */
2734
3974
  firstPartyMcpTools?: {
2735
3975
  default: FirstPartyMcpToolName[];
2736
3976
  allowed: FirstPartyMcpToolName[];
@@ -2739,11 +3979,93 @@ export type ClientConfig = {
2739
3979
  enabled: boolean;
2740
3980
  maxSizeBytes: number;
2741
3981
  };
3982
+ /**
3983
+ * `false` when a host's session proxy fixes the model policy
3984
+ * (`createSessionProxyHandler({ modelSelection: false })`), so UIs hide the
3985
+ * model picker; `true` when the host explicitly offers end users model
3986
+ * choice (embedded stock UIs then show the picker). Opengeni itself omits it.
3987
+ */
3988
+ modelSelection?: boolean | undefined;
3989
+ /** Session proxy sandbox-path download opt-in; absent on native deployments. */
3990
+ sandboxFiles?: boolean | undefined;
3991
+ /**
3992
+ * `false` when a host's session proxy turns live voice off
3993
+ * (`createSessionProxyHandler({ realtimeVoice: false })`), so UIs hide the
3994
+ * voice button; `true` when the host explicitly offers it to end users
3995
+ * (embedded stock UIs then show the button). Otherwise absent: availability
3996
+ * comes from the workspace's realtime model catalog.
3997
+ */
3998
+ realtimeVoice?: boolean | undefined;
3999
+ /**
4000
+ * Session proxy only: the workspace the proxy resolved for this user, so a
4001
+ * browser pointed at the proxy (`<OpenGeniChat baseUrl=... />`) needs no
4002
+ * workspace id. Absent on native deployments and older proxies.
4003
+ */
4004
+ workspaceId?: string | undefined;
4005
+ /**
4006
+ * Session proxy capability for the embedded artifact viewer and inline Site
4007
+ * previews; absent on native deployments. The live socket is
4008
+ * ticket-authenticated and reached directly; the cache partition identifies
4009
+ * the proxied user. `false` when the proxy does not serve artifacts, so
4010
+ * stock UIs show Site previews as unavailable instead of failing on click.
4011
+ */
4012
+ artifacts?: {
4013
+ editableLiveUrl: string;
4014
+ cachePartition: {
4015
+ accountId: string;
4016
+ principalId: string;
4017
+ authorizationEpoch: string;
4018
+ };
4019
+ } | false | undefined;
4020
+ /**
4021
+ * Session proxy only: whether the browser may start a chat (the proxy has a
4022
+ * `createSession` hook). Stock UIs hide "New chat" when `false`; absent on
4023
+ * native deployments and older proxies.
4024
+ */
4025
+ sessionCreation?: boolean | undefined;
4026
+ /**
4027
+ * Session proxy only: whether users may archive or restore their chats.
4028
+ * Stock UIs hide "Archive" when `false`; absent on native deployments.
4029
+ */
4030
+ archive?: boolean | undefined;
2742
4031
  /** Native browser microphone capture + server-side transcription capability. */
2743
4032
  voiceInput?: ClientVoiceInputConfig | undefined;
4033
+ /**
4034
+ * Whether the deployment offers the Jev-backed code_search agent tool and
4035
+ * what workspaces without their own setting get (`split` = half of sessions).
4036
+ */
4037
+ codeSearch?: {
4038
+ available: boolean;
4039
+ workspaceDefault: "off" | "on" | "split";
4040
+ } | undefined;
4041
+ /**
4042
+ * Present only when this deployment archives idle sessions: after `idleDays`
4043
+ * without activity a session (unless kept live) becomes read-only.
4044
+ */
4045
+ sessionArchive?: {
4046
+ enabled: true;
4047
+ idleDays: number;
4048
+ } | undefined;
4049
+ /**
4050
+ * Present when the server records and enforces per-task usage limits.
4051
+ * `enabled: false` refuses new limits but still enforces and clears existing
4052
+ * ones. Omitted by older servers, which ignore `usageLimitMicros`.
4053
+ */
4054
+ sessionUsageLimits?: {
4055
+ enabled: boolean;
4056
+ } | undefined;
4057
+ /** Agent configuration rollout and per-capability availability. */
4058
+ agentConfig?: ClientAgentConfig | undefined;
2744
4059
  productAccessMode: ProductAccessMode;
4060
+ /** Client-safe hint for whether the console should offer Stripe checkout. */
4061
+ billingMode?: BillingMode | undefined;
2745
4062
  managedAuthSessionSetMode: "legacy" | "dual" | "broker";
2746
4063
  auth: ClientAuthConfig;
4064
+ /**
4065
+ * Product documentation for a console Help link. `null` means the deployment
4066
+ * hides the link; absent means a server that predates the field.
4067
+ */
4068
+ documentationUrl?: string | null | undefined;
2747
4069
  analytics: {
2748
4070
  consentRequired: boolean;
2749
4071
  providers: {
@@ -2759,6 +4081,13 @@ export type ClientConfig = {
2759
4081
  } | undefined;
2760
4082
  };
2761
4083
  };
4084
+ /** Operator-owned legal documents the signed-out console links to, when configured. */
4085
+ legal?: {
4086
+ privacyPolicyUrl?: string | undefined;
4087
+ termsOfServiceUrl?: string | undefined;
4088
+ } | undefined;
4089
+ /** Operator support address the console offers as a mailto link, when configured. */
4090
+ supportEmail?: string | undefined;
2762
4091
  structuredServices: {
2763
4092
  fileSystem: boolean;
2764
4093
  git: boolean;
@@ -2768,6 +4097,7 @@ export type ClientConfig = {
2768
4097
  /** Client-safe voice-input capability projection. */
2769
4098
  export type ClientVoiceInputConfig = {
2770
4099
  available: boolean;
4100
+ providers?: VoiceInputProviderId[] | undefined;
2771
4101
  maxDurationSeconds: number;
2772
4102
  maxSizeBytes: number;
2773
4103
  acceptedMimeTypes: string[];
@@ -2779,7 +4109,7 @@ export type ClientResumableVoiceInputConfig = {
2779
4109
  maxChunkSizeBytes: number;
2780
4110
  providerSegmentSeconds: number;
2781
4111
  };
2782
- export type TranscriptionRecordingErrorCode = "permission_denied" | "not_supported" | "network" | "provider" | "policy_blocked" | "timeout" | "cancelled" | "unavailable" | "too_large" | "invalid_audio" | "unknown";
4112
+ export type TranscriptionRecordingErrorCode = "permission_denied" | "not_supported" | "network" | "provider" | "policy_blocked" | "timeout" | "cancelled" | "unavailable" | "too_large" | "invalid_audio" | "unknown" | "insufficient_credits" | "allowance_exhausted" | "monthly_model_cost_limit";
2783
4113
  export type TranscriptionRecordingState = "uploading" | "segmenting" | "ready" | "transcribing" | "complete" | "failed" | "discarded";
2784
4114
  export type TranscriptionRecordingSegmentState = "preparing" | "pending" | "transcribing" | "complete" | "failed";
2785
4115
  export type TranscriptionRecordingSegment = {
@@ -2852,11 +4182,43 @@ export type AccessGrant = {
2852
4182
  subjectId: string;
2853
4183
  subjectLabel?: string | undefined;
2854
4184
  permissions: Permission[];
4185
+ /** Explicit policies never expand `workspace:admin` into unselected permissions. */
4186
+ permissionMode?: "legacy" | "explicit" | undefined;
2855
4187
  principalKind?: AccessPrincipalKind | undefined;
2856
4188
  metadata?: Record<string, unknown> | undefined;
2857
4189
  serviceInitiator?: ServiceTurnInitiator | undefined;
2858
4190
  serviceInitiatorContext?: ServiceTurnInitiatorContext | undefined;
2859
4191
  };
4192
+ /**
4193
+ * Authority of a directly used organization or workspace API key, separate
4194
+ * from the caller's account and workspace grants. Full organization keys can
4195
+ * provision shared workspaces, external members, and sessions through `asUser`;
4196
+ * those user requests additionally need the user's live membership.
4197
+ * Organization-key scope excludes Personal workspaces. Neither key kind bypasses
4198
+ * session visibility or the explicit `secrets:read` permission requirement.
4199
+ */
4200
+ export type AccessCredential = {
4201
+ kind: "organization_api_key" | "workspace_api_key";
4202
+ /** Organization keys only; omitted for workspace keys. */
4203
+ access?: OrganizationApiKeyAccess | undefined;
4204
+ /** The key's organization id. */
4205
+ accountId: string;
4206
+ /** Null for an organization key; `workspaceScope` selects shared workspaces, never Personal. */
4207
+ workspaceId: string | null;
4208
+ /**
4209
+ * Effective workspace permissions, with admin expansion only for legacy keys. Excludes
4210
+ * account-only permissions and includes `secrets:read` only when explicitly
4211
+ * granted. Explicit policies grant exactly their selected permissions.
4212
+ */
4213
+ effectiveWorkspacePermissions: Permission[];
4214
+ /** Organization keys only; the preset label never adds permissions. */
4215
+ policy?: OrganizationAccessPolicy | undefined;
4216
+ /** Organization keys only; omitted on older servers. */
4217
+ workspaceScope?: OrganizationWorkspaceScope | undefined;
4218
+ /** Plain-language explanation of the key's scope and limits. */
4219
+ note: string;
4220
+ };
4221
+ /** Caller identity, grants, defaults, and optional direct API-key authority. */
2860
4222
  export type AccessContext = {
2861
4223
  mode: ProductAccessMode;
2862
4224
  subjectId: string;
@@ -2865,6 +4227,15 @@ export type AccessContext = {
2865
4227
  workspaceGrants: AccessGrant[];
2866
4228
  defaultAccountId: string | null;
2867
4229
  defaultWorkspaceId: string | null;
4230
+ /**
4231
+ * Direct API-key authority; omitted for `asUser`/external actors, humans,
4232
+ * delegated tokens, other caller contexts, and older servers. Existing grants
4233
+ * are unchanged. Full organization keys can provision shared workspaces,
4234
+ * external members, and `asUser` sessions; user requests still need live
4235
+ * membership. Organization-key scope excludes Personal workspaces. Neither key
4236
+ * kind bypasses session visibility or the explicit `secrets:read` requirement.
4237
+ */
4238
+ credential?: AccessCredential | undefined;
2868
4239
  };
2869
4240
  export type ManagedOrganizationMembership = {
2870
4241
  id: string;
@@ -2900,7 +4271,7 @@ export type UserResourceAuthoritySummary = {
2900
4271
  grants: UserResourceAuthorityGrant[];
2901
4272
  };
2902
4273
  export type ListUserResourceAuthoritiesOptions = {
2903
- resourceKind: UserResourceKind;
4274
+ resourceKind: Exclude<UserResourceKind, "connection">;
2904
4275
  cursor?: string | undefined;
2905
4276
  limit?: number | undefined;
2906
4277
  };
@@ -2911,7 +4282,7 @@ export type ListUserResourceAuthoritiesResponse = {
2911
4282
  };
2912
4283
  export type IssueUserResourceGrantRequest = {
2913
4284
  scope: "user";
2914
- resourceKind: UserResourceKind;
4285
+ resourceKind: Exclude<UserResourceKind, "connection">;
2915
4286
  mode: "session";
2916
4287
  context: "user_private" | "workspace_shared";
2917
4288
  sessionId: string;
@@ -2919,7 +4290,7 @@ export type IssueUserResourceGrantRequest = {
2919
4290
  workspaceSharedAcknowledged?: boolean | undefined;
2920
4291
  } | {
2921
4292
  scope: "user";
2922
- resourceKind: UserResourceKind;
4293
+ resourceKind: Exclude<UserResourceKind, "connection">;
2923
4294
  mode: "always";
2924
4295
  context: "user_private" | "workspace_shared";
2925
4296
  sessionId?: null | undefined;
@@ -3086,6 +4457,16 @@ export type CreateOrganizationResponse = {
3086
4457
  organization: OrganizationSummary;
3087
4458
  workspaceId: string;
3088
4459
  };
4460
+ export type CreateAdditionalOrganizationRequest = {
4461
+ name: string;
4462
+ workspaceName: string;
4463
+ operationId: string;
4464
+ };
4465
+ export type CreateAdditionalOrganizationResponse = {
4466
+ organization: OrganizationSummary;
4467
+ workspaceId: string;
4468
+ personalWorkspaceId: string;
4469
+ };
3089
4470
  export type UpdateOrganizationNameRequest = {
3090
4471
  name: string;
3091
4472
  expectedUpdatedAt: string;
@@ -3262,6 +4643,8 @@ export type Workspace = {
3262
4643
  agentInstructions: string | null;
3263
4644
  settings: Record<string, unknown>;
3264
4645
  inferenceControl: {
4646
+ timer?: WorkspacePauseTimer | null | undefined;
4647
+ serverTime?: string | undefined;
3265
4648
  state: "active" | "paused";
3266
4649
  revision: number;
3267
4650
  reason: string | null;
@@ -3273,6 +4656,8 @@ export type Workspace = {
3273
4656
  updatedAt: string;
3274
4657
  };
3275
4658
  export type WorkspaceSettings = {
4659
+ /** Exact product-model preferences. Invalid/newer values are ignored per model. */
4660
+ modelCompactionThresholds?: unknown;
3276
4661
  memoryEnabled?: boolean | undefined;
3277
4662
  /** Reversible Memory V1 prompt composition rollout. */
3278
4663
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
@@ -3280,6 +4665,8 @@ export type WorkspaceSettings = {
3280
4665
  sessionDefaults?: WorkspaceSessionDefaults | undefined;
3281
4666
  /** Exact capability selection inherited by new top-level sessions. */
3282
4667
  sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
4668
+ /** Allowlisted sandbox image for new managed boxes; absent uses the deployment image. */
4669
+ defaultSandboxImage?: string | null | undefined;
3283
4670
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3284
4671
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3285
4672
  maxNestedAgentDepth?: number | null | undefined;
@@ -3287,9 +4674,13 @@ export type WorkspaceSettings = {
3287
4674
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3288
4675
  /** Whether agents may invoke the built-in structured human-input tool. */
3289
4676
  agentHumanInputEnabled?: boolean | undefined;
4677
+ /** Whether agents get the Jev-backed code_search tool; absent or null follows the deployment. */
4678
+ codeSearchEnabled?: boolean | null | undefined;
3290
4679
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3291
4680
  /** Slack orchestration notices; both default off when absent or invalid. */
3292
4681
  slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
4682
+ /** False blocks every model billed in Opengeni credits; absent allows them. */
4683
+ allowCreditModels?: boolean | undefined;
3293
4684
  [key: string]: unknown;
3294
4685
  };
3295
4686
  export type WorkspaceSessionDefaults = {
@@ -3297,8 +4688,9 @@ export type WorkspaceSessionDefaults = {
3297
4688
  reasoningEffort: ReasoningEffort;
3298
4689
  };
3299
4690
  export type WorkspaceSessionToolDefaults = {
3300
- mcpServerIds: string[];
3301
- firstPartyMcpTools: FirstPartyMcpToolName[];
4691
+ inheritConnectedMcpServers?: boolean | undefined;
4692
+ mcpServerIds?: string[];
4693
+ firstPartyMcpTools?: FirstPartyMcpToolName[];
3302
4694
  };
3303
4695
  export type WorkspaceSlackReactionSummonSettings = {
3304
4696
  enabled: boolean;
@@ -3347,21 +4739,41 @@ export type UpdateSlackChannelRoutesRequest = {
3347
4739
  targetWorkspaceId: string | null;
3348
4740
  }>;
3349
4741
  };
4742
+ export type VoiceInputProviderId = "azure-mai" | "supergrok-subscription" | "codex-subscription" | "openai" | "azure-openai";
3350
4743
  export type WorkspaceVoiceInputSettings = {
3351
4744
  enabled: boolean;
4745
+ preferredProvider?: VoiceInputProviderId | null | undefined;
4746
+ fallbackEnabled?: boolean | undefined;
3352
4747
  };
3353
4748
  export type UpdateWorkspaceSettingsRequest = {
4749
+ /** Independent model patches; null restores that model's default. */
4750
+ modelCompactionThresholds?: Record<string, number | null>;
3354
4751
  memoryEnabled?: boolean | undefined;
3355
4752
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3356
- sessionDefaults?: WorkspaceSessionDefaults | undefined;
3357
- sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
4753
+ /** null removes the workspace's own default so it follows its organization's. */
4754
+ sessionDefaults?: WorkspaceSessionDefaults | null | undefined;
4755
+ sessionToolDefaults?: {
4756
+ mcpServerIds?: string[] | null;
4757
+ firstPartyMcpTools?: FirstPartyMcpToolName[] | null;
4758
+ inheritConnectedMcpServers?: boolean | null;
4759
+ } | undefined;
3358
4760
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3359
4761
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3360
4762
  maxNestedAgentDepth?: number | null | undefined;
3361
4763
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3362
4764
  agentHumanInputEnabled?: boolean | undefined;
4765
+ codeSearchEnabled?: boolean | null | undefined;
3363
4766
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3364
4767
  slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
4768
+ /** One of `listWorkspaceSandboxImages().images`, or null for the deployment image. */
4769
+ defaultSandboxImage?: string | null | undefined;
4770
+ /** Agent defaults for new sessions; null clears. Requires the admission switch. */
4771
+ sessionAgentDefaults?: WorkspaceAgentDefaults | null | undefined;
4772
+ /**
4773
+ * False blocks every model billed in Opengeni credits in this workspace,
4774
+ * including ones added later; true allows them again.
4775
+ */
4776
+ allowCreditModels?: boolean | undefined;
3365
4777
  [key: string]: unknown;
3366
4778
  };
3367
4779
  export type SetWorkspaceDefaultRigRequest = {
@@ -3376,7 +4788,12 @@ export type CreateWorkspaceRequest = {
3376
4788
  agentInstructions?: string | null | undefined;
3377
4789
  };
3378
4790
  export type EnsureWorkspaceRequest = {
3379
- accountId: string;
4791
+ /**
4792
+ * Owning organization id. An organization API key may omit it and the
4793
+ * workspace is created in the key's own organization; every other caller
4794
+ * must send it.
4795
+ */
4796
+ accountId?: string | undefined;
3380
4797
  externalSource: string;
3381
4798
  externalId: string;
3382
4799
  name: string;
@@ -3392,6 +4809,34 @@ export type UpdateWorkspaceRequest = {
3392
4809
  slug?: string | null | undefined;
3393
4810
  agentInstructions?: string | null | undefined;
3394
4811
  };
4812
+ /**
4813
+ * Legacy organization API key access tier, derived by the server from the key's
4814
+ * permissions: `full` can provision shared workspaces, external members, and
4815
+ * `asUser` sessions (user requests additionally need live membership);
4816
+ * `read` only inventories shared workspaces and reads their sessions, events,
4817
+ * and files. `developer_setup` configures shared workspaces and budgets without
4818
+ * API-key management or credential delegation; its default expiry is 24 hours.
4819
+ * Organization-key scope excludes Personal workspaces and bypasses neither
4820
+ * session visibility nor the explicit `secrets:read` permission requirement.
4821
+ */
4822
+ export type OrganizationApiKeyAccess = "full" | "read" | "developer_setup";
4823
+ /** Informational preset label; the server recomputes it from explicit permissions. */
4824
+ export type OrganizationAccessPreset = "read_only" | "full" | "custom";
4825
+ /** Organization-key scope always excludes Personal workspaces. */
4826
+ export type OrganizationWorkspaceScope = {
4827
+ kind: "all";
4828
+ } | {
4829
+ kind: "selected";
4830
+ /** Up to 500 unique shared-workspace IDs in the same organization. Empty reaches none. */
4831
+ workspaceIds: string[];
4832
+ };
4833
+ export type OrganizationAccessPolicy = {
4834
+ preset: OrganizationAccessPreset;
4835
+ /** Exact grants, including `workspace:admin` individually; no implicit wildcard. */
4836
+ permissions: Permission[];
4837
+ workspaceScope: OrganizationWorkspaceScope;
4838
+ };
4839
+ export type OrganizationActor = "user" | "organization";
3395
4840
  export type ApiKey = {
3396
4841
  id: string;
3397
4842
  accountId: string;
@@ -3400,6 +4845,18 @@ export type ApiKey = {
3400
4845
  description: string | null;
3401
4846
  prefix: string;
3402
4847
  permissions: Permission[];
4848
+ /** Organization keys only; omitted for workspace-scoped keys. */
4849
+ access?: OrganizationApiKeyAccess | undefined;
4850
+ policy?: OrganizationAccessPolicy | undefined;
4851
+ workspaceScope?: OrganizationWorkspaceScope | undefined;
4852
+ /** Legacy keys retain their historical workspace-admin wildcard. */
4853
+ permissionMode?: "legacy" | "explicit" | undefined;
4854
+ /** Organization keys: the service account that holds the key. */
4855
+ serviceAccount?: {
4856
+ id: string;
4857
+ name: string;
4858
+ role: OrganizationServiceAccountRole;
4859
+ } | null | undefined;
3403
4860
  expiresAt: string | null;
3404
4861
  revokedAt: string | null;
3405
4862
  lastUsedAt: string | null;
@@ -3421,38 +4878,366 @@ export type CreateOrganizationApiKeyRequest = {
3421
4878
  name: string;
3422
4879
  description?: string | undefined;
3423
4880
  expiresAt?: string | undefined;
4881
+ /** With no policy, omitted means legacy `full`. */
4882
+ access?: OrganizationApiKeyAccess | undefined;
4883
+ /** Optional creation alias for the developer_setup access tier. */
4884
+ preset?: "developer_setup" | undefined;
4885
+ /** Explicit grants and shared-workspace scope; do not combine with legacy access/preset. */
4886
+ policy?: OrganizationAccessPolicy | undefined;
4887
+ /** The service account that holds the key; omitted creates one named after the key. */
4888
+ serviceAccountId?: string | undefined;
4889
+ };
4890
+ /** The server requires at least one change. Omitted fields stay unchanged. */
4891
+ export type UpdateOrganizationApiKeyRequest = {
4892
+ name?: string | undefined;
4893
+ description?: string | null | undefined;
4894
+ /** Replaces the policy and transitions a legacy key to explicit permission semantics. */
4895
+ policy?: OrganizationAccessPolicy | undefined;
3424
4896
  };
3425
4897
  export type ListApiKeysResponse = {
3426
4898
  apiKeys: ApiKey[];
3427
4899
  };
3428
- export type WorkspaceMember = {
3429
- subjectId: string;
3430
- subjectLabel: string | null;
3431
- role: string;
3432
- permissions: Permission[];
4900
+ /** Up to admin, never owner. A member's keys never hold administrator permissions. */
4901
+ export type OrganizationServiceAccountRole = "admin" | "member";
4902
+ /** An organization identity with no person behind it; it holds organization API keys. */
4903
+ export type OrganizationServiceAccount = {
4904
+ id: string;
4905
+ organizationId: string;
4906
+ name: string;
4907
+ description: string | null;
4908
+ role: OrganizationServiceAccountRole;
4909
+ /** Keys that are not revoked, including expired ones. */
4910
+ activeKeyCount: number;
3433
4911
  createdAt: string;
4912
+ updatedAt: string;
3434
4913
  };
3435
- export type ListWorkspaceMembersResponse = {
3436
- members: WorkspaceMember[];
3437
- };
3438
- export type WorkspaceMemberCandidate = {
3439
- organizationMembershipId: string;
3440
- subjectId: string;
3441
- name: string | null;
3442
- email: string | null;
3443
- organizationRole: "owner" | "admin" | "member";
4914
+ export type ListOrganizationServiceAccountsResponse = {
4915
+ serviceAccounts: OrganizationServiceAccount[];
3444
4916
  };
3445
- export type ListWorkspaceMemberCandidatesResponse = {
3446
- members: WorkspaceMemberCandidate[];
4917
+ export type CreateOrganizationServiceAccountRequest = {
4918
+ name: string;
4919
+ description?: string | undefined;
4920
+ /** Defaults to member. Only an organization administrator can choose admin. */
4921
+ role?: OrganizationServiceAccountRole | undefined;
3447
4922
  };
3448
- export type AddWorkspaceMemberRequest = {
3449
- organizationMembershipId: string;
3450
- role?: string | undefined;
3451
- permissions: Permission[];
4923
+ /** The server requires at least one change. Making it a member narrows its keys. */
4924
+ export type UpdateOrganizationServiceAccountRequest = {
4925
+ name?: string | undefined;
4926
+ description?: string | null | undefined;
4927
+ role?: OrganizationServiceAccountRole | undefined;
3452
4928
  };
3453
- export type UpdateWorkspaceMemberRequest = {
3454
- role?: string | undefined;
3455
- permissions: Permission[];
4929
+ /** An outside agent a person connected to the organization MCP server. */
4930
+ export type OrganizationMcpConnection = {
4931
+ id: string;
4932
+ /** The name the client registered with ("Claude Code"). */
4933
+ clientName: string;
4934
+ /** Where its sign-in returned to ("127.0.0.1:4567", "cursor.com"). */
4935
+ clientHost: string | null;
4936
+ /** Signed-in agents act as the person who connected them. */
4937
+ actor: "user";
4938
+ connectedBy: {
4939
+ subjectId: string;
4940
+ name: string;
4941
+ };
4942
+ /** What it can do and where. The person's own live access still caps it. */
4943
+ policy: OrganizationAccessPolicy;
4944
+ createdAt: string;
4945
+ lastUsedAt: string | null;
4946
+ expiresAt: string;
4947
+ revokedAt: null;
4948
+ };
4949
+ export type OrganizationMcpConnectionList = {
4950
+ connections: OrganizationMcpConnection[];
4951
+ /** Owners and admins see and can disconnect everyone's agents. */
4952
+ canManageAll: boolean;
4953
+ };
4954
+ export type UpdateOrganizationMcpConnectionRequest = {
4955
+ access: OrganizationAccessPolicy;
4956
+ };
4957
+ /**
4958
+ * A key that acts as the person who created it: their live access in this
4959
+ * organization, capped by `access`. It stops working when they leave.
4960
+ */
4961
+ export type PersonalApiKey = {
4962
+ id: string;
4963
+ organizationId: string;
4964
+ name: string;
4965
+ description: string | null;
4966
+ /** The first characters of the key, to recognize it. */
4967
+ prefix: string;
4968
+ access: OrganizationAccessPolicy;
4969
+ owner: {
4970
+ subjectId: string;
4971
+ name: string;
4972
+ };
4973
+ expiresAt: string | null;
4974
+ lastUsedAt: string | null;
4975
+ createdAt: string;
4976
+ };
4977
+ export type ListPersonalApiKeysResponse = {
4978
+ apiKeys: PersonalApiKey[];
4979
+ /** Owners and admins see everyone's keys and can revoke them. */
4980
+ canManageAll: boolean;
4981
+ };
4982
+ export type CreatePersonalApiKeyRequest = {
4983
+ name: string;
4984
+ description?: string | undefined;
4985
+ access: OrganizationAccessPolicy;
4986
+ /** Omitted means the key never expires. */
4987
+ expiresAt?: string | undefined;
4988
+ };
4989
+ export type CreatePersonalApiKeyResponse = {
4990
+ apiKey: PersonalApiKey;
4991
+ /** The full secret token, shown once at creation. */
4992
+ token: string;
4993
+ };
4994
+ /** A pending agent sign-in, as the web app's sign-in page shows it. */
4995
+ export type McpConnectionRequest = {
4996
+ client: {
4997
+ name: string;
4998
+ host: string | null;
4999
+ };
5000
+ person: {
5001
+ name: string | null;
5002
+ };
5003
+ organizations: Array<{
5004
+ id: string;
5005
+ name: string;
5006
+ workspaces: Array<{
5007
+ id: string;
5008
+ name: string;
5009
+ personal: boolean;
5010
+ }>;
5011
+ /** Everything the person can do there; the most an agent can get. */
5012
+ grantable: Permission[];
5013
+ }>;
5014
+ defaultOrganizationId: string | null;
5015
+ };
5016
+ export type McpConnectionDecision = {
5017
+ decision: "deny";
5018
+ } | {
5019
+ decision: "approve";
5020
+ organizationId: string;
5021
+ access: OrganizationAccessPolicy;
5022
+ };
5023
+ /** Why an inbox item waits on the person. */
5024
+ export type InboxItemKind = "question" | "approval" | "goal_paused" | "notification" | "reply";
5025
+ /**
5026
+ * One thing that waits on the person: a question, an approval, a goal the agent
5027
+ * paused on them, or an agent's notification. It leaves the inbox when it is
5028
+ * answered, resolved, withdrawn or dismissed; it stays in the session's timeline.
5029
+ */
5030
+ export type InboxItem = {
5031
+ id: string;
5032
+ workspaceId: string;
5033
+ sessionId: string;
5034
+ sessionTitle: string | null;
5035
+ kind: InboxItemKind;
5036
+ /** The question or approval id, or the notification key. */
5037
+ sourceKey: string;
5038
+ title: string;
5039
+ /** A notification's subtitle; empty otherwise. */
5040
+ subtitle: string;
5041
+ /** Plain text, or for a notification its message (paragraphs, "- " bullets, **bold**, `code`, links). */
5042
+ body: string;
5043
+ /** A notification's label/value facts (at most four); empty otherwise. */
5044
+ facts: InboxItemFact[];
5045
+ /** A notification's link outside the session, or null. */
5046
+ link: InboxItemLink | null;
5047
+ /**
5048
+ * The session event that opened or last updated the item: open the session
5049
+ * at this point. Null for items from before this was recorded.
5050
+ */
5051
+ eventSequence: number | null;
5052
+ /** One-tap answers for a single short choice question; empty otherwise. */
5053
+ choices: InboxItemChoice[];
5054
+ urgency: "normal" | "time_sensitive";
5055
+ status: "open" | "resolved" | "withdrawn" | "dismissed";
5056
+ /** True while the person has not seen the item's current content. */
5057
+ unread: boolean;
5058
+ snoozedUntil: string | null;
5059
+ createdAt: string;
5060
+ updatedAt: string;
5061
+ resolvedAt: string | null;
5062
+ /** Another workspace member whose agent sent this notification; null for the person's own. */
5063
+ sender?: InboxItemSender | null;
5064
+ /**
5065
+ * Whether the person can open the session the item came from. False for
5066
+ * another member's private session: show no session link then.
5067
+ */
5068
+ sessionAvailable?: boolean;
5069
+ };
5070
+ /** The member an agent notified the person for. */
5071
+ export type InboxItemSender = {
5072
+ subjectId: string;
5073
+ label: string;
5074
+ };
5075
+ /** A short label and value an agent attached to a notification. */
5076
+ export type InboxItemFact = {
5077
+ label: string;
5078
+ value: string;
5079
+ };
5080
+ /** A place outside the session an agent's notification points to. */
5081
+ export type InboxItemLink = {
5082
+ url: string;
5083
+ label: string;
5084
+ };
5085
+ /** An option of the question behind an inbox item, answerable in one tap. */
5086
+ export type InboxItemChoice = {
5087
+ id: string;
5088
+ label: string;
5089
+ };
5090
+ export type ListInboxResponse = {
5091
+ items: InboxItem[];
5092
+ /** Open, unsnoozed items that need the person (questions, approvals, paused goals). */
5093
+ needsYouCount: number;
5094
+ /** Open, unsnoozed, unread items of any kind. */
5095
+ unreadCount: number;
5096
+ };
5097
+ /** The person's own attention on an item; answering happens in the session. */
5098
+ export type UpdateInboxItemInput = {
5099
+ seen?: true;
5100
+ /** ISO time to hide the item until, or null to unsnooze. */
5101
+ snoozedUntil?: string | null;
5102
+ dismissed?: true;
5103
+ };
5104
+ /**
5105
+ * What agents may do in the person's inbox: tidy notifications (from their own
5106
+ * sessions, or any agent's), or `full_access` to see every open item and
5107
+ * snooze or dismiss it. Agents never answer or approve for the person.
5108
+ */
5109
+ export type InboxTidyPolicy = "own_sessions" | "any_agent" | "full_access";
5110
+ export type InboxSettings = {
5111
+ tidyPolicy: InboxTidyPolicy;
5112
+ /**
5113
+ * Goals an agent paused in the person's own sessions reach the inbox. Off by
5114
+ * default. Always present in responses; leave it out of an update to keep it.
5115
+ */
5116
+ pausedGoals?: boolean;
5117
+ /**
5118
+ * Keep each session's latest reply in the inbox until the person clears it.
5119
+ * Off by default. Always present in responses; leave it out to keep it.
5120
+ */
5121
+ replies?: boolean;
5122
+ /**
5123
+ * Alert the phone for the agent's questions and approvals as time-sensitive,
5124
+ * so they break through Focus on iPhone. Off by default. Always present in
5125
+ * responses; leave it out to keep it.
5126
+ */
5127
+ timeSensitiveNeedsYou?: boolean;
5128
+ };
5129
+ /**
5130
+ * The signed-in person's mute on one session. Muted replies neither reach the
5131
+ * inbox nor alert the phone; the agent's notifications, questions and
5132
+ * approvals still do.
5133
+ */
5134
+ export type SessionInboxMute = {
5135
+ repliesMuted: boolean;
5136
+ };
5137
+ /**
5138
+ * Whether other members' agents may notify the signed-in person in one
5139
+ * workspace. Each person decides for themselves; off by default.
5140
+ */
5141
+ export type MemberNotificationsSetting = {
5142
+ allowOthers: boolean;
5143
+ };
5144
+ export type NativeAppPlatform = "ios" | "android" | "macos" | "windows" | "linux";
5145
+ export type NativeAppAuthorizeInput = {
5146
+ /** Exactly `<registered scheme>://auth/callback`. */
5147
+ redirectUri: string;
5148
+ /** Base64url SHA-256 of the app's code verifier. */
5149
+ codeChallenge: string;
5150
+ codeChallengeMethod: "S256";
5151
+ state?: string;
5152
+ platform: NativeAppPlatform;
5153
+ deviceName?: string;
5154
+ };
5155
+ export type NativeAppTokenInput = {
5156
+ code: string;
5157
+ codeVerifier: string;
5158
+ redirectUri: string;
5159
+ };
5160
+ export type NativeAppToken = {
5161
+ /** Sent as `Authorization: Bearer <accessToken>` (the client's `apiKey`). */
5162
+ accessToken: string;
5163
+ tokenType: "Bearer";
5164
+ expiresAt: string;
5165
+ };
5166
+ /**
5167
+ * What a signed-in app is pushed about, for sessions its person started:
5168
+ * `needs_input` (a question or an approval), `reply_ready` (a turn finished),
5169
+ * `failed` (a turn failed) and `agent` (the agent chose to notify).
5170
+ */
5171
+ export type NativePushRule = "needs_input" | "reply_ready" | "failed" | "agent";
5172
+ export type RegisterNativePushDeviceInput = {
5173
+ platform: NativeAppPlatform;
5174
+ /** The app's bundle identifier (iOS) or package name (Android). */
5175
+ appId: string;
5176
+ /** APNs environment of the build; FCM ignores it. */
5177
+ environment: "development" | "production";
5178
+ /** The APNs device token (hex) or FCM registration token. */
5179
+ token: string;
5180
+ rules: NativePushRule[];
5181
+ };
5182
+ /** This app credential's push registration. */
5183
+ export type NativePushDevice = {
5184
+ platform: NativeAppPlatform;
5185
+ appId: string;
5186
+ environment: "development" | "production";
5187
+ token: string;
5188
+ rules: NativePushRule[];
5189
+ updatedAt: string;
5190
+ };
5191
+ export type ListOrganizationSessionsOptions = {
5192
+ /** Page size, 1..200; the server default is 50. */
5193
+ limit?: number | undefined;
5194
+ /** `nextCursor` from the previous page. */
5195
+ cursor?: string | undefined;
5196
+ /** Keep only sessions labelled with this exact end user. */
5197
+ scopeSubjectId?: string | undefined;
5198
+ /** Keep only sessions in this exact lifecycle state. */
5199
+ status?: SessionStatus | undefined;
5200
+ signal?: AbortSignal | undefined;
5201
+ };
5202
+ /**
5203
+ * One page of `GET /v1/organizations/:organizationId/sessions`. Rows come from
5204
+ * every shared workspace the caller may read, each carrying its
5205
+ * `workspaceId`; personal workspaces are never included and private sessions
5206
+ * stay invisible. A page may be shorter than `limit` while `nextCursor` is
5207
+ * still set, so follow `nextCursor` until it is null.
5208
+ */
5209
+ export type OrganizationSessionListResponse = {
5210
+ sessions: Session[];
5211
+ nextCursor: string | null;
5212
+ };
5213
+ export type WorkspaceMember = {
5214
+ subjectId: string;
5215
+ subjectLabel: string | null;
5216
+ role: string;
5217
+ permissions: Permission[];
5218
+ createdAt: string;
5219
+ };
5220
+ export type ListWorkspaceMembersResponse = {
5221
+ members: WorkspaceMember[];
5222
+ };
5223
+ export type WorkspaceMemberCandidate = {
5224
+ organizationMembershipId: string;
5225
+ subjectId: string;
5226
+ name: string | null;
5227
+ email: string | null;
5228
+ organizationRole: "owner" | "admin" | "member";
5229
+ };
5230
+ export type ListWorkspaceMemberCandidatesResponse = {
5231
+ members: WorkspaceMemberCandidate[];
5232
+ };
5233
+ export type AddWorkspaceMemberRequest = {
5234
+ organizationMembershipId: string;
5235
+ role?: string | undefined;
5236
+ permissions: Permission[];
5237
+ };
5238
+ export type UpdateWorkspaceMemberRequest = {
5239
+ role?: string | undefined;
5240
+ permissions: Permission[];
3456
5241
  };
3457
5242
  export type SlackUserLinkAccessRequestStatus = "prepared" | "pending" | "completed" | "denied" | "cancelled" | "expired";
3458
5243
  /** Token-free durable projection of one signed Slack identity-link intent. */
@@ -3544,7 +5329,7 @@ export type SessionGoalContinuation = {
3544
5329
  observedRevision: number;
3545
5330
  nextAttemptAt: string | null;
3546
5331
  lastError: string | null;
3547
- /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
5332
+ /** Agent-stated reason for a `wait_for_input` hold; null otherwise. */
3548
5333
  holdReason?: string | null | undefined;
3549
5334
  };
3550
5335
  export type SessionGoal = {
@@ -3556,6 +5341,8 @@ export type SessionGoal = {
3556
5341
  text: string;
3557
5342
  successCriteria: string | null;
3558
5343
  rootConstraints: string[];
5344
+ /** Optional for older-server/source compatibility; current servers always supply this projection. */
5345
+ reportRequirements?: SessionGoalReportRequirement[] | undefined;
3559
5346
  evidence: string | null;
3560
5347
  rationale: string | null;
3561
5348
  pausedReason: string | null;
@@ -3586,10 +5373,6 @@ export type UpdateSessionGoalRequest = {
3586
5373
  export type UpdateSessionRequest = {
3587
5374
  title: string;
3588
5375
  };
3589
- /** Replace the complete ordered low-to-high precedence Variable Set selection. */
3590
- export type UpdateSessionVariableSetsRequest = {
3591
- variableSetIds: string[];
3592
- };
3593
5376
  /** Outcome of a manual /compact trigger. */
3594
5377
  export type CompactSessionContextResult = {
3595
5378
  /** pending waits for the current safe boundary; completed ran while idle. */
@@ -3662,16 +5445,17 @@ export type ComposerDraft = {
3662
5445
  updatedAt: string | null;
3663
5446
  };
3664
5447
  export type NewSessionDraftOptions = {
5448
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
5449
+ excludedMcpServerIds?: string[] | undefined;
3665
5450
  visibility?: SessionVisibility | undefined;
3666
5451
  sandboxBackend?: SandboxBackend | undefined;
3667
5452
  targetSandboxId?: string | undefined;
3668
5453
  workingDir?: string | undefined;
3669
- variableSetIds?: string[] | undefined;
3670
- variableSetId?: string | undefined;
3671
5454
  rigId?: string | undefined;
3672
5455
  goal?: GoalSpec | undefined;
3673
5456
  firstPartyMcpPermissions?: Permission[] | undefined;
3674
5457
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
5458
+ agent?: AgentConfigRequest | undefined;
3675
5459
  };
3676
5460
  export type NewSessionSelectionHistory = {
3677
5461
  /** Most-recently used project first. Null channelId is the Default project. */
@@ -3696,6 +5480,13 @@ export type NewSessionDraft = {
3696
5480
  model: string;
3697
5481
  reasoningEffort: ReasoningEffort;
3698
5482
  latencyMode: LatencyMode;
5483
+ /**
5484
+ * True when the person chose this model policy; false follows the resolved
5485
+ * default for new chats. Absent from older servers.
5486
+ */
5487
+ modelProvided?: boolean | undefined;
5488
+ /** Absent on legacy drafts; null records an explicit Default-project selection. */
5489
+ selectedProjectChannelId?: string | null | undefined;
3699
5490
  options: NewSessionDraftOptions;
3700
5491
  selectionHistory: NewSessionSelectionHistory;
3701
5492
  updatedAt: string | null;
@@ -3718,8 +5509,28 @@ export type SessionQueueSnapshot = {
3718
5509
  };
3719
5510
  export type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
3720
5511
  export type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
3721
- export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result" | "child_requires_action" | "child_requires_action_resolved" | "child_paused" | "child_waiting_capacity" | "child_progress";
5512
+ 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";
3722
5513
  export type SessionSystemUpdateState = "pending" | "delivered" | "cancelled" | "superseded" | "failed";
5514
+ export type SessionSystemUpdatePayload = {
5515
+ type: "session_wait_timeout";
5516
+ waitTurnId: string;
5517
+ deadlineAt: string;
5518
+ reason: string;
5519
+ [key: string]: unknown;
5520
+ } | {
5521
+ type: "background_command_result";
5522
+ commandId: string;
5523
+ state: "exited" | "lost";
5524
+ exitCode: number | null;
5525
+ reason: string;
5526
+ outputLocator: {
5527
+ eventType: "sandbox.command.output.delta";
5528
+ commandId: string;
5529
+ };
5530
+ [key: string]: unknown;
5531
+ } | ({
5532
+ type: Exclude<SessionSystemUpdateKind, "session_wait_timeout" | "background_command_result">;
5533
+ } & Record<string, unknown>);
3723
5534
  export type SessionSystemUpdate = {
3724
5535
  id: string;
3725
5536
  sessionId: string;
@@ -3728,7 +5539,7 @@ export type SessionSystemUpdate = {
3728
5539
  sourceId: string;
3729
5540
  dedupeKey: string;
3730
5541
  summary: string;
3731
- payload: Record<string, unknown>;
5542
+ payload: SessionSystemUpdatePayload;
3732
5543
  lineage: Record<string, unknown>;
3733
5544
  state: SessionSystemUpdateState;
3734
5545
  deliveredTurnId: string | null;
@@ -3736,6 +5547,56 @@ export type SessionSystemUpdate = {
3736
5547
  deliveredAt: string | null;
3737
5548
  createdAt: string;
3738
5549
  };
5550
+ export type SessionRetryRequest = {
5551
+ clientEventId: string;
5552
+ failureEventId: string;
5553
+ model?: string;
5554
+ reasoningEffort?: ReasoningEffort;
5555
+ latencyMode?: LatencyMode;
5556
+ };
5557
+ export type SandboxRecoverySelection = {
5558
+ version: 1;
5559
+ sessionId: string;
5560
+ sandboxGroupId: string;
5561
+ leaseId: string;
5562
+ routeEpoch: number;
5563
+ authorityEpoch: number;
5564
+ leaseEpoch: number;
5565
+ workspaceGeneration: number;
5566
+ archiveGeneration: number;
5567
+ artifactId: string;
5568
+ revision: string;
5569
+ capturedAt: string;
5570
+ };
5571
+ export type SandboxRecoveryProjection = {
5572
+ version: 1;
5573
+ status: "unsupported" | "blocked" | "eligible" | "consent_accepted" | "restoring" | "restored";
5574
+ reason: string | null;
5575
+ checkpoint: SandboxRecoverySelection | null;
5576
+ operationId: string | null;
5577
+ automaticAvailable?: boolean;
5578
+ /** What an automatic Retry does: restore `checkpoint`, or continue on a new
5579
+ * empty workspace because no usable checkpoint survived the sandbox loss. */
5580
+ automaticLane?: "checkpoint" | "fresh_workspace";
5581
+ /** For a timed recovery wait: the earliest time a Retry or a new message can
5582
+ * let Opengeni decide again. Nothing proceeds by itself before then. */
5583
+ availableAt?: string;
5584
+ };
5585
+ export type SandboxRecoveryRequest = {
5586
+ operationId: string;
5587
+ acceptHistoricalCheckpoint: true;
5588
+ selection: SandboxRecoverySelection;
5589
+ };
5590
+ export type SandboxRecoveryResponse = {
5591
+ outcome: "accepted" | "replayed";
5592
+ operationId: string;
5593
+ recovery: SandboxRecoveryProjection;
5594
+ };
5595
+ export type SessionRetryResponse = {
5596
+ outcome: "accepted" | "replayed";
5597
+ turnId: string;
5598
+ failureEventId: string;
5599
+ };
3739
5600
  export type SessionControlResponse = {
3740
5601
  receipt: SessionCommandReceipt;
3741
5602
  effectiveControl: EffectiveSessionControl;
@@ -3744,6 +5605,19 @@ export type SessionControlResponse = {
3744
5605
  cancelledSessionCount: number;
3745
5606
  cancelledTurnCount: number;
3746
5607
  };
5608
+ export type WorkspacePauseTimer = {
5609
+ id: string;
5610
+ action: "pause" | "resume";
5611
+ dueAt: string;
5612
+ pauseForSeconds: number | null;
5613
+ };
5614
+ export type WorkspacePauseTimerRequest = {
5615
+ action: "set" | "cancel";
5616
+ pauseInSeconds?: number | undefined;
5617
+ pauseForSeconds?: number | null | undefined;
5618
+ clientEventId: string;
5619
+ expectedRevision: number;
5620
+ };
3747
5621
  export type WorkspaceInferenceControlResponse = {
3748
5622
  receipt: SessionCommandReceipt;
3749
5623
  state: "active" | "paused";
@@ -3760,7 +5634,7 @@ export type WorkspaceControlEvent = {
3760
5634
  type: "workspace.control.changed";
3761
5635
  scope: "workspace" | "session";
3762
5636
  rootSessionId: string | null;
3763
- action: "pause" | "resume";
5637
+ action: "pause" | "resume" | "timer_set" | "timer_cancelled";
3764
5638
  automatic: boolean;
3765
5639
  reason: string | null;
3766
5640
  actor: string;
@@ -3817,7 +5691,7 @@ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expecte
3817
5691
  controlEtag?: string;
3818
5692
  modelContext?: string;
3819
5693
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
3820
- connectionAuthorities?: McpConnectionAuthoritySelection[];
5694
+ connectionAccounts?: McpConnectionAccountSelection[];
3821
5695
  personalResourceAttachment?: PersonalResourceAttachmentIntent;
3822
5696
  };
3823
5697
  export type SubmitComposerDraftResponse = {
@@ -3834,11 +5708,28 @@ export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "sel
3834
5708
  };
3835
5709
  /** Input shape for agent config on create/update (server applies defaults). */
3836
5710
  export type ScheduledTaskAgentConfigInput = {
5711
+ /**
5712
+ * Agent configuration frozen into the schedule and used by every run;
5713
+ * omitted runs follow the workspace's agent defaults.
5714
+ */
5715
+ agent?: AgentConfigRequest | undefined;
5716
+ knowledgeSource?: Extract<ScheduledTaskAction, {
5717
+ kind: "knowledge_source_sync";
5718
+ }> | undefined;
3837
5719
  prompt: string;
3838
5720
  resources?: ResourceRef[] | undefined;
5721
+ /**
5722
+ * Connectors added on top of the workspace defaults when `toolPolicy` is
5723
+ * set; otherwise the exact list. Omit both on a schedule that starts its
5724
+ * own session to follow the workspace defaults at each run.
5725
+ */
3839
5726
  tools?: ToolRef[] | undefined;
5727
+ /** Follow the workspace's default connectors at each run, except the excluded ones. */
5728
+ toolPolicy?: ScheduledTaskToolPolicy | undefined;
3840
5729
  metadata?: Record<string, unknown> | undefined;
3841
5730
  slackBotConnectionId?: string | undefined;
5731
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
5732
+ slackBotChannelId?: string | undefined;
3842
5733
  model?: string | undefined;
3843
5734
  reasoningEffort?: ReasoningEffort | undefined;
3844
5735
  sandboxBackend?: SandboxBackend | undefined;
@@ -3850,23 +5741,46 @@ export type ScheduledTaskAgentConfigInput = {
3850
5741
  executionClass?: "incident_telemetry" | undefined;
3851
5742
  incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
3852
5743
  maxNestedAgentDepth?: number | undefined;
5744
+ /**
5745
+ * Seconds a run's own turn may wait on a person (tool approval or structured
5746
+ * question, 60 s - 30 days) before the scheduler rejects the approval / skips
5747
+ * the question as a labelled system decision. Omitted: waits indefinitely.
5748
+ */
5749
+ approvalTimeoutSeconds?: number | undefined;
3853
5750
  };
3854
5751
  export type CreateAgentScheduledTaskRequest = {
5752
+ agentLearning?: {
5753
+ scope: "workspace" | "personal";
5754
+ settings: import("./knowledge.js").AgentLearningOverrides;
5755
+ };
3855
5756
  name: string;
3856
5757
  schedule: ScheduledTaskScheduleSpec;
5758
+ /** Who can see it. Omitted: everyone in the workspace. */
5759
+ visibility?: SessionVisibility | undefined;
3857
5760
  action?: {
3858
5761
  kind: "agent_turn";
3859
5762
  } | undefined;
3860
5763
  runMode?: ScheduledTaskRunMode | undefined;
3861
5764
  targetSessionId?: string | null | undefined;
3862
- connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
5765
+ /**
5766
+ * Connector accounts a person pins for a schedule that starts its own
5767
+ * session (never an existing-chat schedule, never an agent).
5768
+ */
5769
+ pinnedAccounts?: McpConnectionAccountSelection[] | undefined;
5770
+ /** Skip an occurrence instead of running without an unusable pinned account. */
5771
+ pinnedAccountsRequired?: boolean | undefined;
3863
5772
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3864
5773
  agentConfig: ScheduledTaskAgentConfigInput;
3865
5774
  status?: ScheduledTaskStatus | undefined;
3866
- variableSetId?: string | null | undefined;
3867
- /** @deprecated use variableSetId */
3868
- environmentId?: string | null | undefined;
5775
+ /**
5776
+ * Sandbox Environment each run binds to; its active version is resolved per
5777
+ * fire. Omit to resolve it once at create: the workspace default (none for a
5778
+ * Connected Machine task), or the target session's own environment for an
5779
+ * existing-session task. `null` means none.
5780
+ */
3869
5781
  rigId?: string | null | undefined;
5782
+ /** Vault narrowing for every run; omission adds none. */
5783
+ vaultPolicy?: VaultPolicy | undefined;
3870
5784
  metadata?: Record<string, unknown> | undefined;
3871
5785
  };
3872
5786
  export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
@@ -3879,21 +5793,49 @@ export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
3879
5793
  status?: ScheduledTaskStatus | undefined;
3880
5794
  metadata?: Record<string, unknown> | undefined;
3881
5795
  };
3882
- export type CreateScheduledTaskRequest = CreateAgentScheduledTaskRequest | CreateKnowledgeSourceSyncScheduledTaskRequest;
5796
+ /** Send a scheduled message using the destination chat’s current execution settings. */
5797
+ export type CreateSessionScheduledTaskRequest = {
5798
+ name: string;
5799
+ schedule: ScheduledTaskScheduleSpec;
5800
+ prompt: string;
5801
+ targetSessionId: string;
5802
+ /** A schedule posting into an Only me chat is always Only me. */
5803
+ visibility?: SessionVisibility | undefined;
5804
+ runMode?: "existing_session" | undefined;
5805
+ overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
5806
+ status?: ScheduledTaskStatus | undefined;
5807
+ metadata?: Record<string, unknown> | undefined;
5808
+ };
5809
+ export type CreateScheduledTaskRequest = CreateSessionScheduledTaskRequest | CreateAgentScheduledTaskRequest | CreateKnowledgeSourceSyncScheduledTaskRequest;
3883
5810
  export type UpdateScheduledTaskRequest = {
5811
+ expectedExecutionDigest?: string | undefined;
5812
+ adoptSessionSettings?: true | undefined;
5813
+ /** Lossless message edit. All omitted configuration is preserved. */
5814
+ prompt?: string | undefined;
3884
5815
  name?: string | undefined;
3885
5816
  schedule?: ScheduledTaskScheduleSpec | undefined;
3886
5817
  runMode?: ScheduledTaskRunMode | undefined;
3887
5818
  targetSessionId?: string | null | undefined;
3888
- connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
5819
+ /** Change who can see it. Only the owner can; a schedule posting into an Only me chat stays Only me. */
5820
+ visibility?: SessionVisibility | undefined;
5821
+ /** Replace the person-pinned accounts; `[]` unpins every connector. Omitted keeps the pins. */
5822
+ pinnedAccounts?: McpConnectionAccountSelection[] | undefined;
5823
+ /** Skip occurrences instead of running without an unusable pinned account. */
5824
+ pinnedAccountsRequired?: boolean | undefined;
3889
5825
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3890
5826
  action?: ScheduledTaskAction | undefined;
3891
5827
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
5828
+ /** Lossless model defaults patch; cannot be combined with agentConfig replacement.
5829
+ * Existing target/reusable sessions retain their own model and reasoning. */
5830
+ agentConfigPatch?: {
5831
+ prompt?: string | undefined;
5832
+ model?: string | undefined;
5833
+ reasoningEffort?: ReasoningEffort | undefined;
5834
+ } | undefined;
3892
5835
  status?: ScheduledTaskStatus | undefined;
3893
- variableSetId?: string | null | undefined;
3894
- /** @deprecated use variableSetId */
3895
- environmentId?: string | null | undefined;
3896
5836
  rigId?: string | null | undefined;
5837
+ /** Vault narrowing for every run. */
5838
+ vaultPolicy?: VaultPolicy | undefined;
3897
5839
  metadata?: Record<string, unknown> | undefined;
3898
5840
  };
3899
5841
  export type ScheduledTaskRunStatus = "queued" | "dispatched" | "succeeded" | "skipped" | "failed";
@@ -3939,75 +5881,83 @@ export type ScheduledTaskRun = {
3939
5881
  knowledgeSummary: KnowledgeSourceSyncRunSummary | null;
3940
5882
  completedAt: string | null;
3941
5883
  error: string | null;
5884
+ admissionDiagnostic?: {
5885
+ version: 1;
5886
+ reason: "selected_account_unavailable" | "owner_access_unavailable" | "ambiguous_account" | "parent_accounts_required" | "selection_unavailable";
5887
+ accounts: Array<{
5888
+ serverId: string;
5889
+ connectionId: string | null;
5890
+ reason: "connector_unavailable" | "account_not_visible" | "account_inactive" | "account_mismatch" | "selection_unavailable";
5891
+ }>;
5892
+ } | null | undefined;
5893
+ /**
5894
+ * Pinned connector accounts this run could not use. The run went ahead
5895
+ * without those connectors; no other account was used in their place.
5896
+ */
5897
+ degradedAccounts?: Array<{
5898
+ serverId: string;
5899
+ connectionId: string | null;
5900
+ reason: "connector_unavailable" | "account_not_visible" | "account_inactive" | "account_mismatch" | "selection_unavailable" | "owner_access_unavailable";
5901
+ }> | undefined;
5902
+ /**
5903
+ * Why the scheduler refused this occurrence before running it; `error`
5904
+ * equals `reason`. `retryable: true` (status `skipped`): a later occurrence
5905
+ * runs once the condition clears. `retryable: false` (status `failed`):
5906
+ * every occurrence is refused until the task or a resource it names changes.
5907
+ */
5908
+ admissionRefusal?: ScheduledTaskAdmissionRefusal | null | undefined;
5909
+ /**
5910
+ * This dispatched run's own turn is waiting on a person (tool approval or
5911
+ * structured question) since `since`; `expiresAt` is when the task's
5912
+ * `approvalTimeoutSeconds` answers for it (null: waits indefinitely).
5913
+ */
5914
+ awaitingHuman?: ScheduledTaskRunAwaitingHuman | null | undefined;
3942
5915
  createdAt: string;
3943
5916
  updatedAt: string;
5917
+ /** Connectors this run could not use; projected only for a viewer who can act on the task. */
5918
+ accessFailures?: ScheduledTaskRunAccessFailure[] | undefined;
3944
5919
  };
3945
- /** Generic variable-set reads expose name + version metadata only. */
3946
- export type VariableSetVariableMetadata = {
3947
- name: string;
3948
- version: number;
3949
- createdAt: string;
3950
- updatedAt: string;
3951
- };
3952
- /** Dedicated permissioned plaintext response; never embedded in metadata reads. */
3953
- export type VariableSetSecret = {
3954
- variableSetId: string;
3955
- name: string;
3956
- version: number;
3957
- value: string;
3958
- };
3959
- export type VariableSet = {
3960
- id: string;
3961
- accountId: string;
3962
- workspaceId: string;
3963
- scope: "organization" | "workspace" | "user";
3964
- generation: number;
3965
- status: "active" | "revoked";
3966
- name: string;
3967
- description: string | null;
3968
- variables: VariableSetVariableMetadata[];
3969
- createdAt: string;
3970
- updatedAt: string;
3971
- };
3972
- /** Exact-ID attachment metadata; intentionally excludes catalog and secret metadata. */
3973
- export type VariableSetAttachmentMetadata = {
3974
- id: string;
3975
- scope: "organization" | "workspace" | "user";
3976
- };
3977
- export type ResolveVariableSetAttachmentsRequest = {
3978
- variableSetIds: string[];
5920
+ export type ScheduledTaskRunAwaitingHuman = {
5921
+ since: string;
5922
+ expiresAt: string | null;
3979
5923
  };
3980
- export type ResolveVariableSetAttachmentsResponse = {
3981
- variableSets: VariableSetAttachmentMetadata[];
5924
+ export type ScheduledTaskAdmissionRefusal = {
5925
+ version: 1;
5926
+ reason: "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "scheduled_model_unavailable" | "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | (string & {});
5927
+ retryable: boolean;
3982
5928
  };
3983
- /** @deprecated use VariableSetVariableMetadata */
3984
- export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3985
- /** @deprecated use VariableSet */
3986
- export type WorkspaceEnvironment = VariableSet;
3987
- export type CreateVariableSetRequest = {
3988
- /** Omitted remains the legacy workspace-owned path. */
3989
- scope?: "organization" | "workspace" | "user" | undefined;
5929
+ export type ScheduledTaskAccessFailureReason = "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | "personal_authority_unavailable" | "unsupported_auth" | "resource_scope_unavailable" | "designated_credential_unavailable";
5930
+ /** A connector a scheduled run's own turn could not use (a `tool.auth_needed` fact). */
5931
+ export type ScheduledTaskRunAccessFailure = {
5932
+ serverId: string;
3990
5933
  name: string;
3991
- description?: string | undefined;
3992
- /** Initial variables. Values are write-only: they never come back on reads. */
3993
- variables?: {
3994
- name: string;
3995
- value: string;
3996
- }[] | undefined;
5934
+ providerDomain: string;
5935
+ reason: ScheduledTaskAccessFailureReason;
5936
+ count: number;
5937
+ firstOccurredAt: string;
3997
5938
  };
3998
- /** @deprecated use CreateVariableSetRequest */
3999
- export type CreateWorkspaceEnvironmentRequest = CreateVariableSetRequest;
4000
- export type UpdateVariableSetRequest = {
4001
- name?: string | undefined;
4002
- description?: string | null | undefined;
5939
+ /**
5940
+ * A schedule that needs its owner's attention: its latest run failed closed on
5941
+ * connector access (`runId`, `failures`), and/or a pinned connector account can
5942
+ * no longer be used (`unavailableAccounts`; runs continue without that
5943
+ * connector unless the schedule requires its pins; `runId` and `firedAt` are
5944
+ * null when only this applies).
5945
+ */
5946
+ export type ScheduledTaskAccessAttention = {
5947
+ taskId: string;
5948
+ taskName: string;
5949
+ /** The task head this item was computed against; a new head is a new notice. */
5950
+ executionDigest: string;
5951
+ runId: string | null;
5952
+ firedAt: string | null;
5953
+ failures: ScheduledTaskRunAccessFailure[];
5954
+ unavailableAccounts: ScheduledTaskAccessConnector[];
5955
+ /** The latest run is waiting on a person (tool approval or question) right now. */
5956
+ awaitingHuman?: ScheduledTaskRunAwaitingHuman | null | undefined;
4003
5957
  };
4004
- /** @deprecated use UpdateVariableSetRequest */
4005
- export type UpdateWorkspaceEnvironmentRequest = UpdateVariableSetRequest;
4006
- export type SetVariableSetVariableRequest = {
4007
- value: string;
5958
+ export type ListScheduledTaskAccessAttentionResponse = {
5959
+ tasks: ScheduledTaskAccessAttention[];
4008
5960
  };
4009
- /** @deprecated use SetVariableSetVariableRequest */
4010
- export type SetWorkspaceEnvironmentVariableRequest = SetVariableSetVariableRequest;
4011
5961
  export type RigCheck = {
4012
5962
  name: string;
4013
5963
  command: string;
@@ -4050,6 +6000,7 @@ export type RigVersion = {
4050
6000
  setupScript: string | null;
4051
6001
  checks: RigCheck[];
4052
6002
  credentialHooks: string[];
6003
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy data. */
4053
6004
  defaultVariableSetIds: string[];
4054
6005
  changelog: string | null;
4055
6006
  providerImages: Partial<Record<SandboxBackend, RigProviderImage>>;
@@ -4147,7 +6098,6 @@ export type CreateRigRequest = {
4147
6098
  setupScript?: string | undefined;
4148
6099
  checks?: RigCheck[] | undefined;
4149
6100
  credentialHooks?: string[] | undefined;
4150
- defaultVariableSetIds?: string[] | undefined;
4151
6101
  };
4152
6102
  export type UpdateRigRequest = {
4153
6103
  name?: string | undefined;
@@ -4162,7 +6112,6 @@ export type RigDefinitionEditPayload = {
4162
6112
  setupScript?: string | null | undefined;
4163
6113
  checks?: RigCheck[] | undefined;
4164
6114
  credentialHooks?: string[] | undefined;
4165
- defaultVariableSetIds?: string[] | undefined;
4166
6115
  changelog?: string | null | undefined;
4167
6116
  };
4168
6117
  export type ProposeRigChangeRequest = {
@@ -4173,7 +6122,17 @@ export type ProposeRigChangeRequest = {
4173
6122
  payload: RigDefinitionEditPayload;
4174
6123
  };
4175
6124
  export type FileStatus = "pending_upload" | "ready" | "failed" | "expired" | "deleted";
6125
+ export type FileListRequest = {
6126
+ scope?: "all" | "workspace" | "personal";
6127
+ limit?: number;
6128
+ cursor?: string;
6129
+ };
6130
+ export type FileListResponse = {
6131
+ files: FileAsset[];
6132
+ nextCursor: string | null;
6133
+ };
4176
6134
  export type FileAsset = {
6135
+ scope?: "workspace" | "personal" | undefined;
4177
6136
  id: string;
4178
6137
  workspaceId: string;
4179
6138
  status: FileStatus;
@@ -4193,7 +6152,7 @@ export declare const RETAINED_OUTPUT_MAX_PAGE_BYTES: number;
4193
6152
  export declare const COMPUTER_SCREENSHOT_MAX_BYTES: number;
4194
6153
  export declare const GENERATED_IMAGE_MAX_BYTES: number;
4195
6154
  export declare const GENERATED_VIDEO_MAX_BYTES: number;
4196
- export type RetainedOutputKind = "tool_result" | "assistant_completion" | "internal_update" | "event_media" | "computer_screenshot" | "generated_image" | "generated_video" | "file";
6155
+ export type RetainedOutputKind = "tool_result" | "assistant_completion" | "internal_update" | "event_media" | "computer_screenshot" | "browser_screenshot" | "generated_image" | "generated_video" | "file";
4197
6156
  export type RetainedOutputUnavailableReason = "not_retained" | "pending" | "failed" | "expired" | "deleted" | "missing_storage" | "storage_write_failed" | "quota_exceeded" | "invalid_content" | "oversized" | "unsupported";
4198
6157
  export type RetainedArtifactReference = {
4199
6158
  available: true;
@@ -4364,6 +6323,7 @@ export type RetainedArtifactDownload = {
4364
6323
  bytes: Uint8Array;
4365
6324
  };
4366
6325
  export type CreateFileUploadRequest = {
6326
+ scope?: "workspace" | "personal";
4367
6327
  filename: string;
4368
6328
  contentType: string;
4369
6329
  sizeBytes: number;
@@ -4389,6 +6349,7 @@ export type FileDownloadUrlResponse = {
4389
6349
  /** Bytes accepted by the `uploadFile` helper. */
4390
6350
  export type FileUploadData = Blob | ArrayBuffer | Uint8Array | string;
4391
6351
  export type UploadFileInput = {
6352
+ scope?: "workspace" | "personal";
4392
6353
  filename: string;
4393
6354
  contentType: string;
4394
6355
  data: FileUploadData;
@@ -4642,313 +6603,69 @@ export type KnowledgeMemory = {
4642
6603
  };
4643
6604
  export type CreateKnowledgeMemoryRequest = {
4644
6605
  status?: KnowledgeMemoryStatus | undefined;
4645
- kind?: KnowledgeMemoryKind | undefined;
4646
- scope?: string | undefined;
4647
- text: string;
4648
- sourceRefs?: KnowledgeSourceRef[] | undefined;
4649
- confidence?: number | undefined;
4650
- metadata?: Record<string, unknown> | undefined;
4651
- createdBySessionId?: string | undefined;
4652
- pinned?: boolean | undefined;
4653
- replacesId?: string | undefined;
4654
- };
4655
- export type UpdateKnowledgeMemoryRequest = {
4656
- status?: KnowledgeMemoryStatus | undefined;
4657
- kind?: KnowledgeMemoryKind | undefined;
4658
- scope?: string | undefined;
4659
- text?: string | undefined;
4660
- sourceRefs?: KnowledgeSourceRef[] | undefined;
4661
- confidence?: number | undefined;
4662
- metadata?: Record<string, unknown> | undefined;
4663
- reviewedBy?: string | undefined;
4664
- pinned?: boolean | undefined;
4665
- };
4666
- export type KnowledgeMemorySearchRequest = {
4667
- query?: string | undefined;
4668
- status?: KnowledgeMemoryStatus | undefined;
4669
- kind?: KnowledgeMemoryKind | undefined;
4670
- scope?: string | undefined;
4671
- limit?: number | undefined;
4672
- };
4673
- export type WorkspaceMemorySearchMode = "hybrid" | "vector" | "keyword";
4674
- export type WorkspaceMemorySearchRequest = {
4675
- query: string;
4676
- kind?: KnowledgeMemoryKind | undefined;
4677
- limit?: number | undefined;
4678
- mode?: WorkspaceMemorySearchMode | undefined;
4679
- };
4680
- export type WorkspaceMemorySearchResult = {
4681
- memory: KnowledgeMemory;
4682
- score: number;
4683
- matchType: WorkspaceMemorySearchMode;
4684
- vectorScore: number | null;
4685
- keywordScore: number | null;
4686
- };
4687
- export type WorkspaceMemorySearchResponse = {
4688
- results: WorkspaceMemorySearchResult[];
4689
- };
4690
- export type CapabilityPackConnectorAuthModel = "oauth2_authorization_code_pkce" | "oauth2_authorization_code" | "api_key" | "credential_ref";
4691
- export type CapabilityPackConnector = {
4692
- id: string;
4693
- name: string;
4694
- category: string;
4695
- authModel: CapabilityPackConnectorAuthModel;
4696
- providers: string[];
4697
- scopes: string[];
4698
- required: boolean;
4699
- metadata: Record<string, unknown>;
4700
- };
4701
- export type CapabilityPackKnowledge = {
4702
- type: "document_base";
4703
- id: string;
4704
- name: string;
4705
- description: string | null;
4706
- required: boolean;
4707
- };
4708
- export type CapabilityPackScheduledTaskTemplate = {
4709
- id: string;
4710
- name: string;
4711
- description: string;
4712
- defaultSchedule: ScheduledTaskScheduleSpec;
4713
- defaultRunMode: ScheduledTaskRunMode;
4714
- defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
4715
- prompt?: string | undefined;
4716
- };
4717
- export type CapabilityPackAutomationTemplate = {
4718
- id: string;
4719
- name: string;
4720
- description: string;
4721
- adapterId: string;
4722
- eventTypes: string[];
4723
- sessionTemplate: {
4724
- prompt: string;
4725
- instructions: string | null;
4726
- resources: ResourceRef[];
4727
- skills: CapabilityPackSkill[];
4728
- tools: ToolRef[];
4729
- firstPartyMcpTools: string[];
4730
- firstPartyMcpPermissions: Permission[];
4731
- model: string | null;
4732
- reasoningEffort: ReasoningEffort | null;
4733
- sandboxBackend: SandboxBackend | null;
4734
- policyRole: string | null;
4735
- metadata: Record<string, unknown>;
4736
- };
4737
- configuration: Record<string, unknown>;
4738
- connectionRequirement: string | null;
4739
- };
4740
- export type CapabilityPackSkillFile = {
4741
- path: string;
4742
- content: string;
4743
- };
4744
- export type CapabilityPackSkill = {
4745
- name: string;
4746
- description?: string | undefined;
4747
- files: CapabilityPackSkillFile[];
4748
- };
4749
- export type SessionSkill = CapabilityPackSkill;
4750
- export type CapabilityPackVariableSetSpec = {
4751
- description: string;
4752
- requiredVariables: string[];
4753
- required: boolean;
4754
- };
4755
- export type CapabilityPackComponentReference = {
4756
- key: string;
4757
- kind: "plugin";
4758
- pluginKey: string;
4759
- version: string;
4760
- manifestDigest: string;
4761
- required: boolean;
4762
- } | {
4763
- key: string;
4764
- kind: "skill";
4765
- capabilityId: string;
4766
- contentSha256: string;
4767
- required: boolean;
4768
- } | {
4769
- key: string;
4770
- kind: "integration";
4771
- capabilityId: string;
4772
- instanceKey: string;
4773
- revisionId: string;
4774
- contentSha256: string;
4775
- required: boolean;
4776
- } | {
4777
- key: string;
4778
- kind: "facet";
4779
- capabilityId: string;
4780
- instanceKey: string;
4781
- facetKey: string;
4782
- bindingKey: string;
4783
- configDigest: string;
4784
- required: boolean;
4785
- };
4786
- export type CapabilityPackRigRequirement = {
4787
- description?: string | undefined;
4788
- required: boolean;
4789
- rigId?: string | undefined;
4790
- requireVerified: boolean;
4791
- };
4792
- export type CapabilityPack = {
4793
- id: string;
4794
- name: string;
4795
- description: string;
4796
- role: string;
4797
- category: string;
4798
- version: string;
4799
- sandboxImage?: string | undefined;
4800
- sandboxProviderImages?: {
4801
- modal?: {
4802
- imageId: string;
4803
- } | undefined;
4804
- } | undefined;
4805
- skills: CapabilityPackSkill[];
4806
- components: CapabilityPackComponentReference[];
4807
- rig?: CapabilityPackRigRequirement | undefined;
4808
- tools: ToolRef[];
4809
- connectors: CapabilityPackConnector[];
4810
- knowledge: CapabilityPackKnowledge[];
4811
- scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
4812
- automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
4813
- variableSet?: CapabilityPackVariableSetSpec | undefined;
4814
- metadata: Record<string, unknown>;
4815
- };
4816
- /** Input shape for registering a pack manifest (server applies defaults). */
4817
- export type RegisterCapabilityPackRequest = {
4818
- id: string;
4819
- name: string;
4820
- description: string;
4821
- role: string;
4822
- category: string;
4823
- version: string;
4824
- sandboxImage?: string | undefined;
4825
- sandboxProviderImages?: {
4826
- modal?: {
4827
- imageId: string;
4828
- } | undefined;
4829
- } | undefined;
4830
- skills?: {
4831
- name: string;
4832
- description?: string | undefined;
4833
- files: CapabilityPackSkillFile[];
4834
- }[] | undefined;
4835
- components?: ({
4836
- key: string;
4837
- kind: "plugin";
4838
- pluginKey: string;
4839
- version: string;
4840
- manifestDigest: string;
4841
- required?: boolean | undefined;
4842
- } | {
4843
- key: string;
4844
- kind: "skill";
4845
- capabilityId: string;
4846
- contentSha256: string;
4847
- required?: boolean | undefined;
4848
- } | {
4849
- key: string;
4850
- kind: "integration";
4851
- capabilityId: string;
4852
- instanceKey: string;
4853
- revisionId: string;
4854
- contentSha256: string;
4855
- required?: boolean | undefined;
4856
- } | {
4857
- key: string;
4858
- kind: "facet";
4859
- capabilityId: string;
4860
- instanceKey: string;
4861
- facetKey: string;
4862
- bindingKey: string;
4863
- configDigest: string;
4864
- required?: boolean | undefined;
4865
- })[] | undefined;
4866
- rig?: {
4867
- description?: string | undefined;
4868
- required?: boolean | undefined;
4869
- rigId?: string | undefined;
4870
- requireVerified?: boolean | undefined;
4871
- } | undefined;
4872
- tools?: ToolRef[] | undefined;
4873
- connectors?: {
4874
- id: string;
4875
- name: string;
4876
- category: string;
4877
- authModel: CapabilityPackConnectorAuthModel;
4878
- providers?: string[] | undefined;
4879
- scopes?: string[] | undefined;
4880
- required?: boolean | undefined;
4881
- metadata?: Record<string, unknown> | undefined;
4882
- }[] | undefined;
4883
- knowledge?: {
4884
- type: "document_base";
4885
- id: string;
4886
- name: string;
4887
- description?: string | null | undefined;
4888
- required?: boolean | undefined;
4889
- }[] | undefined;
4890
- scheduledTaskTemplates?: {
4891
- id: string;
4892
- name: string;
4893
- description: string;
4894
- defaultSchedule: ScheduledTaskScheduleSpec;
4895
- defaultRunMode?: ScheduledTaskRunMode | undefined;
4896
- defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
4897
- prompt?: string | undefined;
4898
- }[] | undefined;
4899
- automationTemplates?: {
4900
- id: string;
4901
- name: string;
4902
- description: string;
4903
- adapterId: string;
4904
- eventTypes: string[];
4905
- sessionTemplate: {
4906
- prompt: string;
4907
- instructions?: string | null | undefined;
4908
- resources?: ResourceRef[] | undefined;
4909
- skills?: CapabilityPackSkill[] | undefined;
4910
- tools?: ToolRef[] | undefined;
4911
- firstPartyMcpTools?: string[] | undefined;
4912
- firstPartyMcpPermissions?: Permission[] | undefined;
4913
- model?: string | null | undefined;
4914
- reasoningEffort?: ReasoningEffort | null | undefined;
4915
- sandboxBackend?: SandboxBackend | null | undefined;
4916
- policyRole?: string | null | undefined;
4917
- metadata?: Record<string, unknown> | undefined;
4918
- };
4919
- configuration?: Record<string, unknown> | undefined;
4920
- connectionRequirement?: string | null | undefined;
4921
- }[] | undefined;
4922
- variableSet?: {
4923
- description: string;
4924
- requiredVariables?: string[] | undefined;
4925
- required?: boolean | undefined;
4926
- } | undefined;
6606
+ kind?: KnowledgeMemoryKind | undefined;
6607
+ scope?: string | undefined;
6608
+ text: string;
6609
+ sourceRefs?: KnowledgeSourceRef[] | undefined;
6610
+ confidence?: number | undefined;
4927
6611
  metadata?: Record<string, unknown> | undefined;
6612
+ createdBySessionId?: string | undefined;
6613
+ pinned?: boolean | undefined;
6614
+ replacesId?: string | undefined;
4928
6615
  };
4929
- export type WorkspaceRegisteredPack = {
4930
- accountId: string;
4931
- workspaceId: string;
4932
- pack: CapabilityPack;
4933
- createdAt: string;
4934
- updatedAt: string;
6616
+ export type UpdateKnowledgeMemoryRequest = {
6617
+ status?: KnowledgeMemoryStatus | undefined;
6618
+ kind?: KnowledgeMemoryKind | undefined;
6619
+ scope?: string | undefined;
6620
+ text?: string | undefined;
6621
+ sourceRefs?: KnowledgeSourceRef[] | undefined;
6622
+ confidence?: number | undefined;
6623
+ metadata?: Record<string, unknown> | undefined;
6624
+ reviewedBy?: string | undefined;
6625
+ pinned?: boolean | undefined;
4935
6626
  };
4936
- export type PackInstallationStatus = "installing" | "active" | "needs_attention" | "disabled";
4937
- export type PackInstallation = {
4938
- id: string;
4939
- accountId: string;
4940
- workspaceId: string;
4941
- packId: string;
4942
- status: PackInstallationStatus;
4943
- version: number;
4944
- manifestSnapshot: CapabilityPack | null;
4945
- manifestDigest: string | null;
4946
- selectedRigId: string | null;
4947
- installedBySubjectId: string | null;
4948
- metadata: Record<string, unknown>;
4949
- enabledAt: string;
4950
- updatedAt: string;
6627
+ export type KnowledgeMemorySearchRequest = {
6628
+ query?: string | undefined;
6629
+ status?: KnowledgeMemoryStatus | undefined;
6630
+ kind?: KnowledgeMemoryKind | undefined;
6631
+ scope?: string | undefined;
6632
+ limit?: number | undefined;
6633
+ };
6634
+ export type WorkspaceMemorySearchMode = "hybrid" | "vector" | "keyword";
6635
+ export type WorkspaceMemorySearchRequest = {
6636
+ query: string;
6637
+ kind?: KnowledgeMemoryKind | undefined;
6638
+ limit?: number | undefined;
6639
+ mode?: WorkspaceMemorySearchMode | undefined;
6640
+ };
6641
+ export type WorkspaceMemorySearchResult = {
6642
+ memory: KnowledgeMemory;
6643
+ score: number;
6644
+ matchType: WorkspaceMemorySearchMode;
6645
+ vectorScore: number | null;
6646
+ keywordScore: number | null;
6647
+ };
6648
+ export type WorkspaceMemorySearchResponse = {
6649
+ results: WorkspaceMemorySearchResult[];
6650
+ };
6651
+ export type SkillArtifactFile = {
6652
+ path: string;
6653
+ content: string;
6654
+ };
6655
+ export type SkillArtifactDefinition = {
6656
+ name: string;
6657
+ description?: string | undefined;
6658
+ /** Omitted means workspace-wide; session_selected requires explicit session attachment. */
6659
+ activationMode?: "workspace_managed" | "session_selected" | undefined;
6660
+ files: SkillArtifactFile[];
6661
+ };
6662
+ export type SessionSkill = Omit<SkillArtifactDefinition, "activationMode">;
6663
+ /** SKILL.md owns metadata; supplied legacy fields must exactly match it. */
6664
+ export type SkillArtifactDefinitionInput = Omit<SkillArtifactDefinition, "name" | "description"> & {
6665
+ name?: string | undefined;
6666
+ description?: string | undefined;
4951
6667
  };
6668
+ export type SessionSkillInput = Omit<SkillArtifactDefinitionInput, "activationMode">;
4952
6669
  export type PrReviewProvider = GitCredentialProvider;
4953
6670
  export type PrReviewCredentialKind = "github_app" | "managed_github_app" | "provider_token";
4954
6671
  export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
@@ -5046,93 +6763,12 @@ export type PrReviewManagedGitHubInstallation = {
5046
6763
  export type PrReviewManagedGitHubSetup = {
5047
6764
  configured: boolean;
5048
6765
  status: "unavailable" | "not_connected" | "connected";
5049
- appName: "OpenGeni Lens";
6766
+ appName: "Opengeni Lens" | "OpenGeni Lens";
5050
6767
  connectUrl: string | null;
5051
6768
  installations: PrReviewManagedGitHubInstallation[];
5052
6769
  missing: string[];
5053
6770
  };
5054
- export type EnablePackRequest = {
5055
- variableSetId?: string | undefined;
5056
- /** @deprecated use variableSetId */
5057
- environmentId?: string | undefined;
5058
- metadata?: Record<string, unknown> | undefined;
5059
- };
5060
- export type PackComponentResolutionStatus = "ready" | "missing" | "mismatch";
5061
- export type PackComponentResolution = {
5062
- key: string;
5063
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
5064
- capabilityId: string;
5065
- required: boolean;
5066
- status: PackComponentResolutionStatus;
5067
- expectedDigest: string;
5068
- actualDigest: string | null;
5069
- resolvedId: string | null;
5070
- label: string;
5071
- };
5072
- export type PackRigResolution = {
5073
- required: boolean;
5074
- status: "not_required" | "ready" | "missing" | "mismatch" | "unverified";
5075
- requestedRigId: string | null;
5076
- rigId: string | null;
5077
- rigVersionId: string | null;
5078
- name: string | null;
5079
- image: string | null;
5080
- };
5081
- export type PreviewPackInstallationRequest = {
5082
- rigId?: string | undefined;
5083
- variableSetId?: string | undefined;
5084
- };
5085
- export type PackInstallationPreview = {
5086
- packId: string;
5087
- packVersion: string;
5088
- manifestDigest: string;
5089
- installationVersion: number | null;
5090
- action: "install" | "update" | "repair";
5091
- ready: boolean;
5092
- blockers: string[];
5093
- components: PackComponentResolution[];
5094
- rig: PackRigResolution;
5095
- variableSetId: string | null;
5096
- legacyInlineSkillCount: number;
5097
- legacySandboxImage: string | null;
5098
- };
5099
- export type InstallPackRequest = {
5100
- expectedManifestDigest: string;
5101
- expectedInstallationVersion?: number | undefined;
5102
- rigId?: string | undefined;
5103
- variableSetId?: string | undefined;
5104
- idempotencyKey: string;
5105
- metadata?: Record<string, unknown> | undefined;
5106
- };
5107
- export type PackUninstallPreview = {
5108
- packId: string;
5109
- installed: boolean;
5110
- installationVersion: number | null;
5111
- components: Array<{
5112
- key: string;
5113
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
5114
- capabilityId: string;
5115
- retainedByOtherOwners: boolean;
5116
- }>;
5117
- };
5118
- export type UninstallPackRequest = {
5119
- expectedInstallationVersion: number;
5120
- idempotencyKey: string;
5121
- };
5122
- export type UninstallPackResult = {
5123
- packId: string;
5124
- status: "not_installed" | "uninstalled";
5125
- retainedComponents: string[];
5126
- };
5127
- export type ListPacksResponse = {
5128
- packs: CapabilityPack[];
5129
- installations: PackInstallation[];
5130
- };
5131
- export type GetPackResponse = {
5132
- pack: CapabilityPack;
5133
- installation: PackInstallation | null;
5134
- };
5135
- export type CapabilityKind = "pack" | "mcp" | "api" | "skill" | "plugin";
6771
+ export type CapabilityKind = "mcp" | "api" | "skill" | "plugin";
5136
6772
  export type CapabilitySource = "built_in" | "library" | "configured" | "public_registry" | "registry" | "manual";
5137
6773
  export type CapabilityInstallationStatus = "active" | "disabled";
5138
6774
  export type CapabilityCatalogAuthKind = "oauth2" | "api_key" | "none" | "unknown";
@@ -5156,6 +6792,14 @@ export type CapabilityRuntime = {
5156
6792
  state: "trusted" | "legacy_active" | "unverified";
5157
6793
  reason: "trusted_source" | "verified_probe" | "active_installation_compatibility" | "missing_verification";
5158
6794
  } | undefined;
6795
+ /**
6796
+ * Present when connecting needs an operator-registered OAuth client because
6797
+ * the provider refuses self-registration; `configured` is whether this
6798
+ * deployment has one. Connector surfaces offer the row only when true.
6799
+ */
6800
+ operatorOAuthClient?: {
6801
+ configured: boolean;
6802
+ } | undefined;
5159
6803
  };
5160
6804
  export type CapabilityCatalogItem = {
5161
6805
  id: string;
@@ -5194,6 +6838,8 @@ export type CapabilityCatalogItem = {
5194
6838
  /** The connection backing this enabled installation, or null when none is involved. */
5195
6839
  connectionRef: {
5196
6840
  connectionId?: string | undefined;
6841
+ accountSelection?: "all_eligible" | undefined;
6842
+ authoritySource?: "host" | undefined;
5197
6843
  providerDomain: string;
5198
6844
  kind: string;
5199
6845
  subjectScope?: "subject" | "workspace" | undefined;
@@ -5233,6 +6879,7 @@ export type CreateCapabilityCatalogItemRequest = {
5233
6879
  metadata?: Record<string, unknown> | undefined;
5234
6880
  };
5235
6881
  export type EnableCapabilityRequest = {
6882
+ onlyIfUninstalled?: boolean | undefined;
5236
6883
  config?: Record<string, unknown> | undefined;
5237
6884
  metadata?: Record<string, unknown> | undefined;
5238
6885
  connectionRef?: McpServerConnectionRef | undefined;
@@ -5249,7 +6896,7 @@ export type DiscoverMcpCapabilitiesResponse = {
5249
6896
  sourceUrl: string;
5250
6897
  };
5251
6898
  export type SkillImportSource = "github" | "skills_sh";
5252
- export type SkillInstallationSource = "library" | "github" | "skills_sh" | "pack";
6899
+ export type SkillInstallationSource = "library" | "github" | "skills_sh";
5253
6900
  export type PreviewSkillImportRequest = {
5254
6901
  url: string;
5255
6902
  };
@@ -5259,6 +6906,7 @@ export type SkillImportFileSummary = {
5259
6906
  contentSha256: string;
5260
6907
  };
5261
6908
  export type SkillImportPreview = {
6909
+ markdown?: string;
5262
6910
  source: SkillImportSource;
5263
6911
  sourceUrl: string;
5264
6912
  repositoryUrl: string;
@@ -5287,6 +6935,7 @@ export type InstallLibrarySkillRequest = {
5287
6935
  expectedInstallationVersion?: number | undefined;
5288
6936
  };
5289
6937
  export type InstalledSkill = {
6938
+ skillReceipt?: import("./skills.js").SkillWriteReceipt | undefined;
5290
6939
  capabilityId: string;
5291
6940
  pluginId: string;
5292
6941
  pluginVersionId: string;
@@ -5303,7 +6952,7 @@ export type InstalledSkill = {
5303
6952
  status: "installed";
5304
6953
  };
5305
6954
  export type CapabilityComponentOwner = {
5306
- kind: "direct" | "plugin" | "pack" | "migration";
6955
+ kind: "direct" | "plugin" | "migration";
5307
6956
  id: string;
5308
6957
  removable: boolean;
5309
6958
  };
@@ -5345,6 +6994,7 @@ export type UninstallSkillRequest = {
5345
6994
  expectedInstallationVersion: number;
5346
6995
  };
5347
6996
  export type UninstallSkillResult = {
6997
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
5348
6998
  capabilityId: string;
5349
6999
  status: "not_installed" | "uninstalled" | "retained_by_other_owners";
5350
7000
  remainingOwners: CapabilityComponentOwner[];
@@ -5466,8 +7116,31 @@ export type IntegrationSource = {
5466
7116
  url: string;
5467
7117
  baseUrl?: string | undefined;
5468
7118
  };
7119
+ /**
7120
+ * OpenAPI 3.x text (JSON or YAML, at most 8 MiB) sent in the request instead
7121
+ * of a URL. `sourceKey` is your stable identity for the Integration: reuse it
7122
+ * to update the same installation. Server URLs must be absolute or `baseUrl`
7123
+ * given. Calls still obey the deployment network policy, so an API on
7124
+ * localhost or a private address needs a public tunnel unless the operator
7125
+ * enables private targets. Send the same document again on install.
7126
+ */
7127
+ export type InlineOpenApiDocumentSource = {
7128
+ kind: "openapi_document";
7129
+ sourceKey: string;
7130
+ document: string;
7131
+ baseUrl?: string | undefined;
7132
+ };
7133
+ /** Preview/install input sources. */
7134
+ export type IntegrationSourceInput = IntegrationSource | InlineOpenApiDocumentSource;
7135
+ /** Preview echo: an inline document is reported by digest, never its text. */
7136
+ export type IntegrationSourceProjection = IntegrationSource | {
7137
+ kind: "openapi_document";
7138
+ sourceKey: string;
7139
+ documentSha256: string;
7140
+ baseUrl?: string | undefined;
7141
+ };
5469
7142
  export type PreviewApiIntegrationRequest = {
5470
- source: IntegrationSource;
7143
+ source: IntegrationSourceInput;
5471
7144
  connectionId?: string | undefined;
5472
7145
  ownership?: ConnectionOwnership | undefined;
5473
7146
  };
@@ -5503,7 +7176,7 @@ export type ApiIntegrationToolPreview = {
5503
7176
  deprecated: boolean;
5504
7177
  };
5505
7178
  export type ApiIntegrationPreview = {
5506
- source: IntegrationSource;
7179
+ source: IntegrationSourceProjection;
5507
7180
  definitionId: string;
5508
7181
  definitionProvenance: IntegrationDefinitionProvenance;
5509
7182
  protocol: ApiIntegrationProtocol;
@@ -5525,7 +7198,7 @@ export type ApiIntegrationPreview = {
5525
7198
  warnings: string[];
5526
7199
  };
5527
7200
  export type InstallApiIntegrationRequest = {
5528
- source: IntegrationSource;
7201
+ source: IntegrationSourceInput;
5529
7202
  expectedRevisionId: string;
5530
7203
  expectedContentSha256: string;
5531
7204
  connectionId?: string | undefined;
@@ -5534,6 +7207,14 @@ export type InstallApiIntegrationRequest = {
5534
7207
  displayName?: string | undefined;
5535
7208
  expectedInstanceVersion?: number | undefined;
5536
7209
  allowedTools?: string[] | undefined;
7210
+ /**
7211
+ * Selected tools whose preview `approvalMode` is `"ask"` that should run
7212
+ * without per-call human approval (for example in scheduled or other
7213
+ * unattended sessions). Needs `capabilities:manage`; a curated definition
7214
+ * may forbid exempting specific operations (422). Declarative: omit it and every write tool asks
7215
+ * again. Connector Block and session approval policies still apply.
7216
+ */
7217
+ autoApprovedTools?: string[] | undefined;
5537
7218
  };
5538
7219
  export type InstalledApiIntegration = {
5539
7220
  capabilityId: string;
@@ -5679,6 +7360,9 @@ export type InstallPluginRequest = {
5679
7360
  expectedInstallationVersion?: number | undefined;
5680
7361
  };
5681
7362
  export type InstalledPlugin = {
7363
+ skillPublications?: import("./skills.js").SkillPublicationReceipt[] | undefined;
7364
+ skillWrites?: import("./skills.js").SkillWriteReceipt[] | undefined;
7365
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
5682
7366
  pluginKey: string;
5683
7367
  version: string;
5684
7368
  pluginId: string;
@@ -5695,6 +7379,7 @@ export type PluginInstallationSummary = {
5695
7379
  description: string;
5696
7380
  category: string;
5697
7381
  tags: string[];
7382
+ logoUrl?: string | null | undefined;
5698
7383
  sourceUrl: string | null;
5699
7384
  manifestDigest: string;
5700
7385
  installationVersion: number;
@@ -5706,22 +7391,34 @@ export type PluginInstallationSummary = {
5706
7391
  export type ListInstalledPluginsResponse = {
5707
7392
  plugins: PluginInstallationSummary[];
5708
7393
  };
7394
+ export type PluginUninstallComponentImpact = {
7395
+ capabilityId: string;
7396
+ kind: "skill" | "integration" | "mcp";
7397
+ retainedByOtherOwners: boolean;
7398
+ name: string;
7399
+ disposition: "removed" | "retained" | "inactive";
7400
+ retentionReasons: Array<"other_owners" | "customized" | "re_scoped" | "registry_unavailable">;
7401
+ remainingOwners: Array<{
7402
+ kind: "direct" | "plugin" | "migration";
7403
+ name: string;
7404
+ }>;
7405
+ skillId?: string | undefined;
7406
+ };
5709
7407
  export type PluginUninstallPreview = {
5710
7408
  pluginKey: string;
5711
7409
  installed: boolean;
5712
7410
  version: string | null;
5713
7411
  installationVersion: number | null;
5714
- components: Array<{
5715
- capabilityId: string;
5716
- kind: "skill" | "integration" | "mcp";
5717
- retainedByOtherOwners: boolean;
5718
- }>;
7412
+ previewToken?: string | undefined;
7413
+ components: PluginUninstallComponentImpact[];
5719
7414
  };
5720
7415
  export type UninstallPluginRequest = {
5721
7416
  expectedInstallationVersion: number;
7417
+ expectedPreviewToken?: string | undefined;
5722
7418
  idempotencyKey: string;
5723
7419
  };
5724
7420
  export type UninstallPluginResult = {
7421
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
5725
7422
  pluginKey: string;
5726
7423
  status: "not_installed" | "uninstalled";
5727
7424
  retainedComponents: string[];
@@ -5737,6 +7434,10 @@ export type GitHubRepository = {
5737
7434
  defaultBranch: string;
5738
7435
  accountLogin: string;
5739
7436
  accountType: string | null;
7437
+ /** GitHub's archived flag, when the provider reported it. */
7438
+ archived?: boolean | undefined;
7439
+ /** GitHub's reported size in kilobytes, when reported. Zero means empty. */
7440
+ sizeKb?: number | undefined;
5740
7441
  };
5741
7442
  export type GitHubRepositoryScope = "all" | "selected";
5742
7443
  export type GitHubBindingStatus = "disabled" | "unbound" | "bound";
@@ -5750,7 +7451,7 @@ export type GitHubInstallationBinding = {
5750
7451
  lifecycle: GitHubInstallationLifecycle;
5751
7452
  repositoryScope: GitHubRepositoryScope;
5752
7453
  repositoryCount: number;
5753
- /** OpenGeni-owned entry point for changing the installation's repository allowlist. */
7454
+ /** Opengeni-owned entry point for changing the installation's repository allowlist. */
5754
7455
  configureUrl: string | null;
5755
7456
  createdAt: string;
5756
7457
  updatedAt: string;
@@ -5776,6 +7477,55 @@ export type GitHubAppInfo = {
5776
7477
  export type GitHubRepositoriesResponse = {
5777
7478
  repositories: GitHubRepository[];
5778
7479
  };
7480
+ export type GitHubActionPolicyDecision = "allow" | "ask" | "block";
7481
+ export type GitHubActionPolicyEffectiveDecision = GitHubActionPolicyDecision | "mixed";
7482
+ export type GitHubActionPolicyGroup = "routine" | "review" | "merge";
7483
+ export type GitHubActionPolicyActor = {
7484
+ kind: "workspace_app";
7485
+ installationId: number;
7486
+ } | {
7487
+ kind: "personal";
7488
+ connectionId: string;
7489
+ };
7490
+ export type GitHubActionPolicyActorState = GitHubActionPolicyActor & {
7491
+ label: string;
7492
+ groups: Record<GitHubActionPolicyGroup, GitHubActionPolicyEffectiveDecision>;
7493
+ };
7494
+ export type GitHubActionPoliciesResponse = {
7495
+ enabled: boolean;
7496
+ actors: GitHubActionPolicyActorState[];
7497
+ };
7498
+ export type UpdateGitHubActionPolicyRequest = {
7499
+ actor: GitHubActionPolicyActor;
7500
+ group: GitHubActionPolicyGroup;
7501
+ decision: GitHubActionPolicyDecision;
7502
+ };
7503
+ export type VerifyPublicGitHubRepositoryRefRequest = {
7504
+ url: string;
7505
+ ref: string;
7506
+ };
7507
+ export type VerifyPublicGitHubRepositoryRefResponse = {
7508
+ owner: string;
7509
+ name: string;
7510
+ fullName: string;
7511
+ canonicalUrl: string;
7512
+ cloneUrl: string;
7513
+ defaultBranch: string;
7514
+ ref: string;
7515
+ commitSha: string;
7516
+ };
7517
+ export type GitHubRepositoryBranch = {
7518
+ name: string;
7519
+ isDefault: boolean;
7520
+ };
7521
+ export type ListGitHubRepositoryBranchesOptions = {
7522
+ cursor?: number | undefined;
7523
+ limit?: number | undefined;
7524
+ };
7525
+ export type GitHubRepositoryBranchesResponse = {
7526
+ branches: GitHubRepositoryBranch[];
7527
+ nextCursor: number | null;
7528
+ };
5779
7529
  export type CreateGitHubAppManifestRequest = {
5780
7530
  appName?: string | undefined;
5781
7531
  organization?: string | undefined;
@@ -5790,11 +7540,26 @@ export type CreateGitHubAppManifestResponse = {
5790
7540
  };
5791
7541
  export type BillingMode = "disabled" | "stripe";
5792
7542
  export type EntitlementsMode = "none" | "static" | "managed";
7543
+ export type PromotionalCreditScope = {
7544
+ label: string;
7545
+ eligibleModelIds: string[];
7546
+ };
7547
+ export type PromotionalCreditBalance = PromotionalCreditScope & {
7548
+ grantId: string;
7549
+ remainingMicros: number;
7550
+ /** Also pays for dictation and live voice, like general credits (signup credits). */
7551
+ coversVoice?: boolean | undefined;
7552
+ };
7553
+ export type { BillingPlanBalance, SubscriptionPlan, SubscriptionPlanCatalog, BillingSubscriptionCatalog, CreateSubscriptionCheckoutRequest, CreateSubscriptionCheckoutResponse, ChangeBillingSubscriptionRequest, CancelBillingSubscriptionRequest, BillingSubscriptionChange, } from "@opengeni/contracts";
7554
+ import type { BillingPlanBalance } from "@opengeni/contracts";
5793
7555
  export type BillingBalance = {
5794
7556
  accountId: string;
5795
7557
  balanceMicros: number;
5796
7558
  currency: "usd";
5797
7559
  updatedAt: string;
7560
+ generalBalanceMicros?: number | undefined;
7561
+ promotionalCredits?: PromotionalCreditBalance[] | undefined;
7562
+ plan?: BillingPlanBalance | null | undefined;
5798
7563
  };
5799
7564
  export declare const KNOWN_USAGE_EVENT_TYPES: readonly ["agent_run.created", "agent_run.completed", "model.tokens", "model.cost", "file.uploaded", "file.deleted", "document.indexed", "scheduled_task.fired", "knowledge_source_sync.fired", "knowledge_source_sync.completed", "knowledge_source_sync.items", "knowledge_source_sync.bytes", "api_key.request", "sandbox.warm_seconds", "sandbox.warm_cost"];
5800
7565
  export type KnownUsageEventType = (typeof KNOWN_USAGE_EVENT_TYPES)[number];
@@ -5846,12 +7611,16 @@ export type InsightsModelUsageRow = {
5846
7611
  creditUsd: number;
5847
7612
  estimatedProviderUsd: number;
5848
7613
  estimatedProviderCostKnownCalls: number;
7614
+ equivalentCreditUsd: number;
7615
+ equivalentCreditCostKnownCalls: number;
5849
7616
  };
5850
7617
  export type InsightsSeriesPoint = {
5851
7618
  label: string;
5852
7619
  modelCostUsd: number;
5853
7620
  estimatedProviderUsd: number;
5854
7621
  estimatedProviderCostKnownCalls: number;
7622
+ equivalentCreditUsd: number;
7623
+ equivalentCreditCostKnownCalls: number;
5855
7624
  warmSeconds: number;
5856
7625
  inputTokens: number;
5857
7626
  outputTokens: number;
@@ -5865,6 +7634,10 @@ export type InsightsSeriesPoint = {
5865
7634
  cacheHitPct: number;
5866
7635
  calls: number;
5867
7636
  };
7637
+ export type InsightsScope = {
7638
+ rootSessionId: string | null;
7639
+ sessionId: string | null;
7640
+ };
5868
7641
  export type InsightsDepthBucket = {
5869
7642
  depth: number;
5870
7643
  sessions: number;
@@ -5880,12 +7653,27 @@ export type InsightsSpendDriver = {
5880
7653
  creditUsd: number;
5881
7654
  estimatedProviderUsd: number;
5882
7655
  estimatedProviderCostKnownCalls: number;
7656
+ equivalentCreditUsd: number;
7657
+ equivalentCreditCostKnownCalls: number;
5883
7658
  tokens: number;
5884
7659
  cacheHitPct: number;
5885
7660
  pctOfCreditUsd: number;
5886
7661
  pctOfTokens: number;
5887
7662
  deltaUsdVsPrior: number;
5888
7663
  };
7664
+ export type InsightsProjectRow = {
7665
+ id: string;
7666
+ kind: "project" | "other" | "unfiled" | "unavailable" | "deleted";
7667
+ label: string;
7668
+ projects: number;
7669
+ rootSessions: number;
7670
+ calls: number;
7671
+ creditUsd: number;
7672
+ estimatedProviderUsd: number;
7673
+ estimatedProviderCostKnownCalls: number;
7674
+ tokens: number;
7675
+ cacheHitPct: number | null;
7676
+ };
5889
7677
  export type InsightsWarmGroupRow = {
5890
7678
  id: string;
5891
7679
  groupId: string;
@@ -5921,6 +7709,8 @@ export type InsightsScheduleRow = {
5921
7709
  creditUsd: number | null;
5922
7710
  estimatedProviderUsd: number | null;
5923
7711
  estimatedProviderCostKnownCalls: number | null;
7712
+ equivalentCreditUsd: number | null;
7713
+ equivalentCreditCostKnownCalls: number | null;
5924
7714
  tokens: number | null;
5925
7715
  cacheHitPct: number | null;
5926
7716
  billing: InsightsBillingPath | null;
@@ -5944,6 +7734,7 @@ export type InsightsModelCallRow = {
5944
7734
  totalTokens: number | null;
5945
7735
  creditUsd: number;
5946
7736
  estimatedProviderUsd: number | null;
7737
+ equivalentCreditUsd: number | null;
5947
7738
  pricingSource: InsightsPricingSource | null;
5948
7739
  };
5949
7740
  export type ModelContextContributionSource = "workspace_instruction_policy" | "legacy_workspace_instructions" | "preference_registry_descriptor" | "company_profile" | "legacy_memory_v1" | "runtime_skill_catalog";
@@ -5976,6 +7767,18 @@ export type WorkspaceInsightsSnapshot = {
5976
7767
  series: InsightsSeriesPoint[];
5977
7768
  depth: InsightsDepthBucket[];
5978
7769
  drivers: InsightsSpendDriver[];
7770
+ projects: InsightsProjectRow[];
7771
+ privateChats: {
7772
+ ownerKey: string;
7773
+ name: string | null;
7774
+ you: boolean;
7775
+ calls: number;
7776
+ tokens: number;
7777
+ creditUsd: number;
7778
+ estimatedProviderUsd: number;
7779
+ estimatedProviderCostKnownCalls: number;
7780
+ }[];
7781
+ privateChatsTruncated: boolean;
5979
7782
  schedules: InsightsScheduleRow[];
5980
7783
  recentCalls: InsightsModelCallRow[];
5981
7784
  promptContributions: InsightsPromptContributions;
@@ -5994,6 +7797,10 @@ export type WorkspaceInsightsSnapshot = {
5994
7797
  priorEstimatedProviderUsd: number;
5995
7798
  estimatedProviderCostKnownCalls: number;
5996
7799
  priorEstimatedProviderCostKnownCalls: number;
7800
+ equivalentCreditUsd: number;
7801
+ priorEquivalentCreditUsd: number;
7802
+ equivalentCreditCostKnownCalls: number;
7803
+ priorEquivalentCreditCostKnownCalls: number;
5997
7804
  modelCalls: number;
5998
7805
  priorInputTokens: number;
5999
7806
  priorTotalTokens: number;
@@ -6012,6 +7819,13 @@ export type WorkspaceInsightsSnapshot = {
6012
7819
  agentRunsUsed: number;
6013
7820
  agentRunCap: number | null;
6014
7821
  modelFilterActive: boolean;
7822
+ dataThrough: string | null;
7823
+ cacheHitPct: number;
7824
+ scope: InsightsScope;
7825
+ driverGroups: number;
7826
+ driversTruncated: boolean;
7827
+ facetsTruncated: boolean;
7828
+ recentCallsTruncated: boolean;
6015
7829
  };
6016
7830
  export type WorkspaceInsightsResponse = {
6017
7831
  snapshot: WorkspaceInsightsSnapshot;
@@ -6023,14 +7837,36 @@ export type BillingEntitlementsResponse = {
6023
7837
  };
6024
7838
  export type CreateCheckoutRequest = {
6025
7839
  accountId?: string | undefined;
6026
- /** USD amount with cent precision (server enforces min/max). */
6027
- amountUsd: number;
7840
+ /**
7841
+ * USD amount with cent precision (server enforces min/max). Required unless
7842
+ * `promotionCode` is given; a fixed-amount USD code then sets the amount.
7843
+ */
7844
+ amountUsd?: number | undefined;
7845
+ /** A Stripe promotion code to apply up front, as the customer typed it. */
7846
+ promotionCode?: string | undefined;
6028
7847
  successUrl?: string | undefined;
6029
7848
  cancelUrl?: string | undefined;
6030
7849
  };
6031
7850
  export type CreateCheckoutResponse = {
6032
7851
  checkoutSessionId: string;
6033
7852
  url: string;
7853
+ /** The credits this checkout grants once it completes. */
7854
+ amountUsd?: number | undefined;
7855
+ promotionalScope?: PromotionalCreditScope | undefined;
7856
+ };
7857
+ /** Where one checkout stands, and whether its credits reached the balance. */
7858
+ export type BillingCheckoutStatus = {
7859
+ checkoutSessionId: string;
7860
+ status: "open" | "complete" | "expired";
7861
+ credit: {
7862
+ state: "pending" | "granted";
7863
+ amountMicros: number;
7864
+ currency: "usd";
7865
+ /** True when a coupon covered the whole checkout, so nothing was charged. */
7866
+ free: boolean;
7867
+ promotionalScope?: PromotionalCreditScope | undefined;
7868
+ };
7869
+ balance: BillingBalance | null;
6034
7870
  };
6035
7871
  export type CreateBillingPortalRequest = {
6036
7872
  accountId?: string | undefined;
@@ -6054,17 +7890,36 @@ export type UserMessageEventInput = {
6054
7890
  controlEtag?: string | undefined;
6055
7891
  expectedDraftRevision?: number | undefined;
6056
7892
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6057
- connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
7893
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
6058
7894
  personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
6059
7895
  };
6060
7896
  };
7897
+ /**
7898
+ * Stable fields of each `session.requiresAction` `payload.approvals[]` entry.
7899
+ * Entries also carry producer-specific compatibility fields (`rawItem` on a
7900
+ * turn's first pause, `raw` on later ones); read only these three. Events
7901
+ * written before these fields existed need `approvalsFromRequiresAction`
7902
+ * from `@opengeni/react` or `approvalIdentifier` from `@opengeni/contracts`.
7903
+ */
7904
+ export type SessionApprovalRequest = {
7905
+ /** Pass as `sendApprovalDecision({ approvalId })`; this is the tool call id. */
7906
+ id: string;
7907
+ /** Model-visible tool name, for example `crm__update_record`. */
7908
+ name: string;
7909
+ /** Tool arguments as the model produced them (usually a JSON string). */
7910
+ arguments: unknown;
7911
+ [compatibilityField: string]: unknown;
7912
+ };
6061
7913
  export type UserApprovalDecisionEventInput = {
6062
7914
  type: "user.approvalDecision";
6063
7915
  clientEventId?: string | undefined;
6064
7916
  payload: {
7917
+ /** `session.requiresAction` `approvals[].id` (the pending tool call id). */
6065
7918
  approvalId: string;
6066
7919
  decision: "approve" | "reject";
6067
7920
  message?: string | undefined;
7921
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7922
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6068
7923
  };
6069
7924
  };
6070
7925
  export type UserHumanInputResponseEventInput = {
@@ -6073,6 +7928,8 @@ export type UserHumanInputResponseEventInput = {
6073
7928
  payload: {
6074
7929
  requestId: string;
6075
7930
  response: SubmitHumanInputResponseRequest;
7931
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7932
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6076
7933
  };
6077
7934
  };
6078
7935
  /** Control/user events a client may POST to a session's event log. */
@@ -6097,7 +7954,7 @@ export type MetricSample = {
6097
7954
  /** The derived dashboard state of a machine (M3 liveness + consent/display
6098
7955
  * reasons + the in-flight device-flow). */
6099
7956
  export type MachineState = "online" | "reconnecting" | "offline" | "consent_required" | "display_unavailable" | "enrolling";
6100
- export type MachineKind = "modal" | "selfhosted" | "opensandbox";
7957
+ export type MachineKind = "docker" | "modal" | "local" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
6101
7958
  export type MachineConnectionAuthority = {
6102
7959
  state: "not_applicable" | "unclaimed" | "active" | "expired";
6103
7960
  generation: number;
@@ -6116,6 +7973,17 @@ export type MachineRuntimeCapabilities = {
6116
7973
  browserBridge: boolean;
6117
7974
  operationResourcePolicy: boolean;
6118
7975
  operationCpuQuota: boolean;
7976
+ transactionalFsWrite: boolean;
7977
+ /** The agent renews its credentials on request, so screen control turns on in place. */
7978
+ credentialRenew: boolean;
7979
+ /** The live agent's credentials carry screen-control consent; null when unknown. */
7980
+ screenControl: boolean | null;
7981
+ };
7982
+ /** The three macOS Privacy & Security grants desktop capture and input need. */
7983
+ export type MachineMacPermissions = {
7984
+ screenRecording: boolean;
7985
+ accessibility: boolean;
7986
+ inputMonitoring: boolean;
6119
7987
  };
6120
7988
  export type MachineUpdateStatus = "requested" | "accepted" | "waiting_for_idle" | "downloading" | "verifying" | "applying" | "restarting" | "succeeded" | "failed";
6121
7989
  export type MachineUpdateState = {
@@ -6136,14 +8004,114 @@ export type MachineRuntime = {
6136
8004
  updateChannel: "stable" | "beta" | null;
6137
8005
  desiredVersion: string | null;
6138
8006
  versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
8007
+ /** Required installer bootstrap when a legacy updater cannot safely replace the install. */
8008
+ updateBlockedReason?: string | null | undefined;
6139
8009
  capabilities: MachineRuntimeCapabilities;
6140
8010
  update: MachineUpdateState | null;
8011
+ /** Live macOS permissions; null off macOS or when the agent does not report them. */
8012
+ macPermissions: MachineMacPermissions | null;
6141
8013
  };
6142
8014
  export type UpdateMachineAgentResponse = {
6143
8015
  operationId: string;
6144
8016
  accepted: boolean;
6145
8017
  targetVersion: string;
6146
8018
  };
8019
+ /** POST /v1/workspaces/:ws/machines/:enrollmentId/screen-control response.
8020
+ * active: on now. pending: allowed, and turns on by itself when the machine
8021
+ * reconnects (offline), after its agent update (agent_update_required), or on
8022
+ * a retry (renewal_failed). reconnect_required: run the connect command on the
8023
+ * machine again. */
8024
+ export type EnableMachineScreenControlResponse = {
8025
+ status: "active" | "pending";
8026
+ reason: "offline" | "agent_update_required" | "renewal_failed" | "reconnect_required" | null;
8027
+ message: string | null;
8028
+ };
8029
+ /** macOS Privacy & Security panes the agent needs for desktop capture/input. */
8030
+ export type MachinePrivacySettingsPane = "screen_recording" | "accessibility" | "input_monitoring";
8031
+ /** POST /v1/workspaces/:ws/machines/:enrollmentId/privacy-settings body. */
8032
+ export type OpenMachinePrivacySettingsRequest = {
8033
+ pane: MachinePrivacySettingsPane;
8034
+ };
8035
+ /** Who can use a Connected Machine: everyone in its workspace, or one person. */
8036
+ export type MachineAudience = "workspace" | "only_me";
8037
+ /** POST /v1/workspaces/:ws/machines/:enrollmentId/audience/preview body.
8038
+ * `ownerSubjectId` names who owns the machine as Only me (defaults to the
8039
+ * caller; naming someone else needs workspace admin). */
8040
+ export type MachineAudiencePreviewRequest = {
8041
+ audience: MachineAudience;
8042
+ ownerSubjectId?: string;
8043
+ };
8044
+ /** PUT /v1/workspaces/:ws/machines/:enrollmentId/audience body: apply the
8045
+ * previewed plan at the generation it was read at. */
8046
+ export type ChangeMachineAudienceRequest = MachineAudiencePreviewRequest & {
8047
+ expectedGeneration: number;
8048
+ };
8049
+ /** What the change does to one thing on the machine. `move_off`: the chat
8050
+ * leaves the machine (its history and files stay). `keep`: the owner's chat
8051
+ * stays. `make_only_me` / `pause`: a schedule that runs on the machine.
8052
+ * `remove_first`: the same computer is connected a second time. */
8053
+ export type MachineAudienceAction = "move_off" | "keep" | "make_only_me" | "pause" | "remove_first";
8054
+ /** One thing an audience change affects. Another member's private chat or
8055
+ * schedule is listed without its title or owner. */
8056
+ export type MachineAudienceItem = {
8057
+ kind: "chat" | "schedule" | "duplicate_connection";
8058
+ action: MachineAudienceAction;
8059
+ sessionId: string | null;
8060
+ scheduledTaskId: string | null;
8061
+ enrollmentId: string | null;
8062
+ workspaceId: string | null;
8063
+ relation: "other_member" | "owner_shared" | "owner_private" | "other_workspace" | null;
8064
+ visibility: "user_private" | "workspace_shared" | null;
8065
+ title: string | null;
8066
+ ownerSubjectId: string | null;
8067
+ /** A running turn in this chat stops for good. */
8068
+ stopsTurn: boolean;
8069
+ /** Agent commands still running in this chat that stop. */
8070
+ stopsCommands: number;
8071
+ };
8072
+ /** Counts of what one change does. */
8073
+ export type MachineAudienceSummary = {
8074
+ keptChats: number;
8075
+ keptSharedChats: number;
8076
+ movedOffChats: number;
8077
+ schedulesMadeOnlyMe: number;
8078
+ schedulesPaused: number;
8079
+ stoppedTurns: number;
8080
+ stoppedCommands: number;
8081
+ notifiedPeople: number;
8082
+ };
8083
+ /** POST .../audience/preview response: everything one confirmation does.
8084
+ * `ready` is false only while the same computer is also connected as a
8085
+ * separate machine. */
8086
+ export type MachineAudiencePreview = {
8087
+ enrollmentId: string;
8088
+ sandboxId: string;
8089
+ machineName: string;
8090
+ currentAudience: MachineAudience;
8091
+ targetAudience: MachineAudience;
8092
+ generation: number;
8093
+ ownerSubjectId: string | null;
8094
+ summary: MachineAudienceSummary;
8095
+ items: MachineAudienceItem[];
8096
+ ready: boolean;
8097
+ };
8098
+ /** PUT .../audience response. The machine keeps its sandbox ID and connection. */
8099
+ export type ChangeMachineAudienceResponse = {
8100
+ enrollmentId: string;
8101
+ sandboxId: string;
8102
+ previousAudience: MachineAudience;
8103
+ audience: MachineAudience;
8104
+ ownerSubjectId: string | null;
8105
+ generation: number;
8106
+ summary: MachineAudienceSummary;
8107
+ detachedSessionIds: string[];
8108
+ keptSessionIds: string[];
8109
+ };
8110
+ /** POST /v1/workspaces/:ws/machines/:enrollmentId/privacy-settings response. */
8111
+ export type OpenMachinePrivacySettingsResponse = {
8112
+ opened: boolean;
8113
+ message: string | null;
8114
+ };
6147
8115
  export type MachineOperationPolicy = {
6148
8116
  memoryMaxBytes: number | null;
6149
8117
  memoryHighBytes: number | null;
@@ -6241,7 +8209,7 @@ export type SwapActiveSandboxResponse = {
6241
8209
  activeSandboxId: string | null;
6242
8210
  activeEpoch: number;
6243
8211
  reason?: string;
6244
- code?: "stale_pointer" | "offline_enrollment" | "unsupported_backend_context" | "transient_establishment" | "concurrent_swap" | "recovery_in_progress" | "recovery_degraded" | "recovery_unrecoverable";
8212
+ code?: "stale_pointer" | "offline_enrollment" | "unsupported_backend_context" | "transient_establishment" | "concurrent_swap" | "personal_machine_permission_required" | "personal_machine_not_permitted" | "recovery_in_progress" | "recovery_degraded" | "recovery_unrecoverable";
6245
8213
  };
6246
8214
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
6247
8215
  export type EnrollmentOs = "linux" | "macos" | "windows";
@@ -6289,12 +8257,27 @@ export type DeviceEnrollmentDenyResponse = {
6289
8257
  /** POST /v1/workspaces/:ws/enrollments/token body. */
6290
8258
  export type MintEnrollTokenRequest = {
6291
8259
  allowScreenControl?: boolean;
8260
+ /**
8261
+ * Who can use the machine. `user` makes it the signed-in caller's own
8262
+ * machine (requires a verified person: someone signed in, or a credential
8263
+ * acting as them, such as a personal API key or an organization key acting
8264
+ * `asUser`; a key, service or agent acting as itself gets 422); `workspace`
8265
+ * shares it with this workspace's members. Omitted mints the original
8266
+ * workspace-shared token.
8267
+ */
8268
+ scope?: EnrollTokenScope;
6292
8269
  };
8270
+ /** Who can use a machine connected with an enroll token. */
8271
+ export type EnrollTokenScope = "user" | "workspace";
6293
8272
  /** POST /v1/workspaces/:ws/enrollments/token response. The `token` is SECRET. */
6294
8273
  export type MintEnrollTokenResponse = {
6295
8274
  token: string;
6296
8275
  expiresAt: string;
6297
8276
  expiresInSeconds: number;
8277
+ /** What the token grants. Absent from servers that predate scoped tokens,
8278
+ * which always mint workspace-shared tokens. */
8279
+ scope?: EnrollTokenScope;
8280
+ allowScreenControl?: boolean;
6298
8281
  };
6299
8282
  /** The credential payload the headless exchange returns (a subset of the agent's
6300
8283
  * EnrollmentCredentials — IDENTICAL to the device-flow poll authorized branch). */
@@ -6326,4 +8309,245 @@ export type EnrollTokenExchangeRequest = {
6326
8309
  export type EnrollTokenExchangeResponse = {
6327
8310
  credentials: EnrollmentCredentials;
6328
8311
  };
6329
- export {};
8312
+ export type ModelConnectionAccessPolicy = {
8313
+ allowedModels: string[] | null;
8314
+ /** Organization-pool grants; null for every shared workspace, including new ones. */
8315
+ allowedWorkspaces: string[] | null;
8316
+ allowPersonalWorkspaces: boolean;
8317
+ /**
8318
+ * The chosen people (organization membership ids), or null when the account
8319
+ * is not limited to people. Requires `allowedWorkspaces: []` and
8320
+ * `allowPersonalWorkspaces: false`.
8321
+ */
8322
+ allowedPeople?: string[] | null;
8323
+ /** Explicit owner consent to share a personal subscription with the organization. */
8324
+ sharePersonal?: true;
8325
+ version: number;
8326
+ };
8327
+ export type ModelConnectionAccessResponse = {
8328
+ policy: ModelConnectionAccessPolicy;
8329
+ models: Array<{
8330
+ id: string;
8331
+ label: string;
8332
+ }>;
8333
+ workspaces: Array<{
8334
+ id: string;
8335
+ name: string;
8336
+ }>;
8337
+ personalWorkspacesSupported: boolean;
8338
+ /** The account can be limited to chosen people. */
8339
+ peopleSupported?: boolean;
8340
+ /** Active members of the organization an administrator can choose. */
8341
+ people?: Array<{
8342
+ id: string;
8343
+ name: string | null;
8344
+ email: string | null;
8345
+ }>;
8346
+ /** Workspaces that use the account as their own; they always keep it for workspace choices. */
8347
+ localWorkspaceIds?: string[];
8348
+ /** The workspace whose administrators also manage the account, if any. */
8349
+ managedByWorkspaceId?: string | null;
8350
+ personalSharingSupported?: boolean;
8351
+ };
8352
+ export type ConnectorToolPermission = "allow" | "ask" | "block";
8353
+ export type ConnectorToolPermissionEntry = {
8354
+ name: string;
8355
+ title?: string | undefined;
8356
+ description?: string | undefined;
8357
+ group: "read" | "write" | "other";
8358
+ permission: ConnectorToolPermission;
8359
+ inherited: boolean;
8360
+ approvalRequired: boolean;
8361
+ source?: "recommended" | "connector_default" | "tool" | "action" | "conflict";
8362
+ conditional?: boolean;
8363
+ actionPermissions?: Array<{
8364
+ actionName: string;
8365
+ permission: ConnectorToolPermission;
8366
+ }>;
8367
+ };
8368
+ export type ConnectorToolPermissionsResponse = {
8369
+ connectionId: string;
8370
+ serverId: string;
8371
+ defaultPermission: ConnectorToolPermission | null;
8372
+ tools: ConnectorToolPermissionEntry[];
8373
+ discoveryError: string | null;
8374
+ canManage: boolean;
8375
+ appliesTo?: "next_attempt";
8376
+ revision?: string;
8377
+ accountLabel?: string;
8378
+ instanceKey?: string;
8379
+ accounts?: Array<{
8380
+ connectionId: string;
8381
+ label: string;
8382
+ scope: "personal" | "workspace" | "none";
8383
+ instanceKey?: string;
8384
+ }>;
8385
+ };
8386
+ export type UpdateConnectorToolPermissionsRequest = {
8387
+ connectionId: string;
8388
+ permission: ConnectorToolPermission | null;
8389
+ expectedRevision?: string;
8390
+ instanceKey?: string;
8391
+ } & ({
8392
+ target: "default";
8393
+ } | {
8394
+ target: "tools";
8395
+ toolNames: string[];
8396
+ } | {
8397
+ target: "action";
8398
+ toolName: string;
8399
+ actionName: string;
8400
+ });
8401
+ /** Saved Allow/Ask/Block rules for a session MCP server the host attaches.
8402
+ * Tools without a rule follow `defaultPermission`, then the attaching session's
8403
+ * `requireApproval` recommendation (Ask), then Allow. */
8404
+ export type SessionMcpToolPermissionsResponse = {
8405
+ connectionId: string;
8406
+ serverId: string;
8407
+ defaultPermission: ConnectorToolPermission | null;
8408
+ tools: Array<{
8409
+ toolName: string;
8410
+ permission: ConnectorToolPermission;
8411
+ }>;
8412
+ revision: string;
8413
+ canManage: boolean;
8414
+ appliesTo: "next_attempt";
8415
+ };
8416
+ /** `url` is the exact URL attached to sessions; `permission: null` resets. */
8417
+ export type UpdateSessionMcpToolPermissionsRequest = {
8418
+ serverId: string;
8419
+ url: string;
8420
+ permission: ConnectorToolPermission | null;
8421
+ expectedRevision?: string;
8422
+ } & ({
8423
+ target: "default";
8424
+ } | {
8425
+ target: "tools";
8426
+ toolNames: string[];
8427
+ });
8428
+ /** Agent capability ids (see `@opengeni/contracts` agent-config). */
8429
+ export type AgentCapabilityId = "webSearch" | "humanInput" | "skills" | "goals" | "subagents" | "knowledge" | "schedules" | "artifacts" | "browser" | "secrets" | "media" | "workspaceFiles" | "workspaceConnectors" | "workspaceAdmin";
8430
+ /** `read` reads installed Skills; `manage` also changes them. */
8431
+ export type AgentSkillsCapability = "read" | "manage" | false;
8432
+ export type AgentCapabilityToggles = {
8433
+ webSearch?: boolean | undefined;
8434
+ humanInput?: boolean | undefined;
8435
+ skills?: AgentSkillsCapability | undefined;
8436
+ goals?: boolean | undefined;
8437
+ subagents?: boolean | undefined;
8438
+ knowledge?: boolean | undefined;
8439
+ schedules?: boolean | undefined;
8440
+ artifacts?: boolean | undefined;
8441
+ browser?: boolean | undefined;
8442
+ secrets?: boolean | undefined;
8443
+ media?: boolean | undefined;
8444
+ workspaceFiles?: boolean | undefined;
8445
+ workspaceConnectors?: boolean | undefined;
8446
+ workspaceAdmin?: boolean | undefined;
8447
+ };
8448
+ /**
8449
+ * `"all"`: everything this workspace offers (today's behavior). `"none"`: the
8450
+ * session's own tools plus essentials. An object starts from one and toggles.
8451
+ */
8452
+ export type AgentCapabilities = "all" | "none" | ({
8453
+ from: "all" | "none";
8454
+ } & AgentCapabilityToggles);
8455
+ export type AgentRenderer = "opengeni" | "markdown";
8456
+ export type AgentConfigRequest = {
8457
+ capabilities?: AgentCapabilities | undefined;
8458
+ /** Replaces only Opengeni's identity lines (max 8,000 chars); null = default identity. */
8459
+ identity?: string | null | undefined;
8460
+ /** Alias of the session `instructions` field. */
8461
+ instructions?: string | undefined;
8462
+ renderer?: AgentRenderer | undefined;
8463
+ /** Vaults this session may use (input only); intersected with the parent's policy. */
8464
+ vaultPolicy?: VaultPolicy | undefined;
8465
+ };
8466
+ /** Which vaults a session or schedule may use (see `@opengeni/contracts` VaultPolicy). */
8467
+ export type VaultPolicy = {
8468
+ mode: "all";
8469
+ } | {
8470
+ mode: "selected";
8471
+ vaultIds: string[];
8472
+ };
8473
+ export type WorkspaceAgentDefaults = {
8474
+ capabilities?: AgentCapabilities | undefined;
8475
+ identity?: string | null | undefined;
8476
+ renderer?: AgentRenderer | undefined;
8477
+ };
8478
+ export type ResolvedAgentCapabilities = {
8479
+ webSearch: boolean;
8480
+ humanInput: boolean;
8481
+ skills: AgentSkillsCapability;
8482
+ goals: boolean;
8483
+ subagents: boolean;
8484
+ knowledge: boolean;
8485
+ schedules: boolean;
8486
+ artifacts: boolean;
8487
+ browser: boolean;
8488
+ secrets: boolean;
8489
+ media: boolean;
8490
+ workspaceFiles: boolean;
8491
+ workspaceConnectors: boolean;
8492
+ workspaceAdmin: boolean;
8493
+ };
8494
+ export type ResolvedAgentConfig = {
8495
+ version: 1;
8496
+ from: "all" | "none";
8497
+ capabilities: ResolvedAgentCapabilities;
8498
+ /** Capabilities wanted on but not offered by this deployment. */
8499
+ unavailable: AgentCapabilityId[];
8500
+ /** Why each unavailable capability is off; present whenever `unavailable` is non-empty. */
8501
+ unavailableReasons?: Partial<Record<AgentCapabilityId, string>> | undefined;
8502
+ identity: string | null;
8503
+ renderer: AgentRenderer;
8504
+ source: "request" | "workspace_default" | "deployment_default" | "inherited" | "legacy_conversion";
8505
+ };
8506
+ export type AgentEffectiveTools = {
8507
+ capabilities: ResolvedAgentCapabilities;
8508
+ unavailable: AgentCapabilityId[];
8509
+ /** False until exact runtime media adapters (including credential identity) are resolved. */
8510
+ mediaToolsKnown?: boolean | undefined;
8511
+ tools: Array<{
8512
+ name: string;
8513
+ capability: AgentCapabilityId | "runtime" | "sandbox" | "product";
8514
+ source: "first_party" | "runtime" | "hosted" | "sandbox" | "mcp";
8515
+ visibility?: "upfront" | "search" | undefined;
8516
+ }>;
8517
+ mcpServers: Array<{
8518
+ id: string;
8519
+ capability: AgentCapabilityId | "runtime" | "product";
8520
+ toolsKnown: boolean;
8521
+ }>;
8522
+ };
8523
+ /**
8524
+ * `PUT .../sessions/:id/skills`. Replaces every Skill the session carries
8525
+ * itself; an empty list removes them all.
8526
+ */
8527
+ export type UpdateSessionSkillsRequest = {
8528
+ skills: SessionSkillInput[];
8529
+ /** The session's current `toolPolicyVersion` (shared CAS). */
8530
+ expectedVersion: number;
8531
+ };
8532
+ /** `PUT .../sessions/:id/agent`. Omitted agent fields keep their current values. */
8533
+ export type UpdateSessionAgentRequest = {
8534
+ agent: AgentConfigRequest;
8535
+ /** The session's current `toolPolicyVersion` (shared CAS). */
8536
+ expectedVersion: number;
8537
+ };
8538
+ export type ClientAgentConfig = {
8539
+ /** @deprecated Agent configuration is always on; current servers always report `true`. */
8540
+ enabled: boolean;
8541
+ /** @deprecated Omitted `agent` always resolves `{ capabilities: "all" }`; always `true`. */
8542
+ defaultForNewSessions: boolean;
8543
+ capabilities: Array<{
8544
+ id: AgentCapabilityId;
8545
+ available: boolean;
8546
+ reason?: string | undefined;
8547
+ }>;
8548
+ };
8549
+ /** `error.details.code` of a 422 agent-configuration failure. */
8550
+ export type AgentConfigErrorCode = "agent_capability_unavailable" | "agent_config_conflict" | "agent_config_widening"
8551
+ /** Returned only by older servers that predate always-on agent configuration. */
8552
+ | "agent_config_not_enabled";
8553
+ export type { ToolActionReview, ToolReviewDetailsPage, ToolReviewStatus, } from "@opengeni/contracts";