@opengeni/sdk 3.3.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +1007 -72
  2. package/dist/adapters/express.d.ts +31 -0
  3. package/dist/adapters/express.js +87 -0
  4. package/dist/adapters/express.js.map +1 -0
  5. package/dist/adapters/hono.d.ts +16 -0
  6. package/dist/adapters/hono.js +8 -0
  7. package/dist/adapters/hono.js.map +1 -0
  8. package/dist/adapters/next.d.ts +29 -0
  9. package/dist/adapters/next.js +22 -0
  10. package/dist/adapters/next.js.map +1 -0
  11. package/dist/allowance-refusal.d.ts +2 -0
  12. package/dist/allowance-refusal.js +50 -0
  13. package/dist/allowance-refusal.js.map +1 -0
  14. package/dist/app-links.d.ts +42 -0
  15. package/dist/app-links.js +66 -0
  16. package/dist/app-links.js.map +1 -0
  17. package/dist/artifact-catalog.d.ts +40 -0
  18. package/dist/artifact-client.d.ts +20 -8
  19. package/dist/artifacts.d.ts +1 -1
  20. package/dist/artifacts.js +8 -6
  21. package/dist/automations.js +8 -2
  22. package/dist/automations.js.map +1 -1
  23. package/dist/azure-live-transport.d.ts +32 -0
  24. package/dist/browser.d.ts +7 -2
  25. package/dist/browser.js +27 -5
  26. package/dist/chat/fold.d.ts +75 -0
  27. package/dist/chat/handler.d.ts +41 -0
  28. package/dist/chat/http.d.ts +67 -0
  29. package/dist/chat/ids.d.ts +34 -0
  30. package/dist/chat/index.d.ts +9 -0
  31. package/dist/chat/index.js +1369 -0
  32. package/dist/chat/index.js.map +1 -0
  33. package/dist/chat/openai.d.ts +30 -0
  34. package/dist/chat/opengeni.d.ts +129 -0
  35. package/dist/chat/types.d.ts +207 -0
  36. package/dist/chat/vercel.d.ts +49 -0
  37. package/dist/chats.d.ts +8 -0
  38. package/dist/chunk-4AHR4KGA.js +301 -0
  39. package/dist/chunk-4AHR4KGA.js.map +1 -0
  40. package/dist/chunk-6GYGMLX4.js +332 -0
  41. package/dist/chunk-6GYGMLX4.js.map +1 -0
  42. package/dist/chunk-7EWT3PV6.js +368 -0
  43. package/dist/chunk-7EWT3PV6.js.map +1 -0
  44. package/dist/chunk-FTWVVPR6.js +1665 -0
  45. package/dist/chunk-FTWVVPR6.js.map +1 -0
  46. package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
  47. package/dist/chunk-GZQSWAKD.js.map +1 -0
  48. package/dist/chunk-KGEABAID.js +71 -0
  49. package/dist/chunk-KGEABAID.js.map +1 -0
  50. package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
  51. package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
  52. package/dist/{chunk-JUS2UYRP.js → chunk-NCU5OAN7.js} +27 -2
  53. package/dist/chunk-NCU5OAN7.js.map +1 -0
  54. package/dist/{chunk-YXQX7RQT.js → chunk-OI5YLASH.js} +73 -2
  55. package/dist/chunk-OI5YLASH.js.map +1 -0
  56. package/dist/chunk-OV3POE62.js +359 -0
  57. package/dist/chunk-OV3POE62.js.map +1 -0
  58. package/dist/chunk-P7UWKORG.js +561 -0
  59. package/dist/chunk-P7UWKORG.js.map +1 -0
  60. package/dist/chunk-QGEIL4TR.js +195 -0
  61. package/dist/chunk-QGEIL4TR.js.map +1 -0
  62. package/dist/{chunk-TRNI7KEO.js → chunk-S2NLS3ES.js} +3669 -1281
  63. package/dist/chunk-S2NLS3ES.js.map +1 -0
  64. package/dist/chunk-UM4ZXXJR.js +9 -0
  65. package/dist/chunk-UM4ZXXJR.js.map +1 -0
  66. package/dist/{chunk-QT3KFVDP.js → chunk-UME3X7CP.js} +28 -32
  67. package/dist/chunk-UME3X7CP.js.map +1 -0
  68. package/dist/chunk-VT4YM4XQ.js +210 -0
  69. package/dist/chunk-VT4YM4XQ.js.map +1 -0
  70. package/dist/chunk-WSYYXONG.js +1602 -0
  71. package/dist/chunk-WSYYXONG.js.map +1 -0
  72. package/dist/{chunk-C2H7HBNP.js → chunk-WVCJRSGJ.js} +119 -14
  73. package/dist/chunk-WVCJRSGJ.js.map +1 -0
  74. package/dist/chunk-X5ITQVXE.js +15 -0
  75. package/dist/chunk-X5ITQVXE.js.map +1 -0
  76. package/dist/chunk-XA7HVIHI.js +126 -0
  77. package/dist/chunk-XA7HVIHI.js.map +1 -0
  78. package/dist/{chunk-KKRO2VCP.js → chunk-YJCHB7R3.js} +60 -12
  79. package/dist/chunk-YJCHB7R3.js.map +1 -0
  80. package/dist/chunk-YKIHNLWD.js +153 -0
  81. package/dist/chunk-YKIHNLWD.js.map +1 -0
  82. package/dist/chunk-ZDUBPV33.js +277 -0
  83. package/dist/chunk-ZDUBPV33.js.map +1 -0
  84. package/dist/client.d.ts +1068 -118
  85. package/dist/codex-realtime-controller.d.ts +13 -0
  86. package/dist/codex-realtime-controller.js +4 -2
  87. package/dist/codex-realtime-v3-wire.d.ts +3 -2
  88. package/dist/codex-realtime.d.ts +5 -1
  89. package/dist/company-brain.d.ts +1 -11
  90. package/dist/core.d.ts +7 -2
  91. package/dist/core.js +25 -6
  92. package/dist/deprecation.d.ts +47 -0
  93. package/dist/document-authority-client.d.ts +24 -2
  94. package/dist/document-authority.js +7 -5
  95. package/dist/editable-artifacts/index.d.ts +1 -1
  96. package/dist/editable-artifacts/types.d.ts +12 -2
  97. package/dist/editable-artifacts.js +19 -3
  98. package/dist/editable-artifacts.js.map +1 -1
  99. package/dist/embedding-client.d.ts +129 -0
  100. package/dist/errors.d.ts +76 -1
  101. package/dist/external-vault-receiver.d.ts +203 -0
  102. package/dist/external-vault-receiver.js +564 -0
  103. package/dist/external-vault-receiver.js.map +1 -0
  104. package/dist/feedback.d.ts +23 -0
  105. package/dist/gateway-realtime-transport.js +1 -1
  106. package/dist/github-repositories.d.ts +10 -0
  107. package/dist/github-repositories.js +36 -0
  108. package/dist/github-repositories.js.map +1 -0
  109. package/dist/index.d.ts +62 -11
  110. package/dist/index.js +557 -338
  111. package/dist/index.js.map +1 -1
  112. package/dist/insights-usage.d.ts +33 -0
  113. package/dist/insights-usage.js +7 -0
  114. package/dist/insights-usage.js.map +1 -0
  115. package/dist/interaction.d.ts +165 -71
  116. package/dist/interaction.js +2 -2
  117. package/dist/knowledge.d.ts +7 -0
  118. package/dist/knowledge.js +20 -0
  119. package/dist/knowledge.js.map +1 -0
  120. package/dist/known-tools.d.ts +4 -0
  121. package/dist/message-links.d.ts +68 -0
  122. package/dist/model-context.d.ts +68 -0
  123. package/dist/model-display.d.ts +2 -0
  124. package/dist/model-display.js +17 -0
  125. package/dist/model-display.js.map +1 -0
  126. package/dist/model-picker-order.d.ts +1 -0
  127. package/dist/model-picker-order.js +10 -0
  128. package/dist/model-picker-order.js.map +1 -0
  129. package/dist/organization-integration-policy.d.ts +26 -0
  130. package/dist/organization-integration-policy.js +26 -0
  131. package/dist/organization-integration-policy.js.map +1 -0
  132. package/dist/pr-review-client.d.ts +1 -1
  133. package/dist/pr-review.d.ts +1 -1
  134. package/dist/pr-review.js.map +1 -1
  135. package/dist/preference-registry.d.ts +1 -1
  136. package/dist/prepared-mcp-setup.d.ts +5 -0
  137. package/dist/proxy.d.ts +13 -11
  138. package/dist/realtime.d.ts +1 -1
  139. package/dist/realtime.js +253 -7
  140. package/dist/realtime.js.map +1 -1
  141. package/dist/session-history-import.d.ts +22 -0
  142. package/dist/session-history-import.js +36 -0
  143. package/dist/session-history-import.js.map +1 -0
  144. package/dist/session-list-entries.d.ts +1 -0
  145. package/dist/session-list-entries.js +7 -0
  146. package/dist/session-list-entries.js.map +1 -0
  147. package/dist/session-message-search.d.ts +53 -0
  148. package/dist/session-proxy-client.d.ts +28 -0
  149. package/dist/session-proxy.d.ts +334 -0
  150. package/dist/session-proxy.js +24 -0
  151. package/dist/session-proxy.js.map +1 -0
  152. package/dist/session-titles.d.ts +2 -28
  153. package/dist/session-usage-limits.d.ts +10 -0
  154. package/dist/session-usage-limits.js +43 -0
  155. package/dist/session-usage-limits.js.map +1 -0
  156. package/dist/shared-catalog-loader.d.ts +34 -0
  157. package/dist/site-ai.d.ts +35 -0
  158. package/dist/site-bridge-host.d.ts +112 -0
  159. package/dist/site-bridge-host.js +286 -0
  160. package/dist/site-bridge-host.js.map +1 -0
  161. package/dist/site-browser-entry.d.ts +1 -0
  162. package/dist/site-browser-runtime.gen.d.ts +1 -0
  163. package/dist/site-data.d.ts +178 -0
  164. package/dist/site-document.d.ts +5 -0
  165. package/dist/site-document.js +20 -0
  166. package/dist/site-document.js.map +1 -0
  167. package/dist/site-document.test.d.ts +1 -0
  168. package/dist/site-http.d.ts +17 -0
  169. package/dist/site-sql.d.ts +31 -0
  170. package/dist/site-tool-bridge.d.ts +57 -0
  171. package/dist/site.d.ts +186 -0
  172. package/dist/site.js +63 -0
  173. package/dist/site.js.map +1 -0
  174. package/dist/skills.d.ts +75 -0
  175. package/dist/sse.d.ts +1 -1
  176. package/dist/stream.d.ts +2 -0
  177. package/dist/tenant-workspaces.d.ts +47 -0
  178. package/dist/tenant-workspaces.js +8 -0
  179. package/dist/tenant-workspaces.js.map +1 -0
  180. package/dist/tool-auth.d.ts +87 -0
  181. package/dist/tool-auth.js +23 -0
  182. package/dist/tool-auth.js.map +1 -0
  183. package/dist/tool-display-metadata.d.ts +3 -0
  184. package/dist/tools-37DCTCNZ.js +12 -0
  185. package/dist/tools-37DCTCNZ.js.map +1 -0
  186. package/dist/tools.d.ts +81 -0
  187. package/dist/transcription.d.ts +1 -1
  188. package/dist/types.d.ts +2807 -583
  189. package/dist/usage-allowances.d.ts +36 -0
  190. package/dist/usage-allowances.js +80 -0
  191. package/dist/usage-allowances.js.map +1 -0
  192. package/dist/vault-types.d.ts +324 -0
  193. package/dist/vaults-api.d.ts +65 -0
  194. package/dist/workspace-artifacts.d.ts +47 -5
  195. package/dist/workspace-instruction-policies.d.ts +2 -2
  196. package/dist/workspace-integrations.d.ts +74 -0
  197. package/dist/workspace-integrations.js +67 -0
  198. package/dist/workspace-integrations.js.map +1 -0
  199. package/dist/workspace-state.d.ts +8 -71
  200. package/package.json +103 -5
  201. package/src/adapters/express.ts +136 -0
  202. package/src/adapters/hono.ts +18 -0
  203. package/src/adapters/next.ts +42 -0
  204. package/src/allowance-refusal.ts +5 -0
  205. package/src/app-links.ts +117 -0
  206. package/src/artifact-catalog.ts +51 -0
  207. package/src/artifact-client.ts +40 -49
  208. package/src/artifacts.ts +1 -0
  209. package/src/automations-client.ts +8 -2
  210. package/src/azure-live-transport.ts +286 -0
  211. package/src/browser.ts +37 -0
  212. package/src/chat/fold.ts +431 -0
  213. package/src/chat/handler.ts +240 -0
  214. package/src/chat/http.ts +257 -0
  215. package/src/chat/ids.ts +85 -0
  216. package/src/chat/index.ts +88 -0
  217. package/src/chat/openai.ts +439 -0
  218. package/src/chat/opengeni.ts +737 -0
  219. package/src/chat/types.ts +219 -0
  220. package/src/chat/vercel.ts +204 -0
  221. package/src/chats.ts +16 -0
  222. package/src/client.ts +5697 -1833
  223. package/src/codex-realtime-controller.ts +163 -8
  224. package/src/codex-realtime-v3-wire.ts +4 -3
  225. package/src/codex-realtime-v3.ts +12 -3
  226. package/src/codex-realtime.ts +11 -3
  227. package/src/company-brain.ts +0 -40
  228. package/src/core.ts +20 -0
  229. package/src/deprecation.ts +149 -0
  230. package/src/document-authority-client.ts +104 -1
  231. package/src/editable-artifacts/controller.ts +36 -2
  232. package/src/editable-artifacts/index.ts +1 -0
  233. package/src/editable-artifacts/types.ts +29 -16
  234. package/src/embedding-client.ts +519 -0
  235. package/src/errors.ts +303 -4
  236. package/src/external-vault-receiver.ts +914 -0
  237. package/src/feedback.ts +20 -0
  238. package/src/gateway-realtime-transport.ts +3 -3
  239. package/src/github-repositories.ts +60 -0
  240. package/src/index.ts +603 -65
  241. package/src/insights-usage.ts +64 -0
  242. package/src/interaction.ts +315 -93
  243. package/src/knowledge.ts +72 -0
  244. package/src/known-tools.ts +279 -0
  245. package/src/message-links.ts +178 -0
  246. package/src/model-context.ts +113 -0
  247. package/src/model-display.ts +11 -0
  248. package/src/model-picker-order.ts +6 -0
  249. package/src/organization-integration-policy.ts +54 -0
  250. package/src/pr-review-client.ts +1 -1
  251. package/src/pr-review.ts +1 -1
  252. package/src/preference-registry.ts +2 -0
  253. package/src/prepared-mcp-setup.ts +123 -0
  254. package/src/proxy.ts +23 -12
  255. package/src/realtime.ts +15 -6
  256. package/src/session-history-import.ts +84 -0
  257. package/src/session-list-entries.ts +1 -0
  258. package/src/session-message-search.ts +47 -0
  259. package/src/session-proxy-client.ts +68 -0
  260. package/src/session-proxy.ts +2098 -0
  261. package/src/session-titles.ts +8 -82
  262. package/src/session-usage-limits.ts +71 -0
  263. package/src/shared-catalog-loader.ts +169 -0
  264. package/src/site-ai.ts +284 -0
  265. package/src/site-bridge-host.ts +422 -0
  266. package/src/site-browser-entry.ts +6 -0
  267. package/src/site-browser-runtime.gen.ts +2 -0
  268. package/src/site-data.ts +372 -0
  269. package/src/site-document.test.ts +64 -0
  270. package/src/site-document.ts +18 -0
  271. package/src/site-http.ts +171 -0
  272. package/src/site-sql.ts +153 -0
  273. package/src/site-tool-bridge.ts +401 -0
  274. package/src/site.ts +878 -0
  275. package/src/skills.ts +69 -0
  276. package/src/sse.ts +9 -3
  277. package/src/stream.ts +33 -10
  278. package/src/tenant-workspaces.ts +148 -0
  279. package/src/tool-auth.ts +301 -0
  280. package/src/tool-display-metadata.ts +27 -0
  281. package/src/tools.ts +452 -0
  282. package/src/transcription.ts +3 -0
  283. package/src/types.ts +3170 -582
  284. package/src/usage-allowances.ts +189 -0
  285. package/src/vault-types.ts +379 -0
  286. package/src/vaults-api.ts +339 -0
  287. package/src/workspace-artifacts.ts +55 -6
  288. package/src/workspace-instruction-policies.ts +2 -1
  289. package/src/workspace-integrations.ts +402 -0
  290. package/src/workspace-state.ts +8 -82
  291. package/dist/chunk-C2H7HBNP.js.map +0 -1
  292. package/dist/chunk-C4DJPZRU.js +0 -119
  293. package/dist/chunk-C4DJPZRU.js.map +0 -1
  294. package/dist/chunk-JUS2UYRP.js.map +0 -1
  295. package/dist/chunk-KKRO2VCP.js.map +0 -1
  296. package/dist/chunk-QT3KFVDP.js.map +0 -1
  297. package/dist/chunk-TRNI7KEO.js.map +0 -1
  298. package/dist/chunk-VYCTL62C.js.map +0 -1
  299. package/dist/chunk-YXQX7RQT.js.map +0 -1
