askui 0.27.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { RunnerProtocolRequest } from './runner-protocol-request';
2
+ export declare class GetStartingArgumentsRequest implements RunnerProtocolRequest {
3
+ static msgName: string;
4
+ msgName: string;
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetStartingArgumentsRequest = void 0;
4
+ class GetStartingArgumentsRequest {
5
+ constructor() {
6
+ this.msgName = GetStartingArgumentsRequest.msgName;
7
+ }
8
+ }
9
+ exports.GetStartingArgumentsRequest = GetStartingArgumentsRequest;
10
+ GetStartingArgumentsRequest.msgName = 'GET_STARTING_ARGUMENTS_REQUEST';
@@ -6,3 +6,4 @@ export { RunnerProtocolRequest } from './runner-protocol-request';
6
6
  export { StartRecordingRequest } from './start-recording-request';
7
7
  export { StopRecordingRequest } from './stop-recording-request';
8
8
  export { GetProcessPidRequest } from './get-server-process-pid';
9
+ export { GetStartingArgumentsRequest } from './get-starting-arguments-request';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetProcessPidRequest = exports.StopRecordingRequest = exports.StartRecordingRequest = exports.ReadRecordingRequest = exports.InteractiveAnnotationRequest = exports.ControlRequest = exports.CaptureScreenshotRequest = void 0;
3
+ exports.GetStartingArgumentsRequest = exports.GetProcessPidRequest = exports.StopRecordingRequest = exports.StartRecordingRequest = exports.ReadRecordingRequest = exports.InteractiveAnnotationRequest = exports.ControlRequest = exports.CaptureScreenshotRequest = void 0;
4
4
  var capture_screenshot_request_1 = require("./capture-screenshot-request");
5
5
  Object.defineProperty(exports, "CaptureScreenshotRequest", { enumerable: true, get: function () { return capture_screenshot_request_1.CaptureScreenshotRequest; } });
6
6
  var control_request_1 = require("./control-request");
@@ -15,3 +15,5 @@ var stop_recording_request_1 = require("./stop-recording-request");
15
15
  Object.defineProperty(exports, "StopRecordingRequest", { enumerable: true, get: function () { return stop_recording_request_1.StopRecordingRequest; } });
16
16
  var get_server_process_pid_1 = require("./get-server-process-pid");
17
17
  Object.defineProperty(exports, "GetProcessPidRequest", { enumerable: true, get: function () { return get_server_process_pid_1.GetProcessPidRequest; } });
18
+ var get_starting_arguments_request_1 = require("./get-starting-arguments-request");
19
+ Object.defineProperty(exports, "GetStartingArgumentsRequest", { enumerable: true, get: function () { return get_starting_arguments_request_1.GetStartingArgumentsRequest; } });
@@ -100,3 +100,10 @@ export interface GetProcessPidResponse {
100
100
  };
101
101
  msgName: 'GET_PROCESS_PID_RESPONSE';
102
102
  }
103
+ export interface GetStartingArgumentsResponse {
104
+ data: {
105
+ error?: string;
106
+ arguments: Record<string, string>;
107
+ };
108
+ msgName: 'GET_STARTING_ARGUMENTS_RESPONSE';
109
+ }
@@ -37,6 +37,7 @@ export declare class ExecutionRuntime {
37
37
  private predictCommand;
38
38
  annotateInteractively(): Promise<void>;
39
39
  takeScreenshotIfImageisNotProvided(imagePath?: string): Promise<string>;
40
+ getStartingArguments(): Promise<Record<string, string | number | boolean>>;
40
41
  getDetectedElements(instruction: string, customElementJson?: CustomElementJson[]): Promise<DetectedElement[]>;
41
42
  annotateImage(imagePath?: string, customElementJson?: CustomElementJson[], elements?: DetectedElement[]): Promise<Annotation>;
42
43
  predictVQA(prompt: string, config?: object): Promise<any>;
@@ -183,6 +183,12 @@ class ExecutionRuntime {
183
183
  return base64Image;
184
184
  });
185
185
  }
