askui 0.8.0 → 0.10.0

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.
@@ -26,6 +26,12 @@ export declare class Exec extends FluentBase implements Executable {
26
26
  exec(): Promise<void>;
27
27
  }
28
28
  export declare class FluentFilters extends FluentBase {
29
+ /**
30
+ * Filters for a UI element 'other element'.
31
+ *
32
+ * @return {FluentFiltersOrRelations}
33
+ */
34
+ otherElement(): FluentFiltersOrRelations;
29
35
  /**
30
36
  * Filters for a UI element 'table'.
31
37
  *
@@ -50,6 +56,30 @@ export declare class FluentFilters extends FluentBase {
50
56
  * @return {FluentFiltersOrRelations}
51
57
  */
52
58
  checkbox(): FluentFiltersOrRelations;
59
+ /**
60
+ * Filters for any UI element on the screen.
61
+ *
62
+ * **Examples:**
63
+ * ```typescript
64
+ * await aui.moveMouseTo().element().exec()
65
+ * ```
66
+ *
67
+ * @return {FluentFiltersOrRelations}
68
+ */
69
+ element(): FluentFiltersOrRelations;
70
+ /**
71
+ * Filters special elements
72
+ *
73
+ * **Examples:**
74
+ * ```typescript
75
+ * await aui.moveMouseTo().element().special("circle").exec()
76
+ * ```
77
+ *
78
+ * @param {string} text - A text to be matched.
79
+ *
80
+ * @return {FluentFiltersOrRelations}
81
+ */
82
+ special(text: string): FluentFiltersOrRelations;
53
83
  /**
54
84
  * Filters for a UI element 'button'.
55
85
  *
@@ -512,6 +542,12 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
512
542
  exec(): Promise<void>;
513
543
  }
514
544
  export declare class FluentFiltersCondition extends FluentBase {
545
+ /**
546
+ * Filters for a UI element 'other element'.
547
+ *
548
+ * @return {FluentFiltersOrRelationsCondition}
549
+ */
550
+ otherElement(): FluentFiltersOrRelationsCondition;
515
551
  /**
516
552
  * Filters for a UI element 'table'.
517
553
  *
@@ -536,6 +572,30 @@ export declare class FluentFiltersCondition extends FluentBase {
536
572
  * @return {FluentFiltersOrRelationsCondition}
537
573
  */
538
574
  checkbox(): FluentFiltersOrRelationsCondition;
575
+ /**
576
+ * Filters for any UI element on the screen.
577
+ *
578
+ * **Examples:**
579
+ * ```typescript
580
+ * await aui.moveMouseTo().element().exec()
581
+ * ```
582
+ *
583
+ * @return {FluentFiltersOrRelationsCondition}
584
+ */
585
+ element(): FluentFiltersOrRelationsCondition;
586
+ /**
587
+ * Filters special elements
588
+ *
589
+ * **Examples:**
590
+ * ```typescript
591
+ * await aui.moveMouseTo().element().special("circle").exec()
592
+ * ```
593
+ *
594
+ * @param {string} text - A text to be matched.
595
+ *
596
+ * @return {FluentFiltersOrRelationsCondition}
597
+ */
598
+ special(text: string): FluentFiltersOrRelationsCondition;
539
599
  /**
540
600
  * Filters for a UI element 'button'.
541
601
  *
@@ -1443,6 +1503,12 @@ export declare class ExecGetter extends FluentBase implements ExecutableGetter {
1443
1503
  exec(): Promise<DetectedElement[]>;
1444
1504
  }
1445
1505
  export declare class FluentFiltersGetter extends FluentBase {
1506
+ /**
1507
+ * Filters for a UI element 'other element'.
1508
+ *
1509
+ * @return {FluentFiltersOrRelationsGetter}
1510
+ */
1511
+ otherElement(): FluentFiltersOrRelationsGetter;
1446
1512
  /**
1447
1513
  * Filters for a UI element 'table'.
1448
1514
  *
@@ -1467,6 +1533,30 @@ export declare class FluentFiltersGetter extends FluentBase {
1467
1533
  * @return {FluentFiltersOrRelationsGetter}
1468
1534
  */
1469
1535
  checkbox(): FluentFiltersOrRelationsGetter;
1536
+ /**
1537
+ * Filters for any UI element on the screen.
1538
+ *
1539
+ * **Examples:**
1540
+ * ```typescript
1541
+ * await aui.moveMouseTo().element().exec()
1542
+ * ```
1543
+ *
1544
+ * @return {FluentFiltersOrRelationsGetter}
1545
+ */
1546
+ element(): FluentFiltersOrRelationsGetter;
1547
+ /**
1548
+ * Filters special elements
1549
+ *
1550
+ * **Examples:**
1551
+ * ```typescript
1552
+ * await aui.moveMouseTo().element().special("circle").exec()
1553
+ * ```
1554
+ *
1555
+ * @param {string} text - A text to be matched.
1556
+ *
1557
+ * @return {FluentFiltersOrRelationsGetter}
1558
+ */
1559
+ special(text: string): FluentFiltersOrRelationsGetter;
1470
1560
  /**
1471
1561
  * Filters for a UI element 'button'.
1472
1562
  *
@@ -62,6 +62,15 @@ class Exec extends FluentBase {
62
62
  exports.Exec = Exec;
63
63
  // Filters
64
64
  class FluentFilters extends FluentBase {
65
+ /**
66
+ * Filters for a UI element 'other element'.
67
+ *
68
+ * @return {FluentFiltersOrRelations}
69
+ */
70
+ otherElement() {
71
+ this._textStr = 'other element';
72
+ return new FluentFiltersOrRelations(this);
73
+ }
65
74
  /**
66
75
  * Filters for a UI element 'table'.
67
76
  *
@@ -98,6 +107,36 @@ class FluentFilters extends FluentBase {
98
107
  this._textStr = 'checkbox';
99
108
  return new FluentFiltersOrRelations(this);
100
109
  }
110
+ /**
111
+ * Filters for any UI element on the screen.
112
+ *
113
+ * **Examples:**
114
+ * ```typescript
115
+ * await aui.moveMouseTo().element().exec()
116
+ * ```
117
+ *
118
+ * @return {FluentFiltersOrRelations}
119
+ */
120
+ element() {
121
+ this._textStr = 'element';
122
+ return new FluentFiltersOrRelations(this);
123
+ }
124
+ /**
125
+ * Filters special elements
126
+ *
127
+ * **Examples:**
128
+ * ```typescript
129
+ * await aui.moveMouseTo().element().special("circle").exec()
130
+ * ```
131
+ *
132
+ * @param {string} text - A text to be matched.
133
+ *
134
+ * @return {FluentFiltersOrRelations}
135
+ */
136
+ special(text) {
137
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
138
+ return new FluentFiltersOrRelations(this);
139
+ }
101
140
  /**
102
141
  * Filters for a UI element 'button'.
103
142
  *
@@ -627,6 +666,15 @@ class FluentFiltersOrRelations extends FluentFilters {
627
666
  exports.FluentFiltersOrRelations = FluentFiltersOrRelations;
628
667
  // Filters
629
668
  class FluentFiltersCondition extends FluentBase {
669
+ /**
670
+ * Filters for a UI element 'other element'.
671
+ *
672
+ * @return {FluentFiltersOrRelationsCondition}
673
+ */
674
+ otherElement() {
675
+ this._textStr = 'other element';
676
+ return new FluentFiltersOrRelationsCondition(this);
677
+ }
630
678
  /**
631
679
  * Filters for a UI element 'table'.
632
680
  *
@@ -663,6 +711,36 @@ class FluentFiltersCondition extends FluentBase {
663
711
  this._textStr = 'checkbox';
664
712
  return new FluentFiltersOrRelationsCondition(this);
665
713
  }
714
+ /**
715
+ * Filters for any UI element on the screen.
716
+ *
717
+ * **Examples:**
718
+ * ```typescript
719
+ * await aui.moveMouseTo().element().exec()
720
+ * ```
721
+ *
722
+ * @return {FluentFiltersOrRelationsCondition}
723
+ */
724
+ element() {
725
+ this._textStr = 'element';
726
+ return new FluentFiltersOrRelationsCondition(this);
727
+ }
728
+ /**
729
+ * Filters special elements
730
+ *
731
+ * **Examples:**
732
+ * ```typescript
733
+ * await aui.moveMouseTo().element().special("circle").exec()
734
+ * ```
735
+ *
736
+ * @param {string} text - A text to be matched.
737
+ *
738
+ * @return {FluentFiltersOrRelationsCondition}
739
+ */
740
+ special(text) {
741
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
742
+ return new FluentFiltersOrRelationsCondition(this);
743
+ }
666
744
  /**
667
745
  * Filters for a UI element 'button'.
668
746
  *
@@ -1722,6 +1800,15 @@ class ExecGetter extends FluentBase {
1722
1800
  exports.ExecGetter = ExecGetter;
1723
1801
  // Filters
1724
1802
  class FluentFiltersGetter extends FluentBase {
1803
+ /**
1804
+ * Filters for a UI element 'other element'.
1805
+ *
1806
+ * @return {FluentFiltersOrRelationsGetter}
1807
+ */
1808
+ otherElement() {
1809
+ this._textStr = 'other element';
1810
+ return new FluentFiltersOrRelationsGetter(this);
1811
+ }
1725
1812
  /**
1726
1813
  * Filters for a UI element 'table'.
1727
1814
  *
@@ -1758,6 +1845,36 @@ class FluentFiltersGetter extends FluentBase {
1758
1845
  this._textStr = 'checkbox';
1759
1846
  return new FluentFiltersOrRelationsGetter(this);
1760
1847
  }
1848
+ /**
1849
+ * Filters for any UI element on the screen.
1850
+ *
1851
+ * **Examples:**
1852
+ * ```typescript
1853
+ * await aui.moveMouseTo().element().exec()
1854
+ * ```
1855
+ *
1856
+ * @return {FluentFiltersOrRelationsGetter}
1857
+ */
1858
+ element() {
1859
+ this._textStr = 'element';
1860
+ return new FluentFiltersOrRelationsGetter(this);
1861
+ }
1862
+ /**
1863
+ * Filters special elements
1864
+ *
1865
+ * **Examples:**
1866
+ * ```typescript
1867
+ * await aui.moveMouseTo().element().special("circle").exec()
1868
+ * ```
1869
+ *
1870
+ * @param {string} text - A text to be matched.
1871
+ *
1872
+ * @return {FluentFiltersOrRelationsGetter}
1873
+ */
1874
+ special(text) {
1875
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
1876
+ return new FluentFiltersOrRelationsGetter(this);
1877
+ }
1761
1878
  /**
1762
1879
  * Filters for a UI element 'button'.
1763
1880
  *
@@ -3,14 +3,16 @@ import { ControlCommand } from '../core/ui-control-commands';
3
3
  import { CustomElement } from '../core/model/test-case-dto';
4
4
  import { Annotation } from '../core/annotation/annotation';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
+ import { ModelCompositionBranch } from './model-composition-branch';
6
7
  export declare class InferenceClient {
7
8
  baseUrl: string;
8
9
  httpClient: HttpClientGot;
9
10
  resize?: number | undefined;
10
11
  readonly workspaceId?: string | undefined;
12
+ readonly modelComposition?: ModelCompositionBranch[] | undefined;
11
13
  apiVersion: string;
12
14
  url: string;
13
- constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, apiVersion?: string);
15
+ constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, modelComposition?: ModelCompositionBranch[] | undefined, apiVersion?: string);
14
16
  isImageRequired(instruction: string): Promise<boolean>;
15
17
  private resizeIfNeeded;
16
18
  inference(customElements?: CustomElement[], image?: string, instruction?: string): Promise<ControlCommand | Annotation>;
@@ -21,11 +21,12 @@ const inference_response_error_1 = require("./inference-response-error");
21
21
  const config_error_1 = require("./config-error");
22
22
  const logger_1 = require("../lib/logger");
23
23
  class InferenceClient {
24
- constructor(baseUrl, httpClient, resize, workspaceId, apiVersion = 'v3') {
24
+ constructor(baseUrl, httpClient, resize, workspaceId, modelComposition, apiVersion = 'v3') {
25
25
  this.baseUrl = baseUrl;
26
26
  this.httpClient = httpClient;
27
27
  this.resize = resize;
28
28
  this.workspaceId = workspaceId;
29
+ this.modelComposition = modelComposition;
29
30
  this.apiVersion = apiVersion;
30
31
  const versionedBaseUrl = (0, url_join_1.default)(this.baseUrl, 'api', this.apiVersion);
31
32
  this.url = workspaceId
@@ -62,6 +63,7 @@ class InferenceClient {
62
63
  image: resizedImage.base64Image,
63
64
  instruction,
64
65
  customElements,
66
+ modelComposition: this.modelComposition,
65
67
  };
66
68
  const url = (0, url_join_1.default)(this.url, 'inference');
67
69
  const response = yield this.httpClient.post(url, requestBody);
@@ -0,0 +1,8 @@
1
+ export interface ModelCompositionBranch {
2
+ task: string;
3
+ architecture: string;
4
+ version: string;
5
+ interface: string;
6
+ useCase: string;
7
+ tags: string[];
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -52,7 +52,7 @@ class UiControlClient extends dsl_1.ApiCommands {
52
52
  return this._uiControllerClient;
53
53
  }
54
54
  get inferenceClient() {
55
- return new inference_client_1.InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId);
55
+ return new inference_client_1.InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId, this.clientArgs.modelComposition);
56
56
  }
57
57
  get executionRuntime() {
58
58
  return new execution_runtime_1.ExecutionRuntime(this.uiControllerClient, this.inferenceClient);
@@ -1,6 +1,7 @@
1
1
  import { AnnotationLevel } from './annotation-level';
2
2
  import { CredentialArgs } from './credentials-args';
3
3
  import { ProxyAgentArgs } from '../shared/proxy-agent-args';
4
+ import { ModelCompositionBranch } from './model-composition-branch';
4
5
  /**
5
6
  * Configuration options for the askui UI Control Client
6
7
  *
@@ -32,6 +33,7 @@ export interface ClientArgs {
32
33
  readonly credentials?: CredentialArgs;
33
34
  readonly proxyAgents?: ProxyAgentArgs;
34
35
  readonly resize?: number;
36
+ readonly modelComposition?: ModelCompositionBranch[];
35
37
  }
36
38
  export interface ClientArgsWithDefaults extends ClientArgs {
37
39
  readonly uiControllerUrl: string;
@@ -48,7 +48,7 @@ class UiControllerClient {
48
48
  this.ws.on('error', (error) => {
49
49
  this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.ERROR;
50
50
  reject(new ui_control_client_error_1.UiControlClientError(`Connection to UI Controller cannot be established,
51
- Probably it was not started. Makse sure you started UI Controller with this
51
+ Probably it was not started. Make sure you started UI Controller with this
52
52
  Url ${this.url}. Error message ${error.message}`));
53
53
  });
54
54
  }
@@ -26,6 +26,12 @@ export declare class Exec extends FluentBase implements Executable {
26
26
  exec(): Promise<void>;
27
27
  }
28
28
  export declare class FluentFilters extends FluentBase {
29
+ /**
30
+ * Filters for a UI element 'other element'.
31
+ *
32
+ * @return {FluentFiltersOrRelations}
33
+ */
34
+ otherElement(): FluentFiltersOrRelations;
29
35
  /**
30
36
  * Filters for a UI element 'table'.
31
37
  *
@@ -50,6 +56,30 @@ export declare class FluentFilters extends FluentBase {
50
56
  * @return {FluentFiltersOrRelations}
51
57
  */
52
58
  checkbox(): FluentFiltersOrRelations;
59
+ /**
60
+ * Filters for any UI element on the screen.
61
+ *
62
+ * **Examples:**
63
+ * ```typescript
64
+ * await aui.moveMouseTo().element().exec()
65
+ * ```
66
+ *
67
+ * @return {FluentFiltersOrRelations}
68
+ */
69
+ element(): FluentFiltersOrRelations;
70
+ /**
71
+ * Filters special elements
72
+ *
73
+ * **Examples:**
74
+ * ```typescript
75
+ * await aui.moveMouseTo().element().special("circle").exec()
76
+ * ```
77
+ *
78
+ * @param {string} text - A text to be matched.
79
+ *
80
+ * @return {FluentFiltersOrRelations}
81
+ */
82
+ special(text: string): FluentFiltersOrRelations;
53
83
  /**
54
84
  * Filters for a UI element 'button'.
55
85
  *
@@ -512,6 +542,12 @@ export declare class FluentFiltersOrRelations extends FluentFilters {
512
542
  exec(): Promise<void>;
513
543
  }
514
544
  export declare class FluentFiltersCondition extends FluentBase {
545
+ /**
546
+ * Filters for a UI element 'other element'.
547
+ *
548
+ * @return {FluentFiltersOrRelationsCondition}
549
+ */
550
+ otherElement(): FluentFiltersOrRelationsCondition;
515
551
  /**
516
552
  * Filters for a UI element 'table'.
517
553
  *
@@ -536,6 +572,30 @@ export declare class FluentFiltersCondition extends FluentBase {
536
572
  * @return {FluentFiltersOrRelationsCondition}
537
573
  */
538
574
  checkbox(): FluentFiltersOrRelationsCondition;
575
+ /**
576
+ * Filters for any UI element on the screen.
577
+ *
578
+ * **Examples:**
579
+ * ```typescript
580
+ * await aui.moveMouseTo().element().exec()
581
+ * ```
582
+ *
583
+ * @return {FluentFiltersOrRelationsCondition}
584
+ */
585
+ element(): FluentFiltersOrRelationsCondition;
586
+ /**
587
+ * Filters special elements
588
+ *
589
+ * **Examples:**
590
+ * ```typescript
591
+ * await aui.moveMouseTo().element().special("circle").exec()
592
+ * ```
593
+ *
594
+ * @param {string} text - A text to be matched.
595
+ *
596
+ * @return {FluentFiltersOrRelationsCondition}
597
+ */
598
+ special(text: string): FluentFiltersOrRelationsCondition;
539
599
  /**
540
600
  * Filters for a UI element 'button'.
541
601
  *
@@ -1443,6 +1503,12 @@ export declare class ExecGetter extends FluentBase implements ExecutableGetter {
1443
1503
  exec(): Promise<DetectedElement[]>;
1444
1504
  }
1445
1505
  export declare class FluentFiltersGetter extends FluentBase {
1506
+ /**
1507
+ * Filters for a UI element 'other element'.
1508
+ *
1509
+ * @return {FluentFiltersOrRelationsGetter}
1510
+ */
1511
+ otherElement(): FluentFiltersOrRelationsGetter;
1446
1512
  /**
1447
1513
  * Filters for a UI element 'table'.
1448
1514
  *
@@ -1467,6 +1533,30 @@ export declare class FluentFiltersGetter extends FluentBase {
1467
1533
  * @return {FluentFiltersOrRelationsGetter}
1468
1534
  */
1469
1535
  checkbox(): FluentFiltersOrRelationsGetter;
1536
+ /**
1537
+ * Filters for any UI element on the screen.
1538
+ *
1539
+ * **Examples:**
1540
+ * ```typescript
1541
+ * await aui.moveMouseTo().element().exec()
1542
+ * ```
1543
+ *
1544
+ * @return {FluentFiltersOrRelationsGetter}
1545
+ */
1546
+ element(): FluentFiltersOrRelationsGetter;
1547
+ /**
1548
+ * Filters special elements
1549
+ *
1550
+ * **Examples:**
1551
+ * ```typescript
1552
+ * await aui.moveMouseTo().element().special("circle").exec()
1553
+ * ```
1554
+ *
1555
+ * @param {string} text - A text to be matched.
1556
+ *
1557
+ * @return {FluentFiltersOrRelationsGetter}
1558
+ */
1559
+ special(text: string): FluentFiltersOrRelationsGetter;
1470
1560
  /**
1471
1561
  * Filters for a UI element 'button'.
1472
1562
  *
@@ -58,6 +58,15 @@ export class Exec extends FluentBase {
58
58
  }
59
59
  // Filters
60
60
  export class FluentFilters extends FluentBase {
61
+ /**
62
+ * Filters for a UI element 'other element'.
63
+ *
64
+ * @return {FluentFiltersOrRelations}
65
+ */
66
+ otherElement() {
67
+ this._textStr = 'other element';
68
+ return new FluentFiltersOrRelations(this);
69
+ }
61
70
  /**
62
71
  * Filters for a UI element 'table'.
63
72
  *
@@ -94,6 +103,36 @@ export class FluentFilters extends FluentBase {
94
103
  this._textStr = 'checkbox';
95
104
  return new FluentFiltersOrRelations(this);
96
105
  }
106
+ /**
107
+ * Filters for any UI element on the screen.
108
+ *
109
+ * **Examples:**
110
+ * ```typescript
111
+ * await aui.moveMouseTo().element().exec()
112
+ * ```
113
+ *
114
+ * @return {FluentFiltersOrRelations}
115
+ */
116
+ element() {
117
+ this._textStr = 'element';
118
+ return new FluentFiltersOrRelations(this);
119
+ }
120
+ /**
121
+ * Filters special elements
122
+ *
123
+ * **Examples:**
124
+ * ```typescript
125
+ * await aui.moveMouseTo().element().special("circle").exec()
126
+ * ```
127
+ *
128
+ * @param {string} text - A text to be matched.
129
+ *
130
+ * @return {FluentFiltersOrRelations}
131
+ */
132
+ special(text) {
133
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
134
+ return new FluentFiltersOrRelations(this);
135
+ }
97
136
  /**
98
137
  * Filters for a UI element 'button'.
99
138
  *
@@ -621,6 +660,15 @@ export class FluentFiltersOrRelations extends FluentFilters {
621
660
  }
622
661
  // Filters
623
662
  export class FluentFiltersCondition extends FluentBase {
663
+ /**
664
+ * Filters for a UI element 'other element'.
665
+ *
666
+ * @return {FluentFiltersOrRelationsCondition}
667
+ */
668
+ otherElement() {
669
+ this._textStr = 'other element';
670
+ return new FluentFiltersOrRelationsCondition(this);
671
+ }
624
672
  /**
625
673
  * Filters for a UI element 'table'.
626
674
  *
@@ -657,6 +705,36 @@ export class FluentFiltersCondition extends FluentBase {
657
705
  this._textStr = 'checkbox';
658
706
  return new FluentFiltersOrRelationsCondition(this);
659
707
  }
708
+ /**
709
+ * Filters for any UI element on the screen.
710
+ *
711
+ * **Examples:**
712
+ * ```typescript
713
+ * await aui.moveMouseTo().element().exec()
714
+ * ```
715
+ *
716
+ * @return {FluentFiltersOrRelationsCondition}
717
+ */
718
+ element() {
719
+ this._textStr = 'element';
720
+ return new FluentFiltersOrRelationsCondition(this);
721
+ }
722
+ /**
723
+ * Filters special elements
724
+ *
725
+ * **Examples:**
726
+ * ```typescript
727
+ * await aui.moveMouseTo().element().special("circle").exec()
728
+ * ```
729
+ *
730
+ * @param {string} text - A text to be matched.
731
+ *
732
+ * @return {FluentFiltersOrRelationsCondition}
733
+ */
734
+ special(text) {
735
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
736
+ return new FluentFiltersOrRelationsCondition(this);
737
+ }
660
738
  /**
661
739
  * Filters for a UI element 'button'.
662
740
  *
@@ -1712,6 +1790,15 @@ export class ExecGetter extends FluentBase {
1712
1790
  }
1713
1791
  // Filters
1714
1792
  export class FluentFiltersGetter extends FluentBase {
1793
+ /**
1794
+ * Filters for a UI element 'other element'.
1795
+ *
1796
+ * @return {FluentFiltersOrRelationsGetter}
1797
+ */
1798
+ otherElement() {
1799
+ this._textStr = 'other element';
1800
+ return new FluentFiltersOrRelationsGetter(this);
1801
+ }
1715
1802
  /**
1716
1803
  * Filters for a UI element 'table'.
1717
1804
  *
@@ -1748,6 +1835,36 @@ export class FluentFiltersGetter extends FluentBase {
1748
1835
  this._textStr = 'checkbox';
1749
1836
  return new FluentFiltersOrRelationsGetter(this);
1750
1837
  }
1838
+ /**
1839
+ * Filters for any UI element on the screen.
1840
+ *
1841
+ * **Examples:**
1842
+ * ```typescript
1843
+ * await aui.moveMouseTo().element().exec()
1844
+ * ```
1845
+ *
1846
+ * @return {FluentFiltersOrRelationsGetter}
1847
+ */
1848
+ element() {
1849
+ this._textStr = 'element';
1850
+ return new FluentFiltersOrRelationsGetter(this);
1851
+ }
1852
+ /**
1853
+ * Filters special elements
1854
+ *
1855
+ * **Examples:**
1856
+ * ```typescript
1857
+ * await aui.moveMouseTo().element().special("circle").exec()
1858
+ * ```
1859
+ *
1860
+ * @param {string} text - A text to be matched.
1861
+ *
1862
+ * @return {FluentFiltersOrRelationsGetter}
1863
+ */
1864
+ special(text) {
1865
+ this._textStr = `special ${Separators.STRING}${text}${Separators.STRING}`;
1866
+ return new FluentFiltersOrRelationsGetter(this);
1867
+ }
1751
1868
  /**
1752
1869
  * Filters for a UI element 'button'.
1753
1870
  *
@@ -3,14 +3,16 @@ import { ControlCommand } from '../core/ui-control-commands';
3
3
  import { CustomElement } from '../core/model/test-case-dto';
4
4
  import { Annotation } from '../core/annotation/annotation';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
+ import { ModelCompositionBranch } from './model-composition-branch';
6
7
  export declare class InferenceClient {
7
8
  baseUrl: string;
8
9
  httpClient: HttpClientGot;
9
10
  resize?: number | undefined;
10
11
  readonly workspaceId?: string | undefined;
12
+ readonly modelComposition?: ModelCompositionBranch[] | undefined;
11
13
  apiVersion: string;
12
14
  url: string;
13
- constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, apiVersion?: string);
15
+ constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, modelComposition?: ModelCompositionBranch[] | undefined, apiVersion?: string);
14
16
  isImageRequired(instruction: string): Promise<boolean>;
15
17
  private resizeIfNeeded;
16
18
  inference(customElements?: CustomElement[], image?: string, instruction?: string): Promise<ControlCommand | Annotation>;
@@ -15,11 +15,12 @@ import { InferenceResponseError } from './inference-response-error';
15
15
  import { ConfigurationError } from './config-error';
16
16
  import { logger } from '../lib/logger';
17
17
  export class InferenceClient {
18
- constructor(baseUrl, httpClient, resize, workspaceId, apiVersion = 'v3') {
18
+ constructor(baseUrl, httpClient, resize, workspaceId, modelComposition, apiVersion = 'v3') {
19
19
  this.baseUrl = baseUrl;
20
20
  this.httpClient = httpClient;
21
21
  this.resize = resize;
22
22
  this.workspaceId = workspaceId;
23
+ this.modelComposition = modelComposition;
23
24
  this.apiVersion = apiVersion;
24
25
  const versionedBaseUrl = urljoin(this.baseUrl, 'api', this.apiVersion);
25
26
  this.url = workspaceId
@@ -56,6 +57,7 @@ export class InferenceClient {
56
57
  image: resizedImage.base64Image,
57
58
  instruction,
58
59
  customElements,
60
+ modelComposition: this.modelComposition,
59
61
  };
60
62
  const url = urljoin(this.url, 'inference');
61
63
  const response = yield this.httpClient.post(url, requestBody);
@@ -0,0 +1,8 @@
1
+ export interface ModelCompositionBranch {
2
+ task: string;
3
+ architecture: string;
4
+ version: string;
5
+ interface: string;
6
+ useCase: string;
7
+ tags: string[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -49,7 +49,7 @@ export class UiControlClient extends ApiCommands {
49
49
  return this._uiControllerClient;
50
50
  }
51
51
  get inferenceClient() {
52
- return new InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId);
52
+ return new InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId, this.clientArgs.modelComposition);
53
53
  }
54
54
  get executionRuntime() {
55
55
  return new ExecutionRuntime(this.uiControllerClient, this.inferenceClient);
@@ -1,6 +1,7 @@
1
1
  import { AnnotationLevel } from './annotation-level';
2
2
  import { CredentialArgs } from './credentials-args';
3
3
  import { ProxyAgentArgs } from '../shared/proxy-agent-args';
4
+ import { ModelCompositionBranch } from './model-composition-branch';
4
5
  /**
5
6
  * Configuration options for the askui UI Control Client
6
7
  *
@@ -32,6 +33,7 @@ export interface ClientArgs {
32
33
  readonly credentials?: CredentialArgs;
33
34
  readonly proxyAgents?: ProxyAgentArgs;
34
35
  readonly resize?: number;
36
+ readonly modelComposition?: ModelCompositionBranch[];
35
37
  }
36
38
  export interface ClientArgsWithDefaults extends ClientArgs {
37
39
  readonly uiControllerUrl: string;
@@ -42,7 +42,7 @@ export class UiControllerClient {
42
42
  this.ws.on('error', (error) => {
43
43
  this.connectionState = UiControllerClientConnectionState.ERROR;
44
44
  reject(new UiControlClientError(`Connection to UI Controller cannot be established,
45
- Probably it was not started. Makse sure you started UI Controller with this
45
+ Probably it was not started. Make sure you started UI Controller with this
46
46
  Url ${this.url}. Error message ${error.message}`));
47
47
  });
48
48
  }
@@ -12,9 +12,9 @@ Use following command to set up Jest:
12
12
  npm i -D jest @types/jest ts-jest typescript
13
13
  ```
14
14
 
15
- ## How to execute the example test
15
+ ## How to execute the example
16
16
 
17
- This test can be executed with the following command:
17
+ This can be executed with the following command:
18
18
  ```shell
19
19
  npx jest --config ./test/jest.config.ts
20
20
  ```
@@ -1,14 +1,14 @@
1
1
  import { aui } from './helper/jest.setup';
2
2
 
3
3
  describe('jest with askui', () => {
4
-
5
4
  it('should generate an interactive annotation', async () => {
6
5
  await aui.annotateInteractively();
7
6
  });
8
7
 
9
8
  it('should click on my element', async () => {
10
9
  await aui
11
- .click()
12
- // <INSERT YOUR COPIED FILTER HERE AND UNCOMMENT THIS LINE>.exec();
10
+ .click();
11
+ // <INSERT YOUR COPIED ELEMENT DESCRIPTION HERE AND UNCOMMENT THIS AND THE NEXT LINE>
12
+ // .exec();
13
13
  });
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
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",