@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
@@ -9,14 +9,220 @@ var BROWSER_FRAME_MAX_DIMENSION = 32768;
9
9
  var BROWSER_FRAME_MAX_PIXELS = 1e8;
10
10
  var OpenGeniInteractionClient = class {
11
11
  attachedBrowsers;
12
+ authRuns;
12
13
  browsers;
13
14
  computers;
14
15
  identities;
16
+ interventions;
17
+ networkRoutes;
18
+ siteAuthConnections;
15
19
  constructor(transport) {
16
20
  this.attachedBrowsers = new AttachedBrowserDeviceCollection(transport);
21
+ this.authRuns = new AuthRunCollection(transport);
17
22
  this.browsers = new BrowserSessionCollection(transport);
18
23
  this.computers = new ComputerSessionCollection(transport);
19
24
  this.identities = new BrowserIdentityCollection(transport);
25
+ this.interventions = new InteractionInterventionCollection(transport);
26
+ this.networkRoutes = new NetworkRouteCollection(transport);
27
+ this.siteAuthConnections = new SiteAuthConnectionCollection(transport);
28
+ }
29
+ };
30
+ var NetworkRouteCollection = class {
31
+ constructor(transport) {
32
+ this.transport = transport;
33
+ }
34
+ async list(workspaceId, options = {}) {
35
+ return await this.transport.listNetworkRoutes(workspaceId, options);
36
+ }
37
+ route(workspaceId, networkRouteId) {
38
+ return new NetworkRouteResource(this.transport, workspaceId, networkRouteId);
39
+ }
40
+ async create(workspaceId, request, options = {}) {
41
+ const response = await this.transport.createNetworkRoute(workspaceId, request, options);
42
+ return this.route(workspaceId, response.route.id);
43
+ }
44
+ };
45
+ var NetworkRouteResource = class {
46
+ constructor(transport, workspaceId, id) {
47
+ this.transport = transport;
48
+ this.workspaceId = workspaceId;
49
+ this.id = id;
50
+ }
51
+ async get(options = {}) {
52
+ return await this.transport.getNetworkRoute(this.workspaceId, this.id, options);
53
+ }
54
+ async update(request, options = {}) {
55
+ return await this.transport.updateNetworkRoute(this.workspaceId, this.id, request, options);
56
+ }
57
+ };
58
+ var SiteAuthConnectionCollection = class {
59
+ constructor(transport) {
60
+ this.transport = transport;
61
+ }
62
+ async list(workspaceId, options = {}) {
63
+ return await this.transport.listSiteAuthConnections(workspaceId, options);
64
+ }
65
+ connection(workspaceId, connectionId) {
66
+ return new SiteAuthConnectionResource(this.transport, workspaceId, connectionId);
67
+ }
68
+ async create(workspaceId, request, options = {}) {
69
+ const response = await this.transport.createSiteAuthConnection(workspaceId, request, options);
70
+ return this.connection(workspaceId, response.connection.id);
71
+ }
72
+ };
73
+ var SiteAuthConnectionResource = class {
74
+ constructor(transport, workspaceId, id) {
75
+ this.transport = transport;
76
+ this.workspaceId = workspaceId;
77
+ this.id = id;
78
+ }
79
+ async get(options = {}) {
80
+ return await this.transport.getSiteAuthConnection(this.workspaceId, this.id, options);
81
+ }
82
+ async update(request, options = {}) {
83
+ return await this.transport.updateSiteAuthConnection(
84
+ this.workspaceId,
85
+ this.id,
86
+ request,
87
+ options
88
+ );
89
+ }
90
+ };
91
+ var AuthRunCollection = class {
92
+ constructor(transport) {
93
+ this.transport = transport;
94
+ }
95
+ async list(workspaceId, options = {}) {
96
+ return await this.transport.listAuthRuns(workspaceId, options);
97
+ }
98
+ async get(workspaceId, authRunId, options = {}) {
99
+ return await this.transport.getAuthRun(workspaceId, authRunId, options);
100
+ }
101
+ run(workspaceId, browserSessionId, authRunId) {
102
+ return new AuthRunResource(this.transport, workspaceId, browserSessionId, authRunId);
103
+ }
104
+ };
105
+ var BrowserAuthRunCollection = class {
106
+ constructor(transport, workspaceId, browserSessionId) {
107
+ this.transport = transport;
108
+ this.workspaceId = workspaceId;
109
+ this.browserSessionId = browserSessionId;
110
+ }
111
+ async list(options = {}) {
112
+ return await this.transport.listAuthRuns(this.workspaceId, {
113
+ ...options,
114
+ browserSessionId: this.browserSessionId
115
+ });
116
+ }
117
+ run(authRunId) {
118
+ return new AuthRunResource(this.transport, this.workspaceId, this.browserSessionId, authRunId);
119
+ }
120
+ async start(request, options = {}) {
121
+ const response = await this.transport.startBrowserAuthRun(
122
+ this.workspaceId,
123
+ this.browserSessionId,
124
+ request,
125
+ options
126
+ );
127
+ return this.run(response.run.id);
128
+ }
129
+ };
130
+ var AuthRunResource = class {
131
+ constructor(transport, workspaceId, browserSessionId, id) {
132
+ this.transport = transport;
133
+ this.workspaceId = workspaceId;
134
+ this.browserSessionId = browserSessionId;
135
+ this.id = id;
136
+ }
137
+ async get(options = {}) {
138
+ const run = await this.transport.getAuthRun(this.workspaceId, this.id, options);
139
+ if (run.browserSessionId !== this.browserSessionId) {
140
+ throw new Error("AuthRun belongs to another BrowserSession");
141
+ }
142
+ return run;
143
+ }
144
+ async report(request, options = {}) {
145
+ return await this.transport.reportBrowserAuthRun(
146
+ this.workspaceId,
147
+ this.browserSessionId,
148
+ this.id,
149
+ request,
150
+ options
151
+ );
152
+ }
153
+ async protectedFill(request, options = {}) {
154
+ return await this.transport.protectedBrowserAuthFill(
155
+ this.workspaceId,
156
+ this.browserSessionId,
157
+ this.id,
158
+ request,
159
+ options
160
+ );
161
+ }
162
+ async advanceExternal(request, options = {}) {
163
+ return await this.transport.advanceExternalBrowserAuthRun(
164
+ this.workspaceId,
165
+ this.browserSessionId,
166
+ this.id,
167
+ request,
168
+ options
169
+ );
170
+ }
171
+ /** Human-session helper. Hosted provider URLs never appear in model tools. */
172
+ async openExternalFlow(request, options = {}) {
173
+ return await this.transport.openExternalBrowserAuthFlow(
174
+ this.workspaceId,
175
+ this.browserSessionId,
176
+ this.id,
177
+ request,
178
+ options
179
+ );
180
+ }
181
+ async verify(request, options = {}) {
182
+ return await this.transport.verifyBrowserAuthRun(
183
+ this.workspaceId,
184
+ this.browserSessionId,
185
+ this.id,
186
+ request,
187
+ options
188
+ );
189
+ }
190
+ };
191
+ var InteractionInterventionCollection = class {
192
+ constructor(transport) {
193
+ this.transport = transport;
194
+ }
195
+ async list(workspaceId, options = {}) {
196
+ return await this.transport.listInteractionInterventions(workspaceId, options);
197
+ }
198
+ intervention(workspaceId, interventionId) {
199
+ return new InteractionInterventionResource(this.transport, workspaceId, interventionId);
200
+ }
201
+ async create(workspaceId, request, options = {}) {
202
+ const response = await this.transport.createInteractionIntervention(
203
+ workspaceId,
204
+ request,
205
+ options
206
+ );
207
+ return this.intervention(workspaceId, response.intervention.id);
208
+ }
209
+ };
210
+ var InteractionInterventionResource = class {
211
+ constructor(transport, workspaceId, id) {
212
+ this.transport = transport;
213
+ this.workspaceId = workspaceId;
214
+ this.id = id;
215
+ }
216
+ async get(options = {}) {
217
+ return await this.transport.getInteractionIntervention(this.workspaceId, this.id, options);
218
+ }
219
+ async resolve(request, options = {}) {
220
+ return await this.transport.resolveInteractionIntervention(
221
+ this.workspaceId,
222
+ this.id,
223
+ request,
224
+ options
225
+ );
20
226
  }
21
227
  };
