Updates
Rolling release / release (push) Failing after 2m11s

This commit is contained in:
2026-09-14 10:19:13 -04:00
parent a097adf4eb
commit ac5f18f79d
38 changed files with 1265 additions and 157 deletions
+13 -1
View File
@@ -143,6 +143,11 @@ async function extractHits(page, limit) {
}, max);
}
async function pageText(page) {
const text = await page.locator('body').innerText({ timeout: 2000 }).catch(() => '');
return String(text || '').replace(/\n{3,}/g, '\n\n').trim().slice(0, 6000);
}
async function snapshot(page) {
let aria = '';
try {
@@ -150,6 +155,8 @@ async function snapshot(page) {
} catch {
aria = '';
}
const text = await pageText(page);
const title = await page.title().catch(() => '');
const refs = await page.evaluate(() => {
const items = [];
const nodes = document.querySelectorAll('a, button, input, textarea, select, [role="button"], [role="link"], [contenteditable="true"]');
@@ -164,7 +171,12 @@ async function snapshot(page) {
}
return items;
});
return { url: page.url(), title: await page.title(), refs, aria: String(aria || '').slice(0, 8000) };
const result = { url: page.url(), title, refs, text, aria: String(aria || '').slice(0, 4000) };
if (challengeText(title, text)) {
result.challenge = true;
result.next_action = 'Complete the prompt in the Jarvis browser window, then snapshot again.';
}
return result;
}
async function locate(page, input) {