@aarwitz/tapp 0.21.0 → 0.21.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tapp",
|
|
3
3
|
"description": "Give Claude hands and eyes on iOS, Android, and web apps, with exploration, replayable flows, evidence, and deterministic CI gates.",
|
|
4
|
-
"version": "0.21.
|
|
4
|
+
"version": "0.21.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aaron Horowitz",
|
|
7
7
|
"url": "https://github.com/aarwitz"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"command": "npx",
|
|
25
25
|
"args": [
|
|
26
26
|
"-y",
|
|
27
|
-
"@aarwitz/tapp@0.21.
|
|
27
|
+
"@aarwitz/tapp@0.21.1",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
|
@@ -817,7 +817,10 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
817
817
|
let target;
|
|
818
818
|
try { target = new URL(String(body.url || "")); } catch { throw Object.assign(new Error("Audit needs a valid http(s) URL"), { statusCode: 400 }); }
|
|
819
819
|
if (!/^https?:$/.test(target.protocol)) throw Object.assign(new Error("Audit needs a valid http(s) URL"), { statusCode: 400 });
|
|
820
|
-
|
|
820
|
+
// Six was a quiet default with nothing in the UI to change it, so every site a visitor
|
|
821
|
+
// pointed the Studio at came back as a six-page site — including ones with a dozen
|
|
822
|
+
// sections, a login and a booking flow. A read-only page costs a couple of seconds.
|
|
823
|
+
const pages = Math.max(1, Math.min(20, Number(body.pages) || 12));
|
|
821
824
|
// Mint the capture id here so the evidence can be stamped as this visitor's before the
|
|
822
825
|
// run writes anything; a capture that appeared first and was claimed afterwards would be
|
|
823
826
|
// briefly readable by everyone.
|
|
@@ -439,7 +439,7 @@ export async function dismissBlockingOverlay(page) {
|
|
|
439
439
|
.map((element) => (element.innerText || element.getAttribute("aria-label") || "").replace(/\s+/g, " ").trim())
|
|
440
440
|
.filter(Boolean)
|
|
441
441
|
.slice(0, 20);
|
|
442
|
-
}).catch(() => null);
|
|
442
|
+
}, undefined, { timeout: 2_000 }).catch(() => null);
|
|
443
443
|
if (!choice || !choice.length) return null;
|
|
444
444
|
const label = chooseOverlayDismissal(choice);
|
|
445
445
|
if (!label) return null;
|
|
@@ -1236,16 +1236,24 @@ export async function exploreWeb({ url, maxActions = 40, timeoutSec = 300, outDi
|
|
|
1236
1236
|
const buttons = page.locator("button:visible, [role=button]:visible, input[type=submit]:visible, summary:visible");
|
|
1237
1237
|
const buttonTotal = await buttons.count().catch(() => 0);
|
|
1238
1238
|
const buttonsPerPage = webButtonsPerPage(maxActions);
|
|
1239
|
+
// Reset per page: a blocker that defeats recovery here says nothing about the next route.
|
|
1240
|
+
let pageRecoveryHopeless = false;
|
|
1239
1241
|
const n = Math.min(buttonTotal, buttonsPerPage);
|
|
1240
1242
|
if (buttonTotal > buttonsPerPage) probeCapHit = true;
|
|
1241
1243
|
for (let i = 0; i < n && actions < maxActions && Date.now() < deadline; i++) {
|
|
1242
1244
|
const b = buttons.nth(i);
|
|
1245
|
+
// Reading a label is metadata, not navigation, but every locator call inherits the
|
|
1246
|
+
// page's 15s default — so five reads on one unstable element cost seventy-five seconds,
|
|
1247
|
+
// which is how three controls consumed three hundred and forty seconds of a run. If an
|
|
1248
|
+
// attribute cannot be read in a second the element is not in a state worth waiting for,
|
|
1249
|
+
// and an empty label is the honest answer.
|
|
1250
|
+
const READ = { timeout: 1_000 };
|
|
1243
1251
|
const label = webControlLabel({
|
|
1244
|
-
text: await b.textContent().catch(() => ""),
|
|
1245
|
-
value: await b.getAttribute("value").catch(() => ""),
|
|
1246
|
-
ariaLabel: await b.getAttribute("aria-label").catch(() => ""),
|
|
1247
|
-
title: await b.getAttribute("title").catch(() => ""),
|
|
1248
|
-
id: await b.getAttribute("id").catch(() => ""),
|
|
1252
|
+
text: await b.textContent(READ).catch(() => ""),
|
|
1253
|
+
value: await b.getAttribute("value", READ).catch(() => ""),
|
|
1254
|
+
ariaLabel: await b.getAttribute("aria-label", READ).catch(() => ""),
|
|
1255
|
+
title: await b.getAttribute("title", READ).catch(() => ""),
|
|
1256
|
+
id: await b.getAttribute("id", READ).catch(() => ""),
|
|
1249
1257
|
}).slice(0, 40);
|
|
1250
1258
|
if (/log ?out|sign ?out|delete|remove/i.test(label)) continue; // don't destroy test state
|
|
1251
1259
|
// Nor consent on anyone's behalf. Probing clicks every button it can reach, which on a
|
|
@@ -1269,31 +1277,38 @@ export async function exploreWeb({ url, maxActions = 40, timeoutSec = 300, outDi
|
|
|
1269
1277
|
} catch {}
|
|
1270
1278
|
if (!clickSucceeded) {
|
|
1271
1279
|
// Something is covering this control — almost always a modal, drawer or cookie banner
|
|
1272
|
-
// opened by a button probed moments ago. Every remaining control on the page used to
|
|
1273
|
-
//
|
|
1274
|
-
//
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
//
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
await
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
//
|
|
1287
|
-
// is keyed by route rather than by page object, so it stays valid.
|
|
1288
|
-
await page.goto(beforeState.url, { waitUntil: "domcontentloaded" }).catch(() => {});
|
|
1289
|
-
await waitForWebStability(page);
|
|
1290
|
-
// The reload is itself a change, so the pre-reload snapshot would make any control
|
|
1291
|
-
// look like it did something. Judge this click against the page as it is now.
|
|
1280
|
+
// opened by a button probed moments ago. Every remaining control on the page used to be
|
|
1281
|
+
// clicked into that overlay and silently skipped, so a page with a modal reported no
|
|
1282
|
+
// dead controls at all however many it had.
|
|
1283
|
+
//
|
|
1284
|
+
// Recovery is bounded, and gives up for the whole page rather than per control. An
|
|
1285
|
+
// overlay that survived a dismissal and a reload will survive the next control too, and
|
|
1286
|
+
// paying the reload again for each one is how a single stubborn page turned three
|
|
1287
|
+
// clicks into three hundred and forty seconds.
|
|
1288
|
+
if (!pageRecoveryHopeless) {
|
|
1289
|
+
const dismissed = await dismissBlockingOverlay(page).catch(() => null);
|
|
1290
|
+
if (dismissed) narrate(`Dismissed an overlay with "${dismissed}"`, { screen: ob.screen });
|
|
1291
|
+
else await page.keyboard.press("Escape").catch(() => {});
|
|
1292
|
+
await waitForWebStability(page, { timeoutMs: 2_000 });
|
|
1293
|
+
// Clearing the obstruction is itself a change, so anything compared against the
|
|
1294
|
+
// snapshot taken before it would look as though this control had done something.
|
|
1292
1295
|
beforeState = await captureWebControlState(page, b);
|
|
1293
1296
|
try {
|
|
1294
|
-
await b.click({ timeout:
|
|
1297
|
+
await b.click({ timeout: 2_000 });
|
|
1295
1298
|
clickSucceeded = true;
|
|
1296
|
-
} catch {
|
|
1299
|
+
} catch {
|
|
1300
|
+
// One reload per page, with a short navigation deadline: the default is thirty
|
|
1301
|
+
// seconds, which is most of a run to spend on one unreachable button.
|
|
1302
|
+
await page.goto(beforeState.url, { waitUntil: "domcontentloaded", timeout: 5_000 }).catch(() => {});
|
|
1303
|
+
await waitForWebStability(page, { timeoutMs: 2_000 });
|
|
1304
|
+
beforeState = await captureWebControlState(page, b);
|
|
1305
|
+
try {
|
|
1306
|
+
await b.click({ timeout: 2_000 });
|
|
1307
|
+
clickSucceeded = true;
|
|
1308
|
+
} catch {
|
|
1309
|
+
pageRecoveryHopeless = true;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1297
1312
|
}
|
|
1298
1313
|
}
|
|
1299
1314
|
if (!clickSucceeded) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"mcpName": "io.github.aarwitz/tapp",
|
|
5
5
|
"description": "Let coding agents verify UI changes on real iOS, Android, and web surfaces, then enforce reviewed proof in deterministic CI.",
|
|
6
6
|
"license": "MIT",
|