@aarwitz/tapp 0.18.4 → 0.19.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.18.4",
4
+ "version": "0.19.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.18.4",
27
+ "@aarwitz/tapp@0.19.1",
28
28
  "mcp"
29
29
  ],
30
30
  "cwd": "${CLAUDE_PROJECT_DIR}"
package/AGENTS.md CHANGED
@@ -17,6 +17,9 @@ npx -y @aarwitz/tapp@latest explore --goal "SCREEN OR CONTROL" [target] # source
17
17
  npx -y @aarwitz/tapp@latest explore https://your-app.example --watch # web: visibly follow the same exploration
18
18
  npx -y @aarwitz/tapp@latest explore --read-only https://example.com --pages 5 # never clicks: production or a site you do not own
19
19
  npx -y @aarwitz/tapp@latest look [target] # launch + screen summary + screenshot saved to a file (≈ tapp_look)
20
+ npx -y @aarwitz/tapp@latest look latest # a finished run: its screens, each with its moment in the recording
21
+ npx -y @aarwitz/tapp@latest look latest --at 6 # one screen's frame, seeked (not scanned) out of the video
22
+ npx -y @aarwitz/tapp@latest look latest --frames # contact sheets — many frames per image, to scan a run cheaply
20
23
  npx -y @aarwitz/tapp@latest look [target] --tree # + the accessibility tree, --json for every element
21
24
  npx -y @aarwitz/tapp@latest look # no target on iOS: the booted sim as it is → file path
22
25
  npx -y @aarwitz/tapp@latest explore app.apk --platform android --app-id com.acme.app
@@ -70,6 +73,8 @@ installs, returns the bundle id) → `tapp_explore {appBundleId}`.
70
73
  | "Is this live site / production / a prospect's site broken?" | `tapp_explore {readOnly:true}` (CLI `tapp explore --read-only <url> --pages N`) — read-only: dead controls, broken images/links/assets, failed requests, JS errors, mixed content, overflow; writes a capture with evidence | `tapp_explore` (it clicks, types and submits) |
71
74
  | "Make this flow a repeatable test" | drive it in a session, then `tapp_session {action:"save_flow"}`; replay with `tapp_run` | re-driving it by hand every time |
72
75
  | "What's on screen right now?" | `tapp_look` | relaunching the app |
76
+ | "What happened during that run?" / "show me the frame where X" | `tapp_look {capture:"latest", at:"<n\|screen>"}` | re-running the app to reproduce something already recorded |
77
+ | "Scan a recording for something odd" | `tapp_look {capture:"latest", frames:true}` (contact sheets) | pulling frames one at a time, or sampling a handful and calling it a look |
73
78
 
74
79
  ## Session driving (the Playwright loop)
75
80
 
