playwright-mimic 0.1.0 → 0.1.2
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/README.md +695 -446
- package/dist/agentic/agent.d.ts +106 -0
- package/dist/agentic/agent.d.ts.map +1 -0
- package/dist/agentic/agent.js +528 -0
- package/dist/agentic/agent.js.map +1 -0
- package/dist/agentic/index.d.ts +13 -0
- package/dist/agentic/index.d.ts.map +1 -0
- package/dist/agentic/index.js +12 -0
- package/dist/agentic/index.js.map +1 -0
- package/dist/agentic/planner.d.ts +41 -0
- package/dist/agentic/planner.d.ts.map +1 -0
- package/dist/agentic/planner.js +136 -0
- package/dist/agentic/planner.js.map +1 -0
- package/dist/agentic/react.d.ts +35 -0
- package/dist/agentic/react.d.ts.map +1 -0
- package/dist/agentic/react.js +170 -0
- package/dist/agentic/react.js.map +1 -0
- package/dist/agentic/recovery.d.ts +55 -0
- package/dist/agentic/recovery.d.ts.map +1 -0
- package/dist/agentic/recovery.js +200 -0
- package/dist/agentic/recovery.js.map +1 -0
- package/dist/agentic/reflection.d.ts +40 -0
- package/dist/agentic/reflection.d.ts.map +1 -0
- package/dist/agentic/reflection.js +142 -0
- package/dist/agentic/reflection.js.map +1 -0
- package/dist/agentic/types.d.ts +177 -0
- package/dist/agentic/types.d.ts.map +1 -0
- package/dist/agentic/types.js +8 -0
- package/dist/agentic/types.js.map +1 -0
- package/dist/agentic/wait.d.ts +50 -0
- package/dist/agentic/wait.d.ts.map +1 -0
- package/dist/agentic/wait.js +140 -0
- package/dist/agentic/wait.js.map +1 -0
- package/dist/agentic-mimic.d.ts +56 -0
- package/dist/agentic-mimic.d.ts.map +1 -0
- package/dist/agentic-mimic.js +98 -0
- package/dist/agentic-mimic.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/mimic/actionType.d.ts +7 -0
- package/dist/mimic/actionType.d.ts.map +1 -0
- package/dist/mimic/actionType.js +44 -0
- package/dist/mimic/actionType.js.map +1 -0
- package/dist/mimic/annotations.d.ts +21 -0
- package/dist/mimic/annotations.d.ts.map +1 -0
- package/dist/mimic/annotations.js +36 -0
- package/dist/mimic/annotations.js.map +1 -0
- package/dist/mimic/cli.d.ts +15 -0
- package/dist/mimic/cli.d.ts.map +1 -0
- package/dist/mimic/cli.js +17 -0
- package/dist/mimic/cli.js.map +1 -0
- package/dist/mimic/click.d.ts +39 -0
- package/dist/mimic/click.d.ts.map +1 -0
- package/dist/mimic/click.js +348 -0
- package/dist/mimic/click.js.map +1 -0
- package/dist/mimic/forms.d.ts +52 -0
- package/dist/mimic/forms.d.ts.map +1 -0
- package/dist/mimic/forms.js +511 -0
- package/dist/mimic/forms.js.map +1 -0
- package/dist/mimic/markers.d.ts +133 -0
- package/dist/mimic/markers.d.ts.map +1 -0
- package/dist/mimic/markers.js +589 -0
- package/dist/mimic/markers.js.map +1 -0
- package/dist/mimic/navigation.d.ts +19 -0
- package/dist/mimic/navigation.d.ts.map +1 -0
- package/dist/mimic/navigation.js +136 -0
- package/dist/mimic/navigation.js.map +1 -0
- package/dist/mimic/playwrightCodeGenerator.d.ts +55 -0
- package/dist/mimic/playwrightCodeGenerator.d.ts.map +1 -0
- package/dist/mimic/playwrightCodeGenerator.js +270 -0
- package/dist/mimic/playwrightCodeGenerator.js.map +1 -0
- package/dist/mimic/replay.d.ts +21 -0
- package/dist/mimic/replay.d.ts.map +1 -0
- package/dist/mimic/replay.js +142 -0
- package/dist/mimic/replay.js.map +1 -0
- package/dist/mimic/schema/action.d.ts +315 -0
- package/dist/mimic/schema/action.d.ts.map +1 -0
- package/dist/mimic/schema/action.js +186 -0
- package/dist/mimic/schema/action.js.map +1 -0
- package/dist/mimic/selector.d.ts +143 -0
- package/dist/mimic/selector.d.ts.map +1 -0
- package/dist/mimic/selector.js +1515 -0
- package/dist/mimic/selector.js.map +1 -0
- package/dist/mimic/selectorDescriptor.d.ts +25 -0
- package/dist/mimic/selectorDescriptor.d.ts.map +1 -0
- package/dist/mimic/selectorDescriptor.js +32 -0
- package/dist/mimic/selectorDescriptor.js.map +1 -0
- package/dist/mimic/selectorSerialization.d.ts +18 -0
- package/dist/mimic/selectorSerialization.d.ts.map +1 -0
- package/dist/mimic/selectorSerialization.js +32 -0
- package/dist/mimic/selectorSerialization.js.map +1 -0
- package/dist/mimic/selectorTypes.d.ts +122 -0
- package/dist/mimic/selectorTypes.d.ts.map +1 -0
- package/dist/mimic/selectorTypes.js +2 -0
- package/dist/mimic/selectorTypes.js.map +1 -0
- package/dist/mimic/selectorUtils.d.ts +52 -0
- package/dist/mimic/selectorUtils.d.ts.map +1 -0
- package/dist/mimic/selectorUtils.js +251 -0
- package/dist/mimic/selectorUtils.js.map +1 -0
- package/dist/mimic/storage.d.ts +110 -0
- package/dist/mimic/storage.d.ts.map +1 -0
- package/dist/mimic/storage.js +409 -0
- package/dist/mimic/storage.js.map +1 -0
- package/dist/mimic/types.d.ts +85 -0
- package/dist/mimic/types.d.ts.map +1 -0
- package/dist/mimic/types.js +7 -0
- package/dist/mimic/types.js.map +1 -0
- package/dist/mimic.d.ts +29 -4
- package/dist/mimic.d.ts.map +1 -1
- package/dist/mimic.js +530 -32
- package/dist/mimic.js.map +1 -1
- package/dist/mimicry.d.ts +4 -4
- package/dist/mimicry.d.ts.map +1 -1
- package/dist/mimicry.js +22 -13
- package/dist/mimicry.js.map +1 -1
- package/package.json +30 -6
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic Browser Automation Agent
|
|
3
|
+
*
|
|
4
|
+
* Main agent class that orchestrates planning, reasoning, acting, and reflection.
|
|
5
|
+
* Implements a goal-oriented, autonomous browser automation system.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentState, AgentConfig, PlanningResult } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Agentic Browser Automation Agent
|
|
10
|
+
*
|
|
11
|
+
* An autonomous agent that can plan, reason, act, and reflect to achieve
|
|
12
|
+
* browser automation goals.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Agent {
|
|
15
|
+
private config;
|
|
16
|
+
private state;
|
|
17
|
+
private plan?;
|
|
18
|
+
private currentStepIndex;
|
|
19
|
+
private actionRetryCount;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new agent instance
|
|
22
|
+
*
|
|
23
|
+
* @param config - Agent configuration
|
|
24
|
+
*/
|
|
25
|
+
constructor(config: AgentConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the agent with the current page state
|
|
28
|
+
*
|
|
29
|
+
* @returns Promise that resolves when initialization is complete
|
|
30
|
+
*/
|
|
31
|
+
initialize(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Execute a goal-oriented task
|
|
34
|
+
*
|
|
35
|
+
* The agent will plan, reason, act, and reflect to achieve the goal.
|
|
36
|
+
*
|
|
37
|
+
* @param goal - High-level goal to achieve
|
|
38
|
+
* @returns Promise that resolves when the goal is achieved or execution completes
|
|
39
|
+
*/
|
|
40
|
+
executeGoal(goal: string): Promise<{
|
|
41
|
+
success: boolean;
|
|
42
|
+
actionsTaken: number;
|
|
43
|
+
goalAchieved: boolean;
|
|
44
|
+
finalState: AgentState;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Update the agent's state from the current page
|
|
48
|
+
*
|
|
49
|
+
* @returns Promise that resolves when state is updated
|
|
50
|
+
*/
|
|
51
|
+
private updateState;
|
|
52
|
+
/**
|
|
53
|
+
* Execute a decided action
|
|
54
|
+
*
|
|
55
|
+
* @param action - The action to execute
|
|
56
|
+
* @param _reasoning - The reasoning result that led to this action
|
|
57
|
+
* @returns Promise resolving to whether the action was successful
|
|
58
|
+
*/
|
|
59
|
+
private executeAction;
|
|
60
|
+
/**
|
|
61
|
+
* Execute a navigation action
|
|
62
|
+
*/
|
|
63
|
+
private executeNavigation;
|
|
64
|
+
/**
|
|
65
|
+
* Execute a click action
|
|
66
|
+
*/
|
|
67
|
+
private executeClick;
|
|
68
|
+
/**
|
|
69
|
+
* Execute a form action
|
|
70
|
+
*/
|
|
71
|
+
private executeForm;
|
|
72
|
+
/**
|
|
73
|
+
* Execute an assertion action
|
|
74
|
+
*/
|
|
75
|
+
private executeAssertion;
|
|
76
|
+
/**
|
|
77
|
+
* Execute a wait action with smart loading detection
|
|
78
|
+
*/
|
|
79
|
+
private executeWait;
|
|
80
|
+
/**
|
|
81
|
+
* Automatically wait after actions that might trigger loading
|
|
82
|
+
* This is called after click, form, and navigation actions
|
|
83
|
+
*/
|
|
84
|
+
private autoWaitAfterAction;
|
|
85
|
+
/**
|
|
86
|
+
* Execute a retry action
|
|
87
|
+
*/
|
|
88
|
+
private executeRetry;
|
|
89
|
+
/**
|
|
90
|
+
* Check if the goal has been achieved
|
|
91
|
+
*/
|
|
92
|
+
private checkGoalAchievement;
|
|
93
|
+
/**
|
|
94
|
+
* Record an error
|
|
95
|
+
*/
|
|
96
|
+
private recordError;
|
|
97
|
+
/**
|
|
98
|
+
* Get the current agent state
|
|
99
|
+
*/
|
|
100
|
+
getState(): AgentState;
|
|
101
|
+
/**
|
|
102
|
+
* Get the current plan
|
|
103
|
+
*/
|
|
104
|
+
getPlan(): PlanningResult | undefined;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agentic/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEX,cAAc,EAGf,MAAM,YAAY,CAAC;AAgBpB;;;;;GAKG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,IAAI,CAAC,CAAiB;IAC9B,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,gBAAgB,CAAkC;IAE1D;;;;OAIG;gBACS,MAAM,EAAE,WAAW;IA8B/B;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;;;;;OAOG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvC,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,UAAU,CAAC;KACxB,CAAC;IA+KF;;;;OAIG;YACW,WAAW;IAiBzB;;;;;;OAMG;YACW,aAAa;IAuF3B;;OAEG;YACW,iBAAiB;IA+B/B;;OAEG;YACW,YAAY;IA+C1B;;OAEG;YACW,WAAW;IAyCzB;;OAEG;YACW,gBAAgB;IAqB9B;;OAEG;YACW,WAAW;IA8CzB;;;OAGG;YACW,mBAAmB;IAgBjC;;OAEG;YACW,YAAY;IAc1B;;OAEG;YACW,oBAAoB;IAOlC;;OAEG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,QAAQ,IAAI,UAAU;IAItB;;OAEG;IACH,OAAO,IAAI,cAAc,GAAG,SAAS;CAGtC"}
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic Browser Automation Agent
|
|
3
|
+
*
|
|
4
|
+
* Main agent class that orchestrates planning, reasoning, acting, and reflection.
|
|
5
|
+
* Implements a goal-oriented, autonomous browser automation system.
|
|
6
|
+
*/
|
|
7
|
+
import { createPlan } from './planner.js';
|
|
8
|
+
import { reasonAndDecide, validateAction } from './react.js';
|
|
9
|
+
import { reflectOnAction, reflectOnProgress } from './reflection.js';
|
|
10
|
+
import { determineRecoveryStrategy, classifyError, getRetryDelay, shouldRetryBasedOnError } from './recovery.js';
|
|
11
|
+
import { captureTargets, buildSelectorForTarget } from '../mimic/selector.js';
|
|
12
|
+
import { getNavigationAction, executeNavigationAction } from '../mimic/navigation.js';
|
|
13
|
+
import { getClickAction, executeClickAction } from '../mimic/click.js';
|
|
14
|
+
import { getFormAction, executeFormAction } from '../mimic/forms.js';
|
|
15
|
+
import { smartWait, isPageLoading, detectLoadingIndicators } from './wait.js';
|
|
16
|
+
/**
|
|
17
|
+
* Agentic Browser Automation Agent
|
|
18
|
+
*
|
|
19
|
+
* An autonomous agent that can plan, reason, act, and reflect to achieve
|
|
20
|
+
* browser automation goals.
|
|
21
|
+
*/
|
|
22
|
+
export class Agent {
|
|
23
|
+
config;
|
|
24
|
+
state;
|
|
25
|
+
plan;
|
|
26
|
+
currentStepIndex = 0;
|
|
27
|
+
actionRetryCount = new Map();
|
|
28
|
+
/**
|
|
29
|
+
* Create a new agent instance
|
|
30
|
+
*
|
|
31
|
+
* @param config - Agent configuration
|
|
32
|
+
*/
|
|
33
|
+
constructor(config) {
|
|
34
|
+
this.config = {
|
|
35
|
+
maxActions: config.maxActions ?? 50,
|
|
36
|
+
maxRetries: config.maxRetries ?? 3,
|
|
37
|
+
enableReflection: config.enableReflection ?? true,
|
|
38
|
+
enablePlanning: config.enablePlanning ?? true,
|
|
39
|
+
actionTimeout: config.actionTimeout ?? 30000,
|
|
40
|
+
...config,
|
|
41
|
+
};
|
|
42
|
+
// Initialize state
|
|
43
|
+
this.state = {
|
|
44
|
+
currentUrl: '',
|
|
45
|
+
pageTitle: '',
|
|
46
|
+
availableElements: [],
|
|
47
|
+
actionHistory: [],
|
|
48
|
+
currentGoal: '',
|
|
49
|
+
overallObjective: '',
|
|
50
|
+
goalAchieved: false,
|
|
51
|
+
errors: [],
|
|
52
|
+
metadata: {
|
|
53
|
+
stepCount: 0,
|
|
54
|
+
startTime: Date.now(),
|
|
55
|
+
lastActionTime: Date.now(),
|
|
56
|
+
},
|
|
57
|
+
isLoading: false,
|
|
58
|
+
loadingIndicatorCount: 0,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Initialize the agent with the current page state
|
|
63
|
+
*
|
|
64
|
+
* @returns Promise that resolves when initialization is complete
|
|
65
|
+
*/
|
|
66
|
+
async initialize() {
|
|
67
|
+
// Capture initial page state
|
|
68
|
+
this.state.currentUrl = this.config.page.url();
|
|
69
|
+
this.state.pageTitle = await this.config.page.title();
|
|
70
|
+
this.state.availableElements = await captureTargets(this.config.page, { interactableOnly: true });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Execute a goal-oriented task
|
|
74
|
+
*
|
|
75
|
+
* The agent will plan, reason, act, and reflect to achieve the goal.
|
|
76
|
+
*
|
|
77
|
+
* @param goal - High-level goal to achieve
|
|
78
|
+
* @returns Promise that resolves when the goal is achieved or execution completes
|
|
79
|
+
*/
|
|
80
|
+
async executeGoal(goal) {
|
|
81
|
+
this.state.overallObjective = goal;
|
|
82
|
+
this.state.currentGoal = goal;
|
|
83
|
+
this.state.metadata.startTime = Date.now();
|
|
84
|
+
// Initialize if not already done
|
|
85
|
+
if (!this.state.currentUrl) {
|
|
86
|
+
await this.initialize();
|
|
87
|
+
}
|
|
88
|
+
// Planning phase
|
|
89
|
+
if (this.config.enablePlanning) {
|
|
90
|
+
console.log('🤔 Planning execution strategy...');
|
|
91
|
+
this.plan = await createPlan(this.config.brain, goal, {
|
|
92
|
+
url: this.state.currentUrl,
|
|
93
|
+
pageTitle: this.state.pageTitle,
|
|
94
|
+
availableElements: this.state.availableElements.length,
|
|
95
|
+
});
|
|
96
|
+
console.log(`📋 Plan created: ${this.plan.steps.length} steps, complexity: ${this.plan.complexity}`);
|
|
97
|
+
if (this.plan.challenges.length > 0) {
|
|
98
|
+
console.log(`⚠️ Potential challenges: ${this.plan.challenges.join(', ')}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Main execution loop
|
|
102
|
+
let consecutiveFailures = 0;
|
|
103
|
+
const maxConsecutiveFailures = 3;
|
|
104
|
+
while (!this.state.goalAchieved &&
|
|
105
|
+
this.state.metadata.stepCount < this.config.maxActions) {
|
|
106
|
+
// Update state before reasoning
|
|
107
|
+
await this.updateState();
|
|
108
|
+
// Check if we should abort
|
|
109
|
+
if (consecutiveFailures >= maxConsecutiveFailures) {
|
|
110
|
+
console.log('❌ Too many consecutive failures, aborting...');
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
// Get current step from plan (if planning enabled)
|
|
114
|
+
const currentStep = this.plan?.steps[this.currentStepIndex];
|
|
115
|
+
// Reasoning phase (ReAct pattern)
|
|
116
|
+
console.log('🧠 Reasoning about next action...');
|
|
117
|
+
const reasoning = await reasonAndDecide(this.config.brain, this.state, currentStep);
|
|
118
|
+
console.log(`💭 Observation: ${reasoning.observation}`);
|
|
119
|
+
console.log(`🤔 Thought: ${reasoning.thought}`);
|
|
120
|
+
console.log(`✅ Decided: ${reasoning.action.description}`);
|
|
121
|
+
// Validate action
|
|
122
|
+
const validation = validateAction(reasoning.action, this.state);
|
|
123
|
+
if (!validation.feasible) {
|
|
124
|
+
console.log(`⚠️ Action not feasible: ${validation.reason}`);
|
|
125
|
+
this.recordError('validation', validation.reason, 'action validation');
|
|
126
|
+
consecutiveFailures++;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
// Execute action
|
|
130
|
+
const actionSuccess = await this.executeAction(reasoning.action, reasoning);
|
|
131
|
+
// Reflection and recovery phase
|
|
132
|
+
if (this.config.enableReflection && this.state.actionHistory.length > 0) {
|
|
133
|
+
const lastAction = this.state.actionHistory[this.state.actionHistory.length - 1];
|
|
134
|
+
if (lastAction) {
|
|
135
|
+
console.log('🔍 Reflecting on action...');
|
|
136
|
+
const reflection = await reflectOnAction(this.config.brain, lastAction, this.state, goal);
|
|
137
|
+
lastAction.reflection = reflection;
|
|
138
|
+
console.log(`📊 Progress: ${reflection.progressMade ? 'Made progress' : 'No progress'}`);
|
|
139
|
+
console.log(`🎯 Confidence: ${(reflection.confidence * 100).toFixed(0)}%`);
|
|
140
|
+
// Error recovery if action failed
|
|
141
|
+
if (!actionSuccess && lastAction.error) {
|
|
142
|
+
const error = this.state.errors[this.state.errors.length - 1];
|
|
143
|
+
if (error) {
|
|
144
|
+
const retryCount = this.actionRetryCount.get(lastAction.id) || 0;
|
|
145
|
+
// Check if we should retry based on error classification
|
|
146
|
+
if (shouldRetryBasedOnError(error, retryCount, this.config.maxRetries)) {
|
|
147
|
+
console.log('🔄 Determining recovery strategy...');
|
|
148
|
+
const recovery = await determineRecoveryStrategy(this.config.brain, error, lastAction, this.state);
|
|
149
|
+
if (recovery.shouldRetry && !recovery.abort) {
|
|
150
|
+
console.log(`🔄 Retrying with strategy: ${recovery.reasoning}`);
|
|
151
|
+
this.actionRetryCount.set(lastAction.id, retryCount + 1);
|
|
152
|
+
// Wait with exponential backoff
|
|
153
|
+
const delay = getRetryDelay(retryCount + 1);
|
|
154
|
+
await this.config.page.waitForTimeout(delay);
|
|
155
|
+
// Retry the action (simplified - could be enhanced)
|
|
156
|
+
consecutiveFailures--; // Don't count retry as a new failure
|
|
157
|
+
continue; // Loop back to retry
|
|
158
|
+
}
|
|
159
|
+
else if (recovery.skipAndContinue) {
|
|
160
|
+
console.log(`⏭️ Skipping action: ${recovery.reasoning}`);
|
|
161
|
+
consecutiveFailures = 0; // Reset on skip
|
|
162
|
+
}
|
|
163
|
+
else if (recovery.abort) {
|
|
164
|
+
console.log(`🛑 Aborting: ${recovery.reasoning}`);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (reflection.alternatives.length > 0) {
|
|
171
|
+
console.log(`💡 Alternatives: ${reflection.alternatives.join(', ')}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Update consecutive failures counter
|
|
176
|
+
if (actionSuccess) {
|
|
177
|
+
consecutiveFailures = 0;
|
|
178
|
+
if (this.plan) {
|
|
179
|
+
this.currentStepIndex++;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
consecutiveFailures++;
|
|
184
|
+
}
|
|
185
|
+
// Periodic progress reflection
|
|
186
|
+
if (this.state.actionHistory.length % 5 === 0 && this.config.enableReflection) {
|
|
187
|
+
const progressReflection = await reflectOnProgress(this.config.brain, this.state, goal);
|
|
188
|
+
console.log(`📈 Overall Progress: ${progressReflection.progressPercentage}%`);
|
|
189
|
+
if (progressReflection.shouldPivot && progressReflection.pivotStrategy) {
|
|
190
|
+
console.log(`🔄 Pivoting strategy: ${progressReflection.pivotStrategy}`);
|
|
191
|
+
// Strategy pivot could be implemented here
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Small delay between actions, but check for loading first
|
|
195
|
+
// If page is loading, wait for loaders instead of fixed delay
|
|
196
|
+
if (this.state.isLoading) {
|
|
197
|
+
await this.autoWaitAfterAction('inter-action');
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
success: this.state.goalAchieved,
|
|
205
|
+
actionsTaken: this.state.actionHistory.length,
|
|
206
|
+
goalAchieved: this.state.goalAchieved,
|
|
207
|
+
finalState: this.state,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Update the agent's state from the current page
|
|
212
|
+
*
|
|
213
|
+
* @returns Promise that resolves when state is updated
|
|
214
|
+
*/
|
|
215
|
+
async updateState() {
|
|
216
|
+
try {
|
|
217
|
+
this.state.currentUrl = this.config.page.url();
|
|
218
|
+
this.state.pageTitle = await this.config.page.title();
|
|
219
|
+
this.state.availableElements = await captureTargets(this.config.page, { interactableOnly: true });
|
|
220
|
+
// Check for loading indicators
|
|
221
|
+
const loaders = await detectLoadingIndicators(this.config.page);
|
|
222
|
+
this.state.isLoading = loaders.length > 0;
|
|
223
|
+
this.state.loadingIndicatorCount = loaders.length;
|
|
224
|
+
this.state.metadata.lastActionTime = Date.now();
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
this.recordError('state_update', String(error), 'state synchronization');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Execute a decided action
|
|
232
|
+
*
|
|
233
|
+
* @param action - The action to execute
|
|
234
|
+
* @param _reasoning - The reasoning result that led to this action
|
|
235
|
+
* @returns Promise resolving to whether the action was successful
|
|
236
|
+
*/
|
|
237
|
+
async executeAction(action, _reasoning) {
|
|
238
|
+
const actionId = `action-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
239
|
+
const actionRecord = {
|
|
240
|
+
id: actionId,
|
|
241
|
+
plannedAt: Date.now(),
|
|
242
|
+
actionType: action.type,
|
|
243
|
+
description: action.description,
|
|
244
|
+
parameters: action.parameters,
|
|
245
|
+
success: false,
|
|
246
|
+
};
|
|
247
|
+
try {
|
|
248
|
+
console.log(`⚡ Executing: ${action.description}`);
|
|
249
|
+
actionRecord.executedAt = Date.now();
|
|
250
|
+
this.state.metadata.stepCount++;
|
|
251
|
+
// Execute based on action type
|
|
252
|
+
let success = false;
|
|
253
|
+
let result = '';
|
|
254
|
+
switch (action.type) {
|
|
255
|
+
case 'navigation':
|
|
256
|
+
success = await this.executeNavigation(action, actionRecord);
|
|
257
|
+
break;
|
|
258
|
+
case 'click':
|
|
259
|
+
success = await this.executeClick(action, actionRecord);
|
|
260
|
+
break;
|
|
261
|
+
case 'form':
|
|
262
|
+
success = await this.executeForm(action, actionRecord);
|
|
263
|
+
break;
|
|
264
|
+
case 'assertion':
|
|
265
|
+
success = await this.executeAssertion(action, actionRecord);
|
|
266
|
+
break;
|
|
267
|
+
case 'wait':
|
|
268
|
+
success = await this.executeWait(action, actionRecord);
|
|
269
|
+
break;
|
|
270
|
+
case 'retry':
|
|
271
|
+
success = await this.executeRetry(action, actionRecord);
|
|
272
|
+
break;
|
|
273
|
+
case 'abort':
|
|
274
|
+
console.log('🛑 Aborting execution as requested');
|
|
275
|
+
actionRecord.success = true; // Abort is a valid action
|
|
276
|
+
actionRecord.result = 'Execution aborted';
|
|
277
|
+
this.state.actionHistory.push(actionRecord);
|
|
278
|
+
return true;
|
|
279
|
+
default:
|
|
280
|
+
throw new Error(`Unknown action type: ${action.type}`);
|
|
281
|
+
}
|
|
282
|
+
actionRecord.success = success;
|
|
283
|
+
actionRecord.result = result;
|
|
284
|
+
// Check if goal is achieved
|
|
285
|
+
if (success && action.expectedOutcome) {
|
|
286
|
+
// Simple heuristic: if action succeeded and we're checking for goal completion
|
|
287
|
+
// This could be enhanced with more sophisticated goal checking
|
|
288
|
+
await this.checkGoalAchievement();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
actionRecord.success = false;
|
|
293
|
+
actionRecord.error = error instanceof Error ? error.message : String(error);
|
|
294
|
+
const errorClassification = classifyError({
|
|
295
|
+
timestamp: Date.now(),
|
|
296
|
+
type: 'execution',
|
|
297
|
+
message: actionRecord.error,
|
|
298
|
+
context: action.description,
|
|
299
|
+
recovered: false,
|
|
300
|
+
});
|
|
301
|
+
this.recordError('execution', actionRecord.error, action.description);
|
|
302
|
+
// If it's a transient error, wait before retrying
|
|
303
|
+
if (errorClassification.category === 'transient' && errorClassification.suggestedWait) {
|
|
304
|
+
await this.config.page.waitForTimeout(errorClassification.suggestedWait);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
this.state.actionHistory.push(actionRecord);
|
|
309
|
+
}
|
|
310
|
+
return actionRecord.success;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Execute a navigation action
|
|
314
|
+
*/
|
|
315
|
+
async executeNavigation(action, record) {
|
|
316
|
+
try {
|
|
317
|
+
const url = action.parameters.url;
|
|
318
|
+
if (!url) {
|
|
319
|
+
throw new Error('Navigation action requires a URL parameter');
|
|
320
|
+
}
|
|
321
|
+
// Use existing navigation logic
|
|
322
|
+
const navigationAction = await getNavigationAction(this.config.page, this.config.brain, `navigate to ${url}`);
|
|
323
|
+
await executeNavigationAction(this.config.page, navigationAction);
|
|
324
|
+
// Wait for navigation to complete and check for loaders
|
|
325
|
+
await this.config.page.waitForLoadState('networkidle');
|
|
326
|
+
await this.autoWaitAfterAction('navigation');
|
|
327
|
+
await this.updateState();
|
|
328
|
+
record.result = `Navigated to ${url}`;
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
record.error = error instanceof Error ? error.message : String(error);
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Execute a click action
|
|
338
|
+
*/
|
|
339
|
+
async executeClick(action, record) {
|
|
340
|
+
try {
|
|
341
|
+
// Capture targets
|
|
342
|
+
const targetElements = await captureTargets(this.config.page, { interactableOnly: true });
|
|
343
|
+
// Use AI to find the right element
|
|
344
|
+
const stepDescription = action.description || 'click on element';
|
|
345
|
+
const clickActionResult = await getClickAction(this.config.page, this.config.brain, stepDescription, targetElements);
|
|
346
|
+
// Build selector for the best candidate
|
|
347
|
+
const bestCandidate = clickActionResult.candidates[0];
|
|
348
|
+
if (!bestCandidate) {
|
|
349
|
+
throw new Error('No clickable element found');
|
|
350
|
+
}
|
|
351
|
+
const clickable = await buildSelectorForTarget(this.config.page, targetElements[bestCandidate.index]);
|
|
352
|
+
if (!clickable) {
|
|
353
|
+
throw new Error('Could not build selector for target element');
|
|
354
|
+
}
|
|
355
|
+
// Agentic context doesn't have testInfo, pass undefined
|
|
356
|
+
await executeClickAction(clickable, clickActionResult, bestCandidate, undefined, action.description);
|
|
357
|
+
// Auto-wait for loading after click
|
|
358
|
+
await this.autoWaitAfterAction('click');
|
|
359
|
+
await this.updateState();
|
|
360
|
+
record.result = `Clicked on element: ${bestCandidate.text || bestCandidate.ariaLabel || 'element'}`;
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
catch (error) {
|
|
364
|
+
record.error = error instanceof Error ? error.message : String(error);
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Execute a form action
|
|
370
|
+
*/
|
|
371
|
+
async executeForm(action, record) {
|
|
372
|
+
try {
|
|
373
|
+
const formElements = await captureTargets(this.config.page, { interactableOnly: true });
|
|
374
|
+
// Use AI to determine form action
|
|
375
|
+
const stepDescription = action.description || 'update form';
|
|
376
|
+
const formActionResult = await getFormAction(this.config.page, this.config.brain, stepDescription, formElements);
|
|
377
|
+
// Find the target element (simplified - could be enhanced)
|
|
378
|
+
const targetElement = await buildSelectorForTarget(this.config.page, formElements[0] // Simplified - should use AI to find the right field
|
|
379
|
+
);
|
|
380
|
+
if (!targetElement) {
|
|
381
|
+
throw new Error('No form element found');
|
|
382
|
+
}
|
|
383
|
+
// Agentic context doesn't have testInfo, pass undefined
|
|
384
|
+
await executeFormAction(this.config.page, formActionResult, targetElement, undefined, action.description);
|
|
385
|
+
// Auto-wait for loading after form action
|
|
386
|
+
await this.autoWaitAfterAction('form');
|
|
387
|
+
await this.updateState();
|
|
388
|
+
record.result = `Form action executed: ${formActionResult.type}`;
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
record.error = error instanceof Error ? error.message : String(error);
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Execute an assertion action
|
|
398
|
+
*/
|
|
399
|
+
async executeAssertion(action, record) {
|
|
400
|
+
try {
|
|
401
|
+
// Simple assertion - could be enhanced
|
|
402
|
+
const expected = action.parameters.expected;
|
|
403
|
+
const actual = await this.config.page.textContent('body') || '';
|
|
404
|
+
const success = actual.includes(expected);
|
|
405
|
+
record.result = success
|
|
406
|
+
? `Assertion passed: found "${expected}"`
|
|
407
|
+
: `Assertion failed: expected "${expected}" but not found`;
|
|
408
|
+
return success;
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
record.error = error instanceof Error ? error.message : String(error);
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Execute a wait action with smart loading detection
|
|
417
|
+
*/
|
|
418
|
+
async executeWait(action, record) {
|
|
419
|
+
try {
|
|
420
|
+
const waitType = action.parameters.waitType || 'smart';
|
|
421
|
+
const duration = action.parameters.duration || 2000;
|
|
422
|
+
const loaderTimeout = action.parameters.loaderTimeout || 10000;
|
|
423
|
+
if (waitType === 'smart' || waitType === 'loader') {
|
|
424
|
+
// Smart wait: detect and wait for loading indicators
|
|
425
|
+
const waitResult = await smartWait(this.config.page, {
|
|
426
|
+
loaderTimeout,
|
|
427
|
+
fallbackTimeout: duration,
|
|
428
|
+
waitForNetworkIdle: action.parameters.waitForNetworkIdle || false,
|
|
429
|
+
});
|
|
430
|
+
if (waitResult.waitedForLoaders) {
|
|
431
|
+
record.result = `Waited for ${waitResult.loaderCount} loading indicator(s) to disappear (${waitResult.duration}ms)`;
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
record.result = `No loaders detected, waited ${waitResult.duration}ms`;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
else if (waitType === 'fixed') {
|
|
438
|
+
// Fixed timeout wait
|
|
439
|
+
await this.config.page.waitForTimeout(duration);
|
|
440
|
+
record.result = `Waited for ${duration}ms (fixed timeout)`;
|
|
441
|
+
}
|
|
442
|
+
else if (waitType === 'network') {
|
|
443
|
+
// Wait for network idle
|
|
444
|
+
await this.config.page.waitForLoadState('networkidle', { timeout: loaderTimeout });
|
|
445
|
+
record.result = `Waited for network to be idle`;
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
// Default to smart wait
|
|
449
|
+
const waitResult = await smartWait(this.config.page, {
|
|
450
|
+
loaderTimeout,
|
|
451
|
+
fallbackTimeout: duration,
|
|
452
|
+
});
|
|
453
|
+
record.result = `Smart wait completed (${waitResult.duration}ms)`;
|
|
454
|
+
}
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
record.error = error instanceof Error ? error.message : String(error);
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Automatically wait after actions that might trigger loading
|
|
464
|
+
* This is called after click, form, and navigation actions
|
|
465
|
+
*/
|
|
466
|
+
async autoWaitAfterAction(actionType) {
|
|
467
|
+
// Check if page is loading
|
|
468
|
+
const isLoading = await isPageLoading(this.config.page);
|
|
469
|
+
if (isLoading) {
|
|
470
|
+
console.log(`⏳ Auto-detected loading state after ${actionType}, waiting for loaders...`);
|
|
471
|
+
await smartWait(this.config.page, {
|
|
472
|
+
loaderTimeout: 5000, // Shorter timeout for auto-waits
|
|
473
|
+
fallbackTimeout: 500,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
// Small delay for DOM updates even if no visible loader
|
|
478
|
+
await this.config.page.waitForTimeout(300);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Execute a retry action
|
|
483
|
+
*/
|
|
484
|
+
async executeRetry(_action, _record) {
|
|
485
|
+
// Retry logic - could retry the last failed action
|
|
486
|
+
const lastAction = this.state.actionHistory[this.state.actionHistory.length - 1];
|
|
487
|
+
if (lastAction && !lastAction.success) {
|
|
488
|
+
console.log(`🔄 Retrying: ${lastAction.description}`);
|
|
489
|
+
// Simplified retry - could be more sophisticated
|
|
490
|
+
return false; // Indicate retry needs to be handled differently
|
|
491
|
+
}
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Check if the goal has been achieved
|
|
496
|
+
*/
|
|
497
|
+
async checkGoalAchievement() {
|
|
498
|
+
// Simple heuristic - could be enhanced with AI-based goal checking
|
|
499
|
+
// For now, we'll use a simple approach where the agent decides through reasoning
|
|
500
|
+
// This could be enhanced to actually verify the goal state
|
|
501
|
+
this.state.goalAchieved = false; // Will be set by reasoning/reflection
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Record an error
|
|
505
|
+
*/
|
|
506
|
+
recordError(type, message, context) {
|
|
507
|
+
this.state.errors.push({
|
|
508
|
+
timestamp: Date.now(),
|
|
509
|
+
type,
|
|
510
|
+
message,
|
|
511
|
+
context,
|
|
512
|
+
recovered: false,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Get the current agent state
|
|
517
|
+
*/
|
|
518
|
+
getState() {
|
|
519
|
+
return { ...this.state };
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Get the current plan
|
|
523
|
+
*/
|
|
524
|
+
getPlan() {
|
|
525
|
+
return this.plan;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/agentic/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,OAAO,KAAK;IACR,MAAM,CAAwB;IAC9B,KAA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