askui 0.25.1 → 0.27.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.
- package/dist/cjs/core/ai-element/ai-element-collection.d.ts +1 -0
- package/dist/cjs/core/ai-element/ai-element-collection.js +3 -0
- package/dist/cjs/core/models/anthropic/askui-agent.d.ts +2 -0
- package/dist/cjs/core/models/anthropic/askui-agent.js +27 -32
- package/dist/cjs/core/models/anthropic/claude-agent.d.ts +16 -4
- package/dist/cjs/core/models/anthropic/claude-agent.js +43 -5
- package/dist/cjs/core/models/anthropic/index.d.ts +2 -3
- package/dist/cjs/core/models/anthropic/tools/askui-api-tools.d.ts +19 -0
- package/dist/cjs/core/models/anthropic/tools/askui-api-tools.js +81 -0
- package/dist/cjs/core/models/anthropic/tools/base.d.ts +2 -0
- package/dist/cjs/core/models/anthropic/tools/os-agent-tools.d.ts +70 -6
- package/dist/cjs/core/models/anthropic/tools/os-agent-tools.js +393 -84
- package/dist/cjs/core/ui-control-commands/input-event.d.ts +3 -1
- package/dist/cjs/core/ui-control-commands/input-event.js +2 -0
- package/dist/cjs/execution/execution-runtime.d.ts +4 -0
- package/dist/cjs/execution/inference-client.d.ts +4 -0
- package/dist/cjs/execution/ui-control-client.d.ts +112 -33
- package/dist/cjs/execution/ui-control-client.js +105 -45
- package/dist/cjs/lib/interactive_cli/create-example-project.js +1 -1
- package/dist/cjs/main.d.ts +1 -1
- package/dist/esm/core/ai-element/ai-element-collection.d.ts +1 -0
- package/dist/esm/core/ai-element/ai-element-collection.js +3 -0
- package/dist/esm/core/models/anthropic/askui-agent.d.ts +2 -0
- package/dist/esm/core/models/anthropic/askui-agent.js +28 -33
- package/dist/esm/core/models/anthropic/claude-agent.d.ts +16 -4
- package/dist/esm/core/models/anthropic/claude-agent.js +43 -5
- package/dist/esm/core/models/anthropic/index.d.ts +2 -3
- package/dist/esm/core/models/anthropic/index.js +1 -1
- package/dist/esm/core/models/anthropic/tools/askui-api-tools.d.ts +19 -0
- package/dist/esm/core/models/anthropic/tools/askui-api-tools.js +76 -0
- package/dist/esm/core/models/anthropic/tools/base.d.ts +2 -0
- package/dist/esm/core/models/anthropic/tools/os-agent-tools.d.ts +70 -6
- package/dist/esm/core/models/anthropic/tools/os-agent-tools.js +384 -81
- package/dist/esm/core/ui-control-commands/input-event.d.ts +3 -1
- package/dist/esm/core/ui-control-commands/input-event.js +2 -0
- package/dist/esm/execution/execution-runtime.d.ts +4 -0
- package/dist/esm/execution/inference-client.d.ts +4 -0
- package/dist/esm/execution/ui-control-client.d.ts +112 -33
- package/dist/esm/execution/ui-control-client.js +105 -45
- package/dist/esm/lib/interactive_cli/create-example-project.js +1 -1
- package/dist/esm/main.d.ts +1 -1
- package/dist/esm/main.js +1 -1
- package/package.json +2 -2
|
@@ -26,6 +26,10 @@ export declare class InferenceClient {
|
|
|
26
26
|
predictVQAAnswer(prompt: string, image: string, config?: object): Promise<any>;
|
|
27
27
|
predictActResponse(params: {
|
|
28
28
|
max_tokens: number;
|
|
29
|
+
tool_choice?: {
|
|
30
|
+
type: 'tool' | 'any' | 'auto';
|
|
31
|
+
name?: string;
|
|
32
|
+
};
|
|
29
33
|
messages: BetaMessageParam[];
|
|
30
34
|
model: string;
|
|
31
35
|
system?: string;
|
|
@@ -5,7 +5,7 @@ import { AnnotationRequest } from '../core/model/annotation-result/annotation-in
|
|
|
5
5
|
import { DetectedElement } from '../core/model/annotation-result/detected-element';
|
|
6
6
|
import { ClientArgs } from './ui-controller-client-interface';
|
|
7
7
|
import { ModelCompositionBranch } from './model-composition-branch';
|
|
8
|
-
import { AskUIAgent, AgentHistory } from '../core/models/anthropic';
|
|
8
|
+
import { AskUIAgent, AgentHistory, ActOptions } from '../core/models/anthropic';
|
|
9
9
|
export type RelationsForConvenienceMethods = 'nearestTo' | 'leftOf' | 'above' | 'rightOf' | 'below' | 'contains';
|
|
10
10
|
export type TextMatchingOption = 'similar' | 'exact' | 'regex';
|
|
11
11
|
export type ElementExistsQueryType = 'otherElement' | 'switch' | 'element' | 'container' | 'checkbox' | 'element' | 'button' | 'table' | 'text' | 'icon' | 'image' | 'textfield';
|
|
@@ -55,6 +55,7 @@ export declare class UiControlClient extends ApiCommands {
|
|
|
55
55
|
stopVideoRecording(): Promise<void>;
|
|
56
56
|
readVideoRecording(): Promise<string>;
|
|
57
57
|
private shouldAnnotateAfterCommandExecution;
|
|
58
|
+
private beforeNoneInferenceCallCommandExecution;
|
|
58
59
|
private afterCommandExecution;
|
|
59
60
|
annotate(annotationRequest?: AnnotationRequest): Promise<Annotation>;
|
|
60
61
|
annotateInteractively(): Promise<void>;
|
|
@@ -476,51 +477,129 @@ export declare class UiControlClient extends ApiCommands {
|
|
|
476
477
|
*/
|
|
477
478
|
expectAllExist(query: ElementExistsQuery[]): Promise<ExpectAllExistResult>;
|
|
478
479
|
/**
|
|
479
|
-
*
|
|
480
|
+
* Holds down a key on the keyboard.
|
|
480
481
|
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
482
|
+
* **Examples:**
|
|
483
|
+
* ```typescript
|
|
484
|
+
* await aui.keyDown('a').exec();
|
|
485
|
+
* ```
|
|
484
486
|
*
|
|
485
|
-
*
|
|
486
|
-
|
|
487
|
+
* @param {PC_AND_MODIFIER_KEY} key - The key to hold down.
|
|
488
|
+
*/
|
|
489
|
+
keyDown(key: PC_AND_MODIFIER_KEY): Executable;
|
|
490
|
+
/**
|
|
491
|
+
* Releases a key up that was previously held down.
|
|
487
492
|
*
|
|
488
493
|
* **Examples:**
|
|
494
|
+
* ```typescript
|
|
495
|
+
* await aui.keyUp('a').exec();
|
|
496
|
+
* ```
|
|
497
|
+
*
|
|
498
|
+
* @param {PC_AND_MODIFIER_KEY} key - The key to release up.
|
|
499
|
+
*/
|
|
500
|
+
keyUp(key: PC_AND_MODIFIER_KEY): Executable;
|
|
501
|
+
/**
|
|
502
|
+
* Instructs the agent to autonomously achieve a specified goal through UI interactions.
|
|
503
|
+
*
|
|
504
|
+
* This method enables AI-powered automation by allowing the agent to:
|
|
505
|
+
* - Analyze the current screen state and/or provided images
|
|
506
|
+
* - Plan and execute a sequence of UI interactions
|
|
507
|
+
* - Handle complex tasks through natural language instructions
|
|
508
|
+
* - Maintain context across multiple actions
|
|
509
|
+
*
|
|
510
|
+
* The agent can perform various UI interactions including:
|
|
511
|
+
* - Clicking buttons, links, and other interactive elements
|
|
512
|
+
* - Typing text into input fields
|
|
513
|
+
* - Scrolling and navigating through interfaces
|
|
514
|
+
*
|
|
515
|
+
* ### Method Signatures
|
|
516
|
+
* ```typescript
|
|
517
|
+
* act(goal: string, options?: ActOptions): Promise<AgentHistory>
|
|
518
|
+
* act(goal: string, imagePathOrBase64: string, options?: ActOptions): Promise<AgentHistory>
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* ### Parameters
|
|
522
|
+
* @param goal - A natural language instruction describing the task to accomplish.
|
|
523
|
+
* Be specific and clear about the desired outcome.
|
|
524
|
+
* @param imagePathOrBase64 - (Optional) Path to an image file or base64-encoded image string.
|
|
525
|
+
* Used to provide additional visual context for the task.
|
|
526
|
+
* @param options - (Optional) Configuration options for the agent's behavior.
|
|
527
|
+
* @param options.chatId - A unique identifier to maintain context between related actions.
|
|
528
|
+
* Useful for multi-step tasks that require state preservation.
|
|
529
|
+
* @param options.agentHistory
|
|
530
|
+
* - (Optional) Previous interaction history to share between
|
|
531
|
+
* different agent instances. Enables cross-platform task coordination.
|
|
532
|
+
*
|
|
533
|
+
* ### Returns
|
|
534
|
+
* @returns Promise<AgentHistory> - A promise that resolves to the updated interaction history,
|
|
535
|
+
* containing details about the actions taken and their outcomes.
|
|
536
|
+
*
|
|
537
|
+
* ### Throws
|
|
538
|
+
* - If the agent is not properly connected
|
|
539
|
+
* - If the provided goal cannot be understood or executed
|
|
540
|
+
* - If required UI elements are not found or accessible
|
|
541
|
+
* - If the image path is invalid or the base64 string is malformed
|
|
542
|
+
*
|
|
543
|
+
* ### Examples
|
|
544
|
+
*
|
|
545
|
+
* #### Basic Usage
|
|
546
|
+
* ```typescript
|
|
547
|
+
* // Simple task execution
|
|
548
|
+
* await aui.act("Open Chrome and navigate to google.com");
|
|
549
|
+
* ```
|
|
489
550
|
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
551
|
+
* #### Maintaining Context
|
|
552
|
+
* ```typescript
|
|
553
|
+
* // Multi-step task with context preservation
|
|
554
|
+
* await aui.act("Search for current gold prices", {
|
|
555
|
+
* chatId: "gold-price-task"
|
|
494
556
|
* });
|
|
495
|
-
*
|
|
496
|
-
*
|
|
557
|
+
*
|
|
558
|
+
* await aui.act("Create a new text file and save the price", {
|
|
559
|
+
* chatId: "gold-price-task"
|
|
497
560
|
* });
|
|
561
|
+
* ```
|
|
498
562
|
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* //
|
|
563
|
+
* #### Cross-Platform Coordination
|
|
564
|
+
* ```typescript
|
|
565
|
+
* // Share context between desktop and mobile agents
|
|
502
566
|
* await auiAndroid.agent.configureAsAndroidAgent();
|
|
567
|
+
*
|
|
503
568
|
* const history = await auiDesktop.act("Copy username from desktop app");
|
|
504
|
-
* await auiAndroid.act("Paste username into
|
|
569
|
+
* await auiAndroid.act("Paste username into mobile login", {
|
|
505
570
|
* agentHistory: history
|
|
506
571
|
* });
|
|
507
572
|
* ```
|
|
508
573
|
*
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
574
|
+
* #### Using Images for Context
|
|
575
|
+
* ```typescript
|
|
576
|
+
* // Using image file
|
|
577
|
+
* await aui.act(
|
|
578
|
+
* "Click the 'Submit' button in the provided image",
|
|
579
|
+
* 'path/to/screenshot.png'
|
|
580
|
+
* );
|
|
581
|
+
*
|
|
582
|
+
* // Using base64 image
|
|
583
|
+
* const base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...";
|
|
584
|
+
* await aui.act(
|
|
585
|
+
* "Click the 'Submit' button in the provided image",
|
|
586
|
+
* base64Image
|
|
587
|
+
* );
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* ### Best Practices
|
|
591
|
+
* 1. Be specific in your goal descriptions
|
|
592
|
+
* 2. Use chatId for related tasks to maintain context
|
|
593
|
+
* 3. Provide clear visual context when needed
|
|
594
|
+
* 4. Handle errors appropriately in your implementation
|
|
595
|
+
* 5. Consider using agentHistory for complex cross-platform workflows
|
|
596
|
+
*/
|
|
597
|
+
act(goal: string, options?: ActOptions): Promise<AgentHistory>;
|
|
598
|
+
act(goal: string, imagePathOrBase64String: string, options?: ActOptions): Promise<AgentHistory>;
|
|
599
|
+
/**
|
|
600
|
+
* Adds tools to the agent that allow it to interact with AI elements.
|
|
601
|
+
*
|
|
602
|
+
* @returns {Promise<void>} - A promise that resolves when the tools are added to the agent.
|
|
521
603
|
*/
|
|
522
|
-
|
|
523
|
-
chatId?: string;
|
|
524
|
-
agentHistory?: AgentHistory;
|
|
525
|
-
}): Promise<AgentHistory>;
|
|
604
|
+
addAIElementsToolsToAgent(): Promise<void>;
|
|
526
605
|
}
|
|
@@ -16,6 +16,7 @@ import { UiControlClientDependencyBuilder } from './ui-control-client-dependency
|
|
|
16
16
|
import { AIElementCollection } from '../core/ai-element/ai-element-collection';
|
|
17
17
|
import { NoRetryStrategy } from './retry-strategies';
|
|
18
18
|
import { AskUIAgent } from '../core/models/anthropic';
|
|
19
|
+
import { AskUIGetAskUIElementTool, AskUIListAIElementTool } from '../core/models/anthropic/tools/askui-api-tools';
|
|
19
20
|
export class UiControlClient extends ApiCommands {
|
|
20
21
|
constructor(workspaceId, executionRuntime, stepReporter, aiElementArgs, agent) {
|
|
21
22
|
super();
|
|
@@ -79,6 +80,22 @@ export class UiControlClient extends ApiCommands {
|
|
|
79
80
|
return (this.stepReporter.config.withDetectedElements === 'onFailure' && error !== undefined)
|
|
80
81
|
|| (this.stepReporter.config.withDetectedElements === 'always');
|
|
81
82
|
}
|
|
83
|
+
beforeNoneInferenceCallCommandExecution(instruction) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
this.stepReporter.resetStep(instruction);
|
|
86
|
+
let annotation;
|
|
87
|
+
if (this.stepReporter.config.withDetectedElements === 'begin'
|
|
88
|
+
|| this.stepReporter.config.withDetectedElements === 'always') {
|
|
89
|
+
annotation = yield this.executionRuntime.annotateImage();
|
|
90
|
+
}
|
|
91
|
+
const createdAt = new Date();
|
|
92
|
+
yield this.stepReporter.onStepBegin({
|
|
93
|
+
createdAt,
|
|
94
|
+
detectedElements: annotation === null || annotation === void 0 ? void 0 : annotation.detected_elements,
|
|
95
|
+
screenshot: annotation === null || annotation === void 0 ? void 0 : annotation.image,
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
82
99
|
afterCommandExecution(instruction, error) {
|
|
83
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
101
|
var _a;
|
|
@@ -148,7 +165,7 @@ export class UiControlClient extends ApiCommands {
|
|
|
148
165
|
]);
|
|
149
166
|
logger.debug(instruction);
|
|
150
167
|
try {
|
|
151
|
-
|
|
168
|
+
this.stepReporter.resetStep(instruction);
|
|
152
169
|
yield this.executionRuntime.executeInstruction(instruction, modelComposition);
|
|
153
170
|
yield this.afterCommandExecution(instruction);
|
|
154
171
|
return yield Promise.resolve();
|
|
@@ -337,10 +354,14 @@ export class UiControlClient extends ApiCommands {
|
|
|
337
354
|
// eslint-disable-next-line class-methods-use-this
|
|
338
355
|
waitFor(delayInMs) {
|
|
339
356
|
return {
|
|
340
|
-
exec() {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
357
|
+
exec: () => __awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
const stepTitle = `Wait for ${delayInMs} ms`;
|
|
359
|
+
const instruction = yield this.buildInstruction(stepTitle, []);
|
|
360
|
+
yield this.beforeNoneInferenceCallCommandExecution(instruction);
|
|
361
|
+
yield new Promise((resolve) => { setTimeout(resolve, delayInMs); });
|
|
362
|
+
yield this.afterCommandExecution(instruction);
|
|
363
|
+
return Promise.resolve();
|
|
364
|
+
}),
|
|
344
365
|
};
|
|
345
366
|
}
|
|
346
367
|
/**
|
|
@@ -736,55 +757,94 @@ export class UiControlClient extends ApiCommands {
|
|
|
736
757
|
});
|
|
737
758
|
}
|
|
738
759
|
/**
|
|
739
|
-
*
|
|
760
|
+
* Holds down a key on the keyboard.
|
|
740
761
|
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
743
|
-
*
|
|
762
|
+
* **Examples:**
|
|
763
|
+
* ```typescript
|
|
764
|
+
* await aui.keyDown('a').exec();
|
|
765
|
+
* ```
|
|
744
766
|
*
|
|
745
|
-
*
|
|
746
|
-
|
|
767
|
+
* @param {PC_AND_MODIFIER_KEY} key - The key to hold down.
|
|
768
|
+
*/
|
|
769
|
+
keyDown(key) {
|
|
770
|
+
return {
|
|
771
|
+
exec: () => __awaiter(this, void 0, void 0, function* () {
|
|
772
|
+
const stepTitle = `Hold down key ${key}`;
|
|
773
|
+
const instruction = yield this.buildInstruction(stepTitle, []);
|
|
774
|
+
try {
|
|
775
|
+
yield this.beforeNoneInferenceCallCommandExecution(instruction);
|
|
776
|
+
yield this.agent.getOsAgentHandler().desktopKeyHoldDown(key, []);
|
|
777
|
+
yield this.afterCommandExecution(instruction);
|
|
778
|
+
}
|
|
779
|
+
catch (error) {
|
|
780
|
+
yield this.afterCommandExecution(instruction, error instanceof Error ? error : new Error(String(error)));
|
|
781
|
+
return Promise.reject(error);
|
|
782
|
+
}
|
|
783
|
+
return Promise.resolve();
|
|
784
|
+
}),
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Releases a key up that was previously held down.
|
|
747
789
|
*
|
|
748
790
|
* **Examples:**
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
* // Use chatId to maintain context across consecutive steps
|
|
752
|
-
* await aui.act("Search online for the current gold price", {
|
|
753
|
-
* chatId: "session-gold-price"
|
|
754
|
-
* });
|
|
755
|
-
* await aui.act("Create a new text file and type the gold price result into it", {
|
|
756
|
-
* chatId: "session-gold-price"
|
|
757
|
-
* });
|
|
758
|
-
*
|
|
759
|
-
* // Share history explicitly between separate agents (e.g., desktop and Android)
|
|
760
|
-
* // By default, the agent operates as a computer agent.
|
|
761
|
-
* // To control an Android device, you must configure it explicitly:
|
|
762
|
-
* await auiAndroid.agent.configureAsAndroidAgent();
|
|
763
|
-
* const history = await auiDesktop.act("Copy username from desktop app");
|
|
764
|
-
* await auiAndroid.act("Paste username into the mobile login screen", {
|
|
765
|
-
* agentHistory: history
|
|
766
|
-
* });
|
|
791
|
+
* ```typescript
|
|
792
|
+
* await aui.keyUp('a').exec();
|
|
767
793
|
* ```
|
|
768
794
|
*
|
|
769
|
-
* @param {
|
|
770
|
-
* @param {Object} [options] - Optional parameters to maintain or share context.
|
|
771
|
-
* @param {string} [options.chatId] - A session identifier used to persist memory between
|
|
772
|
-
* consecutive `act` calls. When multiple actions share the
|
|
773
|
-
* same `chatId`, the agent retains knowledge of prior steps,
|
|
774
|
-
* such as extracted data or navigation history.
|
|
775
|
-
* @param {AgentHistory} [options.agentHistory] - A shared interaction history object that can be
|
|
776
|
-
* passed between different agent clients (e.g., between
|
|
777
|
-
* `auiDesktop` and `auiAndroid`) to ensure continuity
|
|
778
|
-
* of understanding and task flow.
|
|
779
|
-
* @returns {Promise<AgentHistory>} - Updated action history after executing the goal.
|
|
780
|
-
* @throws {Error} If the agent is not connected when the method is called.
|
|
795
|
+
* @param {PC_AND_MODIFIER_KEY} key - The key to release up.
|
|
781
796
|
*/
|
|
782
|
-
|
|
797
|
+
keyUp(key) {
|
|
798
|
+
return {
|
|
799
|
+
exec: () => __awaiter(this, void 0, void 0, function* () {
|
|
800
|
+
const stepTitle = `Release key ${key}`;
|
|
801
|
+
const instruction = yield this.buildInstruction(stepTitle, []);
|
|
802
|
+
try {
|
|
803
|
+
yield this.beforeNoneInferenceCallCommandExecution(instruction);
|
|
804
|
+
yield this.agent.getOsAgentHandler().desktopKeyRelease(key, []);
|
|
805
|
+
yield this.afterCommandExecution(instruction);
|
|
806
|
+
}
|
|
807
|
+
catch (error) {
|
|
808
|
+
yield this.afterCommandExecution(instruction, error instanceof Error ? error : new Error(String(error)));
|
|
809
|
+
return Promise.reject(error);
|
|
810
|
+
}
|
|
811
|
+
return Promise.resolve();
|
|
812
|
+
}),
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
act(goal, imageOrOptions, options) {
|
|
783
816
|
return __awaiter(this, void 0, void 0, function* () {
|
|
784
|
-
if (
|
|
785
|
-
|
|
817
|
+
if (typeof imageOrOptions === 'string') {
|
|
818
|
+
return this.agent.act(goal, imageOrOptions, options);
|
|
786
819
|
}
|
|
787
|
-
|
|
820
|
+
const fullTitle = `Act: ${goal}`;
|
|
821
|
+
const stepTitle = fullTitle.length > 50 ? `${fullTitle.substring(0, 47)}...` : fullTitle;
|
|
822
|
+
const instruction = yield this.buildInstruction(stepTitle, []);
|
|
823
|
+
try {
|
|
824
|
+
yield this.beforeNoneInferenceCallCommandExecution(instruction);
|
|
825
|
+
const result = yield this.agent.act(goal, undefined, imageOrOptions);
|
|
826
|
+
yield this.afterCommandExecution(instruction);
|
|
827
|
+
return result;
|
|
828
|
+
}
|
|
829
|
+
catch (error) {
|
|
830
|
+
yield this.afterCommandExecution(instruction, error instanceof Error ? error : new Error(String(error)));
|
|
831
|
+
return Promise.reject(error);
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Adds tools to the agent that allow it to interact with AI elements.
|
|
837
|
+
*
|
|
838
|
+
* @returns {Promise<void>} - A promise that resolves when the tools are added to the agent.
|
|
839
|
+
*/
|
|
840
|
+
addAIElementsToolsToAgent() {
|
|
841
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
842
|
+
const aiElementLocator = (aiElementName) => this.get().aiElement(aiElementName).exec();
|
|
843
|
+
const askUIGetAskUIElementTool = new AskUIGetAskUIElementTool(this.agent.getOsAgentHandler(), aiElementLocator, 'aiElement');
|
|
844
|
+
this.agent.addTool(askUIGetAskUIElementTool);
|
|
845
|
+
const listAIElementNamesFunction = () => (AIElementCollection.collectAIElements(this.workspaceId, this.aiElementArgs)).then((aiElementCollection) => aiElementCollection.getNames());
|
|
846
|
+
const askUIListAIElementTool = new AskUIListAIElementTool(listAIElementNamesFunction);
|
|
847
|
+
this.agent.addTool(askUIListAIElementTool);
|
|
788
848
|
});
|
|
789
849
|
}
|
|
790
850
|
}
|
|
@@ -179,7 +179,7 @@ export class CreateExampleProject {
|
|
|
179
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
180
|
const runCommand = promisify(exec);
|
|
181
181
|
const frameworkDependencies = {
|
|
182
|
-
jest: 'npm i -D @askui/askui-reporters typescript ts-node @types/jest ts-jest jest @askui/jest-allure-circus eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import @askui/eslint-plugin-askui hpagent',
|
|
182
|
+
jest: 'npm i -D @askui/askui-reporters typescript ts-node @types/jest@30.0.0 ts-jest@29.4.0 jest@29.7.0 @askui/jest-allure-circus eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import @askui/eslint-plugin-askui hpagent',
|
|
183
183
|
};
|
|
184
184
|
yield runCommand(frameworkDependencies.jest);
|
|
185
185
|
});
|
package/dist/esm/main.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export { Instruction, Reporter, ReporterConfig, Snapshot, SnapshotDetailLevel, S
|
|
|
4
4
|
export { Annotation } from './core/annotation/annotation';
|
|
5
5
|
export { DetectedElement } from './core/model/annotation-result/detected-element';
|
|
6
6
|
export { LogLevels } from './shared';
|
|
7
|
-
export { ToolFailure, ToolError, BaseAgentTool } from './core/models/anthropic';
|
|
7
|
+
export { ToolFailure, ToolError, BaseAgentTool, BetaTool, ToolResult, } from './core/models/anthropic';
|
package/dist/esm/main.js
CHANGED
|
@@ -3,4 +3,4 @@ export * from './execution';
|
|
|
3
3
|
export { Annotation } from './core/annotation/annotation';
|
|
4
4
|
export { DetectedElement } from './core/model/annotation-result/detected-element';
|
|
5
5
|
export { LogLevels } from './shared';
|
|
6
|
-
export { ToolFailure, ToolError, BaseAgentTool } from './core/models/anthropic';
|
|
6
|
+
export { ToolFailure, ToolError, BaseAgentTool, } from './core/models/anthropic';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dist/example_projects_templates/"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@anthropic-ai/sdk": "0.
|
|
54
|
+
"@anthropic-ai/sdk": "0.53.0",
|
|
55
55
|
"chalk": "4.1.1",
|
|
56
56
|
"commander": "12.1.0",
|
|
57
57
|
"fkill": "7.2.1",
|