askui 0.20.7 → 0.20.9

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 (99) hide show
  1. package/dist/cjs/core/inference-response/inference-response.d.ts +5 -0
  2. package/dist/cjs/core/inference-response/model-type.d.ts +1 -1
  3. package/dist/cjs/core/model/custom-element.d.ts +5 -5
  4. package/dist/cjs/core/model/custom-element.js +2 -2
  5. package/dist/cjs/core/reporting/index.js +5 -1
  6. package/dist/cjs/core/reporting/snapshot-detail-level.d.ts +1 -1
  7. package/dist/cjs/core/reporting/snapshot-detail-level.js +1 -2
  8. package/dist/cjs/core/reporting/step-status-end.d.ts +1 -1
  9. package/dist/cjs/core/reporting/step-status.d.ts +1 -1
  10. package/dist/cjs/core/runner-protocol/index.js +5 -1
  11. package/dist/cjs/core/ui-control-commands/action.d.ts +1 -1
  12. package/dist/cjs/core/ui-control-commands/control-command-code.js +1 -1
  13. package/dist/cjs/core/ui-control-commands/input-event.js +1 -1
  14. package/dist/cjs/execution/dsl.d.ts +6 -6
  15. package/dist/cjs/execution/dsl.js +1 -1
  16. package/dist/cjs/execution/execution-runtime.d.ts +4 -2
  17. package/dist/cjs/execution/execution-runtime.js +14 -7
  18. package/dist/cjs/execution/index.d.ts +1 -0
  19. package/dist/cjs/execution/index.js +6 -1
  20. package/dist/cjs/execution/inference-client.d.ts +3 -0
  21. package/dist/cjs/execution/inference-client.js +33 -8
  22. package/dist/cjs/execution/misc.js +1 -2
  23. package/dist/cjs/execution/read-credentials.js +1 -2
  24. package/dist/cjs/execution/read-environment-credentials.js +1 -2
  25. package/dist/cjs/execution/retry-strategies/exponential-retry-strategy.d.ts +19 -0
  26. package/dist/cjs/execution/retry-strategies/exponential-retry-strategy.js +25 -0
  27. package/dist/cjs/execution/retry-strategies/fixed-retry-strategy.d.ts +19 -0
  28. package/dist/cjs/execution/retry-strategies/fixed-retry-strategy.js +25 -0
  29. package/dist/cjs/execution/retry-strategies/index.d.ts +4 -0
  30. package/dist/cjs/execution/retry-strategies/index.js +20 -0
  31. package/dist/cjs/execution/retry-strategies/linear-retry-strategy.d.ts +19 -0
  32. package/dist/cjs/execution/retry-strategies/linear-retry-strategy.js +25 -0
  33. package/dist/cjs/execution/retry-strategies/retry-strategy.d.ts +19 -0
  34. package/dist/cjs/execution/retry-strategies/retry-strategy.js +2 -0
  35. package/dist/cjs/execution/ui-control-client-dependency-builder.js +6 -5
  36. package/dist/cjs/execution/ui-control-client.d.ts +92 -3
  37. package/dist/cjs/execution/ui-control-client.js +115 -15
  38. package/dist/cjs/execution/ui-controller-client-connection-state.js +1 -1
  39. package/dist/cjs/execution/ui-controller-client-interface.d.ts +6 -0
  40. package/dist/cjs/execution/ui-controller-client.js +2 -1
  41. package/dist/cjs/lib/download-binaries.d.ts +0 -1
  42. package/dist/cjs/lib/download-binaries.js +3 -4
  43. package/dist/cjs/lib/interactive_cli/add-remove-script-package-json.js +2 -3
  44. package/dist/cjs/lib/interactive_cli/cli.js +1 -2
  45. package/dist/cjs/lib/logger.d.ts +1 -1
  46. package/dist/cjs/lib/ui-controller-args.js +2 -3
  47. package/dist/cjs/lib/ui-controller-facade.js +4 -4
  48. package/dist/cjs/main.js +5 -1
  49. package/dist/cjs/shared/log-levels.js +1 -1
  50. package/dist/cjs/shared/proxy-agent-args.d.ts +0 -1
  51. package/dist/cjs/utils/analytics/installation-timestamp-create-error.d.ts +0 -1
  52. package/dist/cjs/utils/analytics/installation-timestamp-get-error.d.ts +0 -1
  53. package/dist/cjs/utils/base_64_image/sharp.js +6 -3
  54. package/dist/cjs/utils/http/custom-errors/index.js +2 -2
  55. package/dist/cjs/utils/http/http-client-got.d.ts +0 -1
  56. package/dist/cjs/utils/http/http-client-got.js +2 -2
  57. package/dist/cjs/utils/path.js +1 -2
  58. package/dist/cjs/utils/proxy/proxy-builder.js +7 -3
  59. package/dist/cjs/utils/transformations.js +3 -4
  60. package/dist/esm/core/inference-response/inference-response.d.ts +5 -0
  61. package/dist/esm/core/inference-response/model-type.d.ts +1 -1
  62. package/dist/esm/core/model/custom-element.d.ts +5 -5
  63. package/dist/esm/core/model/custom-element.js +2 -2
  64. package/dist/esm/core/reporting/snapshot-detail-level.d.ts +1 -1
  65. package/dist/esm/core/reporting/step-status-end.d.ts +1 -1
  66. package/dist/esm/core/reporting/step-status.d.ts +1 -1
  67. package/dist/esm/core/ui-control-commands/action.d.ts +1 -1
  68. package/dist/esm/execution/dsl.d.ts +6 -6
  69. package/dist/esm/execution/execution-runtime.d.ts +4 -2
  70. package/dist/esm/execution/execution-runtime.js +14 -7
  71. package/dist/esm/execution/index.d.ts +1 -0
  72. package/dist/esm/execution/index.js +1 -0
  73. package/dist/esm/execution/inference-client.d.ts +3 -0
  74. package/dist/esm/execution/inference-client.js +33 -8
  75. package/dist/esm/execution/retry-strategies/exponential-retry-strategy.d.ts +19 -0
  76. package/dist/esm/execution/retry-strategies/exponential-retry-strategy.js +21 -0
  77. package/dist/esm/execution/retry-strategies/fixed-retry-strategy.d.ts +19 -0
  78. package/dist/esm/execution/retry-strategies/fixed-retry-strategy.js +21 -0
  79. package/dist/esm/execution/retry-strategies/index.d.ts +4 -0
  80. package/dist/esm/execution/retry-strategies/index.js +4 -0
  81. package/dist/esm/execution/retry-strategies/linear-retry-strategy.d.ts +19 -0
  82. package/dist/esm/execution/retry-strategies/linear-retry-strategy.js +21 -0
  83. package/dist/esm/execution/retry-strategies/retry-strategy.d.ts +19 -0
  84. package/dist/esm/execution/retry-strategies/retry-strategy.js +1 -0
  85. package/dist/esm/execution/ui-control-client-dependency-builder.js +6 -5
  86. package/dist/esm/execution/ui-control-client.d.ts +92 -3
  87. package/dist/esm/execution/ui-control-client.js +115 -15
  88. package/dist/esm/execution/ui-controller-client-interface.d.ts +6 -0
  89. package/dist/esm/execution/ui-controller-client.js +2 -1
  90. package/dist/esm/lib/download-binaries.d.ts +0 -1
  91. package/dist/esm/lib/logger.d.ts +1 -1
  92. package/dist/esm/lib/ui-controller-facade.js +4 -4
  93. package/dist/esm/shared/proxy-agent-args.d.ts +0 -1
  94. package/dist/esm/utils/analytics/installation-timestamp-create-error.d.ts +0 -1
  95. package/dist/esm/utils/analytics/installation-timestamp-get-error.d.ts +0 -1
  96. package/dist/esm/utils/http/http-client-got.d.ts +0 -1
  97. package/dist/esm/utils/http/http-client-got.js +2 -2
  98. package/dist/esm/utils/transformations.js +2 -2
  99. package/package.json +28 -28
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.httpClientErrorHandler = exports.GeneralHttpClientError = void 0;
3
+ exports.GeneralHttpClientError = void 0;
4
+ exports.httpClientErrorHandler = httpClientErrorHandler;
4
5
  const server_http_client_error_1 = require("./server-http-client-error");