186
+ getStartingArguments() {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ const startingArgumentsResponse = yield this.uiControllerClient.getStartingArguments();
189
+ return startingArgumentsResponse.data.arguments;
190
+ });
191
+ }
186
192
  getDetectedElements(instruction, customElementJson) {
187
193
  return __awaiter(this, void 0, void 0, function* () {
188
194
  let customElements = [];
@@ -602,4 +602,51 @@ export declare class UiControlClient extends ApiCommands {
602
602
  * @returns {Promise<void>} - A promise that resolves when the tools are added to the agent.
603
603
  */
604
604
  addAIElementsToolsToAgent(): Promise<void>;
605
+ /**
606
+ * Retrieves the starting arguments used when the controller server was initialized.
607
+ *
608
+ * Useful for debugging, logging, or verifying the current server configuration.
609
+ *
610
+ * @property {string} displayNum - Display number controlled by the controller
611
+ * @property {boolean} minimize - Whether controller starts minimized
612
+ * @property {string} runtime - Runtime type ("desktop" or "android")
613
+ * @property {number} port - Communication port
614
+ * @property {number} actionWaitTime - Action wait time
615
+ * @property {string} host - Host address
616
+ * @property {string} logFile - Log file path
617
+ * @property {boolean} hideOverlay - Whether overlay is hidden
618
+ * @property {boolean} debugDraw - Whether debug drawing is enabled
619
+ * @property {string} deviceId - Android device ID
620
+ * @property {string} configFile - Configuration file path
621
+ * @property {string} logLevel - Logging level
622
+ *
623
+ * @example
624
+ * ```typescript
625
+ * const startingArguments = await aui.getControllerStartingArguments();
626
+ * console.log(startingArguments);
627
+ * // Output example:
628
+ * // {
629
+ * // displayNum: 0,
630
+ * // minimize: true,
631
+ * // runtime: 'desktop',
632
+ * // port: 5000,
633
+ * // actionWaitTime: 1000,
634
+ * // host: '127.0.0.1',
635
+ * // logFile: '/tmp/askui/askui-server.log',
636
+ * // hideOverlay: false,
637
+ * // debugDraw: false,
638
+ * // deviceId: 'emulator-5554',
639
+ * // configFile: '/tmp/askui/askui-config.json',
640
+ * // logLevel: 'info',
641
+ * // }
642
+ * ```
643
+ *
644
+ * @example Retrieving Android device ID:
645
+ * ```typescript
646
+ * const startingArguments = await aui.getControllerStartingArguments();
647
+ * console.log(startingArguments.deviceId);
648
+ * // Output example: "emulator-5554"
649
+ * ```
650
+ */
651
+ getControllerStartingArguments(): Promise<Record<'displayNum' | 'minimize' | 'runtime' | 'port' | 'actionWaitTime' | 'host' | 'logFile' | 'hideOverlay' | 'debugDraw' | 'deviceId' | 'configFile' | 'logLevel', string | number | boolean>>;
605
652
  }
@@ -464,7 +464,7 @@ class UiControlClient extends dsl_1.ApiCommands {
464
464
  throw error;
465
465
  }
466
466
  yield this.waitFor(waitTime).exec();
467
- yield this.waitUntil(AskUICommand, maxTry - 1);
467
+ yield this.waitUntil(AskUICommand, maxTry - 1, waitTime);
468
468
  }
469
469
  });
470
470
  }
@@ -850,5 +850,56 @@ class UiControlClient extends dsl_1.ApiCommands {
850
850
  this.agent.addTool(askUIListAIElementTool);
851
851
  });
852
852
  }
853
+ /**
854
+ * Retrieves the starting arguments used when the controller server was initialized.
855
+ *
856
+ * Useful for debugging, logging, or verifying the current server configuration.
857
+ *
858
+ * @property {string} displayNum - Display number controlled by the controller
859
+ * @property {boolean} minimize - Whether controller starts minimized
860
+ * @property {string} runtime - Runtime type ("desktop" or "android")
861
+ * @property {number} port - Communication port
862
+ * @property {number} actionWaitTime - Action wait time
863
+ * @property {string} host - Host address
864
+ * @property {string} logFile - Log file path
865
+ * @property {boolean} hideOverlay - Whether overlay is hidden
866
+ * @property {boolean} debugDraw - Whether debug drawing is enabled
867
+ * @property {string} deviceId - Android device ID
868
+ * @property {string} configFile - Configuration file path
869
+ * @property {string} logLevel - Logging level
870
+ *
871
+ * @example
872
+ * ```typescript
873
+ * const startingArguments = await aui.getControllerStartingArguments();
874
+ * console.log(startingArguments);
875
+ * // Output example:
876
+ * // {
877
+ * // displayNum: 0,
878
+ * // minimize: true,
879
+ * // runtime: 'desktop',
880
+ * // port: 5000,
881
+ * // actionWaitTime: 1000,
882
+ * // host: '127.0.0.1',
883
+ * // logFile: '/tmp/askui/askui-server.log',
884
+ * // hideOverlay: false,
885
+ * // debugDraw: false,
886
+ * // deviceId: 'emulator-5554',
887
+ * // configFile: '/tmp/askui/askui-config.json',
888
+ * // logLevel: 'info',
889
+ * // }
890
+ * ```
891
+ *
892
+ * @example Retrieving Android device ID:
893
+ * ```typescript
894
+ * const startingArguments = await aui.getControllerStartingArguments();
895
+ * console.log(startingArguments.deviceId);
896
+ * // Output example: "emulator-5554"
897
+ * ```
898
+ */
899
+ getControllerStartingArguments() {
900
+ return __awaiter(this, void 0, void 0, function* () {
901
+ return this.executionRuntime.getStartingArguments();
902
+ });
903
+ }
853
904
  }