@@ -1,4 +1,22 @@
1
- import type { OpenGeniRequestOptions } from "./client";
1
+ import type { ComputerNativeCallRequest, ComputerNativeReceipt } from "@opengeni/contracts";
2
+ export type {
3
+ ComputerNativeCallRequest,
4
+ ComputerNativeReceipt,
5
+ ComputerOperationReceipt,
6
+ } from "@opengeni/contracts";
7
+ import type { InteractionSessionListOptions, OpenGeniRequestOptions } from "./client";
8
+ import { browserSessionStorageMode } from "@opengeni/contracts/browser-storage";
9
+ import type {
10
+ BrowserDomReadRequest,
11
+ BrowserDomReadResponse,
12
+ BrowserTargetState,
13
+ } from "@opengeni/contracts";
14
+ export type {
15
+ BrowserDomReadRequest,
16
+ BrowserDomReadResponse,
17
+ BrowserDomSafeAttribute,
18
+ BrowserTargetState,
19
+ } from "@opengeni/contracts";
2
20
  import { OpenGeniApiError } from "./errors";
3
21
  import type { RetainedArtifactReference } from "./types";
4
22
 
@@ -54,7 +72,7 @@ export type InteractionControlFailure = {
54
72
  message: string;
55
73
  };
56
74
 
