@aarwitz/tapp 0.20.0 → 0.20.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.20.
|
|
4
|
+
"version": "0.20.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.20.
|
|
27
|
+
"@aarwitz/tapp@0.20.1",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/bin/tapp.js
CHANGED
|
@@ -138,8 +138,16 @@ function looksLikeCapture(value) {
|
|
|
138
138
|
const raw = String(value || "").trim();
|
|
139
139
|
if (!raw || raw.startsWith("-") || /^https?:\/\//i.test(raw)) return false;
|
|
140
140
|
if (raw === "latest") return true;
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
// Markers, or a recording: a replayed Flow writes video and no markers, and reading it back is
|
|
142
|
+
// exactly what this is for.
|
|
143
|
+
const RECORDINGS = ["exploration.webm", "replay.webm", "exploration.mp4", "replay.mp4", "exploration.mov"];
|
|
144
|
+
const readable = (dir) => {
|
|
145
|
+
try {
|
|
146
|
+
if (fs.existsSync(path.join(dir, "ocqa-markers.txt"))) return true;
|
|
147
|
+
return RECORDINGS.some((name) => fs.existsSync(path.join(dir, name)));
|
|
148
|
+
} catch { return false; }
|
|
149
|
+
};
|
|
150
|
+
return readable(path.resolve(raw)) || readable(path.join(tappHome, "captures", raw));
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
function artifactKind(file) {
|
package/browser/app.js
CHANGED
|
@@ -416,10 +416,13 @@ async function finishTranscript(name, job) {
|
|
|
416
416
|
const files = await api(`/api/captures/${encodeURIComponent(id)}/files`);
|
|
417
417
|
if (files.shots?.length) {
|
|
418
418
|
pushLine({ kind: "shots", shots: files.shots.slice(0, 3).map((shot) => ({ src: captureUrl(id, shot.src), href: captureUrl(id, shot.src), caption: shot.caption })) });
|
|
419
|
-
// The stage keeps the run's final screen until something newer replaces it
|
|
420
|
-
|
|
419
|
+
// The stage keeps the run's final screen until something newer replaces it — but only
|
|
420
|
+
// when the run never put a live frame there. Evidence screenshots are full-page, so a
|
|
421
|
+
// long marketing page becomes a tall sliver once it is fitted to the stage; the viewport
|
|
422
|
+
// frame the run was already showing is the better picture of where it ended.
|
|
423
|
+
const image = $("#live-frame-image");
|
|
424
|
+
if (!state.live?.active && !image.getAttribute("src")) {
|
|
421
425
|
const last = files.shots.at(-1);
|
|
422
|
-
const image = $("#live-frame-image");
|
|
423
426
|
image.onload = () => { $("#live-frame-loading").classList.add("hidden"); $("#device-placeholder").classList.add("hidden"); };
|
|
424
427
|
image.src = captureUrl(id, last.src);
|
|
425
428
|
$("#live-screen-title").textContent = last.caption || "";
|
|
@@ -837,7 +837,7 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
837
837
|
// Hand the page's screenshot to the progress channel: the Studio's device stage polls
|
|
838
838
|
// the job's latest frame, and without this an audit watches an empty panel for its
|
|
839
839
|
// whole run while the real screenshots sit in the capture.
|
|
840
|
-
onPage: (page, n) => progress({ phase: "explore", text: `Audited ${page.url} — ${page.findings.length} finding(s)`, current: n, total: pages, ...(page.screenshot ? { screenshot: page.screenshot } : {}) }),
|
|
840
|
+
onPage: (page, n) => progress({ phase: "explore", text: `Audited ${page.url} — ${page.findings.length} finding(s)`, current: n, total: pages, ...(page.frame || page.screenshot ? { screenshot: page.frame || page.screenshot } : {}) }),
|
|
841
841
|
});
|
|
842
842
|
logUsage("audit.done", {
|
|
843
843
|
visitor: (visitorId || "operator").slice(0, 8), host: safeHost(target.href),
|
|
@@ -29,13 +29,17 @@ export function resolveCapture(target = "") {
|
|
|
29
29
|
try { entries = fs.readdirSync(root, { withFileTypes: true }).filter((e) => e.isDirectory()); } catch { return null; }
|
|
30
30
|
const newest = entries
|
|
31
31
|
.map((e) => ({ dir: path.join(root, e.name), at: fs.statSync(path.join(root, e.name)).mtimeMs }))
|
|
32
|
-
.sort((a, b) => b.at - a.at)
|
|
32
|
+
.sort((a, b) => b.at - a.at)
|
|
33
|
+
.find(({ dir }) => fs.existsSync(path.join(dir, "ocqa-markers.txt")) || !!findRecording(dir));
|
|
33
34
|
return newest ? newest.dir : null;
|
|
34
35
|
}
|
|
36
|
+
// A replayed Flow records video but writes no markers, so "has markers" was too narrow a test
|
|
37
|
+
// and `look` refused to open the very recordings it exists to read.
|
|
38
|
+
const readable = (dir) => fs.existsSync(path.join(dir, "ocqa-markers.txt")) || !!findRecording(dir);
|
|
35
39
|
const direct = path.resolve(value);
|
|
36
|
-
if (
|
|
40
|
+
if (readable(direct)) return direct;
|
|
37
41
|
const byId = path.join(root, value);
|
|
38
|
-
if (
|
|
42
|
+
if (readable(byId)) return byId;
|
|
39
43
|
return null;
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -260,11 +260,17 @@ async function auditOnePage(context, target, { timeoutMs, linkCheckLimit, captur
|
|
|
260
260
|
// Where this page's screenshot landed, so a live viewer can show the page being audited
|
|
261
261
|
// instead of an empty panel. Absolute, because that is what the progress channel forwards.
|
|
262
262
|
let statePath = "";
|
|
263
|
+
let framePath = "";
|
|
263
264
|
if (capture) {
|
|
264
265
|
capture.states += 1;
|
|
265
266
|
const stateName = `state_${capture.states}_${slug(target.pathname === "/" ? (controls.title || "home") : target.pathname)}.png`;
|
|
266
267
|
statePath = path.join(capture.dir, stateName);
|
|
267
268
|
await page.screenshot({ path: statePath, fullPage: true }).catch(() => page.screenshot({ path: statePath }).catch(() => {}));
|
|
269
|
+
// Evidence wants the whole page; a live viewer wants what a person would be looking at. A
|
|
270
|
+
// full-page shot of a long marketing page is a tall sliver once it is fitted into a
|
|
271
|
+
// device stage, so write a viewport-shaped frame alongside it for anything watching.
|
|
272
|
+
framePath = path.join(capture.dir, `frame_${capture.states}.png`);
|
|
273
|
+
await page.screenshot({ path: framePath }).catch(() => { framePath = statePath; });
|
|
268
274
|
capture.emit("STATE", { screen, url: page.url(), elements: controls.controlCount, role: "page", controls: controls.dead.map((d) => d.label).filter(Boolean).slice(0, 40), inputs: [], settled: true, screenshot: stateName });
|
|
269
275
|
for (const f of findings) {
|
|
270
276
|
if (f.selector) {
|
|
@@ -290,6 +296,7 @@ async function auditOnePage(context, target, { timeoutMs, linkCheckLimit, captur
|
|
|
290
296
|
...(controls.wiringUnverifiable ? { wiringUnverifiable: controls.wiringUnverifiable } : {}),
|
|
291
297
|
findings,
|
|
292
298
|
...(statePath ? { screenshot: statePath } : {}),
|
|
299
|
+
...(framePath ? { frame: framePath } : {}),
|
|
293
300
|
links: allowedLinks,
|
|
294
301
|
};
|
|
295
302
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.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",
|