@opengeni/sdk 3.1.0 → 3.1.2

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 +1037 -71
  2. package/dist/accounts.d.ts +5 -1
  3. package/dist/accounts.js +13 -1
  4. package/dist/accounts.js.map +1 -1
  5. package/dist/adapters/express.d.ts +31 -0
  6. package/dist/adapters/express.js +87 -0
  7. package/dist/adapters/express.js.map +1 -0
  8. package/dist/adapters/hono.d.ts +16 -0
  9. package/dist/adapters/hono.js +8 -0
  10. package/dist/adapters/hono.js.map +1 -0
  11. package/dist/adapters/next.d.ts +29 -0
  12. package/dist/adapters/next.js +22 -0
  13. package/dist/adapters/next.js.map +1 -0
  14. package/dist/allowance-refusal.d.ts +2 -0
  15. package/dist/allowance-refusal.js +50 -0
  16. package/dist/allowance-refusal.js.map +1 -0
  17. package/dist/app-links.d.ts +42 -0
  18. package/dist/app-links.js +66 -0
  19. package/dist/app-links.js.map +1 -0
  20. package/dist/artifact-catalog.d.ts +40 -0
  21. package/dist/artifact-client.d.ts +20 -8
  22. package/dist/artifacts.d.ts +1 -1
  23. package/dist/artifacts.js +8 -6
  24. package/dist/automations.js +8 -2
  25. package/dist/automations.js.map +1 -1
  26. package/dist/azure-live-transport.d.ts +32 -0
  27. package/dist/browser.d.ts +7 -2
  28. package/dist/browser.js +27 -5
  29. package/dist/chat/fold.d.ts +75 -0
  30. package/dist/chat/handler.d.ts +41 -0
  31. package/dist/chat/http.d.ts +67 -0
  32. package/dist/chat/ids.d.ts +34 -0
  33. package/dist/chat/index.d.ts +9 -0
  34. package/dist/chat/index.js +1703 -0
  35. package/dist/chat/index.js.map +1 -0
  36. package/dist/chat/openai.d.ts +30 -0
  37. package/dist/chat/opengeni.d.ts +129 -0
  38. package/dist/chat/types.d.ts +207 -0
  39. package/dist/chat/vercel.d.ts +49 -0
  40. package/dist/chats.d.ts +8 -0
  41. package/dist/chunk-4AHR4KGA.js +301 -0
  42. package/dist/chunk-4AHR4KGA.js.map +1 -0
  43. package/dist/chunk-6HZGAIUE.js +1665 -0
  44. package/dist/chunk-6HZGAIUE.js.map +1 -0
  45. package/dist/chunk-7EWT3PV6.js +368 -0
  46. package/dist/chunk-7EWT3PV6.js.map +1 -0
  47. package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
  48. package/dist/chunk-GZQSWAKD.js.map +1 -0
  49. package/dist/chunk-JXXCTW5W.js +1392 -0
  50. package/dist/chunk-JXXCTW5W.js.map +1 -0
  51. package/dist/{chunk-YTAWBDO2.js → chunk-KADZ5PGG.js} +28 -2
  52. package/dist/chunk-KADZ5PGG.js.map +1 -0
  53. package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
  54. package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
  55. package/dist/{chunk-7ZXBPJZP.js → chunk-NEM5N6C6.js} +3902 -1457
  56. package/dist/chunk-NEM5N6C6.js.map +1 -0
  57. package/dist/{chunk-GW3EJ2GP.js → chunk-O7KANXC3.js} +86 -13
  58. package/dist/chunk-O7KANXC3.js.map +1 -0
  59. package/dist/{chunk-VUQZAB3O.js → chunk-OAKHWFSV.js} +28 -32
  60. package/dist/chunk-OAKHWFSV.js.map +1 -0
  61. package/dist/chunk-P7UWKORG.js +561 -0
  62. package/dist/chunk-P7UWKORG.js.map +1 -0
  63. package/dist/chunk-QGEIL4TR.js +195 -0
  64. package/dist/chunk-QGEIL4TR.js.map +1 -0
  65. package/dist/chunk-RJHCBZF7.js +270 -0
  66. package/dist/chunk-RJHCBZF7.js.map +1 -0
  67. package/dist/chunk-S3D75WSQ.js +340 -0
  68. package/dist/chunk-S3D75WSQ.js.map +1 -0
  69. package/dist/chunk-UM4ZXXJR.js +9 -0
  70. package/dist/chunk-UM4ZXXJR.js.map +1 -0
  71. package/dist/chunk-VPVMLM7Q.js +15 -0
  72. package/dist/chunk-VPVMLM7Q.js.map +1 -0
  73. package/dist/{chunk-C2H7HBNP.js → chunk-WVCJRSGJ.js} +119 -14
  74. package/dist/chunk-WVCJRSGJ.js.map +1 -0
  75. package/dist/chunk-XA7HVIHI.js +126 -0
  76. package/dist/chunk-XA7HVIHI.js.map +1 -0
  77. package/dist/{chunk-TX3EIENU.js → chunk-YDVPI7WT.js} +73 -2
  78. package/dist/chunk-YDVPI7WT.js.map +1 -0
  79. package/dist/chunk-YKIHNLWD.js +153 -0
  80. package/dist/chunk-YKIHNLWD.js.map +1 -0
  81. package/dist/chunk-ZDUBPV33.js +277 -0
  82. package/dist/chunk-ZDUBPV33.js.map +1 -0
  83. package/dist/client.d.ts +1065 -124
  84. package/dist/codex-realtime-controller.d.ts +13 -0
  85. package/dist/codex-realtime-controller.js +4 -2
  86. package/dist/codex-realtime-v3-wire.d.ts +3 -2
  87. package/dist/codex-realtime.d.ts +5 -1
  88. package/dist/company-brain.d.ts +1 -11
  89. package/dist/company-profile.d.ts +13 -0
  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/feedback.d.ts +23 -0
  102. package/dist/gateway-realtime-transport.js +1 -1
  103. package/dist/github-repositories.d.ts +10 -0
  104. package/dist/github-repositories.js +36 -0
  105. package/dist/github-repositories.js.map +1 -0
  106. package/dist/index.d.ts +64 -11
  107. package/dist/index.js +566 -141
  108. package/dist/index.js.map +1 -1
  109. package/dist/insights-usage.d.ts +33 -0
  110. package/dist/insights-usage.js +7 -0
  111. package/dist/insights-usage.js.map +1 -0
  112. package/dist/interaction.d.ts +103 -71
  113. package/dist/interaction.js +4 -2
  114. package/dist/knowledge.d.ts +7 -0
  115. package/dist/knowledge.js +20 -0
  116. package/dist/knowledge.js.map +1 -0
  117. package/dist/known-tools.d.ts +4 -0
  118. package/dist/message-links.d.ts +68 -0
  119. package/dist/model-context.d.ts +68 -0
  120. package/dist/model-display.d.ts +2 -0
  121. package/dist/model-display.js +17 -0
  122. package/dist/model-display.js.map +1 -0
  123. package/dist/model-picker-order.d.ts +1 -0
  124. package/dist/model-picker-order.js +10 -0
  125. package/dist/model-picker-order.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 +4 -2
  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 -0
  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-bridge-host.d.ts +112 -0
  155. package/dist/site-bridge-host.js +285 -0
  156. package/dist/site-bridge-host.js.map +1 -0
  157. package/dist/site-browser-entry.d.ts +1 -0
  158. package/dist/site-browser-runtime.gen.d.ts +1 -0
  159. package/dist/site-data.d.ts +178 -0
  160. package/dist/site-document.d.ts +5 -0
  161. package/dist/site-document.js +20 -0
  162. package/dist/site-document.js.map +1 -0
  163. package/dist/site-document.test.d.ts +1 -0
  164. package/dist/site-http.d.ts +17 -0
  165. package/dist/site-sql.d.ts +31 -0
  166. package/dist/site-tool-bridge.d.ts +57 -0
  167. package/dist/site.d.ts +182 -0
  168. package/dist/site.js +62 -0
  169. package/dist/site.js.map +1 -0
  170. package/dist/skills.d.ts +75 -0
  171. package/dist/sse.d.ts +1 -1
  172. package/dist/stream.d.ts +2 -0
  173. package/dist/tenant-workspaces.d.ts +47 -0
  174. package/dist/tenant-workspaces.js +8 -0
  175. package/dist/tenant-workspaces.js.map +1 -0
  176. package/dist/tool-auth.d.ts +87 -0
  177. package/dist/tool-auth.js +23 -0
  178. package/dist/tool-auth.js.map +1 -0
  179. package/dist/tool-display-metadata.d.ts +3 -0
  180. package/dist/tools-37DCTCNZ.js +12 -0
  181. package/dist/tools-37DCTCNZ.js.map +1 -0
  182. package/dist/tools.d.ts +81 -0
  183. package/dist/transcription.d.ts +1 -1
  184. package/dist/types.d.ts +2848 -573
  185. package/dist/usage-allowances.d.ts +36 -0
  186. package/dist/usage-allowances.js +80 -0
  187. package/dist/usage-allowances.js.map +1 -0
  188. package/dist/vault-types.d.ts +236 -0
  189. package/dist/vaults-api.d.ts +57 -0
  190. package/dist/workspace-artifacts.d.ts +47 -5
  191. package/dist/workspace-instruction-policies.d.ts +2 -2
  192. package/dist/workspace-integrations.d.ts +74 -0
  193. package/dist/workspace-integrations.js +65 -0
  194. package/dist/workspace-integrations.js.map +1 -0
  195. package/dist/workspace-state.d.ts +8 -71
  196. package/package.json +99 -5
  197. package/src/accounts.ts +18 -0
  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 +37 -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 +5822 -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/company-profile.ts +13 -0
  226. package/src/core.ts +20 -0
  227. package/src/deprecation.ts +149 -0
  228. package/src/document-authority-client.ts +104 -1
  229. package/src/editable-artifacts/controller.ts +36 -2
  230. package/src/editable-artifacts/index.ts +1 -0
  231. package/src/editable-artifacts/types.ts +29 -16
  232. package/src/embedding-client.ts +519 -0
  233. package/src/errors.ts +303 -4
  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 +611 -64
  238. package/src/insights-usage.ts +61 -0
  239. package/src/interaction.ts +274 -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/model-picker-order.ts +6 -0
  246. package/src/organization-integration-policy.ts +54 -0
  247. package/src/pr-review-client.ts +1 -1
  248. package/src/pr-review.ts +1 -1
  249. package/src/preference-registry.ts +2 -0
  250. package/src/prepared-mcp-setup.ts +123 -0
  251. package/src/proxy.ts +23 -12
  252. package/src/realtime.ts +16 -6
  253. package/src/session-history-import.ts +84 -0
  254. package/src/session-list-entries.ts +1 -0
  255. package/src/session-message-search.ts +47 -0
  256. package/src/session-proxy-client.ts +68 -0
  257. package/src/session-proxy.ts +2098 -0
  258. package/src/session-titles.ts +10 -0
  259. package/src/session-usage-limits.ts +71 -0
  260. package/src/shared-catalog-loader.ts +169 -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 +867 -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 +3216 -581
  280. package/src/usage-allowances.ts +189 -0
  281. package/src/vault-types.ts +293 -0
  282. package/src/vaults-api.ts +288 -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-7ZXBPJZP.js.map +0 -1
  288. package/dist/chunk-C2H7HBNP.js.map +0 -1
  289. package/dist/chunk-C4DJPZRU.js +0 -119
  290. package/dist/chunk-C4DJPZRU.js.map +0 -1
  291. package/dist/chunk-GW3EJ2GP.js.map +0 -1
  292. package/dist/chunk-TX3EIENU.js.map +0 -1
  293. package/dist/chunk-VUQZAB3O.js.map +0 -1
  294. package/dist/chunk-VYCTL62C.js.map +0 -1
  295. package/dist/chunk-YTAWBDO2.js.map +0 -1
