@aarwitz/tapp 0.18.3 → 0.18.4
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/.claude-plugin/plugin.json +2 -2
- package/browser/app.css +5 -3
- package/browser/app.js +18 -6
- package/browser/view-model.js +4 -2
- package/mcp-server/src/browser-product.js +14 -1
- package/package.json +1 -1
|
@@ -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.18.
|
|
4
|
+
"version": "0.18.4",
|
|
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.18.
|
|
27
|
+
"@aarwitz/tapp@0.18.4",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/browser/app.css
CHANGED
|
@@ -485,15 +485,17 @@ dialog::backdrop { background:rgba(0,0,0,.6); }
|
|
|
485
485
|
.command-actions { display:flex; align-items:center; gap:10px; }
|
|
486
486
|
.idle-badges { display:flex; gap:6px; } .idle-badges span { padding:4px 9px; border-radius:999px; border:1px solid var(--tapp-border); color:var(--tapp-text-soft); font-size:11.5px; white-space:nowrap; } .idle-badges span b { color:var(--tapp-text); font-weight:600; }
|
|
487
487
|
.stage { position:relative; height:calc(100vh - 150px); min-height:460px; display:grid; place-items:center; margin:0 0 18px; border-radius:var(--tapp-radius-xl); background:radial-gradient(ellipse at 50% 40%, rgba(31,121,255,.08), transparent 60%), var(--tapp-bg-deep, var(--tapp-bg)); border:1px solid var(--tapp-border); overflow:hidden; }
|
|
488
|
-
.device-stage { height:100%; width:100%; display:grid; grid-template-rows:1fr auto; place-items:center; padding:18px 18px 10px; box-sizing:border-box; }
|
|
488
|
+
.device-stage { height:100%; width:100%; display:grid; grid-template-rows:minmax(0,1fr) auto; place-items:center; padding:18px 18px 10px; box-sizing:border-box; }
|
|
489
|
+
.device-stage > .device-frame { min-height:0; }
|
|
489
490
|
.device-frame { position:relative; max-height:100%; max-width:100%; height:100%; aspect-ratio:9/19.3; border-radius:40px; background:#0b1118; border:1px solid var(--tapp-border-strong); box-shadow:var(--tapp-shadow); padding:12px; box-sizing:border-box; }
|
|
490
|
-
.device-frame .notch {
|
|
491
|
+
.device-frame .notch { display:none; }
|
|
491
492
|
.device-frame .device-screen { position:relative; width:100%; height:100%; border-radius:28px; overflow:hidden; background:#000; }
|
|
492
493
|
.device-frame.android { aspect-ratio:9/19; border-radius:30px; } .device-frame.android .device-screen { border-radius:20px; } .device-frame.android .notch { width:12px; height:12px; border-radius:50%; top:14px; }
|
|
493
494
|
.device-frame.web { aspect-ratio:16/11; height:100%; width:auto; max-width:100%; border-radius:14px; padding:26px 6px 6px; } .device-frame.web .device-screen { border-radius:8px; background:#f4f7f9; }
|
|
494
495
|
.device-frame.web .notch { width:auto; height:auto; left:12px; top:8px; transform:none; background:none; } .device-frame.web .notch::before { content:""; display:block; width:38px; height:10px; border-radius:5px; background:repeating-linear-gradient(90deg, #ff5f57 0 10px, transparent 10px 14px, #febc2e 14px 24px, transparent 24px 28px, #28c840 28px 38px); }
|
|
495
496
|
.stage.web .device-stage { align-content:center; }
|
|
496
|
-
|
|
497
|
+
/* Absolute, so the frame's size comes from the stage height and the aspect ratio, never from the image's pixels. */
|
|
498
|
+
.device-screen img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain; object-position:top center; background:#000; }
|
|
497
499
|
.device-screen #live-frame-loading, .device-placeholder { position:absolute; inset:0; display:grid; place-items:center; padding:24px; text-align:center; color:var(--tapp-text-soft); font-size:12.5px; background:var(--tapp-panel-2); }
|
|
498
500
|
.device-placeholder strong { display:block; margin-bottom:4px; color:var(--tapp-text); font-size:13px; }
|
|
499
501
|
.device-meta { display:flex; gap:14px; color:var(--tapp-text-faint); font-size:11.5px; padding-top:8px; } .device-meta span:first-child { color:var(--tapp-text-soft); font-weight:600; }
|
package/browser/app.js
CHANGED
|
@@ -59,7 +59,8 @@ function reportLink(report, label) { return evidenceLink(captureId(report), labe
|
|
|
59
59
|
|
|
60
60
|
function currentTarget() { return (state.project?.targets || []).find((target) => target.id === state.selectedTargetId) || null; }
|
|
61
61
|
function targetStorageKey() { return `tapp:selected-target:${state.project?.repository?.id || "none"}`; }
|
|
62
|
-
|
|
62
|
+
// A run started from the prompt is on its own platform, whatever repository happens to be open.
|
|
63
|
+
function currentPlatform() { return state.live?.active ? state.live.platform : (state.promptRun && state.promptPlatform) || currentTarget()?.platform || state.promptPlatform || ""; }
|
|
63
64
|
|
|
64
65
|
function chooseDefaultTarget() {
|
|
65
66
|
const targets = state.project?.targets || [];
|
|
@@ -159,7 +160,7 @@ function renderDeviceChrome() {
|
|
|
159
160
|
$("#device-frame").className = `device-frame ${platform || "ios"}`;
|
|
160
161
|
$("#stage").className = `stage ${platform || "ios"}`;
|
|
161
162
|
$("#device-feed-label").textContent = platform === "android" ? "Android" : platform === "web" ? "Chromium" : "iPhone";
|
|
162
|
-
$("#device-meta-device").textContent = platform === "ios" ? (target?.runtime?.surface || "iOS Simulator")
|
|
163
|
+
$("#device-meta-device").textContent = platform === "ios" ? ((!state.promptRun && target?.runtime?.surface) || "iOS Simulator")
|
|
163
164
|
: platform === "android" ? (target?.runtime?.serial || "Android emulator / device")
|
|
164
165
|
: platform === "web" ? "Local Chromium" : "—";
|
|
165
166
|
}
|
|
@@ -369,7 +370,8 @@ function syncTranscriptFromJob(name, job) {
|
|
|
369
370
|
}
|
|
370
371
|
|
|
371
372
|
function startLine(name, job) {
|
|
372
|
-
const
|
|
373
|
+
const raw = job.input || "";
|
|
374
|
+
const input = /\.(app|apk)$/i.test(raw) ? raw.split("/").filter(Boolean).at(-1) : raw;
|
|
373
375
|
return { initialize: "Starting a release check — build, launch and explore the real app", gate: "Running the release gate", audit: `Opening ${input} read-only — nothing will be clicked`, "explore-build": `Exploring ${input} on the booted device`, open: `Opening ${input}`, "session-start": "Opening a live session", "session-act": "Acting in the live session", "session-save-flow": "Saving the journey as a Flow", "session-end": "Ending the live session" }[name] || `${pretty(name)} started`;
|
|
374
376
|
}
|
|
375
377
|
|
|
@@ -384,7 +386,17 @@ async function finishTranscript(name, job) {
|
|
|
384
386
|
if (id) {
|
|
385
387
|
try {
|
|
386
388
|
const files = await api(`/api/captures/${encodeURIComponent(id)}/files`);
|
|
387
|
-
if (files.shots?.length)
|
|
389
|
+
if (files.shots?.length) {
|
|
390
|
+
pushLine({ kind: "shots", shots: files.shots.slice(0, 3).map((shot) => ({ src: captureUrl(id, shot.src), href: captureUrl(id, shot.src), caption: shot.caption })) });
|
|
391
|
+
// The stage keeps the run's final screen until something newer replaces it.
|
|
392
|
+
if (!state.live?.active) {
|
|
393
|
+
const last = files.shots.at(-1);
|
|
394
|
+
const image = $("#live-frame-image");
|
|
395
|
+
image.onload = () => { $("#live-frame-loading").classList.add("hidden"); $("#device-placeholder").classList.add("hidden"); };
|
|
396
|
+
image.src = captureUrl(id, last.src);
|
|
397
|
+
$("#live-screen-title").textContent = last.caption || "";
|
|
398
|
+
}
|
|
399
|
+
}
|
|
388
400
|
const items = [];
|
|
389
401
|
if (files.recording) items.push({ icon: "🎬", label: files.recording, href: captureUrl(id, files.recording) });
|
|
390
402
|
if (files.report) items.push({ icon: "📄", label: "report.html", href: captureUrl(id, files.report) });
|
|
@@ -587,14 +599,14 @@ document.addEventListener("submit", (event) => {
|
|
|
587
599
|
});
|
|
588
600
|
|
|
589
601
|
$$("[data-brand-home]").forEach((button) => button.addEventListener("click", () => state.project?.connected ? (showProduct(), activateView("overview")) : showPrompt()));
|
|
590
|
-
$("#command-run").addEventListener("click", () => runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)));
|
|
602
|
+
$("#command-run").addEventListener("click", () => { state.promptRun = false; runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)); });
|
|
591
603
|
$("#refresh-project").addEventListener("click", () => refresh().catch((error) => toast(error.message, true)));
|
|
592
604
|
$("#change-source").addEventListener("click", showPrompt);
|
|
593
605
|
$("#chat-toggle").addEventListener("click", () => setChatCollapsed(!state.chatCollapsed));
|
|
594
606
|
$("#repository-switcher").addEventListener("change", async (event) => {
|
|
595
607
|
try { await api("/api/repositories/select", { method:"POST", body:JSON.stringify({ id:event.target.value }) }); state.selectedTargetId = ""; await refreshSession(); await refresh(); } catch (error) { toast(error.message, true); }
|
|
596
608
|
});
|
|
597
|
-
$("#explore").addEventListener("click", () => runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)));
|
|
609
|
+
$("#explore").addEventListener("click", () => { state.promptRun = false; runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)); });
|
|
598
610
|
$("#start-session").addEventListener("click", () => runOperation("session-start", operationPayload()).catch((error) => toast(error.message, true)));
|
|
599
611
|
$("#refresh-live-session").addEventListener("click", () => runOperation("session-act", { action:"tree" }).catch((error) => toast(error.message, true)));
|
|
600
612
|
$("#end-session").addEventListener("click", () => runOperation("session-end").catch((error) => toast(error.message, true)));
|
package/browser/view-model.js
CHANGED
|
@@ -41,8 +41,10 @@ const RULES = [
|
|
|
41
41
|
[/^(?:Reached|Navigated to|Now on) /i, "🧭"],
|
|
42
42
|
[/^(?:Tapped|Tap(?:ping)?|Clicked|Pressed) /i, "👆"],
|
|
43
43
|
[/^(?:Typed|Filled|Entered|Type) /i, "⌨️"],
|
|
44
|
-
[/^(?:Swiped|Scrolled)/i, "↕️"],
|
|
45
|
-
[/^(?:Went back|Back)/i, "◀️"],
|
|
44
|
+
[/^(?:Swiped|Swiping|Edge-swiping|Scrolled|Scrolling)/i, "↕️"],
|
|
45
|
+
[/^(?:Went back|Back|Finished with .* going back|Going back)/i, "◀️"],
|
|
46
|
+
[/^(?:Probing|Looking for|Checking)/i, "🔎"],
|
|
47
|
+
[/^(?:Switching to|Switched to)/i, "🗂️"],
|
|
46
48
|
[/sign(?:ed|ing)? in|login|logged in|credentials/i, "🔐"],
|
|
47
49
|
[/screenshot|captured frame|snapshot/i, "📸"],
|
|
48
50
|
[/^(?:Building|Compiling|Build )/i, "🔨"],
|
|
@@ -170,7 +170,7 @@ function openBrowser(url) {
|
|
|
170
170
|
function publicJob(job, { hosted = false } = {}) {
|
|
171
171
|
return {
|
|
172
172
|
id: job.id, operation: job.operation, status: job.status, repositoryId: job.repositoryId || null,
|
|
173
|
-
createdAt: job.createdAt, completedAt: job.completedAt || null, progress: job.progress.slice(-80), frame: !!job.latestFrame,
|
|
173
|
+
createdAt: job.createdAt, completedAt: job.completedAt || null, progress: job.progress.slice(-80), frame: !!job.latestFrame || !!job.liveSimulator, platform: job.platform || null,
|
|
174
174
|
result: hosted ? hostedPayload(job.result) : job.result || null,
|
|
175
175
|
error: job.error || null,
|
|
176
176
|
};
|
|
@@ -489,6 +489,17 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
489
489
|
const jobFrameMatch = url.pathname.match(/^\/api\/jobs\/([a-f0-9]{20})\/frame$/);
|
|
490
490
|
if (request.method === "GET" && jobFrameMatch) {
|
|
491
491
|
const job = jobs.get(jobFrameMatch[1]);
|
|
492
|
+
if (job && !job.latestFrame && job.liveSimulator && job.status === "running") {
|
|
493
|
+
// An iOS exploration drives the booted simulator; photograph it (throttled) the way a
|
|
494
|
+
// live session does, so the stage shows the device while the run happens.
|
|
495
|
+
const engine = await import("./index.js");
|
|
496
|
+
const frame = await engine.captureScreenshotImage(1000);
|
|
497
|
+
if (frame?.error) { json(response, 404, { error: frame.error }); return; }
|
|
498
|
+
const data = Buffer.from(frame.data, "base64");
|
|
499
|
+
response.writeHead(200, { "content-type": frame.mimeType || "image/jpeg", "content-length": data.length, "cache-control": "no-store", "x-content-type-options": "nosniff" });
|
|
500
|
+
response.end(data);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
492
503
|
if (!job?.latestFrame || !fs.existsSync(job.latestFrame)) { json(response, 404, { error: "No exploration frame yet" }); return; }
|
|
493
504
|
const data = fs.readFileSync(job.latestFrame);
|
|
494
505
|
response.writeHead(200, { "content-type": job.latestFrame.endsWith(".jpg") || job.latestFrame.endsWith(".jpeg") ? "image/jpeg" : "image/png", "content-length": data.length, "cache-control": "no-store", "x-content-type-options": "nosniff" });
|
|
@@ -549,6 +560,8 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
549
560
|
if (!["bundle", "app", "apk"].includes(prompt.kind)) throw Object.assign(new Error("Give a bundle id (com.company.app), a simulator .app, or an .apk"), { statusCode: 400 });
|
|
550
561
|
const job = startJob(operation, async (progress) => {
|
|
551
562
|
const engine = await import("./index.js");
|
|
563
|
+
job.platform = prompt.kind === "apk" ? "android" : "ios";
|
|
564
|
+
job.liveSimulator = job.platform === "ios";
|
|
552
565
|
const forward = (entry) => progress({ phase: "explore", text: entry.narrative || `${entry.action || 0}/${entry.max || 0} actions · ${entry.states || 0} states`, ...(entry.action ? { current: entry.action, total: entry.max } : {}), ...(entry.screen ? { screen: entry.screen } : {}), ...(entry.screenshot ? { screenshot: entry.screenshot } : {}) });
|
|
553
566
|
let result;
|
|
554
567
|
if (prompt.kind === "apk") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
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",
|