@aarwitz/tapp 0.35.9 → 0.35.10

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.35.9",
4
+ "version": "0.35.10",
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.35.9",
27
+ "@aarwitz/tapp@0.35.10",
28
28
  "mcp"
29
29
  ],
30
30
  "cwd": "${CLAUDE_PROJECT_DIR}"
package/browser/app.css CHANGED
@@ -477,6 +477,7 @@ dialog::backdrop { background:rgba(0,0,0,.6); }
477
477
  .prompt-suggestions button:hover { background:var(--tapp-panel); }
478
478
  .prompt-suggestions button span { font-size:16px; text-align:center; } .prompt-suggestions button b { font-weight:600; font-family:var(--tapp-font-mono); font-size:12.5px; white-space:nowrap; } .prompt-suggestions button small { color:var(--tapp-text-faint); font-size:12.5px; }
479
479
  .prompt-note { text-align:center; color:var(--tapp-text-faint); font-size:12px; margin:8px 0 0; }
480
+ .connecting-note { font-size:13px; color:var(--tapp-text-soft); margin:0 auto 14px; max-width:620px; }
480
481
  #business-results { display:grid; gap:10px; margin:12px 0; }
481
482
  #business-results p { margin:0; }
482
483
  .business-match { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; border-top:1px solid var(--tapp-border); padding:10px 0; }
package/browser/app.js CHANGED
@@ -37,6 +37,12 @@ const state = {
37
37
  if (fromHash) { saveConnection(fromHash); history.replaceState(null, "", location.pathname + location.search); }
38
38
  state.connection = loadConnection();
39
39
  if (state.connection && state.connection.origin === location.origin) state.connection = null;
40
+ // A connect link pasted into a tab that is already open changes only the fragment, which is
41
+ // not a page load: take the pair the same way, then load the page properly.
42
+ window.addEventListener("hashchange", () => {
43
+ const pasted = parseConnectFragment(location.hash);
44
+ if (pasted) { saveConnection(pasted); location.replace(location.pathname + location.search); }
45
+ });
40
46
  }
41
47
  const $ = (selector) => document.querySelector(selector);
42
48
  const $$ = (selector) => [...document.querySelectorAll(selector)];