22
228
  var AttachedBrowserDeviceCollection = class {
@@ -67,6 +273,9 @@ var BrowserIdentityResource = class {
67
273
  async revisions(options = {}) {
68
274
  return await this.transport.listBrowserRevisions(this.workspaceId, this.id, options);
69
275
  }
276
+ async update(request, options = {}) {
277
+ return await this.transport.updateBrowserIdentity(this.workspaceId, this.id, request, options);
278
+ }
70
279
  };
71
280
  var BrowserSessionCollection = class {
72
281
  constructor(transport) {
@@ -107,6 +316,7 @@ var BrowserSessionCollection = class {
107
316
  ...options.placement !== void 0 ? { placement: options.placement } : {},
108
317
  ...options.identityId !== void 0 ? { identityId: options.identityId } : {},
109
318
  ...options.baseRevisionId !== void 0 ? { baseRevisionId: options.baseRevisionId } : {},
319
+ ...options.networkRouteId !== void 0 ? { networkRouteId: options.networkRouteId } : {},
110
320
  ...options.linkedComputerSessionId !== void 0 ? { linkedComputerSessionId: options.linkedComputerSessionId } : {}
111
321
  },
112
322
  requestOptions
@@ -118,9 +328,15 @@ var BrowserSessionResource = class {
118
328
  this.transport = transport;
119
329
  this.workspaceId = workspaceId;
120
330
  this.id = id;
331
+ this.auth = new BrowserAuthRunCollection(transport, workspaceId, id);
332
+ this.clipboard = new BrowserClipboardResource(transport, workspaceId, id);
333
+ this.downloads = new BrowserDownloadCollection(transport, workspaceId, id);
121
334
  this.tabs = new BrowserTargetCollection(transport, workspaceId, id);
122
335
  this.targets = this.tabs;
123
336
  }
337
+ auth;
338
+ clipboard;
339
+ downloads;
124
340
  tabs;
125
341
  /** Alias for hosts that prefer the protocol term. */
126
342
  targets;
@@ -174,6 +390,83 @@ var BrowserSessionResource = class {
174
390
  return await this.transport.endBrowserSession(this.workspaceId, this.id, request, options);
175
391
  }
176
392
  };
393
+ var BrowserClipboardResource = class {
394
+ constructor(transport, workspaceId, browserSessionId) {
395
+ this.transport = transport;
396
+ this.workspaceId = workspaceId;
397
+ this.browserSessionId = browserSessionId;
398
+ }
399
+ async read(options = {}) {
400
+ const clipboard = await this.transport.readBrowserClipboard(
401
+ this.workspaceId,
402
+ this.browserSessionId,
403
+ options
404
+ );
405
+ if (clipboard.browserSessionId !== this.browserSessionId) {
406
+ throw new Error("Browser clipboard belongs to another BrowserSession");
407
+ }
408
+ return clipboard;
409
+ }
410
+ };
411
+ var BrowserDownloadCollection = class {
412
+ constructor(transport, workspaceId, browserSessionId) {
413
+ this.transport = transport;
414
+ this.workspaceId = workspaceId;
415
+ this.browserSessionId = browserSessionId;
416
+ }
417
+ async list(options = {}) {
418
+ return await this.transport.listBrowserDownloads(
419
+ this.workspaceId,
420
+ this.browserSessionId,
421
+ options
422
+ );
423
+ }
424
+ download(downloadId) {
425
+ return new BrowserDownloadResource(
426
+ this.transport,
427
+ this.workspaceId,
428
+ this.browserSessionId,
429
+ downloadId
430
+ );
431
+ }
432
+ };
433
+ var BrowserDownloadResource = class {
434
+ constructor(transport, workspaceId, browserSessionId, id) {
435
+ this.transport = transport;
436
+ this.workspaceId = workspaceId;
437
+ this.browserSessionId = browserSessionId;
438
+ this.id = id;
439
+ }
440
+ async get(options = {}) {
441
+ const download = await this.transport.getBrowserDownload(
442
+ this.workspaceId,
443
+ this.browserSessionId,
444
+ this.id,
445
+ options
446
+ );
447
+ if (download.browserSessionId !== this.browserSessionId) {
448
+ throw new Error("BrowserDownload belongs to another BrowserSession");
449
+ }
450
+ return download;
451
+ }
452
+ /** Publish this exact private browser download into the source session's
453
+ * workspace. Pass an operationId when the caller needs retry identity across
454
+ * process boundaries; otherwise one is generated for this call. */
455
+ async saveToWorkspace(destinationPath, options = {}) {
456
+ const { operationId = crypto.randomUUID(), overwrite = false, ...requestOptions } = options;
457
+ const response = await this.transport.saveBrowserDownload(
458
+ this.workspaceId,
459
+ this.browserSessionId,
460
+ this.id,
461
+ { operationId, destinationPath, overwrite },
462
+ requestOptions
463
+ );
464
+ if (response.download.id !== this.id || response.download.browserSessionId !== this.browserSessionId) {
465
+ throw new Error("BrowserDownload save returned another resource");
466
+ }
467
+ return response;
468
+ }
469
+ };
177
470
  var BrowserTargetCollection = class {
178
471
  constructor(transport, workspaceId, browserSessionId) {
179
472
  this.transport = transport;
@@ -252,10 +545,12 @@ var ComputerSessionResource = class {
252
545
  this.id = id;
253
546
  this.targets = new ComputerTargetCollection(transport, workspaceId, id);
254
547
  this.apps = this.targets;
548
+ this.clipboard = new ComputerClipboardResource(transport, workspaceId, id);
255
549
  }
256
550
  targets;
257
551
  /** Native application/window targets are also the public app collection. */
258
552
  apps;
553
+ clipboard;
259
554
  async get(options = {}) {
260
555
  return await this.transport.getComputerSession(this.workspaceId, this.id, options);
261
556
  }
@@ -283,6 +578,24 @@ var ComputerSessionResource = class {
283
578
  return await this.transport.endComputerSession(this.workspaceId, this.id, request, options);
284
579
  }
285
580
  };
581
+ var ComputerClipboardResource = class {
582
+ constructor(transport, workspaceId, computerSessionId) {
583
+ this.transport = transport;
584
+ this.workspaceId = workspaceId;
585
+ this.computerSessionId = computerSessionId;
586
+ }
587
+ async read(options = {}) {
588
+ const clipboard = await this.transport.readComputerClipboard(
589
+ this.workspaceId,
590
+ this.computerSessionId,
591
+ options
592
+ );
593
+ if (clipboard.computerSessionId !== this.computerSessionId) {
594
+ throw new Error("Computer clipboard belongs to another ComputerSession");
595
+ }
596
+ return clipboard;
597
+ }
598
+ };
286
599
  var ComputerTargetCollection = class {
287
600
  constructor(transport, workspaceId, computerSessionId) {
288
601
  this.transport = transport;
@@ -641,15 +954,28 @@ export {
641
954
  BROWSER_FRAME_MAX_DIMENSION,
642
955
  BROWSER_FRAME_MAX_PIXELS,
643
956
  OpenGeniInteractionClient,
957
+ NetworkRouteCollection,
958
+ NetworkRouteResource,
959
+ SiteAuthConnectionCollection,
960
+ SiteAuthConnectionResource,
961
+ AuthRunCollection,
962
+ BrowserAuthRunCollection,
963
+ AuthRunResource,
964
+ InteractionInterventionCollection,
965
+ InteractionInterventionResource,
644
966
  AttachedBrowserDeviceCollection,
645
967
  AttachedBrowserDeviceResource,
646
968
  BrowserIdentityCollection,
647
969
  BrowserIdentityResource,
648
970
  BrowserSessionCollection,
649
971
  BrowserSessionResource,
972
+ BrowserClipboardResource,
973
+ BrowserDownloadCollection,
974
+ BrowserDownloadResource,
650
975
  BrowserTargetCollection,
651
976
  ComputerSessionCollection,
652
977
  ComputerSessionResource,
978
+ ComputerClipboardResource,
653
979
  ComputerTargetCollection,
654
980
  browserFrameSocketUrl,
655
981
  computerFrameSocketUrl,
@@ -658,4 +984,4 @@ export {
658
984
  parseBrowserFrameMetadata,
659
985
  parseComputerFrameMetadata
660
986
  };
661
- //# sourceMappingURL=chunk-MZWTWOX6.js.map
987
+ //# sourceMappingURL=chunk-ST5DDKJP.js.map