@opengeni/sdk 3.3.2-canary.1 → 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 (295) 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 +6 -2
  25. package/dist/browser.js +25 -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-E5BNEG2D.js → chunk-NCU5OAN7.js} +27 -2
  53. package/dist/chunk-NCU5OAN7.js.map +1 -0
  54. package/dist/{chunk-BESZFWMU.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-GY6RQPCG.js → chunk-S2NLS3ES.js} +3598 -1278
  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-TFCLHRZK.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-6NEPJ7NC.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-QTBAMHEF.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 +1056 -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 +6 -2
  91. package/dist/core.js +23 -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 +64 -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 +61 -11
  110. package/dist/index.js +555 -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/organization-integration-policy.d.ts +26 -0
  127. package/dist/organization-integration-policy.js +26 -0
  128. package/dist/organization-integration-policy.js.map +1 -0
  129. package/dist/pr-review-client.d.ts +1 -1
  130. package/dist/pr-review.d.ts +1 -1
  131. package/dist/pr-review.js.map +1 -1
  132. package/dist/preference-registry.d.ts +1 -1
  133. package/dist/prepared-mcp-setup.d.ts +5 -0
  134. package/dist/proxy.d.ts +13 -11
  135. package/dist/realtime.d.ts +1 -1
  136. package/dist/realtime.js +253 -7
  137. package/dist/realtime.js.map +1 -1
  138. package/dist/session-history-import.d.ts +22 -0
  139. package/dist/session-history-import.js +36 -0
  140. package/dist/session-history-import.js.map +1 -0
  141. package/dist/session-list-entries.d.ts +1 -0
  142. package/dist/session-list-entries.js +7 -0
  143. package/dist/session-list-entries.js.map +1 -0
  144. package/dist/session-message-search.d.ts +53 -0
  145. package/dist/session-proxy-client.d.ts +28 -0
  146. package/dist/session-proxy.d.ts +334 -0
  147. package/dist/session-proxy.js +24 -0
  148. package/dist/session-proxy.js.map +1 -0
  149. package/dist/session-titles.d.ts +2 -28
  150. package/dist/session-usage-limits.d.ts +10 -0
  151. package/dist/session-usage-limits.js +43 -0
  152. package/dist/session-usage-limits.js.map +1 -0
  153. package/dist/shared-catalog-loader.d.ts +34 -0
  154. package/dist/site-ai.d.ts +35 -0
  155. package/dist/site-bridge-host.d.ts +112 -0
  156. package/dist/site-bridge-host.js +286 -0
  157. package/dist/site-bridge-host.js.map +1 -0
  158. package/dist/site-browser-entry.d.ts +1 -0
  159. package/dist/site-browser-runtime.gen.d.ts +1 -0
  160. package/dist/site-data.d.ts +178 -0
  161. package/dist/site-document.d.ts +5 -0
  162. package/dist/site-document.js +20 -0
  163. package/dist/site-document.js.map +1 -0
  164. package/dist/site-document.test.d.ts +1 -0
  165. package/dist/site-http.d.ts +17 -0
  166. package/dist/site-sql.d.ts +31 -0
  167. package/dist/site-tool-bridge.d.ts +57 -0
  168. package/dist/site.d.ts +186 -0
  169. package/dist/site.js +63 -0
  170. package/dist/site.js.map +1 -0
  171. package/dist/skills.d.ts +75 -0
  172. package/dist/sse.d.ts +1 -1
  173. package/dist/stream.d.ts +2 -0
  174. package/dist/tenant-workspaces.d.ts +47 -0
  175. package/dist/tenant-workspaces.js +8 -0
  176. package/dist/tenant-workspaces.js.map +1 -0
  177. package/dist/tool-auth.d.ts +87 -0
  178. package/dist/tool-auth.js +23 -0
  179. package/dist/tool-auth.js.map +1 -0
  180. package/dist/tool-display-metadata.d.ts +3 -0
  181. package/dist/tools-37DCTCNZ.js +12 -0
  182. package/dist/tools-37DCTCNZ.js.map +1 -0
  183. package/dist/tools.d.ts +81 -0
  184. package/dist/transcription.d.ts +1 -1
  185. package/dist/types.d.ts +2785 -592
  186. package/dist/usage-allowances.d.ts +36 -0
  187. package/dist/usage-allowances.js +80 -0
  188. package/dist/usage-allowances.js.map +1 -0
  189. package/dist/vault-types.d.ts +324 -0
  190. package/dist/vaults-api.d.ts +65 -0
  191. package/dist/workspace-artifacts.d.ts +47 -5
  192. package/dist/workspace-instruction-policies.d.ts +2 -2
  193. package/dist/workspace-integrations.d.ts +74 -0
  194. package/dist/workspace-integrations.js +67 -0
  195. package/dist/workspace-integrations.js.map +1 -0
  196. package/dist/workspace-state.d.ts +8 -71
  197. package/package.json +99 -5
  198. package/src/adapters/express.ts +136 -0
  199. package/src/adapters/hono.ts +18 -0
  200. package/src/adapters/next.ts +42 -0
  201. package/src/allowance-refusal.ts +5 -0
  202. package/src/app-links.ts +117 -0
  203. package/src/artifact-catalog.ts +51 -0
  204. package/src/artifact-client.ts +40 -49
  205. package/src/artifacts.ts +1 -0
  206. package/src/automations-client.ts +8 -2
  207. package/src/azure-live-transport.ts +286 -0
  208. package/src/browser.ts +35 -0
  209. package/src/chat/fold.ts +431 -0
  210. package/src/chat/handler.ts +240 -0
  211. package/src/chat/http.ts +257 -0
  212. package/src/chat/ids.ts +85 -0
  213. package/src/chat/index.ts +88 -0
  214. package/src/chat/openai.ts +439 -0
  215. package/src/chat/opengeni.ts +737 -0
  216. package/src/chat/types.ts +219 -0
  217. package/src/chat/vercel.ts +204 -0
  218. package/src/chats.ts +16 -0
  219. package/src/client.ts +5595 -1847
  220. package/src/codex-realtime-controller.ts +163 -8
  221. package/src/codex-realtime-v3-wire.ts +4 -3
  222. package/src/codex-realtime-v3.ts +12 -3
  223. package/src/codex-realtime.ts +11 -3
  224. package/src/company-brain.ts +0 -40
  225. package/src/core.ts +18 -0
  226. package/src/deprecation.ts +149 -0
  227. package/src/document-authority-client.ts +104 -1
  228. package/src/editable-artifacts/controller.ts +36 -2
  229. package/src/editable-artifacts/index.ts +1 -0
  230. package/src/editable-artifacts/types.ts +29 -16
  231. package/src/embedding-client.ts +519 -0
  232. package/src/errors.ts +281 -5
  233. package/src/external-vault-receiver.ts +914 -0
  234. package/src/feedback.ts +20 -0
  235. package/src/gateway-realtime-transport.ts +3 -3
  236. package/src/github-repositories.ts +60 -0
  237. package/src/index.ts +592 -65
  238. package/src/insights-usage.ts +64 -0
  239. package/src/interaction.ts +315 -93
  240. package/src/knowledge.ts +72 -0
  241. package/src/known-tools.ts +279 -0
  242. package/src/message-links.ts +178 -0
  243. package/src/model-context.ts +113 -0
  244. package/src/model-display.ts +11 -0
  245. package/src/organization-integration-policy.ts +54 -0
  246. package/src/pr-review-client.ts +1 -1
  247. package/src/pr-review.ts +1 -1
  248. package/src/preference-registry.ts +2 -0
  249. package/src/prepared-mcp-setup.ts +123 -0
  250. package/src/proxy.ts +23 -12
  251. package/src/realtime.ts +15 -6
  252. package/src/session-history-import.ts +84 -0
  253. package/src/session-list-entries.ts +1 -0
  254. package/src/session-message-search.ts +47 -0
  255. package/src/session-proxy-client.ts +68 -0
  256. package/src/session-proxy.ts +2098 -0
  257. package/src/session-titles.ts +8 -82
  258. package/src/session-usage-limits.ts +71 -0
  259. package/src/shared-catalog-loader.ts +169 -0
  260. package/src/site-ai.ts +284 -0
  261. package/src/site-bridge-host.ts +422 -0
  262. package/src/site-browser-entry.ts +6 -0
  263. package/src/site-browser-runtime.gen.ts +2 -0
  264. package/src/site-data.ts +372 -0
  265. package/src/site-document.test.ts +64 -0
  266. package/src/site-document.ts +18 -0
  267. package/src/site-http.ts +171 -0
  268. package/src/site-sql.ts +153 -0
  269. package/src/site-tool-bridge.ts +401 -0
  270. package/src/site.ts +878 -0
  271. package/src/skills.ts +69 -0
  272. package/src/sse.ts +9 -3
  273. package/src/stream.ts +33 -10
  274. package/src/tenant-workspaces.ts +148 -0
  275. package/src/tool-auth.ts +301 -0
  276. package/src/tool-display-metadata.ts +27 -0
  277. package/src/tools.ts +452 -0
  278. package/src/transcription.ts +3 -0
  279. package/src/types.ts +3142 -594
  280. package/src/usage-allowances.ts +189 -0
  281. package/src/vault-types.ts +379 -0
  282. package/src/vaults-api.ts +339 -0
  283. package/src/workspace-artifacts.ts +55 -6
  284. package/src/workspace-instruction-policies.ts +2 -1
  285. package/src/workspace-integrations.ts +402 -0
  286. package/src/workspace-state.ts +8 -82
  287. package/dist/chunk-6NEPJ7NC.js.map +0 -1
  288. package/dist/chunk-BESZFWMU.js.map +0 -1
  289. package/dist/chunk-E5BNEG2D.js.map +0 -1
  290. package/dist/chunk-GY6RQPCG.js.map +0 -1
  291. package/dist/chunk-OO5LPTO7.js +0 -132
  292. package/dist/chunk-OO5LPTO7.js.map +0 -1
  293. package/dist/chunk-QTBAMHEF.js.map +0 -1
  294. package/dist/chunk-TFCLHRZK.js.map +0 -1
  295. package/dist/chunk-VYCTL62C.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,18 +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;
497
713
  operationId?: string | undefined;
