@aarwitz/tapp 0.32.0 → 0.34.0
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/bin/tapp.js +27 -8
- package/browser/app.css +25 -0
- package/browser/app.js +77 -4
- package/browser/index.html +6 -0
- package/browser/product-contract.js +7 -1
- package/mcp-server/src/android-flow.js +13 -1
- package/mcp-server/src/browser-product.js +65 -12
- package/mcp-server/src/index.js +9 -4
- package/mcp-server/src/journeys.js +16 -4
- package/mcp-server/src/platforms.js +158 -0
- package/mcp-server/src/sign-in.js +91 -0
- package/mcp-server/src/web-explorer.js +41 -15
- package/mcp-server/src/web-flow.js +13 -5
- package/package.json +2 -2
|
@@ -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.
|
|
4
|
+
"version": "0.34.0",
|
|
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.
|
|
27
|
+
"@aarwitz/tapp@0.34.0",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/bin/tapp.js
CHANGED
|
@@ -262,6 +262,28 @@ function repeatedFlagValues(argv, name) {
|
|
|
262
262
|
return values;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
// `--platform windows` used to be indistinguishable from `--platform wbe`: both got
|
|
266
|
+
// "must be ios|android|web", which tells someone who read runtapp.com's Windows card that they
|
|
267
|
+
// typed it wrong. They did not — tapp has no driver for it yet. Say which of the two it is.
|
|
268
|
+
const DRIVEN_PLATFORMS = ["ios", "android", "web"];
|
|
269
|
+
const DECLARED_WITHOUT_DRIVER = {
|
|
270
|
+
windows: "Windows desktop applications (WPF, WinForms, WinUI)",
|
|
271
|
+
macos: "macOS desktop applications",
|
|
272
|
+
mac: "macOS desktop applications",
|
|
273
|
+
desktop: "desktop applications",
|
|
274
|
+
};
|
|
275
|
+
function refusePlatform(platform) {
|
|
276
|
+
const described = DECLARED_WITHOUT_DRIVER[String(platform || "").toLowerCase()];
|
|
277
|
+
if (described) {
|
|
278
|
+
console.error(`❌ tapp has no driver for ${described} yet, so there is nothing to run here.`);
|
|
279
|
+
console.error(" Early runs are set up with us while the driver lands: hello@runtapp.com");
|
|
280
|
+
console.error(" Today tapp drives: web (anywhere), iOS (macOS + Xcode), Android (adb).");
|
|
281
|
+
} else {
|
|
282
|
+
console.error("❌ --platform must be ios|android|web");
|
|
283
|
+
}
|
|
284
|
+
process.exit(2);
|
|
285
|
+
}
|
|
286
|
+
|
|
265
287
|
function iosLaunchOptions(flags, argv) {
|
|
266
288
|
const appLaunchArgs = repeatedFlagValues(argv, "launch-arg");
|
|
267
289
|
let appLaunchEnv;
|
|
@@ -835,7 +857,7 @@ switch (command) {
|
|
|
835
857
|
process.exit(2);
|
|
836
858
|
}
|
|
837
859
|
}
|
|
838
|
-
if (!
|
|
860
|
+
if (!DRIVEN_PLATFORMS.includes(platform)) refusePlatform(platform);
|
|
839
861
|
const engine = await engineImport();
|
|
840
862
|
let started = null;
|
|
841
863
|
try {
|
|
@@ -997,10 +1019,7 @@ switch (command) {
|
|
|
997
1019
|
}
|
|
998
1020
|
}
|
|
999
1021
|
const platform = requestedPlatform(flags, target);
|
|
1000
|
-
if (!
|
|
1001
|
-
console.error("❌ --platform must be ios|android|web");
|
|
1002
|
-
process.exit(2);
|
|
1003
|
-
}
|
|
1022
|
+
if (!DRIVEN_PLATFORMS.includes(platform)) refusePlatform(platform);
|
|
1004
1023
|
if (platform === "ios") requireMacFor("iOS testing");
|
|
1005
1024
|
if (flags.watch === true && platform !== "web") {
|
|
1006
1025
|
console.error("❌ --watch is currently available for web exploration only");
|
|
@@ -1341,7 +1360,7 @@ switch (command) {
|
|
|
1341
1360
|
catch (error) { console.error(`❌ ${error.message}`); process.exit(2); }
|
|
1342
1361
|
const platform = typeof flags.platform === "string" ? flags.platform.toLowerCase()
|
|
1343
1362
|
: verb === "run" ? (typeof flags.url === "string" ? "web" : typeof flags["app-id"] === "string" || typeof flags.apk === "string" ? "android" : "ios") : "";
|
|
1344
|
-
if (platform && !
|
|
1363
|
+
if (platform && !DRIVEN_PLATFORMS.includes(platform)) refusePlatform(platform);
|
|
1345
1364
|
let grounding = { errors: [], warnings: [] };
|
|
1346
1365
|
let groundingMap = null;
|
|
1347
1366
|
let groundingMapPath = null;
|
|
@@ -1588,7 +1607,7 @@ switch (command) {
|
|
|
1588
1607
|
try { contract = await loadReleaseContractFile(contractPath); }
|
|
1589
1608
|
catch (error) { console.error(`❌ ${error.message}`); process.exit(2); }
|
|
1590
1609
|
const platform = String(flags.platform || (contract.platforms.length === 1 ? contract.platforms[0] : "")).toLowerCase();
|
|
1591
|
-
if (platform && !
|
|
1610
|
+
if (platform && !DRIVEN_PLATFORMS.includes(platform)) refusePlatform(platform);
|
|
1592
1611
|
let grounding = { errors: [], warnings: [] };
|
|
1593
1612
|
let groundingMap = null;
|
|
1594
1613
|
let groundingMapPath = "";
|
|
@@ -1753,7 +1772,7 @@ switch (command) {
|
|
|
1753
1772
|
}
|
|
1754
1773
|
const platform = String(flags.platform || "ios").toLowerCase();
|
|
1755
1774
|
if (!["ios", "android", "web"].includes(platform)) {
|
|
1756
|
-
|
|
1775
|
+
refusePlatform(platform);
|
|
1757
1776
|
process.exit(2);
|
|
1758
1777
|
}
|
|
1759
1778
|
const out = path.resolve(typeof flags.out === "string" ? flags.out : path.join(".tapp", "ui-map.json"));
|
package/browser/app.css
CHANGED
|
@@ -606,3 +606,28 @@ dialog::backdrop { background:rgba(0,0,0,.6); }
|
|
|
606
606
|
.signin-or::before, .signin-or::after { content:""; flex:1; height:1px; background:var(--line); }
|
|
607
607
|
.run-stats .bad strong { color:#f87171; }
|
|
608
608
|
#admin-body .actor-row { grid-template-columns: 1.5fr 1fr 1fr; }
|
|
609
|
+
|
|
610
|
+
/* Platforms — what tapp drives, and what this machine can start (ADR-0010).
|
|
611
|
+
Three states, and the "no driver yet" one must never look like a configuration problem the
|
|
612
|
+
reader could fix by installing something. */
|
|
613
|
+
.platform-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:14px 0 0; justify-content:center; }
|
|
614
|
+
.platform-chip { display:inline-flex; align-items:center; gap:7px; padding:5px 11px; border-radius:999px; font-size:12px;
|
|
615
|
+
border:1px solid var(--tapp-border); color:var(--tapp-text-soft); background:var(--tapp-panel); }
|
|
616
|
+
.platform-chip i { width:7px; height:7px; border-radius:50%; background:currentColor; flex:none; }
|
|
617
|
+
.platform-chip.ready { color:var(--tapp-green); border-color:rgba(63,185,80,.38); }
|
|
618
|
+
.platform-chip.needs-machine { color:var(--tapp-amber-soft); border-color:rgba(210,153,34,.38); }
|
|
619
|
+
.platform-chip.pilot { color:var(--tapp-text-faint); }
|
|
620
|
+
.platform-more { font-size:12px; }
|
|
621
|
+
|
|
622
|
+
#platform-list { display:grid; gap:14px; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); }
|
|
623
|
+
.platform-card .platform-summary { margin:0 0 6px; }
|
|
624
|
+
.platform-card .platform-how { margin:0 0 10px; color:var(--tapp-text-soft); font-size:13px; }
|
|
625
|
+
.platform-command { margin:0 0 10px; padding:9px 11px; border-radius:8px; background:var(--tapp-panel-2);
|
|
626
|
+
border:1px solid var(--tapp-border); overflow-x:auto; font-size:12.5px; }
|
|
627
|
+
.platform-state { font-size:11px; letter-spacing:.04em; text-transform:uppercase; padding:3px 9px; border-radius:999px;
|
|
628
|
+
border:1px solid var(--tapp-border); color:var(--tapp-text-soft); white-space:nowrap; }
|
|
629
|
+
.platform-state.ready { color:var(--tapp-green); border-color:rgba(63,185,80,.38); }
|
|
630
|
+
.platform-state.needs-machine { color:var(--tapp-amber-soft); border-color:rgba(210,153,34,.38); }
|
|
631
|
+
|
|
632
|
+
/* A suggestion this Studio cannot start is dimmed, not deleted: pressing it still answers. */
|
|
633
|
+
.prompt-suggestions [data-kind].elsewhere { opacity:.62; }
|
package/browser/app.js
CHANGED
|
@@ -79,6 +79,61 @@ function operationPayload(extra = {}) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// ——— Platforms ————————————————————————————————————————————————————————————————————————
|
|
83
|
+
// tapp drives websites, iOS simulators and Android devices, and the Studio is the same program
|
|
84
|
+
// wherever it runs. A hosted Studio on a Linux box cannot start an iOS run, which is a fact
|
|
85
|
+
// about that machine, not about the product — so say both, and give the command that fixes it.
|
|
86
|
+
// The states come from the server, computed from the machine it is on (mcp-server/src/platforms.js).
|
|
87
|
+
const PLATFORM_STATE_LABEL = { ready: "Ready here", "needs-machine": "Needs your machine", pilot: "No driver yet" };
|
|
88
|
+
|
|
89
|
+
function platformsFromSession() {
|
|
90
|
+
return Array.isArray(state.session?.platforms) ? state.session.platforms : [];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// A compact answer to "what does this thing drive?", on the first screen anyone sees.
|
|
94
|
+
function renderPlatformStrip() {
|
|
95
|
+
const strip = $("#platform-strip");
|
|
96
|
+
if (!strip) return;
|
|
97
|
+
const platforms = platformsFromSession();
|
|
98
|
+
strip.hidden = platforms.length === 0;
|
|
99
|
+
if (!platforms.length) return;
|
|
100
|
+
strip.innerHTML = `${platforms.map((platform) => `
|
|
101
|
+
<span class="platform-chip ${esc(platform.state)}" title="${esc(platform.summary)}">
|
|
102
|
+
<i></i>${esc(platform.label)}
|
|
103
|
+
</span>`).join("")}
|
|
104
|
+
<button type="button" class="quiet platform-more" data-platforms-open>What tapp can drive →</button>`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function renderPlatforms() {
|
|
108
|
+
const node = $("#platform-list");
|
|
109
|
+
if (!node) return;
|
|
110
|
+
const platforms = platformsFromSession();
|
|
111
|
+
if (!platforms.length) { node.innerHTML = `<div class="empty">Checking this machine…</div>`; return; }
|
|
112
|
+
node.innerHTML = platforms.map((platform) => `
|
|
113
|
+
<article class="panel platform-card ${esc(platform.state)}">
|
|
114
|
+
<div class="section-heading compact">
|
|
115
|
+
<div><p class="eyebrow">${esc(platform.give)}</p><h2>${esc(platform.label)}</h2></div>
|
|
116
|
+
<span class="platform-state ${esc(platform.state)}">${esc(PLATFORM_STATE_LABEL[platform.state] || platform.state)}</span>
|
|
117
|
+
</div>
|
|
118
|
+
<p class="platform-summary">${esc(platform.summary)}</p>
|
|
119
|
+
<p class="platform-how">${esc(platform.how)}</p>
|
|
120
|
+
${platform.command ? `<pre class="platform-command"><code>${esc(platform.command)}</code></pre>` : ""}
|
|
121
|
+
${platform.state === "ready" ? ""
|
|
122
|
+
: platform.state === "pilot"
|
|
123
|
+
// No driver: the ask is "we would like one", and the honest reply is a conversation.
|
|
124
|
+
? `<button type="button" class="quiet" data-platform-interest="${esc(platform.id)}">Tell us about your ${esc(platform.label.replace(/ app$/, ""))} app</button>`
|
|
125
|
+
// A driver exists; what is missing is a machine. The ask is "run it for me".
|
|
126
|
+
: `<button type="button" class="quiet" data-platform-interest="${esc(platform.id)}">I want tapp to run this for me</button>`}
|
|
127
|
+
</article>`).join("");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function registerPlatformInterest(id) {
|
|
131
|
+
try {
|
|
132
|
+
await api("/api/platforms/interest", { method:"POST", body: JSON.stringify({ platform: id }) });
|
|
133
|
+
toast("Noted. That is the signal we use to decide what to build next.");
|
|
134
|
+
} catch (error) { toast(error.message, true); }
|
|
135
|
+
}
|
|
136
|
+
|
|
82
137
|
function activateView(view) {
|
|
83
138
|
if (!customerProductContract.views.some((item) => item.id === view)) view = "overview";
|
|
84
139
|
state.activeView = view;
|
|
@@ -147,16 +202,25 @@ async function signOut() {
|
|
|
147
202
|
function applyAccessMode() {
|
|
148
203
|
const session = state.session || {};
|
|
149
204
|
renderAccount();
|
|
205
|
+
// Before the early return below: a local Studio has a platform surface too, and it is the
|
|
206
|
+
// one where most of it says "ready".
|
|
207
|
+
renderPlatformStrip();
|
|
208
|
+
renderPlatforms();
|
|
150
209
|
if (session.access !== "anonymous" && session.access !== "account") return;
|
|
151
210
|
const signedIn = session.access === "account";
|
|
152
211
|
const accepts = new Set(session.accepts || ["url"]);
|
|
212
|
+
// A target this Studio cannot START is still a thing tapp does. It used to be deleted from
|
|
213
|
+
// the screen, which is how a cross-platform product came to look like a website checker: the
|
|
214
|
+
// hosted Studio erased every mention of iOS, Android and folders. Keep them, mark them, and
|
|
215
|
+
// let the answer be "here is where that runs" (ADR-0010).
|
|
153
216
|
for (const button of document.querySelectorAll("[data-kind]")) {
|
|
154
217
|
const kind = button.dataset.kind;
|
|
155
218
|
const usable = kind === "url" ? accepts.has("url") : accepts.has(kind);
|
|
156
|
-
button.closest("li")?.classList.
|
|
219
|
+
button.closest("li")?.classList.remove("hidden");
|
|
220
|
+
button.classList.toggle("elsewhere", !usable);
|
|
157
221
|
}
|
|
158
222
|
const input = $("#prompt-input");
|
|
159
|
-
if (input) input.placeholder = "A website URL…";
|
|
223
|
+
if (input) input.placeholder = accepts.has("path") ? input.placeholder : "A website URL — or an .app, .apk or repo to be told where it runs…";
|
|
160
224
|
// Everything that only means something against a source repository: a target to build, a
|
|
161
225
|
// runner, a release gate, a decision. A hosted visitor auditing a URL has none of them, and
|
|
162
226
|
// showing the empty frames makes a working run look like a broken one.
|
|
@@ -169,8 +233,8 @@ function applyAccessMode() {
|
|
|
169
233
|
if (!state.headingOwnedByRun) setHeading("tapp", signedIn ? "Give it a website. If there is a sign-in, I will ask you for a test account and remember it." : "Give it a public website and it will audit the pages read-only.");
|
|
170
234
|
const note = $("#privacy-note-detail");
|
|
171
235
|
if (note) note.textContent = signedIn
|
|
172
|
-
? "Websites are explored in the cloud. Test accounts you give tapp are kept encrypted, used only to sign in, and never shown again. iOS, Android and folders on your own machine
|
|
173
|
-
: "Websites are audited read-only in the cloud; nothing is clicked. Sign in to go inside a site. iOS, Android and folders on your own machine
|
|
236
|
+
? "Websites are explored in the cloud. Test accounts you give tapp are kept encrypted, used only to sign in, and never shown again. iOS, Android and folders on your own machine run the same Studio there: npx -y @aarwitz/tapp@latest app"
|
|
237
|
+
: "Websites are audited read-only in the cloud; nothing is clicked. Sign in to go inside a site. iOS, Android and folders on your own machine run the same Studio there: npx -y @aarwitz/tapp@latest app";
|
|
174
238
|
$("#actors-panel")?.classList.toggle("hidden", !signedIn);
|
|
175
239
|
$("#journeys-panel")?.classList.toggle("hidden", !signedIn);
|
|
176
240
|
$("#agent-panel")?.classList.toggle("hidden", !signedIn);
|
|
@@ -271,6 +335,11 @@ function renderAdmin() {
|
|
|
271
335
|
${activity.people.length ? activity.people.map((p) => `<div class="actor-row"><span><strong>${p.kind === "account" ? "account" : "visitor"} ${esc(p.id.split(":")[1])}</strong><br><small>first seen ${esc(compactDate(p.first))} · last ${esc(compactDate(p.last))}</small></span><span><small>${esc(Object.entries(p.events).map(([k, v]) => `${k.replace(/\./g, " ")} ×${v}`).join(" · ").slice(0, 90) || "—")}</small></span><span><small>${esc(p.hosts.join(", ") || "—")}</small></span></div>`).join("") : '<div class="empty">Nobody yet. Activity is recorded from the release that introduced this log.</div>'}
|
|
272
336
|
</section>
|
|
273
337
|
|
|
338
|
+
<section class="panel section">
|
|
339
|
+
<div class="section-heading compact"><div><p class="eyebrow">Demand</p><h2>What people wanted that this Studio could not do</h2><p>“Turned away” is somebody who actually pointed tapp at a target it could not start here — the stronger signal, because they tried. “Asked for” is somebody pressing the button on the Platforms page.</p></div></div>
|
|
340
|
+
${(data.demand || []).length ? (data.demand).map((platform) => `<div class="actor-row"><span><strong>${esc(platform.label)}</strong><br><small>${esc(PLATFORM_STATE_LABEL[platform.state] || platform.state)}</small></span><span><small>${esc(String(platform.turnedAway))} turned away</small></span><span><small>${esc(String(platform.askedFor))} asked for</small></span></div>`).join("") : '<div class="empty">Nothing recorded yet.</div>'}
|
|
341
|
+
</section>
|
|
342
|
+
|
|
274
343
|
<section class="panel section">
|
|
275
344
|
<div class="section-heading compact"><div><p class="eyebrow">Accounts</p><h2>People with a tapp account <i class="zero">${data.accounts.length}</i></h2><p>Test accounts are counted, never shown — tapp cannot show them.</p></div></div>
|
|
276
345
|
${data.accounts.length ? data.accounts.map((account) => `<div class="actor-row"><span><strong>${esc(account.email)}</strong>${owner(account.email) ? ' <small class="journey-status passing">owner</small>' : ""}<br><small>joined ${esc(compactDate(account.createdAt))}${account.lastSeenAt ? ` · last seen ${esc(compactDate(account.lastSeenAt))}` : ""}</small></span><span><small>${account.journeys} journey${account.journeys === 1 ? "" : "s"}${account.failing ? ` · <b class="journey-status failing">${account.failing} failing</b>` : ""}${account.neverRun ? ` · ${account.neverRun} never run` : ""}</small></span><span><small>${account.testAccounts} test account${account.testAccounts === 1 ? "" : "s"} · ${account.tokens} token${account.tokens === 1 ? "" : "s"}</small></span></div>`).join("") : '<div class="empty">Nobody has signed in yet.</div>'}
|
|
@@ -1086,6 +1155,10 @@ async function auditWebsite(url) {
|
|
|
1086
1155
|
document.addEventListener("click", (event) => {
|
|
1087
1156
|
const viewButton = event.target.closest("[data-view]");
|
|
1088
1157
|
if (viewButton && $("#product-shell").contains(viewButton)) activateView(viewButton.dataset.view);
|
|
1158
|
+
// "What tapp can drive" is reachable from the first screen, before there is any project.
|
|
1159
|
+
if (event.target.closest("[data-platforms-open]")) { showProduct(); activateView("platforms"); renderPlatforms(); }
|
|
1160
|
+
const interest = event.target.closest("[data-platform-interest]");
|
|
1161
|
+
if (interest) registerPlatformInterest(interest.dataset.platformInterest);
|
|
1089
1162
|
const targetButton = event.target.closest("[data-target-id]");
|
|
1090
1163
|
if (targetButton) {
|
|
1091
1164
|
state.selectedTargetId = targetButton.dataset.targetId;
|
package/browser/index.html
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
<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>
|
|
57
57
|
<button class="primary prompt-go" type="submit" id="prompt-start" aria-label="Start">→</button>
|
|
58
58
|
</form>
|
|
59
|
+
<div class="platform-strip" id="platform-strip" hidden></div>
|
|
59
60
|
<ul class="prompt-suggestions" aria-label="Examples">
|
|
60
61
|
<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>
|
|
61
62
|
<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>
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
<nav class="primary-nav" aria-label="Product navigation">
|
|
90
91
|
<button data-view="overview" class="active"><span><svg><use href="#i-grid"/></svg></span>Overview</button>
|
|
91
92
|
<button data-view="runs"><span><svg><use href="#i-play"/></svg></span>Runs <i id="run-count" class="zero">0</i></button>
|
|
93
|
+
<button data-view="platforms"><span><svg><use href="#i-grid"/></svg></span>Platforms</button>
|
|
92
94
|
<button data-view="admin" id="admin-nav" class="hidden"><span><svg><use href="#i-grid"/></svg></span>Admin</button>
|
|
93
95
|
</nav>
|
|
94
96
|
<div class="sidebar-project">
|
|
@@ -166,6 +168,10 @@
|
|
|
166
168
|
</section>
|
|
167
169
|
</section>
|
|
168
170
|
|
|
171
|
+
<section class="workspace-view" data-view-panel="platforms">
|
|
172
|
+
<div class="view-heading simple"><div><p class="eyebrow">Platforms</p><h1>What tapp can drive</h1><p>tapp is one engine with a driver per platform. This page says what this Studio can start right now, and where the rest runs.</p></div></div>
|
|
173
|
+
<div id="platform-list"><div class="empty">Checking this machine…</div></div>
|
|
174
|
+
</section>
|
|
169
175
|
<section class="workspace-view" data-view-panel="admin">
|
|
170
176
|
<div class="command-bar"><div><h1>Admin</h1><p>Everything this deployment knows about itself. Never a credential — those are encrypted and are not decrypted to be looked at.</p></div></div>
|
|
171
177
|
<div id="admin-body"><div class="empty">Loading…</div></div>
|
|
@@ -6,6 +6,9 @@ export const customerProductContract = Object.freeze({
|
|
|
6
6
|
schemaVersion: 2,
|
|
7
7
|
product: "Tapp",
|
|
8
8
|
interface: "customer-browser",
|
|
9
|
+
// What tapp has a driver for. macOS and Windows desktop applications are shown in the
|
|
10
|
+
// Studio's Platforms view as having no driver yet — declared honestly, never counted here,
|
|
11
|
+
// because this list is what the engine can actually drive (ADR-0010).
|
|
9
12
|
targetPlatforms: ["ios", "android", "web"],
|
|
10
13
|
// A repository is opened by path (`tapp app /path/to/repo`); a website by URL in the Studio.
|
|
11
14
|
repositorySources: ["local-path", "github"],
|
|
@@ -15,7 +18,9 @@ export const customerProductContract = Object.freeze({
|
|
|
15
18
|
{ id: "runs", label: "Runs", capabilities: ["run-history", "run-detail", "evidence-page", "website-audit"] },
|
|
16
19
|
// Only an owner of this deployment ever sees this one (TAPP_ADMIN_EMAILS); to anybody else
|
|
17
20
|
// the nav item is absent and the route is a 404.
|
|
18
|
-
|
|
21
|
+
// Says what tapp drives, what THIS Studio can start, and what to do about the difference.
|
|
22
|
+
{ id: "platforms", label: "Platforms", capabilities: ["platform-matrix", "self-host-command", "platform-interest"] },
|
|
23
|
+
{ id: "admin", label: "Admin", capabilities: ["deployment-usage", "account-list", "platform-demand"] },
|
|
19
24
|
],
|
|
20
25
|
operations: ["initialize", "session-start", "session-act", "session-save-flow", "session-end", "gate", "audit"],
|
|
21
26
|
invariants: [
|
|
@@ -25,5 +30,6 @@ export const customerProductContract = Object.freeze({
|
|
|
25
30
|
"Repositories are opened from the machine the Studio runs on; nothing is uploaded or cloned by the Studio.",
|
|
26
31
|
"Deterministic replay and ordinary merge decisions are keyless.",
|
|
27
32
|
"The admin view reports counts about this deployment; credentials are encrypted and are never decrypted to be shown.",
|
|
33
|
+
"The Platforms view states what this machine can start, computed from the machine; a platform with no driver says so in those words and is never described as needing different hardware.",
|
|
28
34
|
],
|
|
29
35
|
});
|
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { AndroidDriver, findAndroidElement, isAndroidAppSnapshot } from "./android-driver.js";
|
|
4
4
|
import { FlowLog, flowVariables, normalizeFlowStep, substituteFlowValue } from "./flow-runtime.js";
|
|
5
|
+
import { chooseSignInSubmit } from "./sign-in.js";
|
|
5
6
|
|
|
6
7
|
const DEFAULT_TIMEOUT = 6000;
|
|
7
8
|
|
|
@@ -56,7 +57,18 @@ export async function runAndroidFlow({ flow, appId, apkPath, serial, logPath, sc
|
|
|
56
57
|
const passwordResult = await d.type(passwordField.id || passwordField.label, passwordValue, snap);
|
|
57
58
|
if (passwordResult.status !== "ok") throw new Error(passwordResult.detail || "could not fill the password field");
|
|
58
59
|
snap = await d.settle();
|
|
59
|
-
|
|
60
|
+
// Same rule as the web runner: rule out "Forgot password" and "Continue with Google" by
|
|
61
|
+
// name, prefer a sign-in name, and otherwise take the first clickable control after the
|
|
62
|
+
// password field — Android apps name that button after the product too.
|
|
63
|
+
const passwordIndex = snap.elements.indexOf(passwordField);
|
|
64
|
+
const choice = chooseSignInSubmit(snap.elements.map((element, index) => ({
|
|
65
|
+
index,
|
|
66
|
+
name: `${element.text || ""} ${element.label || ""}`.replace(/\s+/g, " ").trim() || String(element.id || ""),
|
|
67
|
+
visible: Boolean(element.clickable),
|
|
68
|
+
disabled: element.enabled === false,
|
|
69
|
+
after: index > passwordIndex,
|
|
70
|
+
})));
|
|
71
|
+
const submit = choice ? snap.elements[choice.index] : null;
|
|
60
72
|
if (!submit) throw new Error("could not identify a sign-in control");
|
|
61
73
|
const submitResult = await d.tap(submit.id || submit.description || submit.text, snap);
|
|
62
74
|
if (submitResult.status !== "ok") throw new Error(submitResult.detail || "could not submit the login form");
|
|
@@ -24,6 +24,7 @@ import { accessConfig, createAccessVerifier } from "./access-jwt.js";
|
|
|
24
24
|
import { oauthProviders, oauthAuthorizeUrl, oauthEmailFromCode, isOauthProvider } from "./oauth.js";
|
|
25
25
|
import { journeyFromCapture, JourneyStore, slugify } from "./journeys.js";
|
|
26
26
|
import { AlertStore, alertForChange, alertMessage, deliverAlert } from "./alerts.js";
|
|
27
|
+
import { platformStates, selfHostAnswer, PLATFORM_TARGETS, hostToolchain } from "./platforms.js";
|
|
27
28
|
|
|
28
29
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
29
30
|
const assetRoot = path.join(packageRoot, "browser");
|
|
@@ -134,6 +135,7 @@ const OAUTH_STATE_COOKIE = "tapp_oauth_state";
|
|
|
134
135
|
function anonymousAllows(method, pathname) {
|
|
135
136
|
if (method === "GET") {
|
|
136
137
|
if (pathname === "/" || pathname === "/admin" || pathname === "/api/version" || pathname === "/api/session" || pathname === "/api/audits") return true;
|
|
138
|
+
if (pathname === "/api/platforms") return true;
|
|
137
139
|
if (pathname.startsWith("/assets/")) return true;
|
|
138
140
|
if (/^\/api\/captures\/[A-Za-z0-9._-]{1,128}\/files$/.test(pathname)) return true;
|
|
139
141
|
if (/^\/evidence\/captures\//.test(pathname)) return true;
|
|
@@ -150,6 +152,9 @@ function anonymousAllows(method, pathname) {
|
|
|
150
152
|
// repo into the landing page, which is how five of its six examples used to dead-end.
|
|
151
153
|
// `explore` is listed so a visitor receives the honest "run this on your own machine" answer
|
|
152
154
|
// from the handler, rather than a bare 401 that reads as broken.
|
|
155
|
+
// Saying "I would use this for Android" is the one piece of demand a stranger can give us,
|
|
156
|
+
// and the reason to ask is strongest exactly when the answer was "not from here".
|
|
157
|
+
if (method === "POST" && pathname === "/api/platforms/interest") return true;
|
|
153
158
|
return method === "POST" && ["/api/operations/audit", "/api/operations/open", "/api/operations/explore-build", "/api/operations/explore"].includes(pathname);
|
|
154
159
|
}
|
|
155
160
|
|
|
@@ -461,9 +466,9 @@ function runnerSummary({ hosted = false } = {}) {
|
|
|
461
466
|
{ id:"managed-android", platform:"android", label:"Managed Android runner", status:"unavailable", remediation:"The hosted customer adapter is not yet connected to a lease-backed Android runner." },
|
|
462
467
|
{ id:"hosted-web", platform:"web", label:"Hosted Chromium", status:"needs-check", remediation:"Tapp verifies the isolated Chromium runtime when the selected web target starts." },
|
|
463
468
|
];
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const android =
|
|
469
|
+
// One probe for the whole product, so the runner list and the platform surface can never
|
|
470
|
+
// disagree about whether this machine has Xcode or adb (mcp-server/src/platforms.js).
|
|
471
|
+
const { ios, android } = hostToolchain();
|
|
467
472
|
return [
|
|
468
473
|
{ id: "local-ios", platform: "ios", label: "Local Xcode simulator", status: ios ? "available" : "unavailable", remediation: ios ? "" : "Use a macOS runner with Xcode for iOS." },
|
|
469
474
|
{ id: "local-android", platform: "android", label: "Local Android runtime", status: android ? "available" : "needs-check", remediation: android ? "Start or connect an emulator/device." : "Install Android SDK platform-tools or connect a managed Android runner." },
|
|
@@ -1194,6 +1199,17 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
1194
1199
|
},
|
|
1195
1200
|
recentRuns: runs.slice(0, 40),
|
|
1196
1201
|
totalRuns: runs.length,
|
|
1202
|
+
// What people wanted that this deployment could not do. "Asked for" is someone
|
|
1203
|
+
// pressing "tell me when tapp can run this"; "turned away" is someone who actually
|
|
1204
|
+
// pointed tapp at a target it could not start here. The second is the stronger
|
|
1205
|
+
// signal, because they tried.
|
|
1206
|
+
demand: PLATFORM_TARGETS.map((target) => ({
|
|
1207
|
+
id: target.id,
|
|
1208
|
+
label: target.label,
|
|
1209
|
+
state: platformStates({ hosted }).find((entry) => entry.id === target.id)?.state || "unknown",
|
|
1210
|
+
askedFor: events.filter((entry) => entry.event === "platform.asked" && entry.platform === target.id).length,
|
|
1211
|
+
turnedAway: events.filter((entry) => entry.event === "self-host.answered" && entry.platform === target.id).length,
|
|
1212
|
+
})),
|
|
1197
1213
|
});
|
|
1198
1214
|
return;
|
|
1199
1215
|
}
|
|
@@ -1246,6 +1262,28 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
1246
1262
|
json(response, 200, { ok: accounts.revokeToken(account.id, revokeTokenMatch[1]) });
|
|
1247
1263
|
return;
|
|
1248
1264
|
}
|
|
1265
|
+
// What tapp drives, and what this particular Studio can start. Public, because the honest
|
|
1266
|
+
// answer to "does this do iOS?" is yes-but-not-from-here, and a visitor who cannot see
|
|
1267
|
+
// that concludes tapp is a website checker (ADR-0010).
|
|
1268
|
+
if (request.method === "GET" && url.pathname === "/api/platforms") {
|
|
1269
|
+
json(response, 200, { hosted, platforms: platformStates({ hosted }) });
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
// "I would use this for Android." The only demand signal a stranger can give us, and it
|
|
1273
|
+
// matters most at the moment the answer was "not from here". No contact details are taken:
|
|
1274
|
+
// this is a counter, not a lead form, and the usage journal keeps no handle.
|
|
1275
|
+
if (request.method === "POST" && url.pathname === "/api/platforms/interest") {
|
|
1276
|
+
guardMutation(request);
|
|
1277
|
+
const asked = await readJsonBody(request);
|
|
1278
|
+
const wanted = String(asked?.platform || "");
|
|
1279
|
+
if (!PLATFORM_TARGETS.some((target) => target.id === wanted)) {
|
|
1280
|
+
json(response, 400, { error: `Unknown platform '${wanted}'` });
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
logUsage("platform.asked", { platform: wanted, ...(account ? { account: account.id.slice(0, 8) } : { visitor: String(visitorId || "").slice(0, 8) }) });
|
|
1284
|
+
json(response, 200, { ok: true, platform: wanted });
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1249
1287
|
if (request.method === "GET" && url.pathname === "/api/session") {
|
|
1250
1288
|
if (account) {
|
|
1251
1289
|
json(response, 200, {
|
|
@@ -1254,6 +1292,10 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
1254
1292
|
access: "account", email: account.email, signInProvider, signInOptions, viaToken, admin: isAdmin(account),
|
|
1255
1293
|
accepts: ["url"],
|
|
1256
1294
|
selfHostOnly: ["path", "github", "bundle", "app", "apk"],
|
|
1295
|
+
// What tapp drives, and what THIS machine can start. The Studio shows all of it:
|
|
1296
|
+
// hiding iOS and Android is what made a cross-platform product look like a website
|
|
1297
|
+
// checker (ADR-0010).
|
|
1298
|
+
platforms: platformStates({ hosted: true }),
|
|
1257
1299
|
});
|
|
1258
1300
|
return;
|
|
1259
1301
|
}
|
|
@@ -1262,15 +1304,18 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
1262
1304
|
csrfToken, mode: "public", product: "Tapp", root: null, repository: null, repositories: [],
|
|
1263
1305
|
contract: customerProductContract, supportedPlatforms: ["web"], runners: [],
|
|
1264
1306
|
access: "anonymous", signInProvider, signInOptions,
|
|
1265
|
-
// The prompt screen offers folders, bundle ids and builds. None of them can
|
|
1266
|
-
// a hosted Studio — there is no Mac, no simulator and no access to the
|
|
1267
|
-
// disk
|
|
1307
|
+
// The prompt screen offers folders, bundle ids and builds. None of them can be
|
|
1308
|
+
// STARTED in a hosted Studio — there is no Mac, no simulator and no access to the
|
|
1309
|
+
// visitor's disk. `accepts` says what can start here; `platforms` says what tapp
|
|
1310
|
+
// drives and where, because a visitor deserves to know the product does phones
|
|
1311
|
+
// even when this deployment cannot (ADR-0010).
|
|
1268
1312
|
accepts: ["url"],
|
|
1269
1313
|
selfHostOnly: ["path", "github", "bundle", "app", "apk"],
|
|
1314
|
+
platforms: platformStates({ hosted: true }),
|
|
1270
1315
|
});
|
|
1271
1316
|
return;
|
|
1272
1317
|
}
|
|
1273
|
-
json(response, 200, { csrfToken, mode: hosted ? "managed" : "local", product: "Tapp", root: hosted ? null : registry.currentRoot(), repository: hosted ? hostedRepository(registry.current()) : registry.current(), repositories: hosted ? registry.list().map(hostedRepository) : registry.list(), contract: customerProductContract, supportedPlatforms: customerProductContract.targetPlatforms, runners: runnerSummary({ hosted }) });
|
|
1318
|
+
json(response, 200, { csrfToken, mode: hosted ? "managed" : "local", product: "Tapp", root: hosted ? null : registry.currentRoot(), repository: hosted ? hostedRepository(registry.current()) : registry.current(), repositories: hosted ? registry.list().map(hostedRepository) : registry.list(), contract: customerProductContract, supportedPlatforms: customerProductContract.targetPlatforms, runners: runnerSummary({ hosted }), platforms: platformStates({ hosted }) });
|
|
1274
1319
|
return;
|
|
1275
1320
|
}
|
|
1276
1321
|
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; }
|
|
@@ -1413,13 +1458,21 @@ export async function startBrowserProduct({ projectDir, port = 0, launch = false
|
|
|
1413
1458
|
if (operation === "explore-build") {
|
|
1414
1459
|
if (anonymous) {
|
|
1415
1460
|
const asked = classifyPrompt(body.input);
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
json(response, 200,
|
|
1419
|
-
|
|
1461
|
+
const wanted = asked.kind === "apk" ? "android" : "ios";
|
|
1462
|
+
logUsage("self-host.answered", { visitor: visitorId.slice(0, 8), kind: asked.kind, platform: wanted });
|
|
1463
|
+
json(response, 200, selfHostAnswer(wanted, asked.value, { hosted: true }));
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
if (hosted) {
|
|
1467
|
+
// A signed-in account used to get a bare 400 here, which reads as "tapp is broken"
|
|
1468
|
+
// rather than "tapp does this, just not on a machine without a simulator". Give the
|
|
1469
|
+
// same structured answer a visitor gets: where it runs, and the command to get there.
|
|
1470
|
+
const asked = classifyPrompt(body.input);
|
|
1471
|
+
const wanted = asked.kind === "apk" ? "android" : "ios";
|
|
1472
|
+
logUsage("self-host.answered", { account: account?.id?.slice(0, 8), kind: asked.kind, platform: wanted });
|
|
1473
|
+
json(response, 200, selfHostAnswer(wanted, asked.value, { hosted: true }));
|
|
1420
1474
|
return;
|
|
1421
1475
|
}
|
|
1422
|
-
if (hosted) throw Object.assign(new Error("Builds are explored on the machine that has the simulator; run the Studio locally"), { statusCode: 400 });
|
|
1423
1476
|
const prompt = classifyPrompt(body.input);
|
|
1424
1477
|
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 });
|
|
1425
1478
|
const job = startJob(operation, async (progress) => {
|
package/mcp-server/src/index.js
CHANGED
|
@@ -30,6 +30,7 @@ const workspaceRoot = (() => {
|
|
|
30
30
|
})();
|
|
31
31
|
const scriptsDir = path.join(repoRoot, "scripts");
|
|
32
32
|
import { writeCaptureProvenance, readCaptureProvenance, captureBelongsToProject, provenanceLabel } from "./capture-provenance.js";
|
|
33
|
+
import { findSignInSubmit } from "./sign-in.js";
|
|
33
34
|
// TAPP_HOME (set by the `tapp` CLI when installed) redirects writable output to a user directory.
|
|
34
35
|
// The old alias remains a read-only fallback; unset repository development stays local.
|
|
35
36
|
const tappHome = (process.env.TAPP_HOME || "").trim();
|
|
@@ -1145,10 +1146,10 @@ async function sessionAct(cmd) {
|
|
|
1145
1146
|
} else {
|
|
1146
1147
|
await email.fill(emailValue);
|
|
1147
1148
|
await password.fill(passwordValue);
|
|
1148
|
-
const submit = session.page
|
|
1149
|
-
if (!
|
|
1149
|
+
const submit = await findSignInSubmit(session.page);
|
|
1150
|
+
if (!submit) { status = "not_found"; detail = "Could not identify a sign-in control"; }
|
|
1150
1151
|
else {
|
|
1151
|
-
await submit.click();
|
|
1152
|
+
await submit.locator.click();
|
|
1152
1153
|
await session.page.waitForTimeout(500);
|
|
1153
1154
|
if (await password.isVisible().catch(() => false)) { status = "still_on_login"; detail = "Submit left the app on the login screen"; }
|
|
1154
1155
|
}
|
|
@@ -3205,7 +3206,11 @@ async function handleTool(name, args = {}) {
|
|
|
3205
3206
|
: { code: 1, stdout: "", stderr: "Xcode not found" };
|
|
3206
3207
|
const bootedLine = (simctl.stdout || "").split("\n").find((l) => /\(Booted\)/.test(l));
|
|
3207
3208
|
const bootedName = bootedLine ? bootedLine.trim().replace(/\s*\(.*$/, "") : null;
|
|
3208
|
-
|
|
3209
|
+
// The SDK is commonly an unlinked Homebrew cask with ANDROID_HOME unset, so a bare `adb`
|
|
3210
|
+
// reports "not found" on machines where `tapp explore --platform android` works. Use the
|
|
3211
|
+
// driver's own resolver, which is what the run will use (resolveAdbPath).
|
|
3212
|
+
const { resolveAdbPath } = await import("./android-driver.js");
|
|
3213
|
+
const adb = await runCommand(resolveAdbPath() || "adb", ["devices"]);
|
|
3209
3214
|
const androidDevice = adb.code === 0
|
|
3210
3215
|
? (adb.stdout || "").split("\n").find((line) => /\tdevice\s*$/.test(line))
|
|
3211
3216
|
: null;
|
|
@@ -35,7 +35,13 @@ function readMarkers(captureDir) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// tapp names a revisited screen "Orders (refreshed)"; the page itself still says "Orders".
|
|
38
|
-
|
|
38
|
+
// A screen name is one line. A headline that wraps in the page's source arrives with its
|
|
39
|
+
// newlines and indentation attached, and a journey step that pins that string can never match
|
|
40
|
+
// again — the browser reports the heading with its whitespace collapsed.
|
|
41
|
+
/** A route, not something a person pressed: "/", "/orders", "https://…", "#pricing". */
|
|
42
|
+
const isAddress = (via) => /^([/#]|https?:)/i.test(String(via || "").trim());
|
|
43
|
+
|
|
44
|
+
const pageName = (screen) => String(screen || "").replace(/\s*\((?:refreshed|again|\d+)\)\s*$/i, "").replace(/\s+/g, " ").trim();
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* Build a Flow from an exploration capture. Returns null when the run did nothing worth
|
|
@@ -59,13 +65,19 @@ export function journeyFromCapture(captureDir, { name = "", actor = "default" }
|
|
|
59
65
|
};
|
|
60
66
|
let acted = false;
|
|
61
67
|
let signedIn = false;
|
|
62
|
-
|
|
68
|
+
let stop = false;
|
|
69
|
+
for (let i = 0; i < markers.length && steps.length < MAX_STEPS && !stop; i += 1) {
|
|
63
70
|
const marker = markers[i];
|
|
64
71
|
if (marker.kind === "OCQA_STATE") { waitFor(marker.screen); continue; }
|
|
65
72
|
switch (marker.type) {
|
|
66
73
|
case "open":
|
|
67
|
-
// The first open is the journey's URL
|
|
68
|
-
|
|
74
|
+
// The first open is the journey's URL. A later one is either a link somebody pressed —
|
|
75
|
+
// which a person can repeat — or the crawler jumping to a route by address, which nobody
|
|
76
|
+
// can. A journey is the path a user could walk, so it ends at the first jump rather than
|
|
77
|
+
// pretending the previous tap led there. (Found by filming: a kept journey had "tap Area"
|
|
78
|
+
// followed by the marketing home page, and the replay rightly refused to believe it.)
|
|
79
|
+
if (!marker.via || marker.via === marker.target || isAddress(marker.via)) { if (acted) stop = true; break; }
|
|
80
|
+
steps.push({ tap: marker.via }); acted = true;
|
|
69
81
|
break;
|
|
70
82
|
case "login":
|
|
71
83
|
steps.push({ login: { email: "$TEST_EMAIL", password: "$TEST_PASSWORD" } });
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Every surface tapp aims at, and whether THIS Studio can drive it.
|
|
2
|
+
//
|
|
3
|
+
// tapp is not a web tool. The engine drives websites, iOS simulators and Android devices, and the
|
|
4
|
+
// Studio in `browser/` is the same program wherever it runs — on a laptop it can start an iOS run,
|
|
5
|
+
// and on a Linux box in a data centre it cannot, because there is no Mac attached to it.
|
|
6
|
+
//
|
|
7
|
+
// The product used to leave that implicit: the hosted Studio answered an .app with a bare 400,
|
|
8
|
+
// and nothing anywhere said that tapp drives phones at all. Someone arriving at app.runtapp.com
|
|
9
|
+
// reasonably concluded it was a website checker.
|
|
10
|
+
//
|
|
11
|
+
// So this module is the one place that answers, for a given host: what can tapp drive, what does
|
|
12
|
+
// each one need, and what should this person do next. Every state below is computed from the
|
|
13
|
+
// machine the Studio is on — never declared — and a platform with no driver says so in those
|
|
14
|
+
// words. Nothing here may describe a capability that does not exist.
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
|
|
18
|
+
import { resolveAdbPath } from "./android-driver.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The states a platform can be in, worst-named-first so nobody mistakes one for another:
|
|
22
|
+
*
|
|
23
|
+
* ready — this Studio can start a run now.
|
|
24
|
+
* needs-machine — tapp drives it, but not from this host. There is an exact command for the
|
|
25
|
+
* machine that can, because self-hosting is the same product, not a lesser one.
|
|
26
|
+
* pilot — tapp does NOT drive it yet. No driver exists. Early work is done with a
|
|
27
|
+
* person while the driver lands (owner decision, 2026-09-14, for Windows).
|
|
28
|
+
*/
|
|
29
|
+
export const PLATFORM_STATES = Object.freeze(["ready", "needs-machine", "pilot"]);
|
|
30
|
+
|
|
31
|
+
/** What tapp aims at, in the order a person should see them. */
|
|
32
|
+
export const PLATFORM_TARGETS = Object.freeze([
|
|
33
|
+
{
|
|
34
|
+
id: "web", label: "Web", give: "A website URL",
|
|
35
|
+
driver: "playwright", needs: "Playwright and Chromium, which tapp installs",
|
|
36
|
+
machine: "any machine",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "ios", label: "iOS", give: "A simulator .app or a bundle id",
|
|
40
|
+
driver: "xcuitest", needs: "macOS with Xcode",
|
|
41
|
+
machine: "a Mac with Xcode",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "android", label: "Android", give: "An .apk or a connected device",
|
|
45
|
+
driver: "adb", needs: "the Android SDK and adb",
|
|
46
|
+
machine: "a machine with the Android SDK",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "macos", label: "macOS app", give: "A .app on your Mac",
|
|
50
|
+
driver: null, needs: "macOS",
|
|
51
|
+
machine: "a Mac",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "windows", label: "Windows app", give: "A WPF, WinForms or WinUI app",
|
|
55
|
+
driver: null, needs: "Windows",
|
|
56
|
+
machine: "a Windows machine",
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
// "A simulator .app" mid-sentence, without lowercasing the file extension or the brand.
|
|
61
|
+
const lower = (text) => String(text).replace(/^(An?|The) /, (word) => word.toLowerCase());
|
|
62
|
+
|
|
63
|
+
const onPath = (name, env) => String(env.PATH || "").split(path.delimiter).some((dir) => dir && fs.existsSync(path.join(dir, name)));
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* What this machine actually has. The same checks `runnerSummary` used, in one place, so the
|
|
67
|
+
* Studio and the runner list can never disagree about whether Xcode is installed.
|
|
68
|
+
*/
|
|
69
|
+
export function hostToolchain({ env = process.env, platform = process.platform } = {}) {
|
|
70
|
+
return {
|
|
71
|
+
ios: platform === "darwin" && (fs.existsSync("/usr/bin/xcodebuild") || onPath("xcodebuild", env)),
|
|
72
|
+
// The driver's own resolver, not a PATH guess: the SDK is commonly an unlinked Homebrew
|
|
73
|
+
// cask with ANDROID_HOME unset, and the Studio must not say "no Android" about a machine
|
|
74
|
+
// where `tapp explore` would happily find adb.
|
|
75
|
+
android: platform === "linux" || platform === "darwin" || platform === "win32" ? Boolean(resolveAdbPath(env)) : false,
|
|
76
|
+
// Chromium is fetched on demand, so web is reachable from any host; whether this particular
|
|
77
|
+
// one has it unpacked is checked when the run starts, which is where the error belongs.
|
|
78
|
+
web: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The command that opens this same Studio on a machine that can do the work. */
|
|
83
|
+
export const SELF_HOST_COMMAND = "npx -y @aarwitz/tapp@latest app";
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The honest state of every platform for one host.
|
|
87
|
+
*
|
|
88
|
+
* @param {object} options
|
|
89
|
+
* @param {boolean} options.hosted true for app.runtapp.com, false for `tapp app` on a laptop
|
|
90
|
+
*/
|
|
91
|
+
export function platformStates({ hosted = false, env = process.env, platform = process.platform, toolchain = null } = {}) {
|
|
92
|
+
const has = toolchain || hostToolchain({ env, platform });
|
|
93
|
+
return PLATFORM_TARGETS.map((target) => {
|
|
94
|
+
// No driver is no driver, on any host. This must never read as "you need a different machine",
|
|
95
|
+
// because buying the machine would not help.
|
|
96
|
+
if (!target.driver) {
|
|
97
|
+
return {
|
|
98
|
+
...target,
|
|
99
|
+
state: "pilot",
|
|
100
|
+
summary: `tapp has no ${target.label} driver yet.`,
|
|
101
|
+
how: `Early ${target.label} work is done with us while the driver lands. Tell us about yours and we will run it with you.`,
|
|
102
|
+
command: "",
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// A public Studio starts website runs and nothing else, whatever the machine under it
|
|
106
|
+
// happens to own (ADR-0008). Saying "ready" because this particular host has Xcode would
|
|
107
|
+
// promise a run the server then refuses — so the deployment has a say, not just the disk.
|
|
108
|
+
const exposed = hosted ? target.id === "web" : true;
|
|
109
|
+
if (has[target.id] && exposed) {
|
|
110
|
+
return {
|
|
111
|
+
...target,
|
|
112
|
+
state: "ready", because: "",
|
|
113
|
+
summary: hosted ? `Ready here. ${target.give}.` : `Ready on this machine. ${target.give}.`,
|
|
114
|
+
how: `Paste ${lower(target.give)} in the box above.`,
|
|
115
|
+
command: "",
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const because = has[target.id] && !exposed ? "not-exposed" : "no-toolchain";
|
|
119
|
+
return {
|
|
120
|
+
...target,
|
|
121
|
+
state: "needs-machine", because,
|
|
122
|
+
summary: because === "not-exposed"
|
|
123
|
+
? `tapp drives ${target.label}, and this machine could — but a public Studio only starts website runs.`
|
|
124
|
+
: `tapp drives ${target.label}, but this Studio is not on ${target.machine}.`,
|
|
125
|
+
// Self-host is the same product without the hosting, so the answer is a command, not an
|
|
126
|
+
// apology (ADR-0006).
|
|
127
|
+
how: `Run this Studio on ${target.machine} and give it ${lower(target.give)} there:`,
|
|
128
|
+
command: SELF_HOST_COMMAND,
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** One platform's state, by id. */
|
|
134
|
+
export function platformState(id, options = {}) {
|
|
135
|
+
return platformStates(options).find((entry) => entry.id === String(id)) || null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The platforms this Studio can start a run on right now. */
|
|
139
|
+
export function readyPlatforms(options = {}) {
|
|
140
|
+
return platformStates(options).filter((entry) => entry.state === "ready").map((entry) => entry.id);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The answer to "I gave you an .app and you are a Linux box": where it runs, and how to get there.
|
|
145
|
+
* Shaped like every other self-host answer the Studio already knows how to show.
|
|
146
|
+
*/
|
|
147
|
+
export function selfHostAnswer(platformId, target = "", options = {}) {
|
|
148
|
+
const entry = platformState(platformId, options);
|
|
149
|
+
if (!entry) return null;
|
|
150
|
+
const what = target ? `“${target}”` : `a ${entry.label} target`;
|
|
151
|
+
if (entry.state === "pilot") {
|
|
152
|
+
return { kind: "self-host", platform: entry.id, state: entry.state, target,
|
|
153
|
+
message: `${what} is a ${entry.label} target, and tapp has no ${entry.label} driver yet. ${entry.how}`, command: "" };
|
|
154
|
+
}
|
|
155
|
+
return { kind: "self-host", platform: entry.id, state: entry.state, target,
|
|
156
|
+
message: `Running ${what} needs ${entry.machine}, which this Studio is not on. Start the Studio there: ${SELF_HOST_COMMAND}`,
|
|
157
|
+
command: SELF_HOST_COMMAND };
|
|
158
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Pressing the button that signs you in.
|
|
2
|
+
//
|
|
3
|
+
// This used to be a word list — `sign in|log in|login|continue|submit` — in three separate
|
|
4
|
+
// places, and a CSS selector that looked for `button[type=submit]` or a button inside a `<form>`.
|
|
5
|
+
// Measured against a real customer's sign-in page, every one of those assumptions was wrong:
|
|
6
|
+
//
|
|
7
|
+
// • the page has no <form> at all (a React component with an onClick handler);
|
|
8
|
+
// • the buttons carry no `type` ATTRIBUTE, so `button[type=submit]` never matches, even though
|
|
9
|
+
// the DOM *property* reads "submit" — which is what made this look fine when probed by hand;
|
|
10
|
+
// • the button is called "Open My Profile", because products name their buttons after what the
|
|
11
|
+
// product does, not after the verb a test author had in mind.
|
|
12
|
+
//
|
|
13
|
+
// So the page offered a perfectly ordinary sign-in form and tapp could not press it. It said so
|
|
14
|
+
// honestly — a high-severity "the sign-in attempt did not leave the login form" — but honest and
|
|
15
|
+
// useless is still useless: the whole promise is that tapp gets *inside* the application.
|
|
16
|
+
//
|
|
17
|
+
// What is actually reliable is not the button's name but its position: the control that signs you
|
|
18
|
+
// in comes after the password field, and the controls that must never be pressed (forgot password,
|
|
19
|
+
// create an account, continue with Google) say so in their own words. So: rule out the dangerous
|
|
20
|
+
// ones by name, then prefer by name, then fall back to position.
|
|
21
|
+
|
|
22
|
+
/** Names that mean "this is the sign-in button". Deliberately short — structure does the rest. */
|
|
23
|
+
export const SIGN_IN_NAME = /\b(sign ?in|log ?in|login|submit|continue)\b/i;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Names that mean "never press this to sign in". Some are merely wrong (forgot password); some
|
|
27
|
+
* are actively harmful — "Continue with Google" would hand a third-party identity provider a
|
|
28
|
+
* session, which a machine must never do on someone's behalf.
|
|
29
|
+
*/
|
|
30
|
+
export const NOT_SIGN_IN = /forgot|reset|recover|remember|show password|hide password|cancel|go back|back to|sign ?up|create (an |your |a )?account|register|get started free|privacy|terms|need help|help\?|continue with|with google|with apple|with facebook|with github|with microsoft|single sign|\bsso\b|close|dismiss|skip/i;
|
|
31
|
+
|
|
32
|
+
/** Every control that can plausibly be clicked, in document order. */
|
|
33
|
+
export const SUBMIT_CANDIDATE_SELECTOR = "button, input[type=submit], input[type=button], input[type=image], [role=button]";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Pick the sign-in control out of the page's clickable controls. Pure, so the ordering rules are
|
|
37
|
+
* testable without a browser.
|
|
38
|
+
*
|
|
39
|
+
* @param {Array<{index:number,name:string,visible:boolean,disabled:boolean,after:boolean}>} candidates
|
|
40
|
+
* `after` means the control follows the visible password field in document order.
|
|
41
|
+
*/
|
|
42
|
+
export function chooseSignInSubmit(candidates = []) {
|
|
43
|
+
const usable = candidates.filter((c) => c && c.visible && !c.disabled && String(c.name || "").trim() && !NOT_SIGN_IN.test(c.name));
|
|
44
|
+
const pick = usable.find((c) => c.after && SIGN_IN_NAME.test(c.name))
|
|
45
|
+
|| usable.find((c) => SIGN_IN_NAME.test(c.name))
|
|
46
|
+
// Named for what the product does, not for the verb: position is what is left to go on.
|
|
47
|
+
|| usable.find((c) => c.after)
|
|
48
|
+
|| usable[0]
|
|
49
|
+
|| null;
|
|
50
|
+
if (!pick) return null;
|
|
51
|
+
return { ...pick, reason: SIGN_IN_NAME.test(pick.name) ? "name" : "position" };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Read the page's clickable controls and say which one signs you in. */
|
|
55
|
+
export async function findSignInSubmit(page) {
|
|
56
|
+
let candidates;
|
|
57
|
+
try {
|
|
58
|
+
candidates = await page.evaluate((selector) => {
|
|
59
|
+
const visible = (el) => {
|
|
60
|
+
if (!el.getClientRects().length) return false;
|
|
61
|
+
const style = getComputedStyle(el);
|
|
62
|
+
return style.visibility !== "hidden" && style.display !== "none" && Number(style.opacity ?? 1) > 0.05;
|
|
63
|
+
};
|
|
64
|
+
const password = Array.from(document.querySelectorAll("input[type=password]")).find(visible) || null;
|
|
65
|
+
return Array.from(document.querySelectorAll(selector)).map((el, index) => ({
|
|
66
|
+
index,
|
|
67
|
+
name: (el.innerText || el.value || el.getAttribute("aria-label") || el.getAttribute("title") || "").replace(/\s+/g, " ").trim().slice(0, 80),
|
|
68
|
+
visible: visible(el),
|
|
69
|
+
disabled: el.disabled === true || el.getAttribute("aria-disabled") === "true",
|
|
70
|
+
// DOCUMENT_POSITION_FOLLOWING (4): the control comes after the password field.
|
|
71
|
+
after: password ? Boolean(password.compareDocumentPosition(el) & 4) : false,
|
|
72
|
+
}));
|
|
73
|
+
}, SUBMIT_CANDIDATE_SELECTOR);
|
|
74
|
+
} catch { return null; }
|
|
75
|
+
const pick = chooseSignInSubmit(candidates);
|
|
76
|
+
if (!pick) return null;
|
|
77
|
+
// querySelectorAll and Playwright's locator both resolve in document order, so the index carries.
|
|
78
|
+
return { locator: page.locator(SUBMIT_CANDIDATE_SELECTOR).nth(pick.index), name: pick.name, reason: pick.reason };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Fill nothing, press once. Returns what was pressed so a caller can say so in a report, or null
|
|
83
|
+
* when the page offers no sign-in control at all.
|
|
84
|
+
*/
|
|
85
|
+
export async function submitSignIn(page, beforeClick = null) {
|
|
86
|
+
const found = await findSignInSubmit(page);
|
|
87
|
+
if (!found) return null;
|
|
88
|
+
if (beforeClick) await beforeClick(found.locator);
|
|
89
|
+
await found.locator.click({ timeout: 3000 });
|
|
90
|
+
return { name: found.name, reason: found.reason };
|
|
91
|
+
}
|
|
@@ -19,6 +19,7 @@ import fs from "fs";
|
|
|
19
19
|
import path from "path";
|
|
20
20
|
import { createRequire } from "module";
|
|
21
21
|
import { execFileSync } from "child_process";
|
|
22
|
+
import { submitSignIn } from "./sign-in.js";
|
|
22
23
|
|
|
23
24
|
const CLICK_SETTLE_MS = 700;
|
|
24
25
|
export const NAV_TIMEOUT_MS = 15_000;
|
|
@@ -194,7 +195,18 @@ async function captureWebControlState(page, locator) {
|
|
|
194
195
|
.sort();
|
|
195
196
|
return {
|
|
196
197
|
title: document.title,
|
|
197
|
-
heading:
|
|
198
|
+
heading: (() => {
|
|
199
|
+
// The same definition the flow runner uses when it checks a screen: the first h1 a
|
|
200
|
+
// person can actually see. A sign-in headline left hidden in the DOM used to go on
|
|
201
|
+
// naming every later screen, and the replay could never agree.
|
|
202
|
+
const shown = (el) => {
|
|
203
|
+
if (!el.getClientRects().length) return false;
|
|
204
|
+
const style = getComputedStyle(el);
|
|
205
|
+
return style.visibility !== "hidden" && style.display !== "none";
|
|
206
|
+
};
|
|
207
|
+
const h1 = Array.from(document.querySelectorAll("h1")).find(shown);
|
|
208
|
+
return (h1 ? h1.innerText || h1.textContent || "" : "").replace(/\s+/g, " ").trim();
|
|
209
|
+
})(),
|
|
198
210
|
dialogs: JSON.stringify(dialogs),
|
|
199
211
|
};
|
|
200
212
|
}).catch(() => ({ title: "", heading: "", dialogs: "" }));
|
|
@@ -333,18 +345,10 @@ export async function loadPlaywright() {
|
|
|
333
345
|
}
|
|
334
346
|
|
|
335
347
|
export async function submitWebLogin(page, beforeClick = null) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
for (const candidate of candidates) {
|
|
341
|
-
if (await candidate.isVisible().catch(() => false)) {
|
|
342
|
-
if (beforeClick) await beforeClick(candidate);
|
|
343
|
-
await candidate.click({ timeout: 3000 });
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return false;
|
|
348
|
+
// One implementation, shared with the flow runner and the MCP login command, so a page that can
|
|
349
|
+
// be signed into by one of them can be signed into by all three. See mcp-server/src/sign-in.js
|
|
350
|
+
// for why a name-only rule was not enough.
|
|
351
|
+
return Boolean(await submitSignIn(page, beforeClick).catch(() => null));
|
|
348
352
|
}
|
|
349
353
|
|
|
350
354
|
// How many distinct in-page states one URL may contribute before we stop splitting it. A
|
|
@@ -751,7 +755,18 @@ export async function inspectWebPage({ url, timeoutMs = NAV_TIMEOUT_MS, screensh
|
|
|
751
755
|
})
|
|
752
756
|
.filter((control) => control.label || control.identifier);
|
|
753
757
|
return {
|
|
754
|
-
heading:
|
|
758
|
+
heading: (() => {
|
|
759
|
+
// The same definition the flow runner uses when it checks a screen: the first h1 a
|
|
760
|
+
// person can actually see. A sign-in headline left hidden in the DOM used to go on
|
|
761
|
+
// naming every later screen, and the replay could never agree.
|
|
762
|
+
const shown = (el) => {
|
|
763
|
+
if (!el.getClientRects().length) return false;
|
|
764
|
+
const style = getComputedStyle(el);
|
|
765
|
+
return style.visibility !== "hidden" && style.display !== "none";
|
|
766
|
+
};
|
|
767
|
+
const h1 = Array.from(document.querySelectorAll("h1")).find(shown);
|
|
768
|
+
return (h1 ? h1.innerText || h1.textContent || "" : "").replace(/\s+/g, " ").trim();
|
|
769
|
+
})(),
|
|
755
770
|
title: document.title.trim(),
|
|
756
771
|
controls,
|
|
757
772
|
};
|
|
@@ -986,7 +1001,18 @@ export async function exploreWeb({ url, maxActions = 40, timeoutSec = 300, outDi
|
|
|
986
1001
|
})
|
|
987
1002
|
.filter((control) => control.label || control.id || control.testId);
|
|
988
1003
|
return {
|
|
989
|
-
heading:
|
|
1004
|
+
heading: (() => {
|
|
1005
|
+
// The same definition the flow runner uses when it checks a screen: the first h1 a
|
|
1006
|
+
// person can actually see. A sign-in headline left hidden in the DOM used to go on
|
|
1007
|
+
// naming every later screen, and the replay could never agree.
|
|
1008
|
+
const shown = (el) => {
|
|
1009
|
+
if (!el.getClientRects().length) return false;
|
|
1010
|
+
const style = getComputedStyle(el);
|
|
1011
|
+
return style.visibility !== "hidden" && style.display !== "none";
|
|
1012
|
+
};
|
|
1013
|
+
const h1 = Array.from(document.querySelectorAll("h1")).find(shown);
|
|
1014
|
+
return (h1 ? h1.innerText || h1.textContent || "" : "").replace(/\s+/g, " ").trim();
|
|
1015
|
+
})(),
|
|
990
1016
|
title: document.title.trim(),
|
|
991
1017
|
controlCount: document.querySelectorAll("a[href], button, [role=button], input, select, textarea").length,
|
|
992
1018
|
textLen: (document.body?.innerText || "").trim().length,
|
|
@@ -4,6 +4,7 @@ import fs from "node:fs";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { FlowLog, flowVariables, normalizeFlowStep, substituteFlowValue } from "./flow-runtime.js";
|
|
6
6
|
import { loadPlaywright, webContextOptions } from "./web-explorer.js";
|
|
7
|
+
import { findSignInSubmit } from "./sign-in.js";
|
|
7
8
|
|
|
8
9
|
const DEFAULT_TIMEOUT = 6000;
|
|
9
10
|
|
|
@@ -91,12 +92,19 @@ async function screenCandidates(page) {
|
|
|
91
92
|
const url = new URL(page.url());
|
|
92
93
|
values.push(url.pathname, url.pathname.split("/").filter(Boolean).at(-1) || "Home");
|
|
93
94
|
} catch {}
|
|
94
|
-
return values.map(
|
|
95
|
+
return values.map(normalizeScreenName).filter(Boolean);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Compare screen names with their whitespace collapsed on both sides: a journey kept before
|
|
99
|
+
// tapp normalized headings holds "Find the right coach.\n Any goal." where the browser
|
|
100
|
+
// now reports "Find the right coach. Any goal." Those are the same screen.
|
|
101
|
+
export function normalizeScreenName(value) {
|
|
102
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
async function waitForScreen(page, target, timeout) {
|
|
98
106
|
const deadline = Date.now() + timeout;
|
|
99
|
-
const wanted = target.toLowerCase();
|
|
107
|
+
const wanted = normalizeScreenName(target).toLowerCase();
|
|
100
108
|
while (Date.now() < deadline) {
|
|
101
109
|
if ((await screenCandidates(page)).some((v) => v.toLowerCase() === wanted)) return true;
|
|
102
110
|
const el = await locateWebElement(page, target);
|
|
@@ -108,7 +116,7 @@ async function waitForScreen(page, target, timeout) {
|
|
|
108
116
|
|
|
109
117
|
async function waitForExactScreen(page, target, timeout) {
|
|
110
118
|
const deadline = Date.now() + timeout;
|
|
111
|
-
const wanted = target.toLowerCase();
|
|
119
|
+
const wanted = normalizeScreenName(target).toLowerCase();
|
|
112
120
|
while (Date.now() < deadline) {
|
|
113
121
|
if ((await screenCandidates(page)).some((v) => v.toLowerCase() === wanted)) return true;
|
|
114
122
|
await page.waitForTimeout(150);
|
|
@@ -223,9 +231,9 @@ export async function executeWebFlowStep({ page, step, vars = {}, defaultTimeout
|
|
|
223
231
|
if (!email || !password) throw new Error("could not identify email and password fields");
|
|
224
232
|
await email.fill(emailValue);
|
|
225
233
|
await password.fill(passwordValue);
|
|
226
|
-
const submit = await
|
|
234
|
+
const submit = await findSignInSubmit(page);
|
|
227
235
|
if (!submit) throw new Error("could not identify a sign-in control");
|
|
228
|
-
await submit.click();
|
|
236
|
+
await submit.locator.click();
|
|
229
237
|
await page.waitForTimeout(400);
|
|
230
238
|
if (await password.isVisible().catch(() => false)) throw new Error("submit left the app on the login screen");
|
|
231
239
|
} else if (action === "swipe") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
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-overlay.test.js tests/web-audit.test.js tests/page-observations.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/actor-store.test.js tests/account-store.test.js tests/alerts.test.js tests/access-jwt.test.js tests/oauth.test.js tests/studio-client.test.js tests/journeys.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/job-lanes.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",
|
|
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-overlay.test.js tests/web-audit.test.js tests/page-observations.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/actor-store.test.js tests/account-store.test.js tests/alerts.test.js tests/access-jwt.test.js tests/oauth.test.js tests/studio-client.test.js tests/journeys.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/sign-in.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/job-lanes.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/platforms.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
|
}
|