@aarwitz/tapp 0.21.2 β 0.23.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 +60 -4
- package/browser/app.css +44 -0
- package/browser/app.js +194 -9
- package/browser/index.html +21 -1
- package/docs/BROWSER-PRODUCT.md +31 -1
- package/mcp-server/src/account-store.js +131 -0
- package/mcp-server/src/actor-store.js +149 -0
- package/mcp-server/src/browser-product.js +234 -24
- package/mcp-server/src/index.js +26 -3
- package/mcp-server/src/mailer.js +70 -0
- package/mcp-server/src/product-operations.js +26 -11
- package/mcp-server/src/web-explorer.js +57 -3
- 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.23.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.23.0",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/bin/tapp.js
CHANGED
|
@@ -134,6 +134,32 @@ function parseVerbArgs(argv) {
|
|
|
134
134
|
// Is this target a finished run rather than something to launch? A capture is a directory with
|
|
135
135
|
// the markers a run writes, addressed by id, by path, or as "latest". Deliberately narrow: a
|
|
136
136
|
// bundle id, a URL, a repo dir and an .apk must all still mean what they meant before.
|
|
137
|
+
// Ask on the terminal. Hidden input turns echo off (raw mode) so a password is never shown or
|
|
138
|
+
// left in a scrollback; a plain field uses the ordinary readline path.
|
|
139
|
+
async function promptOnTerminal(question, { hidden = false } = {}) {
|
|
140
|
+
const { createInterface } = await import("node:readline");
|
|
141
|
+
if (!hidden) {
|
|
142
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
143
|
+
return new Promise((resolve) => rl.question(question, (answer) => { rl.close(); resolve(String(answer || "").trim()); }));
|
|
144
|
+
}
|
|
145
|
+
process.stderr.write(question);
|
|
146
|
+
return new Promise((resolve) => {
|
|
147
|
+
const chars = [];
|
|
148
|
+
const stdin = process.stdin;
|
|
149
|
+
const wasRaw = stdin.isRaw;
|
|
150
|
+
stdin.setRawMode(true); stdin.resume(); stdin.setEncoding("utf8");
|
|
151
|
+
const onData = (ch) => {
|
|
152
|
+
for (const c of ch) {
|
|
153
|
+
if (c === "\r" || c === "\n") { stdin.setRawMode(!!wasRaw); stdin.pause(); stdin.removeListener("data", onData); process.stderr.write("\n"); resolve(chars.join("")); return; }
|
|
154
|
+
if (c === "\u0003") { stdin.setRawMode(!!wasRaw); process.stderr.write("\n"); process.exit(130); }
|
|
155
|
+
if (c === "\u007f" || c === "\b") { chars.pop(); continue; }
|
|
156
|
+
chars.push(c);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
stdin.on("data", onData);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
137
163
|
function looksLikeCapture(value) {
|
|
138
164
|
const raw = String(value || "").trim();
|
|
139
165
|
if (!raw || raw.startsWith("-") || /^https?:\/\//i.test(raw)) return false;
|
|
@@ -365,7 +391,7 @@ async function resolveTargetOrExit(engine, input, { inspect = false } = {}) {
|
|
|
365
391
|
function safeCommandUsage(verb) {
|
|
366
392
|
const usage = {
|
|
367
393
|
workflows: "tapp plan workflows [repo] [--save FILE --confirm] [--workflow ID] [--json]",
|
|
368
|
-
explore: "tapp explore [target] [--platform ios|android|web] [--actions N] [--timeout SEC] [--email VALUE] [--password VALUE] [--baseline FILE] [--json FILE]\n --read-only <url>...: never clicks (dead controls, broken links/assets, failed requests, JS exceptions, mixed content, overflow) [--pages N] [--urls FILE] [--json [FILE]]\n --goal \"SCREEN OR CONTROL\": source-locate a screen/control and take the shortest observed route [--project-dir REPO] [--target NAME|PATH] [--map FILE] [--out FILE]\n Web: [--watch] opens Tapp's controlled browser and shows its actions; [--device \"iPhone 13\"] [--viewport 390x844] render at a device profile or explicit size\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted; TAPP_UDID is the default)\n iOS launch configuration: [--launch-arg VALUE ...] [--launch-env '{\"KEY\":\"VALUE\"}']\n Android: [--app-id ID] [--apk FILE] [--serial ID] [--keep-data]",
|
|
394
|
+
explore: "tapp explore [target] [--platform ios|android|web] [--actions N] [--timeout SEC] [--email VALUE] [--password VALUE] [--baseline FILE] [--json FILE]\n Web: --interactive stops at a sign-in and asks on this terminal (--remember keeps it, encrypted, for next time); --actor NAME starts from that actor's saved session\n --read-only <url>...: never clicks (dead controls, broken links/assets, failed requests, JS exceptions, mixed content, overflow) [--pages N] [--urls FILE] [--json [FILE]]\n --goal \"SCREEN OR CONTROL\": source-locate a screen/control and take the shortest observed route [--project-dir REPO] [--target NAME|PATH] [--map FILE] [--out FILE]\n Web: [--watch] opens Tapp's controlled browser and shows its actions; [--device \"iPhone 13\"] [--viewport 390x844] render at a device profile or explicit size\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted; TAPP_UDID is the default)\n iOS launch configuration: [--launch-arg VALUE ...] [--launch-env '{\"KEY\":\"VALUE\"}']\n Android: [--app-id ID] [--apk FILE] [--serial ID] [--keep-data]",
|
|
369
395
|
focus: "tapp explore --goal \"SCREEN OR CONTROL\" [target] [--platform ios|android|web] [--project-dir REPO] [--target NAME|PATH] [--map FILE] [--out FILE]",
|
|
370
396
|
init: "tapp init [repo] [--explore] [--refresh] [--platform PLATFORM] [--target NAME] [--url URL] [--watch] [--dry-run]",
|
|
371
397
|
open: "tapp look [target] [--platform ios|android|web] [--out FILE] [--tap TEXT] [--wait-for TEXT]\n --tree: accessibility tree of the current screen (--json for every element)\n <capture>|latest: the screens of a finished run β [--at N|\"screen\"] one frame, [--frames] contact sheets for scanning, [--json] the index\n --sim: screenshot the booted simulator only (never builds or installs)\n iOS: [--device \"iPhone 16\"|UDID] chooses the simulator (required when more than one is booted)\n Web: [--device \"iPhone 13\"] [--viewport 390x844] [--full-page]",
|
|
@@ -911,6 +937,31 @@ switch (command) {
|
|
|
911
937
|
const progressMetric = platform === "web" ? "pages reached" : platform === "ios" ? "structural states observed" : "screens reached";
|
|
912
938
|
const onProgress = (p) =>
|
|
913
939
|
writeProgress(`π Exploringβ¦ ${p.action}/${p.max || flags.actions || 60} actions Β· ${p.states} ${progressMetric}`);
|
|
940
|
+
// --interactive: when the run meets a sign-in it has no credentials for, it stops and asks
|
|
941
|
+
// here, on this terminal, the same way the desktop app asks in its chat. The answer goes to
|
|
942
|
+
// the engine through a 0600 file it polls; --remember keeps it in the encrypted actor store
|
|
943
|
+
// so the next run starts signed in. Nothing typed is echoed or logged.
|
|
944
|
+
const interactive = flags.interactive === true && process.stdin.isTTY;
|
|
945
|
+
if (flags.interactive === true && !process.stdin.isTTY) console.error("βΉοΈ --interactive needs a terminal to ask on; running without it.");
|
|
946
|
+
const inputResponsePath = interactive ? path.join(os.tmpdir(), `tapp-input-${process.pid}-${Date.now().toString(36)}.json`) : "";
|
|
947
|
+
const actorName = typeof flags.actor === "string" && flags.actor ? flags.actor : (interactive ? "default" : "");
|
|
948
|
+
const askOnTerminal = async (request) => {
|
|
949
|
+
writeProgress("");
|
|
950
|
+
process.stderr.write(`\nπ tapp found a sign-in on "${request.screen}". Go in? (press Enter on an empty field to skip)\n`);
|
|
951
|
+
const values = {};
|
|
952
|
+
for (const field of request.fields || []) {
|
|
953
|
+
values[field.key] = await promptOnTerminal(` ${field.label}${field.placeholder ? ` (${field.placeholder})` : ""}: `, { hidden: !!field.secure });
|
|
954
|
+
}
|
|
955
|
+
const filled = Object.values(values).some((v) => v);
|
|
956
|
+
const action = filled ? "submit" : "skip";
|
|
957
|
+
fs.writeFileSync(inputResponsePath, JSON.stringify({ requestId: request.requestId, action, values: filled ? values : {} }), { mode: 0o600 });
|
|
958
|
+
if (action === "submit" && flags.remember === true) {
|
|
959
|
+
const { ActorStore } = await import(path.join(packageRoot, "mcp-server", "src", "actor-store.js"));
|
|
960
|
+
new ActorStore().write(target, actorName || "default", { credentials: { email: values.email || "", password: values.password || "" } });
|
|
961
|
+
process.stderr.write(` remembered for ${new URL(target).host} as actor "${actorName || "default"}"\n`);
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
const onProgressWithAsk = (p) => { if (p.awaitInput && interactive) { askOnTerminal(p.awaitInput).catch(() => {}); return; } onProgress(p); };
|
|
914
965
|
const r = platform === "web"
|
|
915
966
|
? await engine.runQaWeb({
|
|
916
967
|
url: target,
|
|
@@ -923,7 +974,10 @@ switch (command) {
|
|
|
923
974
|
device: typeof flags.device === "string" ? flags.device : "",
|
|
924
975
|
viewport: typeof flags.viewport === "string" ? flags.viewport : "",
|
|
925
976
|
surface: "cli",
|
|
926
|
-
onProgress,
|
|
977
|
+
onProgress: onProgressWithAsk,
|
|
978
|
+
interactive,
|
|
979
|
+
inputResponsePath,
|
|
980
|
+
actor: actorName,
|
|
927
981
|
})
|
|
928
982
|
: platform === "android"
|
|
929
983
|
? await engine.runQaAndroid({
|
|
@@ -2125,14 +2179,16 @@ switch (command) {
|
|
|
2125
2179
|
const product = await startBrowserProduct({
|
|
2126
2180
|
projectDir, port,
|
|
2127
2181
|
launch: !publicAccess && flags.open !== false && flags["no-open"] !== true,
|
|
2128
|
-
|
|
2182
|
+
// A loopback origin is a trial of the public Studio on your own machine; pinning its
|
|
2183
|
+
// browser to public addresses would stop it reaching the very thing you are trying.
|
|
2184
|
+
...(publicAccess ? { publicAccess: true, publicOrigin, publicEgressOnly: !localOrigin } : {}),
|
|
2129
2185
|
});
|
|
2130
2186
|
if (publicAccess) {
|
|
2131
2187
|
console.log(`Tapp Β· public Studio for ${publicOrigin}`);
|
|
2132
2188
|
console.log(`Listening on ${product.origin} β put a TLS terminator or tunnel in front of it.`);
|
|
2133
2189
|
console.log("Anonymous visitors may audit a public website read-only. Repositories, live");
|
|
2134
2190
|
console.log("sessions and the release gate require an authenticated local session.");
|
|
2135
|
-
console.log("Browser egress is pinned to public addresses; private ranges are refused.");
|
|
2191
|
+
console.log(localOrigin ? "Local trial: browser egress is not pinned, so this can reach services on this machine." : "Browser egress is pinned to public addresses; private ranges are refused.");
|
|
2136
2192
|
} else {
|
|
2137
2193
|
console.log(`Tapp Β· ${product.root || "choose a local folder or GitHub repository in the browser"}`);
|
|
2138
2194
|
console.log(`Open: ${product.launchUrl}`);
|
package/browser/app.css
CHANGED
|
@@ -529,3 +529,47 @@ dialog::backdrop { background:rgba(0,0,0,.6); }
|
|
|
529
529
|
|
|
530
530
|
@media (max-width: 900px) { .stage { height:auto; min-height:0; } .device-stage { height:auto; } .device-frame { height:62vh; } .device-frame.web { height:auto; } .chat-float { position:static; width:100%; max-height:none; margin:12px; width:calc(100% - 24px); } }
|
|
531
531
|
@media (prefers-reduced-motion: reduce) { .hero-page, .hero-cursor, .hero-log li { animation:none !important; opacity:1 !important; transform:none !important; } .hero-page-1, .hero-page-2 { display:none; } .chat-line.typing i { animation:none; } }
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
/* ---- The ask: a sign-in the engine stopped at, answered in the chat --------------------------- */
|
|
535
|
+
.chat-ask { margin-top:6px; padding:12px; border-radius:var(--tapp-radius-lg); background:rgba(15,26,34,.85); border:1px solid var(--tapp-accent, #4f6cf7); display:grid; gap:8px; }
|
|
536
|
+
.chat-ask-head { display:grid; grid-template-columns:22px 1fr; gap:8px; align-items:start; font-size:13px; line-height:1.45; color:var(--tapp-text); }
|
|
537
|
+
.chat-ask .ask-field { display:grid; gap:4px; font-size:12px; color:var(--tapp-text-soft); }
|
|
538
|
+
.chat-ask .ask-field input { font:inherit; font-size:13px; padding:8px 10px; border-radius:8px; border:1px solid var(--tapp-border); background:rgba(0,0,0,.25); color:var(--tapp-text); }
|
|
539
|
+
.chat-ask .ask-remember { display:flex; gap:8px; align-items:center; font-size:12px; color:var(--tapp-text-soft); }
|
|
540
|
+
.chat-ask .ask-actions { display:flex; gap:8px; flex-wrap:wrap; }
|
|
541
|
+
.chat-ask .ask-actions button { font:inherit; font-size:12px; padding:7px 12px; border-radius:8px; cursor:pointer; }
|
|
542
|
+
|
|
543
|
+
/* ---- Journeys: the list a person owns ------------------------------------------------------- */
|
|
544
|
+
.journey-row { display:grid; grid-template-columns:auto 1fr auto auto; gap:10px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--tapp-border); font-size:13px; }
|
|
545
|
+
.journey-row:last-child { border-bottom:0; }
|
|
546
|
+
.journey-platform { font-size:10px; letter-spacing:.08em; text-transform:uppercase; padding:2px 7px; border-radius:999px; background:rgba(79,108,247,.14); color:var(--tapp-accent, #4f6cf7); }
|
|
547
|
+
.journey-platform.ios { background:rgba(74,194,107,.14); color:var(--tapp-green, #4ac26b); }
|
|
548
|
+
.journey-platform.android { background:rgba(227,179,65,.14); color:var(--tapp-amber, #e3b341); }
|
|
549
|
+
.journey-name { color:var(--tapp-text); font-weight:600; }
|
|
550
|
+
.journey-steps { color:var(--tapp-text-soft); font-size:12px; }
|
|
551
|
+
|
|
552
|
+
.journey-group { border-top:1px solid var(--tapp-border); }
|
|
553
|
+
.journey-group > summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; padding:9px 10px; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--tapp-text-soft); }
|
|
554
|
+
.journey-group > summary::-webkit-details-marker { display:none; }
|
|
555
|
+
.journey-group[open] > summary { color:var(--tapp-text); }
|
|
556
|
+
|
|
557
|
+
/* Accounts on a public Studio (ADR-0009 slice 2). */
|
|
558
|
+
.account-slot { display:flex; gap:8px; align-items:center; font-size:12px; color:var(--muted); flex-wrap:wrap; }
|
|
559
|
+
#account-slot-side { margin-top:8px; }
|
|
560
|
+
#account-slot-side .account-email { max-width:100%; flex:1 1 100%; }
|
|
561
|
+
#account-slot-side button { white-space:nowrap; }
|
|
562
|
+
.account-slot .account-email { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
563
|
+
.account-slot button { font:inherit; font-size:12px; padding:5px 10px; border-radius:999px; border:1px solid var(--line); background:var(--control); color:inherit; cursor:pointer; }
|
|
564
|
+
.account-slot button.primary { background:var(--tapp-accent, #4f6cf7); border-color:transparent; color:#fff; }
|
|
565
|
+
.signin-card { max-width:560px; margin:14px auto 0; padding:14px 16px; border-radius:var(--tapp-radius-lg, 14px); border:1px solid var(--line); background:var(--control); font-size:13px; line-height:1.5; }
|
|
566
|
+
.signin-card p { margin:0 0 10px; }
|
|
567
|
+
.signin-card small { display:block; margin-top:8px; color:var(--tapp-text-faint); }
|
|
568
|
+
.signin-row { display:flex; gap:8px; flex-wrap:wrap; }
|
|
569
|
+
.signin-row input { flex:1 1 220px; font:inherit; padding:9px 12px; border-radius:10px; border:1px solid var(--line); background:rgba(0,0,0,.15); color:inherit; }
|
|
570
|
+
.signin-row button { font:inherit; padding:9px 14px; border-radius:10px; cursor:pointer; }
|
|
571
|
+
.signin-sent { margin:0; }
|
|
572
|
+
.actor-row { display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--tapp-border); font-size:13px; }
|
|
573
|
+
.actor-row:last-child { border-bottom:0; }
|
|
574
|
+
.actor-row small { color:var(--muted); }
|
|
575
|
+
.actor-app { padding:8px 10px 2px; font-weight:600; font-size:12px; color:var(--muted); border-top:1px solid var(--tapp-border); }
|
package/browser/app.js
CHANGED
|
@@ -12,7 +12,7 @@ function apiRoute(route) {
|
|
|
12
12
|
|
|
13
13
|
const state = {
|
|
14
14
|
csrf: "", session: null, project: null, audits: [], explores: [], activeJob: null, activeView: "overview",
|
|
15
|
-
selectedTargetId: "", selectedRunId: "", live: { active:false }, transcript: [], transcriptSource: "", frameTimer: null,
|
|
15
|
+
selectedTargetId: "", selectedRunId: "", live: { active:false }, transcript: [], transcriptSource: "", frameTimer: null, pendingInput: null,
|
|
16
16
|
chatCollapsed: false, shotScreens: new Set(), lastShotAt: 0,
|
|
17
17
|
};
|
|
18
18
|
const $ = (selector) => document.querySelector(selector);
|
|
@@ -91,9 +91,47 @@ function activateView(view) {
|
|
|
91
91
|
// A hosted Studio has no Mac, no simulator and no access to the visitor's disk, so folders,
|
|
92
92
|
// bundle ids and builds cannot work there however the prompt is worded. Offer only what this
|
|
93
93
|
// deployment can actually do, and say where the rest runs, rather than failing after the ask.
|
|
94
|
+
// On a public Studio a person is a visitor until they sign in, and an account after. Both slots
|
|
95
|
+
// (prompt screen and sidebar) show the same thing. A local Studio has neither: the one person at
|
|
96
|
+
// the keyboard is the operator.
|
|
97
|
+
function renderAccount() {
|
|
98
|
+
const session = state.session || {};
|
|
99
|
+
const isPublic = session.access === "anonymous" || session.access === "account";
|
|
100
|
+
for (const slot of document.querySelectorAll("#account-slot, #account-slot-side")) {
|
|
101
|
+
slot.classList.toggle("hidden", !isPublic);
|
|
102
|
+
if (!isPublic) continue;
|
|
103
|
+
slot.innerHTML = session.access === "account"
|
|
104
|
+
? `<span class="account-email" title="${esc(session.email || "")}">${esc(session.email || "")}</span><button type="button" data-signout>Sign out</button>`
|
|
105
|
+
: `<button type="button" class="primary" data-signin>Sign in</button>`;
|
|
106
|
+
}
|
|
107
|
+
$("#signin-card")?.classList.toggle("hidden", session.access !== "anonymous" || !state.signInOpen);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async function requestSignInLink(email) {
|
|
111
|
+
const button = $("#signin-send");
|
|
112
|
+
if (button) button.disabled = true;
|
|
113
|
+
try {
|
|
114
|
+
await api("/api/auth/link", { method:"POST", body:JSON.stringify({ email }) });
|
|
115
|
+
$("#signin-form")?.classList.add("hidden");
|
|
116
|
+
const sent = $("#signin-sent");
|
|
117
|
+
if (sent) { sent.textContent = `Check your email β a sign-in link is on its way to ${email}. It works once, for 15 minutes.`; sent.classList.remove("hidden"); }
|
|
118
|
+
} catch (error) {
|
|
119
|
+
toast(error.message, true);
|
|
120
|
+
} finally {
|
|
121
|
+
if (button) button.disabled = false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function signOut() {
|
|
126
|
+
try { await api("/api/auth/signout", { method:"POST", body:"{}" }); } catch { /* the cookie is gone either way */ }
|
|
127
|
+
location.replace("/");
|
|
128
|
+
}
|
|
129
|
+
|
|
94
130
|
function applyAccessMode() {
|
|
95
131
|
const session = state.session || {};
|
|
96
|
-
|
|
132
|
+
renderAccount();
|
|
133
|
+
if (session.access !== "anonymous" && session.access !== "account") return;
|
|
134
|
+
const signedIn = session.access === "account";
|
|
97
135
|
const accepts = new Set(session.accepts || ["url"]);
|
|
98
136
|
for (const button of document.querySelectorAll("[data-kind]")) {
|
|
99
137
|
const kind = button.dataset.kind;
|
|
@@ -111,9 +149,33 @@ function applyAccessMode() {
|
|
|
111
149
|
document.querySelector(".summary-panel")?.classList.add("hidden");
|
|
112
150
|
// refreshSession() runs on every poll, so this must not overwrite a heading the current run
|
|
113
151
|
// already set β that is what made "Website audit" revert to "tapp" when a run finished.
|
|
114
|
-
if (!state.headingOwnedByRun) setHeading("tapp", "Give it a public website and it will audit the pages read-only.");
|
|
152
|
+
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.");
|
|
115
153
|
const note = $("#privacy-note-detail");
|
|
116
|
-
if (note) note.textContent =
|
|
154
|
+
if (note) note.textContent = signedIn
|
|
155
|
+
? "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 need tapp there: npx -y @aarwitz/tapp@latest app"
|
|
156
|
+
: "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 need tapp there: npx -y @aarwitz/tapp@latest app";
|
|
157
|
+
$("#actors-panel")?.classList.toggle("hidden", !signedIn);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// The test accounts tapp holds, by application β names and what is held, never a value.
|
|
161
|
+
function renderActors() {
|
|
162
|
+
const node = $("#actors-list");
|
|
163
|
+
if (!node) return;
|
|
164
|
+
const apps = state.actors || [];
|
|
165
|
+
const total = apps.reduce((sum, app) => sum + app.actors.length, 0);
|
|
166
|
+
setCount("#actor-count", total);
|
|
167
|
+
if (!total) { node.innerHTML = '<div class="empty">None yet. Explore a site with a sign-in and tapp will ask.</div>'; return; }
|
|
168
|
+
node.innerHTML = apps.map((app) => `<div class="actor-app">${esc(app.host)}</div>${app.actors.map((actor) => {
|
|
169
|
+
const held = [actor.hasCredentials ? "password set" : "", actor.hasSession ? `signed-in session Β· ${compactDate(actor.sessionSavedAt)}` : ""].filter(Boolean).join(" Β· ") || "nothing held";
|
|
170
|
+
return `<div class="actor-row"><span><strong>${esc(actor.actor)}</strong><br><small>${esc(held)}</small></span><span></span><button class="quiet" type="button" data-forget-host="${esc(app.host)}" data-forget-actor="${esc(actor.actor)}">Forget</button></div>`;
|
|
171
|
+
}).join("")}`).join("");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async function forgetActor(host, actor) {
|
|
175
|
+
await api(`/api/actors/${encodeURIComponent(host)}/${encodeURIComponent(actor)}`, { method:"DELETE" });
|
|
176
|
+
state.actors = (state.actors || []).map((app) => app.host === host ? { ...app, actors: app.actors.filter((a) => a.actor !== actor) } : app).filter((app) => app.actors.length);
|
|
177
|
+
renderActors();
|
|
178
|
+
toast(`Forgot ${actor} on ${host}. tapp will ask again next time.`);
|
|
117
179
|
}
|
|
118
180
|
|
|
119
181
|
function showPrompt() {
|
|
@@ -288,7 +350,41 @@ function allRuns() {
|
|
|
288
350
|
return [...gates, ...explores, ...audits].sort((a, b) => String(b.createdAt || "").localeCompare(String(a.createdAt || "")));
|
|
289
351
|
}
|
|
290
352
|
|
|
353
|
+
// The journeys the open repository has committed under .tapp/flows/. This is the thing a
|
|
354
|
+
// person owns; the engine has listed them all along and the Studio never showed them.
|
|
355
|
+
function renderJourneys() {
|
|
356
|
+
const node = $("#journeys-list");
|
|
357
|
+
if (!node) return;
|
|
358
|
+
const flows = state.project?.flows || [];
|
|
359
|
+
setCount("#journey-count", flows.length);
|
|
360
|
+
if (!flows.length) { node.innerHTML = '<div class="empty">No journeys yet. Prove something with a session, then save it as a Flow.</div>'; return; }
|
|
361
|
+
// Group by folder: a real repository keeps dozens under sandbox/, weekly/, mobile/. The top
|
|
362
|
+
// level comes first; each group opens on demand so a hundred journeys read as a map.
|
|
363
|
+
const groups = new Map();
|
|
364
|
+
for (const flow of flows) { const key = flow.group || ""; if (!groups.has(key)) groups.set(key, []); groups.get(key).push(flow); }
|
|
365
|
+
const row = (flow) => `<div class="journey-row"><span class="journey-platform ${esc(flow.platform || "web")}">${esc(flow.platform || "web")}</span><span class="journey-name">${esc(flow.name)}</span><span class="journey-steps">${flow.steps || 0} steps</span><button class="quiet" data-run-journey="${esc(flow.relativePath || flow.name)}" title="Replay this journey">βΆ Run</button></div>`;
|
|
366
|
+
node.innerHTML = [...groups.entries()].sort(([a], [b]) => (a === "" ? -1 : b === "" ? 1 : a.localeCompare(b))).map(([group, items]) =>
|
|
367
|
+
group === ""
|
|
368
|
+
? items.map(row).join("")
|
|
369
|
+
: `<details class="journey-group"${items.length <= 8 ? " open" : ""}><summary><span class="journey-group-name">${esc(group)}/</span><span class="journey-steps">${items.length}</span></summary>${items.map(row).join("")}</details>`
|
|
370
|
+
).join("");
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
async function runJourney(relativePath) {
|
|
374
|
+
const name = String(relativePath).replace(/^\.tapp\/flows\//, "").replace(/\.ya?ml$/i, "");
|
|
375
|
+
showProduct(); activateView("overview"); renderChat();
|
|
376
|
+
setHeading(name, "Replaying the journey exactly as committed.", { owned: true });
|
|
377
|
+
const result = await runOperation("run-flow", { name }, { input: name });
|
|
378
|
+
if (result?.kind === "self-host") { answerSelfHost(result); return; }
|
|
379
|
+
if (result?.kind === "journey") {
|
|
380
|
+
pushLine({ kind: "summary", tone: result.passed ? "ready" : "blocked", pill: result.passed ? "Passed" : "Failed", text: `${result.name}: ${result.executed}/${result.total} steps${result.failed ? `, ${result.failed} failed` : ""}.` });
|
|
381
|
+
renderChat();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
291
385
|
function renderRuns() {
|
|
386
|
+
renderJourneys();
|
|
387
|
+
renderActors();
|
|
292
388
|
const runs = allRuns();
|
|
293
389
|
setCount("#run-count", runs.length);
|
|
294
390
|
$("#runs-list").innerHTML = runs.length ? runs.map((run) => {
|
|
@@ -345,6 +441,11 @@ function renderRunDetail(run) {
|
|
|
345
441
|
// ---- tapp chat: the engine's progress log, rendered as a transcript -------------------------
|
|
346
442
|
function renderChat() {
|
|
347
443
|
const node = $("#chat-transcript");
|
|
444
|
+
// While an ask is on screen the transcript is rebuilt on every poll, and rebuilding it throws
|
|
445
|
+
// away whatever the person has typed into the ask so far. Nothing else changes while the
|
|
446
|
+
// engine waits, so leave the DOM alone until the ask is answered or withdrawn.
|
|
447
|
+
const openAsk = node.querySelector("#chat-ask");
|
|
448
|
+
if (openAsk && state.pendingInput && openAsk.dataset.request === String(state.pendingInput.requestId)) return;
|
|
348
449
|
const stickToBottom = node.scrollTop + node.clientHeight >= node.scrollHeight - 24;
|
|
349
450
|
const lines = state.transcript.map((entry) => {
|
|
350
451
|
if (entry.kind === "shots") return `<div class="chat-shots">${entry.shots.map((shot) => `<a href="${esc(shot.href)}" target="_blank" rel="noreferrer" title="${esc(shot.caption)}"><img src="${esc(shot.src)}" alt="${esc(shot.caption)}"></a>`).join("")}</div>`;
|
|
@@ -353,13 +454,45 @@ function renderChat() {
|
|
|
353
454
|
if (entry.kind === "finding") return `<div class="chat-line finding ${esc(entry.severity)}"><span class="chat-icon">${entry.icon}</span><span>${esc(entry.text)}</span></div>`;
|
|
354
455
|
if (entry.kind === "progress") return "";
|
|
355
456
|
return `<div class="chat-line ${esc(entry.kind || "")}"><span class="chat-icon">${entry.icon || "β’"}</span><span>${esc(entry.text)}${entry.detail ? ` <em>β ${esc(entry.detail)}</em>` : ""}</span></div>`;
|
|
356
|
-
}).join("") + (state.activeJob ? '<div class="chat-line typing"><span class="chat-icon">β¨</span><span>tapp is working<i>β¦</i></span></div>' : "");
|
|
457
|
+
}).join("") + renderAskCard() + (state.activeJob && !state.pendingInput ? '<div class="chat-line typing"><span class="chat-icon">β¨</span><span>tapp is working<i>β¦</i></span></div>' : "");
|
|
357
458
|
node.innerHTML = lines;
|
|
358
459
|
if (stickToBottom) node.scrollTop = node.scrollHeight;
|
|
359
460
|
const progress = [...state.transcript].reverse().find((entry) => entry.kind === "progress");
|
|
360
461
|
$("#chat-status").textContent = state.activeJob ? (progress ? `${progress.current}/${progress.total} actions${progress.states != null ? ` Β· ${progress.states} screens` : ""}` : "workingβ¦") : state.transcript.length > 1 ? "done" : "ready";
|
|
361
462
|
}
|
|
362
463
|
|
|
464
|
+
// The desktop app's prompt, in the chat: Submit, Use defaults, Skip, Don't ask again. Secure
|
|
465
|
+
// fields are password inputs; nothing typed here is echoed into the transcript, and "remember"
|
|
466
|
+
// keeps it in the encrypted actor store so the next run starts signed in.
|
|
467
|
+
function renderAskCard() {
|
|
468
|
+
const ask = state.pendingInput;
|
|
469
|
+
if (!ask) return "";
|
|
470
|
+
const fields = (ask.fields || []).map((f) => `<label class="ask-field"><span>${esc(f.label || f.key)}</span><input name="${esc(f.key)}" type="${f.secure ? "password" : "text"}" placeholder="${esc(f.placeholder || "")}" value="${esc(f.default || "")}" autocomplete="${f.secure ? "current-password" : "username"}"></label>`).join("");
|
|
471
|
+
return `<form class="chat-ask" id="chat-ask" data-request="${esc(ask.requestId)}" data-job="${esc(ask.jobId)}">
|
|
472
|
+
<div class="chat-ask-head"><span class="chat-icon">π</span><span>tapp found a sign-in on <b>${esc(ask.screen || "this screen")}</b>. Go in?</span></div>
|
|
473
|
+
${fields}
|
|
474
|
+
<label class="ask-remember"><input type="checkbox" name="remember" checked> Remember for this site, so next time starts signed in</label>
|
|
475
|
+
<div class="ask-actions">
|
|
476
|
+
<button type="submit" class="primary" data-ask="submit">Submit</button>
|
|
477
|
+
<button type="button" class="quiet" data-ask="skip">Skip</button>
|
|
478
|
+
<button type="button" class="quiet" data-ask="dont_ask">Don't ask again</button>
|
|
479
|
+
</div>
|
|
480
|
+
</form>`;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
async function answerAsk(form, action) {
|
|
484
|
+
const jobId = form.dataset.job;
|
|
485
|
+
const values = {};
|
|
486
|
+
if (action === "submit") for (const input of form.querySelectorAll("input[name]:not([type=checkbox])")) values[input.name] = input.value;
|
|
487
|
+
const remember = !!form.querySelector("input[name=remember]")?.checked;
|
|
488
|
+
try {
|
|
489
|
+
await api(`/api/jobs/${encodeURIComponent(jobId)}/input`, { method: "POST", body: JSON.stringify({ action, values, remember: action === "submit" && remember }) });
|
|
490
|
+
state.pendingInput = null;
|
|
491
|
+
pushLine({ kind: "step", icon: action === "submit" ? "π" : "βοΈ", text: action === "submit" ? "Signing in with what you gave me" : action === "dont_ask" ? "Won't ask again this run" : "Skipped the sign-in" });
|
|
492
|
+
renderChat();
|
|
493
|
+
} catch (error) { toast(error.message, true); }
|
|
494
|
+
}
|
|
495
|
+
|
|
363
496
|
function setChatCollapsed(collapsed) {
|
|
364
497
|
state.chatCollapsed = collapsed;
|
|
365
498
|
$("#chat-float").classList.toggle("collapsed", collapsed);
|
|
@@ -493,9 +626,9 @@ function renderProject() {
|
|
|
493
626
|
return;
|
|
494
627
|
}
|
|
495
628
|
showProduct();
|
|
496
|
-
$("#app-name").textContent = project.application?.name || "Unnamed product";
|
|
629
|
+
if (!state.headingOwnedByRun) $("#app-name").textContent = project.application?.name || "Unnamed product";
|
|
497
630
|
const platforms = project.application?.platforms?.map(pretty).join(" Β· ") || "Targets not inspected";
|
|
498
|
-
$("#app-summary").textContent = `${platforms} Β· ${project.capabilities?.length || 0} known capabilities`;
|
|
631
|
+
if (!state.headingOwnedByRun) $("#app-summary").textContent = `${platforms} Β· ${project.capabilities?.length || 0} known capabilities`;
|
|
499
632
|
renderTargets();
|
|
500
633
|
renderRequirements();
|
|
501
634
|
renderDecision();
|
|
@@ -519,12 +652,16 @@ async function refreshSession() {
|
|
|
519
652
|
async function refresh() {
|
|
520
653
|
// A public visitor has no project and no live session, and asking for them would only earn a
|
|
521
654
|
// 401 on every poll.
|
|
522
|
-
if (state.session?.access === "anonymous") {
|
|
523
|
-
const runs = await
|
|
655
|
+
if (state.session?.access === "anonymous" || state.session?.access === "account") {
|
|
656
|
+
const [runs, actors] = await Promise.all([
|
|
657
|
+
api("/api/audits").catch(() => ({ audits: [], explores: [] })),
|
|
658
|
+
state.session.access === "account" ? api("/api/actors").catch(() => ({ apps: [] })) : Promise.resolve({ apps: [] }),
|
|
659
|
+
]);
|
|
524
660
|
state.project = { connected:false };
|
|
525
661
|
state.live = { active:false };
|
|
526
662
|
state.audits = runs.audits || [];
|
|
527
663
|
state.explores = runs.explores || [];
|
|
664
|
+
state.actors = actors.apps || [];
|
|
528
665
|
renderProject();
|
|
529
666
|
return;
|
|
530
667
|
}
|
|
@@ -557,6 +694,10 @@ async function runOperation(name, body = {}, { input = "" } = {}) {
|
|
|
557
694
|
const ratio = progress?.current && progress?.total ? Math.min(92, Math.round(progress.current / progress.total * 100)) : Math.min(88, 8 + job.progress.length * 4);
|
|
558
695
|
$("#operation-progress-bar").style.width = `${ratio}%`;
|
|
559
696
|
syncTranscriptFromJob(name, { ...job, input });
|
|
697
|
+
// The engine has stopped at a sign-in and is waiting on a person. Show the ask in the chat
|
|
698
|
+
// until it is answered or the engine moves on.
|
|
699
|
+
if (job.input && state.pendingInput?.requestId !== job.input.requestId) { state.pendingInput = { ...job.input, jobId: job.id }; }
|
|
700
|
+
if (!job.input && state.pendingInput) state.pendingInput = null;
|
|
560
701
|
if (!$("#product-shell").classList.contains("hidden")) { renderCommandState(job, name); renderChat(); }
|
|
561
702
|
const screen = [...job.progress].reverse().find((entry) => entry.screen)?.screen;
|
|
562
703
|
if (screen && !state.live?.active) $("#live-screen-title").textContent = screen;
|
|
@@ -616,6 +757,25 @@ async function startFromPrompt(raw) {
|
|
|
616
757
|
const prompt = classifyPrompt(raw);
|
|
617
758
|
if (prompt.kind === "empty") return;
|
|
618
759
|
if (prompt.kind === "url") {
|
|
760
|
+
// On your own machine, or signed in to a public Studio, a website is explored for real β it
|
|
761
|
+
// can stop at a sign-in and ask you. A visitor only ever reads.
|
|
762
|
+
if (state.session?.mode === "local" || state.session?.access === "account") {
|
|
763
|
+
state.promptRun = true; state.promptPlatform = "web";
|
|
764
|
+
showProduct(); activateView("overview"); renderDeviceChrome(); renderChat();
|
|
765
|
+
document.querySelector(".device-stage")?.classList.remove("hidden");
|
|
766
|
+
setHeading("Exploring", "Going inside. If there is a sign-in, I will ask.", { owned: true });
|
|
767
|
+
let result;
|
|
768
|
+
try { result = await runOperation("explore", { url: prompt.value }, { input: prompt.value }); }
|
|
769
|
+
catch (error) {
|
|
770
|
+
// A refused start (your previous run is still finishing, or this Studio is busy) must not
|
|
771
|
+
// leave "Exploring" over an empty stage.
|
|
772
|
+
setHeading("Not started", error.message, { owned: true });
|
|
773
|
+
throw error;
|
|
774
|
+
}
|
|
775
|
+
if (result?.kind === "self-host") { answerSelfHost(result); return; }
|
|
776
|
+
state.selectedRunId = result?.capture?.id || state.selectedRunId;
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
619
779
|
state.promptRun = true; state.promptPlatform = "web";
|
|
620
780
|
showProduct(); activateView("overview"); renderDeviceChrome(); renderChat();
|
|
621
781
|
document.querySelector(".device-stage")?.classList.remove("hidden");
|
|
@@ -680,6 +840,20 @@ document.addEventListener("submit", (event) => {
|
|
|
680
840
|
if (audit) { event.preventDefault(); auditWebsite(audit.elements.url.value).catch((error) => toast(error.message, true)); return; }
|
|
681
841
|
const prompt = event.target.closest("#prompt-form");
|
|
682
842
|
if (prompt) { event.preventDefault(); startFromPrompt(prompt.elements.input.value).catch((error) => toast(error.message, true)); }
|
|
843
|
+
const ask = event.target.closest("#chat-ask");
|
|
844
|
+
if (ask) { event.preventDefault(); answerAsk(ask, "submit"); }
|
|
845
|
+
const signin = event.target.closest("#signin-form");
|
|
846
|
+
if (signin) { event.preventDefault(); requestSignInLink(signin.elements.email.value.trim()); }
|
|
847
|
+
});
|
|
848
|
+
document.addEventListener("click", (event) => {
|
|
849
|
+
const button = event.target.closest("#chat-ask [data-ask]");
|
|
850
|
+
if (button && button.type === "button") { event.preventDefault(); answerAsk(button.closest("#chat-ask"), button.dataset.ask); }
|
|
851
|
+
const play = event.target.closest("[data-run-journey]");
|
|
852
|
+
if (play) { event.preventDefault(); runJourney(play.dataset.runJourney).catch((error) => toast(error.message, true)); }
|
|
853
|
+
if (event.target.closest("[data-signin]")) { event.preventDefault(); state.signInOpen = true; renderAccount(); showPrompt(); setTimeout(() => $("#signin-email")?.focus(), 50); }
|
|
854
|
+
if (event.target.closest("[data-signout]")) { event.preventDefault(); signOut(); }
|
|
855
|
+
const forget = event.target.closest("[data-forget-actor]");
|
|
856
|
+
if (forget) { event.preventDefault(); forgetActor(forget.dataset.forgetHost, forget.dataset.forgetActor).catch((error) => toast(error.message, true)); }
|
|
683
857
|
});
|
|
684
858
|
|
|
685
859
|
$$("[data-brand-home]").forEach((button) => button.addEventListener("click", () => state.project?.connected ? (showProduct(), activateView("overview")) : showPrompt()));
|
|
@@ -705,6 +879,16 @@ $("#run-gate").addEventListener("click", () => runOperation("gate", operationPay
|
|
|
705
879
|
// ?target=... Prefill it and start the run, so arriving here does not mean retyping what was
|
|
706
880
|
// already typed on the landing page. The URL is cleaned up either way so a refresh does not
|
|
707
881
|
// silently re-run it.
|
|
882
|
+
// Coming back from a sign-in link: say what happened, then clean the URL.
|
|
883
|
+
function signInOutcome() {
|
|
884
|
+
let outcome = "";
|
|
885
|
+
try { outcome = new URLSearchParams(window.location.search).get("signin") || ""; } catch { return; }
|
|
886
|
+
if (!outcome) return;
|
|
887
|
+
try { window.history.replaceState({}, "", window.location.pathname); } catch { /* history may be unavailable */ }
|
|
888
|
+
if (outcome === "done") toast(`Signed in${state.session?.email ? ` as ${state.session.email}` : ""}.`);
|
|
889
|
+
if (outcome === "expired") { toast("That sign-in link has expired or was already used β ask for a new one.", true); state.signInOpen = true; renderAccount(); }
|
|
890
|
+
}
|
|
891
|
+
|
|
708
892
|
function handoffTarget() {
|
|
709
893
|
let target = "";
|
|
710
894
|
try { target = new URLSearchParams(window.location.search).get("target") || ""; } catch { return ""; }
|
|
@@ -719,6 +903,7 @@ try {
|
|
|
719
903
|
await refreshSession();
|
|
720
904
|
await refresh();
|
|
721
905
|
if (state.project?.connected && !state.project?.state?.inspected) await runOperation("initialize", { write:true });
|
|
906
|
+
signInOutcome();
|
|
722
907
|
|
|
723
908
|
const handoff = handoffTarget();
|
|
724
909
|
if (handoff) {
|
package/browser/index.html
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
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
|
+
<div class="account-slot hidden" id="account-slot"></div>
|
|
28
29
|
</header>
|
|
29
30
|
|
|
30
31
|
<section class="prompt-hero" aria-hidden="true">
|
|
@@ -61,6 +62,16 @@
|
|
|
61
62
|
<li><button type="button" data-kind="github" data-prompt="owner/repo"><span>π</span><b>owner/repo</b><small>clone from GitHub into an isolated workspace, then the same</small></button></li>
|
|
62
63
|
<li><button type="button" data-kind="build" data-prompt="com.company.app"><span>π±</span><b>com.company.app</b><small>explore a build already on the booted simulator (or give a .app / .apk)</small></button></li>
|
|
63
64
|
</ul>
|
|
65
|
+
<!-- Signing in to a public Studio: an email address and a link, nothing else. Hidden on a
|
|
66
|
+
local Studio, where the one person at the keyboard is the operator already. -->
|
|
67
|
+
<section class="signin-card hidden" id="signin-card" aria-live="polite">
|
|
68
|
+
<form id="signin-form" autocomplete="email">
|
|
69
|
+
<p><strong>Sign in to go inside a site.</strong> tapp can stop at a sign-in and ask you for a test account, then remember it β for that it needs to know it is you.</p>
|
|
70
|
+
<div class="signin-row"><input id="signin-email" name="email" type="email" placeholder="you@company.com" required><button class="primary" type="submit" id="signin-send">Email me a link</button></div>
|
|
71
|
+
<small>No password. The link works once and expires in 15 minutes.</small>
|
|
72
|
+
</form>
|
|
73
|
+
<p class="signin-sent hidden" id="signin-sent"></p>
|
|
74
|
+
</section>
|
|
64
75
|
<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
76
|
<span class="sr-only" id="privacy-note-title">Your code stays on this machine.</span>
|
|
66
77
|
</section>
|
|
@@ -85,6 +96,7 @@
|
|
|
85
96
|
<div class="row" data-repo-only><span><svg><use href="#i-server"/></svg></span><span id="sidebar-runner">Runner not checked</span></div>
|
|
86
97
|
<div class="row hidden" id="sidebar-app-row"><span><svg><use href="#i-app"/></svg></span><span><code id="sidebar-app-id"></code></span></div>
|
|
87
98
|
<span class="mode-pill" id="mode-pill">Self-host Β· this machine</span>
|
|
99
|
+
<div class="account-slot hidden" id="account-slot-side"></div>
|
|
88
100
|
</div>
|
|
89
101
|
<div class="sidebar-footer">
|
|
90
102
|
<button class="quiet" id="change-source">οΌ Test something else</button>
|
|
@@ -154,12 +166,20 @@
|
|
|
154
166
|
<section class="workspace-view" data-view-panel="runs">
|
|
155
167
|
<div class="view-heading simple"><div><p class="eyebrow">Runs</p><h1>Every run, with its evidence</h1><p>Release checks, explorations and read-only website audits. Each opens the report page the engine wrote.</p></div><button class="primary" id="run-gate" data-repo-only>Run release gate</button></div>
|
|
156
168
|
<section class="panel section audit-panel">
|
|
157
|
-
<div class="section-heading compact"><div><p class="eyebrow">Website</p><h2>Audit a website β read-only</h2><p>Up to
|
|
169
|
+
<div class="section-heading compact"><div><p class="eyebrow">Website</p><h2>Audit a website β read-only</h2><p>Up to twenty pages, nothing clicked. Safe on production or a site you do not own; no release verdict without source.</p></div></div>
|
|
158
170
|
<form class="audit-form" id="runs-audit-form">
|
|
159
171
|
<label class="field"><span>Website URL</span><input id="audit-url" name="url" type="url" inputmode="url" placeholder="https://example.com" required autocomplete="off"></label>
|
|
160
172
|
<button class="primary" type="submit" id="audit-start">Audit read-only</button>
|
|
161
173
|
</form>
|
|
162
174
|
</section>
|
|
175
|
+
<section class="panel section hidden" id="actors-panel">
|
|
176
|
+
<div class="section-heading compact"><div><p class="eyebrow">Test accounts</p><h2>What tapp can sign in as <i id="actor-count" class="zero">0</i></h2><p>Kept encrypted. Shown here is only the name and whether a password or a signed-in session is held β never the values. Forget one and tapp will ask again next time.</p></div></div>
|
|
177
|
+
<div id="actors-list"><div class="empty">None yet. Explore a site with a sign-in and tapp will ask.</div></div>
|
|
178
|
+
</section>
|
|
179
|
+
<section class="panel section" id="journeys-panel" data-repo-only>
|
|
180
|
+
<div class="section-heading compact"><div><p class="eyebrow">Journeys</p><h2>What this app has proven <i id="journey-count" class="zero">0</i></h2><p>Committed under <code>.tapp/flows/</code>. Each replays exactly as written β no model, no key β and is what the release gate guards.</p></div></div>
|
|
181
|
+
<div id="journeys-list"><div class="empty">No journeys yet.</div></div>
|
|
182
|
+
</section>
|
|
163
183
|
<div class="split-view">
|
|
164
184
|
<section class="panel list-panel" id="runs-list"><div class="empty">No runs yet.</div></section>
|
|
165
185
|
<section class="panel detail-panel" id="run-detail"><div class="empty">Select a run to inspect its evidence.</div></section>
|
package/docs/BROWSER-PRODUCT.md
CHANGED
|
@@ -45,7 +45,7 @@ refuses what the mode cannot do: a hosted Studio cannot open a path or a build o
|
|
|
45
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
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` |
|
|
47
47
|
|
|
48
|
-
A **website audit** is `explore --read-only`: up to
|
|
48
|
+
A **website audit** is `explore --read-only`: up to twenty same-origin pages (twelve by default) are rendered and read β
|
|
49
49
|
dead controls, broken images/assets/links, failed requests, JS exceptions, mixed content,
|
|
50
50
|
horizontal overflow β and nothing is clicked, typed, submitted or hovered, so it is safe on
|
|
51
51
|
production or a site you do not own. A website has no source revision, so it has no release
|
|
@@ -75,3 +75,33 @@ the chat's narration and summary without a browser.
|
|
|
75
75
|
`saas/` serves the same `browser/` assets through `/api/studio` with an API base and login URL
|
|
76
76
|
injected. It is frozen at its current commit (ADR-0006, owner decision) and will embed the
|
|
77
77
|
simplified Studio when it is next deployed. Nothing in the Studio depends on it.
|
|
78
|
+
|
|
79
|
+
## Accounts on a public Studio
|
|
80
|
+
|
|
81
|
+
A public Studio (`tapp app --public`) has three kinds of person, and the boundary between them is
|
|
82
|
+
an allowlist in `browser-product.js` (`anonymousAllows`, `accountAllows`):
|
|
83
|
+
|
|
84
|
+
| | Visitor | Account | Operator |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| Who | Anyone who opens the page | Signed in with an email link | The machine's owner (`tapp app` launch URL) |
|
|
87
|
+
| May | Audit a public website read-only; see their own audits | Everything a visitor may, plus: explore a website for real (it stops at a sign-in and **asks** in the chat), answer the ask, and see / forget the **test accounts** tapp holds for them | Everything, including repositories, live sessions and the gate |
|
|
88
|
+
| Evidence | Captures stamped with their visitor cookie | Captures stamped `acct:<id>` | All captures on the machine |
|
|
89
|
+
| Test accounts | None β a visitor is never asked | Encrypted, per account: `TAPP_HOME/accounts/actors/<id>/` | `TAPP_HOME/actors/` |
|
|
90
|
+
|
|
91
|
+
**Signing in** is `POST /api/auth/link` with an email, then `GET /auth/<token>` from the email.
|
|
92
|
+
There is no password. Links work once and expire in 15 minutes; sessions last 90 days; only the
|
|
93
|
+
SHA-256 of either token is on disk (`account-store.js`). One address may ask for five links per
|
|
94
|
+
ten minutes, and the reply is the same whether or not the address has an account.
|
|
95
|
+
|
|
96
|
+
**Mail** is sent through Resend when `TAPP_MAIL_RESEND_KEY` and `TAPP_MAIL_FROM` are set
|
|
97
|
+
(`mailer.js`). Without them, each message is written as a 0600 `.eml` into `TAPP_MAIL_OUTBOX`
|
|
98
|
+
(default `TAPP_HOME/mail-outbox`) β what tests and a local trial use, and what a freshly deployed
|
|
99
|
+
host does before a provider is configured. A link is never printed to a log.
|
|
100
|
+
|
|
101
|
+
**What an account's test accounts look like.** The Runs view lists them by application: the
|
|
102
|
+
actor's name, whether a password is held, and whether a signed-in session is held and since when.
|
|
103
|
+
Never a value. *Forget* removes one; tapp asks again next time. This is the CI-secrets model β
|
|
104
|
+
write-only from the UI, encrypted at rest, decrypted only inside the run that signs in with it.
|
|
105
|
+
|
|
106
|
+
A local trial of the public mode (`--origin http://127.0.0.1:PORT`) does not pin browser egress
|
|
107
|
+
to public addresses, so it can reach a site on the same machine; a real origin always does.
|