714
+ /** Direct OpenAI/Azure keys only: verify the provider/model before saving. */
715
+ verifyModelAccess?: boolean | undefined;
498
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
+ });
499
738
  export type PersonalGitHubConnectionMetadata = {
500
739
  credentialRole: "opengeni_github_personal";
501
740
  providerFamily: "github";
@@ -589,9 +828,20 @@ export type VerifyPersonalGitHubRepositorySelectionsRequest = {
589
828
  idempotencyKey: string;
590
829
  };
591
830
  export type OpenGeniSlackBotInstallRequest = {
592
- /** Existing OpenGeni Slack bot connection to reinstall in place. */
831
+ /** Existing Opengeni Slack bot connection to reinstall in place. */
593
832
  connectionId?: string | undefined;
594
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
+ };
595
845
  export type FikenInstallRequest = {
596
846
  apiToken: string;
597
847
  defaultCompanySlug?: string | undefined;
@@ -599,6 +849,7 @@ export type FikenInstallRequest = {
599
849
  connectionId?: string | undefined;
600
850
  };
601
851
  export type FikenOAuthStartRequest = {
852
+ returnPath?: string | undefined;
602
853
  /** Existing Fiken connection to re-authorize in place (reconnect). */
603
854
  connectionId?: string | undefined;
604
855
  };
@@ -624,7 +875,7 @@ export type SlackInstallationBinding = {
624
875
  slackTeamName: string;
625
876
  botId: string;
626
877
  botUserId: string;
627
- botDisplayName: "OpenGeni" | "OpenGeni Staging";
878
+ botDisplayName: "Opengeni" | "Opengeni Staging" | "OpenGeni" | "OpenGeni Staging";
628
879
  state: SlackInstallationBindingState;
629
880
  quarantineReason: string | null;
630
881
  version: number;
@@ -858,7 +1109,12 @@ export type OAuthStartRequest = {
858
1109
  resource?: string | undefined;
859
1110
  requestedScopes?: string[] | undefined;
860
1111
  returnPath?: string | undefined;
1112
+ /** Exact trusted-host destination; requires verified external-user mode. */
1113
+ returnUrl?: string | undefined;
861
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;
862
1118
  ownership?: ConnectionOwnership | undefined;
863
1119
  oauthClient?: {
864
1120
  clientId: string;
@@ -908,11 +1164,11 @@ export type ServiceTurnInitiator = TurnInitiator & {
908
1164
  kind: "service";
909
1165
  };
910
1166
  export type TurnInitiatorContext = Record<string, unknown>;
911
- /** Bounded host provenance; OpenGeni-owned lineage keys are reserved. */
1167
+ /** Bounded host provenance; Opengeni-owned lineage keys are reserved. */
912
1168
  export type ServiceTurnInitiatorContext = TurnInitiatorContext;
913
1169
  export type IntegrationClientMetadata = {
914
1170
  client_id: string;
915
- client_name: "OpenGeni";
1171
+ client_name: "Opengeni" | "OpenGeni";
916
1172
  redirect_uris: string[];
917
1173
  token_endpoint_auth_method: "none";
918
1174
  grant_types: Array<"authorization_code" | "refresh_token">;
@@ -923,6 +1179,11 @@ export type SessionTenancyCreateCapabilities = {
923
1179
  activated: boolean;
924
1180
  canCreatePrivate: boolean;
925
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;
926
1187
  };
927
1188
  export type SessionTenancyPublicProjection = {
928
1189
  visibility: SessionVisibility;
@@ -938,6 +1199,38 @@ export type UpdateSessionVisibilityRequest = {
938
1199
  visibility: SessionVisibility;
939
1200
  expectedAuthorityEpoch: number;
940
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;
941
1234
  };
942
1235
  export type UpdateSessionVisibilityResponse = {
943
1236
  operationId: string;
@@ -954,7 +1247,6 @@ export type ForkSessionRequest = {
954
1247
  visibility: SessionVisibility;
955
1248
  workspaceSharedAcknowledged: boolean;
956
1249
  rigId?: string | null | undefined;
957
- variableSetIds?: string[] | undefined;
958
1250
  };
959
1251
  export type ForkSessionResponse = {
960
1252
  operationId: string;
@@ -968,16 +1260,36 @@ export type ForkSessionResponse = {
968
1260
  replay: boolean;
969
1261
  };
970
1262
  export type SessionBackgroundCommandActivity = {
1263
+ unavailableCount?: number | undefined;
971
1264
  state: "running" | "stopping";
972
1265
  count: number;
973
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
+ };
974
1283
  export type SessionBackgroundCommand = {
1284
+ observationStatus?: "unavailable" | undefined;
1285
+ reconciliation?: SessionBackgroundCommandReconciliation | undefined;
975
1286
  id: string;
976
1287
  workspaceId: string;
977
1288
  sessionId: string;
978
1289
  provider: "managed" | "connected_machine";
979
1290
  state: "running" | "stopping" | "exited" | "lost";
980
1291
  commandPreview: string;
1292
+ commandText?: string | undefined;
981
1293
  cancelRequestedAt: string | null;
982
1294
  exitCode: number | null;
983
1295
  settlementReason: string | null;
@@ -992,12 +1304,36 @@ export type CancelSessionBackgroundCommandResult = {
992
1304
  command: SessionBackgroundCommand;
993
1305
  accepted: boolean;
994
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
+ };
995
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;
996
1331
  id: string;
997
1332
  workspaceId: string;
998
1333
  accountId: string;
999
1334
  status: SessionStatus;
1000
1335
  backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
1336
+ hasSchedules?: boolean | undefined;
1001
1337
  initialMessage: string;
1002
1338
  title: string | null;
1003
1339
  titleSource: "user" | "agent" | null;
@@ -1026,10 +1362,11 @@ export type Session = {
1026
1362
  activeEpoch: number;
1027
1363
  /** Explicit connected-machine project root; null uses the agent launch root. */
1028
1364
  workingDir: string | null;
1029
- /** 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`. */
1030
1366
  variableSetIds?: string[] | undefined;
1367
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
1031
1368
  variableSetId: string | null;
1032
- /** @deprecated use variableSetId */
1369
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
1033
1370
  environmentId: string | null;
1034
1371
  rigId: string | null;
1035
1372
  rigVersionId: string | null;
@@ -1037,10 +1374,24 @@ export type Session = {
1037
1374
  channelId: string | null;
1038
1375
  firstPartyMcpPermissions: string[] | null;
1039
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;
1040
1384
  mcpServers: SessionMcpServerMetadata[];
1385
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
1041
1386
  parentSessionId: string | null;
1042
1387
  /** Immutable server-authored nested-agent lineage and policy snapshot. */
1043
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;
1044
1395
  nestedAgentDepth: number;
1045
1396
  maxNestedAgentDepthOverride: number | null;
1046
1397
  effectiveMaxNestedAgentDepth: number;
@@ -1053,16 +1404,32 @@ export type Session = {
1053
1404
  queueHeadPosition: number;
1054
1405
  queueTailPosition: number;
1055
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;
1056
1412
  lastSequence: number;
1057
1413
  /** Multi-account Codex (P1): the account this session is pinned to (null ⇒ follow workspace active). */
1058
1414
  codexPinnedCredentialId?: string | null;
1059
1415
  /** Multi-account Codex (P1): the account the most recent turn ran on (the "Running on:" indicator). */
1060
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;
1061
1422
  /**
1062
1423
  * Frozen at create. `remote_v2` ⇒ Codex remote compaction + Codex-only model
1063
1424
  * admission; `portable` ⇒ plaintext compaction and free provider switching.
1064
1425
  */
1065
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;
1066
1433
  /** Personal (authenticated subject) workspace pin state, never workspace-global. */
1067
1434
  pinned?: boolean;
1068
1435
  /** Stable pin ordering key; null when this subject has not pinned the session. */
@@ -1078,6 +1445,20 @@ export type Session = {
1078
1445
  /** Personal archive state. */
1079
1446
  archived?: boolean;
1080
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;
1081
1462
  /** Optimistic archive-state revision. */
1082
1463
  archiveVersion?: number;
1083
1464
  /** Server-authoritative descendant counts populated by session-list reads. */
@@ -1086,6 +1467,7 @@ export type Session = {
1086
1467
  totalDescendants: number;
1087
1468
  runningDescendants: number;
1088
1469
  queuedDescendants: number;
1470
+ waitingDescendants?: number | undefined;
1089
1471
  attentionDescendants: number;
1090
1472
  pausedDescendants: number;
1091
1473
  failedDescendants: number;
@@ -1105,6 +1487,18 @@ export type Session = {
1105
1487
  * list and lineage reads for `requires_action` sessions; null otherwise.
1106
1488
  */
1107
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;
1108
1502
  createdAt: string;
1109
1503
  updatedAt: string;
1110
1504
  };
@@ -1113,11 +1507,66 @@ export type CreateSessionResponse = Session & {
1113
1507
  initialTurnId: string | null;
1114
1508
  };
1115
1509
  export type SessionSummary = Session;
1116
- /** 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
+ };
1117
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;
1118
1559
  pinned: Session[];
1119
1560
  /** True when the server omitted older pins from its bounded pinned section. */
1120
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;
1121
1570
  sessions: Session[];
1122
1571
  nextCursor: string | null;
1123
1572
  };
@@ -1217,6 +1666,21 @@ export type UpdateSessionAttentionRequest = {
1217
1666
  activelyWorking?: boolean;
1218
1667
  expectedVersion?: number;
1219
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
+ };
1220
1684
  export type UpdateSessionArchiveRequest = {
1221
1685
  archived: boolean;
1222
1686
  expectedVersion?: number;
@@ -1226,6 +1690,7 @@ export type LineageNode = {
1226
1690
  children: LineageNode[];
1227
1691
  };
1228
1692
  export type SessionLineageResponse = {
1693
+ sessionHasSchedules?: boolean | undefined;
1229
1694
  ancestors: SessionSummary[];
1230
1695
  children: LineageNode[];
1231
1696
  truncated: boolean;
@@ -1306,19 +1771,78 @@ export type SessionTurn = {
1306
1771
  createdAt: string;
1307
1772
  updatedAt: string;
1308
1773
  };
1309
- 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
+ };
1310
1823
  export type HumanInputOption = {
1311
1824
  id: string;
1312
1825
  label: string;
1313
1826
  description?: string | null | undefined;
1314
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
+ };
1315
1836
  export type HumanInputQuestion = {
1837
+ skillReview?: SkillReviewReference | null | undefined;
1316
1838
  id: string;
1317
1839
  kind: HumanInputQuestionKind;
1318
1840
  prompt: string;
1319
1841
  label?: string | null | undefined;
1320
1842
  helpText?: string | null | undefined;
1321
1843
  options: HumanInputOption[];
1844
+ /** Required exactly when `kind` is "secret"; null otherwise. */
1845
+ secret?: HumanInputSecretSpec | null | undefined;
1322
1846
  required: boolean;
1323
1847
  allowOther: boolean;
1324
1848
  validation?: {
@@ -1330,6 +1854,8 @@ export type HumanInputAnswer = {
1330
1854
  questionId: string;
1331
1855
  values: string[];
1332
1856
  other?: string | null | undefined;
1857
+ /** Secret questions: the saved reference, never the value. */
1858
+ secret?: HumanInputSecretAnswerResult | undefined;
1333
1859
  };
1334
1860
  export type HumanInputResponse = {
1335
1861
  outcome: "answered";
@@ -1340,6 +1866,8 @@ export type HumanInputResponse = {
1340
1866
  export type SubmitHumanInputResponseRequest = {
1341
1867
  outcome: "answered";
1342
1868
  answers: HumanInputAnswer[];
1869
+ /** Write-only secret values; never echoed in events or responses. */
1870
+ secretAnswers?: HumanInputSecretAnswer[] | undefined;
1343
1871
  } | {
1344
1872
  outcome: "skipped";
1345
1873
  };
@@ -1361,10 +1889,10 @@ export type SessionHumanInputRequest = {
1361
1889
  createdAt: string;
1362
1890
  updatedAt: string;
1363
1891
  };
1364
- 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"];
1365
1893
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1366
1894
  /**
1367
- * 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
1368
1896
  * can introduce event types without breaking older SDK consumers.
1369
1897
  */
1370
1898
  export type SessionEventType = KnownSessionEventType | (string & {});
@@ -1374,6 +1902,8 @@ export type SessionEvent = {
1374
1902
  sessionId: string;
1375
1903
  /** Per-session sequence number: positive, contiguous, strictly increasing. */
1376
1904
  sequence: number;
1905
+ /** Server-owned durable high-water mark for a synthetic compact event. */
1906
+ coveredThrough?: number | undefined;
1377
1907
  type: SessionEventType;
1378
1908
  payload: unknown;
1379
1909
  occurredAt: string;
@@ -1485,11 +2015,17 @@ export type SessionEventPage = {
1485
2015
  };
1486
2016
  export type ToolAuthNeededPayload = {
1487
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;
1488
2022
  toolName?: string | null | undefined;
1489
2023
  providerDomain: string;
1490
2024
  provider?: string | undefined;
1491
2025
  connectionId?: string | null | undefined;
1492
- 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;
1493
2029
  scopes?: string[] | undefined;
1494
2030
  resource?: string | undefined;
1495
2031
  selectedResources?: Array<{
@@ -1507,6 +2043,15 @@ export type ToolAuthNeededPayload = {
1507
2043
  rationale: string;
1508
2044
  requiredVariables: string[];
1509
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;
1510
2055
  };
1511
2056
  export type AgentTextDeltaPayload = {
1512
2057
  text: string;
@@ -1519,6 +2064,11 @@ export type AgentToolCallCreatedPayload = {
1519
2064
  name: string;
1520
2065
  arguments: unknown;
1521
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;
1522
2072
  };
1523
2073
  export type AgentToolCallOutputPayload = {
1524
2074
  id: string | null;
@@ -1552,7 +2102,7 @@ export type CodexFleetDecisionEventPayload = {
1552
2102
  actual: {
1553
2103
  outcome: "selected" | "waiting" | "none";
1554
2104
  candidateKey: string | null;
1555
- reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "none";
2105
+ reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "allocator_disabled" | "none";
1556
2106
  };
1557
2107
  comparison: CodexFleetShadowComparison;
1558
2108
  replay: {
@@ -1672,11 +2222,16 @@ export type FsTreeNode = {
1672
2222
  truncated: boolean;
1673
2223
  };
1674
2224
  export type FsEncoding = "utf8" | "base64";
2225
+ export type FileSystemRouteIdentity = {
2226
+ epoch: number;
2227
+ root: string;
2228
+ };
1675
2229
  export type FsListRequest = {
1676
2230
  path?: string;
1677
2231
  depth?: number;
1678
2232
  maxEntries?: number;
1679
2233
  includeHidden?: boolean;
2234
+ route?: FileSystemRouteIdentity;
1680
2235
  };
1681
2236
  export type FsListResponse = {
1682
2237
  root: FsTreeNode;
@@ -1691,8 +2246,11 @@ export type FsListBatchResponse = {
1691
2246
  };
1692
2247
  export type FsReadRequest = {
1693
2248
  path: string;
2249
+ /** Confine this read to the session's working directory, refusing symlinks. */
2250
+ workspaceOnly?: boolean;
1694
2251
  encoding?: FsEncoding;
1695
2252
  maxBytes?: number;
2253
+ route?: FileSystemRouteIdentity;
1696
2254
  };
1697
2255
  export type FsReadResponse = {
1698
2256
  path: string;
@@ -1719,6 +2277,7 @@ export type FsWriteRequest = {
1719
2277
  content: string;
1720
2278
  overwrite?: boolean;
1721
2279
  createParents?: boolean;
2280
+ route?: FileSystemRouteIdentity;
1722
2281
  };
1723
2282
  export type FsWriteResponse = {
1724
2283
  path: string;
@@ -1728,6 +2287,7 @@ export type FsWriteResponse = {
1728
2287
  export type FsDeleteRequest = {
1729
2288
  path: string;
1730
2289
  recursive?: boolean;
2290
+ route?: FileSystemRouteIdentity;
1731
2291
  };
1732
2292
  export type FsDeleteResponse = {
1733
2293
  revision: number;
@@ -1737,6 +2297,7 @@ export type FsMoveRequest = {
1737
2297
  newPath: string;
1738
2298
  overwrite?: boolean;
1739
2299
  createParents?: boolean;
2300
+ route?: FileSystemRouteIdentity;
1740
2301
  };
1741
2302
  export type FsMoveResponse = {
1742
2303
  path: string;
@@ -1746,6 +2307,7 @@ export type FsMoveResponse = {
1746
2307
  export type FsMkdirRequest = {
1747
2308
  path: string;
1748
2309
  recursive?: boolean;
2310
+ route?: FileSystemRouteIdentity;
1749
2311
  };
1750
2312
  export type FsMkdirResponse = {
1751
2313
  path: string;
@@ -2106,11 +2668,32 @@ export type IncidentTelemetryPreflightInput = Omit<IncidentTelemetryPreflight, "
2106
2668
  requiredVariableNames?: string[] | undefined;
2107
2669
  };
2108
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;
2109
2685
  prompt: string;
2110
2686
  resources: ResourceRef[];
2111
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;
2112
2693
  metadata: Record<string, unknown>;
2113
2694
  slackBotConnectionId?: string | undefined;
2695
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
2696
+ slackBotChannelId?: string | undefined;
2114
2697
  model?: string | undefined;
2115
2698
  reasoningEffort?: ReasoningEffort | undefined;
2116
2699
  sandboxBackend?: SandboxBackend | undefined;
@@ -2122,6 +2705,8 @@ export type ScheduledTaskAgentConfig = {
2122
2705
  executionClass?: "incident_telemetry" | undefined;
2123
2706
  incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
2124
2707
  maxNestedAgentDepth?: number | undefined;
2708
+ /** Seconds a run may wait on a person before the scheduler answers for it. */
2709
+ approvalTimeoutSeconds?: number | undefined;
2125
2710
  };
2126
2711
  export type ScopedKnowledgeScope = {
2127
2712
  kind: "organization";
@@ -2172,6 +2757,13 @@ export type ScheduledTask = {
2172
2757
  accountId: string;
2173
2758
  workspaceId: string;
2174
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;
2175
2767
  status: ScheduledTaskStatus;
2176
2768
  schedule: ScheduledTaskScheduleSpec;
2177
2769
  temporalScheduleId: string;
@@ -2181,25 +2773,155 @@ export type ScheduledTask = {
2181
2773
  agentConfig: ScheduledTaskAgentConfig;
2182
2774
  createdBy?: TurnInitiator | undefined;
2183
2775
  createdByContext?: TurnInitiatorContext | undefined;
2184
- personalConnections?: McpPersonalConnectionSummary[] | undefined;
2185
2776
  authorityRevision: number;
2186
2777
  executionDigest: string;
2187
2778
  targetSessionId: string | null;
2188
2779
  reusableSessionId: string | null;
2780
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. Use `vaultPolicy`. */
2189
2781
  variableSetId: string | null;
2190
- /** @deprecated use variableSetId */
2782
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy selection. */
2191
2783
  environmentId: string | null;
2192
2784
  rigId: string | null;
2785
+ /** Vaults every run may resolve secret references from (the task vault is always included). */
2786
+ vaultPolicy?: VaultPolicy | undefined;
2193
2787
  metadata: Record<string, unknown>;
2194
2788
  createdAt: string;
2195
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;
2196
2898
  };
2197
2899
  export type CreateSessionRequest = {
2900
+ /** Omitted: defaults/inheritance; []: no bundled guidance. Children cannot widen. */
2901
+ bundledSkillIds?: BundledSkillId[] | undefined;
2902
+ excludedMcpServerIds?: string[] | undefined;
2198
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;
2199
2914
  visibility?: SessionVisibility | undefined;
2200
2915
  initialMessage?: string | undefined;
2201
- /** Create an idle session shell so realtime voice can be the first interaction. */
2202
- 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;
2203
2925
  /** Model-visible application context attached to the initial user message; omitted by standard timeline rendering. */
2204
2926
  modelContext?: string | undefined;
2205
2927
  instructions?: string | undefined;
@@ -2207,7 +2929,15 @@ export type CreateSessionRequest = {
2207
2929
  policyRole?: string | undefined;
2208
2930
  resources?: ResourceRef[] | undefined;
2209
2931
  /** Inline skills fixed onto this session; omitted children inherit them. */
2210
- 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
+ */
2211
2941
  tools?: ToolRef[] | undefined;
2212
2942
  metadata?: Record<string, unknown> | undefined;
2213
2943
  model?: string | undefined;
@@ -2216,34 +2946,47 @@ export type CreateSessionRequest = {
2216
2946
  sandboxBackend?: SandboxBackend | undefined;
2217
2947
  targetSandboxId?: string | undefined;
2218
2948
  workingDir?: string | undefined;
2219
- /** Ordered low-to-high precedence; later sets win name collisions. */
2220
- variableSetIds?: string[] | undefined;
2221
- variableSetId?: string | undefined;
2222
- /** @deprecated use variableSetId */
2223
- environmentId?: string | undefined;
2224
2949
  rigId?: string | undefined;
2225
2950
  goal?: GoalSpec | undefined;
2226
2951
  clientEventId?: string | undefined;
2227
2952
  idempotencyKey?: string | undefined;
2228
2953
  expectedNewSessionDraftRevision?: number | undefined;
2954
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
2229
2955
  maxNestedAgentDepth?: number | undefined;
2230
2956
  firstPartyMcpPermissions?: string[] | undefined;
2231
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;
2232
2964
  mcpServers?: SessionMcpServerInput[] | undefined;
2965
+ mcpApprovalPolicies?: Record<string, SessionMcpApprovalPolicy> | undefined;
2966
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
2233
2967
  /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2234
2968
  personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
2235
2969
  sandbox?: "shared" | "new" | {
2236
2970
  groupId: string;
2237
2971
  } | undefined;
2238
- };
2239
- 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"];
2240
2983
  export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
2241
2984
  /**
2242
- * 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
2243
2986
  * can introduce permissions without breaking older SDK consumers.
2244
2987
  */
2245
2988
  export type Permission = KnownPermission | (string & {});
2246
- 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";
2247
2990
  export type ProductAccessMode = "local" | "configured" | "managed";
2248
2991
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
2249
2992
  export type ModelCapabilityStateV1 = {
@@ -2286,19 +3029,23 @@ export type ModelCredentialSourceV1 = {
2286
3029
  mechanism: "api_key" | "azure_ad_bearer";
2287
3030
  } | {
2288
3031
  kind: "connected_subscription";
2289
- provider: "codex" | "xai";
3032
+ provider: "codex" | "xai" | "claude";
2290
3033
  } | {
2291
3034
  kind: "workspace_connection";
2292
3035
  mechanism: "api_key";
3036
+ } | {
3037
+ kind: "organization_connection";
3038
+ mechanism: "api_key";
2293
3039
  };
2294
3040
  export type ModelBillingAttributionV1 = {
2295
- upstreamPayer: "deployment" | "workspace" | "connected_subscription";
3041
+ upstreamPayer: "deployment" | "workspace" | "organization" | "connected_subscription";
2296
3042
  metering: "opengeni_credits" | "external";
2297
3043
  };
2298
- export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace";
3044
+ export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace" | "organization";
2299
3045
  export type ModelPricingV1 = {
2300
3046
  inputMicrosPerMillionTokens: number;
2301
3047
  cachedInputMicrosPerMillionTokens?: number | undefined;
3048
+ cacheWriteMicrosPerMillionTokens?: number | undefined;
2302
3049
  outputMicrosPerMillionTokens: number;
2303
3050
  marginBps?: number | undefined;
2304
3051
  };
@@ -2320,17 +3067,19 @@ export type ClientModel = {
2320
3067
  label: string;
2321
3068
  /** Optional curated compact label for dense UI (e.g. mobile composer). */
2322
3069
  shortLabel?: string | undefined;
3070
+ /** Optional HTTPS maker logo supplied by the model catalog. */
3071
+ logoUrl?: string | undefined;
2323
3072
  /** Provider id (e.g. `openai`, `azure`, or a registry provider id). */
2324
3073
  provider: string;
2325
3074
  providerLabel: string;
2326
- api: "responses" | "chat";
3075
+ api: "responses" | "chat" | "anthropic-messages";
2327
3076
  source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | "openrouter" | undefined;
2328
3077
  contextWindowTokens?: number | undefined;
2329
3078
  schemaVersion?: 1 | undefined;
2330
3079
  aliases?: string[] | undefined;
2331
3080
  deployment?: {
2332
3081
  upstreamModelId: string;
2333
- wireApi: "responses" | "chat";
3082
+ wireApi: "responses" | "chat" | "anthropic-messages";
2334
3083
  } | undefined;
2335
3084
  executionLimits?: {
2336
3085
  contextWindowTokens: number | null;
@@ -2348,7 +3097,7 @@ export type ClientModel = {
2348
3097
  export type ModelAvailabilityV1 = {
2349
3098
  status: "available" | "unavailable" | "degraded" | "unknown";
2350
3099
  selectable: boolean;
2351
- 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;
2352
3101
  checkedAt: string | null;
2353
3102
  };
2354
3103
  export type ModelCredentialReadinessV1 = {
@@ -2358,13 +3107,39 @@ export type ModelCredentialReadinessV1 = {
2358
3107
  checkedAt: string | null;
2359
3108
  };
2360
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;
2361
3121
  credentialReadiness: ModelCredentialReadinessV1;
3122
+ creditFunding?: "promotional" | "general" | "unavailable" | undefined;
2362
3123
  /** Exact workspace-policy verdict without exposing provider identity. */
2363
3124
  policyAllowed?: boolean | undefined;
2364
3125
  availability: ModelAvailabilityV1;
2365
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
+ };
2366
3134
  export type WorkspaceModelCatalogResponse = {
2367
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;
2368
3143
  };
2369
3144
  export type WorkspaceGatewayCustomModel = {
2370
3145
  id: string;
@@ -2392,6 +3167,70 @@ export type WorkspaceOpenRouterCustomModelsResponse = {
2392
3167
  };
2393
3168
  export type CreateWorkspaceOpenRouterCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
2394
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;
2395
3234
  /**
2396
3235
  * The workspace's hard model/provider allowlist. `null` means unrestricted for
2397
3236
  * that dimension; an empty array is an explicit total block.
@@ -2399,8 +3238,309 @@ export type DeleteWorkspaceOpenRouterCustomModelRequest = DeleteWorkspaceGateway
2399
3238
  export type WorkspaceModelAccessPolicy = {
2400
3239
  allowedProviders: string[] | null;
2401
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;
2402
3257
  };
2403
- /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
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`. */
2404
3544
  export type UpdateWorkspaceModelAccessPolicyRequest = {
2405
3545
  allowedProviders?: string[] | null | undefined;
2406
3546
  allowedModels?: string[] | null | undefined;
@@ -2424,6 +3564,12 @@ export type CodexConnectionStatus = {
2424
3564
  label?: string | null;
2425
3565
  chatgptAccountId?: string | null;
2426
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;
2427
3573
  /** How many Codex accounts the workspace has connected. */
2428
3574
  accountCount?: number;
2429
3575
  source?: WorkspaceCodexSubscriptionSource;
@@ -2437,6 +3583,13 @@ export type WorkspaceCodexSubscriptionSource = {
2437
3583
  effectiveSource: "workspace" | "organization" | "disabled";
2438
3584
  workspaceAvailable: boolean;
2439
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;
2440
3593
  };
2441
3594
  /**
2442
3595
  * One normalized Codex usage window (5h or weekly), camelCase end-to-end (the
@@ -2475,22 +3628,48 @@ export type CodexUsagePayload = {
2475
3628
  meteredFeature: string;
2476
3629
  fiveHour: CodexUsageWindow | null;
2477
3630
  weekly: CodexUsageWindow | null;
3631
+ unknownWindowExhausted: boolean;
2478
3632
  }>;
2479
3633
  credits?: {
2480
3634
  hasCredits: boolean;
2481
3635
  unlimited: boolean;
2482
3636
  overageLimitReached: boolean;
2483
- balance: string;
3637
+ balance: string | null;
2484
3638
  };
2485
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
+ };
2486
3649
  /** One connected Codex (ChatGPT) account in a workspace (multi-account P1). Metadata only. */
2487
3650
  export type CodexAccount = {
2488
3651
  id: string;
2489
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[];
2490
3658
  chatgptAccountId?: string | null;
2491
3659
  label?: string | null;
2492
3660
  email?: string | null;
2493
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[];
2494
3673
  status: "active" | "needs_relogin" | "error";
2495
3674
  active: boolean;
2496
3675
  expiresAt?: string | null;
@@ -2501,6 +3680,9 @@ export type CodexAccount = {
2501
3680
  usageCheckedAt?: string | null;
2502
3681
  exhaustedUntil?: string | null;
2503
3682
  /** Controls only NEW automatic allocations. */
3683
+ extraCreditsEnabled?: boolean;
3684
+ extraCreditsVersion?: number;
3685
+ extraCreditsUpdatedAt?: string | null;
2504
3686
  allocatorEnabled: boolean;
2505
3687
  /** Independent OCC sequence; credential/token `version` is never exposed. */
2506
3688
  allocatorVersion: number;
@@ -2600,6 +3782,17 @@ export type CodexAccountsResponse = {
2600
3782
  settings: CodexRotationSettings;
2601
3783
  };
2602
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
+ };
2603
3796
  export type CodexAppsUpdate = {
2604
3797
  credentialId: string | null;
2605
3798
  version: number;
@@ -2631,10 +3824,11 @@ export type CodexConnectPoll = {
2631
3824
  isActive?: boolean;
2632
3825
  };
2633
3826
  /** Explicit authority of one connected SuperGrok/xAI subscription account. */
2634
- export type SuperGrokAccountScope = "workspace" | "user";
3827
+ export type SuperGrokAccountScope = "workspace" | "user" | "organization";
2635
3828
  /** Metadata-only connected SuperGrok account. Secret OAuth material never crosses the API. */
2636
3829
  export type SuperGrokAccount = {
2637
3830
  id: string;
3831
+ plan?: string | null;
2638
3832
  scope: SuperGrokAccountScope;
2639
3833
  subject: string;
2640
3834
  email?: string | null;
@@ -2663,6 +3857,8 @@ export type SuperGrokRotationSettings = {
2663
3857
  };
2664
3858
  /** GET /supergrok/accounts — visible accounts plus the workspace active pointer. */
2665
3859
  export type SuperGrokAccountsResponse = {
3860
+ source?: "workspace" | "user" | "organization";
3861
+ organizationId?: string;
2666
3862
  accounts: SuperGrokAccount[];
2667
3863
  activeAccountId: string | null;
2668
3864
  settings: SuperGrokRotationSettings;
@@ -2735,8 +3931,13 @@ export type ClientAuthConfig = {
2735
3931
  emailVerificationRequired?: boolean;
2736
3932
  /** Configured managed sign-in providers; omitted by older deployments. */
2737
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;
2738
3939
  };
2739
- 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";
2740
3941
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2741
3942
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2742
3943
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2749,8 +3950,16 @@ export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
2749
3950
  */
2750
3951
  export type ClientConfig = {
2751
3952
  deploymentRevision: string;
2752
- 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;
2753
3959
  serverVersion?: string | undefined;
3960
+ claudeSubscriptionEnabled?: boolean | undefined;
3961
+ /** Whether people can connect their own computers; absent on older servers. */
3962
+ connectedMachines?: boolean | undefined;
2754
3963
  defaultModel: string;
2755
3964
  allowedModels: string[];
2756
3965
  models: ClientModel[];
@@ -2761,7 +3970,7 @@ export type ClientConfig = {
2761
3970
  id: string;
2762
3971
  name: string;
2763
3972
  }[];
2764
- /** Deployment defaults and hard maximum for built-in OpenGeni session tools. */
3973
+ /** Deployment defaults and hard maximum for built-in Opengeni session tools. */
2765
3974
  firstPartyMcpTools?: {
2766
3975
  default: FirstPartyMcpToolName[];
2767
3976
  allowed: FirstPartyMcpToolName[];
@@ -2770,11 +3979,93 @@ export type ClientConfig = {
2770
3979
  enabled: boolean;
2771
3980
  maxSizeBytes: number;
2772
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;
2773
4031
  /** Native browser microphone capture + server-side transcription capability. */
2774
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;
2775
4059
  productAccessMode: ProductAccessMode;
4060
+ /** Client-safe hint for whether the console should offer Stripe checkout. */
4061
+ billingMode?: BillingMode | undefined;
2776
4062
  managedAuthSessionSetMode: "legacy" | "dual" | "broker";
2777
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;
2778
4069
  analytics: {
2779
4070
  consentRequired: boolean;
2780
4071
  providers: {
@@ -2790,6 +4081,13 @@ export type ClientConfig = {
2790
4081
  } | undefined;
2791
4082
  };
2792
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;
2793
4091
  structuredServices: {
2794
4092
  fileSystem: boolean;
2795
4093
  git: boolean;
@@ -2799,6 +4097,7 @@ export type ClientConfig = {
2799
4097
  /** Client-safe voice-input capability projection. */
2800
4098
  export type ClientVoiceInputConfig = {
2801
4099
  available: boolean;
4100
+ providers?: VoiceInputProviderId[] | undefined;
2802
4101
  maxDurationSeconds: number;
2803
4102
  maxSizeBytes: number;
2804
4103
  acceptedMimeTypes: string[];
@@ -2810,7 +4109,7 @@ export type ClientResumableVoiceInputConfig = {
2810
4109
  maxChunkSizeBytes: number;
2811
4110
  providerSegmentSeconds: number;
2812
4111
  };
2813
- 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";
2814
4113
  export type TranscriptionRecordingState = "uploading" | "segmenting" | "ready" | "transcribing" | "complete" | "failed" | "discarded";
2815
4114
  export type TranscriptionRecordingSegmentState = "preparing" | "pending" | "transcribing" | "complete" | "failed";
2816
4115
  export type TranscriptionRecordingSegment = {
@@ -2883,11 +4182,43 @@ export type AccessGrant = {
2883
4182
  subjectId: string;
2884
4183
  subjectLabel?: string | undefined;
2885
4184
  permissions: Permission[];
4185
+ /** Explicit policies never expand `workspace:admin` into unselected permissions. */
4186
+ permissionMode?: "legacy" | "explicit" | undefined;
2886
4187
  principalKind?: AccessPrincipalKind | undefined;
2887
4188
  metadata?: Record<string, unknown> | undefined;
2888
4189
  serviceInitiator?: ServiceTurnInitiator | undefined;
2889
4190
  serviceInitiatorContext?: ServiceTurnInitiatorContext | undefined;
2890
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. */
2891
4222
  export type AccessContext = {
2892
4223
  mode: ProductAccessMode;
2893
4224
  subjectId: string;
@@ -2896,6 +4227,15 @@ export type AccessContext = {
2896
4227
  workspaceGrants: AccessGrant[];
2897
4228
  defaultAccountId: string | null;
2898
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;
2899
4239
  };
2900
4240
  export type ManagedOrganizationMembership = {
2901
4241
  id: string;
@@ -2931,7 +4271,7 @@ export type UserResourceAuthoritySummary = {
2931
4271
  grants: UserResourceAuthorityGrant[];
2932
4272
  };
2933
4273
  export type ListUserResourceAuthoritiesOptions = {
2934
- resourceKind: UserResourceKind;
4274
+ resourceKind: Exclude<UserResourceKind, "connection">;
2935
4275
  cursor?: string | undefined;
2936
4276
  limit?: number | undefined;
2937
4277
  };
@@ -2942,7 +4282,7 @@ export type ListUserResourceAuthoritiesResponse = {
2942
4282
  };
2943
4283
  export type IssueUserResourceGrantRequest = {
2944
4284
  scope: "user";
2945
- resourceKind: UserResourceKind;
4285
+ resourceKind: Exclude<UserResourceKind, "connection">;
2946
4286
  mode: "session";
2947
4287
  context: "user_private" | "workspace_shared";
2948
4288
  sessionId: string;
@@ -2950,7 +4290,7 @@ export type IssueUserResourceGrantRequest = {
2950
4290
  workspaceSharedAcknowledged?: boolean | undefined;
2951
4291
  } | {
2952
4292
  scope: "user";
2953
- resourceKind: UserResourceKind;
4293
+ resourceKind: Exclude<UserResourceKind, "connection">;
2954
4294
  mode: "always";
2955
4295
  context: "user_private" | "workspace_shared";
2956
4296
  sessionId?: null | undefined;
@@ -3117,6 +4457,16 @@ export type CreateOrganizationResponse = {
3117
4457
  organization: OrganizationSummary;
3118
4458
  workspaceId: string;
3119
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
+ };
3120
4470
  export type UpdateOrganizationNameRequest = {
3121
4471
  name: string;
3122
4472
  expectedUpdatedAt: string;
@@ -3293,6 +4643,8 @@ export type Workspace = {
3293
4643
  agentInstructions: string | null;
3294
4644
  settings: Record<string, unknown>;
3295
4645
  inferenceControl: {
4646
+ timer?: WorkspacePauseTimer | null | undefined;
4647
+ serverTime?: string | undefined;
3296
4648
  state: "active" | "paused";
3297
4649
  revision: number;
3298
4650
  reason: string | null;
@@ -3304,6 +4656,8 @@ export type Workspace = {
3304
4656
  updatedAt: string;
3305
4657
  };
3306
4658
  export type WorkspaceSettings = {
4659
+ /** Exact product-model preferences. Invalid/newer values are ignored per model. */
4660
+ modelCompactionThresholds?: unknown;
3307
4661
  memoryEnabled?: boolean | undefined;
3308
4662
  /** Reversible Memory V1 prompt composition rollout. */
3309
4663
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
@@ -3311,6 +4665,8 @@ export type WorkspaceSettings = {
3311
4665
  sessionDefaults?: WorkspaceSessionDefaults | undefined;
3312
4666
  /** Exact capability selection inherited by new top-level sessions. */
3313
4667
  sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
4668
+ /** Allowlisted sandbox image for new managed boxes; absent uses the deployment image. */
4669
+ defaultSandboxImage?: string | null | undefined;
3314
4670
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3315
4671
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3316
4672
  maxNestedAgentDepth?: number | null | undefined;
@@ -3318,9 +4674,13 @@ export type WorkspaceSettings = {
3318
4674
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3319
4675
  /** Whether agents may invoke the built-in structured human-input tool. */
3320
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;
3321
4679
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3322
4680
  /** Slack orchestration notices; both default off when absent or invalid. */
3323
4681
  slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
4682
+ /** False blocks every model billed in Opengeni credits; absent allows them. */
4683
+ allowCreditModels?: boolean | undefined;
3324
4684
  [key: string]: unknown;
3325
4685
  };
3326
4686
  export type WorkspaceSessionDefaults = {
@@ -3328,8 +4688,9 @@ export type WorkspaceSessionDefaults = {
3328
4688
  reasoningEffort: ReasoningEffort;
3329
4689
  };
3330
4690
  export type WorkspaceSessionToolDefaults = {
3331
- mcpServerIds: string[];
3332
- firstPartyMcpTools: FirstPartyMcpToolName[];
4691
+ inheritConnectedMcpServers?: boolean | undefined;
4692
+ mcpServerIds?: string[];
4693
+ firstPartyMcpTools?: FirstPartyMcpToolName[];
3333
4694
  };
3334
4695
  export type WorkspaceSlackReactionSummonSettings = {
3335
4696
  enabled: boolean;
@@ -3378,21 +4739,41 @@ export type UpdateSlackChannelRoutesRequest = {
3378
4739
  targetWorkspaceId: string | null;
3379
4740
  }>;
3380
4741
  };
4742
+ export type VoiceInputProviderId = "azure-mai" | "supergrok-subscription" | "codex-subscription" | "openai" | "azure-openai";
3381
4743
  export type WorkspaceVoiceInputSettings = {
3382
4744
  enabled: boolean;
4745
+ preferredProvider?: VoiceInputProviderId | null | undefined;
4746
+ fallbackEnabled?: boolean | undefined;
3383
4747
  };
3384
4748
  export type UpdateWorkspaceSettingsRequest = {
4749
+ /** Independent model patches; null restores that model's default. */
4750
+ modelCompactionThresholds?: Record<string, number | null>;
3385
4751
  memoryEnabled?: boolean | undefined;
3386
4752
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3387
- sessionDefaults?: WorkspaceSessionDefaults | undefined;
3388
- 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;
3389
4760
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3390
4761
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3391
4762
  maxNestedAgentDepth?: number | null | undefined;
3392
4763
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3393
4764
  agentHumanInputEnabled?: boolean | undefined;
4765
+ codeSearchEnabled?: boolean | null | undefined;
3394
4766
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3395
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;
3396
4777
  [key: string]: unknown;
3397
4778
  };
3398
4779
  export type SetWorkspaceDefaultRigRequest = {
@@ -3407,7 +4788,12 @@ export type CreateWorkspaceRequest = {
3407
4788
  agentInstructions?: string | null | undefined;
3408
4789
  };
3409
4790
  export type EnsureWorkspaceRequest = {
3410
- 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;
3411
4797
  externalSource: string;
3412
4798
  externalId: string;
3413
4799
  name: string;
@@ -3423,6 +4809,34 @@ export type UpdateWorkspaceRequest = {
3423
4809
  slug?: string | null | undefined;
3424
4810
  agentInstructions?: string | null | undefined;
3425
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";
3426
4840
  export type ApiKey = {
3427
4841
  id: string;
3428
4842
  accountId: string;
@@ -3431,6 +4845,18 @@ export type ApiKey = {
3431
4845
  description: string | null;
3432
4846
  prefix: string;
3433
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;
3434
4860
  expiresAt: string | null;
3435
4861
  revokedAt: string | null;
3436
4862
  lastUsedAt: string | null;
@@ -3452,71 +4878,399 @@ export type CreateOrganizationApiKeyRequest = {
3452
4878
  name: string;
3453
4879
  description?: string | undefined;
3454
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;
3455
4896
  };
3456
4897
  export type ListApiKeysResponse = {
3457
4898
  apiKeys: ApiKey[];
3458
4899
  };
3459
- export type WorkspaceMember = {
3460
- subjectId: string;
3461
- subjectLabel: string | null;
3462
- role: string;
3463
- 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;
3464
4911
  createdAt: string;
4912
+ updatedAt: string;
3465
4913
  };
3466
- export type ListWorkspaceMembersResponse = {
3467
- members: WorkspaceMember[];
4914
+ export type ListOrganizationServiceAccountsResponse = {
4915
+ serviceAccounts: OrganizationServiceAccount[];
3468
4916
  };
3469
- export type WorkspaceMemberCandidate = {
3470
- organizationMembershipId: string;
3471
- subjectId: string;
3472
- name: string | null;
3473
- email: string | null;
3474
- organizationRole: "owner" | "admin" | "member";
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;
3475
4922
  };
3476
- export type ListWorkspaceMemberCandidatesResponse = {
3477
- members: WorkspaceMemberCandidate[];
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;
3478
4928
  };
3479
- export type AddWorkspaceMemberRequest = {
3480
- organizationMembershipId: string;
3481
- role?: string | undefined;
3482
- 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;
3483
4948
  };
3484
- export type UpdateWorkspaceMemberRequest = {
3485
- role?: string | undefined;
3486
- permissions: Permission[];
4949
+ export type OrganizationMcpConnectionList = {
4950
+ connections: OrganizationMcpConnection[];
4951
+ /** Owners and admins see and can disconnect everyone's agents. */
4952
+ canManageAll: boolean;
3487
4953
  };
3488
- export type SlackUserLinkAccessRequestStatus = "prepared" | "pending" | "completed" | "denied" | "cancelled" | "expired";
3489
- /** Token-free durable projection of one signed Slack identity-link intent. */
3490
- export type SlackUserLinkAccessRequest = {
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 = {
3491
4962
  id: string;
3492
- workspaceId: string;
3493
- workspaceDisplayName: string | null;
3494
- subjectLabel: string | null;
3495
- status: SlackUserLinkAccessRequestStatus;
3496
- version: number;
3497
- expiresAt: string;
3498
- requestedAt: string | null;
3499
- decidedAt: string | null;
3500
- completedAt: string | null;
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;
3501
4975
  createdAt: string;
3502
- updatedAt: string;
3503
- };
3504
- export type PrepareSlackUserLinkAccessRequest = {
3505
- linkToken: string;
3506
4976
  };
3507
- export type SlackUserLinkAccessMutationRequest = {
3508
- expectedVersion: number;
3509
- idempotencyKey: string;
4977
+ export type ListPersonalApiKeysResponse = {
4978
+ apiKeys: PersonalApiKey[];
4979
+ /** Owners and admins see everyone's keys and can revoke them. */
4980
+ canManageAll: boolean;
3510
4981
  };
3511
- export type ApproveSlackUserLinkAccessRequest = SlackUserLinkAccessMutationRequest & {
3512
- role?: string | undefined;
3513
- permissions: Permission[];
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;
3514
4988
  };
3515
- export type ListSlackUserLinkAccessRequestsResponse = {
3516
- requests: SlackUserLinkAccessRequest[];
4989
+ export type CreatePersonalApiKeyResponse = {
4990
+ apiKey: PersonalApiKey;
4991
+ /** The full secret token, shown once at creation. */
4992
+ token: string;
3517
4993
  };
3518
- export type SessionGoalStatus = "active" | "paused" | "completed";
3519
- export type SessionGoalCreatedBy = "api" | "agent" | "scheduled_task";
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[];
5241
+ };
5242
+ export type SlackUserLinkAccessRequestStatus = "prepared" | "pending" | "completed" | "denied" | "cancelled" | "expired";
5243
+ /** Token-free durable projection of one signed Slack identity-link intent. */
5244
+ export type SlackUserLinkAccessRequest = {
5245
+ id: string;
5246
+ workspaceId: string;
5247
+ workspaceDisplayName: string | null;
5248
+ subjectLabel: string | null;
5249
+ status: SlackUserLinkAccessRequestStatus;
5250
+ version: number;
5251
+ expiresAt: string;
5252
+ requestedAt: string | null;
5253
+ decidedAt: string | null;
5254
+ completedAt: string | null;
5255
+ createdAt: string;
5256
+ updatedAt: string;
5257
+ };
5258
+ export type PrepareSlackUserLinkAccessRequest = {
5259
+ linkToken: string;
5260
+ };
5261
+ export type SlackUserLinkAccessMutationRequest = {
5262
+ expectedVersion: number;
5263
+ idempotencyKey: string;
5264
+ };
5265
+ export type ApproveSlackUserLinkAccessRequest = SlackUserLinkAccessMutationRequest & {
5266
+ role?: string | undefined;
5267
+ permissions: Permission[];
5268
+ };
5269
+ export type ListSlackUserLinkAccessRequestsResponse = {
5270
+ requests: SlackUserLinkAccessRequest[];
5271
+ };
5272
+ export type SessionGoalStatus = "active" | "paused" | "completed";
5273
+ export type SessionGoalCreatedBy = "api" | "agent" | "scheduled_task";
3520
5274
  export type SessionGoalMutationPolicy = "review_changes" | "preserve_intent" | "autonomous_adaptation";
3521
5275
  export type SessionGoalChangeKind = "refinement" | "adaptation" | "replacement";
3522
5276
  export type SessionGoalRevision = {
@@ -3575,7 +5329,7 @@ export type SessionGoalContinuation = {
3575
5329
  observedRevision: number;
3576
5330
  nextAttemptAt: string | null;
3577
5331
  lastError: string | null;
3578
- /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
5332
+ /** Agent-stated reason for a `wait_for_input` hold; null otherwise. */
3579
5333
  holdReason?: string | null | undefined;
3580
5334
  };
3581
5335
  export type SessionGoal = {
@@ -3587,6 +5341,8 @@ export type SessionGoal = {
3587
5341
  text: string;
3588
5342
  successCriteria: string | null;
3589
5343
  rootConstraints: string[];
5344
+ /** Optional for older-server/source compatibility; current servers always supply this projection. */
5345
+ reportRequirements?: SessionGoalReportRequirement[] | undefined;
3590
5346
  evidence: string | null;
3591
5347
  rationale: string | null;
3592
5348
  pausedReason: string | null;
@@ -3617,10 +5373,6 @@ export type UpdateSessionGoalRequest = {
3617
5373
  export type UpdateSessionRequest = {
3618
5374
  title: string;
3619
5375
  };
3620
- /** Replace the complete ordered low-to-high precedence Variable Set selection. */
3621
- export type UpdateSessionVariableSetsRequest = {
3622
- variableSetIds: string[];
3623
- };
3624
5376
  /** Outcome of a manual /compact trigger. */
3625
5377
  export type CompactSessionContextResult = {
3626
5378
  /** pending waits for the current safe boundary; completed ran while idle. */
@@ -3693,16 +5445,17 @@ export type ComposerDraft = {
3693
5445
  updatedAt: string | null;
3694
5446
  };
3695
5447
  export type NewSessionDraftOptions = {
5448
+ agentLearning?: import("@opengeni/contracts").AgentLearningOverrides | undefined;
5449
+ excludedMcpServerIds?: string[] | undefined;
3696
5450
  visibility?: SessionVisibility | undefined;
3697
5451
  sandboxBackend?: SandboxBackend | undefined;
3698
5452
  targetSandboxId?: string | undefined;
3699
5453
  workingDir?: string | undefined;
3700
- variableSetIds?: string[] | undefined;
3701
- variableSetId?: string | undefined;
3702
5454
  rigId?: string | undefined;
3703
5455
  goal?: GoalSpec | undefined;
3704
5456
  firstPartyMcpPermissions?: Permission[] | undefined;
3705
5457
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
5458
+ agent?: AgentConfigRequest | undefined;
3706
5459
  };
3707
5460
  export type NewSessionSelectionHistory = {
3708
5461
  /** Most-recently used project first. Null channelId is the Default project. */
@@ -3727,6 +5480,13 @@ export type NewSessionDraft = {
3727
5480
  model: string;
3728
5481
  reasoningEffort: ReasoningEffort;
3729
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;
3730
5490
  options: NewSessionDraftOptions;
3731
5491
  selectionHistory: NewSessionSelectionHistory;
3732
5492
  updatedAt: string | null;
@@ -3749,8 +5509,28 @@ export type SessionQueueSnapshot = {
3749
5509
  };
3750
5510
  export type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
3751
5511
  export type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
3752
- 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";
3753
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>);
3754
5534
  export type SessionSystemUpdate = {
3755
5535
  id: string;
3756
5536
  sessionId: string;
@@ -3759,7 +5539,7 @@ export type SessionSystemUpdate = {
3759
5539
  sourceId: string;
3760
5540
  dedupeKey: string;
3761
5541
  summary: string;
3762
- payload: Record<string, unknown>;
5542
+ payload: SessionSystemUpdatePayload;
3763
5543
  lineage: Record<string, unknown>;
3764
5544
  state: SessionSystemUpdateState;
3765
5545
  deliveredTurnId: string | null;
@@ -3767,6 +5547,56 @@ export type SessionSystemUpdate = {
3767
5547
  deliveredAt: string | null;
3768
5548
  createdAt: string;
3769
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
+ };
3770
5600
  export type SessionControlResponse = {
3771
5601
  receipt: SessionCommandReceipt;
3772
5602
  effectiveControl: EffectiveSessionControl;
@@ -3775,6 +5605,19 @@ export type SessionControlResponse = {
3775
5605
  cancelledSessionCount: number;
3776
5606
  cancelledTurnCount: number;
3777
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
+ };
3778
5621
  export type WorkspaceInferenceControlResponse = {
3779
5622
  receipt: SessionCommandReceipt;
3780
5623
  state: "active" | "paused";
@@ -3791,7 +5634,7 @@ export type WorkspaceControlEvent = {
3791
5634
  type: "workspace.control.changed";
3792
5635
  scope: "workspace" | "session";
3793
5636
  rootSessionId: string | null;
3794
- action: "pause" | "resume";
5637
+ action: "pause" | "resume" | "timer_set" | "timer_cancelled";
3795
5638
  automatic: boolean;
3796
5639
  reason: string | null;
3797
5640
  actor: string;
@@ -3848,7 +5691,7 @@ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expecte
3848
5691
  controlEtag?: string;
3849
5692
  modelContext?: string;
3850
5693
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
3851
- connectionAuthorities?: McpConnectionAuthoritySelection[];
5694
+ connectionAccounts?: McpConnectionAccountSelection[];
3852
5695
  personalResourceAttachment?: PersonalResourceAttachmentIntent;
3853
5696
  };
3854
5697
  export type SubmitComposerDraftResponse = {
@@ -3865,11 +5708,28 @@ export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "sel
3865
5708
  };
3866
5709
  /** Input shape for agent config on create/update (server applies defaults). */
3867
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;
3868
5719
  prompt: string;
3869
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
+ */
3870
5726
  tools?: ToolRef[] | undefined;
5727
+ /** Follow the workspace's default connectors at each run, except the excluded ones. */
5728
+ toolPolicy?: ScheduledTaskToolPolicy | undefined;
3871
5729
  metadata?: Record<string, unknown> | undefined;
3872
5730
  slackBotConnectionId?: string | undefined;
5731
+ /** Slack channel a person chose for this task's bot posts; requires slackBotConnectionId. */
5732
+ slackBotChannelId?: string | undefined;
3873
5733
  model?: string | undefined;
3874
5734
  reasoningEffort?: ReasoningEffort | undefined;
3875
5735
  sandboxBackend?: SandboxBackend | undefined;
@@ -3881,23 +5741,46 @@ export type ScheduledTaskAgentConfigInput = {
3881
5741
  executionClass?: "incident_telemetry" | undefined;
3882
5742
  incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
3883
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;
3884
5750
  };
3885
5751
  export type CreateAgentScheduledTaskRequest = {
5752
+ agentLearning?: {
5753
+ scope: "workspace" | "personal";
5754
+ settings: import("./knowledge.js").AgentLearningOverrides;
5755
+ };
3886
5756
  name: string;
3887
5757
  schedule: ScheduledTaskScheduleSpec;
5758
+ /** Who can see it. Omitted: everyone in the workspace. */
5759
+ visibility?: SessionVisibility | undefined;
3888
5760
  action?: {
3889
5761
  kind: "agent_turn";
3890
5762
  } | undefined;
3891
5763
  runMode?: ScheduledTaskRunMode | undefined;
3892
5764
  targetSessionId?: string | null | undefined;
3893
- 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;
3894
5772
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3895
5773
  agentConfig: ScheduledTaskAgentConfigInput;
3896
5774
  status?: ScheduledTaskStatus | undefined;
3897
- variableSetId?: string | null | undefined;
3898
- /** @deprecated use variableSetId */
3899
- 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
+ */
3900
5781
  rigId?: string | null | undefined;
5782
+ /** Vault narrowing for every run; omission adds none. */
5783
+ vaultPolicy?: VaultPolicy | undefined;
3901
5784
  metadata?: Record<string, unknown> | undefined;
3902
5785
  };
3903
5786
  export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
@@ -3910,21 +5793,49 @@ export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
3910
5793
  status?: ScheduledTaskStatus | undefined;
3911
5794
  metadata?: Record<string, unknown> | undefined;
3912
5795
  };
3913
- 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;
3914
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;
3915
5815
  name?: string | undefined;
3916
5816
  schedule?: ScheduledTaskScheduleSpec | undefined;
3917
5817
  runMode?: ScheduledTaskRunMode | undefined;
3918
5818
  targetSessionId?: string | null | undefined;
3919
- 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;
3920
5825
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3921
5826
  action?: ScheduledTaskAction | undefined;
3922
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;
3923
5835
  status?: ScheduledTaskStatus | undefined;
3924
- variableSetId?: string | null | undefined;
3925
- /** @deprecated use variableSetId */
3926
- environmentId?: string | null | undefined;
3927
5836
  rigId?: string | null | undefined;
5837
+ /** Vault narrowing for every run. */
5838
+ vaultPolicy?: VaultPolicy | undefined;
3928
5839
  metadata?: Record<string, unknown> | undefined;
3929
5840
  };
3930
5841
  export type ScheduledTaskRunStatus = "queued" | "dispatched" | "succeeded" | "skipped" | "failed";
@@ -3970,75 +5881,83 @@ export type ScheduledTaskRun = {
3970
5881
  knowledgeSummary: KnowledgeSourceSyncRunSummary | null;
3971
5882
  completedAt: string | null;
3972
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;
3973
5915
  createdAt: string;
3974
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;
3975
5919
  };
3976
- /** Generic variable-set reads expose name + version metadata only. */
3977
- export type VariableSetVariableMetadata = {
3978
- name: string;
3979
- version: number;
3980
- createdAt: string;
3981
- updatedAt: string;
3982
- };
3983
- /** Dedicated permissioned plaintext response; never embedded in metadata reads. */
3984
- export type VariableSetSecret = {
3985
- variableSetId: string;
3986
- name: string;
3987
- version: number;
3988
- value: string;
3989
- };
3990
- export type VariableSet = {
3991
- id: string;
3992
- accountId: string;
3993
- workspaceId: string;
3994
- scope: "organization" | "workspace" | "user";
3995
- generation: number;
3996
- status: "active" | "revoked";
3997
- name: string;
3998
- description: string | null;
3999
- variables: VariableSetVariableMetadata[];
4000
- createdAt: string;
4001
- updatedAt: string;
4002
- };
4003
- /** Exact-ID attachment metadata; intentionally excludes catalog and secret metadata. */
4004
- export type VariableSetAttachmentMetadata = {
4005
- id: string;
4006
- scope: "organization" | "workspace" | "user";
4007
- };
4008
- export type ResolveVariableSetAttachmentsRequest = {
4009
- variableSetIds: string[];
5920
+ export type ScheduledTaskRunAwaitingHuman = {
5921
+ since: string;
5922
+ expiresAt: string | null;
4010
5923
  };
4011
- export type ResolveVariableSetAttachmentsResponse = {
4012
- 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;
4013
5928
  };
4014
- /** @deprecated use VariableSetVariableMetadata */
4015
- export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
4016
- /** @deprecated use VariableSet */
4017
- export type WorkspaceEnvironment = VariableSet;
4018
- export type CreateVariableSetRequest = {
4019
- /** Omitted remains the legacy workspace-owned path. */
4020
- 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;
4021
5933
  name: string;
4022
- description?: string | undefined;
4023
- /** Initial variables. Values are write-only: they never come back on reads. */
4024
- variables?: {
4025
- name: string;
4026
- value: string;
4027
- }[] | undefined;
5934
+ providerDomain: string;
5935
+ reason: ScheduledTaskAccessFailureReason;
5936
+ count: number;
5937
+ firstOccurredAt: string;
4028
5938
  };
4029
- /** @deprecated use CreateVariableSetRequest */
4030
- export type CreateWorkspaceEnvironmentRequest = CreateVariableSetRequest;
4031
- export type UpdateVariableSetRequest = {
4032
- name?: string | undefined;
4033
- 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;
4034
5957
  };
4035
- /** @deprecated use UpdateVariableSetRequest */
4036
- export type UpdateWorkspaceEnvironmentRequest = UpdateVariableSetRequest;
4037
- export type SetVariableSetVariableRequest = {
4038
- value: string;
5958
+ export type ListScheduledTaskAccessAttentionResponse = {
5959
+ tasks: ScheduledTaskAccessAttention[];
4039
5960
  };
4040
- /** @deprecated use SetVariableSetVariableRequest */
4041
- export type SetWorkspaceEnvironmentVariableRequest = SetVariableSetVariableRequest;
4042
5961
  export type RigCheck = {
4043
5962
  name: string;
4044
5963
  command: string;
@@ -4081,6 +6000,7 @@ export type RigVersion = {
4081
6000
  setupScript: string | null;
4082
6001
  checks: RigCheck[];
4083
6002
  credentialHooks: string[];
6003
+ /** @deprecated Variable Sets were replaced by vaults; inert legacy data. */
4084
6004
  defaultVariableSetIds: string[];
4085
6005
  changelog: string | null;
4086
6006
  providerImages: Partial<Record<SandboxBackend, RigProviderImage>>;
@@ -4178,7 +6098,6 @@ export type CreateRigRequest = {
4178
6098
  setupScript?: string | undefined;
4179
6099
  checks?: RigCheck[] | undefined;
4180
6100
  credentialHooks?: string[] | undefined;
4181
- defaultVariableSetIds?: string[] | undefined;
4182
6101
  };
4183
6102
  export type UpdateRigRequest = {
4184
6103
  name?: string | undefined;
@@ -4193,7 +6112,6 @@ export type RigDefinitionEditPayload = {
4193
6112
  setupScript?: string | null | undefined;
4194
6113
  checks?: RigCheck[] | undefined;
4195
6114
  credentialHooks?: string[] | undefined;
4196
- defaultVariableSetIds?: string[] | undefined;
4197
6115
  changelog?: string | null | undefined;
4198
6116
  };
4199
6117
  export type ProposeRigChangeRequest = {
@@ -4204,7 +6122,17 @@ export type ProposeRigChangeRequest = {
4204
6122
  payload: RigDefinitionEditPayload;
4205
6123
  };
4206
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
+ };
4207
6134
  export type FileAsset = {
6135
+ scope?: "workspace" | "personal" | undefined;
4208
6136
  id: string;
4209
6137
  workspaceId: string;
4210
6138
  status: FileStatus;
@@ -4224,7 +6152,7 @@ export declare const RETAINED_OUTPUT_MAX_PAGE_BYTES: number;
4224
6152
  export declare const COMPUTER_SCREENSHOT_MAX_BYTES: number;
4225
6153
  export declare const GENERATED_IMAGE_MAX_BYTES: number;
4226
6154
  export declare const GENERATED_VIDEO_MAX_BYTES: number;
4227
- 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";
4228
6156
  export type RetainedOutputUnavailableReason = "not_retained" | "pending" | "failed" | "expired" | "deleted" | "missing_storage" | "storage_write_failed" | "quota_exceeded" | "invalid_content" | "oversized" | "unsupported";
4229
6157
  export type RetainedArtifactReference = {
4230
6158
  available: true;
@@ -4395,6 +6323,7 @@ export type RetainedArtifactDownload = {
4395
6323
  bytes: Uint8Array;
4396
6324
  };
4397
6325
  export type CreateFileUploadRequest = {
6326
+ scope?: "workspace" | "personal";
4398
6327
  filename: string;
4399
6328
  contentType: string;
4400
6329
  sizeBytes: number;
@@ -4420,6 +6349,7 @@ export type FileDownloadUrlResponse = {
4420
6349
  /** Bytes accepted by the `uploadFile` helper. */
4421
6350
  export type FileUploadData = Blob | ArrayBuffer | Uint8Array | string;
4422
6351
  export type UploadFileInput = {
6352
+ scope?: "workspace" | "personal";
4423
6353
  filename: string;
4424
6354
  contentType: string;
4425
6355
  data: FileUploadData;
@@ -4673,313 +6603,69 @@ export type KnowledgeMemory = {
4673
6603
  };
4674
6604
  export type CreateKnowledgeMemoryRequest = {
4675
6605
  status?: KnowledgeMemoryStatus | undefined;
4676
- kind?: KnowledgeMemoryKind | undefined;
4677
- scope?: string | undefined;
4678
- text: string;
4679
- sourceRefs?: KnowledgeSourceRef[] | undefined;
4680
- confidence?: number | undefined;
4681
- metadata?: Record<string, unknown> | undefined;
4682
- createdBySessionId?: string | undefined;
4683
- pinned?: boolean | undefined;
4684
- replacesId?: string | undefined;
4685
- };
4686
- export type UpdateKnowledgeMemoryRequest = {
4687
- status?: KnowledgeMemoryStatus | undefined;
4688
- kind?: KnowledgeMemoryKind | undefined;
4689
- scope?: string | undefined;
4690
- text?: string | undefined;
4691
- sourceRefs?: KnowledgeSourceRef[] | undefined;
4692
- confidence?: number | undefined;
4693
- metadata?: Record<string, unknown> | undefined;
4694
- reviewedBy?: string | undefined;
4695
- pinned?: boolean | undefined;
4696
- };
4697
- export type KnowledgeMemorySearchRequest = {
4698
- query?: string | undefined;
4699
- status?: KnowledgeMemoryStatus | undefined;
4700
- kind?: KnowledgeMemoryKind | undefined;
4701
- scope?: string | undefined;
4702
- limit?: number | undefined;
4703
- };
4704
- export type WorkspaceMemorySearchMode = "hybrid" | "vector" | "keyword";
4705
- export type WorkspaceMemorySearchRequest = {
4706
- query: string;
4707
- kind?: KnowledgeMemoryKind | undefined;
4708
- limit?: number | undefined;
4709
- mode?: WorkspaceMemorySearchMode | undefined;
4710
- };
4711
- export type WorkspaceMemorySearchResult = {
4712
- memory: KnowledgeMemory;
4713
- score: number;
4714
- matchType: WorkspaceMemorySearchMode;
4715
- vectorScore: number | null;
4716
- keywordScore: number | null;
4717
- };
4718
- export type WorkspaceMemorySearchResponse = {
4719
- results: WorkspaceMemorySearchResult[];
4720
- };
4721
- export type CapabilityPackConnectorAuthModel = "oauth2_authorization_code_pkce" | "oauth2_authorization_code" | "api_key" | "credential_ref";
4722
- export type CapabilityPackConnector = {
4723
- id: string;
4724
- name: string;
4725
- category: string;
4726
- authModel: CapabilityPackConnectorAuthModel;
4727
- providers: string[];
4728
- scopes: string[];
4729
- required: boolean;
4730
- metadata: Record<string, unknown>;
4731
- };
4732
- export type CapabilityPackKnowledge = {
4733
- type: "document_base";
4734
- id: string;
4735
- name: string;
4736
- description: string | null;
4737
- required: boolean;
4738
- };
4739
- export type CapabilityPackScheduledTaskTemplate = {
4740
- id: string;
4741
- name: string;
4742
- description: string;
4743
- defaultSchedule: ScheduledTaskScheduleSpec;
4744
- defaultRunMode: ScheduledTaskRunMode;
4745
- defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
4746
- prompt?: string | undefined;
4747
- };
4748
- export type CapabilityPackAutomationTemplate = {
4749
- id: string;
4750
- name: string;
4751
- description: string;
4752
- adapterId: string;
4753
- eventTypes: string[];
4754
- sessionTemplate: {
4755
- prompt: string;
4756
- instructions: string | null;
4757
- resources: ResourceRef[];
4758
- skills: CapabilityPackSkill[];
4759
- tools: ToolRef[];
4760
- firstPartyMcpTools: string[];
4761
- firstPartyMcpPermissions: Permission[];
4762
- model: string | null;
4763
- reasoningEffort: ReasoningEffort | null;
4764
- sandboxBackend: SandboxBackend | null;
4765
- policyRole: string | null;
4766
- metadata: Record<string, unknown>;
4767
- };
4768
- configuration: Record<string, unknown>;
4769
- connectionRequirement: string | null;
4770
- };
4771
- export type CapabilityPackSkillFile = {
4772
- path: string;
4773
- content: string;
4774
- };
4775
- export type CapabilityPackSkill = {
4776
- name: string;
4777
- description?: string | undefined;
4778
- files: CapabilityPackSkillFile[];
4779
- };
4780
- export type SessionSkill = CapabilityPackSkill;
4781
- export type CapabilityPackVariableSetSpec = {
4782
- description: string;
4783
- requiredVariables: string[];
4784
- required: boolean;
4785
- };
4786
- export type CapabilityPackComponentReference = {
4787
- key: string;
4788
- kind: "plugin";
4789
- pluginKey: string;
4790
- version: string;
4791
- manifestDigest: string;
4792
- required: boolean;
4793
- } | {
4794
- key: string;
4795
- kind: "skill";
4796
- capabilityId: string;
4797
- contentSha256: string;
4798
- required: boolean;
4799
- } | {
4800
- key: string;
4801
- kind: "integration";
4802
- capabilityId: string;
4803
- instanceKey: string;
4804
- revisionId: string;
4805
- contentSha256: string;
4806
- required: boolean;
4807
- } | {
4808
- key: string;
4809
- kind: "facet";
4810
- capabilityId: string;
4811
- instanceKey: string;
4812
- facetKey: string;
4813
- bindingKey: string;
4814
- configDigest: string;
4815
- required: boolean;
4816
- };
4817
- export type CapabilityPackRigRequirement = {
4818
- description?: string | undefined;
4819
- required: boolean;
4820
- rigId?: string | undefined;
4821
- requireVerified: boolean;
4822
- };
4823
- export type CapabilityPack = {
4824
- id: string;
4825
- name: string;
4826
- description: string;
4827
- role: string;
4828
- category: string;
4829
- version: string;
4830
- sandboxImage?: string | undefined;
4831
- sandboxProviderImages?: {
4832
- modal?: {
4833
- imageId: string;
4834
- } | undefined;
4835
- } | undefined;
4836
- skills: CapabilityPackSkill[];
4837
- components: CapabilityPackComponentReference[];
4838
- rig?: CapabilityPackRigRequirement | undefined;
4839
- tools: ToolRef[];
4840
- connectors: CapabilityPackConnector[];
4841
- knowledge: CapabilityPackKnowledge[];
4842
- scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
4843
- automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
4844
- variableSet?: CapabilityPackVariableSetSpec | undefined;
4845
- metadata: Record<string, unknown>;
4846
- };
4847
- /** Input shape for registering a pack manifest (server applies defaults). */
4848
- export type RegisterCapabilityPackRequest = {
4849
- id: string;
4850
- name: string;
4851
- description: string;
4852
- role: string;
4853
- category: string;
4854
- version: string;
4855
- sandboxImage?: string | undefined;
4856
- sandboxProviderImages?: {
4857
- modal?: {
4858
- imageId: string;
4859
- } | undefined;
4860
- } | undefined;
4861
- skills?: {
4862
- name: string;
4863
- description?: string | undefined;
4864
- files: CapabilityPackSkillFile[];
4865
- }[] | undefined;
4866
- components?: ({
4867
- key: string;
4868
- kind: "plugin";
4869
- pluginKey: string;
4870
- version: string;
4871
- manifestDigest: string;
4872
- required?: boolean | undefined;
4873
- } | {
4874
- key: string;
4875
- kind: "skill";
4876
- capabilityId: string;
4877
- contentSha256: string;
4878
- required?: boolean | undefined;
4879
- } | {
4880
- key: string;
4881
- kind: "integration";
4882
- capabilityId: string;
4883
- instanceKey: string;
4884
- revisionId: string;
4885
- contentSha256: string;
4886
- required?: boolean | undefined;
4887
- } | {
4888
- key: string;
4889
- kind: "facet";
4890
- capabilityId: string;
4891
- instanceKey: string;
4892
- facetKey: string;
4893
- bindingKey: string;
4894
- configDigest: string;
4895
- required?: boolean | undefined;
4896
- })[] | undefined;
4897
- rig?: {
4898
- description?: string | undefined;
4899
- required?: boolean | undefined;
4900
- rigId?: string | undefined;
4901
- requireVerified?: boolean | undefined;
4902
- } | undefined;
4903
- tools?: ToolRef[] | undefined;
4904
- connectors?: {
4905
- id: string;
4906
- name: string;
4907
- category: string;
4908
- authModel: CapabilityPackConnectorAuthModel;
4909
- providers?: string[] | undefined;
4910
- scopes?: string[] | undefined;
4911
- required?: boolean | undefined;
4912
- metadata?: Record<string, unknown> | undefined;
4913
- }[] | undefined;
4914
- knowledge?: {
4915
- type: "document_base";
4916
- id: string;
4917
- name: string;
4918
- description?: string | null | undefined;
4919
- required?: boolean | undefined;
4920
- }[] | undefined;
4921
- scheduledTaskTemplates?: {
4922
- id: string;
4923
- name: string;
4924
- description: string;
4925
- defaultSchedule: ScheduledTaskScheduleSpec;
4926
- defaultRunMode?: ScheduledTaskRunMode | undefined;
4927
- defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
4928
- prompt?: string | undefined;
4929
- }[] | undefined;
4930
- automationTemplates?: {
4931
- id: string;
4932
- name: string;
4933
- description: string;
4934
- adapterId: string;
4935
- eventTypes: string[];
4936
- sessionTemplate: {
4937
- prompt: string;
4938
- instructions?: string | null | undefined;
4939
- resources?: ResourceRef[] | undefined;
4940
- skills?: CapabilityPackSkill[] | undefined;
4941
- tools?: ToolRef[] | undefined;
4942
- firstPartyMcpTools?: string[] | undefined;
4943
- firstPartyMcpPermissions?: Permission[] | undefined;
4944
- model?: string | null | undefined;
4945
- reasoningEffort?: ReasoningEffort | null | undefined;
4946
- sandboxBackend?: SandboxBackend | null | undefined;
4947
- policyRole?: string | null | undefined;
4948
- metadata?: Record<string, unknown> | undefined;
4949
- };
4950
- configuration?: Record<string, unknown> | undefined;
4951
- connectionRequirement?: string | null | undefined;
4952
- }[] | undefined;
4953
- variableSet?: {
4954
- description: string;
4955
- requiredVariables?: string[] | undefined;
4956
- required?: boolean | undefined;
4957
- } | undefined;
6606
+ kind?: KnowledgeMemoryKind | undefined;
6607
+ scope?: string | undefined;
6608
+ text: string;
6609
+ sourceRefs?: KnowledgeSourceRef[] | undefined;
6610
+ confidence?: number | undefined;
4958
6611
  metadata?: Record<string, unknown> | undefined;
6612
+ createdBySessionId?: string | undefined;
6613
+ pinned?: boolean | undefined;
6614
+ replacesId?: string | undefined;
4959
6615
  };
4960
- export type WorkspaceRegisteredPack = {
4961
- accountId: string;
4962
- workspaceId: string;
4963
- pack: CapabilityPack;
4964
- createdAt: string;
4965
- 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;
4966
6626
  };
4967
- export type PackInstallationStatus = "installing" | "active" | "needs_attention" | "disabled";
4968
- export type PackInstallation = {
4969
- id: string;
4970
- accountId: string;
4971
- workspaceId: string;
4972
- packId: string;
4973
- status: PackInstallationStatus;
4974
- version: number;
4975
- manifestSnapshot: CapabilityPack | null;
4976
- manifestDigest: string | null;
4977
- selectedRigId: string | null;
4978
- installedBySubjectId: string | null;
4979
- metadata: Record<string, unknown>;
4980
- enabledAt: string;
4981
- 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;
4982
6667
  };
6668
+ export type SessionSkillInput = Omit<SkillArtifactDefinitionInput, "activationMode">;
4983
6669
  export type PrReviewProvider = GitCredentialProvider;
4984
6670
  export type PrReviewCredentialKind = "github_app" | "managed_github_app" | "provider_token";
4985
6671
  export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
@@ -5077,93 +6763,12 @@ export type PrReviewManagedGitHubInstallation = {
5077
6763
  export type PrReviewManagedGitHubSetup = {
5078
6764
  configured: boolean;
5079
6765
  status: "unavailable" | "not_connected" | "connected";
5080
- appName: "OpenGeni Lens";
6766
+ appName: "Opengeni Lens" | "OpenGeni Lens";
5081
6767
  connectUrl: string | null;
5082
6768
  installations: PrReviewManagedGitHubInstallation[];
5083
6769
  missing: string[];
5084
6770
  };
5085
- export type EnablePackRequest = {
5086
- variableSetId?: string | undefined;
5087
- /** @deprecated use variableSetId */
5088
- environmentId?: string | undefined;
5089
- metadata?: Record<string, unknown> | undefined;
5090
- };
5091
- export type PackComponentResolutionStatus = "ready" | "missing" | "mismatch";
5092
- export type PackComponentResolution = {
5093
- key: string;
5094
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
5095
- capabilityId: string;
5096
- required: boolean;
5097
- status: PackComponentResolutionStatus;
5098
- expectedDigest: string;
5099
- actualDigest: string | null;
5100
- resolvedId: string | null;
5101
- label: string;
5102
- };
5103
- export type PackRigResolution = {
5104
- required: boolean;
5105
- status: "not_required" | "ready" | "missing" | "mismatch" | "unverified";
5106
- requestedRigId: string | null;
5107
- rigId: string | null;
5108
- rigVersionId: string | null;
5109
- name: string | null;
5110
- image: string | null;
5111
- };
5112
- export type PreviewPackInstallationRequest = {
5113
- rigId?: string | undefined;
5114
- variableSetId?: string | undefined;
5115
- };
5116
- export type PackInstallationPreview = {
5117
- packId: string;
5118
- packVersion: string;
5119
- manifestDigest: string;
5120
- installationVersion: number | null;
5121
- action: "install" | "update" | "repair";
5122
- ready: boolean;
5123
- blockers: string[];
5124
- components: PackComponentResolution[];
5125
- rig: PackRigResolution;
5126
- variableSetId: string | null;
5127
- legacyInlineSkillCount: number;
5128
- legacySandboxImage: string | null;
5129
- };
5130
- export type InstallPackRequest = {
5131
- expectedManifestDigest: string;
5132
- expectedInstallationVersion?: number | undefined;
5133
- rigId?: string | undefined;
5134
- variableSetId?: string | undefined;
5135
- idempotencyKey: string;
5136
- metadata?: Record<string, unknown> | undefined;
5137
- };
5138
- export type PackUninstallPreview = {
5139
- packId: string;
5140
- installed: boolean;
5141
- installationVersion: number | null;
5142
- components: Array<{
5143
- key: string;
5144
- kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
5145
- capabilityId: string;
5146
- retainedByOtherOwners: boolean;
5147
- }>;
5148
- };
5149
- export type UninstallPackRequest = {
5150
- expectedInstallationVersion: number;
5151
- idempotencyKey: string;
5152
- };
5153
- export type UninstallPackResult = {
5154
- packId: string;
5155
- status: "not_installed" | "uninstalled";
5156
- retainedComponents: string[];
5157
- };
5158
- export type ListPacksResponse = {
5159
- packs: CapabilityPack[];
5160
- installations: PackInstallation[];
5161
- };
5162
- export type GetPackResponse = {
5163
- pack: CapabilityPack;
5164
- installation: PackInstallation | null;
5165
- };
5166
- export type CapabilityKind = "pack" | "mcp" | "api" | "skill" | "plugin";
6771
+ export type CapabilityKind = "mcp" | "api" | "skill" | "plugin";
5167
6772
  export type CapabilitySource = "built_in" | "library" | "configured" | "public_registry" | "registry" | "manual";
5168
6773
  export type CapabilityInstallationStatus = "active" | "disabled";
5169
6774
  export type CapabilityCatalogAuthKind = "oauth2" | "api_key" | "none" | "unknown";
@@ -5187,6 +6792,14 @@ export type CapabilityRuntime = {
5187
6792
  state: "trusted" | "legacy_active" | "unverified";
5188
6793
  reason: "trusted_source" | "verified_probe" | "active_installation_compatibility" | "missing_verification";
5189
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;
5190
6803
  };
5191
6804
  export type CapabilityCatalogItem = {
5192
6805
  id: string;
@@ -5225,6 +6838,8 @@ export type CapabilityCatalogItem = {
5225
6838
  /** The connection backing this enabled installation, or null when none is involved. */
5226
6839
  connectionRef: {
5227
6840
  connectionId?: string | undefined;
6841
+ accountSelection?: "all_eligible" | undefined;
6842
+ authoritySource?: "host" | undefined;
5228
6843
  providerDomain: string;
5229
6844
  kind: string;
5230
6845
  subjectScope?: "subject" | "workspace" | undefined;
@@ -5264,6 +6879,7 @@ export type CreateCapabilityCatalogItemRequest = {
5264
6879
  metadata?: Record<string, unknown> | undefined;
5265
6880
  };
5266
6881
  export type EnableCapabilityRequest = {
6882
+ onlyIfUninstalled?: boolean | undefined;
5267
6883
  config?: Record<string, unknown> | undefined;
5268
6884
  metadata?: Record<string, unknown> | undefined;
5269
6885
  connectionRef?: McpServerConnectionRef | undefined;
@@ -5280,7 +6896,7 @@ export type DiscoverMcpCapabilitiesResponse = {
5280
6896
  sourceUrl: string;
5281
6897
  };
5282
6898
  export type SkillImportSource = "github" | "skills_sh";
5283
- export type SkillInstallationSource = "library" | "github" | "skills_sh" | "pack";
6899
+ export type SkillInstallationSource = "library" | "github" | "skills_sh";
5284
6900
  export type PreviewSkillImportRequest = {
5285
6901
  url: string;
5286
6902
  };
@@ -5290,6 +6906,7 @@ export type SkillImportFileSummary = {
5290
6906
  contentSha256: string;
5291
6907
  };
5292
6908
  export type SkillImportPreview = {
6909
+ markdown?: string;
5293
6910
  source: SkillImportSource;
5294
6911
  sourceUrl: string;
5295
6912
  repositoryUrl: string;
@@ -5318,6 +6935,7 @@ export type InstallLibrarySkillRequest = {
5318
6935
  expectedInstallationVersion?: number | undefined;
5319
6936
  };
5320
6937
  export type InstalledSkill = {
6938
+ skillReceipt?: import("./skills.js").SkillWriteReceipt | undefined;
5321
6939
  capabilityId: string;
5322
6940
  pluginId: string;
5323
6941
  pluginVersionId: string;
@@ -5334,7 +6952,7 @@ export type InstalledSkill = {
5334
6952
  status: "installed";
5335
6953
  };
5336
6954
  export type CapabilityComponentOwner = {
5337
- kind: "direct" | "plugin" | "pack" | "migration";
6955
+ kind: "direct" | "plugin" | "migration";
5338
6956
  id: string;
5339
6957
  removable: boolean;
5340
6958
  };
@@ -5376,6 +6994,7 @@ export type UninstallSkillRequest = {
5376
6994
  expectedInstallationVersion: number;
5377
6995
  };
5378
6996
  export type UninstallSkillResult = {
6997
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
5379
6998
  capabilityId: string;
5380
6999
  status: "not_installed" | "uninstalled" | "retained_by_other_owners";
5381
7000
  remainingOwners: CapabilityComponentOwner[];
@@ -5497,8 +7116,31 @@ export type IntegrationSource = {
5497
7116
  url: string;
5498
7117
  baseUrl?: string | undefined;
5499
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
+ };
5500
7142
  export type PreviewApiIntegrationRequest = {
5501
- source: IntegrationSource;
7143
+ source: IntegrationSourceInput;
5502
7144
  connectionId?: string | undefined;
5503
7145
  ownership?: ConnectionOwnership | undefined;
5504
7146
  };
@@ -5534,7 +7176,7 @@ export type ApiIntegrationToolPreview = {
5534
7176
  deprecated: boolean;
5535
7177
  };
5536
7178
  export type ApiIntegrationPreview = {
5537
- source: IntegrationSource;
7179
+ source: IntegrationSourceProjection;
5538
7180
  definitionId: string;
5539
7181
  definitionProvenance: IntegrationDefinitionProvenance;
5540
7182
  protocol: ApiIntegrationProtocol;
@@ -5556,7 +7198,7 @@ export type ApiIntegrationPreview = {
5556
7198
  warnings: string[];
5557
7199
  };
5558
7200
  export type InstallApiIntegrationRequest = {
5559
- source: IntegrationSource;
7201
+ source: IntegrationSourceInput;
5560
7202
  expectedRevisionId: string;
5561
7203
  expectedContentSha256: string;
5562
7204
  connectionId?: string | undefined;
@@ -5565,6 +7207,14 @@ export type InstallApiIntegrationRequest = {
5565
7207
  displayName?: string | undefined;
5566
7208
  expectedInstanceVersion?: number | undefined;
5567
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;
5568
7218
  };
5569
7219
  export type InstalledApiIntegration = {
5570
7220
  capabilityId: string;
@@ -5710,6 +7360,9 @@ export type InstallPluginRequest = {
5710
7360
  expectedInstallationVersion?: number | undefined;
5711
7361
  };
5712
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;
5713
7366
  pluginKey: string;
5714
7367
  version: string;
5715
7368
  pluginId: string;
@@ -5726,6 +7379,7 @@ export type PluginInstallationSummary = {
5726
7379
  description: string;
5727
7380
  category: string;
5728
7381
  tags: string[];
7382
+ logoUrl?: string | null | undefined;
5729
7383
  sourceUrl: string | null;
5730
7384
  manifestDigest: string;
5731
7385
  installationVersion: number;
@@ -5737,22 +7391,34 @@ export type PluginInstallationSummary = {
5737
7391
  export type ListInstalledPluginsResponse = {
5738
7392
  plugins: PluginInstallationSummary[];
5739
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
+ };
5740
7407
  export type PluginUninstallPreview = {
5741
7408
  pluginKey: string;
5742
7409
  installed: boolean;
5743
7410
  version: string | null;
5744
7411
  installationVersion: number | null;
5745
- components: Array<{
5746
- capabilityId: string;
5747
- kind: "skill" | "integration" | "mcp";
5748
- retainedByOtherOwners: boolean;
5749
- }>;
7412
+ previewToken?: string | undefined;
7413
+ components: PluginUninstallComponentImpact[];
5750
7414
  };
5751
7415
  export type UninstallPluginRequest = {
5752
7416
  expectedInstallationVersion: number;
7417
+ expectedPreviewToken?: string | undefined;
5753
7418
  idempotencyKey: string;
5754
7419
  };
5755
7420
  export type UninstallPluginResult = {
7421
+ skillReleases?: import("./skills.js").SkillSourceReleaseReceipt[] | undefined;
5756
7422
  pluginKey: string;
5757
7423
  status: "not_installed" | "uninstalled";
5758
7424
  retainedComponents: string[];
@@ -5768,6 +7434,10 @@ export type GitHubRepository = {
5768
7434
  defaultBranch: string;
5769
7435
  accountLogin: string;
5770
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;
5771
7441
  };
5772
7442
  export type GitHubRepositoryScope = "all" | "selected";
5773
7443
  export type GitHubBindingStatus = "disabled" | "unbound" | "bound";
@@ -5781,7 +7451,7 @@ export type GitHubInstallationBinding = {
5781
7451
  lifecycle: GitHubInstallationLifecycle;
5782
7452
  repositoryScope: GitHubRepositoryScope;
5783
7453
  repositoryCount: number;
5784
- /** OpenGeni-owned entry point for changing the installation's repository allowlist. */
7454
+ /** Opengeni-owned entry point for changing the installation's repository allowlist. */
5785
7455
  configureUrl: string | null;
5786
7456
  createdAt: string;
5787
7457
  updatedAt: string;
@@ -5807,6 +7477,55 @@ export type GitHubAppInfo = {
5807
7477
  export type GitHubRepositoriesResponse = {
5808
7478
  repositories: GitHubRepository[];
5809
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
+ };
5810
7529
  export type CreateGitHubAppManifestRequest = {
5811
7530
  appName?: string | undefined;
5812
7531
  organization?: string | undefined;
@@ -5821,11 +7540,26 @@ export type CreateGitHubAppManifestResponse = {
5821
7540
  };
5822
7541
  export type BillingMode = "disabled" | "stripe";
5823
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";
5824
7555
  export type BillingBalance = {
5825
7556
  accountId: string;
5826
7557
  balanceMicros: number;
5827
7558
  currency: "usd";
5828
7559
  updatedAt: string;
7560
+ generalBalanceMicros?: number | undefined;
7561
+ promotionalCredits?: PromotionalCreditBalance[] | undefined;
7562
+ plan?: BillingPlanBalance | null | undefined;
5829
7563
  };
5830
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"];
5831
7565
  export type KnownUsageEventType = (typeof KNOWN_USAGE_EVENT_TYPES)[number];
@@ -5877,12 +7611,16 @@ export type InsightsModelUsageRow = {
5877
7611
  creditUsd: number;
5878
7612
  estimatedProviderUsd: number;
5879
7613
  estimatedProviderCostKnownCalls: number;
7614
+ equivalentCreditUsd: number;
7615
+ equivalentCreditCostKnownCalls: number;
5880
7616
  };
5881
7617
  export type InsightsSeriesPoint = {
5882
7618
  label: string;
5883
7619
  modelCostUsd: number;
5884
7620
  estimatedProviderUsd: number;
5885
7621
  estimatedProviderCostKnownCalls: number;
7622
+ equivalentCreditUsd: number;
7623
+ equivalentCreditCostKnownCalls: number;
5886
7624
  warmSeconds: number;
5887
7625
  inputTokens: number;
5888
7626
  outputTokens: number;
@@ -5896,6 +7634,10 @@ export type InsightsSeriesPoint = {
5896
7634
  cacheHitPct: number;
5897
7635
  calls: number;
5898
7636
  };
7637
+ export type InsightsScope = {
7638
+ rootSessionId: string | null;
7639
+ sessionId: string | null;
7640
+ };
5899
7641
  export type InsightsDepthBucket = {
5900
7642
  depth: number;
5901
7643
  sessions: number;
@@ -5911,12 +7653,27 @@ export type InsightsSpendDriver = {
5911
7653
  creditUsd: number;
5912
7654
  estimatedProviderUsd: number;
5913
7655
  estimatedProviderCostKnownCalls: number;
7656
+ equivalentCreditUsd: number;
7657
+ equivalentCreditCostKnownCalls: number;
5914
7658
  tokens: number;
5915
7659
  cacheHitPct: number;
5916
7660
  pctOfCreditUsd: number;
5917
7661
  pctOfTokens: number;
5918
7662
  deltaUsdVsPrior: number;
5919
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
+ };
5920
7677
  export type InsightsWarmGroupRow = {
5921
7678
  id: string;
5922
7679
  groupId: string;
@@ -5952,6 +7709,8 @@ export type InsightsScheduleRow = {
5952
7709
  creditUsd: number | null;
5953
7710
  estimatedProviderUsd: number | null;
5954
7711
  estimatedProviderCostKnownCalls: number | null;
7712
+ equivalentCreditUsd: number | null;
7713
+ equivalentCreditCostKnownCalls: number | null;
5955
7714
  tokens: number | null;
5956
7715
  cacheHitPct: number | null;
5957
7716
  billing: InsightsBillingPath | null;
@@ -5975,6 +7734,7 @@ export type InsightsModelCallRow = {
5975
7734
  totalTokens: number | null;
5976
7735
  creditUsd: number;
5977
7736
  estimatedProviderUsd: number | null;
7737
+ equivalentCreditUsd: number | null;
5978
7738
  pricingSource: InsightsPricingSource | null;
5979
7739
  };
5980
7740
  export type ModelContextContributionSource = "workspace_instruction_policy" | "legacy_workspace_instructions" | "preference_registry_descriptor" | "company_profile" | "legacy_memory_v1" | "runtime_skill_catalog";
@@ -6007,6 +7767,18 @@ export type WorkspaceInsightsSnapshot = {
6007
7767
  series: InsightsSeriesPoint[];
6008
7768
  depth: InsightsDepthBucket[];
6009
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;
6010
7782
  schedules: InsightsScheduleRow[];
6011
7783
  recentCalls: InsightsModelCallRow[];
6012
7784
  promptContributions: InsightsPromptContributions;
@@ -6025,6 +7797,10 @@ export type WorkspaceInsightsSnapshot = {
6025
7797
  priorEstimatedProviderUsd: number;
6026
7798
  estimatedProviderCostKnownCalls: number;
6027
7799
  priorEstimatedProviderCostKnownCalls: number;
7800
+ equivalentCreditUsd: number;
7801
+ priorEquivalentCreditUsd: number;
7802
+ equivalentCreditCostKnownCalls: number;
7803
+ priorEquivalentCreditCostKnownCalls: number;
6028
7804
  modelCalls: number;
6029
7805
  priorInputTokens: number;
6030
7806
  priorTotalTokens: number;
@@ -6043,6 +7819,13 @@ export type WorkspaceInsightsSnapshot = {
6043
7819
  agentRunsUsed: number;
6044
7820
  agentRunCap: number | null;
6045
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;
6046
7829
  };
6047
7830
  export type WorkspaceInsightsResponse = {
6048
7831
  snapshot: WorkspaceInsightsSnapshot;
@@ -6054,14 +7837,36 @@ export type BillingEntitlementsResponse = {
6054
7837
  };
6055
7838
  export type CreateCheckoutRequest = {
6056
7839
  accountId?: string | undefined;
6057
- /** USD amount with cent precision (server enforces min/max). */
6058
- 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;
6059
7847
  successUrl?: string | undefined;
6060
7848
  cancelUrl?: string | undefined;
6061
7849
  };
6062
7850
  export type CreateCheckoutResponse = {
6063
7851
  checkoutSessionId: string;
6064
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;
6065
7870
  };
6066
7871
  export type CreateBillingPortalRequest = {
6067
7872
  accountId?: string | undefined;
@@ -6085,17 +7890,36 @@ export type UserMessageEventInput = {
6085
7890
  controlEtag?: string | undefined;
6086
7891
  expectedDraftRevision?: number | undefined;
6087
7892
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6088
- connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
7893
+ connectionAccounts?: McpConnectionAccountSelection[] | undefined;
6089
7894
  personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
6090
7895
  };
6091
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
+ };
6092
7913
  export type UserApprovalDecisionEventInput = {
6093
7914
  type: "user.approvalDecision";
6094
7915
  clientEventId?: string | undefined;
6095
7916
  payload: {
7917
+ /** `session.requiresAction` `approvals[].id` (the pending tool call id). */
6096
7918
  approvalId: string;
6097
7919
  decision: "approve" | "reject";
6098
7920
  message?: string | undefined;
7921
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7922
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6099
7923
  };
6100
7924
  };
6101
7925
  export type UserHumanInputResponseEventInput = {
@@ -6104,6 +7928,8 @@ export type UserHumanInputResponseEventInput = {
6104
7928
  payload: {
6105
7929
  requestId: string;
6106
7930
  response: SubmitHumanInputResponseRequest;
7931
+ /** Server-owned header rotation applied atomically when the response is accepted. */
7932
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
6107
7933
  };
6108
7934
  };
6109
7935
  /** Control/user events a client may POST to a session's event log. */
@@ -6128,7 +7954,7 @@ export type MetricSample = {
6128
7954
  /** The derived dashboard state of a machine (M3 liveness + consent/display
6129
7955
  * reasons + the in-flight device-flow). */
6130
7956
  export type MachineState = "online" | "reconnecting" | "offline" | "consent_required" | "display_unavailable" | "enrolling";
6131
- export type MachineKind = "modal" | "selfhosted" | "opensandbox";
7957
+ export type MachineKind = "docker" | "modal" | "local" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
6132
7958
  export type MachineConnectionAuthority = {
6133
7959
  state: "not_applicable" | "unclaimed" | "active" | "expired";
6134
7960
  generation: number;
@@ -6147,6 +7973,17 @@ export type MachineRuntimeCapabilities = {
6147
7973
  browserBridge: boolean;
6148
7974
  operationResourcePolicy: boolean;
6149
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;
6150
7987
  };
6151
7988
  export type MachineUpdateStatus = "requested" | "accepted" | "waiting_for_idle" | "downloading" | "verifying" | "applying" | "restarting" | "succeeded" | "failed";
6152
7989
  export type MachineUpdateState = {
@@ -6167,14 +8004,114 @@ export type MachineRuntime = {
6167
8004
  updateChannel: "stable" | "beta" | null;
6168
8005
  desiredVersion: string | null;
6169
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;
6170
8009
  capabilities: MachineRuntimeCapabilities;
6171
8010
  update: MachineUpdateState | null;
8011
+ /** Live macOS permissions; null off macOS or when the agent does not report them. */
8012
+ macPermissions: MachineMacPermissions | null;
6172
8013
  };
6173
8014
  export type UpdateMachineAgentResponse = {
6174
8015
  operationId: string;
6175
8016
  accepted: boolean;
6176
8017
  targetVersion: string;
6177
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
+ };
6178
8115
  export type MachineOperationPolicy = {
6179
8116
  memoryMaxBytes: number | null;
6180
8117
  memoryHighBytes: number | null;
@@ -6272,7 +8209,7 @@ export type SwapActiveSandboxResponse = {
6272
8209
  activeSandboxId: string | null;
6273
8210
  activeEpoch: number;
6274
8211
  reason?: string;
6275
- 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";
6276
8213
  };
6277
8214
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
6278
8215
  export type EnrollmentOs = "linux" | "macos" | "windows";
@@ -6320,12 +8257,27 @@ export type DeviceEnrollmentDenyResponse = {
6320
8257
  /** POST /v1/workspaces/:ws/enrollments/token body. */
6321
8258
  export type MintEnrollTokenRequest = {
6322
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;
6323
8269
  };
8270
+ /** Who can use a machine connected with an enroll token. */
8271
+ export type EnrollTokenScope = "user" | "workspace";
6324
8272
  /** POST /v1/workspaces/:ws/enrollments/token response. The `token` is SECRET. */
6325
8273
  export type MintEnrollTokenResponse = {
6326
8274
  token: string;
6327
8275
  expiresAt: string;
6328
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;
6329
8281
  };
6330
8282
  /** The credential payload the headless exchange returns (a subset of the agent's
6331
8283
  * EnrollmentCredentials — IDENTICAL to the device-flow poll authorized branch). */
@@ -6357,4 +8309,245 @@ export type EnrollTokenExchangeRequest = {
6357
8309
  export type EnrollTokenExchangeResponse = {
6358
8310
  credentials: EnrollmentCredentials;
6359
8311
  };
6360
- 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";