testchimp-runner-core 0.0.33 → 0.0.35
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/execution-service.d.ts +1 -4
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/execution-service.js +155 -468
- package/dist/execution-service.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/llm-facade.d.ts.map +1 -1
- package/dist/llm-facade.js +7 -7
- package/dist/llm-facade.js.map +1 -1
- package/dist/llm-provider.d.ts +9 -0
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/model-constants.d.ts +16 -5
- package/dist/model-constants.d.ts.map +1 -1
- package/dist/model-constants.js +17 -6
- package/dist/model-constants.js.map +1 -1
- package/dist/orchestrator/decision-parser.d.ts +18 -0
- package/dist/orchestrator/decision-parser.d.ts.map +1 -0
- package/dist/orchestrator/decision-parser.js +127 -0
- package/dist/orchestrator/decision-parser.js.map +1 -0
- package/dist/orchestrator/index.d.ts +4 -2
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +15 -2
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/orchestrator-agent.d.ts +17 -22
- package/dist/orchestrator/orchestrator-agent.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator-agent.js +708 -577
- package/dist/orchestrator/orchestrator-agent.js.map +1 -1
- package/dist/orchestrator/orchestrator-prompts.d.ts +32 -0
- package/dist/orchestrator/orchestrator-prompts.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator-prompts.js +737 -0
- package/dist/orchestrator/orchestrator-prompts.js.map +1 -0
- package/dist/orchestrator/page-som-handler.d.ts +106 -0
- package/dist/orchestrator/page-som-handler.d.ts.map +1 -0
- package/dist/orchestrator/page-som-handler.js +1353 -0
- package/dist/orchestrator/page-som-handler.js.map +1 -0
- package/dist/orchestrator/som-types.d.ts +149 -0
- package/dist/orchestrator/som-types.d.ts.map +1 -0
- package/dist/orchestrator/som-types.js +87 -0
- package/dist/orchestrator/som-types.js.map +1 -0
- package/dist/orchestrator/tool-registry.d.ts +2 -0
- package/dist/orchestrator/tool-registry.d.ts.map +1 -1
- package/dist/orchestrator/tool-registry.js.map +1 -1
- package/dist/orchestrator/tools/index.d.ts +5 -1
- package/dist/orchestrator/tools/index.d.ts.map +1 -1
- package/dist/orchestrator/tools/index.js +9 -2
- package/dist/orchestrator/tools/index.js.map +1 -1
- package/dist/orchestrator/tools/refresh-som-markers.d.ts +12 -0
- package/dist/orchestrator/tools/refresh-som-markers.d.ts.map +1 -0
- package/dist/orchestrator/tools/refresh-som-markers.js +64 -0
- package/dist/orchestrator/tools/refresh-som-markers.js.map +1 -0
- package/dist/orchestrator/tools/verify-action-result.d.ts +17 -0
- package/dist/orchestrator/tools/verify-action-result.d.ts.map +1 -0
- package/dist/orchestrator/tools/verify-action-result.js +140 -0
- package/dist/orchestrator/tools/verify-action-result.js.map +1 -0
- package/dist/orchestrator/tools/view-previous-screenshot.d.ts +15 -0
- package/dist/orchestrator/tools/view-previous-screenshot.d.ts.map +1 -0
- package/dist/orchestrator/tools/view-previous-screenshot.js +92 -0
- package/dist/orchestrator/tools/view-previous-screenshot.js.map +1 -0
- package/dist/orchestrator/types.d.ts +49 -1
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js +11 -1
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +40 -34
- package/dist/prompts.js.map +1 -1
- package/dist/scenario-service.d.ts +5 -0
- package/dist/scenario-service.d.ts.map +1 -1
- package/dist/scenario-service.js +17 -0
- package/dist/scenario-service.js.map +1 -1
- package/dist/scenario-worker-class.d.ts +4 -0
- package/dist/scenario-worker-class.d.ts.map +1 -1
- package/dist/scenario-worker-class.js +21 -3
- package/dist/scenario-worker-class.js.map +1 -1
- package/dist/testing/agent-tester.d.ts +35 -0
- package/dist/testing/agent-tester.d.ts.map +1 -0
- package/dist/testing/agent-tester.js +84 -0
- package/dist/testing/agent-tester.js.map +1 -0
- package/dist/testing/ref-translator-tester.d.ts +44 -0
- package/dist/testing/ref-translator-tester.d.ts.map +1 -0
- package/dist/testing/ref-translator-tester.js +104 -0
- package/dist/testing/ref-translator-tester.js.map +1 -0
- package/dist/utils/coordinate-converter.d.ts +32 -0
- package/dist/utils/coordinate-converter.d.ts.map +1 -0
- package/dist/utils/coordinate-converter.js +130 -0
- package/dist/utils/coordinate-converter.js.map +1 -0
- package/dist/utils/hierarchical-selector.d.ts +47 -0
- package/dist/utils/hierarchical-selector.d.ts.map +1 -0
- package/dist/utils/hierarchical-selector.js +212 -0
- package/dist/utils/hierarchical-selector.js.map +1 -0
- package/dist/utils/page-info-retry.d.ts +14 -0
- package/dist/utils/page-info-retry.d.ts.map +1 -0
- package/dist/utils/page-info-retry.js +60 -0
- package/dist/utils/page-info-retry.js.map +1 -0
- package/dist/utils/page-info-utils.d.ts +1 -0
- package/dist/utils/page-info-utils.d.ts.map +1 -1
- package/dist/utils/page-info-utils.js +46 -18
- package/dist/utils/page-info-utils.js.map +1 -1
- package/dist/utils/ref-attacher.d.ts +21 -0
- package/dist/utils/ref-attacher.d.ts.map +1 -0
- package/dist/utils/ref-attacher.js +149 -0
- package/dist/utils/ref-attacher.js.map +1 -0
- package/dist/utils/ref-translator.d.ts +49 -0
- package/dist/utils/ref-translator.d.ts.map +1 -0
- package/dist/utils/ref-translator.js +276 -0
- package/dist/utils/ref-translator.js.map +1 -0
- package/package.json +1 -1
- package/plandocs/BEFORE_AFTER_VERIFICATION.md +148 -0
- package/plandocs/COORDINATE_MODE_DIAGNOSIS.md +144 -0
- package/plandocs/IMPLEMENTATION_STATUS.md +108 -0
- package/plandocs/PHASE_1_COMPLETE.md +165 -0
- package/plandocs/PHASE_1_SUMMARY.md +184 -0
- package/plandocs/PROMPT_OPTIMIZATION_ANALYSIS.md +120 -0
- package/plandocs/PROMPT_SANITY_CHECK.md +120 -0
- package/plandocs/SESSION_SUMMARY_v0.0.33.md +151 -0
- package/plandocs/TROUBLESHOOTING_SESSION.md +72 -0
- package/plandocs/VISUAL_AGENT_EVOLUTION_PLAN.md +396 -0
- package/plandocs/WHATS_NEW_v0.0.33.md +183 -0
- package/plandocs/exploratory-mode-support-v2.plan.md +953 -0
- package/plandocs/exploratory-mode-support.plan.md +928 -0
- package/plandocs/journey-id-tracking-addendum.md +227 -0
- package/src/execution-service.ts +179 -596
- package/src/index.ts +10 -0
- package/src/llm-facade.ts +8 -8
- package/src/llm-provider.ts +11 -1
- package/src/model-constants.ts +17 -5
- package/src/orchestrator/decision-parser.ts +139 -0
- package/src/orchestrator/index.ts +27 -2
- package/src/orchestrator/orchestrator-agent.ts +868 -623
- package/src/orchestrator/orchestrator-prompts.ts +786 -0
- package/src/orchestrator/page-som-handler.ts +1565 -0
- package/src/orchestrator/som-types.ts +188 -0
- package/src/orchestrator/tool-registry.ts +2 -0
- package/src/orchestrator/tools/index.ts +5 -1
- package/src/orchestrator/tools/refresh-som-markers.ts +69 -0
- package/src/orchestrator/tools/verify-action-result.ts +159 -0
- package/src/orchestrator/tools/view-previous-screenshot.ts +103 -0
- package/src/orchestrator/types.ts +95 -4
- package/src/prompts.ts +40 -34
- package/src/scenario-service.ts +20 -0
- package/src/scenario-worker-class.ts +30 -4
- package/src/utils/coordinate-converter.ts +162 -0
- package/src/utils/page-info-retry.ts +65 -0
- package/src/utils/page-info-utils.ts +53 -18
- package/testchimp-runner-core-0.0.35.tgz +0 -0
- /package/{CREDIT_CALLBACK_ARCHITECTURE.md → plandocs/CREDIT_CALLBACK_ARCHITECTURE.md} +0 -0
- /package/{INTEGRATION_COMPLETE.md → plandocs/INTEGRATION_COMPLETE.md} +0 -0
- /package/{VISION_DIAGNOSTICS_IMPROVEMENTS.md → plandocs/VISION_DIAGNOSTICS_IMPROVEMENTS.md} +0 -0
- /package/{RELEASE_0.0.26.md → releasenotes/RELEASE_0.0.26.md} +0 -0
- /package/{RELEASE_0.0.27.md → releasenotes/RELEASE_0.0.27.md} +0 -0
- /package/{RELEASE_0.0.28.md → releasenotes/RELEASE_0.0.28.md} +0 -0
|
@@ -8,6 +8,7 @@ export interface InteractiveElement {
|
|
|
8
8
|
id: string | null;
|
|
9
9
|
text: string;
|
|
10
10
|
type: string;
|
|
11
|
+
name: string; // name attribute (critical for form inputs)
|
|
11
12
|
role: string;
|
|
12
13
|
ariaLabel: string;
|
|
13
14
|
placeholder: string;
|
|
@@ -34,7 +35,9 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
34
35
|
if ('accessibility' in input) {
|
|
35
36
|
// Input is a Page object
|
|
36
37
|
hasPageObject = true;
|
|
37
|
-
|
|
38
|
+
// CRITICAL: Use interestingOnly: false to get FULL ARIA tree like Playwright MCP
|
|
39
|
+
// This includes all structural nodes (generic, paragraph, etc.) not just interactive ones
|
|
40
|
+
const snapshot = await input.accessibility.snapshot({ interestingOnly: false });
|
|
38
41
|
const url = input.url();
|
|
39
42
|
const title = await input.title();
|
|
40
43
|
domSnapshot = { url, title, accessibilityTree: snapshot };
|
|
@@ -57,7 +60,8 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
57
60
|
'[role="textbox"]',
|
|
58
61
|
'[role="checkbox"]',
|
|
59
62
|
'[role="radio"]',
|
|
60
|
-
'[onclick]'
|
|
63
|
+
'[onclick]',
|
|
64
|
+
'[type="submit"]'
|
|
61
65
|
];
|
|
62
66
|
|
|
63
67
|
const allInteractive = new Set<any>();
|
|
@@ -65,11 +69,30 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
65
69
|
doc.querySelectorAll(selector).forEach((el: any) => allInteractive.add(el));
|
|
66
70
|
});
|
|
67
71
|
|
|
72
|
+
// CRITICAL: Also detect elements that are styled/behave as interactive
|
|
73
|
+
// (e.g., divs/spans with cursor:pointer, click handlers)
|
|
74
|
+
// This catches modern web apps that use non-semantic HTML
|
|
75
|
+
const allElements = doc.querySelectorAll('div, span, p, li, td');
|
|
76
|
+
allElements.forEach((el: any) => {
|
|
77
|
+
const styles = (globalThis as any).window.getComputedStyle(el);
|
|
78
|
+
const hasClickHandler = el.onclick ||
|
|
79
|
+
el.getAttribute('onclick') ||
|
|
80
|
+
el.hasAttribute('data-action') ||
|
|
81
|
+
el.hasAttribute('data-click');
|
|
82
|
+
|
|
83
|
+
// Include if: cursor is pointer, has click handler, or has tabindex (keyboard focusable)
|
|
84
|
+
if (styles.cursor === 'pointer' || hasClickHandler || el.tabIndex >= 0) {
|
|
85
|
+
allInteractive.add(el);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
68
89
|
allInteractive.forEach((el: any) => {
|
|
69
90
|
const rect = el.getBoundingClientRect();
|
|
70
91
|
|
|
71
92
|
// Skip invisible elements
|
|
72
|
-
if (rect.width === 0 || rect.height === 0)
|
|
93
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
73
96
|
|
|
74
97
|
const id = el.id || null;
|
|
75
98
|
const tag = el.tagName.toLowerCase();
|
|
@@ -95,6 +118,12 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
95
118
|
selectors.push(`getByRole('${role}', {name: '${text}'})`);
|
|
96
119
|
}
|
|
97
120
|
|
|
121
|
+
// 2b. BEST: getByRole for buttons with type attribute (more specific)
|
|
122
|
+
if (tag === 'button' && el.type) {
|
|
123
|
+
selectors.push(`getByRole('button', {name: '${text}'})`);
|
|
124
|
+
selectors.push(`button[type="${el.type}"]`);
|
|
125
|
+
}
|
|
126
|
+
|
|
98
127
|
// 3. BEST: getByPlaceholder for inputs with placeholders
|
|
99
128
|
if (placeholder && placeholder.length > 0 && placeholder.length < 50) {
|
|
100
129
|
selectors.push(`getByPlaceholder('${placeholder}')`);
|
|
@@ -110,7 +139,21 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
110
139
|
el.getAttribute('data-id') || el.getAttribute('data-test');
|
|
111
140
|
if (dataTestId) selectors.push(`getByTestId('${dataTestId}')`);
|
|
112
141
|
|
|
113
|
-
// 6.
|
|
142
|
+
// 6. GOOD: name attribute (especially for form inputs - very common and stable)
|
|
143
|
+
const nameAttr = el.getAttribute('name');
|
|
144
|
+
if (nameAttr && (tag === 'input' || tag === 'textarea' || tag === 'select')) {
|
|
145
|
+
selectors.push(`input[name="${nameAttr}"]`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 6b. GOOD: class-based selectors for buttons (common in modern frameworks)
|
|
149
|
+
if (tag === 'button' && el.className) {
|
|
150
|
+
const classes = el.className.split(' ').filter((c: string) => c.length > 0 && !c.includes('userfront-'));
|
|
151
|
+
if (classes.length > 0) {
|
|
152
|
+
selectors.push(`button.${classes[0]}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// 7. LAST RESORT: ID selector (only if stable - avoid auto-generated IDs with unicode)
|
|
114
157
|
// Skip auto-generated Ant Design IDs like «r3»-form-item or rc_select_xxx
|
|
115
158
|
if (id && !id.includes('«') && !id.match(/^(rc_|:r[0-9]+:|__)/)) {
|
|
116
159
|
selectors.push(`#${id}`);
|
|
@@ -121,6 +164,7 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
121
164
|
id,
|
|
122
165
|
text,
|
|
123
166
|
type,
|
|
167
|
+
name: nameAttr || '', // CRITICAL: Capture name attribute for form inputs
|
|
124
168
|
role,
|
|
125
169
|
ariaLabel,
|
|
126
170
|
placeholder,
|
|
@@ -182,23 +226,14 @@ export async function getEnhancedPageInfo(input: any | { url: string; title: str
|
|
|
182
226
|
}
|
|
183
227
|
|
|
184
228
|
formattedElements = selectedElements.map((e, i) => {
|
|
185
|
-
const idInfo = e.id ? `#${e.id}` : '
|
|
229
|
+
const idInfo = e.id ? `#${e.id}` : '';
|
|
186
230
|
const typeInfo = e.type ? ` type="${e.type}"` : '';
|
|
231
|
+
const nameInfo = e.name ? ` name="${e.name}"` : '';
|
|
187
232
|
const placeholderInfo = e.placeholder ? ` placeholder="${e.placeholder}"` : '';
|
|
233
|
+
const roleInfo = e.role ? ` role="${e.role}"` : '';
|
|
188
234
|
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
if (e.selectors && e.selectors.length > 0) {
|
|
192
|
-
selectorsInfo = e.selectors[0]; // Best option
|
|
193
|
-
if (e.selectors.length > 1) {
|
|
194
|
-
selectorsInfo += ` (or: ${e.selectors.slice(1, 3).join(', ')})`; // Show up to 2 alternatives
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
selectorsInfo = 'No reliable selector available';
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return `${i + 1}. [${e.bbox.x},${e.bbox.y} ${e.bbox.width}x${e.bbox.height}] <${e.tag}> ${idInfo}${typeInfo}${placeholderInfo} "${e.text}"
|
|
201
|
-
→ ${selectorsInfo}`;
|
|
235
|
+
// Compact format: show all relevant attributes for LLM to construct selectors
|
|
236
|
+
return `${i + 1}. [${e.bbox.x},${e.bbox.y} ${e.bbox.width}x${e.bbox.height}] <${e.tag}>${idInfo}${typeInfo}${nameInfo}${placeholderInfo}${roleInfo} "${e.text}"`;
|
|
202
237
|
}).join('\n');
|
|
203
238
|
|
|
204
239
|
// Show stats for omitted elements
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|