57
- /** Decodes the bounded typed control-failure details emitted by OpenGeni. Raw
75
+ /** Decodes the bounded typed control-failure details emitted by Opengeni. Raw
58
76
  * provider/OS detail is intentionally absent; both correlation ids are opaque. */
59
77
  export function interactionControlFailureFromError(
60
78
  error: unknown,
@@ -318,36 +336,14 @@ export type NetworkRouteMutationResponse = {
318
336
  replayed: boolean;
319
337
  };
320
338
 
321
- export type SiteAuthFieldPurpose = "identifier" | "password" | "secret" | "totp";
322
- export type SiteAuthAuthority =
323
- | {
324
- id: string;
325
- kind: "connection_fields";
326
- label: string;
327
- credential: InteractionCredentialAuthorityRef;
328
- fields: Array<{
329
- id: string;
330
- purpose: SiteAuthFieldPurpose;
331
- credentialKey: string;
332
- digits?: number | undefined;
333
- periodSeconds?: number | undefined;
334
- algorithm?: "sha1" | "sha256" | "sha512" | undefined;
335
- }>;
336
- }
337
- | {
338
- id: string;
339
- kind: "human";
340
- label: string;
341
- fields: Array<{ id: string; purpose: SiteAuthFieldPurpose }>;
342
- }
343
- | {
344
- id: string;
345
- kind: "external_provider";
346
- label: string;
347
- adapterId: string;
348
- connectionId: string;
349
- credential: InteractionCredentialAuthorityRef | null;
350
- };
339
+ export type SiteAuthAuthority = {
340
+ id: string;
341
+ kind: "external_provider";
342
+ label: string;
343
+ adapterId: string;
344
+ connectionId: string;
345
+ credential: InteractionCredentialAuthorityRef | null;
346
+ };
351
347
 
352
348
  export type SiteAuthMethod = {
353
349
  id: string;
@@ -433,14 +429,12 @@ export type AuthRun = {
433
429
  state:
434
430
  | "discovering"
435
431
  | "awaiting_choice"
436
- | "awaiting_secret"
437
432
  | "awaiting_external_action"
438
433
  | "working"
439
434
  | "verified"
440
435
  | "failed"
441
436
  | "cancelled";
442
437
  choices: Array<{ id: string; label: string; methodId: string }>;
443
- pendingFields: Array<{ id: string; label: string; purpose: SiteAuthFieldPurpose }>;
444
438
  externalAction: {
445
439
  kind: "push" | "security_key" | "passkey" | "device" | "human" | "other";
446
440
  label: string;
@@ -474,37 +468,11 @@ export type ReportAuthRunRequest = {
474
468
  expectedVersion: number;
475
469
  methodId?: string | undefined;
476
470
  authorityId?: string | undefined;
477
- state:
478
- | "awaiting_choice"
479
- | "awaiting_secret"
480
- | "awaiting_external_action"
481
- | "working"
482
- | "failed"
483
- | "cancelled";
471
+ state: "awaiting_choice" | "awaiting_external_action" | "working" | "failed" | "cancelled";
484
472
  choices?: AuthRun["choices"] | undefined;
485
- pendingFields?: AuthRun["pendingFields"] | undefined;
486
473
  externalAction?: AuthRun["externalAction"] | undefined;
487
474
  failureCode?: string | null | undefined;
488
475
  };
489
- export type ProtectedAuthFillRequest = {
490
- operationId: string;
491
- expectedVersion: number;
492
- expectedTargetGeneration: string;
493
- expectedDocumentGeneration: string | null;
494
- expectedFrameId: string | null;
495
- authorityId: string;
496
- fields: Array<{ fieldId: string; locator: BrowserLocator }>;
497
- submit:
498
- | { type: "none" }
499
- | { type: "click"; locator: BrowserLocator }
500
- | { type: "press"; key: string; locator?: BrowserLocator | undefined };
501
- };
502
- export type ProtectedAuthFillResponse = {
503
- run: AuthRun;
504
- status: "submitted" | "working" | "needs_human" | "stale" | "failed";
505
- operationId: string;
506
- replayed: boolean;
507
- };
508
476
  export type ExternalAuthRunRequest = {
509
477
  operationId: string;
510
478
  expectedVersion: number;
@@ -802,6 +770,17 @@ export type BrowserObservation = {
802
770
  frameId: string | null;
803
771
  semantic: InteractionSemanticSnapshot | InteractionSemanticDiff | null;
804
772
  screenshot: RetainedArtifactReference | null;
773
+ viewport?:
774
+ | {
775
+ width: number;
776
+ height: number;
777
+ visualWidth: number;
778
+ visualHeight: number;
779
+ deviceScaleFactor: number;
780
+ maxTouchPoints: number;
781
+ }
782
+ | null
783
+ | undefined;
805
784
  focusedRef: string | null;
806
785
  changedRegions: InteractionRect[];
807
786
  diagnostics: InteractionDiagnosticSummary;
@@ -863,6 +842,15 @@ export type BrowserPermissionSetting = "granted" | "denied" | "prompt";
863
842
 
864
843
  export type BrowserAction =
865
844
  | { type: "navigate"; url: string }
845
+ | { type: "history"; direction: "back" | "forward" }
846
+ | { type: "activate" }
847
+ | {
848
+ type: "viewport";
849
+ width: number;
850
+ height: number;
851
+ mobile: boolean;
852
+ deviceScaleFactor?: number | undefined;
853
+ }
866
854
  | {
867
855
  type: "click";
868
856
  locator: BrowserLocator;
@@ -871,7 +859,13 @@ export type BrowserAction =
871
859
  | { type: "double_click"; locator: BrowserLocator }
872
860
  | { type: "hover"; locator: BrowserLocator }
873
861
  | { type: "fill"; locator: BrowserLocator; value: string }
874
- | { type: "type"; locator?: BrowserLocator | undefined; text: string }
862
+ | {
863
+ type: "type";
864
+ locator?: BrowserLocator | undefined;
865
+ text: string;
866
+ /** `keys` sends one key press per character (split one-time-code boxes). */
867
+ mode?: "insert" | "keys" | undefined;
868
+ }
875
869
  | { type: "press"; locator?: BrowserLocator | undefined; key: string }
876
870
  | { type: "select"; locator: BrowserLocator; values: string[] }
877
871
  | { type: "check"; locator: BrowserLocator; checked: boolean }
@@ -919,7 +913,11 @@ export type BrowserAction =
919
913
  timeoutMs?: number | undefined;
920
914
  };
921
915
 
922
- export type BrowserActionBatch = { type: "batch"; actions: BrowserAction[] };
916
+ export type BrowserActionBatch = {
917
+ type: "batch";
918
+ actions: BrowserAction[];
919
+ fenceEachAction?: true | undefined;
920
+ };
923
921
 
924
922
  export type InteractionError = {
925
923
  code:
@@ -941,6 +939,8 @@ export type InteractionError = {
941
939
  | "outcome_unknown"
942
940
  | "invalid_action"
943
941
  | "timeout"
942
+ | "tab_not_responding"
943
+ | "tab_crashed"
944
944
  | "controller_lost"
945
945
  | "driver_failed";
946
946
  message: string;
@@ -974,6 +974,7 @@ export type CreateBrowserSessionRequest = {
974
974
  name?: string | undefined;
975
975
  initialUrl?: string | undefined;
976
976
  headless?: boolean | undefined;
977
+ storageMode?: "private_profile" | "ephemeral_context" | undefined;
977
978
  engine?: "chromium" | "lightpanda" | undefined;
978
979
  placement?: InteractionPlacement | undefined;
979
980
  identityId?: string | undefined;
@@ -990,9 +991,82 @@ export type BrowserSessionListResponse = {
990
991
  export type BrowserSessionMutationResponse = {
991
992
  session: BrowserSession;
992
993
  operation: InteractionLifecycleOperationReceipt;
994
+ /** Present only on a create that launched the browser in this request. */
995
+ initialView?: { targets: BrowserTarget[]; observation: BrowserObservation } | undefined;
993
996
  };
994
997
 
995
998
  export type BrowserSessionLifecycleRequest = { operationId: string };
999
+
1000
+ /** Why a browser's preserved working copy cannot be adopted as it is. */
1001
+ export type BrowserWorkingCopyRefusal =
1002
+ | "unsupported_platform"
1003
+ | "unsupported_browser"
1004
+ | "browser_running"
1005
+ | "working_copy_invalid"
1006
+ | "receipt_not_adoptable"
1007
+ | "authority_changed"
1008
+ | "process_state_unknown"
1009
+ | "adoption_not_needed"
1010
+ | "adoption_unresolved";
1011
+
1012
+ /** One adoption of a copied working directory, as its controller recorded it. */
1013
+ export type BrowserWorkingCopyAdoption = {
1014
+ operationId: string;
1015
+ browserSessionId: string;
1016
+ controllerGeneration: string;
1017
+ manifestDigest: string;
1018
+ phase:
1019
+ | "intent"
1020
+ | "copied"
1021
+ | "receipt"
1022
+ | "source_preserved"
1023
+ | "adopted"
1024
+ | "interrupted"
1025
+ | "failed"
1026
+ | "collision"
1027
+ | "reverting"
1028
+ | "reverted";
1029
+ failureCode: string | null;
1030
+ retainedDirectories: string[];
1031
+ createdAt: string;
1032
+ updatedAt: string;
1033
+ };
1034
+
1035
+ /** Evidence about a browser's preserved working copy after its controller lost
1036
+ * it. Freshness is never machine-proven. */
1037
+ export type BrowserWorkingCopyInspection = {
1038
+ browserSessionId: string;
1039
+ controllerGeneration: string;
1040
+ adoptable: boolean;
1041
+ refusal: BrowserWorkingCopyRefusal | null;
1042
+ explanation: string;
1043
+ /** `excluded` lists the controller-owned derived entries left out of the
1044
+ * copy (journal shared-memory indexes and the per-launch launcher folder). */
1045
+ manifest: { digest: string; entries: number; bytes: number; excluded: string[] } | null;
1046
+ platformSupported: boolean;
1047
+ profileIdentityMatches: boolean;
1048
+ profileInUse: boolean | null;
1049
+ receipt: {
1050
+ operationId: string;
1051
+ intent: "launch" | "suspend" | "retire" | "adopt";
1052
+ state: string;
1053
+ directoryLaunchAllowed: boolean;
1054
+ authorityMatches: boolean;
1055
+ launchedFromCheckpoint: boolean;
1056
+ adoption: { operationId: string; manifestDigest: string } | null;
1057
+ } | null;
1058
+ freshness: { status: "unknown"; latestCheckpointAt: string | null };
1059
+ activeAdoption: BrowserWorkingCopyAdoption | null;
1060
+ };
1061
+
1062
+ export type BrowserWorkingCopyAdoptionRequest = { operationId: string; manifestDigest: string };
1063
+
1064
+ export type BrowserWorkingCopyAdoptionResponse = {
1065
+ inFlight: boolean;
1066
+ adoption: BrowserWorkingCopyAdoption | null;
1067
+ explanation: string;
1068
+ };
1069
+
996
1070
  export type BrowserOpenTargetRequest = { url?: string | undefined };
997
1071
 
998
1072
  export type BrowserTargetListResponse = {
@@ -1018,13 +1092,16 @@ export type InteractionFrameStreamAttachment<RelayKind extends 3 | 4 = 3 | 4> =
1018
1092
 
1019
1093
  export type ComputerFrameStreamAttachment =
1020
1094
  | InteractionFrameStreamAttachment<4>
1021
- | { kind: "direct_rfb"; url: string; protocols: string[] };
1095
+ | { kind: "direct_rfb"; url: string; protocols: string[]; inputAllowed: boolean };
1022
1096
 
1023
1097
  export type BrowserSessionAttachment = {
1024
1098
  browserSessionId: string;
1025
1099
  controllerGeneration: string;
1026
1100
  targetId: string;
1027
1101
  stream: InteractionFrameStreamAttachment<3>;
1102
+ /** Negotiated from this attachment’s live controller, absent on older helpers. */
1103
+ fencedInputBatches?: true | undefined;
1104
+ focusedInputObservations?: true | undefined;
1028
1105
  expiresAt: string;
1029
1106
  };
1030
1107
 
@@ -1037,10 +1114,15 @@ export type BrowserSessionAttachmentRequest = {
1037
1114
  export type BrowserActionRequest = {
1038
1115
  operationId: string;
1039
1116
  targetId: string;
1040
- expectedTargetGeneration: string;
1041
- expectedDocumentGeneration: string | null;
1042
- expectedFrameId: string | null;
1043
- observationMode?: "full" | "none" | undefined;
1117
+ /** Omit the three fences to act on the target's current state; the API reads
1118
+ * them from the live controller in the same request. */
1119
+ expectedTargetGeneration?: string | undefined;
1120
+ expectedDocumentGeneration?: string | null | undefined;
1121
+ expectedFrameId?: string | null | undefined;
1122
+ /** `input` is negotiated by focusedInputObservations on a live attachment.
1123
+ * It returns optional native-select metadata after a pointer click, and null
1124
+ * for ordinary input. Use full for agent observations. */
1125
+ observationMode?: "full" | "none" | "input" | undefined;
1044
1126
  action: BrowserAction | BrowserActionBatch;
1045
1127
  };
1046
1128
 
@@ -1055,6 +1137,17 @@ export type BrowserActionReceipt = {
1055
1137
  settledAt: string | null;
1056
1138
  observation: BrowserObservation | null;
1057
1139
  error: InteractionError | null;
1140
+ /** Elements the action's locators resolved to, in dispatch order. */
1141
+ targets?: BrowserActionResolvedTarget[] | undefined;
1142
+ };
1143
+
1144
+ export type BrowserActionResolvedTarget = {
1145
+ actionIndex: number;
1146
+ ref: string | null;
1147
+ role: string;
1148
+ name: string | null;
1149
+ /** Nearest dialog, landmark, menu or toolbar around the element. */
1150
+ container: { role: string; name: string | null } | null;
1058
1151
  };
1059
1152
 
1060
1153
  export type BrowserSessionHeartbeatResponse = {
@@ -1071,9 +1164,13 @@ export type ComputerSessionCapabilities = {
1071
1164
  screenCapture: boolean;
1072
1165
  semanticActions: boolean;
1073
1166
  pointerInput: boolean;
1167
+ /** Causal count-2 input requires its exact confirmed first operation. Absent means unsupported. */
1168
+ pointerClickContinuation?: boolean | undefined;
1074
1169
  keyboardInput: boolean;
1075
1170
  clipboard: boolean;
1076
1171
  backgroundActions: boolean;
1172
+ /** Raw window input stays in the background. Absent means foreground-only. */
1173
+ backgroundInput?: boolean | undefined;
1077
1174
  parallelApps: boolean;
1078
1175
  };
1079
1176
 
@@ -1172,6 +1269,9 @@ export type ComputerAction =
1172
1269
  deltaX?: number | undefined;
1173
1270
  deltaY?: number | undefined;
1174
1271
  button?: "left" | "right" | "middle" | undefined;
1272
+ /** Click only; 2 delivers one second click pair after a completed first click. */
1273
+ clickCount?: 1 | 2 | undefined;
1274
+ continuationOfOperationId?: string | undefined;
1175
1275
  }
1176
1276
  | { type: "keyboard"; action: "type" | "press"; value: string }
1177
1277
  | {
@@ -1221,10 +1321,19 @@ export type ComputerSessionAttachment = {
1221
1321
  computerSessionId: string;
1222
1322
  controllerGeneration: string;
1223
1323
  targetId: string;
1324
+ /** Viewer posture when attached; actions still reauthorize the live source. */
1325
+ inputAllowed?: boolean | undefined;
1224
1326
  stream: ComputerFrameStreamAttachment;
1225
1327
  expiresAt: string;
1226
1328
  };
1227
1329
 
1330
+ /** Caller-specific hint only; every action still requires live authorization. */
1331
+ export type ComputerSessionInputPosture = {
1332
+ computerSessionId: string;
1333
+ controllerGeneration: string;
1334
+ inputAllowed: boolean;
1335
+ };
1336
+
1228
1337
  export type ComputerSessionAttachmentRequest = {
1229
1338
  targetId: string;
1230
1339
  expiresInSeconds?: number | undefined;
@@ -1327,13 +1436,6 @@ export interface InteractionTransport {
1327
1436
  request: ReportAuthRunRequest,
1328
1437
  options?: OpenGeniRequestOptions,
1329
1438
  ): Promise<AuthRunMutationResponse>;
1330
- protectedBrowserAuthFill(
1331
- workspaceId: string,
1332
- browserSessionId: string,
1333
- authRunId: string,
1334
- request: ProtectedAuthFillRequest,
1335
- options?: OpenGeniRequestOptions,
1336
- ): Promise<ProtectedAuthFillResponse>;
1337
1439
  advanceExternalBrowserAuthRun(
1338
1440
  workspaceId: string,
1339
1441
  browserSessionId: string,
@@ -1411,7 +1513,7 @@ export interface InteractionTransport {
1411
1513
  ): Promise<BrowserRevisionListResponse>;
1412
1514
  listBrowserSessions(
1413
1515
  workspaceId: string,
1414
- options?: OpenGeniRequestOptions,
1516
+ options?: OpenGeniRequestOptions | InteractionSessionListOptions,
1415
1517
  ): Promise<BrowserSessionListResponse>;
1416
1518
  getBrowserSession(
1417
1519
  workspaceId: string,
@@ -1457,6 +1559,13 @@ export interface InteractionTransport {
1457
1559
  request?: BrowserOpenTargetRequest,
1458
1560
  options?: OpenGeniRequestOptions,
1459
1561
  ): Promise<BrowserObservation>;
1562
+ /** Optional for custom transports predating metadata-only tab opening. */
1563
+ openBrowserTargetWithInventory?(
1564
+ workspaceId: string,
1565
+ browserSessionId: string,
1566
+ request?: BrowserOpenTargetRequest,
1567
+ options?: OpenGeniRequestOptions,
1568
+ ): Promise<BrowserTargetListResponse>;
1460
1569
  selectBrowserTarget(
1461
1570
  workspaceId: string,
1462
1571
  browserSessionId: string,
@@ -1475,6 +1584,26 @@ export interface InteractionTransport {
1475
1584
  targetId: string,
1476
1585
  options?: OpenGeniRequestOptions,
1477
1586
  ): Promise<BrowserObservation>;
1587
+ getBrowserTargetState(
1588
+ workspaceId: string,
1589
+ browserSessionId: string,
1590
+ targetId: string,
1591
+ options?: OpenGeniRequestOptions,
1592
+ ): Promise<BrowserTargetState>;
1593
+ readBrowserDom(
1594
+ workspaceId: string,
1595
+ browserSessionId: string,
1596
+ targetId: string,
1597
+ request: BrowserDomReadRequest,
1598
+ options?: OpenGeniRequestOptions,
1599
+ ): Promise<BrowserDomReadResponse>;
1600
+ captureBrowserTarget(
1601
+ workspaceId: string,
1602
+ browserSessionId: string,
1603
+ targetId: string,
1604
+ options?: OpenGeniRequestOptions,
1605
+ captureOptions?: BrowserScreenshotOptions,
1606
+ ): Promise<BrowserFrame>;
1478
1607
  actInBrowser(
1479
1608
  workspaceId: string,
1480
1609
  browserSessionId: string,
@@ -1530,13 +1659,18 @@ export interface InteractionTransport {
1530
1659
  ): Promise<BrowserSessionMutationResponse>;
1531
1660
  listComputerSessions(
1532
1661
  workspaceId: string,
1533
- options?: OpenGeniRequestOptions,
1662
+ options?: OpenGeniRequestOptions | InteractionSessionListOptions,
1534
1663
  ): Promise<ComputerSessionListResponse>;
1535
1664
  getComputerSession(
1536
1665
  workspaceId: string,
1537
1666
  computerSessionId: string,
1538
1667
  options?: OpenGeniRequestOptions,
1539
1668
  ): Promise<ComputerSession>;
1669
+ getComputerInputPosture?(
1670
+ workspaceId: string,
1671
+ computerSessionId: string,
1672
+ options?: OpenGeniRequestOptions,
1673
+ ): Promise<ComputerSessionInputPosture>;
1540
1674
  readComputerClipboard(
1541
1675
  workspaceId: string,
1542
1676
  computerSessionId: string,
@@ -1564,12 +1698,24 @@ export interface InteractionTransport {
1564
1698
  targetId: string,
1565
1699
  options?: OpenGeniRequestOptions,
1566
1700
  ): Promise<ComputerFrame>;
1701
+ callNativeComputerTool?(
1702
+ workspaceId: string,
1703
+ computerSessionId: string,
1704
+ request: ComputerNativeCallRequest,
1705
+ options?: OpenGeniRequestOptions,
1706
+ ): Promise<ComputerNativeReceipt>;
1567
1707
  actInComputer(
1568
1708
  workspaceId: string,
1569
1709
  computerSessionId: string,
1570
1710
  request: ComputerActionRequest,
1571
1711
  options?: OpenGeniRequestOptions,
1572
1712
  ): Promise<ComputerActionReceipt>;
1713
+ getNativeComputerToolReceipt?(
1714
+ workspaceId: string,
1715
+ computerSessionId: string,
1716
+ operationId: string,
1717
+ options?: OpenGeniRequestOptions,
1718
+ ): Promise<ComputerNativeReceipt>;
1573
1719
  getComputerActionReceipt(
1574
1720
  workspaceId: string,
1575
1721
  computerSessionId: string,
@@ -1638,6 +1784,7 @@ export type CurrentOrOpenBrowserOptions = {
1638
1784
  name?: string | undefined;
1639
1785
  initialUrl?: string | undefined;
1640
1786
  headless?: boolean | undefined;
1787
+ storageMode?: "private_profile" | "ephemeral_context" | undefined;
1641
1788
  placement?: InteractionPlacement | undefined;
1642
1789
  identityId?: string | undefined;
1643
1790
  baseRevisionId?: string | undefined;
@@ -1852,19 +1999,6 @@ export class AuthRunResource {
1852
1999
  );
1853
2000
  }
1854
2001
 
1855
- async protectedFill(
1856
- request: ProtectedAuthFillRequest,
1857
- options: OpenGeniRequestOptions = {},
1858
- ): Promise<ProtectedAuthFillResponse> {
1859
- return await this.transport.protectedBrowserAuthFill(
1860
- this.workspaceId,
1861
- this.browserSessionId,
1862
- this.id,
1863
- request,
1864
- options,
1865
- );
1866
- }
1867
-
1868
2002
  async advanceExternal(
1869
2003
  request: ExternalAuthRunRequest,
1870
2004
  options: OpenGeniRequestOptions = {},
@@ -2037,7 +2171,7 @@ export class BrowserSessionCollection {
2037
2171
 
2038
2172
  async list(
2039
2173
  workspaceId: string,
2040
- options: OpenGeniRequestOptions = {},
2174
+ options: OpenGeniRequestOptions | InteractionSessionListOptions = {},
2041
2175
  ): Promise<BrowserSessionListResponse> {
2042
2176
  return await this.transport.listBrowserSessions(workspaceId, options);
2043
2177
  }
@@ -2058,7 +2192,13 @@ export class BrowserSessionCollection {
2058
2192
  async currentOrOpen(options: CurrentOrOpenBrowserOptions): Promise<BrowserSessionResource> {
2059
2193
  const requestOptions = options.signal ? { signal: options.signal } : {};
2060
2194
  const listed = await this.list(options.workspaceId, requestOptions);
2061
- const current = newestRelevantBrowser(listed.sessions, options.associationSessionId);
2195
+ const current = newestRelevantBrowser(
2196
+ listed.sessions.filter(
2197
+ (session) =>
2198
+ browserSessionStorageMode(session) === (options.storageMode ?? "private_profile"),
2199
+ ),
2200
+ options.associationSessionId,
2201
+ );
2062
2202
  if (current) {
2063
2203
  const resource = this.session(options.workspaceId, current.id);
2064
2204
  if (current.lifecycle === "suspended") {
@@ -2077,6 +2217,7 @@ export class BrowserSessionCollection {
2077
2217
  ...(options.name !== undefined ? { name: options.name } : {}),
2078
2218
  ...(options.initialUrl !== undefined ? { initialUrl: options.initialUrl } : {}),
2079
2219
  ...(options.headless !== undefined ? { headless: options.headless } : {}),
2220
+ ...(options.storageMode !== undefined ? { storageMode: options.storageMode } : {}),
2080
2221
  ...(options.placement !== undefined ? { placement: options.placement } : {}),
2081
2222
  ...(options.identityId !== undefined ? { identityId: options.identityId } : {}),
2082
2223
  ...(options.baseRevisionId !== undefined ? { baseRevisionId: options.baseRevisionId } : {}),
@@ -2121,6 +2262,49 @@ export class BrowserSessionResource {
2121
2262
  return await this.transport.observeBrowserTarget(this.workspaceId, this.id, targetId, options);
2122
2263
  }
2123
2264
 
2265
+ async targetState(
2266
+ targetId: string,
2267
+ options: OpenGeniRequestOptions = {},
2268
+ ): Promise<BrowserTargetState> {
2269
+ return await this.transport.getBrowserTargetState(this.workspaceId, this.id, targetId, options);
2270
+ }
2271
+
2272
+ async readDom(
2273
+ targetId: string,
2274
+ request: BrowserDomReadRequest,
2275
+ options: OpenGeniRequestOptions = {},
2276
+ ): Promise<BrowserDomReadResponse> {
2277
+ return await this.transport.readBrowserDom(
2278
+ this.workspaceId,
2279
+ this.id,
2280
+ targetId,
2281
+ request,
2282
+ options,
2283
+ );
2284
+ }
2285
+
2286
+ async capture(
2287
+ targetId: string,
2288
+ options: OpenGeniRequestOptions = {},
2289
+ captureOptions: BrowserScreenshotOptions = {},
2290
+ ): Promise<BrowserFrame> {
2291
+ return await this.transport.captureBrowserTarget(
2292
+ this.workspaceId,
2293
+ this.id,
2294
+ targetId,
2295
+ options,
2296
+ captureOptions,
2297
+ );
2298
+ }
2299
+
2300
+ async screenshot(
2301
+ targetId: string,
2302
+ captureOptions: BrowserScreenshotOptions = {},
2303
+ options: OpenGeniRequestOptions = {},
2304
+ ): Promise<BrowserFrame> {
2305
+ return await this.capture(targetId, options, captureOptions);
2306
+ }
2307
+
2124
2308
  async act(
2125
2309
  request: BrowserActionRequest,
2126
2310
  options: OpenGeniRequestOptions = {},
@@ -2343,7 +2527,7 @@ export class ComputerSessionCollection {
2343
2527
 
2344
2528
  async list(
2345
2529
  workspaceId: string,
2346
- options: OpenGeniRequestOptions = {},
2530
+ options: OpenGeniRequestOptions | InteractionSessionListOptions = {},
2347
2531
  ): Promise<ComputerSessionListResponse> {
2348
2532
  return await this.transport.listComputerSessions(workspaceId, options);
2349
2533
  }
@@ -2412,6 +2596,15 @@ export class ComputerSessionResource {
2412
2596
  return await this.transport.captureComputerTarget(this.workspaceId, this.id, targetId, options);
2413
2597
  }
2414
2598
 
2599
+ async callNativeTool(
2600
+ request: ComputerNativeCallRequest,
2601
+ options: OpenGeniRequestOptions = {},
2602
+ ): Promise<ComputerNativeReceipt> {
2603
+ if (!this.transport.callNativeComputerTool)
2604
+ throw new Error("Native CUA tools require a current interaction transport");
2605
+ return await this.transport.callNativeComputerTool(this.workspaceId, this.id, request, options);
2606
+ }
2607
+
2415
2608
  async act(
2416
2609
  request: ComputerActionRequest,
2417
2610
  options: OpenGeniRequestOptions = {},
@@ -2419,6 +2612,20 @@ export class ComputerSessionResource {
2419
2612
  return await this.transport.actInComputer(this.workspaceId, this.id, request, options);
2420
2613
  }
2421
2614
 
2615
+ async nativeReceipt(
2616
+ operationId: string,
2617
+ options: OpenGeniRequestOptions = {},
2618
+ ): Promise<ComputerNativeReceipt> {
2619
+ if (!this.transport.getNativeComputerToolReceipt)
2620
+ throw new Error("Native CUA receipts require a current interaction transport");
2621
+ return await this.transport.getNativeComputerToolReceipt(
2622
+ this.workspaceId,
2623
+ this.id,
2624
+ operationId,
2625
+ options,
2626
+ );
2627
+ }
2628
+
2422
2629
  async receipt(
2423
2630
  operationId: string,
2424
2631
  options: OpenGeniRequestOptions = {},
@@ -2438,6 +2645,13 @@ export class ComputerSessionResource {
2438
2645
  return await this.transport.attachComputerSession(this.workspaceId, this.id, request, options);
2439
2646
  }
2440
2647
 
2648
+ async inputPosture(options: OpenGeniRequestOptions = {}): Promise<ComputerSessionInputPosture> {
2649
+ if (!this.transport.getComputerInputPosture) {
2650
+ throw new Error("Computer input posture requires a current interaction transport.");
2651
+ }
2652
+ return await this.transport.getComputerInputPosture(this.workspaceId, this.id, options);
2653
+ }
2654
+
2441
2655
  async heartbeat(options: OpenGeniRequestOptions = {}): Promise<ComputerSessionHeartbeatResponse> {
2442
2656
  return await this.transport.heartbeatComputerSession(this.workspaceId, this.id, options);
2443
2657
  }
@@ -2505,6 +2719,14 @@ export type BrowserFrameMetadata = {
2505
2719
 
2506
2720
  export type BrowserFrame = BrowserFrameMetadata & { data: Uint8Array };
2507
2721
 
2722
+ export type BrowserScreenshotOptions = {
2723
+ /** Capture the document content instead of the visible viewport. */
2724
+ fullPage?: boolean;
2725
+ format?: "jpeg" | "png";
2726
+ /** JPEG quality, from 1 to 100. Ignored for PNG. */
2727
+ quality?: number;
2728
+ };
2729
+
2508
2730
  export type ComputerFrameMetadata = {
2509
2731
  frameId: string;
2510
2732
  computerSessionId: string;