@opengeni/sdk 0.52.1 → 1.0.1

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 (56) hide show
  1. package/README.md +67 -7
  2. package/dist/artifacts.js +5 -5
  3. package/dist/{chunk-FRJFNDIR.js → chunk-4DV37UUA.js} +6 -2
  4. package/dist/chunk-4DV37UUA.js.map +1 -0
  5. package/dist/{chunk-KIHGPM7H.js → chunk-A5DC5WEM.js} +288 -45
  6. package/dist/chunk-A5DC5WEM.js.map +1 -0
  7. package/dist/{chunk-V5F253OG.js → chunk-GU6JF75T.js} +6 -3
  8. package/dist/chunk-GU6JF75T.js.map +1 -0
  9. package/dist/{chunk-MZWTWOX6.js → chunk-ST5DDKJP.js} +327 -1
  10. package/dist/chunk-ST5DDKJP.js.map +1 -0
  11. package/dist/{chunk-FHI4DFIG.js → chunk-TYZ4JL4J.js} +2 -2
  12. package/dist/{chunk-ILQZR5N6.js → chunk-YGH5P47G.js} +693 -34
  13. package/dist/chunk-YGH5P47G.js.map +1 -0
  14. package/dist/{chunk-DXDL7EEW.js → chunk-YKZME56C.js} +197 -113
  15. package/dist/chunk-YKZME56C.js.map +1 -0
  16. package/dist/client.d.ts +108 -18
  17. package/dist/codex-realtime-controller.d.ts +5 -0
  18. package/dist/codex-realtime-controller.js +2 -2
  19. package/dist/codex-realtime-v3.d.ts +13 -2
  20. package/dist/core.js +7 -7
  21. package/dist/desktop.d.ts +8 -0
  22. package/dist/editable-artifacts.js +4 -4
  23. package/dist/gateway-realtime-transport.d.ts +1 -0
  24. package/dist/gateway-realtime-transport.js +5 -3
  25. package/dist/index.d.ts +6 -2
  26. package/dist/index.js +68 -34
  27. package/dist/index.js.map +1 -1
  28. package/dist/interaction-revision-stream.d.ts +11 -0
  29. package/dist/interaction.d.ts +604 -5
  30. package/dist/interaction.js +27 -1
  31. package/dist/realtime.d.ts +3 -3
  32. package/dist/realtime.js +11 -7
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/types.d.ts +283 -69
  35. package/dist/workspace-live-stream.d.ts +14 -0
  36. package/package.json +2 -2
  37. package/src/client.ts +863 -62
  38. package/src/codex-realtime-controller.ts +239 -12
  39. package/src/codex-realtime-lifecycle.ts +1 -0
  40. package/src/codex-realtime-v3.ts +162 -31
  41. package/src/desktop.ts +11 -1
  42. package/src/errors.ts +16 -2
  43. package/src/gateway-realtime-transport.ts +252 -109
  44. package/src/index.ts +42 -13
  45. package/src/interaction-revision-stream.ts +117 -0
  46. package/src/interaction.ts +1049 -5
  47. package/src/realtime.ts +14 -4
  48. package/src/types.ts +353 -72
  49. package/src/workspace-live-stream.ts +137 -0
  50. package/dist/chunk-DXDL7EEW.js.map +0 -1
  51. package/dist/chunk-FRJFNDIR.js.map +0 -1
  52. package/dist/chunk-ILQZR5N6.js.map +0 -1
  53. package/dist/chunk-KIHGPM7H.js.map +0 -1
  54. package/dist/chunk-MZWTWOX6.js.map +0 -1
  55. package/dist/chunk-V5F253OG.js.map +0 -1
  56. /package/dist/{chunk-FHI4DFIG.js.map → chunk-TYZ4JL4J.js.map} +0 -0
@@ -1,3 +1,11 @@
1
+ import {
2
+ COMPUTER_SCREENSHOT_MAX_BYTES,
3
+ GENERATED_VIDEO_MAX_BYTES,
4
+ OPENGENI_API_CONTRACT_HEADER,
5
+ OPENGENI_API_CONTRACT_REVISION,
6
+ OPENGENI_CORRELATION_HEADER,
7
+ RETAINED_OUTPUT_MAX_PAGE_BYTES
8
+ } from "./chunk-4DV37UUA.js";
1
9
  import {
2
10
  OpenGeniApiContractMismatchError,
3
11
  OpenGeniApiError,
@@ -5,18 +13,10 @@ import {
5
13
  OpenGeniStreamError,
6
14
  isAbortError,
7
15
  isRetryableStreamError
8
- } from "./chunk-V5F253OG.js";
16
+ } from "./chunk-GU6JF75T.js";
9
17
  import {
10
18
  OpenGeniInteractionClient
11
- } from "./chunk-MZWTWOX6.js";
12
- import {
13
- COMPUTER_SCREENSHOT_MAX_BYTES,
14
- GENERATED_VIDEO_MAX_BYTES,
15
- OPENGENI_API_CONTRACT_HEADER,
16
- OPENGENI_API_CONTRACT_REVISION,
17
- OPENGENI_CORRELATION_HEADER,
18
- RETAINED_OUTPUT_MAX_PAGE_BYTES
19
- } from "./chunk-FRJFNDIR.js";
19
+ } from "./chunk-ST5DDKJP.js";
20
20
 
21
21
  // src/sse.ts
22
22
  async function* parseSseStream(stream) {
@@ -353,6 +353,177 @@ async function sleep2(delayMs, signal) {
353
353
  });
354
354
  }
355
355
 
