@mushi-mushi/ux 0.5.2 → 0.6.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/README.md +14 -0
- package/dist/cli.js +4320 -3985
- package/dist/index.d.ts +10 -3
- package/dist/index.js +112 -42
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -267,6 +267,8 @@ interface SessionOptions {
|
|
|
267
267
|
ignore?: readonly string[];
|
|
268
268
|
/** Write policy (guard.ts). Default read-only; fresh-eyes runs may write to the app's own origins (ADR 0053). */
|
|
269
269
|
policy?: GuardPolicy;
|
|
270
|
+
/** Cookies and storage a clean browser starts with (a sign-in done in another session); ignored with a profile. */
|
|
271
|
+
storageState?: Awaited<ReturnType<BrowserContext['storageState']>>;
|
|
270
272
|
}
|
|
271
273
|
declare function openSession(opts?: SessionOptions): Promise<BrowserSession>;
|
|
272
274
|
/**
|
|
@@ -1272,7 +1274,7 @@ interface FreshEyesStep {
|
|
|
1272
1274
|
capped?: boolean;
|
|
1273
1275
|
}
|
|
1274
1276
|
/** Why a session ended without reaching its goal. Measured causes are page facts; the last two are the model's. */
|
|
1275
|
-
type StallReason = 'signup_wall' | 'captcha' | 'external' | 'dead_end' | 'blocked' | 'error' | 'model_gave_up' | 'model_unavailable' | 'out_of_steps';
|
|
1277
|
+
type StallReason = 'signup_wall' | 'captcha' | 'external' | 'dead_end' | 'blocked' | 'error' | 'model_gave_up' | 'model_unavailable' | 'out_of_steps' | 'unverified';
|
|
1276
1278
|
interface FreshEyesSession {
|
|
1277
1279
|
index: number;
|
|
1278
1280
|
outcome: 'reached' | 'stalled';
|
|
@@ -2263,8 +2265,13 @@ declare const UPLOAD_PLATFORMS: readonly ["ios", "android", "flutter", "react_na
|
|
|
2263
2265
|
type UploadPlatform = (typeof UPLOAD_PLATFORMS)[number];
|
|
2264
2266
|
declare const UPLOAD_SOURCES: readonly ["maestro", "adb", "simctl", "sdk", "playwright", "other"];
|
|
2265
2267
|
type UploadSource = (typeof UPLOAD_SOURCES)[number];
|
|
2266
|
-
/** The server's caps (POST /v1/ux/captures). */
|
|
2268
|
+
/** The server's caps (POST /v1/ux/captures): screens in one request. */
|
|
2267
2269
|
declare const UPLOAD_MAX_PAGES = 60;
|
|
2270
|
+
/**
|
|
2271
|
+
* Screens in one check, sent in requests of UPLOAD_MAX_PAGES (the server's
|
|
2272
|
+
* UX_CAPTURES_MAX_RUN_PAGES; the console sends the same parts, 2026-12-04).
|
|
2273
|
+
*/
|
|
2274
|
+
declare const UPLOAD_MAX_RUN_PAGES = 200;
|
|
2268
2275
|
declare const UPLOAD_MAX_PNG_BYTES: number;
|
|
2269
2276
|
interface CapturedScreen {
|
|
2270
2277
|
folder: string;
|
|
@@ -2348,5 +2355,5 @@ interface Verdict {
|
|
|
2348
2355
|
}
|
|
2349
2356
|
declare function decide(input: VerdictInput): Verdict;
|
|
2350
2357
|
|
|
2351
|
-
export { AGENTS, CLIP_LIMITS, DEFAULT_CLIP_VIEWPORT, DEFAULT_JUDGE_MODEL, DEFAULT_SCORECARD_MODEL, DEFAULT_SCORECARD_VIEWPORT, DEFAULT_SETUP_COMMAND, FACTS_SCRIPT, POINTER_PROMPT, UPLOAD_MAX_PAGES, UPLOAD_MAX_PNG_BYTES, UPLOAD_PLATFORMS, UPLOAD_SOURCES, UX_DIMENSIONS, UX_RUBRIC, UX_SCORECARD_LIMITS, UX_SCORECARD_PROMPT_VERSION, UX_SCORE_ANCHORS, VIEWPORTS, accessibilityCap, anchoredDimensions, applyFacts, buildPacket, capFlows, captureFolder, capturePage, captureSurface, causeIsFileable, causeRank, causeReportBody, causeSlug, causeTokens, clampCaps, clipSlug, clipUploadBody, countedDimensions, cropTop, cursorCloudAdapter, cursorModel, dHash, decide, discover, effectiveClipCaps, evidenceSeenIn, fetchClipCaps, fileScorecard, findDesignFiles, firstJsonObject, getAgent, groupCauses, groupingPrompt, hammingHex, hasTimeForScreen, httpsRepoUrl, installGuard, isDestructiveLabel, isRequestAllowed, judgeSurface, loadState, localScorer, mergeGrouping, nativeFacts, newRunId, nextRoutePath, nodesToContent, normText, normalizeLink, openSession, overallScore, pageSystemPrompt, pageUserPrompt, parseFlow, parseMaestroHierarchy, parsePageAnswer, parseUiautomator, patternKeyFor, performanceCap, pixelDiff, planFiling, pngSize, probePenalty, quoteArg, rawScores, reactRouterPaths, readCaptures, readScreens, recordClips, rescorePage, routesFromSource, runDir, runFreshEyes, runProbes, runScorecard, runTerminalSetup, safeShotPath, sameCause, saveState, scorecardContext, scorecardMarkdown, scorecardMarker, scorecardPageKey, scorecardRows, scorecardRunId, screenPath, serverScorer, settle, sitemapPaths, startDashboard, startLoop, startSync, surfaceKey, syncConfigFromEnv, syncScorecard, toSnapshot, topCauses, typicalScore, unshuffle, uploadAllShots, uploadCaptures, uploadClips };
|
|
2358
|
+
export { AGENTS, CLIP_LIMITS, DEFAULT_CLIP_VIEWPORT, DEFAULT_JUDGE_MODEL, DEFAULT_SCORECARD_MODEL, DEFAULT_SCORECARD_VIEWPORT, DEFAULT_SETUP_COMMAND, FACTS_SCRIPT, POINTER_PROMPT, UPLOAD_MAX_PAGES, UPLOAD_MAX_PNG_BYTES, UPLOAD_MAX_RUN_PAGES, UPLOAD_PLATFORMS, UPLOAD_SOURCES, UX_DIMENSIONS, UX_RUBRIC, UX_SCORECARD_LIMITS, UX_SCORECARD_PROMPT_VERSION, UX_SCORE_ANCHORS, VIEWPORTS, accessibilityCap, anchoredDimensions, applyFacts, buildPacket, capFlows, captureFolder, capturePage, captureSurface, causeIsFileable, causeRank, causeReportBody, causeSlug, causeTokens, clampCaps, clipSlug, clipUploadBody, countedDimensions, cropTop, cursorCloudAdapter, cursorModel, dHash, decide, discover, effectiveClipCaps, evidenceSeenIn, fetchClipCaps, fileScorecard, findDesignFiles, firstJsonObject, getAgent, groupCauses, groupingPrompt, hammingHex, hasTimeForScreen, httpsRepoUrl, installGuard, isDestructiveLabel, isRequestAllowed, judgeSurface, loadState, localScorer, mergeGrouping, nativeFacts, newRunId, nextRoutePath, nodesToContent, normText, normalizeLink, openSession, overallScore, pageSystemPrompt, pageUserPrompt, parseFlow, parseMaestroHierarchy, parsePageAnswer, parseUiautomator, patternKeyFor, performanceCap, pixelDiff, planFiling, pngSize, probePenalty, quoteArg, rawScores, reactRouterPaths, readCaptures, readScreens, recordClips, rescorePage, routesFromSource, runDir, runFreshEyes, runProbes, runScorecard, runTerminalSetup, safeShotPath, sameCause, saveState, scorecardContext, scorecardMarkdown, scorecardMarker, scorecardPageKey, scorecardRows, scorecardRunId, screenPath, serverScorer, settle, sitemapPaths, startDashboard, startLoop, startSync, surfaceKey, syncConfigFromEnv, syncScorecard, toSnapshot, topCauses, typicalScore, unshuffle, uploadAllShots, uploadCaptures, uploadClips };
|
|
2352
2359
|
export type { AgentAdapter, AgentName, AgentRunOptions, AllowRule, AxeViolation, BrowserSession, Candidate, Capture, CapturedScreen, ClipFlow, ClipResult, ClipSkip, ClipUploadOutcome, CursorCloudDeps, Dashboard, DiscoverOptions, FreshAction, FreshAsk, FreshEyesFinding, FreshEyesOptions, FreshEyesPersona, FreshEyesResult, FreshEyesSession, FreshEyesStep, GuardPolicy, Identity, IterationRecord, JudgeClaim, JudgeOptions, JudgeVerdict, LayoutIssue, LoopEvent, LoopHandle, LoopOptions, NativeNode, Opinion, OpinionCategory, PacketInput, PageCapture, PageFacts, ParsedPageScore, Phase, PhaseName, ProbeResult, RecordClipsOptions, ReplayStep, RequirementKind, RunState, ScoreVia, ScorecardFileOutcome, ScorecardOptions, ScorecardPageResult, ScorecardResult, ScorecardRow, ScoredPage, Scorer, ServerClipCaps, StallReason, StepOutcome, SuccessCheck, Surface, SurfaceKind, SurfaceState, SurfaceStatus, SyncConfig, SyncHandle, TerminalHandoff, TerminalOptions, TerminalResult, UploadOptions, UploadPlatform, UploadResult, UploadSource, UxCause, UxCausePage, UxClaim, UxDimension, UxFilingPlan, UxIssue, UxPageFacts, UxPagePromptContext, UxPageScore, UxSeverity, Verdict, VerdictInput, Viewport, WriteMode };
|
package/dist/index.js
CHANGED
|
@@ -779,7 +779,7 @@ async function openSession(opts = {}) {
|
|
|
779
779
|
};
|
|
780
780
|
} else {
|
|
781
781
|
browser = await chromium.launch({ headless, ...channel });
|
|
782
|
-
context = await browser.newContext({ serviceWorkers: "block" });
|
|
782
|
+
context = await browser.newContext({ serviceWorkers: "block", ...opts.storageState ? { storageState: opts.storageState } : {} });
|
|
783
783
|
closeBrowser = () => browser.close();
|
|
784
784
|
}
|
|
785
785
|
const guard = await installGuard(context, opts.allow ?? [], { blocked: [] }, opts.policy);
|
|
@@ -3415,20 +3415,56 @@ function hasData(body) {
|
|
|
3415
3415
|
}
|
|
3416
3416
|
return true;
|
|
3417
3417
|
}
|
|
3418
|
-
|
|
3419
|
-
if (!hasSuccessCheck(c)) return
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3418
|
+
function goalVerdict(c, now, start2) {
|
|
3419
|
+
if (!hasSuccessCheck(c)) return { verdict: "no" };
|
|
3420
|
+
const proofs = [];
|
|
3421
|
+
const weak = [];
|
|
3422
|
+
let strong = false;
|
|
3423
|
+
if (c.url) {
|
|
3424
|
+
if (!urlMatches(c.url, now.url)) return { verdict: "no" };
|
|
3425
|
+
strong = true;
|
|
3426
|
+
proofs.push(`the address ${pathOf(now.url)} matched ${c.url}`);
|
|
3427
|
+
}
|
|
3428
|
+
if (c.api) {
|
|
3429
|
+
if (!now.apiHasData) return { verdict: "no" };
|
|
3430
|
+
strong = true;
|
|
3431
|
+
proofs.push(`${c.api} answered with data`);
|
|
3424
3432
|
}
|
|
3425
|
-
if (c.
|
|
3433
|
+
if (c.text) {
|
|
3434
|
+
const re = new RegExp(c.text, "i");
|
|
3435
|
+
const hit = re.exec(now.bodyText);
|
|
3436
|
+
if (!hit) return { verdict: "no" };
|
|
3437
|
+
if (re.test(start2.bodyText)) weak.push(`"${hit[0]}" was already on the start page`);
|
|
3438
|
+
else if (!re.test(now.mainText)) weak.push(`"${hit[0]}" showed only outside the page's main content (a menu, header or footer)`);
|
|
3439
|
+
else proofs.push(`"${hit[0]}" appeared in the page's main content`);
|
|
3440
|
+
}
|
|
3441
|
+
if (c.selector) {
|
|
3442
|
+
if (!now.selectorVisible) return { verdict: "no" };
|
|
3443
|
+
if (start2.selectorVisible) weak.push(`${c.selector} was already on the start page`);
|
|
3444
|
+
else proofs.push(`${c.selector} appeared`);
|
|
3445
|
+
}
|
|
3446
|
+
if (weak.length && !strong) return { verdict: "weak", detail: weak.join("; ").slice(0, 240) };
|
|
3447
|
+
return { verdict: "pass", detail: [...proofs, ...weak].join("; ").slice(0, 240) };
|
|
3448
|
+
}
|
|
3449
|
+
async function goalSeen(page, c) {
|
|
3450
|
+
const texts = await page.evaluate(() => {
|
|
3451
|
+
const body = document.body;
|
|
3452
|
+
const main = document.querySelector('main, [role="main"]');
|
|
3453
|
+
let mainText = main?.innerText ?? "";
|
|
3454
|
+
if (!main && body) {
|
|
3455
|
+
const copy = body.cloneNode(true);
|
|
3456
|
+
for (const el of copy.querySelectorAll('header, nav, aside, footer, [role="navigation"], [role="banner"], [role="contentinfo"]')) el.remove();
|
|
3457
|
+
mainText = copy.textContent ?? "";
|
|
3458
|
+
}
|
|
3459
|
+
return { mainText, bodyText: body?.innerText ?? "" };
|
|
3460
|
+
}).catch(() => ({ mainText: "", bodyText: "" }));
|
|
3461
|
+
const selectorVisible = c.selector ? await page.locator(c.selector).first().isVisible({ timeout: 1e3 }).catch(() => false) : void 0;
|
|
3462
|
+
let apiHasData;
|
|
3426
3463
|
if (c.api) {
|
|
3427
3464
|
const res = await page.context().request.get(c.api, { timeout: 15e3 }).catch(() => null);
|
|
3428
|
-
|
|
3429
|
-
if (!hasData(await res.json().catch(() => null))) return false;
|
|
3465
|
+
apiHasData = !!res && res.ok() && hasData(await res.json().catch(() => null));
|
|
3430
3466
|
}
|
|
3431
|
-
return
|
|
3467
|
+
return { url: page.url(), mainText: texts.mainText, bodyText: texts.bodyText, selectorVisible, apiHasData };
|
|
3432
3468
|
}
|
|
3433
3469
|
var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
3434
3470
|
function extractSetupValues(text) {
|
|
@@ -3910,6 +3946,23 @@ async function runSession(x) {
|
|
|
3910
3946
|
if (firstSignals.length) landing.signals = firstSignals.map((s) => s.kind);
|
|
3911
3947
|
for (const s of firstSignals) x.addCandidate({ kind: "signal", signal: s, screen: pagePath(new URL(s.url).pathname), steps: [], session: index });
|
|
3912
3948
|
await record(landing);
|
|
3949
|
+
const startSeen = hasSuccessCheck(opts.success) ? await goalSeen(page, opts.success) : { url: "", mainText: "", bodyText: "" };
|
|
3950
|
+
let weakGoal = null;
|
|
3951
|
+
const reachedWith = (detail) => {
|
|
3952
|
+
session.outcome = "reached";
|
|
3953
|
+
const last = session.steps[session.steps.length - 1];
|
|
3954
|
+
if (last) last.note = `${last.note ? `${last.note} \xB7 ` : ""}Goal check passed: ${detail}`.slice(0, 300);
|
|
3955
|
+
};
|
|
3956
|
+
const checkGoal = async () => {
|
|
3957
|
+
if (!hasSuccessCheck(opts.success)) return false;
|
|
3958
|
+
const g = goalVerdict(opts.success, await goalSeen(page, opts.success), startSeen);
|
|
3959
|
+
if (g.verdict === "pass") {
|
|
3960
|
+
reachedWith(g.detail);
|
|
3961
|
+
return true;
|
|
3962
|
+
}
|
|
3963
|
+
if (g.verdict === "weak") weakGoal = g.detail;
|
|
3964
|
+
return false;
|
|
3965
|
+
};
|
|
3913
3966
|
for (let n = 1; n <= x.maxSteps; n++) {
|
|
3914
3967
|
while (page.isClosed() && windows.length) {
|
|
3915
3968
|
page = windows.pop();
|
|
@@ -3924,10 +3977,7 @@ async function runSession(x) {
|
|
|
3924
3977
|
x.addCandidate({ kind: "captcha", screen, detail: "A captcha appeared on this screen.", steps: [...actions], session: index });
|
|
3925
3978
|
break;
|
|
3926
3979
|
}
|
|
3927
|
-
if (await
|
|
3928
|
-
session.outcome = "reached";
|
|
3929
|
-
break;
|
|
3930
|
-
}
|
|
3980
|
+
if (await checkGoal()) break;
|
|
3931
3981
|
const snapshot = redact(await screenForModel(page), identity);
|
|
3932
3982
|
const tAsk = performance.now();
|
|
3933
3983
|
const answer = await x.ask(
|
|
@@ -3971,7 +4021,8 @@ async function runSession(x) {
|
|
|
3971
4021
|
doneClaims++;
|
|
3972
4022
|
say(` step ${n}: the visitor thinks the goal is reached; the goal check says no`);
|
|
3973
4023
|
if (doneClaims >= 2) {
|
|
3974
|
-
stall(n, "
|
|
4024
|
+
if (weakGoal) stall(n, "unverified", `The goal check matched, but proves nothing about this visit: ${weakGoal}.`);
|
|
4025
|
+
else stall(n, "model_gave_up", "The visitor believed the goal was reached, but the goal check did not pass.");
|
|
3975
4026
|
session.opinions.push({ category: "confusing", why: "I thought I was done here.", screen, step: n, mainChars: facts.mainChars });
|
|
3976
4027
|
break;
|
|
3977
4028
|
}
|
|
@@ -4104,8 +4155,9 @@ async function runSession(x) {
|
|
|
4104
4155
|
}
|
|
4105
4156
|
}
|
|
4106
4157
|
if (session.outcome !== "reached" && !session.stall) {
|
|
4107
|
-
|
|
4108
|
-
|
|
4158
|
+
const reached = await checkGoal().catch(() => false);
|
|
4159
|
+
if (!reached && weakGoal) stall(session.steps.length, "unverified", `The goal check matched, but proves nothing about this visit: ${weakGoal}.`);
|
|
4160
|
+
else if (!reached) stall(session.steps.length, "out_of_steps", `The goal was not reached in ${x.maxSteps} steps.`);
|
|
4109
4161
|
}
|
|
4110
4162
|
} finally {
|
|
4111
4163
|
await ctx.close().catch(() => {
|
|
@@ -6982,6 +7034,7 @@ function sizeAndHead(file) {
|
|
|
6982
7034
|
var UPLOAD_PLATFORMS = ["ios", "android", "flutter", "react_native", "capacitor", "web", "other"];
|
|
6983
7035
|
var UPLOAD_SOURCES = ["maestro", "adb", "simctl", "sdk", "playwright", "other"];
|
|
6984
7036
|
var UPLOAD_MAX_PAGES = 60;
|
|
7037
|
+
var UPLOAD_MAX_RUN_PAGES = 200;
|
|
6985
7038
|
var UPLOAD_MAX_PNG_BYTES = 8 * 1024 * 1024;
|
|
6986
7039
|
function readScreens(dir, opts = {}) {
|
|
6987
7040
|
const root = join20(dir, "pages");
|
|
@@ -7024,7 +7077,7 @@ function readScreens(dir, opts = {}) {
|
|
|
7024
7077
|
if ((byPath.get(s.facts.key) ?? 0) > 1) s.facts = { ...s.facts, key: nameKeys[i] };
|
|
7025
7078
|
});
|
|
7026
7079
|
if (!out.length) throw new Error(`No screenshots in ${root}: each screen needs a settled.png (or early.png).`);
|
|
7027
|
-
if (out.length >
|
|
7080
|
+
if (out.length > UPLOAD_MAX_RUN_PAGES) throw new Error(`${out.length} screens; one check takes at most ${UPLOAD_MAX_RUN_PAGES}. Split the folder.`);
|
|
7028
7081
|
const keys = /* @__PURE__ */ new Set();
|
|
7029
7082
|
for (const s of out) {
|
|
7030
7083
|
if (keys.has(s.facts.key)) throw new Error(`Two screens have the key "${s.facts.key}". Give each its own name or facts.json key.`);
|
|
@@ -7050,6 +7103,11 @@ async function pool2(items, n, fn) {
|
|
|
7050
7103
|
};
|
|
7051
7104
|
await Promise.all(Array.from({ length: Math.max(1, Math.min(n, items.length)) }, worker));
|
|
7052
7105
|
}
|
|
7106
|
+
function uploadParts(screens, size = UPLOAD_MAX_PAGES) {
|
|
7107
|
+
const out = [];
|
|
7108
|
+
for (let i = 0; i < screens.length; i += size) out.push(screens.slice(i, i + size));
|
|
7109
|
+
return out;
|
|
7110
|
+
}
|
|
7053
7111
|
async function uploadCaptures(cfg, opts) {
|
|
7054
7112
|
const progress = opts.onProgress ?? (() => {
|
|
7055
7113
|
});
|
|
@@ -7058,28 +7116,38 @@ async function uploadCaptures(cfg, opts) {
|
|
|
7058
7116
|
const build = readBuild(opts.dir, opts.build, opts.ciCommit);
|
|
7059
7117
|
progress(`${screens.length} screen(s) to upload (${opts.platform}${opts.device ? `, ${opts.device}` : ""}${build.appVersion ? `, version ${build.appVersion}` : ", version not recorded"})`);
|
|
7060
7118
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7061
|
-
const
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7119
|
+
const parts = uploadParts(screens);
|
|
7120
|
+
let runId = "";
|
|
7121
|
+
const d = { reservedUsd: null, uploads: [] };
|
|
7122
|
+
for (const [i, part] of parts.entries()) {
|
|
7123
|
+
const sent = await api2(
|
|
7124
|
+
cfg,
|
|
7125
|
+
"/v1/ux/captures",
|
|
7126
|
+
{
|
|
7127
|
+
method: "POST",
|
|
7128
|
+
body: JSON.stringify({
|
|
7129
|
+
...i > 0 ? { runId } : {},
|
|
7130
|
+
platform: opts.platform,
|
|
7131
|
+
...opts.device ? { device: opts.device } : {},
|
|
7132
|
+
...opts.source ? { source: opts.source } : {},
|
|
7133
|
+
...opts.app ? { app: opts.app } : {},
|
|
7134
|
+
...opts.viewport ? { viewport: opts.viewport } : {},
|
|
7135
|
+
...opts.maxCostUsd !== void 0 ? { maxCostUsd: opts.maxCostUsd } : {},
|
|
7136
|
+
...i === 0 && parts.length > 1 ? { totalPages: screens.length } : {},
|
|
7137
|
+
...build,
|
|
7138
|
+
pages: part.map((s) => ({ facts: s.facts, shots: s.shots }))
|
|
7139
|
+
})
|
|
7140
|
+
},
|
|
7141
|
+
doFetch
|
|
7142
|
+
);
|
|
7143
|
+
const where = parts.length > 1 ? ` (part ${i + 1} of ${parts.length}${runId ? `, run ${runId}` : ""})` : "";
|
|
7144
|
+
if (!sent.ok) throw new Error(`The captures were not accepted${where}: ${apiError2(sent)}`);
|
|
7145
|
+
const got = sent.body?.data;
|
|
7146
|
+
if (!got?.runId) throw new Error(`The API returned no run id${where}.`);
|
|
7147
|
+
runId = got.runId;
|
|
7148
|
+
if (i === 0) d.reservedUsd = got.reservedUsd ?? null;
|
|
7149
|
+
d.uploads.push(...got.uploads ?? []);
|
|
7150
|
+
}
|
|
7083
7151
|
const byKey = new Map(screens.map((s) => [s.facts.key, s]));
|
|
7084
7152
|
const shotNames = /* @__PURE__ */ new Map();
|
|
7085
7153
|
let uploaded = 0;
|
|
@@ -7140,7 +7208,8 @@ async function uploadCaptures(cfg, opts) {
|
|
|
7140
7208
|
started_at: startedAt,
|
|
7141
7209
|
finished_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7142
7210
|
error: null,
|
|
7143
|
-
|
|
7211
|
+
// A check sent in parts closes from the pages the server holds; one part sends them, as before.
|
|
7212
|
+
...parts.length > 1 ? { pages: [], fromSaved: true } : { pages: screens.map((s) => ({ facts: s.facts, score: scores.get(s.facts.key) ?? null, shots: shotNames.get(s.facts.key) ?? [], ...scores.has(s.facts.key) ? {} : { error: "Not scored." } })) },
|
|
7144
7213
|
causes: result.causes
|
|
7145
7214
|
})
|
|
7146
7215
|
},
|
|
@@ -7162,6 +7231,7 @@ export {
|
|
|
7162
7231
|
POINTER_PROMPT,
|
|
7163
7232
|
UPLOAD_MAX_PAGES,
|
|
7164
7233
|
UPLOAD_MAX_PNG_BYTES,
|
|
7234
|
+
UPLOAD_MAX_RUN_PAGES,
|
|
7165
7235
|
UPLOAD_PLATFORMS,
|
|
7166
7236
|
UPLOAD_SOURCES,
|
|
7167
7237
|
UX_DIMENSIONS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mushi-mushi/ux",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The bug button for apps built with AI. Local visual UX loop: maps a running app's pages, tabs and dialogs, runs your coding agent on each one against screenshot baselines, and shows before/after diffs, regressions and a pairwise judge.",
|
|
6
6
|
"type": "module",
|