@aarwitz/tapp 0.19.0 → 0.19.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.
|
@@ -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.19.
|
|
4
|
+
"version": "0.19.2",
|
|
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.19.
|
|
27
|
+
"@aarwitz/tapp@0.19.2",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/browser/app.js
CHANGED
|
@@ -106,7 +106,12 @@ function applyAccessMode() {
|
|
|
106
106
|
// runner, a release gate, a decision. A hosted visitor auditing a URL has none of them, and
|
|
107
107
|
// showing the empty frames makes a working run look like a broken one.
|
|
108
108
|
for (const node of document.querySelectorAll("[data-repo-only]")) node.classList.add("hidden");
|
|
109
|
-
|
|
109
|
+
// "What the last run proved" reports a release decision. A read-only website audit never
|
|
110
|
+
// produces one, so the panel can only ever say "No run yet" here.
|
|
111
|
+
document.querySelector(".summary-panel")?.classList.add("hidden");
|
|
112
|
+
// refreshSession() runs on every poll, so this must not overwrite a heading the current run
|
|
113
|
+
// already set — that is what made "Website audit" revert to "tapp" when a run finished.
|
|
114
|
+
if (!state.headingOwnedByRun) setHeading("tapp", "Give it a public website and it will audit the pages read-only.");
|
|
110
115
|
const note = $("#privacy-note-detail");
|
|
111
116
|
if (note) note.textContent = "Websites are audited read-only in the cloud; nothing is clicked. iOS, Android and folders on your own machine need tapp there: npx -y @aarwitz/tapp@latest app";
|
|
112
117
|
}
|
|
@@ -569,7 +574,10 @@ async function runOperation(name, body = {}, { input = "" } = {}) {
|
|
|
569
574
|
|
|
570
575
|
// "What should tapp test?" — route by what was typed. The server classifies again and refuses
|
|
571
576
|
// what the mode cannot do (a hosted Studio cannot open a path on your machine).
|
|
572
|
-
|
|
577
|
+
// `owned` marks a heading as belonging to whatever is happening now, so periodic re-renders
|
|
578
|
+
// leave it alone until something else takes over.
|
|
579
|
+
function setHeading(title, summary, { owned = false } = {}) {
|
|
580
|
+
state.headingOwnedByRun = owned;
|
|
573
581
|
const heading = $("#app-name");
|
|
574
582
|
if (heading) heading.textContent = title;
|
|
575
583
|
const note = $("#app-summary");
|
|
@@ -580,7 +588,7 @@ function setHeading(title, summary) {
|
|
|
580
588
|
// simulator build, a repository that needs a toolchain. The engine answers with where they do
|
|
581
589
|
// run; show that answer where it stays put, not in a toast that disappears in six seconds.
|
|
582
590
|
function answerSelfHost(answer) {
|
|
583
|
-
setHeading("Run this on your machine", "The cloud Studio audits websites; this target needs your toolchain.");
|
|
591
|
+
setHeading("Run this on your machine", "The cloud Studio audits websites; this target needs your toolchain.", { owned: true });
|
|
584
592
|
document.querySelector(".summary-panel")?.classList.add("hidden");
|
|
585
593
|
document.querySelector(".device-stage")?.classList.add("hidden");
|
|
586
594
|
state.transcript = [];
|
|
@@ -598,8 +606,8 @@ async function startFromPrompt(raw) {
|
|
|
598
606
|
state.promptRun = true; state.promptPlatform = "web";
|
|
599
607
|
showProduct(); activateView("overview"); renderDeviceChrome(); renderChat();
|
|
600
608
|
document.querySelector(".device-stage")?.classList.remove("hidden");
|
|
601
|
-
document.querySelector(".summary-panel")?.classList.remove("hidden");
|
|
602
|
-
if (state.session?.access === "anonymous") setHeading("Website audit", "Read-only. Nothing on the page is clicked.");
|
|
609
|
+
if (state.session?.access !== "anonymous") document.querySelector(".summary-panel")?.classList.remove("hidden");
|
|
610
|
+
if (state.session?.access === "anonymous") setHeading("Website audit", "Read-only. Nothing on the page is clicked.", { owned: true });
|
|
603
611
|
const result = await runOperation("audit", { url: prompt.value }, { input: prompt.value });
|
|
604
612
|
state.selectedRunId = result?.capture?.id || state.selectedRunId;
|
|
605
613
|
return;
|
|
@@ -16,6 +16,7 @@ import { initializeProductProject, prepareProductTarget, readProductProject, run
|
|
|
16
16
|
import { readCaptureProvenance } from "./capture-provenance.js";
|
|
17
17
|
import { collectShots } from "./html-report.js";
|
|
18
18
|
import { classifyPrompt } from "../../browser/view-model.js";
|
|
19
|
+
import { JobLanes } from "./job-lanes.js";
|
|
19
20
|
|
|
20
21
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
21
22
|
const assetRoot = path.join(packageRoot, "browser");
|
|
@@ -450,18 +451,57 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
450
451
|
const sessionToken = crypto.randomBytes(32).toString("base64url");
|
|
451
452
|
const csrfToken = crypto.randomBytes(24).toString("base64url");
|
|
452
453
|
const jobs = new Map();
|
|
453
|
-
|
|
454
|
+
// A public Studio serves strangers, and until now it recorded nothing about that — the journal
|
|
455
|
+
// held only startup lines, so "is anyone using this?" had no answer at all. These lines go to
|
|
456
|
+
// stdout, which systemd already captures, so there is no new storage to run:
|
|
457
|
+
//
|
|
458
|
+
// journalctl -u tapp-demo | grep tapp-usage
|
|
459
|
+
//
|
|
460
|
+
// Deliberately not collected: no IP address (Cloudflare fronts this and we do not need it), no
|
|
461
|
+
// full URL (a query string can carry a token or an email), and only the first eight characters
|
|
462
|
+
// of the visitor id — enough to tell two visitors apart in a day's log, not enough to be a
|
|
463
|
+
// durable handle for one. Off unless the Studio is public; a local Studio logging its owner's
|
|
464
|
+
// own use is noise.
|
|
465
|
+
const usage = { visitors: new Set(), audits: 0, refusals: 0, startedAt: new Date().toISOString() };
|
|
466
|
+
const logUsage = (event, fields = {}) => {
|
|
467
|
+
if (!publicAccess) return;
|
|
468
|
+
try {
|
|
469
|
+
console.log(`tapp-usage ${JSON.stringify({ at: new Date().toISOString(), event, ...fields })}`);
|
|
470
|
+
} catch { /* logging must never break a run */ }
|
|
471
|
+
};
|
|
472
|
+
// Where a visitor pointed us, without what they may have put in the query string.
|
|
473
|
+
const safeHost = (value) => { try { return new URL(value).host; } catch { return "unparsed"; } };
|
|
474
|
+
// Engine errors quote the URL they failed on, query string and all — which is how a token or
|
|
475
|
+
// an email in someone's link ends up in a log that was supposed to hold neither. Keep the
|
|
476
|
+
// origin and path, drop everything after it.
|
|
477
|
+
const redactUrls = (text) => String(text).replace(/https?:\/\/[^\s"'<>]+/gi, (match) => {
|
|
478
|
+
try { const u = new URL(match); return `${u.origin}${u.pathname}${u.search || u.hash ? "?…" : ""}`; }
|
|
479
|
+
catch { return "[url]"; }
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
// Individual lines age out of the journal; a rollup means one grep still answers "did anyone
|
|
483
|
+
// use this last week?". unref'd so it never holds the process open, and cleared on close.
|
|
484
|
+
const usageHeartbeat = publicAccess
|
|
485
|
+
? setInterval(() => logUsage("rollup", {
|
|
486
|
+
sinceStart: usage.startedAt,
|
|
487
|
+
distinctVisitors: usage.visitors.size,
|
|
488
|
+
audits: usage.audits,
|
|
489
|
+
refusals: usage.refusals,
|
|
490
|
+
}), 60 * 60 * 1000)
|
|
491
|
+
: null;
|
|
492
|
+
if (usageHeartbeat?.unref) usageHeartbeat.unref();
|
|
493
|
+
|
|
494
|
+
// Work is serialized per lane rather than globally; see job-lanes.js for why.
|
|
495
|
+
const OPERATOR_LANE = "operator";
|
|
496
|
+
const lanes = new JobLanes({ operatorLane: OPERATOR_LANE });
|
|
454
497
|
let liveSession = null;
|
|
455
498
|
let liveManagedRuntime = null;
|
|
456
499
|
let origin = "";
|
|
457
500
|
|
|
458
|
-
const startJob = (operation, work, repositoryId = registry.current()?.id || null) => {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
throw error;
|
|
463
|
-
}
|
|
464
|
-
const job = { id: crypto.randomBytes(10).toString("hex"), operation, repositoryId, status: "running", createdAt: new Date().toISOString(), progress: [] };
|
|
501
|
+
const startJob = (operation, work, repositoryId = registry.current()?.id || null, { lane = OPERATOR_LANE } = {}) => {
|
|
502
|
+
const job = { id: crypto.randomBytes(10).toString("hex"), operation, repositoryId, lane, status: "running", createdAt: new Date().toISOString(), progress: [] };
|
|
503
|
+
const claimed = lanes.claim(lane, job);
|
|
504
|
+
if (!claimed.ok) throw Object.assign(new Error(claimed.message), { statusCode: claimed.statusCode });
|
|
465
505
|
const progress = (entry) => {
|
|
466
506
|
const normalized = typeof entry === "string" ? { text: entry } : entry || {};
|
|
467
507
|
job.progress.push({ at: new Date().toISOString(), phase: normalized.phase || operation, text: String(normalized.text || "").slice(-1200), ...(normalized.current ? { current: normalized.current, total: normalized.total } : {}), ...(normalized.screen ? { screen: String(normalized.screen).slice(0, 200) } : {}) });
|
|
@@ -471,16 +511,16 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
471
511
|
if (normalized.screenshot && path.isAbsolute(normalized.screenshot)) job.latestFrame = normalized.screenshot;
|
|
472
512
|
};
|
|
473
513
|
jobs.set(job.id, job);
|
|
474
|
-
activeMutation = job;
|
|
475
514
|
Promise.resolve().then(() => work(progress)).then((result) => {
|
|
476
515
|
job.status = "completed";
|
|
477
516
|
job.result = result;
|
|
478
517
|
}).catch((error) => {
|
|
479
518
|
job.status = "failed";
|
|
480
519
|
job.error = { message: error.message || String(error), ...(error.details ? { details: error.details } : {}) };
|
|
520
|
+
logUsage("job.failed", { operation, lane: String(lane).slice(0, 8), message: redactUrls(error.message || error).slice(0, 200) });
|
|
481
521
|
}).finally(() => {
|
|
482
522
|
job.completedAt = new Date().toISOString();
|
|
483
|
-
|
|
523
|
+
lanes.release(lane, job);
|
|
484
524
|
});
|
|
485
525
|
return job;
|
|
486
526
|
};
|
|
@@ -522,13 +562,17 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
522
562
|
if (!/^[a-f0-9]{32}$/.test(visitorId)) {
|
|
523
563
|
visitorId = crypto.randomBytes(16).toString("hex");
|
|
524
564
|
response.setHeader("set-cookie", `${VISITOR_COOKIE}=${visitorId}; HttpOnly; SameSite=Lax; Secure; Path=/; Max-Age=2592000`);
|
|
565
|
+
usage.visitors.add(visitorId.slice(0, 8));
|
|
566
|
+
logUsage("visitor.new", { visitor: visitorId.slice(0, 8), distinctVisitors: usage.visitors.size });
|
|
525
567
|
}
|
|
526
568
|
if (!anonymousAllows(request.method, url.pathname)) {
|
|
569
|
+
usage.refusals += 1;
|
|
570
|
+
logUsage("refused", { visitor: visitorId.slice(0, 8), reason: "not-public", method: request.method, path: url.pathname, status: 401 });
|
|
527
571
|
json(response, 401, { error: "Sign in to use this. A public visitor can audit a website read-only; repositories, live sessions and the release gate need an account." });
|
|
528
572
|
return;
|
|
529
573
|
}
|
|
530
574
|
const limited = auditRateLimit(visitorId, request.method, url.pathname);
|
|
531
|
-
if (limited) { response.writeHead(429, { "content-type": "application/json; charset=utf-8", "retry-after": String(limited) }); response.end(JSON.stringify({ error: `Too many audits from here. Try again in ${Math.ceil(limited / 60)} minute(s).` })); return; }
|
|
575
|
+
if (limited) { usage.refusals += 1; logUsage("refused", { visitor: visitorId.slice(0, 8), reason: "rate-limit", retryAfterSec: limited, status: 429 }); response.writeHead(429, { "content-type": "application/json; charset=utf-8", "retry-after": String(limited) }); response.end(JSON.stringify({ error: `Too many audits from here. Try again in ${Math.ceil(limited / 60)} minute(s).` })); return; }
|
|
532
576
|
}
|
|
533
577
|
// The operator sees every capture; a visitor sees only captures stamped with their id.
|
|
534
578
|
const evidenceOwner = anonymous ? visitorId : null;
|
|
@@ -668,7 +712,8 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
668
712
|
|
|
669
713
|
if (request.method === "POST" && url.pathname === "/api/repositories/select") {
|
|
670
714
|
requireMutationAuth(request, hosted ? publicOrigins : origin, csrfToken);
|
|
671
|
-
|
|
715
|
+
const busy = lanes.running(OPERATOR_LANE);
|
|
716
|
+
if (busy) throw Object.assign(new Error(`Operation '${busy.operation}' is still running`), { statusCode: 409 });
|
|
672
717
|
if (liveSession?.active) throw Object.assign(new Error("End the active live session before changing repositories"), { statusCode:409 });
|
|
673
718
|
const body = await readJsonBody(request);
|
|
674
719
|
const repository = registry.select(body.id);
|
|
@@ -688,6 +733,7 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
688
733
|
if (liveSession?.active) throw Object.assign(new Error("End the active live session before opening another project"), { statusCode: 409 });
|
|
689
734
|
if (prompt.kind === "path") {
|
|
690
735
|
if (anonymous) {
|
|
736
|
+
logUsage("self-host.answered", { visitor: visitorId.slice(0, 8), kind: "path" });
|
|
691
737
|
json(response, 200, { kind: "self-host", target: prompt.value, command: `npx -y @aarwitz/tapp@latest app ${prompt.value}`,
|
|
692
738
|
message: `A folder on your machine is not visible from the cloud. Open it with the Studio there: npx -y @aarwitz/tapp@latest app ${prompt.value}` });
|
|
693
739
|
return;
|
|
@@ -701,6 +747,7 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
701
747
|
}
|
|
702
748
|
if (prompt.kind === "github") {
|
|
703
749
|
if (anonymous) {
|
|
750
|
+
logUsage("self-host.answered", { visitor: visitorId.slice(0, 8), kind: "github" });
|
|
704
751
|
json(response, 200, { kind: "self-host", target: prompt.value, command: "npx -y @aarwitz/tapp@latest app",
|
|
705
752
|
message: `Cloning and building ${prompt.value} needs a machine with your toolchain on it. Run the Studio there and paste the same thing: npx -y @aarwitz/tapp@latest app` });
|
|
706
753
|
return;
|
|
@@ -719,6 +766,7 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
719
766
|
if (operation === "explore-build") {
|
|
720
767
|
if (anonymous) {
|
|
721
768
|
const asked = classifyPrompt(body.input);
|
|
769
|
+
logUsage("self-host.answered", { visitor: visitorId.slice(0, 8), kind: asked.kind });
|
|
722
770
|
const where = asked.kind === "apk" ? "an Android device or emulator" : "a Mac with an iOS simulator";
|
|
723
771
|
json(response, 200, { kind: "self-host", target: asked.value, command: "npx -y @aarwitz/tapp@latest app",
|
|
724
772
|
message: `Running ${asked.value || "a build"} needs ${where}, which the cloud does not have. Start the Studio on that machine: npx -y @aarwitz/tapp@latest app` });
|
|
@@ -778,6 +826,9 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
778
826
|
try { fs.mkdirSync(path.join(captureRoot(), auditCapture), { recursive: true }); } catch { /* the run reports its own failure */ }
|
|
779
827
|
setCaptureOwner(auditCapture, visitorId);
|
|
780
828
|
}
|
|
829
|
+
const auditStartedMs = Date.now();
|
|
830
|
+
usage.audits += 1;
|
|
831
|
+
logUsage("audit.start", { visitor: (visitorId || "operator").slice(0, 8), host: safeHost(target.href), pages, totalAudits: usage.audits });
|
|
781
832
|
const job = startJob(operation, async (progress) => {
|
|
782
833
|
const { auditWebSite } = await import("./web-audit.js");
|
|
783
834
|
progress({ phase: "runtime", text: `Opening ${target.href} read-only (up to ${pages} pages, nothing will be clicked)` });
|
|
@@ -788,8 +839,14 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
788
839
|
// whole run while the real screenshots sit in the capture.
|
|
789
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 } : {}) }),
|
|
790
841
|
});
|
|
842
|
+
logUsage("audit.done", {
|
|
843
|
+
visitor: (visitorId || "operator").slice(0, 8), host: safeHost(target.href),
|
|
844
|
+
pagesAudited: summary?.pagesAudited ?? null,
|
|
845
|
+
findings: summary?.issueCount ?? (summary?.issues || []).length,
|
|
846
|
+
seconds: Math.round((Date.now() - auditStartedMs) / 100) / 10,
|
|
847
|
+
});
|
|
791
848
|
return hosted ? hostedPayload(summary) : summary;
|
|
792
|
-
}, null);
|
|
849
|
+
}, null, { lane: visitorId || OPERATOR_LANE });
|
|
793
850
|
job.visitorId = visitorId;
|
|
794
851
|
json(response, 202, { job: publicJob(job, { hosted }) });
|
|
795
852
|
return;
|
|
@@ -931,6 +988,7 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
931
988
|
if (liveManagedRuntime) await engine.stopManagedWebTarget(liveManagedRuntime).catch(() => {});
|
|
932
989
|
}
|
|
933
990
|
await new Promise((resolve, reject) => server.close((error) => error ? reject(error) : resolve()));
|
|
991
|
+
if (usageHeartbeat) clearInterval(usageHeartbeat);
|
|
934
992
|
if (egressProxy) { await egressProxy.close().catch(() => {}); restoreEgressEnv(); }
|
|
935
993
|
registry.close();
|
|
936
994
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Who is allowed to be running right now.
|
|
2
|
+
//
|
|
3
|
+
// A local Studio owns one simulator, one repository and one live session, so the operator's work
|
|
4
|
+
// is strictly one at a time. A public Studio has many visitors whose website audits share none of
|
|
5
|
+
// that — each drives its own browser and writes its own capture — so serializing them globally
|
|
6
|
+
// only makes a working Studio look broken to the second person through the door.
|
|
7
|
+
//
|
|
8
|
+
// Lanes are that distinction: the operator has one, every visitor has their own, and the machine
|
|
9
|
+
// keeps a ceiling because it is finite. The ceiling and a lane conflict are different answers:
|
|
10
|
+
// "busy, try again" is not the same as "your own run is still going".
|
|
11
|
+
export class JobLanes {
|
|
12
|
+
constructor({ operatorLane = "operator", maxConcurrentGuests = 3 } = {}) {
|
|
13
|
+
this.operatorLane = operatorLane;
|
|
14
|
+
this.maxConcurrentGuests = maxConcurrentGuests;
|
|
15
|
+
this.active = new Map();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get guestsRunning() {
|
|
19
|
+
let count = 0;
|
|
20
|
+
for (const lane of this.active.keys()) if (lane !== this.operatorLane) count += 1;
|
|
21
|
+
return count;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
running(lane) {
|
|
25
|
+
return this.active.get(lane) || null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Take the lane, or explain why not. Returns `{ ok: true }`, or `{ ok: false, statusCode,
|
|
30
|
+
* message }` — 409 when this lane is already working, 503 when the machine is at its ceiling.
|
|
31
|
+
*/
|
|
32
|
+
claim(lane, job) {
|
|
33
|
+
const busy = this.active.get(lane);
|
|
34
|
+
if (busy) {
|
|
35
|
+
return { ok: false, statusCode: 409, message: `Operation '${busy.operation}' is still running` };
|
|
36
|
+
}
|
|
37
|
+
if (lane !== this.operatorLane && this.guestsRunning >= this.maxConcurrentGuests) {
|
|
38
|
+
return { ok: false, statusCode: 503, message: "This Studio is busy with other runs right now; try again in a minute." };
|
|
39
|
+
}
|
|
40
|
+
this.active.set(lane, job);
|
|
41
|
+
return { ok: true };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Releasing is idempotent and only ever clears the job that holds the lane, so a late
|
|
45
|
+
// completion cannot free a lane someone else has since taken.
|
|
46
|
+
release(lane, job) {
|
|
47
|
+
if (this.active.get(lane) === job) this.active.delete(lane);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1213,9 +1213,15 @@ export async function exploreWeb({ url, maxActions = 40, timeoutSec = 300, outDi
|
|
|
1213
1213
|
const video = page.video();
|
|
1214
1214
|
await context.close().catch(() => {});
|
|
1215
1215
|
if (video) {
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1216
|
+
const finalPath = path.join(outDir, "exploration.webm");
|
|
1217
|
+
await video.path().then((p) => fs.renameSync(p, finalPath)).catch(() => {});
|
|
1218
|
+
// Playwright records VP9, which QuickTime and Preview cannot open. Write an H.264 sibling
|
|
1219
|
+
// so the evidence is playable where it lands, instead of needing a conversion step that
|
|
1220
|
+
// whoever opens it has to know about. Best effort: no ffmpeg just means no mp4.
|
|
1221
|
+
if (fs.existsSync(finalPath)) {
|
|
1222
|
+
const { writePlayableCopy } = await import("./capture-frames.js");
|
|
1223
|
+
await writePlayableCopy(finalPath).catch(() => {});
|
|
1224
|
+
}
|
|
1219
1225
|
}
|
|
1220
1226
|
await browser.close().catch(() => {});
|
|
1221
1227
|
}
|
|
@@ -364,7 +364,13 @@ export async function runWebFlow({ flow, url, logPath, screenshotDir, recordVide
|
|
|
364
364
|
if (video) {
|
|
365
365
|
try {
|
|
366
366
|
const produced = await video.path();
|
|
367
|
-
if (produced && fs.existsSync(produced))
|
|
367
|
+
if (produced && fs.existsSync(produced)) {
|
|
368
|
+
const finalPath = path.join(recordVideoDir, "replay.webm");
|
|
369
|
+
fs.renameSync(produced, finalPath);
|
|
370
|
+
// VP9 is unopenable in QuickTime and Preview; ship an H.264 sibling beside it.
|
|
371
|
+
const { writePlayableCopy } = await import("./capture-frames.js");
|
|
372
|
+
await writePlayableCopy(finalPath).catch(() => {});
|
|
373
|
+
}
|
|
368
374
|
} catch { /* the replay result matters more than its recording */ }
|
|
369
375
|
}
|
|
370
376
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
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",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"mobile"
|
|
97
97
|
],
|
|
98
98
|
"scripts": {
|
|
99
|
-
"test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-audit.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/ios-crash-attribution.test.js tests/ios-simulator-selection.test.js tests/ios-recording-stop.test.js tests/web-flow.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/browser-product.test.js tests/browser-chat-narration.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
|
|
99
|
+
"test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-audit.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/ios-crash-attribution.test.js tests/ios-simulator-selection.test.js tests/ios-recording-stop.test.js tests/web-flow.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/job-lanes.test.js tests/browser-product.test.js tests/browser-chat-narration.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
|
|
100
100
|
"test:browser-journey": "node --test tests/browser-journey.test.js",
|
|
101
101
|
"test:browser-native": "TAPP_RUN_NATIVE_BROWSER=1 node --test tests/browser-native-journey.test.js"
|
|
102
102
|
}
|