356
+ // src/interaction-revision-stream.ts
357
+ async function* streamWorkspaceInteractionRevisions(transport, options = {}) {
358
+ const signal = options.signal;
359
+ const reconnect = options.reconnect ?? true;
360
+ const baseDelayMs = options.reconnectDelayMs ?? 500;
361
+ const maxDelayMs = options.maxReconnectDelayMs ?? 1e4;
362
+ const jitterRatio = options.reconnectJitterRatio ?? 0.2;
363
+ const beforeLiveTimeoutMs = options.beforeLiveTimeoutMs ?? 15e3;
364
+ const heartbeatTimeoutMs = options.heartbeatTimeoutMs ?? 45e3;
365
+ const maxAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
366
+ let cursor = options.after ?? 0;
367
+ let failures = 0;
368
+ let delayMs = baseDelayMs;
369
+ let everConnected = false;
370
+ for (; ; ) {
371
+ if (signal?.aborted) return;
372
+ options.onStateChange?.(everConnected || failures > 0 ? "reconnecting" : "connecting");
373
+ const cursorAtOpen = cursor;
374
+ try {
375
+ const body = await transport.openStream(cursor, signal);
376
+ everConnected = true;
377
+ failures = 0;
378
+ delayMs = baseDelayMs;
379
+ await runBeforeLive(options.beforeLive, beforeLiveTimeoutMs, signal);
380
+ options.onStateChange?.("live");
381
+ for await (const message of parseSseStream(
382
+ withStreamInactivityTimeout(body, heartbeatTimeoutMs, signal)
383
+ )) {
384
+ if (signal?.aborted) return;
385
+ const event = parseWorkspaceInteractionRevision(message.data);
386
+ if (!event || event.sequence <= cursor) continue;
387
+ cursor = event.sequence;
388
+ yield event;
389
+ }
390
+ if (!reconnect) return;
391
+ if (cursor === cursorAtOpen) await sleep3(jitteredDelay(baseDelayMs, jitterRatio), signal);
392
+ continue;
393
+ } catch (error) {
394
+ if (signal?.aborted || isAbortError(error)) return;
395
+ if (!reconnect || !isRetryableStreamError(error)) throw error;
396
+ failures += 1;
397
+ if (failures > maxAttempts) {
398
+ throw new OpenGeniStreamError(
399
+ `workspace interaction stream gave up after ${maxAttempts} reconnect attempts: ${error instanceof Error ? error.message : String(error)}`
400
+ );
401
+ }
402
+ }
403
+ await sleep3(jitteredDelay(delayMs, jitterRatio), signal);
404
+ delayMs = Math.min(Math.max(delayMs * 2, baseDelayMs), maxDelayMs);
405
+ }
406
+ }
407
+ function parseWorkspaceInteractionRevision(data) {
408
+ let value;
409
+ try {
410
+ value = JSON.parse(data);
411
+ } catch {
412
+ return null;
413
+ }
414
+ if (!isRecord(value) || value.type !== "workspace.interaction.changed" || typeof value.workspaceId !== "string" || typeof value.sequence !== "number" || !Number.isSafeInteger(value.sequence) || value.sequence < 0 || value.revision !== value.sequence || typeof value.occurredAt !== "string") {
415
+ return null;
416
+ }
417
+ return value;
418
+ }
419
+ function isRecord(value) {
420
+ return typeof value === "object" && value !== null && !Array.isArray(value);
421
+ }
422
+ async function sleep3(delayMs, signal) {
423
+ if (signal?.aborted || delayMs <= 0) return;
424
+ await new Promise((resolve) => {
425
+ const timer = setTimeout(done, delayMs);
426
+ function done() {
427
+ clearTimeout(timer);
428
+ signal?.removeEventListener("abort", done);
429
+ resolve();
430
+ }
431
+ signal?.addEventListener("abort", done, { once: true });
432
+ });
433
+ }
434
+
435
+ // src/workspace-live-stream.ts
436
+ async function* streamWorkspaceLiveEvents(transport, options = {}) {
437
+ const signal = options.signal;
438
+ const reconnect = options.reconnect ?? true;
439
+ const baseDelayMs = options.reconnectDelayMs ?? 500;
440
+ const maxDelayMs = options.maxReconnectDelayMs ?? 1e4;
441
+ const jitterRatio = options.reconnectJitterRatio ?? 0.2;
442
+ const beforeLiveTimeoutMs = options.beforeLiveTimeoutMs ?? 15e3;
443
+ const heartbeatTimeoutMs = options.heartbeatTimeoutMs ?? 45e3;
444
+ const maxAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
445
+ let controlCursor = options.controlAfter ?? 0;
446
+ let interactionCursor = options.interactionAfter ?? 0;
447
+ let failures = 0;
448
+ let delayMs = baseDelayMs;
449
+ let everConnected = false;
450
+ for (; ; ) {
451
+ if (signal?.aborted) return;
452
+ options.onStateChange?.(everConnected || failures > 0 ? "reconnecting" : "connecting");
453
+ const cursorsAtOpen = `${controlCursor}:${interactionCursor}`;
454
+ try {
455
+ const body = await transport.openStream(controlCursor, interactionCursor, signal);
456
+ everConnected = true;
457
+ failures = 0;
458
+ delayMs = baseDelayMs;
459
+ await runBeforeLive(options.beforeLive, beforeLiveTimeoutMs, signal);
460
+ options.onStateChange?.("live");
461
+ for await (const message of parseSseStream(
462
+ withStreamInactivityTimeout(body, heartbeatTimeoutMs, signal)
463
+ )) {
464
+ if (signal?.aborted) return;
465
+ const event = parseWorkspaceLiveEvent(message.data);
466
+ if (!event) continue;
467
+ if (event.type === "workspace.control.changed") {
468
+ if (event.sequence <= controlCursor) continue;
469
+ controlCursor = event.sequence;
470
+ } else {
471
+ if (event.sequence <= interactionCursor) continue;
472
+ interactionCursor = event.sequence;
473
+ }
474
+ yield event;
475
+ }
476
+ if (!reconnect) return;
477
+ if (`${controlCursor}:${interactionCursor}` === cursorsAtOpen) {
478
+ await sleep4(jitteredDelay(baseDelayMs, jitterRatio), signal);
479
+ }
480
+ continue;
481
+ } catch (error) {
482
+ if (signal?.aborted || isAbortError(error)) return;
483
+ if (!reconnect || !isRetryableStreamError(error)) throw error;
484
+ failures += 1;
485
+ if (failures > maxAttempts) {
486
+ throw new OpenGeniStreamError(
487
+ `workspace live stream gave up after ${maxAttempts} reconnect attempts: ${error instanceof Error ? error.message : String(error)}`
488
+ );
489
+ }
490
+ }
491
+ await sleep4(jitteredDelay(delayMs, jitterRatio), signal);
492
+ delayMs = Math.min(Math.max(delayMs * 2, baseDelayMs), maxDelayMs);
493
+ }
494
+ }
495
+ function parseWorkspaceLiveEvent(data) {
496
+ let value;
497
+ try {
498
+ value = JSON.parse(data);
499
+ } catch {
500
+ return null;
501
+ }
502
+ if (!isRecord2(value) || typeof value.sequence !== "number") return null;
503
+ if (value.type === "workspace.control.changed" && typeof value.id === "string" && Number.isSafeInteger(value.sequence)) {
504
+ return value;
505
+ }
506
+ if (value.type === "workspace.interaction.changed" && typeof value.workspaceId === "string" && Number.isSafeInteger(value.sequence) && value.sequence >= 0 && value.revision === value.sequence && typeof value.occurredAt === "string") {
507
+ return value;
508
+ }
509
+ return null;
510
+ }
511
+ function isRecord2(value) {
512
+ return typeof value === "object" && value !== null && !Array.isArray(value);
513
+ }
514
+ async function sleep4(delayMs, signal) {
515
+ if (signal?.aborted || delayMs <= 0) return;
516
+ await new Promise((resolve) => {
517
+ const timer = setTimeout(done, delayMs);
518
+ function done() {
519
+ clearTimeout(timer);
520
+ signal?.removeEventListener("abort", done);
521
+ resolve();
522
+ }
523
+ signal?.addEventListener("abort", done, { once: true });
524
+ });
525
+ }
526
+
356
527
  // src/retained-artifacts.ts
