@aarwitz/tapp 0.21.1 → 0.21.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.21.1",
4
+ "version": "0.21.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.21.1",
27
+ "@aarwitz/tapp@0.21.2",
28
28
  "mcp"
29
29
  ],
30
30
  "cwd": "${CLAUDE_PROJECT_DIR}"
@@ -559,15 +559,27 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
559
559
  if (publicAccess && !authenticated) {
560
560
  anonymous = true;
561
561
  visitorId = String(cookies(request)[VISITOR_COOKIE] || "");
562
- if (!/^[a-f0-9]{32}$/.test(visitorId)) {
562
+ const returning = /^[a-f0-9]{32}$/.test(visitorId);
563
+ if (!returning) {
563
564
  visitorId = crypto.randomBytes(16).toString("hex");
564
565
  response.setHeader("set-cookie", `${VISITOR_COOKIE}=${visitorId}; HttpOnly; SameSite=Lax; Secure; Path=/; Max-Age=2592000`);
565
- usage.visitors.add(visitorId.slice(0, 8));
566
+ }
567
+ const permitted = anonymousAllows(request.method, url.pathname);
568
+ // Count someone as a visitor only when they ask for something the Studio actually
569
+ // offers. A public host is scanned constantly — in one afternoon this recorded 404
570
+ // "new visitors", 383 of which were bots probing for .env files, which is a reading
571
+ // that answers "is anyone using this?" with noise.
572
+ if (!returning && permitted) {
573
+ if (usage.visitors.size < 50_000) usage.visitors.add(visitorId.slice(0, 8));
566
574
  logUsage("visitor.new", { visitor: visitorId.slice(0, 8), distinctVisitors: usage.visitors.size });
567
575
  }
568
- if (!anonymousAllows(request.method, url.pathname)) {
576
+ if (!permitted) {
569
577
  usage.refusals += 1;
570
- logUsage("refused", { visitor: visitorId.slice(0, 8), reason: "not-public", method: request.method, path: url.pathname, status: 401 });
578
+ // Scanners are the overwhelming majority of refusals and say nothing about the
579
+ // product; count them, and keep one line per path rather than one per request.
580
+ const scanning = /\.(env|git|aws|ssh)|wp-|phpunit|vendor\/|\.ya?ml$|\.ini$|credentials/i.test(url.pathname);
581
+ if (!scanning) logUsage("refused", { visitor: visitorId.slice(0, 8), reason: "not-public", method: request.method, path: url.pathname, status: 401 });
582
+ else if (usage.refusals % 100 === 0) logUsage("scanned", { refusalsSoFar: usage.refusals, note: "automated probes for secrets; all refused" });
571
583
  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." });
572
584
  return;
573
585
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarwitz/tapp",
3
- "version": "0.21.1",
3
+ "version": "0.21.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",