@aarwitz/tapp 0.18.2 → 0.18.3
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 +287 -60
- package/browser/app.js +194 -103
- package/browser/index.html +53 -54
- package/browser/product-contract.js +1 -1
- package/browser/view-model.js +85 -0
- package/docs/BROWSER-PRODUCT.md +28 -11
- package/mcp-server/src/browser-product.js +101 -1
- package/mcp-server/src/html-report.js +1 -1
- package/mcp-server/src/index.js +4 -0
- package/package.json +2 -2
package/browser/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="description" content="Tapp Studio:
|
|
6
|
+
<meta name="description" content="Tapp Studio: point Tapp at a website, a repository or a build, watch it run on a real device, and open the evidence.">
|
|
7
7
|
<meta name="tapp-api-base" content="">
|
|
8
8
|
<meta name="tapp-login-url" content="">
|
|
9
9
|
<title>Tapp</title>
|
|
@@ -21,44 +21,49 @@
|
|
|
21
21
|
<symbol id="i-app" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="2" width="10" height="12" rx="2"/><path d="M6.5 12h3"/></symbol>
|
|
22
22
|
</svg>
|
|
23
23
|
|
|
24
|
-
<main class="
|
|
24
|
+
<main class="prompt-screen hidden" id="source-onboarding">
|
|
25
25
|
<header class="onboarding-topbar">
|
|
26
26
|
<button class="brand" data-brand-home aria-label="Tapp overview">tapp<span class="brand-mark"></span><small>ship with proof</small></button>
|
|
27
27
|
<span class="mode-pill" id="onboarding-mode-pill">Self-host · this machine</span>
|
|
28
28
|
</header>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<div class="
|
|
34
|
-
<
|
|
29
|
+
|
|
30
|
+
<section class="prompt-hero" aria-hidden="true">
|
|
31
|
+
<!-- A device being driven: a cursor moves across screens, each screen gets its check. The
|
|
32
|
+
loop is the product in eight seconds; it respects prefers-reduced-motion. -->
|
|
33
|
+
<div class="hero-stage">
|
|
34
|
+
<div class="hero-device">
|
|
35
|
+
<span class="hero-notch"></span>
|
|
36
|
+
<div class="hero-screen">
|
|
37
|
+
<div class="hero-page hero-page-1"><span class="hero-bar"></span><span class="hero-line w60"></span><span class="hero-line w80"></span><span class="hero-tile"></span><span class="hero-btn">Add to cart</span></div>
|
|
38
|
+
<div class="hero-page hero-page-2"><span class="hero-bar"></span><span class="hero-line w40"></span><span class="hero-row"></span><span class="hero-row"></span><span class="hero-btn">Checkout</span></div>
|
|
39
|
+
<div class="hero-page hero-page-3"><span class="hero-bar"></span><span class="hero-check">✓</span><span class="hero-line w60 center"></span><span class="hero-line w40 center"></span></div>
|
|
40
|
+
</div>
|
|
41
|
+
<span class="hero-cursor">👆</span>
|
|
42
|
+
</div>
|
|
43
|
+
<ul class="hero-log">
|
|
44
|
+
<li class="hero-log-1">📱 Launching the app</li>
|
|
45
|
+
<li class="hero-log-2">👆 Tapping “Add to cart”</li>
|
|
46
|
+
<li class="hero-log-3">👆 Tapping “Checkout”</li>
|
|
47
|
+
<li class="hero-log-4">📸 Screenshotting · <b>✓ Order confirmed</b></li>
|
|
48
|
+
</ul>
|
|
35
49
|
</div>
|
|
36
50
|
</section>
|
|
37
51
|
|
|
38
|
-
<section class="
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
<small>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<h2>Audit a website</h2>
|
|
53
|
-
<p>Read-only: Tapp renders up to six pages and reports what is broken as served — dead controls, broken images and links, failed requests, layout that scrolls sideways on a phone. Nothing is clicked, typed or submitted, so it is safe on production or a site you do not own. No release verdict without source.</p>
|
|
54
|
-
<form class="audit-form" id="onboarding-audit-form">
|
|
55
|
-
<label class="field"><span>Website URL</span><input id="onboarding-audit-url" name="url" type="url" inputmode="url" placeholder="https://example.com" required autocomplete="off"></label>
|
|
56
|
-
<button class="primary" type="submit" id="onboarding-audit-start">Audit read-only</button>
|
|
57
|
-
</form>
|
|
58
|
-
</article>
|
|
52
|
+
<section class="prompt-block">
|
|
53
|
+
<h1>What should tapp test?</h1>
|
|
54
|
+
<form class="prompt-form" id="prompt-form" autocomplete="off">
|
|
55
|
+
<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>
|
|
56
|
+
<button class="primary prompt-go" type="submit" id="prompt-start" aria-label="Start">→</button>
|
|
57
|
+
</form>
|
|
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>
|
|
63
|
+
</ul>
|
|
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
|
+
<span class="sr-only" id="privacy-note-title">Your code stays on this machine.</span>
|
|
59
66
|
</section>
|
|
60
|
-
|
|
61
|
-
<div class="privacy-note"><strong id="privacy-note-title">Your code stays on this machine.</strong><span id="privacy-note-detail">Exploration, replay and merge decisions are deterministic and need no API key. This machine must stay open while a run is in progress.</span></div>
|
|
62
67
|
</main>
|
|
63
68
|
|
|
64
69
|
<div class="product-shell hidden" id="product-shell">
|
|
@@ -82,7 +87,7 @@
|
|
|
82
87
|
<span class="mode-pill" id="mode-pill">Self-host · this machine</span>
|
|
83
88
|
</div>
|
|
84
89
|
<div class="sidebar-footer">
|
|
85
|
-
<button class="quiet" id="change-source"
|
|
90
|
+
<button class="quiet" id="change-source">+ Test something else</button>
|
|
86
91
|
<button class="quiet hidden" id="refresh-project">Refresh</button>
|
|
87
92
|
</div>
|
|
88
93
|
</aside>
|
|
@@ -90,19 +95,17 @@
|
|
|
90
95
|
<main class="workspace">
|
|
91
96
|
<section class="workspace-view active" data-view-panel="overview" id="overview">
|
|
92
97
|
<div class="command-bar">
|
|
93
|
-
<div><h1
|
|
98
|
+
<div><h1 id="app-name">Your project</h1><p id="app-summary">Inspecting the repository for targets.</p></div>
|
|
94
99
|
<div class="command-actions">
|
|
95
100
|
<span class="phase-pill hidden" id="phase-pill"><span class="spinner"></span><span id="phase-pill-text">Working…</span></span>
|
|
101
|
+
<div class="idle-badges" id="idle-badges"></div>
|
|
96
102
|
<button class="primary" id="command-run">Run release check</button>
|
|
97
103
|
</div>
|
|
98
104
|
</div>
|
|
99
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>
|
|
100
|
-
<div class="idle-badges" id="idle-badges"></div>
|
|
101
|
-
<hr class="command-divider">
|
|
102
106
|
|
|
103
|
-
<section class="
|
|
104
|
-
<div class="device-
|
|
105
|
-
<p class="feed-label" id="device-feed-label">Live feed</p>
|
|
107
|
+
<section class="stage" id="stage">
|
|
108
|
+
<div class="device-stage">
|
|
106
109
|
<div class="device-frame" id="device-frame">
|
|
107
110
|
<span class="notch"></span>
|
|
108
111
|
<div class="device-screen">
|
|
@@ -111,23 +114,19 @@
|
|
|
111
114
|
<div class="device-placeholder" id="device-placeholder"><div><strong>No live feed yet</strong>Run a release check or open a live session to see the real application here.</div></div>
|
|
112
115
|
</div>
|
|
113
116
|
</div>
|
|
114
|
-
<div class="device-meta">
|
|
115
|
-
<div><span>Device</span><strong id="device-meta-device">—</strong></div>
|
|
116
|
-
<div><span>Screen</span><strong id="live-screen-title">—</strong></div>
|
|
117
|
-
</div>
|
|
117
|
+
<div class="device-meta"><span id="device-feed-label">Live feed</span><span id="device-meta-device">—</span><span id="live-screen-title">—</span></div>
|
|
118
118
|
</div>
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
<
|
|
119
|
+
|
|
120
|
+
<aside class="chat-float" id="chat-float" aria-label="tapp chat">
|
|
121
|
+
<button class="chat-head" id="chat-toggle" aria-expanded="true" aria-controls="chat-transcript">
|
|
122
|
+
<span class="chat-avatar">💬</span>
|
|
123
|
+
<span class="chat-title">tapp<small id="chat-status">ready</small></span>
|
|
124
|
+
<span class="chat-caret" aria-hidden="true">▾</span>
|
|
125
|
+
</button>
|
|
122
126
|
<div class="chat-transcript" id="chat-transcript"></div>
|
|
123
|
-
|
|
124
|
-
</div>
|
|
127
|
+
</aside>
|
|
125
128
|
</section>
|
|
126
129
|
|
|
127
|
-
<div class="view-heading" style="margin-top:20px">
|
|
128
|
-
<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>
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
130
|
<section class="panel section" id="target-stage">
|
|
132
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>
|
|
133
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>
|
|
@@ -140,7 +139,7 @@
|
|
|
140
139
|
</section>
|
|
141
140
|
|
|
142
141
|
<section class="panel section live-session-panel hidden" id="live-session-panel">
|
|
143
|
-
<div class="section-heading"><div><p class="eyebrow">Live application</p><h2>Drive the running target</h2><p>The device
|
|
142
|
+
<div class="section-heading"><div><p class="eyebrow">Live application</p><h2>Drive the running target</h2><p>The device above is the real application. Semantic controls refresh after every action; successful actions are recorded as a Flow you can save.</p></div><div class="button-row"><span class="status-chip" id="live-platform">Target</span><span class="status-chip" id="live-recorded-steps">0 recorded steps</span><button class="quiet" id="refresh-live-session">Refresh</button><button class="secondary" id="end-session">End session</button></div></div>
|
|
144
143
|
<div class="live-layout">
|
|
145
144
|
<aside class="live-controls"><div class="live-controls-heading"><div><strong>Semantic controls</strong><small id="live-control-count">0 available</small></div></div><div id="live-control-list"><div class="empty">Controls appear when the session starts.</div></div><div class="manual-action"><label><span>Target or field</span><input id="live-action-target" placeholder="Accessibility id or visible label"></label><label><span>Text <i>for type/wait</i></span><input id="live-action-text" autocomplete="off"></label><div class="button-row"><button class="secondary" id="live-tap">Tap</button><button class="secondary" id="live-type">Type</button><button class="quiet" id="live-back">Back</button><button class="quiet" id="live-swipe">Swipe up</button></div></div></aside>
|
|
146
145
|
<div class="flow-recorder-panel"><div class="flow-recorder-head"><div><strong>Keep this journey as a deterministic Flow</strong><small>Saved Flows replay without AI; promote them into the gate from the repository.</small></div></div><div class="flow-recorder"><label><span>Flow name</span><input id="live-flow-name" placeholder="Checkout smoke"></label><button class="primary" id="save-live-flow">Save Flow</button></div></div>
|
|
@@ -148,12 +147,12 @@
|
|
|
148
147
|
</section>
|
|
149
148
|
|
|
150
149
|
<section class="overview-grid">
|
|
151
|
-
<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 id="overview-evidence"><div class="empty">No run yet.</div></div></article>
|
|
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>
|
|
152
151
|
</section>
|
|
153
152
|
</section>
|
|
154
153
|
|
|
155
154
|
<section class="workspace-view" data-view-panel="runs">
|
|
156
|
-
<div class="view-heading simple"><div><p class="eyebrow">Runs</p><h1>Every run, with its evidence</h1><p>Release checks
|
|
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>
|
|
157
156
|
<section class="panel section audit-panel">
|
|
158
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>
|
|
159
158
|
<form class="audit-form" id="runs-audit-form">
|
|
@@ -8,7 +8,7 @@ export const customerProductContract = Object.freeze({
|
|
|
8
8
|
interface: "customer-browser",
|
|
9
9
|
targetPlatforms: ["ios", "android", "web"],
|
|
10
10
|
// A repository is opened by path (`tapp app /path/to/repo`); a website by URL in the Studio.
|
|
11
|
-
repositorySources: ["local-path"],
|
|
11
|
+
repositorySources: ["local-path", "github"],
|
|
12
12
|
entryLayers: ["repository", "website"],
|
|
13
13
|
views: [
|
|
14
14
|
{ id: "overview", label: "Overview", capabilities: ["target-selection", "release-check", "live-feed", "progress-transcript", "live-session", "flow-recording", "latest-evidence"] },
|
package/browser/view-model.js
CHANGED
|
@@ -14,3 +14,88 @@ export function productJourneyFlags({ status = {}, hasTarget = false, hasEvidenc
|
|
|
14
14
|
export function operationIsPending(status) {
|
|
15
15
|
return ["queued", "claimed", "running"].includes(String(status || ""));
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
// What a person typed into "What should tapp test?" — classified the same way on the server.
|
|
19
|
+
// Order matters: a GitHub URL is a URL, so it is checked before the generic http(s) rule.
|
|
20
|
+
export function classifyPrompt(raw) {
|
|
21
|
+
const input = String(raw || "").trim();
|
|
22
|
+
if (!input) return { kind: "empty", value: "" };
|
|
23
|
+
const github = input.match(/^(?:https?:\/\/)?(?:www\.)?github\.com\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+?)(?:\.git)?(?:\/.*)?$/i) || input.match(/^([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)$/);
|
|
24
|
+
if (github && !/^https?:\/\/(?!(?:www\.)?github\.com)/i.test(input) && !input.startsWith("/") && !input.startsWith("~")) {
|
|
25
|
+
return { kind: "github", value: github[1].replace(/\.git$/, "") };
|
|
26
|
+
}
|
|
27
|
+
if (/^https?:\/\//i.test(input)) return { kind: "url", value: input };
|
|
28
|
+
if (/\.apk$/i.test(input)) return { kind: "apk", value: input };
|
|
29
|
+
if (/\.app\/?$/i.test(input) && /[\/~]/.test(input)) return { kind: "app", value: input.replace(/\/$/, "") };
|
|
30
|
+
// Reverse-DNS reads as a bundle id (com.company.app); a hostname puts the TLD last (company.com).
|
|
31
|
+
if (/^(?:com|org|net|io|co|dev|app|ai|me|us|uk|de|fr|se|edu|gov)\.[A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9-]+)+$/i.test(input)) return { kind: "bundle", value: input };
|
|
32
|
+
if (/^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+$/.test(input)) return { kind: "url", value: `https://${input}` };
|
|
33
|
+
if (input.startsWith("/") || input.startsWith("~") || input.startsWith("./") || input.startsWith("../")) return { kind: "path", value: input };
|
|
34
|
+
return { kind: "business", value: input };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Renders one engine progress line as a chat line: an emoji and the engine's own words. The
|
|
38
|
+
// text is never rewritten beyond trimming; the icon is derived from what the engine said.
|
|
39
|
+
const RULES = [
|
|
40
|
+
[/^(?:Opened|Open(?:ing)?) /i, "📍"],
|
|
41
|
+
[/^(?:Reached|Navigated to|Now on) /i, "🧭"],
|
|
42
|
+
[/^(?:Tapped|Tap(?:ping)?|Clicked|Pressed) /i, "👆"],
|
|
43
|
+
[/^(?:Typed|Filled|Entered|Type) /i, "⌨️"],
|
|
44
|
+
[/^(?:Swiped|Scrolled)/i, "↕️"],
|
|
45
|
+
[/^(?:Went back|Back)/i, "◀️"],
|
|
46
|
+
[/sign(?:ed|ing)? in|login|logged in|credentials/i, "🔐"],
|
|
47
|
+
[/screenshot|captured frame|snapshot/i, "📸"],
|
|
48
|
+
[/^(?:Building|Compiling|Build )/i, "🔨"],
|
|
49
|
+
[/^(?:Installing|Installed|Install )/i, "📦"],
|
|
50
|
+
[/^(?:Launching|Launched|Booting|Booted|Starting the app|Opening the)/i, "📱"],
|
|
51
|
+
[/^(?:Cloning|Connected |Cloned)/i, "🐙"],
|
|
52
|
+
[/^(?:Inspecting|Detected|Found \d+ target|Reading the repository)/i, "🔎"],
|
|
53
|
+
[/^(?:Audited|Auditing|Opening .* read-only)/i, "🔍"],
|
|
54
|
+
[/^(?:Exploring|Explore )/i, "🧭"],
|
|
55
|
+
[/^(?:Replaying|Replay |Running flow|Flow )/i, "▶️"],
|
|
56
|
+
[/^(?:Gate|Release gate|Evaluating)/i, "⚖️"],
|
|
57
|
+
[/^\d+\/\d+ actions/i, "⏳"],
|
|
58
|
+
[/waiting|waited|settling/i, "⏳"],
|
|
59
|
+
[/^(?:Timed out|Failed|Error|Could not)/i, "⚠️"],
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export function narrate(entry = {}, { platform = "" } = {}) {
|
|
63
|
+
const text = String(entry.text || "").trim().replace(/\s+/g, " ");
|
|
64
|
+
if (!text) return null;
|
|
65
|
+
const progress = text.match(/^(\d+)\/(\d+) actions(?: · (\d+) (?:states?|pages?|screens?)[^·]*)?/i);
|
|
66
|
+
if (progress) return { kind: "progress", icon: "⏳", text, current: Number(progress[1]), total: Number(progress[2]), states: progress[3] ? Number(progress[3]) : null };
|
|
67
|
+
for (const [pattern, icon] of RULES) {
|
|
68
|
+
if (pattern.test(text)) {
|
|
69
|
+
const kind = /^(?:Timed out|Failed|Error|Could not)/i.test(text) ? "warning" : "step";
|
|
70
|
+
const deviceIcon = icon === "📱" ? (platform === "web" ? "🌐" : platform === "android" ? "🤖" : "📱") : icon;
|
|
71
|
+
return { kind, icon: deviceIcon, text };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { kind: entry.phase && !["explore", "runtime"].includes(entry.phase) ? "phase" : "step", icon: entry.phase === "runtime" ? "⚙️" : "•", text };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function narrateFinding(finding = {}) {
|
|
78
|
+
const severity = String(finding.severity || "info").toLowerCase();
|
|
79
|
+
const icon = { critical: "🔴", high: "🟠", medium: "🟡", low: "⚪️" }[severity] || "•";
|
|
80
|
+
const where = finding.screen ? ` on ${finding.screen}` : "";
|
|
81
|
+
return { kind: "finding", severity, icon, text: `${finding.title || finding.message || finding.type || "Finding"}${where}` };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// The summary card at the end of a run: the gate's outcome when there is one, otherwise what the
|
|
85
|
+
// engine's headline says it observed. Never a score.
|
|
86
|
+
export function summarize(name, result = {}) {
|
|
87
|
+
const report = result?.report || result;
|
|
88
|
+
const gateOutcome = report?.gate?.outcome || (report?.gate?.failed === true ? "fail" : report?.gate ? "pass" : null);
|
|
89
|
+
if (name === "audit") {
|
|
90
|
+
const issues = result.issueCount || 0;
|
|
91
|
+
return { tone: issues ? "caution" : "ready", pill: issues ? `${issues} issue${issues === 1 ? "" : "s"} found` : "✓ Nothing broken observed", text: `${result.pagesAudited || 0} page(s) rendered read-only — nothing was clicked. ${issues ? "Each issue is listed in the run detail with the pages it appears on." : "This says the pages are served without structural defects, not that the site works."}` };
|
|
92
|
+
}
|
|
93
|
+
if (gateOutcome) {
|
|
94
|
+
const tone = { pass: "ready", fail: "blocked", inconclusive: "caution" }[gateOutcome] || "caution";
|
|
95
|
+
const pill = { pass: "✓ Ready to merge", fail: "× Do not merge", inconclusive: "◐ Inconclusive" }[gateOutcome];
|
|
96
|
+
return { tone, pill, text: (report.gate?.reasons || [report.headline || "Release gate completed."]).join(" · ") };
|
|
97
|
+
}
|
|
98
|
+
if (report?.inconclusive) return { tone: "caution", pill: "◐ Inconclusive", text: report.headline || "Exploration could not see enough to conclude." };
|
|
99
|
+
if (report?.headline) return { tone: "neutral", pill: `${report.screensExplored || 0} screens · ${report.actionsPerformed || 0} actions · ${(report.findings || []).length} findings`, text: /not a release decision/i.test(report.headline) ? report.headline : `${report.headline} An observation, not a release decision.` };
|
|
100
|
+
return { tone: "neutral", pill: "Done", text: `${name} completed.` };
|
|
101
|
+
}
|
package/docs/BROWSER-PRODUCT.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Browser Studio
|
|
2
2
|
|
|
3
|
-
Status: current product contract as of 2026-10-
|
|
4
|
-
"desktop-parity Command Center" framing of 2026-10-14.
|
|
3
|
+
Status: current product contract as of 2026-10-19 (ADR-0006, owner decision, amended). Supersedes
|
|
4
|
+
the "desktop-parity Command Center" framing of 2026-10-14.
|
|
5
5
|
|
|
6
6
|
The Studio in `browser/` is the one browser surface. It is a **run viewer**: point Tapp at a
|
|
7
7
|
repository target or a website, watch the run live, open its evidence. It never scores or judges
|
|
@@ -12,22 +12,38 @@ embeds these same assets at build time.
|
|
|
12
12
|
## Start locally
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npx -y @aarwitz/tapp@latest app
|
|
16
|
-
npx -y @aarwitz/tapp@latest app
|
|
15
|
+
npx -y @aarwitz/tapp@latest app # opens on the prompt
|
|
16
|
+
npx -y @aarwitz/tapp@latest app /path/to/repo # opens straight onto that repository
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Tapp prints an authenticated one-time launch URL and opens it in the default browser (`--no-open`
|
|
20
|
-
to copy it by hand, `--port 4317` for a fixed loopback port).
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
to copy it by hand, `--port 4317` for a fixed loopback port). Everything runs on this machine
|
|
21
|
+
with its own toolchain (Xcode for iOS, JDK/SDK + `adb` for Android, Playwright Chromium for
|
|
22
|
+
web), which must stay open while a run is in progress. Nothing is uploaded anywhere.
|
|
23
|
+
|
|
24
|
+
## The prompt
|
|
25
|
+
|
|
26
|
+
With nothing open, the Studio shows one field — **What should tapp test?** — above a short
|
|
27
|
+
looping animation of a device being driven (launch, tap, tap, screenshot, ✓). It accepts:
|
|
28
|
+
|
|
29
|
+
| You type | What happens |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `https://example.com` (or `example.com`) | A read-only website audit; the stage takes a browser's shape. |
|
|
32
|
+
| `~/code/my-app`, `/path/to/repo` | That folder becomes the project: targets are detected, nothing builds until one is chosen. Local Studio only. |
|
|
33
|
+
| `owner/repo`, `github.com/owner/repo` | Cloned with `gh` into an isolated workspace under `TAPP_HOME`, then the same. |
|
|
34
|
+
| `com.company.app` | Explored on the booted iOS simulator as it is (no build). |
|
|
35
|
+
| `/path/to/Demo.app`, `~/Downloads/app.apk` | Installed on the booted simulator / connected device, then explored. |
|
|
36
|
+
| a business name | Answered honestly: nothing discovers surfaces from a name yet; paste its URL. |
|
|
37
|
+
|
|
38
|
+
The server classifies the input again (`classifyPrompt` in `browser/view-model.js` is shared) and
|
|
39
|
+
refuses what the mode cannot do: a hosted Studio cannot open a path or a build on your machine.
|
|
24
40
|
|
|
25
41
|
## What is on the page
|
|
26
42
|
|
|
27
43
|
| View | What it shows | Operations |
|
|
28
44
|
|---|---|---|
|
|
29
|
-
| Overview | The
|
|
30
|
-
| Runs | Every run on this repository and every read-only website audit, newest first; each opens its evidence page. A URL field runs an audit from here. | `gate`, `audit` |
|
|
45
|
+
| Overview | The **stage**: the device as large as the window allows, in its platform's aspect ratio (phone portrait for iOS and Android, browser landscape for web), showing the live frame or the newest screenshot the run wrote. The **chat** floats over its corner on a translucent ground, collapses to a pill, and narrates the engine's own progress log one emoji-led line at a time (👆 Tapped, ⌨️ Typed, 🔐 Signed in, 📍 Opened, 🧭 Reached, 📸 screenshots inline), then attaches the recording and `report.html` and ends with a pill — `✓ Ready to merge`, `× Do not merge`, `◐ Inconclusive`, or for an exploration its counts — and the headline. Nothing is generated after the fact and nothing is a score. Below the stage: the detected targets (an explicit choice when there are several), the live-session controls, and the current decision from the last gate. | `open`, `initialize` (inspect, then build + explore), `explore-build`, live session `start / act / save-flow / end`, release check |
|
|
46
|
+
| Runs | Every run on this repository, every exploration started from the prompt, and every read-only website audit, newest first; each opens its evidence page. A URL field runs an audit from here. | `gate`, `audit` |
|
|
31
47
|
|
|
32
48
|
A **website audit** is `explore --read-only`: up to six same-origin pages are rendered and read —
|
|
33
49
|
dead controls, broken images/assets/links, failed requests, JS exceptions, mixed content,
|
|
@@ -51,7 +67,8 @@ run happens, driving it by hand, and reading evidence.
|
|
|
51
67
|
target choice, exploration, a live session that records a Flow, the gate, and the runs list.
|
|
52
68
|
`tests/browser-onboarding.test.js` covers the no-repository start and a read-only website audit;
|
|
53
69
|
`tests/browser-product.test.js` covers authentication, CSRF, the audit operation and the removed
|
|
54
|
-
endpoints answering 404.
|
|
70
|
+
endpoints answering 404. `tests/browser-chat-narration.test.js` covers prompt classification and
|
|
71
|
+
the chat's narration and summary without a browser.
|
|
55
72
|
|
|
56
73
|
## Hosted relationship
|
|
57
74
|
|
|
@@ -14,6 +14,8 @@ import { BrowserWorkspaceRegistry } from "./browser-workspaces.js";
|
|
|
14
14
|
import { selectApplicationTarget } from "./ci-setup.js";
|
|
15
15
|
import { initializeProductProject, prepareProductTarget, readProductProject, runProductGate } from "./product-operations.js";
|
|
16
16
|
import { readCaptureProvenance } from "./capture-provenance.js";
|
|
17
|
+
import { collectShots } from "./html-report.js";
|
|
18
|
+
import { classifyPrompt } from "../../browser/view-model.js";
|
|
17
19
|
|
|
18
20
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
19
21
|
const assetRoot = path.join(packageRoot, "browser");
|
|
@@ -131,6 +133,32 @@ function listAudits(limit = 50) {
|
|
|
131
133
|
return audits.sort((a, b) => b.createdAt.localeCompare(a.createdAt)).slice(0, limit);
|
|
132
134
|
}
|
|
133
135
|
|
|
136
|
+
// Everything the Studio can show for one capture, as paths relative to /evidence/captures/<id>/.
|
|
137
|
+
function captureFiles(captureId) {
|
|
138
|
+
const root = capturePath(captureId, ".");
|
|
139
|
+
if (!root || !fs.existsSync(root)) return null;
|
|
140
|
+
const shots = collectShots(root).slice(0, 24);
|
|
141
|
+
const recording = ["exploration.webm", "exploration.mov", "exploration.mp4"].find((name) => fs.existsSync(path.join(root, name))) || null;
|
|
142
|
+
return { id: captureId, shots, recording, report: fs.existsSync(path.join(root, "report.html")) ? "report.html" : null, provenance: readCaptureProvenance(root) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Explorations started from the prompt (a bundle id, an .app or .apk) have no repository to list
|
|
146
|
+
// them under; they are listed from their captures like audits are.
|
|
147
|
+
function listBuildExplores(limit = 50) {
|
|
148
|
+
const root = captureRoot();
|
|
149
|
+
let names;
|
|
150
|
+
try { names = fs.readdirSync(root); } catch { return []; }
|
|
151
|
+
const runs = [];
|
|
152
|
+
for (const name of names) {
|
|
153
|
+
const provenance = readCaptureProvenance(path.join(root, name));
|
|
154
|
+
if (!provenance || provenance.kind !== "explore" || provenance.origin !== "studio-prompt") continue;
|
|
155
|
+
let report = null;
|
|
156
|
+
try { report = JSON.parse(fs.readFileSync(path.join(root, name, "report.json"), "utf8")); } catch { /* older capture */ }
|
|
157
|
+
runs.push({ id: name, createdAt: provenance.createdAt, platform: provenance.platform, target: provenance.target, report });
|
|
158
|
+
}
|
|
159
|
+
return runs.sort((a, b) => b.createdAt.localeCompare(a.createdAt)).slice(0, limit);
|
|
160
|
+
}
|
|
161
|
+
|
|
134
162
|
function openBrowser(url) {
|
|
135
163
|
const invocation = process.platform === "darwin" ? ["open", [url]]
|
|
136
164
|
: process.platform === "win32" ? ["cmd", ["/c", "start", "", url]]
|
|
@@ -430,7 +458,14 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
430
458
|
return;
|
|
431
459
|
}
|
|
432
460
|
if (request.method === "GET" && url.pathname === "/api/repositories") { json(response, 200, hosted ? { current:hostedRepository(registry.current()), repositories:registry.list().map(hostedRepository) } : { current: registry.current(), repositories: registry.list() }); return; }
|
|
433
|
-
if (request.method === "GET" && url.pathname === "/api/audits") { json(response, 200, { audits: hosted ? hostedPayload(listAudits()) : listAudits() }); return; }
|
|
461
|
+
if (request.method === "GET" && url.pathname === "/api/audits") { json(response, 200, { audits: hosted ? hostedPayload(listAudits()) : listAudits(), explores: hosted ? hostedPayload(listBuildExplores()) : listBuildExplores() }); return; }
|
|
462
|
+
const filesMatch = url.pathname.match(/^\/api\/captures\/([A-Za-z0-9._-]{1,128})\/files$/);
|
|
463
|
+
if (request.method === "GET" && filesMatch) {
|
|
464
|
+
const files = captureFiles(filesMatch[1]);
|
|
465
|
+
if (!files) { json(response, 404, { error: "No such capture" }); return; }
|
|
466
|
+
json(response, 200, files);
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
434
469
|
if (request.method === "GET" && url.pathname === "/api/project") { json(response, 200, hosted ? hostedPayload(projectSnapshot(registry)) : projectSnapshot(registry)); return; }
|
|
435
470
|
if (request.method === "GET" && url.pathname === "/api/live-session") { json(response, 200, liveSession || { active:false }); return; }
|
|
436
471
|
if (request.method === "GET" && url.pathname === "/api/live-session/frame") {
|
|
@@ -482,6 +517,71 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
482
517
|
requireMutationAuth(request, hosted ? publicOrigins : origin, csrfToken);
|
|
483
518
|
const body = await readJsonBody(request);
|
|
484
519
|
const operation = url.pathname.slice("/api/operations/".length);
|
|
520
|
+
// "What should tapp test?" — a repository on this machine or on GitHub becomes the current
|
|
521
|
+
// project; a build is explored directly; a URL goes to `audit`; a business name is not
|
|
522
|
+
// something Tapp can resolve yet, and says so instead of guessing.
|
|
523
|
+
if (operation === "open") {
|
|
524
|
+
const prompt = classifyPrompt(body.input);
|
|
525
|
+
if (liveSession?.active) throw Object.assign(new Error("End the active live session before opening another project"), { statusCode: 409 });
|
|
526
|
+
if (prompt.kind === "path") {
|
|
527
|
+
if (hosted) throw Object.assign(new Error("A hosted Studio cannot open a path on your machine; run `tapp app /path/to/repo` locally"), { statusCode: 400 });
|
|
528
|
+
const resolved = prompt.value.startsWith("~") ? path.join(os.homedir(), prompt.value.slice(1)) : path.resolve(prompt.value);
|
|
529
|
+
if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) throw Object.assign(new Error(`No folder at ${resolved}`), { statusCode: 400 });
|
|
530
|
+
const repository = registry.addExisting(resolved);
|
|
531
|
+
json(response, 200, { kind: "repository", repository: hosted ? hostedRepository(repository) : repository });
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (prompt.kind === "github") {
|
|
535
|
+
const job = startJob(operation, async (progress) => ({ kind: "repository", repository: await registry.cloneGithub(prompt.value, progress) }), null);
|
|
536
|
+
json(response, 202, { job: publicJob(job, { hosted }) });
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
if (prompt.kind === "business") {
|
|
540
|
+
json(response, 200, { kind: "business", message: `I can't find a business's website or app from a name yet — paste its URL and I'll audit it read-only, or open its repository.` });
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
json(response, 200, { kind: prompt.kind, value: prompt.value });
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (operation === "explore-build") {
|
|
547
|
+
if (hosted) throw Object.assign(new Error("Builds are explored on the machine that has the simulator; run the Studio locally"), { statusCode: 400 });
|
|
548
|
+
const prompt = classifyPrompt(body.input);
|
|
549
|
+
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
|
+
const job = startJob(operation, async (progress) => {
|
|
551
|
+
const engine = await import("./index.js");
|
|
552
|
+
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
|
+
let result;
|
|
554
|
+
if (prompt.kind === "apk") {
|
|
555
|
+
progress({ phase: "runtime", text: `Installing ${path.basename(prompt.value)} on the connected Android device` });
|
|
556
|
+
result = await engine.runQaAndroid({ apkPath: prompt.value, appId: String(body.appId || ""), maxActions: Number(body.maxActions) || 40, timeout: Number(body.timeout) || 600, onProgress: forward });
|
|
557
|
+
} else {
|
|
558
|
+
let bundleId = prompt.value;
|
|
559
|
+
if (prompt.kind === "app") {
|
|
560
|
+
progress({ phase: "runtime", text: `Installing ${path.basename(prompt.value)} on the booted simulator` });
|
|
561
|
+
const installed = await engine.installAppOnBootedSim(prompt.value, { onStatus: (text) => progress({ phase: "runtime", text }) });
|
|
562
|
+
if (installed?.error) throw new Error(installed.error);
|
|
563
|
+
bundleId = installed.bundleId;
|
|
564
|
+
}
|
|
565
|
+
progress({ phase: "runtime", text: `Launching ${bundleId} on the booted simulator` });
|
|
566
|
+
result = await engine.runQaIos({ bundleId, maxActions: Number(body.maxActions) || 40, timeout: Number(body.timeout) || 600, device: String(body.device || ""), onProgress: forward });
|
|
567
|
+
}
|
|
568
|
+
if (result?.error) throw Object.assign(new Error(result.error), { details: result.details || {} });
|
|
569
|
+
const structured = result.structured;
|
|
570
|
+
// Mark the capture as prompt-started so the Studio lists it without a repository.
|
|
571
|
+
try {
|
|
572
|
+
const captureDir = structured?.capture?.path;
|
|
573
|
+
if (captureDir) {
|
|
574
|
+
const provenancePath = path.join(captureDir, "provenance.json");
|
|
575
|
+
const provenance = JSON.parse(fs.readFileSync(provenancePath, "utf8"));
|
|
576
|
+
fs.writeFileSync(provenancePath, JSON.stringify({ ...provenance, origin: "studio-prompt" }, null, 2));
|
|
577
|
+
fs.writeFileSync(path.join(captureDir, "report.json"), JSON.stringify({ headline: structured.headline, inconclusive: structured.inconclusive, screensExplored: structured.screensExplored, actionsPerformed: structured.actionsPerformed, findingCounts: structured.findingCounts, findings: structured.findings, checkedFor: structured.checkedFor, notChecked: structured.notChecked, platform: structured.platform, target: structured.target }, null, 2));
|
|
578
|
+
}
|
|
579
|
+
} catch { /* listing is a convenience; the capture is the evidence */ }
|
|
580
|
+
return structured;
|
|
581
|
+
}, null);
|
|
582
|
+
json(response, 202, { job: publicJob(job, { hosted }) });
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
485
585
|
// A website audit needs no repository: it is read-only against a URL and writes a capture.
|
|
486
586
|
if (operation === "audit") {
|
|
487
587
|
let target;
|
|
@@ -33,7 +33,7 @@ export function capturePlatform(captureDir) {
|
|
|
33
33
|
// Two capture layouts exist: web runs write state_*.png at the capture root; iOS runs
|
|
34
34
|
// export XCUITest attachments into screenshots/ as UUID files with a manifest carrying
|
|
35
35
|
// the human-readable state_N_<Screen> names.
|
|
36
|
-
function collectShots(captureDir) {
|
|
36
|
+
export function collectShots(captureDir) {
|
|
37
37
|
const root = fs
|
|
38
38
|
.readdirSync(captureDir)
|
|
39
39
|
.filter((f) => f.endsWith(".png") && f.startsWith("state_"))
|
package/mcp-server/src/index.js
CHANGED
|
@@ -2274,6 +2274,10 @@ export async function runInitExploration({
|
|
|
2274
2274
|
},
|
|
2275
2275
|
mapDiff: previous ? diffUiMaps(previous, observed, { comparableFullSweep: false }) : null,
|
|
2276
2276
|
inconclusive: qa.structured.inconclusive === true,
|
|
2277
|
+
headline: qa.structured.headline || "",
|
|
2278
|
+
screensExplored: qa.structured.screensExplored ?? 0,
|
|
2279
|
+
actionsPerformed: qa.structured.actionsPerformed ?? 0,
|
|
2280
|
+
findingCounts: qa.structured.findingCounts || null,
|
|
2277
2281
|
findings: qa.structured.findings || [],
|
|
2278
2282
|
capture: qa.structured.capture,
|
|
2279
2283
|
reportHtml: qa.structured.reportHtml || null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.3",
|
|
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/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-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/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",
|
|
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
|
}
|