@allwright.dev/core 0.0.53 → 0.0.54

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.
package/dist/bootstrap.js CHANGED
@@ -12,7 +12,7 @@ const ALLWRIGHT_HOME_ENV_VAR = "ALLWRIGHT_HOME";
12
12
  const ALLWRIGHT_REPOSITORY_ENV_VAR = "ALLWRIGHT_REPOSITORY";
13
13
  const ALLWRIGHT_VERSION_ENV_VAR = "ALLWRIGHT_VERSION";
14
14
  const DEFAULT_RELEASE_REPOSITORY = "allwright-dev/allwright";
15
- const DEFAULT_RELEASE_VERSION = "0.0.53";
15
+ const DEFAULT_RELEASE_VERSION = "0.0.54";
16
16
  const STARTUP_TIMEOUT_MS = 20_000;
17
17
  const PING_TIMEOUT_MS = 1_000;
18
18
  const PROTO_ROOT = fileURLToPath(new URL("../proto/", import.meta.url));
package/dist/browser.js CHANGED
@@ -77,6 +77,9 @@ export class BrowserImpl {
77
77
  const event = await this.#queue.next();
78
78
  if (event.closed) {
79
79
  this.#closed = true;
80
+ for (const page of this.#pages.values()) {
81
+ page.dispose();
82
+ }
80
83
  this.#stream.end();
81
84
  return;
82
85
  }
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { PageImpl } from "./page.js";
5
5
  import { setServerAddr, shutdown } from "./runtime.js";
6
6
  import type { Browser, BrowserKind, BrowserType, LaunchOptions, Page, ResolveConfigOptions, ResolvedAllwrightConfig } from "./types.js";
7
7
  export { findConfigFile, loadConfigFile, resolveConfig, setServerAddr, shutdown };
8
- export type { AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, Locator, LocatorInfo, MobileSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
8
+ export type { AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, Locator, LocatorInfo, MobileSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
9
9
  export declare const chromium: BrowserType;
10
10
  export declare const firefox: BrowserType;
11
11
  export { mobile };
package/dist/mobile.js CHANGED
@@ -75,6 +75,33 @@ class MobileAndroidAppImpl {
75
75
  }
76
76
  }
77
77
  }
78
+ async screenshot(options = {}) {
79
+ const handle = await this.#getHandle();
80
+ this.#ensureOpen(handle);
81
+ handle.stream.write({
82
+ surfaceSessionId: this.#surfaceSessionId,
83
+ contextSessionId: this.sessionId,
84
+ screenshot: {
85
+ retryOptions: retryOptions(options.timeoutMs),
86
+ },
87
+ });
88
+ while (true) {
89
+ const event = await handle.queue.next();
90
+ if (event.screenshotCaptured?.pngData) {
91
+ return {
92
+ pngData: event.screenshotCaptured.pngData,
93
+ note: event.screenshotCaptured.note ?? "",
94
+ };
95
+ }
96
+ if (event.error?.message) {
97
+ throw new Error(event.error.message);
98
+ }
99
+ if (event.closed) {
100
+ handle.closed = true;
101
+ throw new Error(`android app session ${this.sessionId} closed while capturing screenshot`);
102
+ }
103
+ }
104
+ }
78
105
  async #getHandle() {
79
106
  if (!this.#handlePromise) {
80
107
  this.#handlePromise = createPageHandle(this.#runtime);
package/dist/page.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, Locator, NavigateResult, Page, PageInfo, PressOptions, PressResult, RuntimeClient, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
1
+ import type { ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, Locator, NavigateResult, Page, PageInfo, PressOptions, PressResult, RuntimeClient, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
2
2
  export declare class PageImpl implements Page {
3
3
  #private;
4
4
  constructor(input: PageInfo & {
@@ -18,8 +18,10 @@ export declare class PageImpl implements Page {
18
18
  textContent(selector: string, options?: CommandOptions): Promise<TextResult>;
19
19
  innerText(selector: string, options?: CommandOptions): Promise<TextResult>;
20
20
  waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
21
+ screenshot(options?: CommandOptions): Promise<ScreenshotResult>;
21
22
  close(): Promise<void>;
22
23
  ping(message?: string): Promise<string>;
23
24
  pageInfo(): PageInfo;
24
25
  navigate(url: string, options?: CommandOptions): Promise<NavigateResult>;
26
+ dispose(): void;
25
27
  }
package/dist/page.js CHANGED
@@ -304,6 +304,33 @@ export class PageImpl {
304
304
  }
305
305
  }
306
306
  }
307
+ async screenshot(options = {}) {
308
+ const handle = await this.#getHandle();
309
+ this.#ensureOpen(handle);
310
+ handle.stream.write({
311
+ surfaceSessionId: this.browserSessionId,
312
+ contextSessionId: this.sessionId,
313
+ screenshot: {
314
+ retryOptions: options.timeoutMs ? { timeoutMs: options.timeoutMs } : undefined,
315
+ },
316
+ });
317
+ while (true) {
318
+ const event = await handle.queue.next();
319
+ if (event.screenshotCaptured?.pngData) {
320
+ return {
321
+ pngData: event.screenshotCaptured.pngData,
322
+ note: event.screenshotCaptured.note ?? "",
323
+ };
324
+ }
325
+ if (event.error?.message) {
326
+ throw formatActionError("screenshot", event.error.message);
327
+ }
328
+ if (event.closed) {
329
+ handle.closed = true;
330
+ throw new Error(`page session ${this.sessionId} closed while waiting for screenshot`);
331
+ }
332
+ }
333
+ }
307
334
  async close() {
308
335
  const handle = await this.#getHandle();
309
336
  if (handle.closed) {
@@ -318,7 +345,7 @@ export class PageImpl {
318
345
  const event = await handle.queue.next();
319
346
  if (event.closed) {
320
347
  handle.closed = true;
321
- handle.stream.end();
348
+ this.dispose();
322
349
  return;
323
350
  }
324
351
  if (event.error?.message) {
@@ -416,4 +443,28 @@ export class PageImpl {
416
443
  }
417
444
  return this.#handlePromise;
418
445
  }
446
+ dispose() {
447
+ const handlePromise = this.#handlePromise;
448
+ if (!handlePromise) {
449
+ return;
450
+ }
451
+ void handlePromise.then((handle) => {
452
+ if (handle.closed) {
453
+ return;
454
+ }
455
+ handle.closed = true;
456
+ try {
457
+ handle.stream.end();
458
+ }
459
+ catch {
460
+ // Best-effort local teardown during page disposal.
461
+ }
462
+ try {
463
+ handle.stream.cancel();
464
+ }
465
+ catch {
466
+ // grpc-js may reject cancel/end ordering depending on stream state.
467
+ }
468
+ });
469
+ }
419
470
  }
package/dist/runtime.js CHANGED
@@ -20,6 +20,10 @@ export async function shutdown() {
20
20
  return;
21
21
  }
22
22
  const runtime = await runtimePromise;
23
+ for (const stream of runtime.openStreams ?? []) {
24
+ closeTrackedStream(stream);
25
+ runtime.unregisterStream(stream);
26
+ }
23
27
  runtime.client.close();
24
28
  runtimePromise = null;
25
29
  await shutdownManagedServer();
@@ -44,6 +48,11 @@ export async function getRuntime() {
44
48
  }
45
49
  export async function createPageHandle(runtime) {
46
50
  const stream = runtime.client.ContextSession();
51
+ runtime.registerStream(stream);
52
+ const unregister = () => runtime.unregisterStream(stream);
53
+ stream.on("close", unregister);
54
+ stream.on("end", unregister);
55
+ stream.on("error", unregister);
47
56
  const queue = bindStreamQueue(stream);
48
57
  return {
49
58
  stream,
@@ -53,6 +62,11 @@ export async function createPageHandle(runtime) {
53
62
  }
54
63
  export async function createBrowserSessionHandle(runtime) {
55
64
  const stream = runtime.client.SurfaceSession();
65
+ runtime.registerStream(stream);
66
+ const unregister = () => runtime.unregisterStream(stream);
67
+ stream.on("close", unregister);
68
+ stream.on("end", unregister);
69
+ stream.on("error", unregister);
56
70
  const queue = bindStreamQueue(stream);
57
71
  return { stream, queue };
58
72
  }
@@ -93,7 +107,17 @@ async function createRuntime() {
93
107
  const proto = grpc.loadPackageDefinition(loaded);
94
108
  const ClientCtor = proto.allwright.engine.v1.EngineService;
95
109
  const client = new ClientCtor(resolvedServerAddr, grpc.credentials.createInsecure());
96
- return { client };
110
+ const openStreams = new Set();
111
+ return {
112
+ client,
113
+ openStreams,
114
+ registerStream(stream) {
115
+ openStreams.add(stream);
116
+ },
117
+ unregisterStream(stream) {
118
+ openStreams.delete(stream);
119
+ },
120
+ };
97
121
  }
98
122
  function configuredServerAddr() {
99
123
  if (serverAddrOverride) {
@@ -114,3 +138,17 @@ function bindStreamQueue(stream) {
114
138
  });
115
139
  return queue;
116
140
  }
141
+ function closeTrackedStream(stream) {
142
+ try {
143
+ stream.end();
144
+ }
145
+ catch {
146
+ // Some grpc-js stream states reject end() during teardown; keep going.
147
+ }
148
+ try {
149
+ stream.cancel();
150
+ }
151
+ catch {
152
+ // Best-effort shutdown so dangling streams do not keep the process alive.
153
+ }
154
+ }
package/dist/types.d.ts CHANGED
@@ -67,6 +67,10 @@ export interface WaitForSelectorResult {
67
67
  visible: boolean;
68
68
  note: string;
69
69
  }
70
+ export interface ScreenshotResult {
71
+ pngData: Uint8Array;
72
+ note: string;
73
+ }
70
74
  export interface BrowserInfo {
71
75
  sessionId: string;
72
76
  browserName: string;
@@ -110,6 +114,7 @@ export interface Page extends PageInfo {
110
114
  textContent(selector: string, options?: CommandOptions): Promise<TextResult>;
111
115
  innerText(selector: string, options?: CommandOptions): Promise<TextResult>;
112
116
  waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
117
+ screenshot(options?: CommandOptions): Promise<ScreenshotResult>;
113
118
  close(): Promise<void>;
114
119
  ping(message?: string): Promise<string>;
115
120
  pageInfo(): PageInfo;
@@ -139,6 +144,7 @@ export interface MobileAndroidApp {
139
144
  locator(selector: string): MobileAndroidLocator;
140
145
  click(selector: string, options?: CommandOptions): Promise<ClickResult>;
141
146
  fill(selector: string, value: string, options?: CommandOptions): Promise<FillResult>;
147
+ screenshot(options?: CommandOptions): Promise<ScreenshotResult>;
142
148
  }
143
149
  export interface MobileAndroidDevice {
144
150
  readonly sessionId: string;
@@ -388,6 +394,10 @@ export interface ContextSessionEvent {
388
394
  visible?: boolean;
389
395
  note?: string;
390
396
  };
397
+ screenshotCaptured?: {
398
+ pngData?: Uint8Array;
399
+ note?: string;
400
+ };
391
401
  }
392
402
  export interface LaunchChromeRequest {
393
403
  launchChrome: {
@@ -565,13 +575,22 @@ export interface WaitForSelectorRequest {
565
575
  };
566
576
  };
567
577
  }
578
+ export interface ScreenshotRequest {
579
+ surfaceSessionId: string;
580
+ contextSessionId: string;
581
+ screenshot: {
582
+ retryOptions?: {
583
+ timeoutMs?: number;
584
+ };
585
+ };
586
+ }
568
587
  export interface CloseContextRequest {
569
588
  surfaceSessionId: string;
570
589
  contextSessionId: string;
571
590
  close: Record<string, never>;
572
591
  }
573
592
  export type SurfaceSessionRequest = LaunchBrowserRequest | LaunchChromeRequest | OpenContextRequest | ConnectMobileRequest | LaunchAppRequest | SurfacePingRequest | CloseSurfaceRequest;
574
- export type ContextSessionRequest = ContextPingRequest | NavigateRequest | ClickRequest | CountRequest | HighlightRequest | FocusRequest | FillRequest | HoverRequest | PressRequest | TextContentRequest | InnerTextRequest | WaitForSelectorRequest | CloseContextRequest;
593
+ export type ContextSessionRequest = ContextPingRequest | NavigateRequest | ClickRequest | CountRequest | HighlightRequest | FocusRequest | FillRequest | HoverRequest | PressRequest | TextContentRequest | InnerTextRequest | WaitForSelectorRequest | ScreenshotRequest | CloseContextRequest;
575
594
  export type SurfaceSessionStream = grpc.ClientDuplexStream<SurfaceSessionRequest, SurfaceSessionEvent>;
576
595
  export type ContextSessionStream = grpc.ClientDuplexStream<ContextSessionRequest, ContextSessionEvent>;
577
596
  export interface EngineServiceClientShape {
@@ -591,6 +610,9 @@ export interface EngineProtoRoot {
591
610
  }
592
611
  export interface RuntimeClient {
593
612
  client: EngineServiceClientShape;
613
+ openStreams: Set<SurfaceSessionStream | ContextSessionStream>;
614
+ registerStream(stream: SurfaceSessionStream | ContextSessionStream): void;
615
+ unregisterStream(stream: SurfaceSessionStream | ContextSessionStream): void;
594
616
  }
595
617
  export interface BrowserLaunchState {
596
618
  runtime: RuntimeClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allwright.dev/core",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "High-level TypeScript client for the allwright automation engine.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,214 @@
1
+ syntax = "proto3";
2
+
3
+ package allwright.engine.v1;
4
+ option go_package = "allwright.dev/gen/allwright/engine/v1;enginev1";
5
+
6
+ import "core/v1/common.proto";
7
+
8
+ message ContextSessionCommand {
9
+ string surface_session_id = 1;
10
+ string context_session_id = 2;
11
+
12
+ oneof command {
13
+ ContextSessionPingCommand ping = 3;
14
+ CloseContextSessionCommand close = 4;
15
+ NavigatePageCommand navigate = 5;
16
+ ClickElementCommand click_element = 6;
17
+ CountElementsCommand count_elements = 7;
18
+ HighlightElementsCommand highlight_elements = 8;
19
+ FocusElementCommand focus_element = 9;
20
+ FillElementCommand fill_element = 10;
21
+ HoverElementCommand hover_element = 11;
22
+ PressKeyCommand press_key = 12;
23
+ GetTextContentCommand get_text_content = 13;
24
+ GetInnerTextCommand get_inner_text = 14;
25
+ WaitForSelectorCommand wait_for_selector = 15;
26
+ ScreenshotCommand screenshot = 16;
27
+ }
28
+ }
29
+
30
+ message ContextSessionPingCommand {
31
+ string message = 1;
32
+ }
33
+
34
+ message CloseContextSessionCommand {}
35
+
36
+ message ContextSessionEvent {
37
+ string context_session_id = 1;
38
+
39
+ oneof event {
40
+ ContextSessionAttachedEvent attached = 2;
41
+ ContextSessionPongEvent pong = 3;
42
+ ContextSessionClosedEvent closed = 4;
43
+ ContextSessionErrorEvent error = 5;
44
+ PageNavigatedEvent navigated = 6;
45
+ ChromiumBidiInjectionEvent chromium_bidi_injection = 7;
46
+ ElementClickedEvent element_clicked = 8;
47
+ ElementCountedEvent element_counted = 9;
48
+ ElementsHighlightedEvent elements_highlighted = 10;
49
+ ElementFocusedEvent element_focused = 11;
50
+ ElementFilledEvent element_filled = 12;
51
+ ElementHoveredEvent element_hovered = 13;
52
+ KeyPressedEvent key_pressed = 14;
53
+ TextContentResolvedEvent text_content_resolved = 15;
54
+ InnerTextResolvedEvent inner_text_resolved = 16;
55
+ SelectorWaitSatisfiedEvent selector_wait_satisfied = 17;
56
+ ScreenshotCapturedEvent screenshot_captured = 18;
57
+ }
58
+ }
59
+
60
+ message ContextSessionAttachedEvent {
61
+ string note = 1;
62
+ }
63
+
64
+ message ContextSessionPongEvent {
65
+ string message = 1;
66
+ }
67
+
68
+ message ContextSessionClosedEvent {
69
+ string reason = 1;
70
+ }
71
+
72
+ message ContextSessionErrorEvent {
73
+ string message = 1;
74
+ }
75
+
76
+ message NavigatePageCommand {
77
+ string url = 1;
78
+ optional CommandRetryOptions retry_options = 2;
79
+ }
80
+
81
+ message ClickElementCommand {
82
+ string css_selector = 1;
83
+ optional CommandRetryOptions retry_options = 2;
84
+ }
85
+
86
+ message CountElementsCommand {
87
+ string css_selector = 1;
88
+ optional CommandRetryOptions retry_options = 2;
89
+ }
90
+
91
+ message HighlightElementsCommand {
92
+ string css_selector = 1;
93
+ optional uint32 duration_ms = 2;
94
+ optional CommandRetryOptions retry_options = 3;
95
+ }
96
+
97
+ message FocusElementCommand {
98
+ string css_selector = 1;
99
+ optional CommandRetryOptions retry_options = 2;
100
+ }
101
+
102
+ message FillElementCommand {
103
+ string css_selector = 1;
104
+ string value = 2;
105
+ optional CommandRetryOptions retry_options = 3;
106
+ }
107
+
108
+ message HoverElementCommand {
109
+ string css_selector = 1;
110
+ optional CommandRetryOptions retry_options = 2;
111
+ }
112
+
113
+ message PressKeyCommand {
114
+ string css_selector = 1;
115
+ string key = 2;
116
+ optional string text = 3;
117
+ optional CommandRetryOptions retry_options = 4;
118
+ }
119
+
120
+ message GetTextContentCommand {
121
+ string css_selector = 1;
122
+ optional CommandRetryOptions retry_options = 2;
123
+ }
124
+
125
+ message GetInnerTextCommand {
126
+ string css_selector = 1;
127
+ optional CommandRetryOptions retry_options = 2;
128
+ }
129
+
130
+ message WaitForSelectorCommand {
131
+ string css_selector = 1;
132
+ optional bool visible = 2;
133
+ optional CommandRetryOptions retry_options = 3;
134
+ }
135
+
136
+ message ScreenshotCommand {
137
+ optional CommandRetryOptions retry_options = 1;
138
+ }
139
+
140
+ message PageNavigatedEvent {
141
+ string url = 1;
142
+ string note = 2;
143
+ }
144
+
145
+ message ChromiumBidiInjectionEvent {
146
+ string note = 1;
147
+ string bidi_session_id = 2;
148
+ string mapper_target_id = 3;
149
+ string mapper_session_id = 4;
150
+ string package_version = 5;
151
+ }
152
+
153
+ message ElementClickedEvent {
154
+ string css_selector = 1;
155
+ string note = 2;
156
+ string bidi_session_id = 3;
157
+ }
158
+
159
+ message ElementCountedEvent {
160
+ string css_selector = 1;
161
+ uint32 count = 2;
162
+ string note = 3;
163
+ }
164
+
165
+ message ElementsHighlightedEvent {
166
+ string css_selector = 1;
167
+ uint32 count = 2;
168
+ string note = 3;
169
+ }
170
+
171
+ message ElementFocusedEvent {
172
+ string css_selector = 1;
173
+ string note = 2;
174
+ }
175
+
176
+ message ElementFilledEvent {
177
+ string css_selector = 1;
178
+ string value = 2;
179
+ string note = 3;
180
+ }
181
+
182
+ message ElementHoveredEvent {
183
+ string css_selector = 1;
184
+ string note = 2;
185
+ }
186
+
187
+ message KeyPressedEvent {
188
+ string css_selector = 1;
189
+ string key = 2;
190
+ string note = 3;
191
+ }
192
+
193
+ message TextContentResolvedEvent {
194
+ string css_selector = 1;
195
+ string text = 2;
196
+ string note = 3;
197
+ }
198
+
199
+ message InnerTextResolvedEvent {
200
+ string css_selector = 1;
201
+ string text = 2;
202
+ string note = 3;
203
+ }
204
+
205
+ message SelectorWaitSatisfiedEvent {
206
+ string css_selector = 1;
207
+ bool visible = 2;
208
+ string note = 3;
209
+ }
210
+
211
+ message ScreenshotCapturedEvent {
212
+ bytes png_data = 1;
213
+ string note = 2;
214
+ }
@@ -3,9 +3,9 @@ syntax = "proto3";
3
3
  package allwright.engine.v1;
4
4
  option go_package = "allwright.dev/gen/allwright/engine/v1;enginev1";
5
5
 
6
- import "core/v1/browser.proto";
6
+ import "core/v1/surface.proto";
7
7
  import "core/v1/common.proto";
8
- import "core/v1/tab.proto";
8
+ import "core/v1/context.proto";
9
9
 
10
10
  service EngineService {
11
11
  rpc Ping(PingRequest) returns (PingResponse);
@@ -37,134 +37,3 @@ message ChromeLaunchedEvent {
37
37
  string user_data_dir = 4;
38
38
  string initial_page_session_id = 5;
39
39
  }
40
-
41
- message NavigatePageCommand {
42
- string url = 1;
43
- optional CommandRetryOptions retry_options = 2;
44
- }
45
-
46
- message ClickElementCommand {
47
- string css_selector = 1;
48
- optional CommandRetryOptions retry_options = 2;
49
- }
50
-
51
- message CountElementsCommand {
52
- string css_selector = 1;
53
- optional CommandRetryOptions retry_options = 2;
54
- }
55
-
56
- message HighlightElementsCommand {
57
- string css_selector = 1;
58
- optional uint32 duration_ms = 2;
59
- optional CommandRetryOptions retry_options = 3;
60
- }
61
-
62
- message FocusElementCommand {
63
- string css_selector = 1;
64
- optional CommandRetryOptions retry_options = 2;
65
- }
66
-
67
- message FillElementCommand {
68
- string css_selector = 1;
69
- string value = 2;
70
- optional CommandRetryOptions retry_options = 3;
71
- }
72
-
73
- message HoverElementCommand {
74
- string css_selector = 1;
75
- optional CommandRetryOptions retry_options = 2;
76
- }
77
-
78
- message PressKeyCommand {
79
- string css_selector = 1;
80
- string key = 2;
81
- optional string text = 3;
82
- optional CommandRetryOptions retry_options = 4;
83
- }
84
-
85
- message GetTextContentCommand {
86
- string css_selector = 1;
87
- optional CommandRetryOptions retry_options = 2;
88
- }
89
-
90
- message GetInnerTextCommand {
91
- string css_selector = 1;
92
- optional CommandRetryOptions retry_options = 2;
93
- }
94
-
95
- message WaitForSelectorCommand {
96
- string css_selector = 1;
97
- optional bool visible = 2;
98
- optional CommandRetryOptions retry_options = 3;
99
- }
100
-
101
- message PageNavigatedEvent {
102
- string url = 1;
103
- string note = 2;
104
- }
105
-
106
- message ChromiumBidiInjectionEvent {
107
- string note = 1;
108
- string bidi_session_id = 2;
109
- string mapper_target_id = 3;
110
- string mapper_session_id = 4;
111
- string package_version = 5;
112
- }
113
-
114
- message ElementClickedEvent {
115
- string css_selector = 1;
116
- string note = 2;
117
- string bidi_session_id = 3;
118
- }
119
-
120
- message ElementCountedEvent {
121
- string css_selector = 1;
122
- uint32 count = 2;
123
- string note = 3;
124
- }
125
-
126
- message ElementsHighlightedEvent {
127
- string css_selector = 1;
128
- uint32 count = 2;
129
- string note = 3;
130
- }
131
-
132
- message ElementFocusedEvent {
133
- string css_selector = 1;
134
- string note = 2;
135
- }
136
-
137
- message ElementFilledEvent {
138
- string css_selector = 1;
139
- string value = 2;
140
- string note = 3;
141
- }
142
-
143
- message ElementHoveredEvent {
144
- string css_selector = 1;
145
- string note = 2;
146
- }
147
-
148
- message KeyPressedEvent {
149
- string css_selector = 1;
150
- string key = 2;
151
- string note = 3;
152
- }
153
-
154
- message TextContentResolvedEvent {
155
- string css_selector = 1;
156
- string text = 2;
157
- string note = 3;
158
- }
159
-
160
- message InnerTextResolvedEvent {
161
- string css_selector = 1;
162
- string text = 2;
163
- string note = 3;
164
- }
165
-
166
- message SelectorWaitSatisfiedEvent {
167
- string css_selector = 1;
168
- bool visible = 2;
169
- string note = 3;
170
- }
@@ -1,72 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package allwright.engine.v1;
4
- option go_package = "allwright.dev/gen/allwright/engine/v1;enginev1";
5
-
6
- import "surfaces/web/v1/web.proto";
7
-
8
- message ContextSessionCommand {
9
- string surface_session_id = 1;
10
- string context_session_id = 2;
11
-
12
- oneof command {
13
- ContextSessionPingCommand ping = 3;
14
- CloseContextSessionCommand close = 4;
15
- NavigatePageCommand navigate = 5;
16
- ClickElementCommand click_element = 6;
17
- CountElementsCommand count_elements = 7;
18
- HighlightElementsCommand highlight_elements = 8;
19
- FocusElementCommand focus_element = 9;
20
- FillElementCommand fill_element = 10;
21
- HoverElementCommand hover_element = 11;
22
- PressKeyCommand press_key = 12;
23
- GetTextContentCommand get_text_content = 13;
24
- GetInnerTextCommand get_inner_text = 14;
25
- WaitForSelectorCommand wait_for_selector = 15;
26
- }
27
- }
28
-
29
- message ContextSessionPingCommand {
30
- string message = 1;
31
- }
32
-
33
- message CloseContextSessionCommand {}
34
-
35
- message ContextSessionEvent {
36
- string context_session_id = 1;
37
-
38
- oneof event {
39
- ContextSessionAttachedEvent attached = 2;
40
- ContextSessionPongEvent pong = 3;
41
- ContextSessionClosedEvent closed = 4;
42
- ContextSessionErrorEvent error = 5;
43
- PageNavigatedEvent navigated = 6;
44
- ChromiumBidiInjectionEvent chromium_bidi_injection = 7;
45
- ElementClickedEvent element_clicked = 8;
46
- ElementCountedEvent element_counted = 9;
47
- ElementsHighlightedEvent elements_highlighted = 10;
48
- ElementFocusedEvent element_focused = 11;
49
- ElementFilledEvent element_filled = 12;
50
- ElementHoveredEvent element_hovered = 13;
51
- KeyPressedEvent key_pressed = 14;
52
- TextContentResolvedEvent text_content_resolved = 15;
53
- InnerTextResolvedEvent inner_text_resolved = 16;
54
- SelectorWaitSatisfiedEvent selector_wait_satisfied = 17;
55
- }
56
- }
57
-
58
- message ContextSessionAttachedEvent {
59
- string note = 1;
60
- }
61
-
62
- message ContextSessionPongEvent {
63
- string message = 1;
64
- }
65
-
66
- message ContextSessionClosedEvent {
67
- string reason = 1;
68
- }
69
-
70
- message ContextSessionErrorEvent {
71
- string message = 1;
72
- }
File without changes