854
905
  exports.UiControlClient = UiControlClient;
@@ -1,6 +1,6 @@
1
1
  import WebSocket from 'ws';
2
2
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
3
- import { CaptureScreenshotResponse, ControlResponse, StartRecordingResponse, StopRecordingResponse, ReadRecordingPartResponse, InteractiveAnnotationResponse, GetProcessPidResponse } from '../core/runner-protocol';
3
+ import { CaptureScreenshotResponse, ControlResponse, StartRecordingResponse, StopRecordingResponse, ReadRecordingPartResponse, InteractiveAnnotationResponse, GetProcessPidResponse, GetStartingArgumentsResponse } from '../core/runner-protocol';
4
4
  import { ControlCommand } from '../core/ui-control-commands';
5
5
  import { UiControllerClientConnectionState } from './ui-controller-client-connection-state';
6
6
  export declare class UiControllerClient {
@@ -22,6 +22,7 @@ export declare class UiControllerClient {
22
22
  private sendAndReceive;
23
23
  private send;
24
24
  requestScreenshot(): Promise<CaptureScreenshotResponse>;
25
+ getStartingArguments(): Promise<GetStartingArgumentsResponse>;
25
26
  getServerPid(): Promise<GetProcessPidResponse>;
26
27
  startVideoRecording(): Promise<StartRecordingResponse>;
27
28
  stopVideoRecording(): Promise<StopRecordingResponse>;
@@ -101,6 +101,9 @@ class UiControllerClient {
101
101
  requestScreenshot() {
102
102
  return this.sendAndReceive(new runner_protocol_1.CaptureScreenshotRequest());
103
103
  }
104
+ getStartingArguments() {
105
+ return this.sendAndReceive(new runner_protocol_1.GetStartingArgumentsRequest());
106
+ }
104
107
  getServerPid() {
105
108
  return this.sendAndReceive(new runner_protocol_1.GetProcessPidRequest());
106
109
  }
@@ -0,0 +1,5 @@
1
+ import { RunnerProtocolRequest } from './runner-protocol-request';
2
+ export declare class GetStartingArgumentsRequest implements RunnerProtocolRequest {
3
+ static msgName: string;
4
+ msgName: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ export class GetStartingArgumentsRequest {
2
+ constructor() {
3
+ this.msgName = GetStartingArgumentsRequest.msgName;
4
+ }
5
+ }
6
+ GetStartingArgumentsRequest.msgName = 'GET_STARTING_ARGUMENTS_REQUEST';
@@ -6,3 +6,4 @@ export { RunnerProtocolRequest } from './runner-protocol-request';
6
6
  export { StartRecordingRequest } from './start-recording-request';
7
7
  export { StopRecordingRequest } from './stop-recording-request';
8
8
  export { GetProcessPidRequest } from './get-server-process-pid';
9
+ export { GetStartingArgumentsRequest } from './get-starting-arguments-request';
@@ -5,3 +5,4 @@ export { ReadRecordingRequest } from './read-recording-request';
5
5
  export { StartRecordingRequest } from './start-recording-request';
6
6
  export { StopRecordingRequest } from './stop-recording-request';
7
7
  export { GetProcessPidRequest } from './get-server-process-pid';
8
+ export { GetStartingArgumentsRequest } from './get-starting-arguments-request';
@@ -100,3 +100,10 @@ export interface GetProcessPidResponse {
100
100
  };
101
101
  msgName: 'GET_PROCESS_PID_RESPONSE';
102
102
  }
103
+ export interface GetStartingArgumentsResponse {
104
+ data: {
105
+ error?: string;
106
+ arguments: Record<string, string>;
107
+ };
108
+ msgName: 'GET_STARTING_ARGUMENTS_RESPONSE';
109
+ }
@@ -37,6 +37,7 @@ export declare class ExecutionRuntime {
37
37
  private predictCommand;
38
38
  annotateInteractively(): Promise<void>;
39
39
  takeScreenshotIfImageisNotProvided(imagePath?: string): Promise<string>;
40
+ getStartingArguments(): Promise<Record<string, string | number | boolean>>;
40
41
  getDetectedElements(instruction: string, customElementJson?: CustomElementJson[]): Promise<DetectedElement[]>;
41
42
  annotateImage(imagePath?: string, customElementJson?: CustomElementJson[], elements?: DetectedElement[]): Promise<Annotation>;
42
43
  predictVQA(prompt: string, config?: object): Promise<any>;
@@ -180,6 +180,12 @@ export class ExecutionRuntime {
180
180
  return base64Image;
181
181
  });
182
182
  }
183
+ getStartingArguments() {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ const startingArgumentsResponse = yield this.uiControllerClient.getStartingArguments();
186
+ return startingArgumentsResponse.data.arguments;
187
+ });
188
+ }
183
189
  getDetectedElements(instruction, customElementJson) {
184
190
  return __awaiter(this, void 0, void 0, function* () {
185
191
  let customElements = [];
@@ -602,4 +602,51 @@ export declare class UiControlClient extends ApiCommands {
602
602
  * @returns {Promise<void>} - A promise that resolves when the tools are added to the agent.
603
603
  */
604
604
  addAIElementsToolsToAgent(): Promise<void>;
605
+ /**
606
+ * Retrieves the starting arguments used when the controller server was initialized.
607
+ *
608
+ * Useful for debugging, logging, or verifying the current server configuration.
609
+ *
610
+ * @property {string} displayNum - Display number controlled by the controller
611
+ * @property {boolean} minimize - Whether controller starts minimized
612
+ * @property {string} runtime - Runtime type ("desktop" or "android")
613
+ * @property {number} port - Communication port
614
+ * @property {number} actionWaitTime - Action wait time
615
+ * @property {string} host - Host address
616
+ * @property {string} logFile - Log file path
617
+ * @property {boolean} hideOverlay - Whether overlay is hidden
618
+ * @property {boolean} debugDraw - Whether debug drawing is enabled
619
+ * @property {string} deviceId - Android device ID
620
+ * @property {string} configFile - Configuration file path
621
+ * @property {string} logLevel - Logging level
622
+ *
623
+ * @example
624
+ * ```typescript
625
+ * const startingArguments = await aui.getControllerStartingArguments();
626
+ * console.log(startingArguments);
627
+ * // Output example:
628
+ * // {
629
+ * // displayNum: 0,
630
+ * // minimize: true,
631
+ * // runtime: 'desktop',
632
+ * // port: 5000,
633
+ * // actionWaitTime: 1000,
634
+ * // host: '127.0.0.1',
635
+ * // logFile: '/tmp/askui/askui-server.log',
636
+ * // hideOverlay: false,
637
+ * // debugDraw: false,
638
+ * // deviceId: 'emulator-5554',
639
+ * // configFile: '/tmp/askui/askui-config.json',
640
+ * // logLevel: 'info',
641
+ * // }
642
+ * ```
643
+ *
644
+ * @example Retrieving Android device ID:
645
+ * ```typescript
646
+ * const startingArguments = await aui.getControllerStartingArguments();
647
+ * console.log(startingArguments.deviceId);
648
+ * // Output example: "emulator-5554"
649
+ * ```
650
+ */
651
+ getControllerStartingArguments(): Promise<Record<'displayNum' | 'minimize' | 'runtime' | 'port' | 'actionWaitTime' | 'host' | 'logFile' | 'hideOverlay' | 'debugDraw' | 'deviceId' | 'configFile' | 'logLevel', string | number | boolean>>;
605
652
  }
@@ -461,7 +461,7 @@ export class UiControlClient extends ApiCommands {
461
461
  throw error;
462
462
  }
463
463
  yield this.waitFor(waitTime).exec();
464
- yield this.waitUntil(AskUICommand, maxTry - 1);
464
+ yield this.waitUntil(AskUICommand, maxTry - 1, waitTime);
465
465
  }
466
466
  });