@@ -0,0 +1,61 @@
1
+ // Type-only references keep this opt-in SDK leaf free of zod/root contracts.
2
+ import type {
3
+ OrganizationInsightsUsageQueryInput,
4
+ OrganizationInsightsCallsQueryInput,
5
+ InsightsUsageRange,
6
+ InsightsUsagePayer,
7
+ InsightsUsageSource,
8
+ } from "@opengeni/contracts/insights-usage";
9
+
10
+ export type {
11
+ InsightsUsageRange,
12
+ InsightsUsageGroupBy,
13
+ InsightsUsagePayer,
14
+ InsightsUsageSource,
15
+ InsightsUsageTokens,
16
+ InsightsUsageClassMicros,
17
+ InsightsUsageMeasures,
18
+ InsightsUsageScope,
19
+ InsightsUsageGroup,
20
+ InsightsUsageSeriesPoint,
21
+ InsightsUsageFacets,
22
+ InsightsUsageResponse,
23
+ InsightsCall,
24
+ InsightsCallsResponse,
25
+ } from "@opengeni/contracts/insights-usage";
26
+
27
+ /** Custom selections require both inclusive UTC calendar days. */
28
+ export type InsightsUsageWindowOptions =
29
+ | { range?: Exclude<InsightsUsageRange, "custom">; from?: never; to?: never }
30
+ | { range: "custom"; from: string; to: string };
31
+
32
+ type FilterOptions<T> = Omit<T, "range" | "from" | "to" | "limit" | "payer" | "source"> &
33
+ InsightsUsageWindowOptions & {
34
+ limit?: number;
35
+ payer?: InsightsUsagePayer | InsightsUsagePayer[];
36
+ source?: InsightsUsageSource | InsightsUsageSource[];
37
+ };
38
+
39
+ export type OrganizationInsightsUsageOptions = FilterOptions<
40
+ Omit<OrganizationInsightsUsageQueryInput, "seriesGroups">
41
+ > & { seriesGroups?: boolean };
42
+ /** workspaceId is intersected with the path workspace by the existing server gate. */
43
+ export type WorkspaceInsightsUsageOptions = OrganizationInsightsUsageOptions;
44
+ export type OrganizationInsightsCallsOptions = FilterOptions<OrganizationInsightsCallsQueryInput>;
45
+ export type WorkspaceInsightsCallsOptions = OrganizationInsightsCallsOptions;
46
+ export type InsightsCallsScope =
47
+ | { kind: "workspace"; workspaceId: string }
48
+ | { kind: "organization"; accountId: string };
49
+
50
+ /** Arrays repeat; comma strings, false and opaque values round-trip unchanged. */
51
+ export function insightsUsageQueryString(
52
+ options: OrganizationInsightsUsageOptions | OrganizationInsightsCallsOptions,
53
+ ): string {
54
+ const params = new URLSearchParams();
55
+ for (const [key, value] of Object.entries(options)) {
56
+ if (value === undefined) continue;
57
+ for (const item of Array.isArray(value) ? value : [value]) params.append(key, String(item));
58
+ }
59
+ const query = params.toString();
60
+ return query ? `?${query}` : "";
61
+ }
@@ -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;
@@ -1018,13 +1019,16 @@ export type InteractionFrameStreamAttachment<RelayKind extends 3 | 4 = 3 | 4> =
1018
1019
 