357
528
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
358
529
  var SHA256 = /^[0-9a-f]{64}$/;
@@ -900,6 +1071,16 @@ var OpenGeniClient = class {
900
1071
  { signal: options.signal }
901
1072
  );
902
1073
  }
1074
+ /** Mint a short-lived browser token from a connected SuperGrok account. */
1075
+ async negotiateXaiSubscriptionRealtime(workspaceId, sessionId, request, options = {}) {
1076
+ return await this.requestJson(
1077
+ "POST",
1078
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/realtime/supergrok`,
1079
+ request,
1080
+ {},
1081
+ { signal: options.signal }
1082
+ );
1083
+ }
903
1084
  /** Promote a negotiated connection only after its browser data channel is ready. */
904
1085
  async activateCodexRealtimeConnection(workspaceId, sessionId, realtimeId, connectionId, request, options = {}) {
905
1086
  return await this.requestJson(
@@ -1409,6 +1590,50 @@ var OpenGeniClient = class {
1409
1590
  streamWorkspaceControlEvents(workspaceId, options = {}) {
1410
1591
  return streamWorkspaceControlEvents(this.workspaceControlStreamTransport(workspaceId), options);
1411
1592
  }
1593
+ /**
1594
+ * Multiplex workspace control and interaction invalidations over one HTTP
1595
+ * connection while retaining an independent durable cursor for each domain.
1596
+ */
1597
+ streamWorkspaceLiveEvents(workspaceId, options = {}) {
1598
+ return streamWorkspaceLiveEvents(this.workspaceLiveStreamTransport(workspaceId), options);
1599
+ }
1600
+ workspaceLiveStreamTransport(workspaceId) {
1601
+ return {
1602
+ openStream: async (controlAfter, interactionAfter, signal) => await this.openWorkspaceLiveEventStream(workspaceId, {
1603
+ controlAfter,
1604
+ interactionAfter,
1605
+ ...signal ? { signal } : {}
1606
+ })
1607
+ };
1608
+ }
1609
+ async openWorkspaceLiveEventStream(workspaceId, options = {}) {
1610
+ const correlationId = crypto.randomUUID();
1611
+ const response = await this.fetchImpl(
1612
+ this.url(`/v1/workspaces/${workspaceId}/live-events/stream`, {
1613
+ controlAfter: String(options.controlAfter ?? 0),
1614
+ interactionAfter: String(options.interactionAfter ?? 0)
1615
+ }),
1616
+ {
1617
+ method: "GET",
1618
+ headers: {
1619
+ ...this.headers(correlationId),
1620
+ Accept: "text/event-stream"
1621
+ },
1622
+ ...options.signal ? { signal: options.signal } : {}
1623
+ }
1624
+ );
1625
+ assertApiContractResponse(response);
1626
+ if (!response.ok) {
1627
+ throw await apiErrorFromResponse(response, {
1628
+ method: "GET",
1629
+ correlationId
1630
+ });
1631
+ }
1632
+ if (!response.body) {
1633
+ throw new OpenGeniApiError(response.status, "SSE response did not include a readable body");
1634
+ }
1635
+ return response.body;
1636
+ }
1412
1637
  workspaceControlStreamTransport(workspaceId) {
1413
1638
  return {
1414
1639
  openStream: async (after, signal) => await this.openWorkspaceControlEventStream(workspaceId, {
@@ -1469,6 +1694,19 @@ var OpenGeniClient = class {
1469
1694
  request
1470
1695
  );
1471
1696
  }
1697
+ async listGoalRevisions(workspaceId, sessionId) {
1698
+ return await this.requestJson(
1699
+ "GET",
1700
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal/revisions`
1701
+ );
1702
+ }
1703
+ async applyGoalRevision(workspaceId, sessionId, revisionId, request) {
1704
+ return await this.requestJson(
1705
+ "POST",
1706
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal/revisions/${revisionId}/apply`,
1707
+ request
1708
+ );
1709
+ }
1472
1710
  async deleteGoal(workspaceId, sessionId) {
1473
1711
  await this.requestVoid("DELETE", `/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal`);
1474
1712
  }
@@ -1747,6 +1985,235 @@ var OpenGeniClient = class {
1747
1985
  );
1748
1986
  }
1749
1987
  // --- Browser / Computer interaction resources --------------------------------
1988
+ streamWorkspaceInteractionRevisions(workspaceId, options = {}) {
1989
+ return streamWorkspaceInteractionRevisions(
1990
+ this.workspaceInteractionRevisionStreamTransport(workspaceId),
1991
+ options
1992
+ );
1993
+ }
1994
+ workspaceInteractionRevisionStreamTransport(workspaceId) {
1995
+ return {
1996
+ openStream: async (after, signal) => await this.openWorkspaceInteractionRevisionStream(workspaceId, {
1997
+ after,
1998
+ ...signal ? { signal } : {}
1999
+ })
2000
+ };
2001
+ }
2002
+ async openWorkspaceInteractionRevisionStream(workspaceId, options = {}) {
2003
+ const correlationId = crypto.randomUUID();
2004
+ const response = await this.fetchImpl(
2005
+ this.url(`/v1/workspaces/${workspaceId}/interaction-events/stream`, {
2006
+ after: String(options.after ?? 0)
2007
+ }),
2008
+ {
2009
+ method: "GET",
2010
+ headers: {
2011
+ ...this.headers(correlationId),
2012
+ Accept: "text/event-stream"
2013
+ },
2014
+ ...options.signal ? { signal: options.signal } : {}
2015
+ }
2016
+ );
2017
+ assertApiContractResponse(response);
2018
+ if (!response.ok) {
2019
+ throw await apiErrorFromResponse(response, {
2020
+ method: "GET",
2021
+ correlationId
2022
+ });
2023
+ }
2024
+ if (!response.body) {
2025
+ throw new OpenGeniApiError(response.status, "SSE response did not include a readable body");
2026
+ }
2027
+ return response.body;
2028
+ }
2029
+ async listNetworkRoutes(workspaceId, options = {}) {
2030
+ return await this.requestJson(
2031
+ "GET",
2032
+ `/v1/workspaces/${workspaceId}/network-routes`,
2033
+ void 0,
2034
+ options.includeArchived ? { includeArchived: "true" } : {},
2035
+ options
2036
+ );
2037
+ }
2038
+ async getNetworkRoute(workspaceId, networkRouteId, options = {}) {
2039
+ return await this.requestJson(
2040
+ "GET",
2041
+ `/v1/workspaces/${workspaceId}/network-routes/${encodeURIComponent(networkRouteId)}`,
2042
+ void 0,
2043
+ {},
2044
+ options
2045
+ );
2046
+ }
2047
+ async createNetworkRoute(workspaceId, request, options = {}) {
2048
+ return await this.requestJson(
2049
+ "POST",
2050
+ `/v1/workspaces/${workspaceId}/network-routes`,
2051
+ request,
2052
+ {},
2053
+ options
2054
+ );
2055
+ }
2056
+ async updateNetworkRoute(workspaceId, networkRouteId, request, options = {}) {
2057
+ return await this.requestJson(
2058
+ "PATCH",
2059
+ `/v1/workspaces/${workspaceId}/network-routes/${encodeURIComponent(networkRouteId)}`,
2060
+ request,
2061
+ {},
2062
+ options
2063
+ );
2064
+ }
2065
+ async listSiteAuthConnections(workspaceId, options = {}) {
2066
+ return await this.requestJson(
2067
+ "GET",
2068
+ `/v1/workspaces/${workspaceId}/site-auth-connections`,
2069
+ void 0,
2070
+ options.includeArchived ? { includeArchived: "true" } : {},
2071
+ options
2072
+ );
2073
+ }
2074
+ async getSiteAuthConnection(workspaceId, siteAuthConnectionId, options = {}) {
2075
+ return await this.requestJson(
2076
+ "GET",
2077
+ `/v1/workspaces/${workspaceId}/site-auth-connections/${encodeURIComponent(siteAuthConnectionId)}`,
2078
+ void 0,
2079
+ {},
2080
+ options
2081
+ );
2082
+ }
2083
+ async createSiteAuthConnection(workspaceId, request, options = {}) {
2084
+ return await this.requestJson(
2085
+ "POST",
2086
+ `/v1/workspaces/${workspaceId}/site-auth-connections`,
2087
+ request,
2088
+ {},
2089
+ options
2090
+ );
2091
+ }
2092
+ async updateSiteAuthConnection(workspaceId, siteAuthConnectionId, request, options = {}) {
2093
+ return await this.requestJson(
2094
+ "PATCH",
2095
+ `/v1/workspaces/${workspaceId}/site-auth-connections/${encodeURIComponent(siteAuthConnectionId)}`,
2096
+ request,
2097
+ {},
2098
+ options
2099
+ );
2100
+ }
2101
+ async listAuthRuns(workspaceId, options = {}) {
2102
+ return await this.requestJson(
2103
+ "GET",
2104
+ `/v1/workspaces/${workspaceId}/auth-runs`,
2105
+ void 0,
2106
+ {
2107
+ ...options.browserSessionId ? { browserSessionId: options.browserSessionId } : {},
2108
+ ...options.siteAuthConnectionId ? { siteAuthConnectionId: options.siteAuthConnectionId } : {},
2109
+ ...options.includeSettled ? { includeSettled: "true" } : {}
2110
+ },
2111
+ options
2112
+ );
2113
+ }
2114
+ async getAuthRun(workspaceId, authRunId, options = {}) {
2115
+ return await this.requestJson(
2116
+ "GET",
2117
+ `/v1/workspaces/${workspaceId}/auth-runs/${encodeURIComponent(authRunId)}`,
2118
+ void 0,
2119
+ {},
2120
+ options
2121
+ );
2122
+ }
2123
+ async startBrowserAuthRun(workspaceId, browserSessionId, request, options = {}) {
2124
+ return await this.requestJson(
2125
+ "POST",
2126
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs`,
2127
+ request,
2128
+ {},
2129
+ options
2130
+ );
2131
+ }
2132
+ async reportBrowserAuthRun(workspaceId, browserSessionId, authRunId, request, options = {}) {
2133
+ return await this.requestJson(
2134
+ "POST",
2135
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs/${encodeURIComponent(authRunId)}/report`,
2136
+ request,
2137
+ {},
2138
+ options
2139
+ );
2140
+ }
2141
+ async protectedBrowserAuthFill(workspaceId, browserSessionId, authRunId, request, options = {}) {
2142
+ return await this.requestJson(
2143
+ "POST",
2144
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs/${encodeURIComponent(authRunId)}/protected-fill`,
2145
+ request,
2146
+ {},
2147
+ options
2148
+ );
2149
+ }
2150
+ async advanceExternalBrowserAuthRun(workspaceId, browserSessionId, authRunId, request, options = {}) {
2151
+ return await this.requestJson(
2152
+ "POST",
2153
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs/${encodeURIComponent(authRunId)}/external-auth`,
2154
+ request,
2155
+ {},
2156
+ options
2157
+ );
2158
+ }
2159
+ async openExternalBrowserAuthFlow(workspaceId, browserSessionId, authRunId, request, options = {}) {
2160
+ return await this.requestJson(
2161
+ "POST",
2162
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs/${encodeURIComponent(authRunId)}/external-auth/interactive`,
2163
+ request,
2164
+ {},
2165
+ options
2166
+ );
2167
+ }
2168
+ async verifyBrowserAuthRun(workspaceId, browserSessionId, authRunId, request, options = {}) {
2169
+ return await this.requestJson(
2170
+ "POST",
2171
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/auth-runs/${encodeURIComponent(authRunId)}/verify`,
2172
+ request,
2173
+ {},
2174
+ options
2175
+ );
2176
+ }
2177
+ async listInteractionInterventions(workspaceId, options = {}) {
2178
+ return await this.requestJson(
2179
+ "GET",
2180
+ `/v1/workspaces/${workspaceId}/interaction-interventions`,
2181
+ void 0,
2182
+ {
2183
+ ...options.resourceKind ? { resourceKind: options.resourceKind } : {},
2184
+ ...options.resourceId ? { resourceId: options.resourceId } : {},
2185
+ ...options.includeSettled ? { includeSettled: "true" } : {}
2186
+ },
2187
+ options
2188
+ );
2189
+ }
2190
+ async getInteractionIntervention(workspaceId, interventionId, options = {}) {
2191
+ return await this.requestJson(
2192
+ "GET",
2193
+ `/v1/workspaces/${workspaceId}/interaction-interventions/${encodeURIComponent(interventionId)}`,
2194
+ void 0,
2195
+ {},
2196
+ options
2197
+ );
2198
+ }
2199
+ async createInteractionIntervention(workspaceId, request, options = {}) {
2200
+ return await this.requestJson(
2201
+ "POST",
2202
+ `/v1/workspaces/${workspaceId}/interaction-interventions`,
2203
+ request,
2204
+ {},
2205
+ options
2206
+ );
2207
+ }
2208
+ async resolveInteractionIntervention(workspaceId, interventionId, request, options = {}) {
2209
+ return await this.requestJson(
2210
+ "POST",
2211
+ `/v1/workspaces/${workspaceId}/interaction-interventions/${encodeURIComponent(interventionId)}/resolve`,
2212
+ request,
2213
+ {},
2214
+ options
2215
+ );
2216
+ }
1750
2217
  async listAttachedBrowsers(workspaceId, options = {}) {
1751
2218
  return await this.requestJson(
1752
2219
  "GET",
@@ -1792,6 +2259,15 @@ var OpenGeniClient = class {
1792
2259
  options
1793
2260
  );
1794
2261
  }
2262
+ async updateBrowserIdentity(workspaceId, identityId, request, options = {}) {
2263
+ return await this.requestJson(
2264
+ "PATCH",
2265
+ `/v1/workspaces/${workspaceId}/browser-identities/${encodeURIComponent(identityId)}`,
2266
+ request,
2267
+ {},
2268
+ options
2269
+ );
2270
+ }
1795
2271
  async listBrowserRevisions(workspaceId, identityId, options = {}) {
1796
2272
  return await this.requestJson(
1797
2273
  "GET",
@@ -1821,6 +2297,42 @@ var OpenGeniClient = class {
1821
2297
  options
1822
2298
  );
1823
2299
  }
2300
+ async readBrowserClipboard(workspaceId, browserSessionId, options = {}) {
2301
+ return await this.requestJson(
2302
+ "GET",
2303
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/clipboard`,
2304
+ void 0,
2305
+ {},
2306
+ options
2307
+ );
2308
+ }
2309
+ async listBrowserDownloads(workspaceId, browserSessionId, options = {}) {
2310
+ return await this.requestJson(
2311
+ "GET",
2312
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/downloads`,
2313
+ void 0,
2314
+ {},
2315
+ options
2316
+ );
2317
+ }
2318
+ async getBrowserDownload(workspaceId, browserSessionId, downloadId, options = {}) {
2319
+ return await this.requestJson(
2320
+ "GET",
2321
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/downloads/${encodeURIComponent(downloadId)}`,
2322
+ void 0,
2323
+ {},
2324
+ options
2325
+ );
2326
+ }
2327
+ async saveBrowserDownload(workspaceId, browserSessionId, downloadId, request, options = {}) {
2328
+ return await this.requestJson(
2329
+ "POST",
2330
+ `/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/downloads/${encodeURIComponent(downloadId)}/save`,
2331
+ request,
2332
+ {},
2333
+ options
2334
+ );
2335
+ }
1824
2336
  async createBrowserSession(workspaceId, request, options = {}) {
1825
2337
  return await this.requestJson(
1826
2338
  "POST",
@@ -1980,6 +2492,15 @@ var OpenGeniClient = class {
1980
2492
  options
1981
2493
  );
1982
2494
  }
2495
+ async readComputerClipboard(workspaceId, computerSessionId, options = {}) {
2496
+ return await this.requestJson(
2497
+ "GET",
2498
+ `/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/clipboard`,
2499
+ void 0,
2500
+ {},
2501
+ options
2502
+ );
2503
+ }
1983
2504
  async createComputerSession(workspaceId, request, options = {}) {
1984
2505
  return await this.requestJson(
1985
2506
  "POST",
@@ -2088,6 +2609,13 @@ var OpenGeniClient = class {
2088
2609
  async getAccessContext() {
2089
2610
  return await this.requestJson("GET", "/v1/access/me");
2090
2611
  }
2612
+ /** Active organization memberships proven by the current managed-human session. */
2613
+ async listOrganizationMemberships() {
2614
+ return await this.requestJson(
2615
+ "GET",
2616
+ "/v1/organization-memberships"
2617
+ );
2618
+ }
2091
2619
  async listWorkspaces() {
2092
2620
  return await this.requestJson("GET", "/v1/workspaces");
2093
2621
  }
@@ -2527,6 +3055,41 @@ var OpenGeniClient = class {
2527
3055
  `/v1/workspaces/${workspaceId}/variable-sets/${variableSetId}/variables/${encodeURIComponent(name)}`
2528
3056
  );
2529
3057
  }
3058
+ // --- Channels --------------------------------------------------------------
3059
+ // Workspace-shared rail organization for root sessions. sessions:read gates
3060
+ // list; sessions:create gates create / update / delete; sessions:control
3061
+ // gates re-filing a session.
3062
+ async listChannels(workspaceId) {
3063
+ return await this.requestJson("GET", `/v1/workspaces/${workspaceId}/channels`);
3064
+ }
3065
+ async createChannel(workspaceId, request) {
3066
+ return await this.requestJson(
3067
+ "POST",
3068
+ `/v1/workspaces/${workspaceId}/channels`,
3069
+ request
3070
+ );
3071
+ }
3072
+ async updateChannel(workspaceId, channelId, request) {
3073
+ return await this.requestJson(
3074
+ "PATCH",
3075
+ `/v1/workspaces/${workspaceId}/channels/${channelId}`,
3076
+ request
3077
+ );
3078
+ }
3079
+ async deleteChannel(workspaceId, channelId) {
3080
+ await this.requestJson(
3081
+ "DELETE",
3082
+ `/v1/workspaces/${workspaceId}/channels/${channelId}`
3083
+ );
3084
+ }
3085
+ /** Re-file a session into a channel (null = back to the unfiled inbox). */
3086
+ async updateSessionChannel(workspaceId, sessionId, request) {
3087
+ return await this.requestJson(
3088
+ "PUT",
3089
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/channel`,
3090
+ request
3091
+ );
3092
+ }
2530
3093
  // --- Rigs ------------------------------------------------------------------
2531
3094
  // Workspace-scoped, versioned sandbox machine definitions. rigs:use gates read
2532
3095
  // + proposeRigChange; rigs:manage gates create / update / delete / activate.
@@ -3202,11 +3765,11 @@ var OpenGeniClient = class {
3202
3765
  `/v1/workspaces/${workspaceId}/integrations`
3203
3766
  );
3204
3767
  }
3205
- /** List curated provider presets without exposing deployment OAuth credentials. */
3206
- async listApiIntegrationPresets(workspaceId) {
3768
+ /** List curated provider definitions without exposing deployment OAuth credentials. */
3769
+ async listIntegrationDefinitions(workspaceId) {
3207
3770
  return await this.requestJson(
3208
3771
  "GET",
3209
- `/v1/workspaces/${workspaceId}/integrations/presets`
3772
+ `/v1/workspaces/${workspaceId}/integrations/definitions`
3210
3773
  );
3211
3774
  }
3212
3775
  /** Detect and compile an Integration without mutating workspace state. */
@@ -3217,7 +3780,7 @@ var OpenGeniClient = class {
3217
3780
  request
3218
3781
  );
3219
3782
  }
3220
- /** Start a signed PKCE OAuth flow for a built-in Google or Microsoft preset. */
3783
+ /** Start a signed PKCE OAuth flow for a built-in Google or Microsoft definition. */
3221
3784
  async startApiIntegrationOAuth(workspaceId, request) {
3222
3785
  return await this.requestJson(
3223
3786
  "POST",
@@ -3248,70 +3811,70 @@ var OpenGeniClient = class {
3248
3811
  );
3249
3812
  }
3250
3813
  /** List immutable provider facets and their exact per-account bindings. */
3251
- async listIntegrationFeatures(workspaceId, capabilityId, instanceKey) {
3814
+ async listIntegrationFacets(workspaceId, capabilityId, instanceKey) {
3252
3815
  return await this.requestJson(
3253
3816
  "GET",
3254
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features`
3817
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets`
3255
3818
  );
3256
3819
  }
3257
- /** Configure or OCC-update one adapter-owned feature on an Integration instance. */
3258
- async configureIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
3820
+ /** Configure or OCC-update one adapter-owned facet on an Integration instance. */
3821
+ async configureIntegrationFacet(workspaceId, capabilityId, instanceKey, facetKey, request) {
3259
3822
  return await this.requestJson(
3260
3823
  "PUT",
3261
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}`,
3824
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets/${encodeURIComponent(facetKey)}`,
3262
3825
  request
3263
3826
  );
3264
3827
  }
3265
3828
  /** Browse source metadata through one exact Google Drive Integration instance. */
3266
- async browseGoogleDriveIntegrationSource(workspaceId, capabilityId, instanceKey, featureKey, options = {}) {
3829
+ async browseGoogleDriveFacetSource(workspaceId, capabilityId, instanceKey, facetKey, options = {}) {
3267
3830
  const query = new URLSearchParams();
3268
3831
  if (options.parentId) query.set("parentId", options.parentId);
3269
3832
  if (options.pageToken) query.set("pageToken", options.pageToken);
3270
3833
  const suffix = query.size > 0 ? `?${query}` : "";
3271
3834
  return await this.requestJson(
3272
3835
  "GET",
3273
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/browse${suffix}`
3836
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets/${encodeURIComponent(facetKey)}/browse${suffix}`
3274
3837
  );
3275
3838
  }
3276
3839
  /** Verify and bind document sources to one exact Google Drive Integration instance. */
3277
- async saveGoogleDriveIntegrationSource(workspaceId, capabilityId, instanceKey, featureKey, request) {
3840
+ async saveGoogleDriveFacetSource(workspaceId, capabilityId, instanceKey, facetKey, request) {
3278
3841
  return await this.requestJson(
3279
3842
  "PUT",
3280
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/source`,
3843
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets/${encodeURIComponent(facetKey)}/source`,
3281
3844
  request
3282
3845
  );
3283
3846
  }
3284
- async pauseIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
3285
- return await this.mutateIntegrationFeatureLifecycle(
3847
+ async pauseIntegrationFacet(workspaceId, capabilityId, instanceKey, facetKey, request) {
3848
+ return await this.mutateIntegrationFacetLifecycle(
3286
3849
  workspaceId,
3287
3850
  capabilityId,
3288
3851
  instanceKey,
3289
- featureKey,
3852
+ facetKey,
3290
3853
  "pause",
3291
3854
  request
3292
3855
  );
3293
3856
  }
3294
- async resumeIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
3295
- return await this.mutateIntegrationFeatureLifecycle(
3857
+ async resumeIntegrationFacet(workspaceId, capabilityId, instanceKey, facetKey, request) {
3858
+ return await this.mutateIntegrationFacetLifecycle(
3296
3859
  workspaceId,
3297
3860
  capabilityId,
3298
3861
  instanceKey,
3299
- featureKey,
3862
+ facetKey,
3300
3863
  "resume",
3301
3864
  request
3302
3865
  );
3303
3866
  }
3304
- async removeIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
3867
+ async removeIntegrationFacet(workspaceId, capabilityId, instanceKey, facetKey, request) {
3305
3868
  return await this.requestJson(
3306
3869
  "DELETE",
3307
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}`,
3870
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets/${encodeURIComponent(facetKey)}`,
3308
3871
  request
3309
3872
  );
3310
3873
  }
3311
- async mutateIntegrationFeatureLifecycle(workspaceId, capabilityId, instanceKey, featureKey, action, request) {
3874
+ async mutateIntegrationFacetLifecycle(workspaceId, capabilityId, instanceKey, facetKey, action, request) {
3312
3875
  return await this.requestJson(
3313
3876
  "POST",
3314
- `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/${action}`,
3877
+ `/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/facets/${encodeURIComponent(facetKey)}/${action}`,
3315
3878
  request
3316
3879
  );
3317
3880
  }
@@ -3364,6 +3927,21 @@ var OpenGeniClient = class {
3364
3927
  request
3365
3928
  );
3366
3929
  }
3930
+ /** List Skills from the authoritative Plugin/Skill-Facet installation ledger. */
3931
+ async listInstalledSkills(workspaceId) {
3932
+ return await this.requestJson(
3933
+ "GET",
3934
+ `/v1/workspaces/${workspaceId}/skills`
3935
+ );
3936
+ }
3937
+ /** Install one exact reviewed curated-library Skill through the Skill domain. */
3938
+ async installLibrarySkill(workspaceId, libraryId, request) {
3939
+ return await this.requestJson(
3940
+ "POST",
3941
+ `/v1/workspaces/${workspaceId}/skills/library/${encodeURIComponent(libraryId)}/install`,
3942
+ request
3943
+ );
3944
+ }
3367
3945
  async previewSkillUninstall(workspaceId, capabilityId) {
3368
3946
  return await this.requestJson(
3369
3947
  "GET",
@@ -3402,6 +3980,26 @@ var OpenGeniClient = class {
3402
3980
  );
3403
3981
  return response.connection;
3404
3982
  }
3983
+ /**
3984
+ * Verify a pasted Fiken personal API token and store it as the
3985
+ * workspace-shared Fiken connection (or rewrite an existing one in place).
3986
+ */
3987
+ async installFikenConnection(workspaceId, request) {
3988
+ const response = await this.requestJson(
3989
+ "POST",
3990
+ `/v1/workspaces/${workspaceId}/connections/fiken/install`,
3991
+ request
3992
+ );
3993
+ return response.connection;
3994
+ }
3995
+ /** Start the Fiken OAuth flow for the workspace-shared Fiken connection. */
3996
+ async startFikenOAuth(workspaceId, request = {}) {
3997
+ return await this.requestJson(
3998
+ "POST",
3999
+ `/v1/workspaces/${workspaceId}/connections/fiken/oauth/start`,
4000
+ request
4001
+ );
4002
+ }
3405
4003
  /** Start the public Slack installation flow for the workspace-shared OpenGeni bot. */
3406
4004
  async startOpenGeniSlackBotInstall(workspaceId, request = {}) {
3407
4005
  return await this.requestJson(
@@ -3727,6 +4325,64 @@ var OpenGeniClient = class {
3727
4325
  { target }
3728
4326
  );
3729
4327
  }
4328
+ // --- SuperGrok/xAI connected subscriptions ------------------------------------------------------
4329
+ async supergrokStatus(workspaceId) {
4330
+ return await this.requestJson(
4331
+ "GET",
4332
+ `/v1/workspaces/${workspaceId}/supergrok/status`
4333
+ );
4334
+ }
4335
+ async supergrokConnectStart(workspaceId, scope = "workspace") {
4336
+ return await this.requestJson(
4337
+ "POST",
4338
+ `/v1/workspaces/${workspaceId}/supergrok/connect/start`,
4339
+ { scope }
4340
+ );
4341
+ }
4342
+ async supergrokConnectPoll(workspaceId, state) {
4343
+ return await this.requestJson(
4344
+ "POST",
4345
+ `/v1/workspaces/${workspaceId}/supergrok/connect/poll`,
4346
+ { state }
4347
+ );
4348
+ }
4349
+ async listSuperGrokAccounts(workspaceId) {
4350
+ return await this.requestJson(
4351
+ "GET",
4352
+ `/v1/workspaces/${workspaceId}/supergrok/accounts`
4353
+ );
4354
+ }
4355
+ async activateSuperGrokAccount(workspaceId, accountId) {
4356
+ return await this.requestJson(
4357
+ "POST",
4358
+ `/v1/workspaces/${workspaceId}/supergrok/accounts/${accountId}/activate`,
4359
+ {}
4360
+ );
4361
+ }
4362
+ async setSuperGrokRotationSettings(workspaceId, patch) {
4363
+ return await this.requestJson(
4364
+ "PATCH",
4365
+ `/v1/workspaces/${workspaceId}/supergrok/settings`,
4366
+ patch
4367
+ );
4368
+ }
4369
+ async setSuperGrokAccountAllocator(workspaceId, accountId, input) {
4370
+ return await this.requestJson(
4371
+ "PATCH",
4372
+ `/v1/workspaces/${workspaceId}/supergrok/accounts/${accountId}/allocator`,
4373
+ input
4374
+ );
4375
+ }
4376
+ async renameSuperGrokAccount(workspaceId, accountId, label) {
4377
+ return await this.requestJson(
4378
+ "PATCH",
4379
+ `/v1/workspaces/${workspaceId}/supergrok/accounts/${accountId}`,
4380
+ { label }
4381
+ );
4382
+ }
4383
+ async disconnectSuperGrokAccount(workspaceId, accountId) {
4384
+ return await this.requestJson("DELETE", `/v1/workspaces/${workspaceId}/supergrok/accounts/${accountId}`, {});
4385
+ }
3730
4386
  /** Contract-checked JSON transport shared by opt-in typed SDK clients. */
3731
4387
  async requestJson(method, path, body, query = {}, options = {}) {
3732
4388
  const correlationId = crypto.randomUUID();
@@ -4016,6 +4672,9 @@ export {
4016
4672
  parseSseStream,
4017
4673
  streamSessionEvents,
4018
4674
  streamWorkspaceControlEvents,
4675
+ streamWorkspaceInteractionRevisions,
4676
+ streamWorkspaceLiveEvents,
4677
+ parseWorkspaceLiveEvent,
4019
4678
  parseRetainedGeneratedImageReference,
4020
4679
  generatedImageSandboxPathMatches,
4021
4680
  parseGeneratedImageReceipt,
@@ -4024,4 +4683,4 @@ export {
4024
4683
  parseMediaGenerationResult,
4025
4684
  OpenGeniClient
4026
4685
  };
4027
- //# sourceMappingURL=chunk-ILQZR5N6.js.map
4686
+ //# sourceMappingURL=chunk-YGH5P47G.js.map