5
6
  const authentication_http_client_error_1 = require("./authentication-http-client-error");
6
7
  const client_http_client_error_1 = require("./client-http-client-error");
@@ -20,4 +21,3 @@ function httpClientErrorHandler(responseCode, errorMessage) {
20
21
  }
21
22
  return new unkown_http_client_error_1.UnkownHttpClientError(diplayedMessage);
22
23
  }
23
- exports.httpClientErrorHandler = httpClientErrorHandler;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { OptionsOfJSONResponseBody } from 'got';
3
2
  import http from 'http';
4
3
  import https from 'https';
@@ -133,8 +133,8 @@ class HttpClientGot {
133
133
  return { body, headers };
134
134
  });
135
135
  }
136
- get(url, options = { responseType: 'json' }) {
137
- return __awaiter(this, void 0, void 0, function* () {
136
+ get(url_1) {
137
+ return __awaiter(this, arguments, void 0, function* (url, options = { responseType: 'json' }) {
138
138
  const response = yield this.askuiGot.get(url, this.injectHeadersAndCookies(url, options));
139
139
  return response.body;
140
140
  });
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getPathToNodeModulesRoot = void 0;
6
+ exports.getPathToNodeModulesRoot = getPathToNodeModulesRoot;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  function getPathToNodeModulesRoot() {
9
9
  return path_1.default.join(__dirname, '..', '..');
10
10
  }
11
- exports.getPathToNodeModulesRoot = getPathToNodeModulesRoot;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -28,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
32
  });
29
33
  };
30
34
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.envProxyAgents = exports.ProxyImportError = void 0;
35
+ exports.ProxyImportError = void 0;
36
+ exports.envProxyAgents = envProxyAgents;
32
37
  const logger_1 = require("../../lib/logger");
33
38
  class ProxyImportError extends Error {
34
39
  }
@@ -66,4 +71,3 @@ function envProxyAgents() {
66
71
  };
67
72
  });
68
73
  }
69
- exports.envProxyAgents = envProxyAgents;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.resizeBase64ImageWithSameRatio = void 0;
12
+ exports.resizeBase64ImageWithSameRatio = resizeBase64ImageWithSameRatio;
13
13
  const lib_1 = require("../lib");