1019
1020
  export type ComputerFrameStreamAttachment =
1020
1021
  | InteractionFrameStreamAttachment<4>
1021
- | { kind: "direct_rfb"; url: string; protocols: string[] };
1022
+ | { kind: "direct_rfb"; url: string; protocols: string[]; inputAllowed: boolean };
1022
1023
 
1023
1024
  export type BrowserSessionAttachment = {
1024
1025
  browserSessionId: string;
1025
1026
  controllerGeneration: string;
1026
1027
  targetId: string;
1027
1028
  stream: InteractionFrameStreamAttachment<3>;
1029
+ /** Negotiated from this attachment’s live controller, absent on older helpers. */
1030
+ fencedInputBatches?: true | undefined;
1031
+ focusedInputObservations?: true | undefined;
1028
1032
  expiresAt: string;
1029
1033
  };
1030
1034
 
@@ -1037,10 +1041,15 @@ export type BrowserSessionAttachmentRequest = {
1037
1041
  export type BrowserActionRequest = {
1038
1042
  operationId: string;
1039
1043
  targetId: string;
1040
- expectedTargetGeneration: string;
1041
- expectedDocumentGeneration: string | null;
1042
- expectedFrameId: string | null;
1043
- observationMode?: "full" | "none" | undefined;
1044
+ /** Omit the three fences to act on the target's current state; the API reads
1045
+ * them from the live controller in the same request. */
1046
+ expectedTargetGeneration?: string | undefined;
1047
+ expectedDocumentGeneration?: string | null | undefined;
1048
+ expectedFrameId?: string | null | undefined;
1049
+ /** `input` is negotiated by focusedInputObservations on a live attachment.
1050
+ * It returns optional native-select metadata after a pointer click, and null
1051
+ * for ordinary input. Use full for agent observations. */
1052
+ observationMode?: "full" | "none" | "input" | undefined;
1044
1053
  action: BrowserAction | BrowserActionBatch;
1045
1054
  };
1046
1055
 
@@ -1055,6 +1064,17 @@ export type BrowserActionReceipt = {
1055
1064
  settledAt: string | null;
1056
1065
  observation: BrowserObservation | null;
1057
1066
  error: InteractionError | null;
1067
+ /** Elements the action's locators resolved to, in dispatch order. */
1068
+ targets?: BrowserActionResolvedTarget[] | undefined;
1069
+ };
1070
+
1071
+ export type BrowserActionResolvedTarget = {
1072
+ actionIndex: number;
1073
+ ref: string | null;
1074
+ role: string;
1075
+ name: string | null;
1076
+ /** Nearest dialog, landmark, menu or toolbar around the element. */
1077
+ container: { role: string; name: string | null } | null;
1058
1078
  };
1059
1079
 
1060
1080
  export type BrowserSessionHeartbeatResponse = {
@@ -1071,9 +1091,13 @@ export type ComputerSessionCapabilities = {
1071
1091
  screenCapture: boolean;
1072
1092
  semanticActions: boolean;
1073
1093
  pointerInput: boolean;
1094
+ /** Causal count-2 input requires its exact confirmed first operation. Absent means unsupported. */
1095
+ pointerClickContinuation?: boolean | undefined;
1074
1096
  keyboardInput: boolean;
1075
1097
  clipboard: boolean;
1076
1098
  backgroundActions: boolean;
1099
+ /** Raw window input stays in the background. Absent means foreground-only. */
1100
+ backgroundInput?: boolean | undefined;
1077
1101
  parallelApps: boolean;
1078
1102
  };
1079
1103
 
@@ -1172,6 +1196,9 @@ export type ComputerAction =
1172
1196
  deltaX?: number | undefined;
1173
1197
  deltaY?: number | undefined;
1174
1198
  button?: "left" | "right" | "middle" | undefined;
1199
+ /** Click only; 2 delivers one second click pair after a completed first click. */
1200
+ clickCount?: 1 | 2 | undefined;
1201
+ continuationOfOperationId?: string | undefined;
1175
1202
  }
1176
1203
  | { type: "keyboard"; action: "type" | "press"; value: string }
1177
1204
  | {
@@ -1221,10 +1248,19 @@ export type ComputerSessionAttachment = {
1221
1248
  computerSessionId: string;
1222
1249
  controllerGeneration: string;
1223
1250
  targetId: string;
1251
+ /** Viewer posture when attached; actions still reauthorize the live source. */
1252
+ inputAllowed?: boolean | undefined;
1224
1253
  stream: ComputerFrameStreamAttachment;
1225
1254
  expiresAt: string;
1226
1255
  };
1227
1256
 
1257
+ /** Caller-specific hint only; every action still requires live authorization. */
1258
+ export type ComputerSessionInputPosture = {
1259
+ computerSessionId: string;
1260
+ controllerGeneration: string;
1261
+ inputAllowed: boolean;
1262
+ };
1263
+
1228
1264
  export type ComputerSessionAttachmentRequest = {
1229
1265
  targetId: string;
1230
1266
  expiresInSeconds?: number | undefined;
@@ -1327,13 +1363,6 @@ export interface InteractionTransport {
1327
1363
  request: ReportAuthRunRequest,
1328
1364
  options?: OpenGeniRequestOptions,
1329
1365
  ): Promise<AuthRunMutationResponse>;
1330
- protectedBrowserAuthFill(
1331
- workspaceId: string,
1332
- browserSessionId: string,
1333
- authRunId: string,
1334
- request: ProtectedAuthFillRequest,
1335
- options?: OpenGeniRequestOptions,
1336
- ): Promise<ProtectedAuthFillResponse>;
1337
1366
  advanceExternalBrowserAuthRun(
1338
1367
  workspaceId: string,
1339
1368
  browserSessionId: string,
@@ -1411,7 +1440,7 @@ export interface InteractionTransport {
1411
1440
  ): Promise<BrowserRevisionListResponse>;
1412
1441
  listBrowserSessions(
1413
1442
  workspaceId: string,
1414
- options?: OpenGeniRequestOptions,
1443
+ options?: OpenGeniRequestOptions | InteractionSessionListOptions,
1415
1444
  ): Promise<BrowserSessionListResponse>;
1416
1445
  getBrowserSession(
1417
1446
  workspaceId: string,
@@ -1457,6 +1486,13 @@ export interface InteractionTransport {
1457
1486
  request?: BrowserOpenTargetRequest,
1458
1487
  options?: OpenGeniRequestOptions,
1459
1488
  ): Promise<BrowserObservation>;
1489
+ /** Optional for custom transports predating metadata-only tab opening. */
1490
+ openBrowserTargetWithInventory?(
1491
+ workspaceId: string,
1492
+ browserSessionId: string,
1493
+ request?: BrowserOpenTargetRequest,
1494
+ options?: OpenGeniRequestOptions,
1495
+ ): Promise<BrowserTargetListResponse>;
1460
1496
  selectBrowserTarget(
1461
1497
  workspaceId: string,
1462
1498
  browserSessionId: string,
@@ -1475,6 +1511,26 @@ export interface InteractionTransport {
1475
1511
  targetId: string,
1476
1512
  options?: OpenGeniRequestOptions,
1477
1513
  ): Promise<BrowserObservation>;
1514
+ getBrowserTargetState(
1515
+ workspaceId: string,
1516
+ browserSessionId: string,
1517
+ targetId: string,
1518
+ options?: OpenGeniRequestOptions,
1519
+ ): Promise<BrowserTargetState>;
1520
+ readBrowserDom(
1521
+ workspaceId: string,
1522
+ browserSessionId: string,
1523
+ targetId: string,
1524
+ request: BrowserDomReadRequest,
1525
+ options?: OpenGeniRequestOptions,
1526
+ ): Promise<BrowserDomReadResponse>;
1527
+ captureBrowserTarget(
1528
+ workspaceId: string,
1529
+ browserSessionId: string,
1530
+ targetId: string,
1531
+ options?: OpenGeniRequestOptions,
1532
+ captureOptions?: BrowserScreenshotOptions,
1533
+ ): Promise<BrowserFrame>;
1478
1534
  actInBrowser(
1479
1535
  workspaceId: string,
1480
1536
  browserSessionId: string,
@@ -1530,13 +1586,18 @@ export interface InteractionTransport {
1530
1586
  ): Promise<BrowserSessionMutationResponse>;
1531
1587
  listComputerSessions(
1532
1588
  workspaceId: string,
1533
- options?: OpenGeniRequestOptions,
1589
+ options?: OpenGeniRequestOptions | InteractionSessionListOptions,
1534
1590
  ): Promise<ComputerSessionListResponse>;
1535
1591
  getComputerSession(
1536
1592
  workspaceId: string,
1537
1593
  computerSessionId: string,
1538
1594
  options?: OpenGeniRequestOptions,
1539
1595
  ): Promise<ComputerSession>;
1596
+ getComputerInputPosture?(
1597
+ workspaceId: string,
1598
+ computerSessionId: string,
1599
+ options?: OpenGeniRequestOptions,
1600
+ ): Promise<ComputerSessionInputPosture>;
1540
1601
  readComputerClipboard(
1541
1602
  workspaceId: string,
1542
1603
  computerSessionId: string,
@@ -1558,12 +1619,30 @@ export interface InteractionTransport {
1558
1619
  targetId: string,
1559
1620
  options?: OpenGeniRequestOptions,
1560
1621
  ): Promise<ComputerObservation>;
1622
+ captureComputerTarget(
1623
+ workspaceId: string,
1624
+ computerSessionId: string,
1625
+ targetId: string,
1626
+ options?: OpenGeniRequestOptions,
1627
+ ): Promise<ComputerFrame>;
1628
+ callNativeComputerTool?(
1629
+ workspaceId: string,
1630
+ computerSessionId: string,
1631
+ request: ComputerNativeCallRequest,
1632
+ options?: OpenGeniRequestOptions,
1633
+ ): Promise<ComputerNativeReceipt>;
1561
1634
  actInComputer(
1562
1635
  workspaceId: string,
1563
1636
  computerSessionId: string,
1564
1637
  request: ComputerActionRequest,
1565
1638
  options?: OpenGeniRequestOptions,
1566
1639
  ): Promise<ComputerActionReceipt>;
1640
+ getNativeComputerToolReceipt?(
1641
+ workspaceId: string,
1642
+ computerSessionId: string,
1643
+ operationId: string,
1644
+ options?: OpenGeniRequestOptions,
1645
+ ): Promise<ComputerNativeReceipt>;
1567
1646
  getComputerActionReceipt(
1568
1647
  workspaceId: string,
1569
1648
  computerSessionId: string,
@@ -1632,6 +1711,7 @@ export type CurrentOrOpenBrowserOptions = {
1632
1711
  name?: string | undefined;
1633
1712
  initialUrl?: string | undefined;
1634
1713
  headless?: boolean | undefined;
1714
+ storageMode?: "private_profile" | "ephemeral_context" | undefined;
1635
1715
  placement?: InteractionPlacement | undefined;
1636
1716
  identityId?: string | undefined;
1637
1717
  baseRevisionId?: string | undefined;
@@ -1846,19 +1926,6 @@ export class AuthRunResource {
1846
1926
  );
1847
1927
  }
1848
1928
 
1849
- async protectedFill(
1850
- request: ProtectedAuthFillRequest,
1851
- options: OpenGeniRequestOptions = {},
1852
- ): Promise<ProtectedAuthFillResponse> {
1853
- return await this.transport.protectedBrowserAuthFill(
1854
- this.workspaceId,
1855
- this.browserSessionId,
1856
- this.id,
1857
- request,
1858
- options,
1859
- );
1860
- }
1861
-
1862
1929
  async advanceExternal(
1863
1930
  request: ExternalAuthRunRequest,
1864
1931
  options: OpenGeniRequestOptions = {},
@@ -2031,7 +2098,7 @@ export class BrowserSessionCollection {
2031
2098
 
2032
2099
  async list(
2033
2100
  workspaceId: string,
2034
- options: OpenGeniRequestOptions = {},
2101
+ options: OpenGeniRequestOptions | InteractionSessionListOptions = {},
2035
2102
  ): Promise<BrowserSessionListResponse> {
2036
2103
  return await this.transport.listBrowserSessions(workspaceId, options);
2037
2104
  }
@@ -2052,7 +2119,13 @@ export class BrowserSessionCollection {
2052
2119
  async currentOrOpen(options: CurrentOrOpenBrowserOptions): Promise<BrowserSessionResource> {
2053
2120
  const requestOptions = options.signal ? { signal: options.signal } : {};
2054
2121
  const listed = await this.list(options.workspaceId, requestOptions);
2055
- const current = newestRelevantBrowser(listed.sessions, options.associationSessionId);
2122
+ const current = newestRelevantBrowser(
2123
+ listed.sessions.filter(
2124
+ (session) =>
2125
+ browserSessionStorageMode(session) === (options.storageMode ?? "private_profile"),
2126
+ ),
2127
+ options.associationSessionId,
2128
+ );
2056
2129
  if (current) {
2057
2130
  const resource = this.session(options.workspaceId, current.id);
2058
2131
  if (current.lifecycle === "suspended") {
@@ -2071,6 +2144,7 @@ export class BrowserSessionCollection {
2071
2144
  ...(options.name !== undefined ? { name: options.name } : {}),
2072
2145
  ...(options.initialUrl !== undefined ? { initialUrl: options.initialUrl } : {}),
2073
2146
  ...(options.headless !== undefined ? { headless: options.headless } : {}),
2147
+ ...(options.storageMode !== undefined ? { storageMode: options.storageMode } : {}),
2074
2148
  ...(options.placement !== undefined ? { placement: options.placement } : {}),
2075
2149
  ...(options.identityId !== undefined ? { identityId: options.identityId } : {}),
2076
2150
  ...(options.baseRevisionId !== undefined ? { baseRevisionId: options.baseRevisionId } : {}),
@@ -2115,6 +2189,49 @@ export class BrowserSessionResource {
2115
2189
  return await this.transport.observeBrowserTarget(this.workspaceId, this.id, targetId, options);
2116
2190
  }
2117
2191
 
2192
+ async targetState(
2193
+ targetId: string,
2194
+ options: OpenGeniRequestOptions = {},
2195
+ ): Promise<BrowserTargetState> {
2196
+ return await this.transport.getBrowserTargetState(this.workspaceId, this.id, targetId, options);
2197
+ }
2198
+
2199
+ async readDom(
2200
+ targetId: string,
2201
+ request: BrowserDomReadRequest,
2202
+ options: OpenGeniRequestOptions = {},
2203
+ ): Promise<BrowserDomReadResponse> {
2204
+ return await this.transport.readBrowserDom(
2205
+ this.workspaceId,
2206
+ this.id,
2207
+ targetId,
2208
+ request,
2209
+ options,
2210
+ );
2211
+ }
2212
+
2213
+ async capture(
2214
+ targetId: string,
2215
+ options: OpenGeniRequestOptions = {},
2216
+ captureOptions: BrowserScreenshotOptions = {},
2217
+ ): Promise<BrowserFrame> {
2218
+ return await this.transport.captureBrowserTarget(
2219
+ this.workspaceId,
2220
+ this.id,
2221
+ targetId,
2222
+ options,
2223
+ captureOptions,
2224
+ );
2225
+ }
2226
+
2227
+ async screenshot(
2228
+ targetId: string,
2229
+ captureOptions: BrowserScreenshotOptions = {},
2230
+ options: OpenGeniRequestOptions = {},
2231
+ ): Promise<BrowserFrame> {
2232
+ return await this.capture(targetId, options, captureOptions);
2233
+ }
2234
+
2118
2235
  async act(
2119
2236
  request: BrowserActionRequest,
2120
2237
  options: OpenGeniRequestOptions = {},
@@ -2337,7 +2454,7 @@ export class ComputerSessionCollection {
2337
2454
 
2338
2455
  async list(
2339
2456
  workspaceId: string,
2340
- options: OpenGeniRequestOptions = {},
2457
+ options: OpenGeniRequestOptions | InteractionSessionListOptions = {},
2341
2458
  ): Promise<ComputerSessionListResponse> {
2342
2459
  return await this.transport.listComputerSessions(workspaceId, options);
2343
2460
  }
@@ -2402,6 +2519,19 @@ export class ComputerSessionResource {
2402
2519
  return await this.transport.observeComputerTarget(this.workspaceId, this.id, targetId, options);
2403
2520
  }
2404
2521
 
2522
+ async capture(targetId: string, options: OpenGeniRequestOptions = {}): Promise<ComputerFrame> {
2523
+ return await this.transport.captureComputerTarget(this.workspaceId, this.id, targetId, options);
2524
+ }
2525
+
2526
+ async callNativeTool(
2527
+ request: ComputerNativeCallRequest,
2528
+ options: OpenGeniRequestOptions = {},
2529
+ ): Promise<ComputerNativeReceipt> {
2530
+ if (!this.transport.callNativeComputerTool)
2531
+ throw new Error("Native CUA tools require a current interaction transport");
2532
+ return await this.transport.callNativeComputerTool(this.workspaceId, this.id, request, options);
2533
+ }
2534
+
2405
2535
  async act(
2406
2536
  request: ComputerActionRequest,
2407
2537
  options: OpenGeniRequestOptions = {},
@@ -2409,6 +2539,20 @@ export class ComputerSessionResource {
2409
2539
  return await this.transport.actInComputer(this.workspaceId, this.id, request, options);
2410
2540
  }
2411
2541
 
2542
+ async nativeReceipt(
2543
+ operationId: string,
2544
+ options: OpenGeniRequestOptions = {},
2545
+ ): Promise<ComputerNativeReceipt> {
2546
+ if (!this.transport.getNativeComputerToolReceipt)
2547
+ throw new Error("Native CUA receipts require a current interaction transport");
2548
+ return await this.transport.getNativeComputerToolReceipt(
2549
+ this.workspaceId,
2550
+ this.id,
2551
+ operationId,
2552
+ options,
2553
+ );
2554
+ }
2555
+
2412
2556
  async receipt(
2413
2557
  operationId: string,
2414
2558
  options: OpenGeniRequestOptions = {},
@@ -2428,6 +2572,13 @@ export class ComputerSessionResource {
2428
2572
  return await this.transport.attachComputerSession(this.workspaceId, this.id, request, options);
2429
2573
  }
2430
2574
 
2575
+ async inputPosture(options: OpenGeniRequestOptions = {}): Promise<ComputerSessionInputPosture> {
2576
+ if (!this.transport.getComputerInputPosture) {
2577
+ throw new Error("Computer input posture requires a current interaction transport.");
2578
+ }
2579
+ return await this.transport.getComputerInputPosture(this.workspaceId, this.id, options);
2580
+ }
2581
+
2431
2582
  async heartbeat(options: OpenGeniRequestOptions = {}): Promise<ComputerSessionHeartbeatResponse> {
2432
2583
  return await this.transport.heartbeatComputerSession(this.workspaceId, this.id, options);
2433
2584
  }
@@ -2495,6 +2646,14 @@ export type BrowserFrameMetadata = {
2495
2646
 
2496
2647
  export type BrowserFrame = BrowserFrameMetadata & { data: Uint8Array };
2497
2648
 
2649
+ export type BrowserScreenshotOptions = {
2650
+ /** Capture the document content instead of the visible viewport. */
2651
+ fullPage?: boolean;
2652
+ format?: "jpeg" | "png";
2653
+ /** JPEG quality, from 1 to 100. Ignored for PNG. */
2654
+ quality?: number;
2655
+ };
2656
+
2498
2657
  export type ComputerFrameMetadata = {
2499
2658
  frameId: string;
2500
2659
  computerSessionId: string;
@@ -2791,6 +2950,28 @@ export function parseComputerFrameMetadata(value: unknown): ComputerFrameMetadat
2791
2950
  return metadata;
2792
2951
  }
2793
2952
 
2953
+ export function decodeComputerFrameMetadataHeader(value: string): ComputerFrameMetadata {
2954
+ if (!value || value.length > 32 * 1024 || !/^[A-Za-z0-9_-]+$/u.test(value)) {
2955
+ throw new Error("computer frame metadata header is invalid");
2956
+ }
2957
+ const normalized = value.replace(/-/gu, "+").replace(/_/gu, "/");
2958
+ const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
2959
+ let decoded: string;
2960
+ try {
2961
+ decoded = atob(padded);
2962
+ } catch {
2963
+ throw new Error("computer frame metadata header is invalid");
2964
+ }
2965
+ const bytes = Uint8Array.from(decoded, (character) => character.charCodeAt(0));
2966
+ let metadata: unknown;
2967
+ try {
2968
+ metadata = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
2969
+ } catch {
2970
+ throw new Error("computer frame metadata header is invalid");
2971
+ }
2972
+ return parseComputerFrameMetadata(metadata);
2973
+ }
2974
+
2794
2975
  function newestRelevantBrowser(
2795
2976
  sessions: readonly BrowserSession[],
2796
2977
  associationSessionId: string,