@opengeni/codemode 0.2.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.
@@ -0,0 +1,1529 @@
1
+ import type { AttachedBrowserDevice, BrowserAction, BrowserActionReceipt, BrowserDiagnosticBatch, BrowserDiagnosticKind, BrowserIdentity, BrowserIdentityListResponse, BrowserIdentityMutationResponse, BrowserLocator, BrowserObservation, BrowserRevisionListResponse, BrowserSession, BrowserSessionMutationResponse, BrowserTargetListResponse, ComputerAction, ComputerActionReceipt, ComputerLocator, ComputerObservation, ComputerSession, ComputerSessionMutationResponse, ComputerTargetListResponse, InteractionPlacement, PublishBrowserRevisionResponse } from "@opengeni/contracts";
2
+ import type { CodemodeCallOptions, CodemodeClient } from "./index.js";
3
+ import { type CodemodeClientProvider } from "./environment.js";
4
+ import { CodemodeArtifactCollection } from "./artifacts.js";
5
+ export { CodemodeToolExecutionError } from "./structured.js";
6
+ export type InteractionDiscovery = {
7
+ browserRevision: number;
8
+ computerRevision: number;
9
+ identityRevision: number;
10
+ attachedBrowserRevision: number;
11
+ browsers: BrowserSession[];
12
+ computers: ComputerSession[];
13
+ identities: BrowserIdentity[];
14
+ attachedBrowsers: AttachedBrowserDevice[];
15
+ };
16
+ export type CodemodeBrowserOpenOptions = {
17
+ browserSessionId?: string | undefined;
18
+ mode?: "reuse_or_create" | "new" | undefined;
19
+ name?: string | undefined;
20
+ initialUrl?: string | undefined;
21
+ headless?: boolean | undefined;
22
+ placement?: InteractionPlacement | undefined;
23
+ identityId?: string | undefined;
24
+ baseRevisionId?: string | undefined;
25
+ linkedComputerSessionId?: string | undefined;
26
+ };
27
+ export type CodemodeComputerOpenOptions = {
28
+ computerSessionId?: string | undefined;
29
+ mode?: "reuse_or_create" | "new" | undefined;
30
+ name?: string | undefined;
31
+ placement?: InteractionPlacement | undefined;
32
+ };
33
+ export type BrowserActionFences = {
34
+ expectedTargetGeneration?: string | undefined;
35
+ expectedDocumentGeneration?: string | null | undefined;
36
+ expectedFrameId?: string | null | undefined;
37
+ };
38
+ export type ComputerActionFences = {
39
+ expectedTargetGeneration?: string | undefined;
40
+ expectedObservationId?: string | null | undefined;
41
+ expectedFrameId?: string | null | undefined;
42
+ };
43
+ /** Authored object facade over the exact atomic Browser/Computer catalog. */
44
+ export declare class OpenGeniCodemode {
45
+ readonly browsers: CodemodeBrowserCollection;
46
+ readonly computers: CodemodeComputerCollection;
47
+ readonly artifacts: CodemodeArtifactCollection;
48
+ constructor(client?: CodemodeClient | CodemodeClientProvider);
49
+ discover(options?: {
50
+ includeTerminal?: boolean | undefined;
51
+ includeArchivedIdentities?: boolean | undefined;
52
+ includeDisconnectedDevices?: boolean | undefined;
53
+ }, callOptions?: CodemodeCallOptions): Promise<InteractionDiscovery>;
54
+ }
55
+ export declare class CodemodeBrowserCollection {
56
+ readonly client: CodemodeClientProvider;
57
+ readonly identities: CodemodeBrowserIdentityCollection;
58
+ constructor(client: CodemodeClientProvider);
59
+ list(options?: {
60
+ includeTerminal?: boolean | undefined;
61
+ }, callOptions?: CodemodeCallOptions): Promise<BrowserSession[]>;
62
+ open(options?: CodemodeBrowserOpenOptions, callOptions?: CodemodeCallOptions): Promise<CodemodeBrowser>;
63
+ use(browserSessionId: string): CodemodeBrowser;
64
+ }
65
+ export declare class CodemodeBrowserIdentityCollection {
66
+ private readonly client;
67
+ constructor(client: CodemodeClientProvider);
68
+ list(options?: {
69
+ includeArchived?: boolean | undefined;
70
+ }, callOptions?: CodemodeCallOptions): Promise<BrowserIdentityListResponse>;
71
+ get(identityId: string, callOptions?: CodemodeCallOptions): Promise<BrowserIdentity>;
72
+ create(name: string, callOptions?: CodemodeCallOptions): Promise<BrowserIdentityMutationResponse>;
73
+ revisions(identityId: string, callOptions?: CodemodeCallOptions): Promise<BrowserRevisionListResponse>;
74
+ }
75
+ export declare class CodemodeBrowser {
76
+ private readonly client;
77
+ readonly id: string;
78
+ readonly tabs: CodemodeBrowserTabCollection;
79
+ constructor(client: CodemodeClientProvider, id: string);
80
+ refresh(callOptions?: CodemodeCallOptions): Promise<BrowserSession>;
81
+ observe(targetId?: string, callOptions?: CodemodeCallOptions): Promise<BrowserObservation>;
82
+ act(action: BrowserAction, options?: BrowserActionFences & {
83
+ targetId?: string | undefined;
84
+ }, callOptions?: CodemodeCallOptions): Promise<BrowserActionReceipt>;
85
+ diagnostics(targetId?: string, options?: {
86
+ kinds?: BrowserDiagnosticKind[] | undefined;
87
+ after?: number | undefined;
88
+ limit?: number | undefined;
89
+ }, callOptions?: CodemodeCallOptions): Promise<BrowserDiagnosticBatch>;
90
+ publish(input: {
91
+ identityId: string;
92
+ expectedHeadGeneration: number;
93
+ advanceDefault?: boolean | undefined;
94
+ }, callOptions?: CodemodeCallOptions): Promise<PublishBrowserRevisionResponse>;
95
+ suspend(callOptions?: CodemodeCallOptions): Promise<BrowserSessionMutationResponse>;
96
+ resume(callOptions?: CodemodeCallOptions): Promise<BrowserSessionMutationResponse>;
97
+ end(callOptions?: CodemodeCallOptions): Promise<BrowserSessionMutationResponse>;
98
+ private lifecycle;
99
+ }
100
+ export declare class CodemodeBrowserTabCollection {
101
+ private readonly client;
102
+ private readonly browserSessionId;
103
+ constructor(client: CodemodeClientProvider, browserSessionId: string);
104
+ list(callOptions?: CodemodeCallOptions): Promise<BrowserTargetListResponse>;
105
+ selected(callOptions?: CodemodeCallOptions): Promise<CodemodeBrowserTab>;
106
+ use(targetId: string): CodemodeBrowserTab;
107
+ open(url?: string, callOptions?: CodemodeCallOptions): Promise<CodemodeBrowserTab>;
108
+ select(targetId: string, callOptions?: CodemodeCallOptions): Promise<CodemodeBrowserTab>;
109
+ close(targetId: string, callOptions?: CodemodeCallOptions): Promise<BrowserTargetListResponse>;
110
+ resolveId(targetId: string | undefined, callOptions: CodemodeCallOptions): Promise<string>;
111
+ }
112
+ export declare class CodemodeBrowserTab {
113
+ private readonly client;
114
+ readonly browserSessionId: string;
115
+ readonly id: string;
116
+ constructor(client: CodemodeClientProvider, browserSessionId: string, id: string);
117
+ observe(callOptions?: CodemodeCallOptions): Promise<BrowserObservation>;
118
+ act(action: BrowserAction, fences?: BrowserActionFences, callOptions?: CodemodeCallOptions): Promise<BrowserActionReceipt>;
119
+ navigate(url: string, callOptions?: CodemodeCallOptions): Promise<{
120
+ protocolVersion: 1;
121
+ operationId: string;
122
+ browserSessionId: string;
123
+ controllerGeneration: string;
124
+ targetId: string;
125
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
126
+ dispatchedAt: string | null;
127
+ settledAt: string | null;
128
+ observation: {
129
+ protocolVersion: 1;
130
+ observationId: string;
131
+ browserSessionId: string;
132
+ target: {
133
+ id: string;
134
+ browserSessionId: string;
135
+ controllerGeneration: string;
136
+ targetGeneration: string;
137
+ documentGeneration: string | null;
138
+ kind: "background_page" | "page" | "popup" | "worker";
139
+ title: string;
140
+ url: string;
141
+ selected: boolean;
142
+ attached: boolean;
143
+ createdAt: string;
144
+ };
145
+ frameId: string | null;
146
+ semantic: {
147
+ kind: "snapshot";
148
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
149
+ nodeCount: number;
150
+ } | {
151
+ kind: "diff";
152
+ baseObservationId: string;
153
+ removedRefs: string[];
154
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
155
+ } | null;
156
+ screenshot: {
157
+ available: true;
158
+ artifactId: string;
159
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
160
+ contentType: string;
161
+ originalBytes: number;
162
+ sha256: string;
163
+ retainedAt: string;
164
+ dimensions?: {
165
+ width: number;
166
+ height: number;
167
+ } | undefined;
168
+ retention: {
169
+ policy: "workspace_file";
170
+ expiresAt: null;
171
+ } | {
172
+ policy: "session_screenshot";
173
+ expiresAt: string;
174
+ };
175
+ retrieval: {
176
+ method: "GET";
177
+ path: string;
178
+ acceptRanges: "bytes";
179
+ maxRangeBytes: number;
180
+ };
181
+ } | null;
182
+ focusedRef: string | null;
183
+ changedRegions: {
184
+ x: number;
185
+ y: number;
186
+ width: number;
187
+ height: number;
188
+ }[];
189
+ diagnostics: {
190
+ consoleErrorCount: number;
191
+ failedRequestCount: number;
192
+ downloadCount: number;
193
+ pageErrorCount: number;
194
+ };
195
+ dialog: {
196
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
197
+ message: string;
198
+ defaultPrompt: string;
199
+ openedAt: string;
200
+ } | null;
201
+ observedAt: string;
202
+ } | null;
203
+ error: {
204
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
205
+ message: string;
206
+ retryable: boolean;
207
+ details?: Record<string, import("zod").JSONType> | undefined;
208
+ } | null;
209
+ }>;
210
+ getByRole(role: string, options?: {
211
+ name?: string;
212
+ exact?: boolean;
213
+ }): CodemodeBrowserLocator;
214
+ getByText(text: string): CodemodeBrowserLocator;
215
+ getByLabel(text: string): CodemodeBrowserLocator;
216
+ getByPlaceholder(text: string): CodemodeBrowserLocator;
217
+ getByTestId(value: string): CodemodeBrowserLocator;
218
+ locator(selector: string): CodemodeBrowserLocator;
219
+ ref(ref: string): CodemodeBrowserLocator;
220
+ }
221
+ export declare class CodemodeBrowserLocator {
222
+ private readonly tab;
223
+ readonly locator: BrowserLocator;
224
+ constructor(tab: CodemodeBrowserTab, locator: BrowserLocator);
225
+ click(options?: {
226
+ button?: "left" | "right" | "middle";
227
+ }, callOptions?: CodemodeCallOptions): Promise<{
228
+ protocolVersion: 1;
229
+ operationId: string;
230
+ browserSessionId: string;
231
+ controllerGeneration: string;
232
+ targetId: string;
233
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
234
+ dispatchedAt: string | null;
235
+ settledAt: string | null;
236
+ observation: {
237
+ protocolVersion: 1;
238
+ observationId: string;
239
+ browserSessionId: string;
240
+ target: {
241
+ id: string;
242
+ browserSessionId: string;
243
+ controllerGeneration: string;
244
+ targetGeneration: string;
245
+ documentGeneration: string | null;
246
+ kind: "background_page" | "page" | "popup" | "worker";
247
+ title: string;
248
+ url: string;
249
+ selected: boolean;
250
+ attached: boolean;
251
+ createdAt: string;
252
+ };
253
+ frameId: string | null;
254
+ semantic: {
255
+ kind: "snapshot";
256
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
257
+ nodeCount: number;
258
+ } | {
259
+ kind: "diff";
260
+ baseObservationId: string;
261
+ removedRefs: string[];
262
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
263
+ } | null;
264
+ screenshot: {
265
+ available: true;
266
+ artifactId: string;
267
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
268
+ contentType: string;
269
+ originalBytes: number;
270
+ sha256: string;
271
+ retainedAt: string;
272
+ dimensions?: {
273
+ width: number;
274
+ height: number;
275
+ } | undefined;
276
+ retention: {
277
+ policy: "workspace_file";
278
+ expiresAt: null;
279
+ } | {
280
+ policy: "session_screenshot";
281
+ expiresAt: string;
282
+ };
283
+ retrieval: {
284
+ method: "GET";
285
+ path: string;
286
+ acceptRanges: "bytes";
287
+ maxRangeBytes: number;
288
+ };
289
+ } | null;
290
+ focusedRef: string | null;
291
+ changedRegions: {
292
+ x: number;
293
+ y: number;
294
+ width: number;
295
+ height: number;
296
+ }[];
297
+ diagnostics: {
298
+ consoleErrorCount: number;
299
+ failedRequestCount: number;
300
+ downloadCount: number;
301
+ pageErrorCount: number;
302
+ };
303
+ dialog: {
304
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
305
+ message: string;
306
+ defaultPrompt: string;
307
+ openedAt: string;
308
+ } | null;
309
+ observedAt: string;
310
+ } | null;
311
+ error: {
312
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
313
+ message: string;
314
+ retryable: boolean;
315
+ details?: Record<string, import("zod").JSONType> | undefined;
316
+ } | null;
317
+ }>;
318
+ doubleClick(callOptions?: CodemodeCallOptions): Promise<{
319
+ protocolVersion: 1;
320
+ operationId: string;
321
+ browserSessionId: string;
322
+ controllerGeneration: string;
323
+ targetId: string;
324
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
325
+ dispatchedAt: string | null;
326
+ settledAt: string | null;
327
+ observation: {
328
+ protocolVersion: 1;
329
+ observationId: string;
330
+ browserSessionId: string;
331
+ target: {
332
+ id: string;
333
+ browserSessionId: string;
334
+ controllerGeneration: string;
335
+ targetGeneration: string;
336
+ documentGeneration: string | null;
337
+ kind: "background_page" | "page" | "popup" | "worker";
338
+ title: string;
339
+ url: string;
340
+ selected: boolean;
341
+ attached: boolean;
342
+ createdAt: string;
343
+ };
344
+ frameId: string | null;
345
+ semantic: {
346
+ kind: "snapshot";
347
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
348
+ nodeCount: number;
349
+ } | {
350
+ kind: "diff";
351
+ baseObservationId: string;
352
+ removedRefs: string[];
353
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
354
+ } | null;
355
+ screenshot: {
356
+ available: true;
357
+ artifactId: string;
358
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
359
+ contentType: string;
360
+ originalBytes: number;
361
+ sha256: string;
362
+ retainedAt: string;
363
+ dimensions?: {
364
+ width: number;
365
+ height: number;
366
+ } | undefined;
367
+ retention: {
368
+ policy: "workspace_file";
369
+ expiresAt: null;
370
+ } | {
371
+ policy: "session_screenshot";
372
+ expiresAt: string;
373
+ };
374
+ retrieval: {
375
+ method: "GET";
376
+ path: string;
377
+ acceptRanges: "bytes";
378
+ maxRangeBytes: number;
379
+ };
380
+ } | null;
381
+ focusedRef: string | null;
382
+ changedRegions: {
383
+ x: number;
384
+ y: number;
385
+ width: number;
386
+ height: number;
387
+ }[];
388
+ diagnostics: {
389
+ consoleErrorCount: number;
390
+ failedRequestCount: number;
391
+ downloadCount: number;
392
+ pageErrorCount: number;
393
+ };
394
+ dialog: {
395
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
396
+ message: string;
397
+ defaultPrompt: string;
398
+ openedAt: string;
399
+ } | null;
400
+ observedAt: string;
401
+ } | null;
402
+ error: {
403
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
404
+ message: string;
405
+ retryable: boolean;
406
+ details?: Record<string, import("zod").JSONType> | undefined;
407
+ } | null;
408
+ }>;
409
+ hover(callOptions?: CodemodeCallOptions): Promise<{
410
+ protocolVersion: 1;
411
+ operationId: string;
412
+ browserSessionId: string;
413
+ controllerGeneration: string;
414
+ targetId: string;
415
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
416
+ dispatchedAt: string | null;
417
+ settledAt: string | null;
418
+ observation: {
419
+ protocolVersion: 1;
420
+ observationId: string;
421
+ browserSessionId: string;
422
+ target: {
423
+ id: string;
424
+ browserSessionId: string;
425
+ controllerGeneration: string;
426
+ targetGeneration: string;
427
+ documentGeneration: string | null;
428
+ kind: "background_page" | "page" | "popup" | "worker";
429
+ title: string;
430
+ url: string;
431
+ selected: boolean;
432
+ attached: boolean;
433
+ createdAt: string;
434
+ };
435
+ frameId: string | null;
436
+ semantic: {
437
+ kind: "snapshot";
438
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
439
+ nodeCount: number;
440
+ } | {
441
+ kind: "diff";
442
+ baseObservationId: string;
443
+ removedRefs: string[];
444
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
445
+ } | null;
446
+ screenshot: {
447
+ available: true;
448
+ artifactId: string;
449
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
450
+ contentType: string;
451
+ originalBytes: number;
452
+ sha256: string;
453
+ retainedAt: string;
454
+ dimensions?: {
455
+ width: number;
456
+ height: number;
457
+ } | undefined;
458
+ retention: {
459
+ policy: "workspace_file";
460
+ expiresAt: null;
461
+ } | {
462
+ policy: "session_screenshot";
463
+ expiresAt: string;
464
+ };
465
+ retrieval: {
466
+ method: "GET";
467
+ path: string;
468
+ acceptRanges: "bytes";
469
+ maxRangeBytes: number;
470
+ };
471
+ } | null;
472
+ focusedRef: string | null;
473
+ changedRegions: {
474
+ x: number;
475
+ y: number;
476
+ width: number;
477
+ height: number;
478
+ }[];
479
+ diagnostics: {
480
+ consoleErrorCount: number;
481
+ failedRequestCount: number;
482
+ downloadCount: number;
483
+ pageErrorCount: number;
484
+ };
485
+ dialog: {
486
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
487
+ message: string;
488
+ defaultPrompt: string;
489
+ openedAt: string;
490
+ } | null;
491
+ observedAt: string;
492
+ } | null;
493
+ error: {
494
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
495
+ message: string;
496
+ retryable: boolean;
497
+ details?: Record<string, import("zod").JSONType> | undefined;
498
+ } | null;
499
+ }>;
500
+ fill(value: string, callOptions?: CodemodeCallOptions): Promise<{
501
+ protocolVersion: 1;
502
+ operationId: string;
503
+ browserSessionId: string;
504
+ controllerGeneration: string;
505
+ targetId: string;
506
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
507
+ dispatchedAt: string | null;
508
+ settledAt: string | null;
509
+ observation: {
510
+ protocolVersion: 1;
511
+ observationId: string;
512
+ browserSessionId: string;
513
+ target: {
514
+ id: string;
515
+ browserSessionId: string;
516
+ controllerGeneration: string;
517
+ targetGeneration: string;
518
+ documentGeneration: string | null;
519
+ kind: "background_page" | "page" | "popup" | "worker";
520
+ title: string;
521
+ url: string;
522
+ selected: boolean;
523
+ attached: boolean;
524
+ createdAt: string;
525
+ };
526
+ frameId: string | null;
527
+ semantic: {
528
+ kind: "snapshot";
529
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
530
+ nodeCount: number;
531
+ } | {
532
+ kind: "diff";
533
+ baseObservationId: string;
534
+ removedRefs: string[];
535
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
536
+ } | null;
537
+ screenshot: {
538
+ available: true;
539
+ artifactId: string;
540
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
541
+ contentType: string;
542
+ originalBytes: number;
543
+ sha256: string;
544
+ retainedAt: string;
545
+ dimensions?: {
546
+ width: number;
547
+ height: number;
548
+ } | undefined;
549
+ retention: {
550
+ policy: "workspace_file";
551
+ expiresAt: null;
552
+ } | {
553
+ policy: "session_screenshot";
554
+ expiresAt: string;
555
+ };
556
+ retrieval: {
557
+ method: "GET";
558
+ path: string;
559
+ acceptRanges: "bytes";
560
+ maxRangeBytes: number;
561
+ };
562
+ } | null;
563
+ focusedRef: string | null;
564
+ changedRegions: {
565
+ x: number;
566
+ y: number;
567
+ width: number;
568
+ height: number;
569
+ }[];
570
+ diagnostics: {
571
+ consoleErrorCount: number;
572
+ failedRequestCount: number;
573
+ downloadCount: number;
574
+ pageErrorCount: number;
575
+ };
576
+ dialog: {
577
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
578
+ message: string;
579
+ defaultPrompt: string;
580
+ openedAt: string;
581
+ } | null;
582
+ observedAt: string;
583
+ } | null;
584
+ error: {
585
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
586
+ message: string;
587
+ retryable: boolean;
588
+ details?: Record<string, import("zod").JSONType> | undefined;
589
+ } | null;
590
+ }>;
591
+ type(text: string, callOptions?: CodemodeCallOptions): Promise<{
592
+ protocolVersion: 1;
593
+ operationId: string;
594
+ browserSessionId: string;
595
+ controllerGeneration: string;
596
+ targetId: string;
597
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
598
+ dispatchedAt: string | null;
599
+ settledAt: string | null;
600
+ observation: {
601
+ protocolVersion: 1;
602
+ observationId: string;
603
+ browserSessionId: string;
604
+ target: {
605
+ id: string;
606
+ browserSessionId: string;
607
+ controllerGeneration: string;
608
+ targetGeneration: string;
609
+ documentGeneration: string | null;
610
+ kind: "background_page" | "page" | "popup" | "worker";
611
+ title: string;
612
+ url: string;
613
+ selected: boolean;
614
+ attached: boolean;
615
+ createdAt: string;
616
+ };
617
+ frameId: string | null;
618
+ semantic: {
619
+ kind: "snapshot";
620
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
621
+ nodeCount: number;
622
+ } | {
623
+ kind: "diff";
624
+ baseObservationId: string;
625
+ removedRefs: string[];
626
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
627
+ } | null;
628
+ screenshot: {
629
+ available: true;
630
+ artifactId: string;
631
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
632
+ contentType: string;
633
+ originalBytes: number;
634
+ sha256: string;
635
+ retainedAt: string;
636
+ dimensions?: {
637
+ width: number;
638
+ height: number;
639
+ } | undefined;
640
+ retention: {
641
+ policy: "workspace_file";
642
+ expiresAt: null;
643
+ } | {
644
+ policy: "session_screenshot";
645
+ expiresAt: string;
646
+ };
647
+ retrieval: {
648
+ method: "GET";
649
+ path: string;
650
+ acceptRanges: "bytes";
651
+ maxRangeBytes: number;
652
+ };
653
+ } | null;
654
+ focusedRef: string | null;
655
+ changedRegions: {
656
+ x: number;
657
+ y: number;
658
+ width: number;
659
+ height: number;
660
+ }[];
661
+ diagnostics: {
662
+ consoleErrorCount: number;
663
+ failedRequestCount: number;
664
+ downloadCount: number;
665
+ pageErrorCount: number;
666
+ };
667
+ dialog: {
668
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
669
+ message: string;
670
+ defaultPrompt: string;
671
+ openedAt: string;
672
+ } | null;
673
+ observedAt: string;
674
+ } | null;
675
+ error: {
676
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
677
+ message: string;
678
+ retryable: boolean;
679
+ details?: Record<string, import("zod").JSONType> | undefined;
680
+ } | null;
681
+ }>;
682
+ press(key: string, callOptions?: CodemodeCallOptions): Promise<{
683
+ protocolVersion: 1;
684
+ operationId: string;
685
+ browserSessionId: string;
686
+ controllerGeneration: string;
687
+ targetId: string;
688
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
689
+ dispatchedAt: string | null;
690
+ settledAt: string | null;
691
+ observation: {
692
+ protocolVersion: 1;
693
+ observationId: string;
694
+ browserSessionId: string;
695
+ target: {
696
+ id: string;
697
+ browserSessionId: string;
698
+ controllerGeneration: string;
699
+ targetGeneration: string;
700
+ documentGeneration: string | null;
701
+ kind: "background_page" | "page" | "popup" | "worker";
702
+ title: string;
703
+ url: string;
704
+ selected: boolean;
705
+ attached: boolean;
706
+ createdAt: string;
707
+ };
708
+ frameId: string | null;
709
+ semantic: {
710
+ kind: "snapshot";
711
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
712
+ nodeCount: number;
713
+ } | {
714
+ kind: "diff";
715
+ baseObservationId: string;
716
+ removedRefs: string[];
717
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
718
+ } | null;
719
+ screenshot: {
720
+ available: true;
721
+ artifactId: string;
722
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
723
+ contentType: string;
724
+ originalBytes: number;
725
+ sha256: string;
726
+ retainedAt: string;
727
+ dimensions?: {
728
+ width: number;
729
+ height: number;
730
+ } | undefined;
731
+ retention: {
732
+ policy: "workspace_file";
733
+ expiresAt: null;
734
+ } | {
735
+ policy: "session_screenshot";
736
+ expiresAt: string;
737
+ };
738
+ retrieval: {
739
+ method: "GET";
740
+ path: string;
741
+ acceptRanges: "bytes";
742
+ maxRangeBytes: number;
743
+ };
744
+ } | null;
745
+ focusedRef: string | null;
746
+ changedRegions: {
747
+ x: number;
748
+ y: number;
749
+ width: number;
750
+ height: number;
751
+ }[];
752
+ diagnostics: {
753
+ consoleErrorCount: number;
754
+ failedRequestCount: number;
755
+ downloadCount: number;
756
+ pageErrorCount: number;
757
+ };
758
+ dialog: {
759
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
760
+ message: string;
761
+ defaultPrompt: string;
762
+ openedAt: string;
763
+ } | null;
764
+ observedAt: string;
765
+ } | null;
766
+ error: {
767
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
768
+ message: string;
769
+ retryable: boolean;
770
+ details?: Record<string, import("zod").JSONType> | undefined;
771
+ } | null;
772
+ }>;
773
+ select(values: string[], callOptions?: CodemodeCallOptions): Promise<{
774
+ protocolVersion: 1;
775
+ operationId: string;
776
+ browserSessionId: string;
777
+ controllerGeneration: string;
778
+ targetId: string;
779
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
780
+ dispatchedAt: string | null;
781
+ settledAt: string | null;
782
+ observation: {
783
+ protocolVersion: 1;
784
+ observationId: string;
785
+ browserSessionId: string;
786
+ target: {
787
+ id: string;
788
+ browserSessionId: string;
789
+ controllerGeneration: string;
790
+ targetGeneration: string;
791
+ documentGeneration: string | null;
792
+ kind: "background_page" | "page" | "popup" | "worker";
793
+ title: string;
794
+ url: string;
795
+ selected: boolean;
796
+ attached: boolean;
797
+ createdAt: string;
798
+ };
799
+ frameId: string | null;
800
+ semantic: {
801
+ kind: "snapshot";
802
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
803
+ nodeCount: number;
804
+ } | {
805
+ kind: "diff";
806
+ baseObservationId: string;
807
+ removedRefs: string[];
808
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
809
+ } | null;
810
+ screenshot: {
811
+ available: true;
812
+ artifactId: string;
813
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
814
+ contentType: string;
815
+ originalBytes: number;
816
+ sha256: string;
817
+ retainedAt: string;
818
+ dimensions?: {
819
+ width: number;
820
+ height: number;
821
+ } | undefined;
822
+ retention: {
823
+ policy: "workspace_file";
824
+ expiresAt: null;
825
+ } | {
826
+ policy: "session_screenshot";
827
+ expiresAt: string;
828
+ };
829
+ retrieval: {
830
+ method: "GET";
831
+ path: string;
832
+ acceptRanges: "bytes";
833
+ maxRangeBytes: number;
834
+ };
835
+ } | null;
836
+ focusedRef: string | null;
837
+ changedRegions: {
838
+ x: number;
839
+ y: number;
840
+ width: number;
841
+ height: number;
842
+ }[];
843
+ diagnostics: {
844
+ consoleErrorCount: number;
845
+ failedRequestCount: number;
846
+ downloadCount: number;
847
+ pageErrorCount: number;
848
+ };
849
+ dialog: {
850
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
851
+ message: string;
852
+ defaultPrompt: string;
853
+ openedAt: string;
854
+ } | null;
855
+ observedAt: string;
856
+ } | null;
857
+ error: {
858
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
859
+ message: string;
860
+ retryable: boolean;
861
+ details?: Record<string, import("zod").JSONType> | undefined;
862
+ } | null;
863
+ }>;
864
+ check(checked?: boolean, callOptions?: CodemodeCallOptions): Promise<{
865
+ protocolVersion: 1;
866
+ operationId: string;
867
+ browserSessionId: string;
868
+ controllerGeneration: string;
869
+ targetId: string;
870
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
871
+ dispatchedAt: string | null;
872
+ settledAt: string | null;
873
+ observation: {
874
+ protocolVersion: 1;
875
+ observationId: string;
876
+ browserSessionId: string;
877
+ target: {
878
+ id: string;
879
+ browserSessionId: string;
880
+ controllerGeneration: string;
881
+ targetGeneration: string;
882
+ documentGeneration: string | null;
883
+ kind: "background_page" | "page" | "popup" | "worker";
884
+ title: string;
885
+ url: string;
886
+ selected: boolean;
887
+ attached: boolean;
888
+ createdAt: string;
889
+ };
890
+ frameId: string | null;
891
+ semantic: {
892
+ kind: "snapshot";
893
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
894
+ nodeCount: number;
895
+ } | {
896
+ kind: "diff";
897
+ baseObservationId: string;
898
+ removedRefs: string[];
899
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
900
+ } | null;
901
+ screenshot: {
902
+ available: true;
903
+ artifactId: string;
904
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
905
+ contentType: string;
906
+ originalBytes: number;
907
+ sha256: string;
908
+ retainedAt: string;
909
+ dimensions?: {
910
+ width: number;
911
+ height: number;
912
+ } | undefined;
913
+ retention: {
914
+ policy: "workspace_file";
915
+ expiresAt: null;
916
+ } | {
917
+ policy: "session_screenshot";
918
+ expiresAt: string;
919
+ };
920
+ retrieval: {
921
+ method: "GET";
922
+ path: string;
923
+ acceptRanges: "bytes";
924
+ maxRangeBytes: number;
925
+ };
926
+ } | null;
927
+ focusedRef: string | null;
928
+ changedRegions: {
929
+ x: number;
930
+ y: number;
931
+ width: number;
932
+ height: number;
933
+ }[];
934
+ diagnostics: {
935
+ consoleErrorCount: number;
936
+ failedRequestCount: number;
937
+ downloadCount: number;
938
+ pageErrorCount: number;
939
+ };
940
+ dialog: {
941
+ type: "alert" | "beforeunload" | "confirm" | "prompt";
942
+ message: string;
943
+ defaultPrompt: string;
944
+ openedAt: string;
945
+ } | null;
946
+ observedAt: string;
947
+ } | null;
948
+ error: {
949
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
950
+ message: string;
951
+ retryable: boolean;
952
+ details?: Record<string, import("zod").JSONType> | undefined;
953
+ } | null;
954
+ }>;
955
+ }
956
+ export declare class CodemodeComputerCollection {
957
+ private readonly client;
958
+ constructor(client: CodemodeClientProvider);
959
+ list(options?: {
960
+ includeTerminal?: boolean | undefined;
961
+ }, callOptions?: CodemodeCallOptions): Promise<ComputerSession[]>;
962
+ open(options?: CodemodeComputerOpenOptions, callOptions?: CodemodeCallOptions): Promise<CodemodeComputer>;
963
+ use(computerSessionId: string): CodemodeComputer;
964
+ }
965
+ export declare class CodemodeComputer {
966
+ private readonly client;
967
+ readonly id: string;
968
+ readonly targets: CodemodeComputerTargetCollection;
969
+ readonly apps: CodemodeComputerTargetCollection;
970
+ constructor(client: CodemodeClientProvider, id: string);
971
+ refresh(callOptions?: CodemodeCallOptions): Promise<ComputerSession>;
972
+ observe(targetId?: string, callOptions?: CodemodeCallOptions): Promise<ComputerObservation>;
973
+ act(action: ComputerAction, options?: ComputerActionFences & {
974
+ targetId?: string | undefined;
975
+ }, callOptions?: CodemodeCallOptions): Promise<ComputerActionReceipt>;
976
+ launch(applicationId: string, callOptions?: CodemodeCallOptions): Promise<{
977
+ computerSessionId: string;
978
+ controllerGeneration: string;
979
+ targets: {
980
+ id: string;
981
+ computerSessionId: string;
982
+ controllerGeneration: string;
983
+ targetGeneration: string;
984
+ kind: "app" | "screen" | "window";
985
+ applicationId: string | null;
986
+ processId: number | null;
987
+ title: string;
988
+ bounds: {
989
+ x: number;
990
+ y: number;
991
+ width: number;
992
+ height: number;
993
+ } | null;
994
+ focused: boolean;
995
+ }[];
996
+ }>;
997
+ end(callOptions?: CodemodeCallOptions): Promise<ComputerSessionMutationResponse>;
998
+ }
999
+ export declare class CodemodeComputerTargetCollection {
1000
+ private readonly client;
1001
+ private readonly computerSessionId;
1002
+ constructor(client: CodemodeClientProvider, computerSessionId: string);
1003
+ list(callOptions?: CodemodeCallOptions): Promise<ComputerTargetListResponse>;
1004
+ use(targetId: string): CodemodeComputerTarget;
1005
+ focused(callOptions?: CodemodeCallOptions): Promise<CodemodeComputerTarget>;
1006
+ resolveId(targetId: string | undefined, callOptions: CodemodeCallOptions): Promise<string>;
1007
+ }
1008
+ export declare class CodemodeComputerTarget {
1009
+ private readonly client;
1010
+ readonly computerSessionId: string;
1011
+ readonly id: string;
1012
+ constructor(client: CodemodeClientProvider, computerSessionId: string, id: string);
1013
+ observe(callOptions?: CodemodeCallOptions): Promise<ComputerObservation>;
1014
+ act(action: ComputerAction, fences?: ComputerActionFences, callOptions?: CodemodeCallOptions): Promise<ComputerActionReceipt>;
1015
+ getByRole(role: string, options?: {
1016
+ name?: string;
1017
+ exact?: boolean;
1018
+ }): CodemodeComputerLocator;
1019
+ getByText(text: string, exact?: boolean): CodemodeComputerLocator;
1020
+ getByLabel(text: string, exact?: boolean): CodemodeComputerLocator;
1021
+ getByIdentifier(value: string): CodemodeComputerLocator;
1022
+ ref(ref: string): CodemodeComputerLocator;
1023
+ }
1024
+ export declare class CodemodeComputerLocator {
1025
+ private readonly target;
1026
+ readonly locator: ComputerLocator;
1027
+ constructor(target: CodemodeComputerTarget, locator: ComputerLocator);
1028
+ invoke(callOptions?: CodemodeCallOptions): Promise<{
1029
+ protocolVersion: 1;
1030
+ operationId: string;
1031
+ computerSessionId: string;
1032
+ controllerGeneration: string;
1033
+ targetId: string;
1034
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1035
+ dispatchedAt: string | null;
1036
+ settledAt: string | null;
1037
+ observation: {
1038
+ protocolVersion: 1;
1039
+ observationId: string;
1040
+ computerSessionId: string;
1041
+ target: {
1042
+ id: string;
1043
+ computerSessionId: string;
1044
+ controllerGeneration: string;
1045
+ targetGeneration: string;
1046
+ kind: "app" | "screen" | "window";
1047
+ applicationId: string | null;
1048
+ processId: number | null;
1049
+ title: string;
1050
+ bounds: {
1051
+ x: number;
1052
+ y: number;
1053
+ width: number;
1054
+ height: number;
1055
+ } | null;
1056
+ focused: boolean;
1057
+ };
1058
+ frameId: string | null;
1059
+ semantic: {
1060
+ kind: "snapshot";
1061
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1062
+ nodeCount: number;
1063
+ } | {
1064
+ kind: "diff";
1065
+ baseObservationId: string;
1066
+ removedRefs: string[];
1067
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1068
+ } | null;
1069
+ screenshot: {
1070
+ available: true;
1071
+ artifactId: string;
1072
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1073
+ contentType: string;
1074
+ originalBytes: number;
1075
+ sha256: string;
1076
+ retainedAt: string;
1077
+ dimensions?: {
1078
+ width: number;
1079
+ height: number;
1080
+ } | undefined;
1081
+ retention: {
1082
+ policy: "workspace_file";
1083
+ expiresAt: null;
1084
+ } | {
1085
+ policy: "session_screenshot";
1086
+ expiresAt: string;
1087
+ };
1088
+ retrieval: {
1089
+ method: "GET";
1090
+ path: string;
1091
+ acceptRanges: "bytes";
1092
+ maxRangeBytes: number;
1093
+ };
1094
+ } | null;
1095
+ focusedRef: string | null;
1096
+ changedRegions: {
1097
+ x: number;
1098
+ y: number;
1099
+ width: number;
1100
+ height: number;
1101
+ }[];
1102
+ observedAt: string;
1103
+ } | null;
1104
+ error: {
1105
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1106
+ message: string;
1107
+ retryable: boolean;
1108
+ details?: Record<string, import("zod").JSONType> | undefined;
1109
+ } | null;
1110
+ }>;
1111
+ focus(callOptions?: CodemodeCallOptions): Promise<{
1112
+ protocolVersion: 1;
1113
+ operationId: string;
1114
+ computerSessionId: string;
1115
+ controllerGeneration: string;
1116
+ targetId: string;
1117
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1118
+ dispatchedAt: string | null;
1119
+ settledAt: string | null;
1120
+ observation: {
1121
+ protocolVersion: 1;
1122
+ observationId: string;
1123
+ computerSessionId: string;
1124
+ target: {
1125
+ id: string;
1126
+ computerSessionId: string;
1127
+ controllerGeneration: string;
1128
+ targetGeneration: string;
1129
+ kind: "app" | "screen" | "window";
1130
+ applicationId: string | null;
1131
+ processId: number | null;
1132
+ title: string;
1133
+ bounds: {
1134
+ x: number;
1135
+ y: number;
1136
+ width: number;
1137
+ height: number;
1138
+ } | null;
1139
+ focused: boolean;
1140
+ };
1141
+ frameId: string | null;
1142
+ semantic: {
1143
+ kind: "snapshot";
1144
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1145
+ nodeCount: number;
1146
+ } | {
1147
+ kind: "diff";
1148
+ baseObservationId: string;
1149
+ removedRefs: string[];
1150
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1151
+ } | null;
1152
+ screenshot: {
1153
+ available: true;
1154
+ artifactId: string;
1155
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1156
+ contentType: string;
1157
+ originalBytes: number;
1158
+ sha256: string;
1159
+ retainedAt: string;
1160
+ dimensions?: {
1161
+ width: number;
1162
+ height: number;
1163
+ } | undefined;
1164
+ retention: {
1165
+ policy: "workspace_file";
1166
+ expiresAt: null;
1167
+ } | {
1168
+ policy: "session_screenshot";
1169
+ expiresAt: string;
1170
+ };
1171
+ retrieval: {
1172
+ method: "GET";
1173
+ path: string;
1174
+ acceptRanges: "bytes";
1175
+ maxRangeBytes: number;
1176
+ };
1177
+ } | null;
1178
+ focusedRef: string | null;
1179
+ changedRegions: {
1180
+ x: number;
1181
+ y: number;
1182
+ width: number;
1183
+ height: number;
1184
+ }[];
1185
+ observedAt: string;
1186
+ } | null;
1187
+ error: {
1188
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1189
+ message: string;
1190
+ retryable: boolean;
1191
+ details?: Record<string, import("zod").JSONType> | undefined;
1192
+ } | null;
1193
+ }>;
1194
+ setValue(value: string | number | boolean, callOptions?: CodemodeCallOptions): Promise<{
1195
+ protocolVersion: 1;
1196
+ operationId: string;
1197
+ computerSessionId: string;
1198
+ controllerGeneration: string;
1199
+ targetId: string;
1200
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1201
+ dispatchedAt: string | null;
1202
+ settledAt: string | null;
1203
+ observation: {
1204
+ protocolVersion: 1;
1205
+ observationId: string;
1206
+ computerSessionId: string;
1207
+ target: {
1208
+ id: string;
1209
+ computerSessionId: string;
1210
+ controllerGeneration: string;
1211
+ targetGeneration: string;
1212
+ kind: "app" | "screen" | "window";
1213
+ applicationId: string | null;
1214
+ processId: number | null;
1215
+ title: string;
1216
+ bounds: {
1217
+ x: number;
1218
+ y: number;
1219
+ width: number;
1220
+ height: number;
1221
+ } | null;
1222
+ focused: boolean;
1223
+ };
1224
+ frameId: string | null;
1225
+ semantic: {
1226
+ kind: "snapshot";
1227
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1228
+ nodeCount: number;
1229
+ } | {
1230
+ kind: "diff";
1231
+ baseObservationId: string;
1232
+ removedRefs: string[];
1233
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1234
+ } | null;
1235
+ screenshot: {
1236
+ available: true;
1237
+ artifactId: string;
1238
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1239
+ contentType: string;
1240
+ originalBytes: number;
1241
+ sha256: string;
1242
+ retainedAt: string;
1243
+ dimensions?: {
1244
+ width: number;
1245
+ height: number;
1246
+ } | undefined;
1247
+ retention: {
1248
+ policy: "workspace_file";
1249
+ expiresAt: null;
1250
+ } | {
1251
+ policy: "session_screenshot";
1252
+ expiresAt: string;
1253
+ };
1254
+ retrieval: {
1255
+ method: "GET";
1256
+ path: string;
1257
+ acceptRanges: "bytes";
1258
+ maxRangeBytes: number;
1259
+ };
1260
+ } | null;
1261
+ focusedRef: string | null;
1262
+ changedRegions: {
1263
+ x: number;
1264
+ y: number;
1265
+ width: number;
1266
+ height: number;
1267
+ }[];
1268
+ observedAt: string;
1269
+ } | null;
1270
+ error: {
1271
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1272
+ message: string;
1273
+ retryable: boolean;
1274
+ details?: Record<string, import("zod").JSONType> | undefined;
1275
+ } | null;
1276
+ }>;
1277
+ select(callOptions?: CodemodeCallOptions): Promise<{
1278
+ protocolVersion: 1;
1279
+ operationId: string;
1280
+ computerSessionId: string;
1281
+ controllerGeneration: string;
1282
+ targetId: string;
1283
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1284
+ dispatchedAt: string | null;
1285
+ settledAt: string | null;
1286
+ observation: {
1287
+ protocolVersion: 1;
1288
+ observationId: string;
1289
+ computerSessionId: string;
1290
+ target: {
1291
+ id: string;
1292
+ computerSessionId: string;
1293
+ controllerGeneration: string;
1294
+ targetGeneration: string;
1295
+ kind: "app" | "screen" | "window";
1296
+ applicationId: string | null;
1297
+ processId: number | null;
1298
+ title: string;
1299
+ bounds: {
1300
+ x: number;
1301
+ y: number;
1302
+ width: number;
1303
+ height: number;
1304
+ } | null;
1305
+ focused: boolean;
1306
+ };
1307
+ frameId: string | null;
1308
+ semantic: {
1309
+ kind: "snapshot";
1310
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1311
+ nodeCount: number;
1312
+ } | {
1313
+ kind: "diff";
1314
+ baseObservationId: string;
1315
+ removedRefs: string[];
1316
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1317
+ } | null;
1318
+ screenshot: {
1319
+ available: true;
1320
+ artifactId: string;
1321
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1322
+ contentType: string;
1323
+ originalBytes: number;
1324
+ sha256: string;
1325
+ retainedAt: string;
1326
+ dimensions?: {
1327
+ width: number;
1328
+ height: number;
1329
+ } | undefined;
1330
+ retention: {
1331
+ policy: "workspace_file";
1332
+ expiresAt: null;
1333
+ } | {
1334
+ policy: "session_screenshot";
1335
+ expiresAt: string;
1336
+ };
1337
+ retrieval: {
1338
+ method: "GET";
1339
+ path: string;
1340
+ acceptRanges: "bytes";
1341
+ maxRangeBytes: number;
1342
+ };
1343
+ } | null;
1344
+ focusedRef: string | null;
1345
+ changedRegions: {
1346
+ x: number;
1347
+ y: number;
1348
+ width: number;
1349
+ height: number;
1350
+ }[];
1351
+ observedAt: string;
1352
+ } | null;
1353
+ error: {
1354
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1355
+ message: string;
1356
+ retryable: boolean;
1357
+ details?: Record<string, import("zod").JSONType> | undefined;
1358
+ } | null;
1359
+ }>;
1360
+ expand(callOptions?: CodemodeCallOptions): Promise<{
1361
+ protocolVersion: 1;
1362
+ operationId: string;
1363
+ computerSessionId: string;
1364
+ controllerGeneration: string;
1365
+ targetId: string;
1366
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1367
+ dispatchedAt: string | null;
1368
+ settledAt: string | null;
1369
+ observation: {
1370
+ protocolVersion: 1;
1371
+ observationId: string;
1372
+ computerSessionId: string;
1373
+ target: {
1374
+ id: string;
1375
+ computerSessionId: string;
1376
+ controllerGeneration: string;
1377
+ targetGeneration: string;
1378
+ kind: "app" | "screen" | "window";
1379
+ applicationId: string | null;
1380
+ processId: number | null;
1381
+ title: string;
1382
+ bounds: {
1383
+ x: number;
1384
+ y: number;
1385
+ width: number;
1386
+ height: number;
1387
+ } | null;
1388
+ focused: boolean;
1389
+ };
1390
+ frameId: string | null;
1391
+ semantic: {
1392
+ kind: "snapshot";
1393
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1394
+ nodeCount: number;
1395
+ } | {
1396
+ kind: "diff";
1397
+ baseObservationId: string;
1398
+ removedRefs: string[];
1399
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1400
+ } | null;
1401
+ screenshot: {
1402
+ available: true;
1403
+ artifactId: string;
1404
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1405
+ contentType: string;
1406
+ originalBytes: number;
1407
+ sha256: string;
1408
+ retainedAt: string;
1409
+ dimensions?: {
1410
+ width: number;
1411
+ height: number;
1412
+ } | undefined;
1413
+ retention: {
1414
+ policy: "workspace_file";
1415
+ expiresAt: null;
1416
+ } | {
1417
+ policy: "session_screenshot";
1418
+ expiresAt: string;
1419
+ };
1420
+ retrieval: {
1421
+ method: "GET";
1422
+ path: string;
1423
+ acceptRanges: "bytes";
1424
+ maxRangeBytes: number;
1425
+ };
1426
+ } | null;
1427
+ focusedRef: string | null;
1428
+ changedRegions: {
1429
+ x: number;
1430
+ y: number;
1431
+ width: number;
1432
+ height: number;
1433
+ }[];
1434
+ observedAt: string;
1435
+ } | null;
1436
+ error: {
1437
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1438
+ message: string;
1439
+ retryable: boolean;
1440
+ details?: Record<string, import("zod").JSONType> | undefined;
1441
+ } | null;
1442
+ }>;
1443
+ collapse(callOptions?: CodemodeCallOptions): Promise<{
1444
+ protocolVersion: 1;
1445
+ operationId: string;
1446
+ computerSessionId: string;
1447
+ controllerGeneration: string;
1448
+ targetId: string;
1449
+ state: "completed" | "dispatched" | "failed" | "outcome_unknown" | "prepared";
1450
+ dispatchedAt: string | null;
1451
+ settledAt: string | null;
1452
+ observation: {
1453
+ protocolVersion: 1;
1454
+ observationId: string;
1455
+ computerSessionId: string;
1456
+ target: {
1457
+ id: string;
1458
+ computerSessionId: string;
1459
+ controllerGeneration: string;
1460
+ targetGeneration: string;
1461
+ kind: "app" | "screen" | "window";
1462
+ applicationId: string | null;
1463
+ processId: number | null;
1464
+ title: string;
1465
+ bounds: {
1466
+ x: number;
1467
+ y: number;
1468
+ width: number;
1469
+ height: number;
1470
+ } | null;
1471
+ focused: boolean;
1472
+ };
1473
+ frameId: string | null;
1474
+ semantic: {
1475
+ kind: "snapshot";
1476
+ roots: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1477
+ nodeCount: number;
1478
+ } | {
1479
+ kind: "diff";
1480
+ baseObservationId: string;
1481
+ removedRefs: string[];
1482
+ changed: import("@opengeni/contracts").InteractionSemanticNodeValue[];
1483
+ } | null;
1484
+ screenshot: {
1485
+ available: true;
1486
+ artifactId: string;
1487
+ kind: "assistant_completion" | "computer_screenshot" | "event_media" | "file" | "generated_image" | "generated_video" | "internal_update" | "tool_result";
1488
+ contentType: string;
1489
+ originalBytes: number;
1490
+ sha256: string;
1491
+ retainedAt: string;
1492
+ dimensions?: {
1493
+ width: number;
1494
+ height: number;
1495
+ } | undefined;
1496
+ retention: {
1497
+ policy: "workspace_file";
1498
+ expiresAt: null;
1499
+ } | {
1500
+ policy: "session_screenshot";
1501
+ expiresAt: string;
1502
+ };
1503
+ retrieval: {
1504
+ method: "GET";
1505
+ path: string;
1506
+ acceptRanges: "bytes";
1507
+ maxRangeBytes: number;
1508
+ };
1509
+ } | null;
1510
+ focusedRef: string | null;
1511
+ changedRegions: {
1512
+ x: number;
1513
+ y: number;
1514
+ width: number;
1515
+ height: number;
1516
+ }[];
1517
+ observedAt: string;
1518
+ } | null;
1519
+ error: {
1520
+ code: "attempt_stale" | "controller_lost" | "controller_stale" | "document_stale" | "driver_failed" | "frame_stale" | "invalid_action" | "locator_ambiguous" | "locator_not_found" | "machine_locked" | "observation_stale" | "operation_conflict" | "outcome_unknown" | "permission_denied" | "resource_not_found" | "resource_unavailable" | "target_not_found" | "target_stale" | "timeout" | "unsupported";
1521
+ message: string;
1522
+ retryable: boolean;
1523
+ details?: Record<string, import("zod").JSONType> | undefined;
1524
+ } | null;
1525
+ }>;
1526
+ private semantic;
1527
+ }
1528
+ export declare function createOpenGeniCodemode(client?: CodemodeClient | CodemodeClientProvider): OpenGeniCodemode;
1529
+ export declare const openGeni: OpenGeniCodemode;