askui 0.7.2 → 0.9.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.
Files changed (43) hide show
  1. package/dist/cjs/execution/dsl.d.ts +592 -1333
  2. package/dist/cjs/execution/dsl.js +1111 -2383
  3. package/dist/cjs/execution/inference-client.d.ts +3 -1
  4. package/dist/cjs/execution/inference-client.js +3 -1
  5. package/dist/cjs/execution/model-composition-branch.d.ts +8 -0
  6. package/dist/cjs/execution/ui-control-client.js +2 -1
  7. package/dist/cjs/execution/ui-controller-client-interface.d.ts +2 -0
  8. package/dist/cjs/execution/ui-controller-client.js +1 -1
  9. package/dist/esm/execution/dsl.d.ts +592 -1333
  10. package/dist/esm/execution/dsl.js +1119 -2391
  11. package/dist/esm/execution/inference-client.d.ts +3 -1
  12. package/dist/esm/execution/inference-client.js +3 -1
  13. package/dist/esm/execution/model-composition-branch.d.ts +8 -0
  14. package/dist/esm/execution/ui-control-client.js +2 -1
  15. package/dist/esm/execution/ui-controller-client-interface.d.ts +2 -0
  16. package/dist/esm/execution/ui-controller-client.js +1 -1
  17. package/dist/example_projects_templates/typescript_jest/test/README.md +2 -2
  18. package/dist/example_projects_templates/typescript_jest/test/my-first-askui-test-suite.test.ts +3 -3
  19. package/package.json +1 -1
  20. package/dist/cjs/core/annotation/annotation-json.d.ts +0 -5
  21. package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +0 -53
  22. package/dist/cjs/execution/dsl.spec.d.ts +0 -1
  23. package/dist/cjs/execution/dsl.spec.js +0 -75
  24. package/dist/cjs/execution/read-environment-credentials.spec.d.ts +0 -1
  25. package/dist/cjs/execution/read-environment-credentials.spec.js +0 -11
  26. package/dist/cjs/lib/ui-controller-args.spec.d.ts +0 -1
  27. package/dist/cjs/lib/ui-controller-args.spec.js +0 -23
  28. package/dist/cjs/utils/http/credentials.spec.d.ts +0 -1
  29. package/dist/cjs/utils/http/credentials.spec.js +0 -11
  30. package/dist/esm/core/annotation/annotation-json.d.ts +0 -5
  31. package/dist/esm/core/annotation/annotation-json.js +0 -1
  32. package/dist/esm/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  33. package/dist/esm/core/model/test-case-dto/custom-element.spec.js +0 -51
  34. package/dist/esm/execution/dsl.spec.d.ts +0 -1
  35. package/dist/esm/execution/dsl.spec.js +0 -73
  36. package/dist/esm/execution/read-environment-credentials.spec.d.ts +0 -1
  37. package/dist/esm/execution/read-environment-credentials.spec.js +0 -9
  38. package/dist/esm/lib/ui-controller-args.spec.d.ts +0 -1
  39. package/dist/esm/lib/ui-controller-args.spec.js +0 -21
  40. package/dist/esm/utils/http/credentials.spec.d.ts +0 -1
  41. package/dist/esm/utils/http/credentials.spec.js +0 -9
  42. /package/dist/cjs/{core/annotation/annotation-json.js → execution/model-composition-branch.js} +0 -0
  43. /package/dist/{cjs/core/model/test-case-dto/custom-element.spec.d.ts → esm/execution/model-composition-branch.js} +0 -0
@@ -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
+ }
@@ -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);
@@ -110,6 +110,7 @@ class UiControlClient extends dsl_1.ApiCommands {
110
110
  customElements,
111
111
  secretText,
112
112
  });
113
+ this.secretText = undefined;
113
114
  yield this.annotateByDefault(test_case_result_dto_1.TestStepState.PASSED, customElements);
114
115
  return yield Promise.resolve();
115
116
  }
@@ -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
  }