14
14
  const base_64_image_1 = require("./base_64_image/base-64-image");
15
15
  const image_resize_errors_1 = require("./image-resize-errors");
@@ -23,8 +23,8 @@ const image_resize_errors_1 = require("./image-resize-errors");
23
23
  * @returns {Promise<ResizedImage>} ResiziedImage Interface,
24
24
  * the true pixel values = controlui-api response * resizeRatio.
25
25
  */
26
- function resizeBase64ImageWithSameRatio(base64ImageString, maxEdge = 1400) {
27
- return __awaiter(this, void 0, void 0, function* () {
26
+ function resizeBase64ImageWithSameRatio(base64ImageString_1) {
27
+ return __awaiter(this, arguments, void 0, function* (base64ImageString, maxEdge = 1400) {
28
28
  lib_1.logger.debug('Image resizing');
29
29
  try {
30
30
  const image = yield base_64_image_1.Base64Image.fromString(base64ImageString);
@@ -44,4 +44,3 @@ function resizeBase64ImageWithSameRatio(base64ImageString, maxEdge = 1400) {
44
44
  }
45
45
  });
46
46
  }
47
- exports.resizeBase64ImageWithSameRatio = resizeBase64ImageWithSameRatio;
@@ -5,6 +5,11 @@ export interface InferenceResponseBody {
5
5
  type: ModelType;
6
6
  data: ModelType extends 'COMMANDS' ? ControlCommand : Annotation;
7
7
  }
8
+ export interface VQAInferenceResponseBody {
9
+ data: {
10
+ response: string;
11
+ };
12
+ }
8
13
  export declare class InferenceResponse {
9
14
  static fromJson(json: InferenceResponseBody, resizeRatio?: number, image?: string): ControlCommand | Annotation;
10
15
  static createModels(type: ModelType, data: ModelType extends 'COMMANDS' ? ControlCommand : Annotation, resizeRatio: number, image?: string): ControlCommand | Annotation;
@@ -1 +1 @@
1
- export declare type ModelType = 'DETECTED_ELEMENTS' | 'COMMANDS';
1
+ export type ModelType = 'DETECTED_ELEMENTS' | 'COMMANDS';
@@ -5,16 +5,16 @@ export declare class CustomElement implements CustomElementJson {
5
5
  threshold?: number | undefined;
6
6
  stopThreshold?: number | undefined;
7
7
  rotationDegreePerStep?: number | undefined;
8
- imageCompareFormat?: "RGB" | "grayscale" | "edges" | undefined;
9
- mask?: {
8
+ imageCompareFormat?: ("RGB" | "grayscale" | "edges") | undefined;
9
+ mask?: ({
10
10
  x: number;
11
11
  y: number;
12
- }[] | undefined;
12
+ })[] | undefined;
13
13
  private static schema;
14
- constructor(customImage: string, name?: string | undefined, threshold?: number | undefined, stopThreshold?: number | undefined, rotationDegreePerStep?: number | undefined, imageCompareFormat?: "RGB" | "grayscale" | "edges" | undefined, mask?: {
14
+ constructor(customImage: string, name?: string | undefined, threshold?: number | undefined, stopThreshold?: number | undefined, rotationDegreePerStep?: number | undefined, imageCompareFormat?: ("RGB" | "grayscale" | "edges") | undefined, mask?: ({
15
15
  x: number;
16
16
  y: number;
17
- }[] | undefined);
17
+ })[] | undefined);
18
18
  static fromJsonListWithImagePathOrImage(ceJson?: CustomElementJson[]): Promise<CustomElement[]>;
19
19
  static fromJsonWithImagePathOrImage(ceJson: CustomElementJson): Promise<CustomElement>;
20
20
  static fromJson(ceJson: CustomElementJson): CustomElement;
@@ -19,8 +19,8 @@ export class CustomElement {
19
19
  this.imageCompareFormat = imageCompareFormat;
20
20
  this.mask = mask;
21
21
  }
22
- static fromJsonListWithImagePathOrImage(ceJson = []) {
23
- return __awaiter(this, void 0, void 0, function* () {
22
+ static fromJsonListWithImagePathOrImage() {
23
+ return __awaiter(this, arguments, void 0, function* (ceJson = []) {
24
24
  return Promise.all(ceJson.map((customElement) => CustomElement.fromJsonWithImagePathOrImage(customElement)));
25
25
  });
26
26
  }
@@ -1,4 +1,4 @@
1
- export declare type SnapshotDetailLevel =
1
+ export type SnapshotDetailLevel =
2
2
  /**
3
3
  * Details of snapshot, e.g., screenshot or detected elements, may or may not be available
4
4
  * depending on if they are required by the step. There are not guarantees made.
@@ -1 +1 @@
1
- export declare type StepStatusEnd = 'passed' | 'failed' | 'erroneous';
1
+ export type StepStatusEnd = 'passed' | 'failed' | 'erroneous';
@@ -10,4 +10,4 @@
10
10
  * e.g., the user has no usage left, response of inference backend cannot be processed,
11
11
  * e.g., because lib version is outdated, etc. (currently not supported, everything "failed")
12
12
  */
13
- export declare type StepStatus = 'passed' | 'failed' | 'pending' | 'running' | 'erroneous';
13
+ export type StepStatus = 'passed' | 'failed' | 'pending' | 'running' | 'erroneous';
@@ -1,5 +1,5 @@
1
1
  import { InputEvent } from './input-event';
2
- export declare type ActionParameters = {
2
+ export type ActionParameters = {
3
3
  [key: string]: string | number | boolean | string[] | ActionParameters;
4
4
  };
5
5
  export declare class Action {
@@ -3,12 +3,12 @@ import { DetectedElement } from '../core/model/annotation-result/detected-elemen
3
3
  export declare enum Separators {
4
4
  STRING = "<|string|>"
5
5
  }
6
- export declare type INTERSECTION_AREA = 'element_center_line' | 'element_edge_area' | 'display_edge_area';
7
- export declare type PC_KEY = 'backspace' | 'delete' | 'enter' | 'tab' | 'escape' | 'up' | 'down' | 'right' | 'left' | 'home' | 'end' | 'pageup' | 'pagedown' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'space' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '!' | '"' | '#' | '$' | '%' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~ ';
8
- export declare type ANDROID_KEY = 'home' | 'back' | 'call' | 'endcall' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'star' | 'pound' | 'dpad_up' | 'dpad_down' | 'dpad_left' | 'dpad_right' | 'dpad_center' | 'volume_up' | 'volume_down' | 'power' | 'camera' | 'clear' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'comma' | 'period' | 'alt_left' | 'alt_right' | 'shift_left' | 'shift_right' | 'tab' | 'space' | 'sym' | 'explorer' | 'envelope' | 'enter' | 'del' | 'grave' | 'minus' | 'equals' | 'left_bracket' | 'right_bracket' | 'backslash' | 'semicolon' | 'apostrophe' | 'slash' | 'at' | 'num' | 'headsethook' | 'focus' | 'plus' | 'menu' | 'notification' | 'search' | 'media_play_pause' | 'media_stop' | 'media_next' | 'media_previous' | 'media_rewind' | 'media_fast_forward' | 'mute' | 'page_up' | 'page_down' | 'switch_charset' | 'escape' | 'forward_del' | 'ctrl_left' | 'ctrl_right' | 'caps_lock' | 'scroll_lock' | 'function' | 'break' | 'move_home' | 'move_end' | 'insert' | 'forward' | 'media_play' | 'media_pause' | 'media_close' | 'media_eject' | 'media_record' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'num_lock' | 'numpad_0' | 'numpad_1' | 'numpad_2' | 'numpad_3' | 'numpad_4' | 'numpad_5' | 'numpad_6' | 'numpad_7' | 'numpad_8' | 'numpad_9' | 'numpad_divide' | 'numpad_multiply' | 'numpad_subtract' | 'numpad_add' | 'numpad_dot' | 'numpad_comma' | 'numpad_enter' | 'numpad_equals' | 'numpad_left_paren' | 'numpad_right_paren' | 'volume_mute' | 'info' | 'channel_up' | 'channel_down' | 'zoom_in' | 'zoom_out' | 'window' | 'guide' | 'bookmark' | 'captions' | 'settings' | 'app_switch' | 'language_switch' | 'contacts' | 'calendar' | 'music' | 'calculator' | 'assist' | 'brightness_down' | 'brightness_up' | 'media_audio_track' | 'sleep' | 'wakeup' | 'pairing' | 'media_top_menu' | 'last_channel' | 'tv_data_service' | 'voice_assist' | 'help' | 'navigate_previous' | 'navigate_next' | 'navigate_in' | 'navigate_out' | 'dpad_up_left' | 'dpad_down_left' | 'dpad_up_right' | 'dpad_down_right' | 'media_skip_forward' | 'media_skip_backward' | 'media_step_forward' | 'media_step_backward' | 'soft_sleep' | 'cut' | 'copy' | 'paste' | 'all_apps' | 'refresh';
9
- export declare type MODIFIER_KEY = 'command' | 'alt' | 'control' | 'shift' | 'right_shift';
10
- export declare type COLOR = 'black' | 'white' | 'red' | 'green' | 'yellow green' | 'orange' | 'yellow' | 'purple' | 'pink' | 'gray' | 'lime green' | 'royal blue';
11
- export declare type PC_AND_MODIFIER_KEY = 'command' | 'alt' | 'control' | 'shift' | 'right_shift' | 'backspace' | 'delete' | 'enter' | 'tab' | 'escape' | 'up' | 'down' | 'right' | 'left' | 'home' | 'end' | 'pageup' | 'pagedown' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'space' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '!' | '"' | '#' | '$' | '%' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~ ';
6
+ export type INTERSECTION_AREA = 'element_center_line' | 'element_edge_area' | 'display_edge_area';
7
+ export type PC_KEY = 'backspace' | 'delete' | 'enter' | 'tab' | 'escape' | 'up' | 'down' | 'right' | 'left' | 'home' | 'end' | 'pageup' | 'pagedown' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'space' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '!' | '"' | '#' | '$' | '%' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~ ';
8
+ export type ANDROID_KEY = 'home' | 'back' | 'call' | 'endcall' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'star' | 'pound' | 'dpad_up' | 'dpad_down' | 'dpad_left' | 'dpad_right' | 'dpad_center' | 'volume_up' | 'volume_down' | 'power' | 'camera' | 'clear' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'comma' | 'period' | 'alt_left' | 'alt_right' | 'shift_left' | 'shift_right' | 'tab' | 'space' | 'sym' | 'explorer' | 'envelope' | 'enter' | 'del' | 'grave' | 'minus' | 'equals' | 'left_bracket' | 'right_bracket' | 'backslash' | 'semicolon' | 'apostrophe' | 'slash' | 'at' | 'num' | 'headsethook' | 'focus' | 'plus' | 'menu' | 'notification' | 'search' | 'media_play_pause' | 'media_stop' | 'media_next' | 'media_previous' | 'media_rewind' | 'media_fast_forward' | 'mute' | 'page_up' | 'page_down' | 'switch_charset' | 'escape' | 'forward_del' | 'ctrl_left' | 'ctrl_right' | 'caps_lock' | 'scroll_lock' | 'function' | 'break' | 'move_home' | 'move_end' | 'insert' | 'forward' | 'media_play' | 'media_pause' | 'media_close' | 'media_eject' | 'media_record' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'num_lock' | 'numpad_0' | 'numpad_1' | 'numpad_2' | 'numpad_3' | 'numpad_4' | 'numpad_5' | 'numpad_6' | 'numpad_7' | 'numpad_8' | 'numpad_9' | 'numpad_divide' | 'numpad_multiply' | 'numpad_subtract' | 'numpad_add' | 'numpad_dot' | 'numpad_comma' | 'numpad_enter' | 'numpad_equals' | 'numpad_left_paren' | 'numpad_right_paren' | 'volume_mute' | 'info' | 'channel_up' | 'channel_down' | 'zoom_in' | 'zoom_out' | 'window' | 'guide' | 'bookmark' | 'captions' | 'settings' | 'app_switch' | 'language_switch' | 'contacts' | 'calendar' | 'music' | 'calculator' | 'assist' | 'brightness_down' | 'brightness_up' | 'media_audio_track' | 'sleep' | 'wakeup' | 'pairing' | 'media_top_menu' | 'last_channel' | 'tv_data_service' | 'voice_assist' | 'help' | 'navigate_previous' | 'navigate_next' | 'navigate_in' | 'navigate_out' | 'dpad_up_left' | 'dpad_down_left' | 'dpad_up_right' | 'dpad_down_right' | 'media_skip_forward' | 'media_skip_backward' | 'media_step_forward' | 'media_step_backward' | 'soft_sleep' | 'cut' | 'copy' | 'paste' | 'all_apps' | 'refresh';
9
+ export type MODIFIER_KEY = 'command' | 'alt' | 'control' | 'shift' | 'right_shift';
10
+ export type COLOR = 'black' | 'white' | 'red' | 'green' | 'yellow green' | 'orange' | 'yellow' | 'purple' | 'pink' | 'gray' | 'lime green' | 'royal blue';
11
+ export type PC_AND_MODIFIER_KEY = 'command' | 'alt' | 'control' | 'shift' | 'right_shift' | 'backspace' | 'delete' | 'enter' | 'tab' | 'escape' | 'up' | 'down' | 'right' | 'left' | 'home' | 'end' | 'pageup' | 'pagedown' | 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12' | 'space' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '!' | '"' | '#' | '$' | '%' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~ ';
12
12
  export interface CommandExecutorContext {
13
13
  customElementsJson: CustomElementJson[];
14
14
  aiElementNames: string[];
@@ -5,11 +5,13 @@ import { CustomElementJson } from '../core/model/custom-element-json';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
6
  import { UiControllerClientConnectionState } from './ui-controller-client-connection-state';
7
7
  import { Instruction, StepReporter } from '../core/reporting';
8
+ import { RetryStrategy } from './retry-strategies/retry-strategy';
8
9
  export declare class ExecutionRuntime {
9
10
  private uiControllerClient;
10
11
  private inferenceClient;
11
12
  private stepReporter;
12
- constructor(uiControllerClient: UiControllerClient, inferenceClient: InferenceClient, stepReporter: StepReporter);
13
+ private retryStrategy;
14
+ constructor(uiControllerClient: UiControllerClient, inferenceClient: InferenceClient, stepReporter: StepReporter, retryStrategy: RetryStrategy);
13
15
  connect(): Promise<UiControllerClientConnectionState>;
14
16
  disconnect(): void;
15
17
  startVideoRecording(): Promise<void>;
@@ -19,7 +21,6 @@ export declare class ExecutionRuntime {
19
21
  executeInstruction(instruction: Instruction): Promise<void>;
20
22
  private readonly EXEC_REPETITION_COUNT;
21
23
  private executeCommandRepeatedly;
22
- private readonly PREDICT_COMMAND_RETRY_COUNT;
23
24
  /**
24
25
  * Command prediction may fail, e.g., due to application still loading
25
26
  * --> retry with linear back-off
@@ -35,4 +36,5 @@ export declare class ExecutionRuntime {
35
36
  takeScreenshotIfImageisNotProvided(imagePath?: string): Promise<string>;
36
37
  getDetectedElements(instruction: string, customElementJson?: CustomElementJson[]): Promise<DetectedElement[]>;
37
38
  annotateImage(imagePath?: string, customElementJson?: CustomElementJson[], elements?: DetectedElement[]): Promise<Annotation>;
39
+ predictVQA(prompt: string, config?: object): Promise<any>;
38
40
  }
@@ -16,12 +16,12 @@ import { Annotation } from '../core/annotation/annotation';
16
16
  import { logger } from '../lib/logger';
17
17
  import { Base64Image } from '../utils/base_64_image/base-64-image';
18
18
  export class ExecutionRuntime {
19
- constructor(uiControllerClient, inferenceClient, stepReporter) {
19
+ constructor(uiControllerClient, inferenceClient, stepReporter, retryStrategy) {
20
20
  this.uiControllerClient = uiControllerClient;
21
21
  this.inferenceClient = inferenceClient;
22
22
  this.stepReporter = stepReporter;
23
+ this.retryStrategy = retryStrategy;
23
24
  this.EXEC_REPETITION_COUNT = 25;
24
- this.PREDICT_COMMAND_RETRY_COUNT = 2;
25
25
  }
26
26
  connect() {
27
27
  return __awaiter(this, void 0, void 0, function* () {
@@ -53,8 +53,8 @@ export class ExecutionRuntime {
53
53
  });
54
54
  }
55
55
  executeInstruction(instruction) {
56
- var _a, _b, _c;
57
56
  return __awaiter(this, void 0, void 0, function* () {
57
+ var _a, _b, _c;
58
58
  const controlCommand = yield this.predictCommandWithRetry(instruction);
59
59
  if (controlCommand.code === ControlCommandCode.OK) {
60
60
  return this.requestControl(controlCommand);
@@ -67,8 +67,8 @@ export class ExecutionRuntime {
67
67
  });
68
68
  }
69
69
  executeCommandRepeatedly(instruction) {
70
- var _a, _b, _c;
71
70
  return __awaiter(this, void 0, void 0, function* () {
71
+ var _a, _b, _c;
72
72
  /* eslint-disable no-await-in-loop */
73
73
  for (let repeatCount = this.EXEC_REPETITION_COUNT; repeatCount >= 0; repeatCount -= 1) {
74
74
  if (repeatCount === 0) {
@@ -87,6 +87,7 @@ export class ExecutionRuntime {
87
87
  throw new ControlCommandError((_c = (_b = (_a = controlCommand.actions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.text) !== null && _c !== void 0 ? _c : '');
88
88
  }
89
89
  }
90
+ /* eslint-enable no-await-in-loop */
90
91
  });
91
92
  }
92
93
  /**
@@ -95,15 +96,15 @@ export class ExecutionRuntime {
95
96
  */
96
97
  /* eslint-disable-next-line consistent-return */
97
98
  predictCommandWithRetry(instruction) {
98
- var _a, _b, _c;
99
99
  return __awaiter(this, void 0, void 0, function* () {
100
+ var _a, _b, _c;
100
101
  let command = yield this.predictCommand(instruction);
101
102
  /* eslint-disable no-await-in-loop */
102
- for (let k = 0; k < this.PREDICT_COMMAND_RETRY_COUNT; k += 1) {
103
+ for (let k = 0; k < this.retryStrategy.retryCount; k += 1) {
103
104
  if (command.code === ControlCommandCode.OK) {
104
105
  return command;
105
106
  }
106
- const msUntilRetry = k * 1000;
107
+ const msUntilRetry = this.retryStrategy.getDelay(k + 1);
107
108
  logger.debug(`Wait ${msUntilRetry} and retry predicting command...`);
108
109
  yield delay(msUntilRetry);
109
110
  command = yield this.predictCommand(instruction, new ControlCommandError((_c = (_b = (_a = command.actions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.text) !== null && _c !== void 0 ? _c : ''));
@@ -205,4 +206,10 @@ export class ExecutionRuntime {
205
206
  return this.inferenceClient.predictImageAnnotation(base64Image, customElements);
206
207
  });
207
208
  }
209
+ predictVQA(prompt, config) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ const base64Image = yield this.takeScreenshotIfImageisNotProvided();
212
+ return this.inferenceClient.predictVQAAnswer(prompt, base64Image, config);
213
+ });
214
+ }
208
215
  }
@@ -1 +1,2 @@
1
1
  export * from './ui-control-client';
2
+ export * from './retry-strategies';
@@ -1 +1,2 @@
1
1
  export * from './ui-control-client';
2
+ export * from './retry-strategies';
@@ -3,6 +3,7 @@ import { ControlCommand } from '../core/ui-control-commands';
3
3
  import { CustomElement } from '../core/model/custom-element';
4
4
  import { Annotation } from '../core/annotation/annotation';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
+ import { VQAInferenceResponseBody } from '../core/inference-response/inference-response';
6
7
  import { ModelCompositionBranch } from './model-composition-branch';
7
8
  export declare class InferenceClient {
8
9
  private readonly baseUrl;
@@ -16,8 +17,10 @@ export declare class InferenceClient {
16
17
  isImageRequired(instruction: string): Promise<boolean>;
17
18
  private resizeIfNeeded;
18
19
  inference(customElements?: CustomElement[], image?: string, instruction?: string): Promise<ControlCommand | Annotation>;
20
+ vqaInference(image: string, prompt: string, config?: object): Promise<VQAInferenceResponseBody>;
19
21
  private static logMetaInformation;
20
22
  predictControlCommand(instruction: string, customElements?: CustomElement[], image?: string): Promise<ControlCommand>;
21
23
  getDetectedElements(instruction: string, image: string, customElements?: CustomElement[]): Promise<DetectedElement[]>;
22
24
  predictImageAnnotation(image: string, customElements?: CustomElement[]): Promise<Annotation>;
25
+ predictVQAAnswer(prompt: string, image: string, config?: object): Promise<any>;
23
26
  }
@@ -29,6 +29,7 @@ export class InferenceClient {
29
29
  this.urls = {
30
30
  inference: urljoin(url, 'inference'),
31
31
  isImageRequired: urljoin(url, 'instruction', 'is-image-required'),
32
+ vqaInference: urljoin(url, 'vqa', 'inference'),
32
33
  };
33
34
  this.httpClient.urlsToRetry = Object.values(this.urls);
34
35
  if (this.resize !== undefined && this.resize <= 0) {
@@ -53,8 +54,8 @@ export class InferenceClient {
53
54
  return resizeBase64ImageWithSameRatio(image, this.resize);
54
55
  });
55
56
  }
56
- inference(customElements = [], image, instruction) {
57
- return __awaiter(this, void 0, void 0, function* () {
57
+ inference() {
58
+ return __awaiter(this, arguments, void 0, function* (customElements = [], image, instruction) {
58
59
  const resizedImage = yield this.resizeIfNeeded(customElements, image);
59
60
  const response = yield this.httpClient.post(this.urls.inference, this.urls.inference.includes('v4-experimental') ? {
60
61
  image: resizedImage.base64Image,
@@ -71,13 +72,24 @@ export class InferenceClient {
71
72
  return InferenceResponse.fromJson(response.body, resizedImage.resizeRatio, image);
72
73
  });
73
74
  }
75
+ vqaInference(image, prompt, config) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const response = yield this.httpClient.post(this.urls.vqaInference, {
78
+ config,
79
+ image,
80
+ prompt,
81
+ });
82
+ InferenceClient.logMetaInformation(response);
83
+ return response.body;
84
+ });
85
+ }
74
86
  static logMetaInformation(response) {
75
87
  if (response.headers['askui-usage-warnings'] !== undefined) {
76
88
  logger.warn(response.headers['askui-usage-warnings']);
77
89
  }
78
90
  }
79
- predictControlCommand(instruction, customElements = [], image) {
80
- return __awaiter(this, void 0, void 0, function* () {
91
+ predictControlCommand(instruction_1) {
92
+ return __awaiter(this, arguments, void 0, function* (instruction, customElements = [], image) {
81
93
  const inferenceResponse = yield this.inference(customElements, image, instruction);
82
94
  if (!(inferenceResponse instanceof ControlCommand)) {
83
95
  throw new InferenceResponseError('Internal Error. Can not execute command');
@@ -85,8 +97,8 @@ export class InferenceClient {
85
97
  return inferenceResponse;
86
98
  });
87
99
  }
88
- getDetectedElements(instruction, image, customElements = []) {
89
- return __awaiter(this, void 0, void 0, function* () {
100
+ getDetectedElements(instruction_1, image_1) {
101
+ return __awaiter(this, arguments, void 0, function* (instruction, image, customElements = []) {
90
102
  const inferenceResponse = yield this.inference(customElements, image, instruction);
91
103
  if (!(inferenceResponse instanceof Annotation)) {
92
104
  throw new InferenceResponseError('Internal Error. Unable to get the detected elements');
@@ -94,8 +106,8 @@ export class InferenceClient {
94
106
  return inferenceResponse.detected_elements;
95
107
  });
96
108
  }
97
- predictImageAnnotation(image, customElements = []) {
98
- return __awaiter(this, void 0, void 0, function* () {
109
+ predictImageAnnotation(image_1) {
110
+ return __awaiter(this, arguments, void 0, function* (image, customElements = []) {
99
111
  const inferenceResponse = yield this.inference(customElements, image);
100
112
  if (!(inferenceResponse instanceof Annotation)) {
101
113
  throw new InferenceResponseError('Internal Error. Can not execute annotation');
@@ -103,4 +115,17 @@ export class InferenceClient {
103
115
  return inferenceResponse;
104
116
  });
105
117
  }
118
+ predictVQAAnswer(prompt, image, config) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ const inferenceResponse = yield this.vqaInference(image, prompt, config);
121
+ const { response } = inferenceResponse.data;
122
+ try {
123
+ return JSON.parse(response);
124
+ }
125
+ catch (error) {
126
+ logger.warn(`Response is no valid JSON: ${response}`);
127
+ }
128
+ return response;
129
+ });
130
+ }
106
131
  }
@@ -0,0 +1,19 @@
1
+ import { RetryStrategy } from './retry-strategy';
2
+ /**
3
+ * ExponentialRetryStrategy implements a retry strategy that uses an exponential backoff algorithm.
4
+ */
5
+ export declare class ExponentialRetryStrategy implements RetryStrategy {
6
+ baseDelayMs: number;
7
+ retryCount: number;
8
+ /**
9
+ * @param baseDelayMs - The initial delay before the first retry (default is 1000ms)
10
+ * @param retryCount - The maximum number of retries (default is 3)
11
+ */
12
+ constructor(baseDelayMs?: number, retryCount?: number);
13
+ /**
14
+ * Calculates the delay for a given retry attempt using exponential backoff.
15
+ * @param attempt - The current retry attempt number (0-based)
16
+ * @returns The delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(attempt: number): number;
19
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ExponentialRetryStrategy implements a retry strategy that uses an exponential backoff algorithm.
3
+ */
4
+ export class ExponentialRetryStrategy {
5
+ /**
6
+ * @param baseDelayMs - The initial delay before the first retry (default is 1000ms)
7
+ * @param retryCount - The maximum number of retries (default is 3)
8
+ */
9
+ constructor(baseDelayMs = 1000, retryCount = 3) {
10
+ this.baseDelayMs = baseDelayMs;
11
+ this.retryCount = retryCount;
12
+ }
13
+ /**
14
+ * Calculates the delay for a given retry attempt using exponential backoff.
15
+ * @param attempt - The current retry attempt number (0-based)
16
+ * @returns The delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(attempt) {
19
+ return this.baseDelayMs * (Math.pow(2, attempt));
20
+ }
21
+ }
@@ -0,0 +1,19 @@
1
+ import { RetryStrategy } from './retry-strategy';
2
+ /**
3
+ * FixedRetryStrategy implements a retry strategy that uses a constant delay for each retry attempt.
4
+ */
5
+ export declare class FixedRetryStrategy implements RetryStrategy {
6
+ baseDelayMs: number;
7
+ retryCount: number;
8
+ /**
9
+ * @param baseDelayMs - The constant delay before each retry (default is 1000ms)
10
+ * @param retryCount - The maximum number of retries (default is 3)
11
+ */
12
+ constructor(baseDelayMs?: number, retryCount?: number);
13
+ /**
14
+ * Returns the fixed delay for each retry attempt.
15
+ * @param _attempt - The current retry attempt number (not used in this strategy)
16
+ * @returns The fixed delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(_attempt: number): number;
19
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * FixedRetryStrategy implements a retry strategy that uses a constant delay for each retry attempt.
3
+ */
4
+ export class FixedRetryStrategy {
5
+ /**
6
+ * @param baseDelayMs - The constant delay before each retry (default is 1000ms)
7
+ * @param retryCount - The maximum number of retries (default is 3)
8
+ */
9
+ constructor(baseDelayMs = 1000, retryCount = 3) {
10
+ this.baseDelayMs = baseDelayMs;
11
+ this.retryCount = retryCount;
12
+ }
13
+ /**
14
+ * Returns the fixed delay for each retry attempt.
15
+ * @param _attempt - The current retry attempt number (not used in this strategy)
16
+ * @returns The fixed delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(_attempt) {
19
+ return this.baseDelayMs;
20
+ }
21
+ }
@@ -0,0 +1,4 @@
1
+ export * from './exponential-retry-strategy';
2
+ export * from './linear-retry-strategy';
3
+ export * from './fixed-retry-strategy';
4
+ export * from './retry-strategy';
@@ -0,0 +1,4 @@
1
+ export * from './exponential-retry-strategy';
2
+ export * from './linear-retry-strategy';
3
+ export * from './fixed-retry-strategy';
4
+ export * from './retry-strategy';
@@ -0,0 +1,19 @@
1
+ import { RetryStrategy } from './retry-strategy';
2
+ /**
3
+ * LinearRetryStrategy implements a retry strategy that uses a linear backoff algorithm.
4
+ */
5
+ export declare class LinearRetryStrategy implements RetryStrategy {
6
+ baseDelayMs: number;
7
+ retryCount: number;
8
+ /**
9
+ * @param baseDelayMs - The initial delay before the first retry (default is 1000ms)
10
+ * @param retryCount - The maximum number of retries (default is 3)
11
+ */
12
+ constructor(baseDelayMs?: number, retryCount?: number);
13
+ /**
14
+ * Calculates the delay for a given retry attempt using linear backoff.
15
+ * @param attempt - The current retry attempt number (1-based)
16
+ * @returns The delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(attempt: number): number;
19
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * LinearRetryStrategy implements a retry strategy that uses a linear backoff algorithm.
3
+ */
4
+ export class LinearRetryStrategy {
5
+ /**
6
+ * @param baseDelayMs - The initial delay before the first retry (default is 1000ms)
7
+ * @param retryCount - The maximum number of retries (default is 3)
8
+ */
9
+ constructor(baseDelayMs = 1000, retryCount = 3) {
10
+ this.baseDelayMs = baseDelayMs;
11
+ this.retryCount = retryCount;
12
+ }
13
+ /**
14
+ * Calculates the delay for a given retry attempt using linear backoff.
15
+ * @param attempt - The current retry attempt number (1-based)
16
+ * @returns The delay in milliseconds for the current attempt
17
+ */
18
+ getDelay(attempt) {
19
+ return this.baseDelayMs * attempt;
20
+ }
21
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Interface representing a retry strategy for operations.
3
+ */
4
+ export interface RetryStrategy {
5
+ /**
6
+ * The base delay in milliseconds before the first retry.
7
+ */
8
+ baseDelayMs: number;
9
+ /**
10
+ * The maximum number of retry attempts.
11
+ */
12
+ retryCount: number;
13
+ /**
14
+ * Function to calculate the delay before the next retry attempt.
15
+ * @param attempt - The current retry attempt number (0-based).
16
+ * @returns The delay in milliseconds for the next retry.
17
+ */
18
+ getDelay(attempt: number): number;
19
+ }