467
467
  }
@@ -847,4 +847,55 @@ export class UiControlClient extends ApiCommands {
847
847
  this.agent.addTool(askUIListAIElementTool);
848
848
  });
849
849
  }
850
+ /**
851
+ * Retrieves the starting arguments used when the controller server was initialized.
852
+ *
853
+ * Useful for debugging, logging, or verifying the current server configuration.
854
+ *
855
+ * @property {string} displayNum - Display number controlled by the controller
856
+ * @property {boolean} minimize - Whether controller starts minimized
857
+ * @property {string} runtime - Runtime type ("desktop" or "android")
858
+ * @property {number} port - Communication port
859
+ * @property {number} actionWaitTime - Action wait time
860
+ * @property {string} host - Host address
861
+ * @property {string} logFile - Log file path
862
+ * @property {boolean} hideOverlay - Whether overlay is hidden
863
+ * @property {boolean} debugDraw - Whether debug drawing is enabled
864
+ * @property {string} deviceId - Android device ID
865
+ * @property {string} configFile - Configuration file path
866
+ * @property {string} logLevel - Logging level
867
+ *
868
+ * @example
869
+ * ```typescript
870
+ * const startingArguments = await aui.getControllerStartingArguments();
871
+ * console.log(startingArguments);
872
+ * // Output example:
873
+ * // {
874
+ * // displayNum: 0,
875
+ * // minimize: true,
876
+ * // runtime: 'desktop',
877
+ * // port: 5000,
878
+ * // actionWaitTime: 1000,
879
+ * // host: '127.0.0.1',
880
+ * // logFile: '/tmp/askui/askui-server.log',
881
+ * // hideOverlay: false,
882
+ * // debugDraw: false,
883
+ * // deviceId: 'emulator-5554',
884
+ * // configFile: '/tmp/askui/askui-config.json',
885
+ * // logLevel: 'info',
886
+ * // }
887
+ * ```
888
+ *
889
+ * @example Retrieving Android device ID:
890
+ * ```typescript
891
+ * const startingArguments = await aui.getControllerStartingArguments();
892
+ * console.log(startingArguments.deviceId);
893
+ * // Output example: "emulator-5554"
894
+ * ```
895
+ */
896
+ getControllerStartingArguments() {
897
+ return __awaiter(this, void 0, void 0, function* () {
898
+ return this.executionRuntime.getStartingArguments();
899
+ });
900
+ }
850
901
  }