package/bin/tapp.js CHANGED
@@ -131,6 +131,17 @@ function parseVerbArgs(argv) {
131
131
  // ADR-0007: twelve public verbs, one engine. The resolver maps the public surface onto the
132
132
  // internal case labels below (which keep their original argument shapes), and keeps every older
133
133
  // verb working as a hidden alias that names its new form once on stderr.
134
+ // Is this target a finished run rather than something to launch? A capture is a directory with
135
+ // the markers a run writes, addressed by id, by path, or as "latest". Deliberately narrow: a
136
+ // bundle id, a URL, a repo dir and an .apk must all still mean what they meant before.
137
+ function looksLikeCapture(value) {
138
+ const raw = String(value || "").trim();
139
+ if (!raw || raw.startsWith("-") || /^https?:\/\//i.test(raw)) return false;
140
+ if (raw === "latest") return true;
141
+ const marked = (dir) => { try { return fs.existsSync(path.join(dir, "ocqa-markers.txt")); } catch { return false; } };
142
+ return marked(path.resolve(raw)) || marked(path.join(tappHome, "captures", raw));
143
+ }
144
+
134
145
  function artifactKind(file) {
135
146
  if (!file) return "flow";
136
147
  if (/\.ts$/.test(file)) return "contract";
@@ -156,10 +167,16 @@ function resolveCommand(command, rest) {
156
167
  if (goal >= 0 && rest[goal + 1] !== undefined) return { command: "focus", rest: [rest[goal + 1], ...rest.slice(0, goal), ...rest.slice(goal + 2)] };
157
168
  return { command, rest };
158
169
  }
159
- case "look":
170
+ case "look": {
171
+ // A capture is a target like any other (`report [capture]` already takes one), so looking
172
+ // at a finished run is the same verb as looking at a running app — only the screen is
173
+ // recorded rather than live. See the 2026-10-21 amendment to ADR-0007.
174
+ const subject = rest.find((a) => !a.startsWith("--"));
175
+ if (looksLikeCapture(subject) || has("--frames") || has("--at")) return { command: "frames", rest };
160
176
  if (has("--sim")) return { command: "shot", rest: without("--sim") };
161
177
  if (has("--tree")) return { command: "tree", rest: without("--tree") };
162
178
  return { command: "open", rest };
179
+ }
163
180
  case "run":
164
181
  return { command: artifactKind(rest.find((a) => !a.startsWith("--"))), rest: ["run", ...rest] };
165
182
  case "validate": {
@@ -343,7 +360,7 @@ function safeCommandUsage(verb) {
343
360
  explore: "tapp explore [target] [--platform ios|android|web] [--actions N] [--timeout SEC] [--email VALUE] [--password VALUE] [--baseline FILE] [--json FILE]\n --read-only <url>...: never clicks (dead controls, broken links/assets, failed requests, JS exceptions, mixed content, overflow) [--pages N] [--urls FILE] [--json [FILE]]\n --goal \"SCREEN OR CONTROL\": source-locate a screen/control and take the shortest observed route [--project-dir REPO] [--target NAME|PATH] [--map FILE] [--out FILE]\n Web: [--watch] opens Tapp's controlled browser and shows its actions; [--device \"iPhone 13\"] [--viewport 390x844] render at a device profile or explicit size\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted; TAPP_UDID is the default)\n iOS launch configuration: [--launch-arg VALUE ...] [--launch-env '{\"KEY\":\"VALUE\"}']\n Android: [--app-id ID] [--apk FILE] [--serial ID] [--keep-data]",
344
361
  focus: "tapp explore --goal \"SCREEN OR CONTROL\" [target] [--platform ios|android|web] [--project-dir REPO] [--target NAME|PATH] [--map FILE] [--out FILE]",
345
362
  init: "tapp init [repo] [--explore] [--refresh] [--platform PLATFORM] [--target NAME] [--url URL] [--watch] [--dry-run]",
346
- open: "tapp look [target] [--platform ios|android|web] [--out FILE] [--tap TEXT] [--wait-for TEXT]\n --tree: accessibility tree of the current screen (--json for every element)\n --sim: screenshot the booted simulator only (never builds or installs)\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted)\n Web: [--device \"iPhone 13\"] [--viewport 390x844] [--full-page]",
363
+ open: "tapp look [target] [--platform ios|android|web] [--out FILE] [--tap TEXT] [--wait-for TEXT]\n --tree: accessibility tree of the current screen (--json for every element)\n <capture>|latest: the screens of a finished run — [--at N|\"screen\"] one frame, [--frames] contact sheets for scanning, [--json] the index\n --sim: screenshot the booted simulator only (never builds or installs)\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted)\n Web: [--device \"iPhone 13\"] [--viewport 390x844] [--full-page]",
347
364
  tree: "tapp look --tree [target] [--platform ios|android|web] [--json] [--tap TEXT] [--wait-for TEXT]\n iOS: inspects an installed app; never builds or installs.\n Web: [--device \"iPhone 13\"] [--viewport 390x844]",
348
365
  shot: "tapp look --sim [--out FILE]",
349
366
  apps: "tapp apps",
@@ -2082,11 +2099,37 @@ switch (command) {
2082
2099
  }
2083
2100
  const port = flags.port === undefined ? 0 : Number(flags.port);
2084
2101
  if (!Number.isInteger(port) || port < 0 || port > 65535) { console.error("❌ --port must be 0..65535"); process.exit(2); }
2102
+ // --public serves the Studio to anyone who can reach it: no account, a read-only website
2103
+ // audit each, evidence scoped per visitor, and every browser connection forced through the
2104
+ // public-egress proxy. Repositories, live sessions and the gate stay unavailable, because
2105
+ // there is no way to offer them safely to an anonymous visitor on a shared machine.
2106
+ const publicAccess = flags.public === true;
2107
+ const publicOrigin = typeof flags.origin === "string" ? flags.origin : "";
2108
+ // https for anything real; plain http on loopback so the public mode can be dry-run locally
2109
+ // before a tunnel or TLS terminator is in front of it.
2110
+ const localOrigin = /^http:\/\/(?:127\.0\.0\.1|localhost|\[::1\])(?::\d{1,5})?$/.test(publicOrigin);
2111
+ if (publicAccess && !localOrigin && !/^https:\/\/[^\s/]+$/.test(publicOrigin)) {
2112
+ console.error("❌ --public needs --origin https://your.domain (or an http://127.0.0.1:PORT origin to try it locally)");
2113
+ process.exit(2);
2114
+ }
2115
+ if (publicAccess && flags.port === undefined) { console.error("❌ --public needs an explicit --port"); process.exit(2); }
2085
2116
  const { startBrowserProduct } = await import(path.join(packageRoot, "mcp-server", "src", "browser-product.js"));
2086
- const product = await startBrowserProduct({ projectDir, port, launch: flags.open !== false && flags["no-open"] !== true });
2087
- console.log(`Tapp · ${product.root || "choose a local folder or GitHub repository in the browser"}`);
2088
- console.log(`Open: ${product.launchUrl}`);
2089
- console.log("Local-only session; press Ctrl-C to stop.");
2117
+ const product = await startBrowserProduct({
2118
+ projectDir, port,
2119
+ launch: !publicAccess && flags.open !== false && flags["no-open"] !== true,
2120
+ ...(publicAccess ? { publicAccess: true, publicOrigin } : {}),
2121
+ });
2122
+ if (publicAccess) {
2123
+ console.log(`Tapp · public Studio for ${publicOrigin}`);
2124
+ console.log(`Listening on ${product.origin} — put a TLS terminator or tunnel in front of it.`);
2125
+ console.log("Anonymous visitors may audit a public website read-only. Repositories, live");
2126
+ console.log("sessions and the release gate require an authenticated local session.");
2127
+ console.log("Browser egress is pinned to public addresses; private ranges are refused.");
2128
+ } else {
2129
+ console.log(`Tapp · ${product.root || "choose a local folder or GitHub repository in the browser"}`);
2130
+ console.log(`Open: ${product.launchUrl}`);
2131
+ console.log("Local-only session; press Ctrl-C to stop.");
2132
+ }
2090
2133
  const shutdown = async () => { try { await product.close(); } finally { process.exit(0); } };
2091
2134
  process.once("SIGINT", shutdown);
2092
2135
  process.once("SIGTERM", shutdown);
@@ -2094,6 +2137,67 @@ switch (command) {
2094
2137
  break;
2095
2138
  }
2096
2139
 
2140
+ // `tapp look <capture>` — the screens of a finished run. Same verb as looking at a live app;
2141
+ // the screen is recorded rather than in front of us (ADR-0007, amended 2026-10-21).
2142
+ case "frames": {
2143
+ const { flags, positionals } = parseVerbArgs(rest);
2144
+ const { resolveCapture, captureIndex, selectState, extractFrame, contactSheets, writePlayableCopy } =
2145
+ await import(path.join(packageRoot, "mcp-server", "src", "capture-frames.js"));
2146
+
2147
+ const dir = resolveCapture(positionals[0] || "latest");
2148
+ if (!dir) { console.error(`❌ No capture found for ${positionals[0] || "latest"}`); process.exit(2); }
2149
+ const index = captureIndex(dir);
2150
+
2151
+ if (flags.json !== undefined) {
2152
+ const out = typeof flags.json === "string" ? flags.json : "";
2153
+ const payload = JSON.stringify(index, null, 2);
2154
+ if (out) { fs.writeFileSync(out, payload); console.log(`Wrote ${out}`); } else console.log(payload);
2155
+ break;
2156
+ }
2157
+
2158
+ console.log(`📼 ${index.capture} — ${index.states.length} screen(s), ${index.actions} action(s), ${index.findings} finding(s)`);
2159
+ if (index.recording) {
2160
+ console.log(` recording: ${index.recording.file}${index.recording.indexed ? "" : " (no frame index — re-run to seek by screen)"}`);
2161
+ const playable = await writePlayableCopy(index.recording.path).catch(() => null);
2162
+ if (playable) console.log(` playable: ${path.basename(playable)}`);
2163
+ } else {
2164
+ console.log(" recording: none — screenshots only");
2165
+ }
2166
+
2167
+ if (flags.at !== undefined) {
2168
+ const state = selectState(index, flags.at);
2169
+ if (!state) { console.error(`❌ No screen matching '${flags.at}'. Screens: ${index.states.map((x) => `${x.index}:${x.screen}`).join(", ")}`); process.exit(2); }
2170
+ const out = typeof flags.out === "string" ? flags.out : path.join(dir, `frame_${state.index}.png`);
2171
+ const got = await extractFrame(index, state, out);
2172
+ if (!got) { console.error("❌ No frame or screenshot exists for that screen"); process.exit(1); }
2173
+ console.log(`\n${state.index}. ${state.screen}${state.url ? ` ${state.url}` : ""}`);
2174
+ console.log(` ${got.from === "recording" ? `frame at ${(got.atMs / 1000).toFixed(1)}s` : "screenshot"} → ${got.file}`);
2175
+ if (state.findings.length) for (const f of state.findings) console.log(` • ${f.severity} ${f.title}`);
2176
+ break;
2177
+ }
2178
+
2179
+ if (flags.frames) {
2180
+ const out = typeof flags.frames === "string" ? flags.frames : path.join(dir, "frames");
2181
+ const sheets = await contactSheets(index, out);
2182
+ if (!sheets.length) { console.error("❌ Nothing to tile — the run recorded no video and no screenshots"); process.exit(1); }
2183
+ console.log(`\n${sheets.length} contact sheet(s) — many frames per image, for scanning:`);
2184
+ for (const sheet of sheets) console.log(` ${sheet}`);
2185
+ break;
2186
+ }
2187
+
2188
+ // Default: the screens, with where each one is in the recording.
2189
+ console.log("");
2190
+ for (const state of index.states) {
2191
+ const when = state.videoAtMs != null ? `${(state.videoAtMs / 1000).toFixed(1)}s` : state.t != null ? `${(state.t / 1000).toFixed(1)}s` : "—";
2192
+ console.log(`${String(state.index).padStart(2)}. ${when.padStart(7)} ${state.screen}${state.url ? ` ${state.url}` : ""}`);
2193
+ if (state.screenshot) console.log(` ${state.screenshot}`);
2194
+ for (const f of state.findings) console.log(` • ${f.severity} ${f.title}`);
2195
+ }
2196
+ console.log(`\nOne screen: tapp look ${index.capture} --at <n|"screen">`);
2197
+ console.log(`Scan them: tapp look ${index.capture} --frames`);
2198
+ break;
2199
+ }
2200
+
2097
2201
  case "report": {
2098
2202
  // Regenerate + open the HTML evidence page for a capture (default: the latest).
2099
2203
  const capturesDir = path.join(tappHome, "captures");
@@ -2201,6 +2305,9 @@ Observe — look at the real app (no Tapp account or server required):
2201
2305
  straight to a named screen · web: --watch · --platform ios|android|web · --actions N)
2202
2306
  tapp look [target] One screen: summary + screenshot (--tree adds the accessibility tree,
2203
2307
  --sim screenshots the booted simulator · web: --tap TEXT · --wait-for TEXT)
2308
+ A capture id, a capture path, or 'latest' reads a finished run instead:
2309
+ its screens with the moment each was reached (--at N|"screen" pulls one
2310
+ frame · --frames tiles many frames per image for scanning · --json)
2204
2311
 
2205
2312
  Replay — deterministic, keyless:
2206
2313
  tapp run FILE Replay a committed Flow, Task, release contract, or Scenario
package/browser/app.js CHANGED
@@ -88,6 +88,34 @@ function activateView(view) {
88
88
  window.scrollTo({ top:0, behavior:"instant" });
89
89
  }
90
90
 
91
+ // A hosted Studio has no Mac, no simulator and no access to the visitor's disk, so folders,
92
+ // bundle ids and builds cannot work there however the prompt is worded. Offer only what this
93
+ // deployment can actually do, and say where the rest runs, rather than failing after the ask.
94
+ function applyAccessMode() {
95
+ const session = state.session || {};
96
+ if (session.access !== "anonymous") return;
97
+ const accepts = new Set(session.accepts || ["url"]);
98
+ for (const button of document.querySelectorAll("[data-kind]")) {
99
+ const kind = button.dataset.kind;
100
+ const usable = kind === "url" ? accepts.has("url") : accepts.has(kind);
101
+ button.closest("li")?.classList.toggle("hidden", !usable);
102
+ }
103
+ const input = $("#prompt-input");
104
+ if (input) input.placeholder = "A website URL…";
105
+ // Everything that only means something against a source repository: a target to build, a
106
+ // runner, a release gate, a decision. A hosted visitor auditing a URL has none of them, and
107
+ // showing the empty frames makes a working run look like a broken one.
108
+ for (const node of document.querySelectorAll("[data-repo-only]")) node.classList.add("hidden");
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.");
115
+ const note = $("#privacy-note-detail");
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";
117
+ }
118
+
91
119
  function showPrompt() {
92
120
  $("#source-onboarding").classList.remove("hidden");
93
121
  $("#product-shell").classList.add("hidden");
@@ -472,9 +500,21 @@ async function refreshSession() {
472
500
  $("#mode-pill").textContent = local ? "Self-host · this machine" : "Cloud · outbound runner";
473
501
  $("#onboarding-mode-pill").textContent = local ? "Self-host · this machine" : "Cloud";
474
502
  $("#privacy-note-detail").textContent = local ? "Everything runs on this machine. Exploration, replay and merge decisions are deterministic and need no API key." : "Your repository stays in your private Tapp workspace.";
503
+ applyAccessMode();
475
504
  }
476
505
 
477
506
  async function refresh() {
507
+ // A public visitor has no project and no live session, and asking for them would only earn a
508
+ // 401 on every poll.
509
+ if (state.session?.access === "anonymous") {
510
+ const runs = await api("/api/audits").catch(() => ({ audits: [], explores: [] }));
511
+ state.project = { connected:false };
512
+ state.live = { active:false };
513
+ state.audits = runs.audits || [];
514
+ state.explores = runs.explores || [];
515
+ renderProject();
516
+ return;
517
+ }
478
518
  const [project, live, runs] = await Promise.all([api("/api/project"), api("/api/live-session"), api("/api/audits").catch(() => ({ audits: [], explores: [] }))]);
479
519
  state.project = project;
480
520
  state.live = live;
@@ -534,12 +574,40 @@ async function runOperation(name, body = {}, { input = "" } = {}) {
534
574
 
535
575
  // "What should tapp test?" — route by what was typed. The server classifies again and refuses
536
576
  // what the mode cannot do (a hosted Studio cannot open a path on your machine).
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;
581
+ const heading = $("#app-name");
582
+ if (heading) heading.textContent = title;
583
+ const note = $("#app-summary");
584
+ if (note) note.textContent = summary;
585
+ }
586
+
587
+ // Some targets simply cannot run where this Studio is running — a folder on someone's disk, a
588
+ // simulator build, a repository that needs a toolchain. The engine answers with where they do
589
+ // run; show that answer where it stays put, not in a toast that disappears in six seconds.
590
+ function answerSelfHost(answer) {
591
+ setHeading("Run this on your machine", "The cloud Studio audits websites; this target needs your toolchain.", { owned: true });
592
+ document.querySelector(".summary-panel")?.classList.add("hidden");
593
+ document.querySelector(".device-stage")?.classList.add("hidden");
594
+ state.transcript = [];
595
+ pushLine({ kind: "step", icon: "🖥️", text: answer.message });
596
+ if (answer.command) pushLine({ kind: "step", icon: "⌨️", text: answer.command });
597
+ renderChat();
598
+ setChatCollapsed(false);
599
+ toast(answer.message, true);
600
+ }
601
+
537
602
  async function startFromPrompt(raw) {
538
603
  const prompt = classifyPrompt(raw);
539
604
  if (prompt.kind === "empty") return;
540
605
  if (prompt.kind === "url") {
541
606
  state.promptRun = true; state.promptPlatform = "web";
542
607
  showProduct(); activateView("overview"); renderDeviceChrome(); renderChat();
608
+ document.querySelector(".device-stage")?.classList.remove("hidden");
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 });
543
611
  const result = await runOperation("audit", { url: prompt.value }, { input: prompt.value });
544
612
  state.selectedRunId = result?.capture?.id || state.selectedRunId;
545
613
  return;
@@ -548,11 +616,14 @@ async function startFromPrompt(raw) {
548
616
  state.promptRun = true; state.promptPlatform = prompt.kind === "apk" ? "android" : "ios";
549
617
  showProduct(); activateView("overview"); renderDeviceChrome(); renderChat();
550
618
  const result = await runOperation("explore-build", { input: prompt.value }, { input: prompt.value });
619
+ if (result?.kind === "self-host") { answerSelfHost(result); return; }
551
620
  state.selectedRunId = result?.capture?.id || state.selectedRunId;
552
621
  return;
553
622
  }
623
+ showProduct(); activateView("overview"); renderChat();
554
624
  const answer = await runOperation("open", { input: prompt.value }, { input: prompt.value });
555
- if (answer?.kind === "business") { toast(answer.message, true); return; }
625
+ if (answer?.kind === "self-host") { answerSelfHost(answer); return; }
626
+ if (answer?.kind === "business") { answerSelfHost({ message: answer.message }); return; }
556
627
  await refreshSession();
557
628
  await refresh();
558
629
  state.selectedTargetId = "";
@@ -617,9 +688,29 @@ $("#live-back").addEventListener("click", () => runOperation("session-act", { ac
617
688
  $("#live-swipe").addEventListener("click", () => runOperation("session-act", { action:"swipe", direction:"up" }).catch((error) => toast(error.message, true)));
618
689
  $("#run-gate").addEventListener("click", () => runOperation("gate", operationPayload()).catch((error) => toast(error.message, true)));
619
690
 
691
+ // runtapp.com's hero is the same prompt as this screen, so it hands the target over as
692
+ // ?target=... Prefill it and start the run, so arriving here does not mean retyping what was
693
+ // already typed on the landing page. The URL is cleaned up either way so a refresh does not
694
+ // silently re-run it.
695
+ function handoffTarget() {
696
+ let target = "";
697
+ try { target = new URLSearchParams(window.location.search).get("target") || ""; } catch { return ""; }
698
+ target = target.trim().slice(0, 512);
699
+ if (!target) return "";
700
+ try { window.history.replaceState({}, "", window.location.pathname); } catch { /* history may be unavailable */ }
701
+ return target;
702
+ }
703
+
620
704
  try {
621
705
  try { setChatCollapsed(localStorage.getItem("tapp:chat-collapsed") === "1"); } catch { /* storage may be unavailable */ }
622
706
  await refreshSession();
623
707
  await refresh();
624
708
  if (state.project?.connected && !state.project?.state?.inspected) await runOperation("initialize", { write:true });
709
+
710
+ const handoff = handoffTarget();
711
+ if (handoff) {
712
+ const input = $("#prompt-input");
713
+ if (input) input.value = handoff;
714
+ await startFromPrompt(handoff);
715
+ }
625
716
  } catch (error) { toast(error.message, true); }
@@ -56,10 +56,10 @@
56
56
  <button class="primary prompt-go" type="submit" id="prompt-start" aria-label="Start">→</button>
57
57
  </form>
58
58
  <ul class="prompt-suggestions" aria-label="Examples">
59
- <li><button type="button" data-prompt="https://example.com"><span>⌁</span><b>https://example.com</b><small>audit a website read-only — safe on production, nothing is clicked</small></button></li>
60
- <li><button type="button" data-prompt="~/code/my-app"><span>⌘</span><b>~/code/my-app</b><small>open a repo folder on this Mac — detects iOS, Android and web targets, builds locally</small></button></li>
61
- <li><button type="button" data-prompt="owner/repo"><span>🐙</span><b>owner/repo</b><small>clone from GitHub into an isolated workspace, then the same</small></button></li>
62
- <li><button type="button" data-prompt="com.company.app"><span>📱</span><b>com.company.app</b><small>explore a build already on the booted simulator (or give a .app / .apk)</small></button></li>
59
+ <li><button type="button" data-kind="url" data-prompt="https://example.com"><span>⌁</span><b>https://example.com</b><small>audit a website read-only — safe on production, nothing is clicked</small></button></li>
60
+ <li><button type="button" data-kind="path" data-prompt="~/code/my-app"><span>⌘</span><b>~/code/my-app</b><small>open a repo folder on this Mac — detects iOS, Android and web targets, builds locally</small></button></li>
61
+ <li><button type="button" data-kind="github" data-prompt="owner/repo"><span>🐙</span><b>owner/repo</b><small>clone from GitHub into an isolated workspace, then the same</small></button></li>
62
+ <li><button type="button" data-kind="build" data-prompt="com.company.app"><span>📱</span><b>com.company.app</b><small>explore a build already on the booted simulator (or give a .app / .apk)</small></button></li>
63
63
  </ul>
64
64
  <p class="prompt-note" id="privacy-note-detail">Everything runs on this machine. Exploration, replay and merge decisions are deterministic and need no API key.</p>
65
65
  <span class="sr-only" id="privacy-note-title">Your code stays on this machine.</span>
@@ -80,9 +80,9 @@
80
80
  <div class="sidebar-project">
81
81
  <p class="eyebrow">Project</p>
82
82
  <div class="row"><span><svg><use href="#i-folder"/></svg></span><span><strong id="sidebar-project-name">Product</strong></span></div>
83
- <div class="row"><span><svg><use href="#i-branch"/></svg></span><span id="sidebar-project-source">Repository</span></div>
84
- <div class="row"><span><svg><use href="#i-target"/></svg></span><span id="sidebar-target">Select a target</span></div>
85
- <div class="row"><span><svg><use href="#i-server"/></svg></span><span id="sidebar-runner">Runner not checked</span></div>
83
+ <div class="row" data-repo-only><span><svg><use href="#i-branch"/></svg></span><span id="sidebar-project-source">Repository</span></div>
84
+ <div class="row" data-repo-only><span><svg><use href="#i-target"/></svg></span><span id="sidebar-target">Select a target</span></div>
85
+ <div class="row" data-repo-only><span><svg><use href="#i-server"/></svg></span><span id="sidebar-runner">Runner not checked</span></div>
86
86
  <div class="row hidden" id="sidebar-app-row"><span><svg><use href="#i-app"/></svg></span><span><code id="sidebar-app-id"></code></span></div>
87
87
  <span class="mode-pill" id="mode-pill">Self-host · this machine</span>
88
88
  </div>
@@ -99,7 +99,7 @@
99
99
  <div class="command-actions">
100
100
  <span class="phase-pill hidden" id="phase-pill"><span class="spinner"></span><span id="phase-pill-text">Working…</span></span>
101
101
  <div class="idle-badges" id="idle-badges"></div>
102
- <button class="primary" id="command-run">Run release check</button>
102
+ <button class="primary" id="command-run" data-repo-only>Run release check</button>
103
103
  </div>
104
104
  </div>
105
105
  <div class="run-progress hidden" id="run-progress"><span class="progress-track"><span id="run-progress-bar"></span></span><span id="run-progress-text">Starting…</span></div>
@@ -127,7 +127,7 @@
127
127
  </aside>
128
128
  </section>
129
129
 
130
- <section class="panel section" id="target-stage">
130
+ <section class="panel section" id="target-stage" data-repo-only>
131
131
  <div class="section-heading"><div><p class="eyebrow">Build & run</p><h2>Choose the product target</h2><p>Tapp detected these targets from source. With more than one, you choose; nothing builds until you do.</p></div><span class="status-chip" id="target-status">No target selected</span></div>
132
132
  <div class="target-choice-callout hidden" id="target-choice-callout"><span>1</span><div><strong>Choose what Tapp should test</strong><small>Nothing will build until you select a target. Tapp never guesses when a repository contains multiple applications.</small></div></div>
133
133
  <div id="targets" class="target-grid"><div class="empty">Inspecting the repository for iOS, Android and web targets…</div></div>
@@ -147,12 +147,12 @@
147
147
  </section>
148
148
 
149
149
  <section class="overview-grid">
150
- <article class="panel summary-panel"><div class="section-heading compact"><div><p class="eyebrow">Latest evidence</p><h2>What the last run proved</h2></div><button class="quiet" data-view="runs">All runs</button></div><div class="decision-card neutral" id="decision-card"><span class="decision-label">CURRENT DECISION</span><strong id="decision-title">Not evaluated</strong><span id="decision-detail">Run a conclusive release gate to establish evidence.</span></div><div id="overview-evidence"><div class="empty">No run yet.</div></div></article>
150
+ <article class="panel summary-panel"><div data-repo-only-marker></div><div class="section-heading compact"><div><p class="eyebrow">Latest evidence</p><h2>What the last run proved</h2></div><button class="quiet" data-view="runs">All runs</button></div><div class="decision-card neutral" id="decision-card" data-repo-only><span class="decision-label">CURRENT DECISION</span><strong id="decision-title">Not evaluated</strong><span id="decision-detail">Run a conclusive release gate to establish evidence.</span></div><div id="overview-evidence"><div class="empty">No run yet.</div></div></article>
151
151
  </section>
152
152
  </section>
153
153
 
154
154
  <section class="workspace-view" data-view-panel="runs">
155
- <div class="view-heading simple"><div><p class="eyebrow">Runs</p><h1>Every run, with its evidence</h1><p>Release checks, explorations and read-only website audits. Each opens the report page the engine wrote.</p></div><button class="primary" id="run-gate">Run release gate</button></div>
155
+ <div class="view-heading simple"><div><p class="eyebrow">Runs</p><h1>Every run, with its evidence</h1><p>Release checks, explorations and read-only website audits. Each opens the report page the engine wrote.</p></div><button class="primary" id="run-gate" data-repo-only>Run release gate</button></div>
156
156
  <section class="panel section audit-panel">
157
157
  <div class="section-heading compact"><div><p class="eyebrow">Website</p><h2>Audit a website — read-only</h2><p>Up to six pages, nothing clicked. Safe on production or a site you do not own; no release verdict without source.</p></div></div>
158
158
  <form class="audit-form" id="runs-audit-form">