@@ -277,7 +283,7 @@ function applyAccessMode() {
277
283
  $("#selfhost-card")?.classList.remove("hidden");
278
284
  $("#cloud-card")?.classList.toggle("hidden", signedIn);
279
285
  const lead = $("#selfhost-lead");
280
- if (lead && state.connectionLost) lead.innerHTML = `<strong>Your machine stopped answering at ${esc(state.connectionLost.origin)}.</strong> Start the runtime again and this page connects to it; or open the address the command prints if this browser will not reach your machine.`;
286
+ if (lead && state.connectionLost) lead.innerHTML = `<strong>This page could not reach your machine at ${esc(state.connectionLost.origin)}</strong> (${esc(state.connectionLost.reason)}). If Chrome asked to access devices on your local network, allow it and run the command again. Otherwise open the Studio directly on your machine — the same thing, served from there: <a href="${esc(state.connectionLost.launch)}">${esc(state.connectionLost.origin)}</a>.`;
281
287
  const input = $("#prompt-input");
282
288
  if (input && !accepts.has("path")) input.placeholder = "A business name or website URL…";
283
289
  // Everything that only means something against a source repository: a target to build, a
@@ -1405,17 +1411,21 @@ function renderProject() {
1405
1411
 
1406
1412
  async function refreshSession() {
1407
1413
  if (state.connection) {
1408
- try { state.session = await api("/api/session"); }
1414
+ // Chrome asks the person before a page may reach their local network, and the fetch waits
1415
+ // on their answer; give that long, then stop waiting rather than show a blank page.
1416
+ const waited = new Promise((_, reject) => setTimeout(() => reject(new Error("this page was not allowed to reach your machine")), 25_000));
1417
+ try { state.session = await Promise.race([api("/api/session"), waited]); }
1409
1418
  catch (error) {
1410
- // The machine stopped answering (the runtime was closed, or this browser will not reach
1411
- // loopback). Say so on the hosted page and carry on as a visitor; the saved connection is
1412
- // dropped so a reload does not loop on the same failure.
1413
- state.connectionLost = { origin: state.connection.origin, reason: error.message };
1419
+ // The machine stopped answering (the runtime was closed, Chrome refused, or this browser
1420
+ // will not reach loopback). Say so on the hosted page, with the way round it, and carry on
1421
+ // as a visitor; the saved connection is dropped so a reload does not loop on the failure.
1422
+ state.connectionLost = { origin: state.connection.origin, launch: `${state.connection.origin}/?token=${encodeURIComponent(state.connection.token)}`, reason: error.message };
1414
1423
  state.connection = null;
1415
1424
  saveConnection(null);
1416
1425
  state.session = await api("/api/session");
1417
1426
  }
1418
1427
  } else state.session = await api("/api/session");
1428
+ $("#connecting-note")?.classList.add("hidden");
1419
1429
  state.csrf = state.session.csrfToken;
1420
1430
  const local = state.session.mode === "local";
1421
1431
  $("#mode-pill").textContent = local ? (state.connection ? "Connected · your machine" : "Self-host · this machine") : "Cloud · outbound runner";
@@ -1845,6 +1855,14 @@ function handoffTarget() {
1845
1855
 
1846
1856
  try {
1847
1857
  try { setChatCollapsed(localStorage.getItem("tapp:chat-collapsed") === "1"); } catch { /* storage may be unavailable */ }
1858
+ if (state.connection) {
1859
+ // Say what is happening before the machine answers: a blank page while Chrome asks for
1860
+ // permission reads as broken.
1861
+ showPrompt();
1862
+ $("#onboarding-mode-pill").textContent = "Connecting · your machine";
1863
+ const note = $("#connecting-note");
1864
+ if (note) { note.textContent = `Connecting to your machine at ${state.connection.origin}… If Chrome asks whether this site may access devices on your local network, allow it — that is your own machine.`; note.classList.remove("hidden"); }
1865
+ }
1848
1866
  await refreshSession();
1849
1867
  await refresh();
1850
1868
  if (state.project?.connected && !state.project?.state?.inspected) await runOperation("initialize", { write:true });
@@ -63,6 +63,9 @@
63
63
  <ol class="setup-steps" id="setup-steps"><li class="empty">Checking this machine…</li></ol>
64
64
  </section>
65
65
  <section class="prompt-block">
66
+ <!-- The hosted page reaching the runtime on this person's machine (ADR-0011 §4): said while
67
+ it happens, because Chrome may be asking for permission and a blank page says nothing. -->
68
+ <p class="prompt-note connecting-note hidden" id="connecting-note"></p>
66
69
  <h1>What should tapp test?</h1>
67
70
  <form class="prompt-form" id="prompt-form" autocomplete="off">
68
71
  <label class="prompt-field"><span class="sr-only">Website, repository, folder, or build</span><input id="prompt-input" name="input" placeholder="A website URL, a GitHub repo, a folder on this Mac, a bundle id, an .app or .apk…" spellcheck="false" required></label>
@@ -986,7 +986,9 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
986
986
  }
987
987
  if (request.method === "OPTIONS") {
988
988
  if (connectedCaller) {
989
- response.writeHead(204, { "access-control-allow-methods": "GET,POST,DELETE,OPTIONS", "access-control-allow-headers": "authorization,content-type,x-tapp-csrf", "access-control-allow-private-network": "true", "access-control-max-age": "600" });
989
+ // Chrome asked this as "private network" until 2025 and asks it as "local network"
990
+ // since; both answers are given, so either generation lets the page through.
991
+ response.writeHead(204, { "access-control-allow-methods": "GET,POST,DELETE,OPTIONS", "access-control-allow-headers": "authorization,content-type,x-tapp-csrf", "access-control-allow-private-network": "true", "access-control-allow-local-network": "true", "access-control-max-age": "600" });
990
992
  } else response.writeHead(204);
991
993
  response.end();
992
994
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarwitz/tapp",
3
- "version": "0.35.9",
3
+ "version": "0.35.10",
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",