@@ -1,6 +1,6 @@
1
1
  import WebSocket from 'ws';
2
2
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
3
- import { CaptureScreenshotResponse, ControlResponse, StartRecordingResponse, StopRecordingResponse, ReadRecordingPartResponse, InteractiveAnnotationResponse, GetProcessPidResponse } from '../core/runner-protocol';
3
+ import { CaptureScreenshotResponse, ControlResponse, StartRecordingResponse, StopRecordingResponse, ReadRecordingPartResponse, InteractiveAnnotationResponse, GetProcessPidResponse, GetStartingArgumentsResponse } from '../core/runner-protocol';
4
4
  import { ControlCommand } from '../core/ui-control-commands';
5
5
  import { UiControllerClientConnectionState } from './ui-controller-client-connection-state';
6
6
  export declare class UiControllerClient {
@@ -22,6 +22,7 @@ export declare class UiControllerClient {
22
22
  private sendAndReceive;
23
23
  private send;
24
24
  requestScreenshot(): Promise<CaptureScreenshotResponse>;
25
+ getStartingArguments(): Promise<GetStartingArgumentsResponse>;
25
26
  getServerPid(): Promise<GetProcessPidResponse>;
26
27
  startVideoRecording(): Promise<StartRecordingResponse>;
27
28
  stopVideoRecording(): Promise<StopRecordingResponse>;
@@ -1,5 +1,5 @@
1
1
  import WebSocket from 'ws';
2
- import { CaptureScreenshotRequest, ControlRequest, StartRecordingRequest, StopRecordingRequest, ReadRecordingRequest, InteractiveAnnotationRequest, GetProcessPidRequest, } from '../core/runner-protocol';
2
+ import { CaptureScreenshotRequest, ControlRequest, StartRecordingRequest, StopRecordingRequest, ReadRecordingRequest, InteractiveAnnotationRequest, GetProcessPidRequest, GetStartingArgumentsRequest, } from '../core/runner-protocol';
3
3
  import { logger } from '../lib/logger';
4
4
  import { UiControllerClientConnectionState } from './ui-controller-client-connection-state';
5
5
  import { ReadRecordingResponseStreamHandler } from './read-recording-response-stream-handler';
@@ -95,6 +95,9 @@ export class UiControllerClient {
95
95
  requestScreenshot() {
96
96
  return this.sendAndReceive(new CaptureScreenshotRequest());
97
97
  }
98
+ getStartingArguments() {
99
+ return this.sendAndReceive(new GetStartingArgumentsRequest());
100
+ }
98
101
  getServerPid() {
99
102
  return this.sendAndReceive(new GetProcessPidRequest());
100
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.27.0",
3
+ "version": "0.28.1",
4
4
  "license": "MIT",
5
5
  "author": "askui GmbH <info@askui.com> (http://www.askui.com/)",
6
6
  "description": "Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on",