@aarwitz/tapp 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/browser/app.css +149 -97
- package/browser/app.js +87 -399
- package/browser/index.html +40 -121
- package/browser/product-contract.js +16 -16
- package/docs/BROWSER-PRODUCT.md +42 -65
- package/docs/PRODUCT-ENGINE.md +1 -1
- package/mcp-server/src/browser-product.js +42 -70
- package/package.json +2 -2
package/browser/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { customerProductContract } from "./product-contract.js";
|
|
2
|
-
import { operationIsPending
|
|
2
|
+
import { operationIsPending } from "./view-model.js";
|
|
3
3
|
|
|
4
4
|
const API_BASE = String(document.querySelector('meta[name="tapp-api-base"]')?.content || "").replace(/\/$/, "");
|
|
5
5
|
const LOGIN_URL = String(document.querySelector('meta[name="tapp-login-url"]')?.content || "");
|
|
@@ -11,9 +11,8 @@ function apiRoute(route) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const state = {
|
|
14
|
-
csrf: "", session: null, project: null, activeJob: null, activeView: "overview",
|
|
15
|
-
selectedTargetId: "", selectedRunId: "",
|
|
16
|
-
uploadedEntries: [], live: { active:false }, transcript: [], transcriptSource: "", frameTimer: null,
|
|
14
|
+
csrf: "", session: null, project: null, audits: [], activeJob: null, activeView: "overview",
|
|
15
|
+
selectedTargetId: "", selectedRunId: "", live: { active:false }, transcript: [], transcriptSource: "", frameTimer: null,
|
|
17
16
|
};
|
|
18
17
|
const $ = (selector) => document.querySelector(selector);
|
|
19
18
|
const $$ = (selector) => [...document.querySelectorAll(selector)];
|
|
@@ -51,13 +50,12 @@ function captureId(report) {
|
|
|
51
50
|
return report?.capture?.id || "";
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
function
|
|
55
|
-
const id = captureId(report);
|
|
53
|
+
function evidenceLink(id, label = "Open visual evidence") {
|
|
56
54
|
return id ? `<a class="button-link" href="${esc(apiRoute(`/evidence/captures/${encodeURIComponent(id)}/report.html`))}" target="_blank" rel="noreferrer">${esc(label)}</a>` : "";
|
|
57
55
|
}
|
|
56
|
+
function reportLink(report, label) { return evidenceLink(captureId(report), label); }
|
|
58
57
|
|
|
59
58
|
function currentTarget() { return (state.project?.targets || []).find((target) => target.id === state.selectedTargetId) || null; }
|
|
60
|
-
|
|
61
59
|
function targetStorageKey() { return `tapp:selected-target:${state.project?.repository?.id || "none"}`; }
|
|
62
60
|
|
|
63
61
|
function chooseDefaultTarget() {
|
|
@@ -73,8 +71,6 @@ function operationPayload(extra = {}) {
|
|
|
73
71
|
return {
|
|
74
72
|
...(target ? { target:target.id, platform:target.platform } : {}),
|
|
75
73
|
...(target?.platform === "android" && $("#android-serial")?.value.trim() ? { serial:$("#android-serial").value.trim() } : {}),
|
|
76
|
-
...($("#test-email")?.value ? { testEmail:$("#test-email").value } : {}),
|
|
77
|
-
...($("#test-password")?.value ? { testPassword:$("#test-password").value } : {}),
|
|
78
74
|
...extra,
|
|
79
75
|
};
|
|
80
76
|
}
|
|
@@ -96,35 +92,25 @@ function showSourceOnboarding() {
|
|
|
96
92
|
function showProduct() {
|
|
97
93
|
$("#source-onboarding").classList.add("hidden");
|
|
98
94
|
$("#product-shell").classList.remove("hidden");
|
|
99
|
-
activateView(location.hash.slice(1) || state.activeView);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function sourceLayer(repository) {
|
|
103
|
-
return repository?.source?.kind === "website" ? "Website" : "Repository";
|
|
104
95
|
}
|
|
105
96
|
|
|
106
97
|
function renderRepositoryChrome() {
|
|
107
98
|
const repositories = state.session?.repositories || [];
|
|
108
99
|
const current = state.project?.repository || state.session?.repository;
|
|
109
100
|
const switcher = $("#repository-switcher");
|
|
110
|
-
switcher.classList.toggle("hidden", repositories.length <
|
|
111
|
-
switcher.innerHTML = repositories.map((repository) => `<option value="${esc(repository.id)}" ${repository.id === current?.id ? "selected" : ""}>${esc(repository.name)}
|
|
101
|
+
switcher.classList.toggle("hidden", repositories.length < 2);
|
|
102
|
+
switcher.innerHTML = repositories.map((repository) => `<option value="${esc(repository.id)}" ${repository.id === current?.id ? "selected" : ""}>${esc(repository.name)}</option>`).join("");
|
|
112
103
|
$("#refresh-project").classList.toggle("hidden", !current);
|
|
113
104
|
if (!current) return;
|
|
114
|
-
const website = sourceLayer(current) === "Website";
|
|
115
105
|
$("#sidebar-project-name").textContent = state.project?.application?.name || current.name;
|
|
116
|
-
$("#sidebar-project-source").textContent =
|
|
106
|
+
$("#sidebar-project-source").textContent = current.source?.label || current.root || "Repository";
|
|
117
107
|
$("#project-avatar").textContent = (state.project?.application?.name || current.name || "T").slice(0, 1).toUpperCase();
|
|
118
|
-
$("#repository-title").textContent = current.source?.label || current.name;
|
|
119
|
-
$("#repository-detail").textContent = current.source?.note || (website ? "Connected website. Tapp can explore, record, and check it; a release verdict needs a source revision." : current.ephemeral ? "This is an isolated working copy. Review and export changes before updating the source repository." : `Direct local checkout · ${current.root}`);
|
|
120
|
-
$("#settings-repository").innerHTML = `<dl class="settings-dl"><div><dt>Layer</dt><dd>${sourceLayer(current)}</dd></div><div><dt>Source</dt><dd>${esc(pretty(current.source?.kind))}</dd></div><div><dt>Location</dt><dd><code>${esc(current.root || current.source?.label || "—")}</code></dd></div><div><dt>Write mode</dt><dd>${website ? "Observation only" : current.ephemeral ? "Isolated review copy" : "Direct checkout"}</dd></div></dl>`;
|
|
121
108
|
}
|
|
122
109
|
|
|
123
|
-
function setCount(id, value
|
|
110
|
+
function setCount(id, value) {
|
|
124
111
|
const node = $(id);
|
|
125
112
|
node.textContent = value;
|
|
126
113
|
node.classList.toggle("zero", !value);
|
|
127
|
-
node.classList.toggle("alert", alert && value > 0);
|
|
128
114
|
}
|
|
129
115
|
|
|
130
116
|
function renderTargets() {
|
|
@@ -138,8 +124,8 @@ function renderTargets() {
|
|
|
138
124
|
const detail = target.platform === "ios" ? `${target.build?.proposedScheme || "scheme unresolved"} · ${target.runtime?.surface || "iOS Simulator"}`
|
|
139
125
|
: target.platform === "android" ? `${target.runtime?.applicationId || "application id unresolved"} · ${target.build?.task || "assembleDebug"}`
|
|
140
126
|
: `${target.runtime?.management || "runtime unresolved"} · ${target.build?.start || target.build?.tool || "web"}`;
|
|
141
|
-
return `<button type="button" class="target-card ${selected ? "selected" : ""}" data-target-id="${esc(target.id)}" aria-pressed="${selected ? "true" : "false"}"><span class="platform-icon ${esc(target.platform)}">${target.platform === "ios" ? "
|
|
142
|
-
}).join("") : '<div class="empty">
|
|
127
|
+
return `<button type="button" class="target-card ${selected ? "selected" : ""}" data-target-id="${esc(target.id)}" aria-pressed="${selected ? "true" : "false"}"><span class="platform-icon ${esc(target.platform)}">${esc(target.platform === "ios" ? "" : target.platform === "android" ? "▲" : "⌁")}</span><span><strong>${esc(target.name)}</strong><small>${esc(pretty(target.platform))} · ${esc(detail)}</small></span><em class="target-state ${esc(target.status || "")}">${esc(pretty(target.status || "detected"))}</em></button>`;
|
|
128
|
+
}).join("") : (state.project?.state?.inspected ? '<div class="empty">No iOS, Android or web target was detected in this repository.</div>' : '<div class="empty">Inspecting the repository for iOS, Android and web targets…</div>');
|
|
143
129
|
const target = currentTarget();
|
|
144
130
|
$("#target-status").textContent = target ? `${pretty(target.platform)} · ${target.name}` : targets.length > 1 ? "Selection required" : "No target selected";
|
|
145
131
|
$("#sidebar-target").textContent = target ? `${pretty(target.platform)} · ${target.name}` : "Select a target";
|
|
@@ -152,9 +138,10 @@ function renderTargets() {
|
|
|
152
138
|
$("#serial-field").classList.toggle("hidden", target?.platform !== "android");
|
|
153
139
|
$("#explore").disabled = !target;
|
|
154
140
|
$("#command-run").disabled = !target || !!state.activeJob;
|
|
141
|
+
$("#run-gate").disabled = !target || !!state.activeJob;
|
|
155
142
|
$("#explore").textContent = target && targets.length > 1 ? `Build & explore ${target.name}` : "Build, launch & explore";
|
|
156
143
|
$("#start-session").disabled = !target || state.live?.active === true;
|
|
157
|
-
$("#explore-help").textContent = !target ? (targets.length > 1 ? `Choose one of the ${targets.length} detected targets. Tapp will not select one for you.` : "
|
|
144
|
+
$("#explore-help").textContent = !target ? (targets.length > 1 ? `Choose one of the ${targets.length} detected targets. Tapp will not select one for you.` : "A runnable target is needed first.")
|
|
158
145
|
: target.platform === "ios" ? "Builds the selected scheme for an iOS simulator, installs it, then explores."
|
|
159
146
|
: target.platform === "android" ? "Builds the selected Gradle application, installs its APK, then explores."
|
|
160
147
|
: "Builds and starts the selected repository web application, then explores it in Chromium.";
|
|
@@ -171,7 +158,7 @@ function renderDeviceChrome(target) {
|
|
|
171
158
|
}
|
|
172
159
|
|
|
173
160
|
// The device panel shows whichever real surface exists right now: an interactive session's frame,
|
|
174
|
-
// else the newest screenshot the running
|
|
161
|
+
// else the newest screenshot the running operation wrote. Nothing is synthesized.
|
|
175
162
|
function frameSource() {
|
|
176
163
|
if (state.live?.active) return "/api/live-session/frame";
|
|
177
164
|
if (state.activeJob && state.jobHasFrame) return `/api/jobs/${state.activeJob}/frame`;
|
|
@@ -227,7 +214,7 @@ function renderLiveSession() {
|
|
|
227
214
|
const target = element.id || element.label;
|
|
228
215
|
const input = element.role === "input" || element.secure || /input|textfield|edittext|textarea|secure/i.test(element.type);
|
|
229
216
|
return `<button class="live-control" data-live-control="${index}" data-live-target="${esc(target)}" data-live-input="${input ? "true" : "false"}" ${element.enabled === false || (!element.hittable && !input) ? "disabled" : ""}><span><strong>${esc(element.label || element.id)}</strong><small>${esc(element.id || "No stable identifier")} · ${esc(element.type || element.role || "control")}</small></span><em>${input ? "fill" : element.clickable ? "tap" : "inspect"}</em></button>`;
|
|
230
|
-
}).join("") : '<div class="empty">The current screen exposed no semantic controls. Add accessibility identifiers
|
|
217
|
+
}).join("") : '<div class="empty">The current screen exposed no semantic controls. Add accessibility identifiers to the app to drive it here.</div>';
|
|
231
218
|
refreshLiveFrame();
|
|
232
219
|
}
|
|
233
220
|
|
|
@@ -236,60 +223,6 @@ function renderRequirements() {
|
|
|
236
223
|
$("#requirements").innerHTML = requirements.length ? `<ul class="requirements">${requirements.map((item) => `<li class="${item.severity === "blocking" ? "blocking" : ""}"><span>${item.severity === "blocking" ? "!" : "i"}</span><div><b>${esc(item.message)}</b><small>${esc(item.remediation || "")}</small></div></li>`).join("")}</ul>` : "";
|
|
237
224
|
}
|
|
238
225
|
|
|
239
|
-
function renderMap(map) {
|
|
240
|
-
const nodes = map?.nodes || [];
|
|
241
|
-
const edges = map?.edges || [];
|
|
242
|
-
const controls = nodes.reduce((total, node) => total + (node.controls?.length || 0), 0);
|
|
243
|
-
const covered = nodes.filter((node) => (node.coveredBy?.tasks?.length || 0) + (node.coveredBy?.contracts?.length || 0) > 0).length;
|
|
244
|
-
$("#map-metric").textContent = `${nodes.length} states · ${edges.length} transitions`;
|
|
245
|
-
$("#map-canvas").innerHTML = nodes.length ? nodes.map((node, index) => {
|
|
246
|
-
const tasks = node.coveredBy?.tasks || [], contracts = node.coveredBy?.contracts || [];
|
|
247
|
-
return `<article class="map-node" style="--node-order:${index}"><div class="map-node-title"><span>${String(index + 1).padStart(2, "0")}</span><b>${esc(node.stateLabel || node.name)}</b></div><small>${node.controls?.length || 0} controls · ${esc((node.platforms || []).join("/"))} · ${esc(node.status)}</small><div class="coverage">${tasks.map((item) => `<span class="tag covered">Task: ${esc(item)}</span>`).join("")}${contracts.map((item) => `<span class="tag covered">Contract: ${esc(item)}</span>`).join("")}${!tasks.length && !contracts.length ? '<span class="tag">uncovered</span>' : ""}</div></article>`;
|
|
248
|
-
}).join("") : '<div class="empty">Explore the real product to build its map.</div>';
|
|
249
|
-
$("#coverage-summary").innerHTML = `<p class="eyebrow">MAP COVERAGE</p><dl><div><dt>States</dt><dd>${nodes.length}</dd></div><div><dt>Transitions</dt><dd>${edges.length}</dd></div><div><dt>Controls</dt><dd>${controls}</dd></div><div><dt>Covered states</dt><dd>${covered}/${nodes.length}</dd></div></dl><p class="coverage-honesty">Coverage means observed and contract-linked UI states—not source-line coverage or proof of every possible input.</p>`;
|
|
250
|
-
$("#overview-coverage").innerHTML = `<div><strong>${nodes.length}</strong><small>states observed</small></div><div><strong>${edges.length}</strong><small>transitions</small></div><div><strong>${controls}</strong><small>semantic controls</small></div><div><strong>${nodes.length ? Math.round(covered / nodes.length * 100) : 0}%</strong><small>contract-linked</small></div>`;
|
|
251
|
-
$("#transition-list").innerHTML = edges.length ? `<h3>Observed transitions</h3>${edges.map((edge) => `<div><code>${esc(edge.from)}</code><span>→ ${esc(edge.action?.target || edge.action?.label || edge.action || "action")} →</span><code>${esc(edge.to)}</code><em>${esc(edge.status)}</em></div>`).join("")}` : "";
|
|
252
|
-
$("#screen-list").innerHTML = nodes.length ? `<table><thead><tr><th>Screen / state</th><th>Platform</th><th>Status</th><th>Controls</th><th>Coverage</th></tr></thead><tbody>${nodes.map((node) => `<tr><td><strong>${esc(node.stateLabel || node.name)}</strong><small><code>${esc(node.id)}</code></small></td><td>${esc((node.platforms || []).join(", "))}</td><td>${esc(node.status)}</td><td>${node.controls?.length || 0}</td><td>${(node.coveredBy?.tasks?.length || 0)} Tasks · ${(node.coveredBy?.contracts?.length || 0)} contracts</td></tr>`).join("")}</tbody></table>` : '<div class="empty">No observed screens yet.</div>';
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
function decisionValue(value) { return value === "accepted" ? "approved" : value || "pending"; }
|
|
256
|
-
|
|
257
|
-
function planHtml(plan) {
|
|
258
|
-
const items = plan?.items || [];
|
|
259
|
-
return items.length ? items.map((item) => `<article class="plan-item" data-id="${esc(item.id)}" data-criticality="${esc(item.criticality)}" data-original="${esc(decisionValue(item.decision))}"><div><div class="plan-title"><h3>${esc(item.title)}</h3><span class="criticality ${esc(item.criticality)}">${esc(item.criticality)}</span></div><p>${esc(item.businessValue)}</p><small class="risk">${esc(item.risk || item.requiredValidation || "Requires real deterministic validation")}</small><div class="plan-meta"><span class="tag">${esc(item.origin)}</span>${(item.platforms || []).map((platform) => `<span class="tag">${esc(platform)}</span>`).join("")}${(item.actors || []).map((actor) => `<span class="tag">actor: ${esc(actor)}</span>`).join("")}${item.generation ? `<span class="tag ${item.generation.trusted ? "covered" : "warning"}">${esc(item.generation.status)}</span>` : ""}</div></div><select aria-label="Decision for ${esc(item.title)}" ${item.origin === "committed" ? "disabled" : ""}><option value="pending" ${decisionValue(item.decision)==="pending"?"selected":""}>Needs review</option><option value="approved" ${decisionValue(item.decision)==="approved"?"selected":""}>Approve</option><option value="deferred" ${decisionValue(item.decision)==="deferred"?"selected":""}>Defer</option><option value="rejected" ${decisionValue(item.decision)==="rejected"?"selected":""}>Reject</option></select></article>`).join("") : '<div class="empty">Inspect and explore to create a grounded release plan.</div>';
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function renderPlan(plan) {
|
|
263
|
-
const items = plan?.items || [];
|
|
264
|
-
const pending = items.filter((item) => item.decision === "pending").length;
|
|
265
|
-
$("#plan-status").textContent = plan ? `${items.length} proposed · ${pending} pending` : "No plan";
|
|
266
|
-
$("#plan-list").innerHTML = planHtml(plan);
|
|
267
|
-
$("#coverage-plan-list").innerHTML = planHtml(plan);
|
|
268
|
-
setCount("#contract-count", state.project?.model?.artifacts?.contracts?.length || 0);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
function renderArtifacts(model, plan) {
|
|
272
|
-
const tasks = model?.artifacts?.tasks || [];
|
|
273
|
-
const contracts = model?.artifacts?.contracts || [];
|
|
274
|
-
const flows = state.project?.flows || [];
|
|
275
|
-
const items = plan?.items || [];
|
|
276
|
-
const generated = items.filter((item) => item.generation?.path);
|
|
277
|
-
const drafts = generated.filter((item) => item.generation.status !== "promoted");
|
|
278
|
-
const validatedDrafts = drafts.filter((item) => item.generation?.trusted === true || item.generation?.status === "validated-draft");
|
|
279
|
-
const promoted = generated.filter((item) => item.generation.status === "promoted");
|
|
280
|
-
$("#validation-status").textContent = validatedDrafts.length ? "Validated drafts available" : drafts.length ? `${drafts.length} untrusted draft(s)` : promoted.length || contracts.length ? "Promoted suite ready" : "Not generated";
|
|
281
|
-
$("#generate").disabled = !items.some((item) => item.decision === "approved" && item.origin !== "committed" && !item.generation?.path);
|
|
282
|
-
$("#validate-drafts").disabled = !drafts.length || !currentTarget();
|
|
283
|
-
$("#promote").disabled = !validatedDrafts.length;
|
|
284
|
-
const artifacts = [
|
|
285
|
-
...contracts.map((item) => ({ kind:"Contract", name:item.name, path:item.path, status:"committed", platforms:item.platforms || [] })),
|
|
286
|
-
...tasks.map((item) => ({ kind:"Task", name:item.name, path:item.path, status:"committed", platforms:item.platforms || Object.keys(item.implementations || {}) })),
|
|
287
|
-
...flows.map((item) => ({ kind:"Flow", name:item.name, path:item.path, status:item.status, platforms:[item.platform], steps:item.steps })),
|
|
288
|
-
...drafts.map((item) => ({ kind:"Draft", name:item.name, path:item.generation.path, status:item.generation.trusted ? "validated" : item.generation.status || "untrusted", platforms:item.platforms || [] })),
|
|
289
|
-
];
|
|
290
|
-
$("#artifact-list").innerHTML = artifacts.length ? artifacts.map((item) => `<div class="artifact"><span><b>${esc(item.kind)}</b> · ${esc(item.name)} <span class="tag ${item.status === "validated" || item.status === "committed" ? "covered" : "warning"}">${esc(item.status)}</span>${item.steps ? ` <small>${item.steps} steps</small>` : ""}</span><span>${(item.platforms || []).map((platform) => `<i>${esc(platform)}</i>`).join("")}<code>${esc(item.path)}</code></span></div>`).join("") : '<div class="empty">No generated or committed Tasks, Flows, or contracts yet.</div>';
|
|
291
|
-
}
|
|
292
|
-
|
|
293
226
|
function latestRun() { return (state.project?.evidence || []).find((run) => run.report) || null; }
|
|
294
227
|
|
|
295
228
|
function renderDecision(run) {
|
|
@@ -299,7 +232,7 @@ function renderDecision(run) {
|
|
|
299
232
|
card.className = "decision-card neutral";
|
|
300
233
|
$("#decision-title").textContent = "Not evaluated";
|
|
301
234
|
$("#decision-detail").textContent = "Run a conclusive release gate to establish evidence.";
|
|
302
|
-
$("#overview-evidence").innerHTML = '<div class="empty">No
|
|
235
|
+
$("#overview-evidence").innerHTML = '<div class="empty">No run yet.</div>';
|
|
303
236
|
return;
|
|
304
237
|
}
|
|
305
238
|
const report = latest.report;
|
|
@@ -313,77 +246,51 @@ function renderDecision(run) {
|
|
|
313
246
|
$("#overview-evidence").innerHTML = `<div class="latest-run-line"><span class="verdict-dot ${esc(cssClass)}"></span><div><strong>${esc(report.headline || pretty(cssClass))}</strong><small>${esc(pretty(report.platform || "unknown"))} · ${compactDate(latest.createdAt)} · ${(report.contracts || []).filter((item) => item.passed).length}/${(report.contracts || []).length} contracts passed</small></div></div><p>${esc((report.gate?.reasons || ["No blocking release-gate reason reported."])[0])}</p>${reportLink(report)}`;
|
|
314
247
|
}
|
|
315
248
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (!latest) { $("#latest-evidence").innerHTML = '<div class="empty">No release run yet.</div>'; return; }
|
|
323
|
-
const report = latest.report;
|
|
324
|
-
const failed = report.gate?.failed === true;
|
|
325
|
-
$("#latest-evidence").innerHTML = `<article class="evidence-card"><small>Gate</small><strong class="${failed ? "bad" : "good"}">${failed ? "BLOCK" : "PASS"}</strong><small>${esc(report.platform || "unknown")}</small></article><article class="evidence-card"><small>Coverage</small><strong>${report.screensExplored || 0}</strong><small>states · ${report.actionsPerformed || 0} actions</small></article><article class="evidence-card"><small>Contracts</small><strong>${(report.contracts || []).filter((item) => item.passed).length}/${(report.contracts || []).length}</strong><small>deterministic replay</small></article><article class="evidence-card"><small>Findings</small><strong>${report.findingCounts?.total ?? (report.findings || []).length}</strong><small>${report.regression?.new?.length || 0} new vs baseline</small></article><article class="evidence-card wide"><small>Decision rationale</small><h3>${esc(report.headline || "Release gate completed")}</h3><ul class="findings-list">${(report.gate?.reasons || ["No blocking gate reason reported."]).map((item) => `<li>${esc(item)}</li>`).join("")}</ul>${reportLink(report, "Open full report")}</article><article class="evidence-card wide"><small>Known boundary</small><h3>What this run did not prove</h3><ul class="findings-list">${(report.notChecked || ["Only observed and committed journeys are covered."]).slice(0, 5).map((item) => `<li>${esc(item)}</li>`).join("")}</ul></article>`;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function allFindings() {
|
|
329
|
-
return (state.project?.evidence || []).flatMap((run) => (run.report?.findings || []).map((finding, index) => ({ ...finding, __runId:run.id, __createdAt:run.createdAt, __id:`${run.id}:${finding.findingKey || finding.id || index}` })));
|
|
249
|
+
// Runs are two kinds with one list: gate runs on the repository (`report`) and read-only website
|
|
250
|
+
// audits (`audit`). Both open the report page the engine wrote.
|
|
251
|
+
function allRuns() {
|
|
252
|
+
const gates = (state.project?.evidence || []).map((run) => ({ ...run, kind:"gate" }));
|
|
253
|
+
const audits = (state.audits || []).map((audit) => ({ id:audit.id, createdAt:audit.createdAt, kind:"audit", audit }));
|
|
254
|
+
return [...gates, ...audits].sort((a, b) => String(b.createdAt || "").localeCompare(String(a.createdAt || "")));
|
|
330
255
|
}
|
|
331
256
|
|
|
332
|
-
function
|
|
333
|
-
|
|
334
|
-
function renderFindings() {
|
|
335
|
-
const filter = $("#finding-filter").value;
|
|
336
|
-
const findings = allFindings().filter((finding) => filter === "all" || String(finding.severity).toLowerCase() === filter);
|
|
337
|
-
setCount("#finding-count", allFindings().filter((finding) => ["critical", "high"].includes(String(finding.severity).toLowerCase())).length, { alert:true });
|
|
338
|
-
$("#findings-list").innerHTML = findings.length ? findings.map((finding) => `<button class="finding-row ${finding.__id === state.selectedFindingId ? "selected" : ""}" data-finding-id="${esc(finding.__id)}"><span class="severity ${esc(String(finding.severity || "info").toLowerCase())}"></span><span><strong>${esc(findingTitle(finding))}</strong><small>${esc(finding.screen || finding.category || pretty(finding.type))} · ${compactDate(finding.__createdAt)}</small></span><em>${esc(finding.severity || "info")}</em></button>`).join("") : '<div class="empty">No findings match this view.</div>';
|
|
339
|
-
const selected = findings.find((finding) => finding.__id === state.selectedFindingId) || findings[0];
|
|
340
|
-
if (selected) state.selectedFindingId = selected.__id;
|
|
341
|
-
$("#finding-detail").innerHTML = selected ? `<p class="eyebrow">${esc(selected.severity || "FINDING")}</p><h2>${esc(findingTitle(selected))}</h2><p>${esc(selected.description || selected.detail || "Tapp recorded this behavior during the release run.")}</p><dl class="detail-dl"><div><dt>Screen</dt><dd>${esc(selected.screen || "—")}</dd></div><div><dt>Category</dt><dd>${esc(pretty(selected.category || selected.type || "unknown"))}</dd></div><div><dt>Target</dt><dd>${esc(selected.target || "—")}</dd></div><div><dt>Run</dt><dd><code>${esc(selected.__runId)}</code></dd></div></dl>${selected.evidence ? `<h3>Evidence</h3><pre>${esc(typeof selected.evidence === "string" ? selected.evidence : JSON.stringify(selected.evidence, null, 2))}</pre>` : ""}<p class="honesty">Finding acknowledgement and suppression are not yet shared across browser, CLI, and CI, so this browser does not offer a misleading local-only “ignore” button.</p>` : '<div class="empty">Select a finding to inspect its evidence.</div>';
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function renderRuns(runs) {
|
|
257
|
+
function renderRuns() {
|
|
258
|
+
const runs = allRuns();
|
|
345
259
|
setCount("#run-count", runs.length);
|
|
346
260
|
$("#runs-list").innerHTML = runs.length ? runs.map((run) => {
|
|
261
|
+
if (run.kind === "audit") {
|
|
262
|
+
const audit = run.audit;
|
|
263
|
+
const issues = audit.issueCount || 0;
|
|
264
|
+
const host = (() => { try { return new URL(audit.url).host; } catch { return audit.url; } })();
|
|
265
|
+
return `<button class="run-row ${run.id === state.selectedRunId ? "selected" : ""}" data-run-id="${esc(run.id)}"><span class="run-status ${issues ? "inconclusive" : "ready"}">${issues ? "!" : "✓"}</span><span><strong>Audit · ${esc(host)}</strong><small>${compactDate(run.createdAt)} · ${audit.pagesAudited || 0} page${audit.pagesAudited === 1 ? "" : "s"} · read-only</small></span><em>${issues ? `${issues} issue${issues === 1 ? "" : "s"}` : "Nothing broken"}</em></button>`;
|
|
266
|
+
}
|
|
347
267
|
const report = run.report;
|
|
348
268
|
const failed = report?.gate?.failed === true;
|
|
349
|
-
// Status reflects the gate outcome (pass/fail/inconclusive), mapped to the existing CSS classes.
|
|
350
269
|
const status = !report ? run.status
|
|
351
270
|
: report.gate?.outcome === "fail" || failed ? "blocked"
|
|
352
271
|
: report.gate?.outcome === "inconclusive" || report.inconclusive ? "inconclusive"
|
|
353
272
|
: report.gate?.outcome === "pass" ? "ready" : "completed";
|
|
354
273
|
return `<button class="run-row ${run.id === state.selectedRunId ? "selected" : ""}" data-run-id="${esc(run.id)}"><span class="run-status ${esc(status)}">${failed ? "×" : report ? "✓" : "…"}</span><span><strong>${esc(report?.headline || `Release run ${run.id.slice(-8)}`)}</strong><small>${compactDate(run.createdAt)} · ${esc(pretty(report?.platform || "unknown"))}</small></span><em>${esc(pretty(status))}</em></button>`;
|
|
355
|
-
}).join("") : '<div class="empty">No release
|
|
274
|
+
}).join("") : '<div class="empty">No runs yet. Run a release check, or audit a website above.</div>';
|
|
356
275
|
const selected = runs.find((run) => run.id === state.selectedRunId) || runs[0];
|
|
357
276
|
if (selected) state.selectedRunId = selected.id;
|
|
358
277
|
renderRunDetail(selected);
|
|
359
278
|
}
|
|
360
279
|
|
|
280
|
+
function renderAuditDetail(audit) {
|
|
281
|
+
const counts = audit.findingCounts || {};
|
|
282
|
+
const issues = audit.issues || [];
|
|
283
|
+
$("#run-detail").innerHTML = `<div class="run-detail-head"><div><p class="eyebrow">READ-ONLY AUDIT</p><h2>${esc(audit.url)}</h2><small><code>${esc(audit.id)}</code> · ${compactDate(audit.createdAt)} · nothing was clicked</small></div>${evidenceLink(audit.id, "Visual report")}</div><div class="run-stats"><div><strong>${audit.pagesAudited || 0}</strong><small>pages</small></div><div><strong>${issues.length}</strong><small>distinct issues</small></div><div><strong>${counts.high || 0}</strong><small>high</small></div><div><strong>${counts.medium || 0}</strong><small>medium</small></div></div><h3>Issues</h3>${issues.length ? `<ul class="detail-list">${issues.slice(0, 40).map((issue) => `<li><b>${esc(issue.severity)}</b> · ${esc(issue.title)}${issue.pages?.length > 1 ? ` <small>(${issue.pages.length} pages)</small>` : ""}</li>`).join("")}</ul>` : '<p class="muted">Nothing broken was observed. This says the pages are served without structural defects, not that the site works.</p>'}<h3>Not checked</h3><ul class="detail-list boundary">${(audit.notChecked || []).slice(0, 6).map((item) => `<li>${esc(item)}</li>`).join("")}</ul>`;
|
|
284
|
+
}
|
|
285
|
+
|
|
361
286
|
function renderRunDetail(run) {
|
|
287
|
+
if (run?.kind === "audit") { renderAuditDetail(run.audit); return; }
|
|
362
288
|
if (!run?.report) { $("#run-detail").innerHTML = '<div class="empty">Select a completed run to inspect its evidence.</div>'; return; }
|
|
363
289
|
const report = run.report;
|
|
364
290
|
const contracts = report.contracts || [];
|
|
365
291
|
$("#run-detail").innerHTML = `<div class="run-detail-head"><div><p class="eyebrow">${esc(report.gate?.failed ? "BLOCKED" : report.inconclusive ? "INCONCLUSIVE" : "RELEASE RUN")}</p><h2>${esc(report.headline || "Release gate completed")}</h2><small><code>${esc(run.id)}</code> · ${compactDate(run.createdAt)}</small></div>${reportLink(report, "Visual report")}</div><div class="run-stats"><div><strong>${report.screensExplored || 0}</strong><small>states</small></div><div><strong>${report.actionsPerformed || 0}</strong><small>actions</small></div><div><strong>${contracts.filter((item) => item.passed).length}/${contracts.length}</strong><small>contracts</small></div><div><strong>${report.findingCounts?.total ?? (report.findings || []).length}</strong><small>findings</small></div></div><h3>Decision rationale</h3><ul class="detail-list">${(report.gate?.reasons || ["No blocking gate reason reported."]).map((item) => `<li>${esc(item)}</li>`).join("")}</ul><h3>Deterministic contracts</h3>${contracts.length ? contracts.map((contract) => `<div class="contract-result"><span class="${contract.passed ? "pass" : "fail"}">${contract.passed ? "✓" : "×"}</span><div><strong>${esc(contract.title || contract.name || contract.path)}</strong><small>${esc(contract.detail || contract.path || "Deterministic replay")}</small></div></div>`).join("") : '<p class="muted">No committed release contracts applied to this target.</p>'}<h3>What Tapp checked</h3><ul class="detail-list">${(report.checkedFor || []).slice(0, 8).map((item) => `<li>${esc(item)}</li>`).join("")}</ul><h3>Not checked</h3><ul class="detail-list boundary">${(report.notChecked || []).slice(0, 8).map((item) => `<li>${esc(item)}</li>`).join("")}</ul>`;
|
|
366
292
|
}
|
|
367
293
|
|
|
368
|
-
function renderApplication(model) {
|
|
369
|
-
if (!model) { $("#application-model").innerHTML = '<div class="empty">Inspect the repository to build its Application Model.</div>'; return; }
|
|
370
|
-
const sections = [
|
|
371
|
-
["Targets", model.targets || [], (item) => `${pretty(item.platform)} · ${item.name}`, (item) => item.status],
|
|
372
|
-
["Capabilities", model.capabilities || [], (item) => item.name, (item) => item.status],
|
|
373
|
-
["Actors", model.actors || [], (item) => item.name, (item) => (item.roles || []).join(", ") || item.session],
|
|
374
|
-
["Business entities", model.entities || [], (item) => item.name, (item) => item.status],
|
|
375
|
-
["Critical journeys", model.journeys || [], (item) => item.name, (item) => item.criticality],
|
|
376
|
-
["Revenue paths", model.revenuePaths || [], (item) => item.name, (item) => item.criticality],
|
|
377
|
-
];
|
|
378
|
-
$("#application-model").innerHTML = sections.map(([title, items, label, meta]) => `<article class="panel model-card"><p class="eyebrow">${esc(title.toUpperCase())}</p><strong>${items.length}</strong>${items.length ? `<ul>${items.slice(0, 12).map((item) => `<li><span>${esc(label(item))}</span><small>${esc(meta(item) || "observed")}</small></li>`).join("")}</ul>` : '<p class="muted">Nothing grounded yet.</p>'}</article>`).join("");
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function renderRunners() {
|
|
382
|
-
$("#runner-list").innerHTML = (state.session?.runners || []).map((runner) => `<div class="runner-row"><span class="runner-dot ${esc(runner.status)}"></span><div><strong>${esc(runner.label)}</strong><small>${esc(pretty(runner.platform))} · ${esc(pretty(runner.status))}${runner.remediation ? ` · ${esc(runner.remediation)}` : ""}</small></div></div>`).join("");
|
|
383
|
-
const actors = state.project?.actors || [];
|
|
384
|
-
$("#actor-list").innerHTML = actors.length ? actors.map((actor) => `<div class="actor-row"><span>${esc(actor.name.slice(0, 1).toUpperCase())}</span><div><strong>${esc(actor.name)}</strong><small>${esc((actor.roles || []).join(", ") || actor.session || "actor")} · ${(actor.credentialRequirements || []).length} credential binding(s)</small></div></div>`).join("") : '<p class="muted">No actors are configured. Tapp will ask only when a reviewed journey requires one.</p>';
|
|
385
|
-
}
|
|
386
|
-
|
|
387
294
|
const chatTime = (value) => new Intl.DateTimeFormat(undefined, { hour:"numeric", minute:"2-digit" }).format(new Date(value));
|
|
388
295
|
|
|
389
296
|
function renderChat() {
|
|
@@ -401,7 +308,6 @@ function syncTranscriptFromJob(name, job) {
|
|
|
401
308
|
if (state.transcriptSource !== key) { state.transcript = [{ at: job.createdAt, kind: "phase", text: `${pretty(name)} started` }]; state.transcriptSource = key; }
|
|
402
309
|
const seen = state.transcript.length - 1;
|
|
403
310
|
for (const entry of job.progress.slice(seen)) {
|
|
404
|
-
// Engine progress lines can carry a whole contract result; the transcript keeps the lede.
|
|
405
311
|
const text = String(entry.text || "").trim().replace(/\s+/g, " ").slice(0, 220).replace(/(.{219}).+/, "$1…");
|
|
406
312
|
if (!text) continue;
|
|
407
313
|
const last = state.transcript.at(-1);
|
|
@@ -413,11 +319,15 @@ function syncTranscriptFromJob(name, job) {
|
|
|
413
319
|
function finishTranscript(name, job) {
|
|
414
320
|
if (job.status === "failed") { state.transcript.push({ at: job.completedAt || new Date().toISOString(), kind: "failed", text: job.error?.message || `${pretty(name)} failed` }); return; }
|
|
415
321
|
const report = job.result?.report || job.result;
|
|
416
|
-
|
|
322
|
+
const findings = report?.findings || (report?.issues || []);
|
|
323
|
+
for (const finding of findings.slice(0, 12)) {
|
|
417
324
|
const severity = String(finding.severity || "info").toLowerCase();
|
|
418
|
-
state.transcript.push({ at: job.completedAt || new Date().toISOString(), kind: "finding", severity, text: `${pretty(severity)} issue${finding.screen ? ` on ${finding.screen}` : ""}: ${finding.title || finding.message || finding.type
|
|
325
|
+
state.transcript.push({ at: job.completedAt || new Date().toISOString(), kind: "finding", severity, text: `${pretty(severity)} issue${finding.screen ? ` on ${finding.screen}` : ""}: ${finding.title || finding.message || finding.type}` });
|
|
419
326
|
}
|
|
420
|
-
const summary = report?.headline
|
|
327
|
+
const summary = report?.headline
|
|
328
|
+
|| (name === "gate" ? (job.result?.passed === false ? "Release gate blocked this revision." : "Release gate completed.")
|
|
329
|
+
: name === "audit" ? `Audit complete — ${job.result?.pagesAudited || 0} page(s), ${job.result?.issueCount || 0} distinct issue(s), nothing clicked.`
|
|
330
|
+
: `${pretty(name)} completed`);
|
|
421
331
|
state.transcript.push({ at: job.completedAt || new Date().toISOString(), kind: "summary", text: summary });
|
|
422
332
|
}
|
|
423
333
|
|
|
@@ -427,7 +337,7 @@ function seedIdleTranscript() {
|
|
|
427
337
|
const report = latest?.report;
|
|
428
338
|
state.transcript = report
|
|
429
339
|
? [{ at: latest.createdAt, kind: "summary", text: `Last run: ${report.headline || "release run completed"} · ${report.screensExplored || 0} states · ${(report.findings || []).length} findings` }]
|
|
430
|
-
: [{ at: new Date().toISOString(), kind: "phase", text: state.project?.state?.inspected ? "Ready. Run a release check to watch Tapp build, launch
|
|
340
|
+
: [{ at: new Date().toISOString(), kind: "phase", text: state.project?.state?.inspected ? "Ready. Run a release check to watch Tapp build, launch and explore the real app." : "Inspecting the project…" }];
|
|
431
341
|
}
|
|
432
342
|
|
|
433
343
|
function renderCommandState(job = null, name = "") {
|
|
@@ -436,6 +346,7 @@ function renderCommandState(job = null, name = "") {
|
|
|
436
346
|
pill.classList.toggle("hidden", !running);
|
|
437
347
|
pill.classList.toggle("running", running);
|
|
438
348
|
$("#command-run").disabled = running || !currentTarget();
|
|
349
|
+
$("#run-gate").disabled = running || !currentTarget();
|
|
439
350
|
$("#run-progress").classList.toggle("hidden", !running);
|
|
440
351
|
$("#idle-badges").classList.toggle("hidden", running);
|
|
441
352
|
if (running) {
|
|
@@ -452,37 +363,29 @@ function renderCommandState(job = null, name = "") {
|
|
|
452
363
|
$("#idle-badges").innerHTML = [
|
|
453
364
|
target ? `<span><b>${esc(pretty(target.platform))}</b> · ${esc(target.name)}</span>` : "<span>No target selected</span>",
|
|
454
365
|
runner ? `<span>${esc(runner.label)} · ${esc(pretty(runner.status))}</span>` : "",
|
|
455
|
-
`<span>Idle · ${target ? "Ready for next release check" : "Choose a target to run"}</span>`,
|
|
366
|
+
`<span>Idle · ${target ? "Ready for the next release check" : "Choose a target to run"}</span>`,
|
|
456
367
|
].filter(Boolean).join("");
|
|
457
368
|
}
|
|
458
369
|
|
|
459
|
-
function renderJourney(status) {
|
|
460
|
-
const flags = productJourneyFlags({ status, hasTarget:!!currentTarget(), hasEvidence:(state.project?.evidence || []).some((run) => run.report) });
|
|
461
|
-
$$(".journey button").forEach((button, index) => button.classList.toggle("done", !!flags[index]));
|
|
462
|
-
}
|
|
463
|
-
|
|
464
370
|
function renderProject() {
|
|
465
371
|
const project = state.project;
|
|
466
372
|
renderRepositoryChrome();
|
|
467
|
-
if (!project?.connected) {
|
|
373
|
+
if (!project?.connected) {
|
|
374
|
+
// No repository: the Studio is still a run viewer for website audits.
|
|
375
|
+
if (state.audits.length && state.activeView === "runs") { showProduct(); renderRuns(); return; }
|
|
376
|
+
showSourceOnboarding();
|
|
377
|
+
renderRuns();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
468
380
|
showProduct();
|
|
469
381
|
$("#app-name").textContent = project.application?.name || "Unnamed product";
|
|
470
382
|
const platforms = project.application?.platforms?.map(pretty).join(" · ") || "Targets not inspected";
|
|
471
|
-
$("#app-summary").textContent = `${platforms} · ${project.capabilities?.length || 0} known capabilities
|
|
472
|
-
$("#connect-status").textContent = project.state.inspected ? (project.state.explored ? "Observed" : "Inspected") : "Not inspected";
|
|
383
|
+
$("#app-summary").textContent = `${platforms} · ${project.capabilities?.length || 0} known capabilities`;
|
|
473
384
|
renderTargets();
|
|
474
385
|
renderRequirements();
|
|
475
|
-
renderMap(project.map);
|
|
476
|
-
renderPlan(project.plan);
|
|
477
|
-
renderArtifacts(project.model, project.plan);
|
|
478
386
|
renderDecision();
|
|
479
|
-
|
|
480
|
-
renderRuns(project.evidence || []);
|
|
481
|
-
renderFindings();
|
|
482
|
-
renderApplication(project.model);
|
|
483
|
-
renderRunners();
|
|
387
|
+
renderRuns();
|
|
484
388
|
renderLiveSession();
|
|
485
|
-
renderJourney(project.state);
|
|
486
389
|
seedIdleTranscript();
|
|
487
390
|
renderChat();
|
|
488
391
|
renderCommandState();
|
|
@@ -494,40 +397,25 @@ async function refreshSession() {
|
|
|
494
397
|
const local = state.session.mode === "local";
|
|
495
398
|
$("#mode-pill").textContent = local ? "Self-host · this machine" : "Cloud · outbound runner";
|
|
496
399
|
$("#onboarding-mode-pill").textContent = local ? "Self-host · this machine" : "Cloud";
|
|
497
|
-
$("#privacy-note-title").textContent = local ? "Your code stays on this machine
|
|
498
|
-
$("#privacy-note-detail").textContent = local ? "Ordinary exploration, replay, and merge decisions are deterministic and require no API key. This machine must stay open while Tapp runs." : "Builds and application runs execute on your connected outbound runner; the hosted control plane keeps the evidence.";
|
|
499
|
-
$("#website-connect-link").classList.toggle("hidden", local);
|
|
500
|
-
$(".local-runner-card").classList.toggle("hidden", local);
|
|
501
|
-
$("#website-source-note").textContent = local
|
|
502
|
-
? "In the local Studio, website checks run from the CLI: npx -y @aarwitz/tapp@latest explore https://example.com --read-only. Website projects live in the hosted Studio."
|
|
503
|
-
: "You confirm you own the site before Tapp observes it. Accounts and backend access are configured privately, never in chat.";
|
|
504
|
-
if (!local) {
|
|
505
|
-
$("#github-source-copy").textContent = "Repository upload works now. GitHub App connection will add selected-repository import without changing the product workflow.";
|
|
506
|
-
$("#github-source-note").textContent = "Use This Mac now; GitHub can be added independently later.";
|
|
507
|
-
const result = await api("/api/repositories/local");
|
|
508
|
-
$("#local-repositories").innerHTML = result.repositories?.length
|
|
509
|
-
? result.repositories.map(repo=>`<button class="primary" data-local-runner="${esc(repo.runnerId)}" data-local-repository="${esc(repo.id)}">Use ${esc(repo.name)} <small>${esc(repo.runnerName)}${repo.branch ? ` · ${esc(repo.branch)}`:""}</small></button>`).join("")
|
|
510
|
-
: '<small>Start the Tapp runner on this Mac to make local checkouts available.</small>';
|
|
511
|
-
}
|
|
400
|
+
$("#privacy-note-title").textContent = local ? "Your code stays on this machine." : "Your repository stays in your private Tapp workspace.";
|
|
512
401
|
}
|
|
513
402
|
|
|
514
403
|
async function refresh() {
|
|
515
|
-
[state.project, state.live] = await Promise.all([api("/api/project"), api("/api/live-session")]);
|
|
404
|
+
[state.project, state.live, { audits: state.audits = [] }] = await Promise.all([api("/api/project"), api("/api/live-session"), api("/api/audits").catch(() => ({ audits: [] }))]);
|
|
516
405
|
renderProject();
|
|
517
406
|
}
|
|
518
407
|
|
|
519
408
|
async function runOperation(name, body = {}) {
|
|
520
|
-
if (state.activeJob) throw new Error("Another
|
|
409
|
+
if (state.activeJob) throw new Error("Another operation is still running");
|
|
521
410
|
const started = await api(`/api/operations/${name}`, { method:"POST", body:JSON.stringify(body) });
|
|
522
411
|
state.activeJob = started.job.id;
|
|
523
412
|
const drawer = $("#operation-drawer");
|
|
524
413
|
drawer.classList.remove("hidden");
|
|
525
|
-
$("#operation-title").textContent = pretty(name);
|
|
526
|
-
$("#operation-progress").textContent = "Starting
|
|
414
|
+
$("#operation-title").textContent = name === "audit" ? "Read-only audit" : pretty(name);
|
|
415
|
+
$("#operation-progress").textContent = "Starting";
|
|
527
416
|
$("#operation-progress-bar").style.width = "6%";
|
|
528
417
|
syncTranscriptFromJob(name, started.job);
|
|
529
|
-
renderCommandState(started.job, name);
|
|
530
|
-
renderChat();
|
|
418
|
+
if ($("#product-shell").classList.contains("hidden") === false) { renderCommandState(started.job, name); renderChat(); }
|
|
531
419
|
try {
|
|
532
420
|
while (true) {
|
|
533
421
|
await new Promise((resolve) => setTimeout(resolve, 650));
|
|
@@ -537,8 +425,7 @@ async function runOperation(name, body = {}) {
|
|
|
537
425
|
const ratio = progress?.current && progress?.total ? Math.min(92, Math.round(progress.current / progress.total * 100)) : Math.min(88, 8 + job.progress.length * 4);
|
|
538
426
|
$("#operation-progress-bar").style.width = `${ratio}%`;
|
|
539
427
|
syncTranscriptFromJob(name, job);
|
|
540
|
-
renderCommandState(job, name);
|
|
541
|
-
renderChat();
|
|
428
|
+
if ($("#product-shell").classList.contains("hidden") === false) { renderCommandState(job, name); renderChat(); }
|
|
542
429
|
const screen = [...job.progress].reverse().find((entry) => entry.screen)?.screen;
|
|
543
430
|
if (screen && !state.live?.active) $("#live-screen-title").textContent = screen;
|
|
544
431
|
if (job.frame && !state.jobHasFrame) { state.jobHasFrame = true; refreshLiveFrame(); }
|
|
@@ -547,10 +434,10 @@ async function runOperation(name, body = {}) {
|
|
|
547
434
|
if (job.status === "failed") throw new Error(job.error?.message || "Operation failed");
|
|
548
435
|
if (job.status !== "completed") throw new Error(`Operation ended in an unknown '${job.status}' state`);
|
|
549
436
|
$("#operation-progress-bar").style.width = "100%";
|
|
550
|
-
if (name === "ci-preview") { $("#ci-preview").textContent = job.result.workflow; $("#ci-preview").classList.remove("hidden"); }
|
|
551
437
|
if (name === "session-act" && job.result.status !== "ok") toast(job.result.detail || `The action ended with ${job.result.status}`, true);
|
|
552
438
|
else if (name === "session-save-flow") toast(`Saved ${job.result.path} as a reviewable deterministic Flow`);
|
|
553
439
|
else if (name === "gate" && job.result.passed === false) toast("The release gate blocked this revision. Tapp did not soften the result.", true);
|
|
440
|
+
else if (name === "audit") toast(`Audited ${job.result.pagesAudited} page(s) — ${job.result.issueCount} distinct issue(s)`);
|
|
554
441
|
else toast(`${pretty(name)} completed`);
|
|
555
442
|
return job.result;
|
|
556
443
|
}
|
|
@@ -561,182 +448,20 @@ async function runOperation(name, body = {}) {
|
|
|
561
448
|
await refreshSession();
|
|
562
449
|
await refresh();
|
|
563
450
|
} finally {
|
|
564
|
-
// The operation is not visually complete until the resulting
|
|
565
|
-
// product snapshot/frame has rendered. Hiding this earlier caused stale
|
|
566
|
-
// decisions and black loading frames to flash after successful work.
|
|
451
|
+
// The operation is not visually complete until the resulting snapshot/frame has rendered.
|
|
567
452
|
drawer.classList.add("hidden");
|
|
568
453
|
}
|
|
569
454
|
}
|
|
570
455
|
}
|
|
571
456
|
|
|
572
|
-
async function
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
if (!target || target.status !== "configured") {
|
|
582
|
-
toast("Repository inspected. Resolve the reported target requirement before Tapp builds it.", true);
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
toast(`Detected ${pretty(target.platform)} target ${target.name}. Building and exploring now.`);
|
|
586
|
-
await runOperation("initialize", operationPayload({ explore:true }));
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
const BLOCKED_UPLOAD_DIRECTORIES = new Set([".git", ".gradle", ".next", ".DS_Store", "Carthage", "DerivedData", "Pods", "build", "dist", "node_modules", "vendor"]);
|
|
590
|
-
|
|
591
|
-
function normalizeInputFiles(fileList) {
|
|
592
|
-
const files = [...fileList];
|
|
593
|
-
const prefix = files[0]?.webkitRelativePath?.split("/")[0] || "repository";
|
|
594
|
-
return files.flatMap((file) => {
|
|
595
|
-
const raw = file.webkitRelativePath || file.name;
|
|
596
|
-
const parts = raw.split("/");
|
|
597
|
-
if (parts[0] === prefix && parts.length > 1) parts.shift();
|
|
598
|
-
if (!parts.length || parts.some((part) => BLOCKED_UPLOAD_DIRECTORIES.has(part))) return [];
|
|
599
|
-
return [{ file, path:parts.join("/") }];
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
async function entriesFromWebkitEntry(entry, prefix = "") {
|
|
604
|
-
if (entry.isFile) {
|
|
605
|
-
const file = await new Promise((resolve, reject) => entry.file(resolve, reject));
|
|
606
|
-
return [{ file, path:`${prefix}${entry.name}` }];
|
|
607
|
-
}
|
|
608
|
-
if (!entry.isDirectory || BLOCKED_UPLOAD_DIRECTORIES.has(entry.name)) return [];
|
|
609
|
-
const reader = entry.createReader();
|
|
610
|
-
const children = [];
|
|
611
|
-
while (true) {
|
|
612
|
-
const batch = await new Promise((resolve, reject) => reader.readEntries(resolve, reject));
|
|
613
|
-
if (!batch.length) break;
|
|
614
|
-
children.push(...batch);
|
|
615
|
-
}
|
|
616
|
-
const nextPrefix = prefix ? `${prefix}${entry.name}/` : "";
|
|
617
|
-
return (await Promise.all(children.map((child) => entriesFromWebkitEntry(child, nextPrefix)))).flat();
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
async function entriesFromDrop(event) {
|
|
621
|
-
const items = [...event.dataTransfer.items];
|
|
622
|
-
const entries = items.map((item) => item.webkitGetAsEntry?.()).filter(Boolean);
|
|
623
|
-
if (entries.length) {
|
|
624
|
-
const rootName = entries.length === 1 && entries[0].isDirectory ? entries[0].name : "repository";
|
|
625
|
-
const files = (await Promise.all(entries.map((entry) => entriesFromWebkitEntry(entry)))).flat();
|
|
626
|
-
return { name:rootName, entries:files };
|
|
627
|
-
}
|
|
628
|
-
return { name:"repository", entries:[...event.dataTransfer.files].map((file) => ({ file, path:file.name })) };
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// The webkitdirectory input (and some drop implementations) silently exclude hidden
|
|
632
|
-
// entries, which destroys committed .tapp/ config. The File System Access picker
|
|
633
|
-
// enumerates hidden files, so it is preferred wherever it exists.
|
|
634
|
-
async function entriesFromDirectoryHandle(handle, prefix = "") {
|
|
635
|
-
const entries = [];
|
|
636
|
-
for await (const child of handle.values()) {
|
|
637
|
-
if (BLOCKED_UPLOAD_DIRECTORIES.has(child.name)) continue;
|
|
638
|
-
if (child.kind === "file") entries.push({ file:await child.getFile(), path:`${prefix}${child.name}` });
|
|
639
|
-
else if (child.kind === "directory") entries.push(...await entriesFromDirectoryHandle(child, `${prefix}${child.name}/`));
|
|
640
|
-
}
|
|
641
|
-
return entries;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
async function chooseFolder() {
|
|
645
|
-
if (!window.showDirectoryPicker) { $("#folder-input").click(); return; }
|
|
646
|
-
let handle;
|
|
647
|
-
try {
|
|
648
|
-
handle = await window.showDirectoryPicker({ mode:"read" });
|
|
649
|
-
} catch (error) {
|
|
650
|
-
if (error?.name === "AbortError") return;
|
|
651
|
-
$("#folder-input").click();
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
await uploadRepository(handle.name, await entriesFromDirectoryHandle(handle), { hiddenComplete:true });
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
async function uploadRepository(name, entries, { hiddenComplete = false } = {}) {
|
|
658
|
-
if (!entries.length) throw new Error("The selected folder contained no uploadable source files");
|
|
659
|
-
if (state.activeJob) throw new Error("Another product operation is still running");
|
|
660
|
-
state.activeJob = "repository-upload";
|
|
661
|
-
const drawer = $("#operation-drawer");
|
|
662
|
-
drawer.classList.remove("hidden");
|
|
663
|
-
$("#operation-title").textContent = "Import local repository";
|
|
664
|
-
$("#operation-progress-bar").style.width = "2%";
|
|
665
|
-
let upload;
|
|
666
|
-
try {
|
|
667
|
-
const bytes = entries.reduce((total, entry) => total + entry.file.size, 0);
|
|
668
|
-
upload = await api("/api/repositories/uploads", { method:"POST", body:JSON.stringify({ name, expectedFiles:entries.length, expectedBytes:bytes }) });
|
|
669
|
-
let cursor = 0;
|
|
670
|
-
let completed = 0;
|
|
671
|
-
const worker = async () => {
|
|
672
|
-
while (cursor < entries.length) {
|
|
673
|
-
const entry = entries[cursor++];
|
|
674
|
-
$("#operation-progress").textContent = `Uploading ${entry.path} · ${completed}/${entries.length}`;
|
|
675
|
-
const response = await fetch(apiRoute(`/api/repositories/uploads/${upload.id}/files`), { method:"PUT", headers:{ "content-type":"application/octet-stream", "x-tapp-csrf":state.csrf, "x-tapp-relative-path":encodeURIComponent(entry.path) }, body:entry.file });
|
|
676
|
-
const result = await response.json().catch(() => ({}));
|
|
677
|
-
if (!response.ok) throw new Error(result.error || `Could not upload ${entry.path}`);
|
|
678
|
-
completed += 1;
|
|
679
|
-
$("#operation-progress-bar").style.width = `${Math.max(3, Math.round(completed / entries.length * 94))}%`;
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
await Promise.all(Array.from({ length:Math.min(4, entries.length) }, worker));
|
|
683
|
-
await api(`/api/repositories/uploads/${upload.id}/complete`, { method:"POST", body:"{}" });
|
|
684
|
-
$("#operation-progress-bar").style.width = "100%";
|
|
685
|
-
const hasHiddenEntries = entries.some((entry) => entry.path.split("/").some((part) => part.startsWith(".")));
|
|
686
|
-
if (!hiddenComplete && !hasHiddenEntries) {
|
|
687
|
-
toast("Imported, but no hidden files (like .tapp/) came through — this browser's folder picker skips them. Committed Tapp config was not uploaded.", true);
|
|
688
|
-
} else {
|
|
689
|
-
toast("Repository imported into an isolated Tapp workspace");
|
|
690
|
-
}
|
|
691
|
-
} catch (error) {
|
|
692
|
-
if (upload?.id) await api(`/api/repositories/uploads/${upload.id}`, { method:"DELETE" }).catch(() => {});
|
|
693
|
-
throw error;
|
|
694
|
-
} finally {
|
|
695
|
-
state.activeJob = null;
|
|
696
|
-
drawer.classList.add("hidden");
|
|
697
|
-
await refreshSession();
|
|
698
|
-
await refresh();
|
|
699
|
-
}
|
|
700
|
-
await beginRepositoryJourney();
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
async function openGithubDialog() {
|
|
704
|
-
const dialog = $("#github-dialog");
|
|
705
|
-
dialog.showModal();
|
|
706
|
-
$("#github-repositories").innerHTML = '<div class="empty">Loading authorized repositories…</div>';
|
|
707
|
-
try {
|
|
708
|
-
const result = await api("/api/repositories/github");
|
|
709
|
-
state.githubRepositories = result.repositories || [];
|
|
710
|
-
if (result.unavailable) {
|
|
711
|
-
$("#github-repositories").innerHTML = `<div class="remediation"><strong>GitHub connection is not configured yet</strong><p>${esc(result.unavailable)}</p></div>`;
|
|
712
|
-
} else renderGithubRepositories();
|
|
713
|
-
} catch (error) {
|
|
714
|
-
$("#github-repositories").innerHTML = `<div class="remediation"><strong>GitHub needs attention</strong><p>${esc(error.message)}</p></div>`;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function renderGithubRepositories() {
|
|
719
|
-
const query = $("#github-search").value.trim().toLowerCase();
|
|
720
|
-
const repositories = state.githubRepositories.filter((repository) => !query || repository.nameWithOwner.toLowerCase().includes(query));
|
|
721
|
-
$("#github-repositories").innerHTML = repositories.length ? repositories.map((repository) => `<button type="button" data-github-repository="${esc(repository.nameWithOwner)}"><span class="repository-icon">${esc(repository.name.slice(0, 1).toUpperCase())}</span><span><strong>${esc(repository.nameWithOwner)}</strong><small>${repository.private ? "Private" : "Public"} · ${esc(repository.permission || "authorized")} · ${esc(repository.defaultBranch || "default branch")}</small></span><em>Connect</em></button>`).join("") : '<div class="empty">No repositories match this search.</div>';
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
async function connectGithub(repository) {
|
|
725
|
-
$("#github-dialog").close();
|
|
726
|
-
await runOperation("connect-github", { repository });
|
|
727
|
-
await beginRepositoryJourney();
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
function reviewDecisions() {
|
|
731
|
-
const decisions = { approve:[], reject:[], defer:[] };
|
|
732
|
-
$$("#plan-list .plan-item").forEach((node) => {
|
|
733
|
-
const value = node.querySelector("select").value;
|
|
734
|
-
if (value === node.dataset.original) return;
|
|
735
|
-
if (value === "approved") decisions.approve.push(node.dataset.id);
|
|
736
|
-
if (value === "rejected") decisions.reject.push(node.dataset.id);
|
|
737
|
-
if (value === "deferred") decisions.defer.push(node.dataset.id);
|
|
738
|
-
});
|
|
739
|
-
return decisions;
|
|
457
|
+
async function auditWebsite(url) {
|
|
458
|
+
const trimmed = String(url || "").trim();
|
|
459
|
+
if (!/^https?:\/\//i.test(trimmed)) { toast("Enter an http(s) URL to audit", true); return; }
|
|
460
|
+
const result = await runOperation("audit", { url: trimmed });
|
|
461
|
+
state.selectedRunId = result?.capture?.id || state.selectedRunId;
|
|
462
|
+
showProduct();
|
|
463
|
+
activateView("runs");
|
|
464
|
+
renderRuns();
|
|
740
465
|
}
|
|
741
466
|
|
|
742
467
|
document.addEventListener("click", (event) => {
|
|
@@ -746,28 +471,11 @@ document.addEventListener("click", (event) => {
|
|
|
746
471
|
if (targetButton) {
|
|
747
472
|
state.selectedTargetId = targetButton.dataset.targetId;
|
|
748
473
|
localStorage.setItem(targetStorageKey(), state.selectedTargetId);
|
|
749
|
-
renderTargets();
|
|
474
|
+
renderTargets();
|
|
475
|
+
renderCommandState();
|
|
750
476
|
}
|
|
751
477
|
const runButton = event.target.closest("[data-run-id]");
|
|
752
|
-
if (runButton) { state.selectedRunId = runButton.dataset.runId; renderRuns(
|
|
753
|
-
const findingButton = event.target.closest("[data-finding-id]");
|
|
754
|
-
if (findingButton) { state.selectedFindingId = findingButton.dataset.findingId; renderFindings(); }
|
|
755
|
-
const coverageButton = event.target.closest("[data-coverage-tab]");
|
|
756
|
-
if (coverageButton) {
|
|
757
|
-
$$('[data-coverage-tab]').forEach((button) => button.classList.toggle("active", button === coverageButton));
|
|
758
|
-
$$('[data-coverage-panel]').forEach((panel) => panel.classList.toggle("active", panel.dataset.coveragePanel === coverageButton.dataset.coverageTab));
|
|
759
|
-
}
|
|
760
|
-
const githubButton = event.target.closest("[data-github-repository]");
|
|
761
|
-
if (githubButton) connectGithub(githubButton.dataset.githubRepository).catch((error) => toast(error.message, true));
|
|
762
|
-
const jump = event.target.closest("[data-jump]");
|
|
763
|
-
if (jump) {
|
|
764
|
-
const destination = jump.dataset.jump;
|
|
765
|
-
const view = ["map"].includes(destination) ? "coverage" : ["contracts", "validate"].includes(destination) ? "contracts" : destination === "evidence" ? "settings" : "overview";
|
|
766
|
-
activateView(view);
|
|
767
|
-
setTimeout(() => document.getElementById(destination)?.scrollIntoView({ behavior:"smooth", block:"start" }), 20);
|
|
768
|
-
}
|
|
769
|
-
const localButton = event.target.closest("[data-local-repository]");
|
|
770
|
-
if (localButton) api("/api/repositories/local", { method:"POST", body:JSON.stringify({ runnerId:localButton.dataset.localRunner, repositoryId:localButton.dataset.localRepository }) }).then(async () => { state.selectedTargetId = ""; await refreshSession(); await refresh(); }).catch((error) => toast(error.message, true));
|
|
478
|
+
if (runButton) { state.selectedRunId = runButton.dataset.runId; renderRuns(); }
|
|
771
479
|
const liveControl = event.target.closest("[data-live-control]");
|
|
772
480
|
if (liveControl) {
|
|
773
481
|
const target = liveControl.dataset.liveTarget;
|
|
@@ -780,55 +488,35 @@ document.addEventListener("click", (event) => {
|
|
|
780
488
|
}
|
|
781
489
|
});
|
|
782
490
|
|
|
491
|
+
document.addEventListener("submit", (event) => {
|
|
492
|
+
const form = event.target.closest("form.audit-form");
|
|
493
|
+
if (!form) return;
|
|
494
|
+
event.preventDefault();
|
|
495
|
+
auditWebsite(form.elements.url.value).catch((error) => toast(error.message, true));
|
|
496
|
+
});
|
|
497
|
+
|
|
783
498
|
$$("[data-brand-home]").forEach((button) => button.addEventListener("click", () => state.project?.connected ? (showProduct(), activateView("overview")) : showSourceOnboarding()));
|
|
784
499
|
$("#command-run").addEventListener("click", () => runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)));
|
|
785
500
|
$("#refresh-project").addEventListener("click", () => refresh().catch((error) => toast(error.message, true)));
|
|
786
501
|
$("#change-source").addEventListener("click", showSourceOnboarding);
|
|
787
|
-
$("#settings-add-repository").addEventListener("click", showSourceOnboarding);
|
|
788
|
-
$("#browse-folder").addEventListener("click", () => chooseFolder().catch((error) => toast(error.message, true)));
|
|
789
|
-
$("#repository-drop-zone").addEventListener("keydown", (event) => { if (["Enter", " "].includes(event.key)) { event.preventDefault(); chooseFolder().catch((error) => toast(error.message, true)); } });
|
|
790
|
-
$("#folder-input").addEventListener("change", (event) => {
|
|
791
|
-
const entries = normalizeInputFiles(event.target.files);
|
|
792
|
-
const name = event.target.files[0]?.webkitRelativePath?.split("/")[0] || "repository";
|
|
793
|
-
uploadRepository(name, entries).catch((error) => toast(error.message, true));
|
|
794
|
-
event.target.value = "";
|
|
795
|
-
});
|
|
796
|
-
for (const name of ["dragenter", "dragover"]) $("#repository-drop-zone").addEventListener(name, (event) => { event.preventDefault(); $("#repository-drop-zone").classList.add("dragging"); });
|
|
797
|
-
for (const name of ["dragleave", "drop"]) $("#repository-drop-zone").addEventListener(name, (event) => { event.preventDefault(); $("#repository-drop-zone").classList.remove("dragging"); });
|
|
798
|
-
$("#repository-drop-zone").addEventListener("drop", async (event) => { try { const dropped = await entriesFromDrop(event); await uploadRepository(dropped.name, dropped.entries); } catch (error) { toast(error.message, true); } });
|
|
799
|
-
$("#connect-github").addEventListener("click", () => openGithubDialog());
|
|
800
|
-
$("#github-search").addEventListener("input", renderGithubRepositories);
|
|
801
502
|
$("#repository-switcher").addEventListener("change", async (event) => {
|
|
802
|
-
if (event.target.value === "__add__") { showSourceOnboarding(); return; }
|
|
803
503
|
try { await api("/api/repositories/select", { method:"POST", body:JSON.stringify({ id:event.target.value }) }); state.selectedTargetId = ""; await refreshSession(); await refresh(); } catch (error) { toast(error.message, true); }
|
|
804
504
|
});
|
|
805
|
-
$("#inspect").addEventListener("click", () => runOperation("initialize", { write:true }).catch((error) => toast(error.message, true)));
|
|
806
505
|
$("#explore").addEventListener("click", () => runOperation("initialize", operationPayload({ explore:true })).catch((error) => toast(error.message, true)));
|
|
807
506
|
$("#start-session").addEventListener("click", () => runOperation("session-start", operationPayload()).catch((error) => toast(error.message, true)));
|
|
808
507
|
$("#refresh-live-session").addEventListener("click", () => runOperation("session-act", { action:"tree" }).catch((error) => toast(error.message, true)));
|
|
809
508
|
$("#end-session").addEventListener("click", () => runOperation("session-end").catch((error) => toast(error.message, true)));
|
|
810
|
-
$("#save-live-flow").addEventListener("click", () => { const name=$("#live-flow-name").value.trim(); if (!name) { toast("Name the Flow before saving it", true); return; } runOperation("session-save-flow",
|
|
509
|
+
$("#save-live-flow").addEventListener("click", () => { const name=$("#live-flow-name").value.trim(); if (!name) { toast("Name the Flow before saving it", true); return; } runOperation("session-save-flow", { name }).catch((error) => toast(error.message, true)); });
|
|
811
510
|
$("#live-tap").addEventListener("click", () => { const id=$("#live-action-target").value.trim(); if (!id) { toast("Choose or enter a semantic target", true); return; } runOperation("session-act", { action:"tap", id }).catch((error) => toast(error.message, true)); });
|
|
812
511
|
$("#live-type").addEventListener("click", () => { const id=$("#live-action-target").value.trim(), text=$("#live-action-text").value; if (!id) { toast("Choose or enter a field", true); return; } runOperation("session-act", { action:"type", id, text }).catch((error) => toast(error.message, true)); });
|
|
813
512
|
$("#live-back").addEventListener("click", () => runOperation("session-act", { action:"back" }).catch((error) => toast(error.message, true)));
|
|
814
513
|
$("#live-swipe").addEventListener("click", () => runOperation("session-act", { action:"swipe", direction:"up" }).catch((error) => toast(error.message, true)));
|
|
815
|
-
$("#approve-high").addEventListener("click", () => $$("#plan-list .plan-item").forEach((node) => { if (["high", "critical"].includes(node.dataset.criticality) && node.querySelector("select").value === "pending") node.querySelector("select").value = "approved"; }));
|
|
816
|
-
$("#defer-rest").addEventListener("click", () => $$("#plan-list .plan-item select").forEach((select) => { if (select.value === "pending") select.value = "deferred"; }));
|
|
817
|
-
$("#save-review").addEventListener("click", () => { const decisions = reviewDecisions(); if (![...decisions.approve, ...decisions.reject, ...decisions.defer].length) { toast("No review decisions changed"); return; } runOperation("review", decisions).catch((error) => toast(error.message, true)); });
|
|
818
|
-
$("#generate").addEventListener("click", () => runOperation("generate").catch((error) => toast(error.message, true)));
|
|
819
|
-
$("#validate-drafts").addEventListener("click", () => runOperation("validate", operationPayload()).catch((error) => toast(error.message, true)));
|
|
820
|
-
$("#promote").addEventListener("click", () => runOperation("promote").catch((error) => toast(error.message, true)));
|
|
821
514
|
$("#run-gate").addEventListener("click", () => runOperation("gate", operationPayload()).catch((error) => toast(error.message, true)));
|
|
822
|
-
$("#create-baseline").addEventListener("click", () => runOperation("baseline", operationPayload({ runId:$("#create-baseline").dataset.runId })).catch((error) => toast(error.message, true)));
|
|
823
|
-
$("#preview-ci").addEventListener("click", () => runOperation("ci-preview").catch((error) => toast(error.message, true)));
|
|
824
|
-
$("#install-ci").addEventListener("click", () => runOperation("ci-install").catch((error) => toast(error.message, true)));
|
|
825
|
-
$("#finding-filter").addEventListener("change", renderFindings);
|
|
826
515
|
|
|
827
516
|
try {
|
|
828
517
|
await refreshSession();
|
|
829
518
|
await refresh();
|
|
830
|
-
// A repository supplied by `tapp app /path`
|
|
831
|
-
//
|
|
832
|
-
// choice when detection is ambiguous.
|
|
519
|
+
// A repository supplied by `tapp app /path` is inspected immediately, then stops for an
|
|
520
|
+
// explicit target choice when detection is ambiguous.
|
|
833
521
|
if (state.project?.connected && !state.project?.state?.inspected) await runOperation("initialize", { write:true });
|
|
834
522
|
} catch (error) { toast(error.message, true); }
|