@mushi-mushi/ux 0.3.1 → 0.5.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 +35 -1
- package/dist/cli.js +2364 -666
- package/dist/index.d.ts +914 -87
- package/dist/index.js +1722 -168
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BrowserContext, Page } from 'playwright';
|
|
2
|
-
import { EventEmitter } from 'node:events';
|
|
3
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
4
3
|
import { z } from 'zod';
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Child processes for agents, installs and dev servers. Prompts go on stdin
|
|
@@ -218,6 +218,14 @@ interface LayoutIssue {
|
|
|
218
218
|
* never named to the coding agent (ADR 0006).
|
|
219
219
|
*/
|
|
220
220
|
|
|
221
|
+
/** What a fresh context may differ in: a device's scale, touch, language and motion. */
|
|
222
|
+
interface FreshContextExtra {
|
|
223
|
+
deviceScaleFactor?: number;
|
|
224
|
+
isMobile?: boolean;
|
|
225
|
+
hasTouch?: boolean;
|
|
226
|
+
locale?: string;
|
|
227
|
+
reducedMotion?: 'reduce';
|
|
228
|
+
}
|
|
221
229
|
interface BrowserSession {
|
|
222
230
|
/** Discovery browses here; app state it leaves behind stays here. */
|
|
223
231
|
context: BrowserContext;
|
|
@@ -227,8 +235,10 @@ interface BrowserSession {
|
|
|
227
235
|
* Captures share no client state, so a screen looks the same however many
|
|
228
236
|
* other screens were visited before it (glot.it /words lost its empty
|
|
229
237
|
* state after other screens wrote to localStorage, 2026-10-07).
|
|
238
|
+
* `extra` is a persona's device, language and motion (fresh-eyes, ADR 0073);
|
|
239
|
+
* never a User-Agent.
|
|
230
240
|
*/
|
|
231
|
-
freshContext(): Promise<BrowserContext>;
|
|
241
|
+
freshContext(extra?: FreshContextExtra): Promise<BrowserContext>;
|
|
232
242
|
/**
|
|
233
243
|
* Visit each path once in the shared context, then seed every later capture
|
|
234
244
|
* from the storage that leaves behind. A first-ever visit can sit on a boot
|
|
@@ -272,85 +282,6 @@ interface Capture {
|
|
|
272
282
|
/** Load one surface at one viewport, screenshot it, and measure it. */
|
|
273
283
|
declare function captureSurface(session: BrowserSession, baseUrl: string, surface: Pick<Surface, 'path' | 'steps'>, viewport: Viewport): Promise<Capture>;
|
|
274
284
|
|
|
275
|
-
interface ResolvedSkill {
|
|
276
|
-
name: string;
|
|
277
|
-
/** Skills this one hands over to, from its "## Related" list and "→ skill" mentions. */
|
|
278
|
-
related?: string[];
|
|
279
|
-
/** SKILL.md text. */
|
|
280
|
-
text: string;
|
|
281
|
-
/** Every file of the skill folder, by path relative to it (includes SKILL.md). */
|
|
282
|
-
files: Record<string, Buffer>;
|
|
283
|
-
/** Where it came from: a path, or owner/repo@ref. */
|
|
284
|
-
source: string;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* The local studio: start a run (agent, model, skill, pages) and watch it:
|
|
289
|
-
* phase and progress, the burndown, every attempt's screenshot against the
|
|
290
|
-
* baseline with a slider and a diff overlay, problem scores, and the agent's
|
|
291
|
-
* output as it streams. Served on 127.0.0.1 only, behind a random token,
|
|
292
|
-
* reading nothing but `.mushi/ux/` in the repo.
|
|
293
|
-
*
|
|
294
|
-
* `mushi-ux ui` opens it with the launcher; `mushi-ux run` and `open` open it
|
|
295
|
-
* on one run, read-only.
|
|
296
|
-
*/
|
|
297
|
-
|
|
298
|
-
interface Dashboard {
|
|
299
|
-
url: string;
|
|
300
|
-
close(): Promise<void>;
|
|
301
|
-
}
|
|
302
|
-
/** Pure: resolve a requested shot path inside the run dir, or null if it escapes. */
|
|
303
|
-
declare function safeShotPath(runDirPath: string, requested: string): string | null;
|
|
304
|
-
/** One run, read-only (used by `mushi-ux run` and `open`). `dir` is `<repo>/.mushi/ux/<runId>`. */
|
|
305
|
-
declare function startDashboard(dir: string, events?: EventEmitter, port?: number): Promise<Dashboard>;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Turns a running app into a list of surfaces: every same-origin page
|
|
309
|
-
* reachable from the start paths, plus the tabs, dialogs and menus each page
|
|
310
|
-
* opens. Runs inside a guarded session, so nothing it clicks can write.
|
|
311
|
-
*
|
|
312
|
-
* Pages whose DOM structure matches one already seen (`/reports/1` and
|
|
313
|
-
* `/reports/2`) are kept once.
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
interface DiscoverOptions {
|
|
317
|
-
baseUrl: string;
|
|
318
|
-
startPaths?: string[];
|
|
319
|
-
/** Repo (or app) directory to read routes from; see routes.ts. */
|
|
320
|
-
sourceDir?: string;
|
|
321
|
-
maxPages?: number;
|
|
322
|
-
maxStatesPerPage?: number;
|
|
323
|
-
/** Paths never visited (globs on pathname), on top of sign-out routes. */
|
|
324
|
-
excludePaths?: string[];
|
|
325
|
-
/**
|
|
326
|
-
* Only pathnames equal to or under this prefix are visited, e.g.
|
|
327
|
-
* `/mushi-mushi/admin` for a console that shares its origin with docs and
|
|
328
|
-
* a landing site. Omit for the whole origin.
|
|
329
|
-
*/
|
|
330
|
-
scopePath?: string;
|
|
331
|
-
/**
|
|
332
|
-
* When two pages count as the same: 'shape' (default) by DOM structure, so
|
|
333
|
-
* `/reports/1` and `/reports/2` are worked on once; 'route' by pathname with
|
|
334
|
-
* ids collapsed and the query ignored, for an app shell whose sidebar and
|
|
335
|
-
* header make every page hash alike (the console kept 3 of 75 loads by
|
|
336
|
-
* shape, 2026-10-24).
|
|
337
|
-
*/
|
|
338
|
-
dedupe?: 'shape' | 'route';
|
|
339
|
-
/**
|
|
340
|
-
* Visit only startPaths (and the tabs, dialogs and menus they open): no
|
|
341
|
-
* routes from the source or sitemap, no following links. Set when the
|
|
342
|
-
* person named the pages.
|
|
343
|
-
*/
|
|
344
|
-
onlyStartPaths?: boolean;
|
|
345
|
-
onProgress?: (msg: string) => void;
|
|
346
|
-
/** Stops discovery between pages (the studio's Stop button). */
|
|
347
|
-
signal?: AbortSignal;
|
|
348
|
-
}
|
|
349
|
-
/** Pure: same-origin, normalized path (no hash), or null to skip. */
|
|
350
|
-
declare function normalizeLink(href: string, baseUrl: string): string | null;
|
|
351
|
-
declare function surfaceKey(path: string, steps: readonly ReplayStep[]): string;
|
|
352
|
-
declare function discover(session: BrowserSession, opts: DiscoverOptions): Promise<Surface[]>;
|
|
353
|
-
|
|
354
285
|
/**
|
|
355
286
|
* PNG helpers: decode, pad two captures to one size, pixel diff, and a
|
|
356
287
|
* difference hash (dHash) for "is this the same screen" checks. No native
|
|
@@ -542,12 +473,28 @@ interface JudgeVerdict {
|
|
|
542
473
|
droppedClaims: number;
|
|
543
474
|
/** Set when the model declined or the call failed; no verdict then. */
|
|
544
475
|
error?: string;
|
|
476
|
+
/**
|
|
477
|
+
* ADR 0072 (P8): no model call was made. `unchanged`: the kept version
|
|
478
|
+
* looks the same as the original; `cache`: the same pair was reviewed
|
|
479
|
+
* before and that verdict is reused.
|
|
480
|
+
*/
|
|
481
|
+
reused?: 'cache' | 'unchanged';
|
|
482
|
+
/** Tokens the call used (absent when reused or failed before an answer). */
|
|
483
|
+
usage?: JudgeUsage;
|
|
484
|
+
}
|
|
485
|
+
interface JudgeUsage {
|
|
486
|
+
input_tokens: number;
|
|
487
|
+
output_tokens: number;
|
|
488
|
+
cache_read_input_tokens: number;
|
|
489
|
+
cache_creation_input_tokens: number;
|
|
545
490
|
}
|
|
546
491
|
interface JudgeOptions {
|
|
547
492
|
dir: string;
|
|
548
493
|
repoRoot: string;
|
|
549
494
|
designFiles: string[];
|
|
550
495
|
model?: string;
|
|
496
|
+
/** Folder of reviewed pairs (ADR 0072): the same two images, model and rules are not reviewed twice. */
|
|
497
|
+
cacheDir?: string;
|
|
551
498
|
client?: Anthropic;
|
|
552
499
|
/** Deterministic order for tests; defaults to Math.random. */
|
|
553
500
|
random?: () => number;
|
|
@@ -709,6 +656,18 @@ interface SavedRunOptions {
|
|
|
709
656
|
/** Keep edits with nothing visible, flagged for review. */
|
|
710
657
|
keepInvisible?: boolean;
|
|
711
658
|
}
|
|
659
|
+
/** ADR 0072: the final review's spend, synced so the console can show what a run cost. */
|
|
660
|
+
interface JudgeUsageTotals {
|
|
661
|
+
model: string;
|
|
662
|
+
/** Verdicts that were a model call. */
|
|
663
|
+
judged: number;
|
|
664
|
+
/** Verdicts reused: the same pair reviewed before, or a kept version that looks unchanged. */
|
|
665
|
+
reused: number;
|
|
666
|
+
input_tokens: number;
|
|
667
|
+
output_tokens: number;
|
|
668
|
+
cache_read_input_tokens: number;
|
|
669
|
+
cache_creation_input_tokens: number;
|
|
670
|
+
}
|
|
712
671
|
interface RunState {
|
|
713
672
|
version: 1;
|
|
714
673
|
runId: string;
|
|
@@ -736,6 +695,8 @@ interface RunState {
|
|
|
736
695
|
stopped?: boolean;
|
|
737
696
|
/** Model of the final review; null when the review is off. */
|
|
738
697
|
judgeModel?: string | null;
|
|
698
|
+
/** What the final review spent (ADR 0072): model calls, reused verdicts and tokens. */
|
|
699
|
+
judgeUsage?: JudgeUsageTotals | null;
|
|
739
700
|
/** Settings to resume with; absent on runs from before 2026-10-06. */
|
|
740
701
|
options?: SavedRunOptions;
|
|
741
702
|
/** The worktree's install finished; a run killed mid-install installs again. */
|
|
@@ -844,11 +805,6 @@ declare function toSnapshot(state: RunState, finished: boolean, uploaded: Readon
|
|
|
844
805
|
url: string;
|
|
845
806
|
number: number;
|
|
846
807
|
} | undefined;
|
|
847
|
-
mode: "local" | "cloud";
|
|
848
|
-
status: string;
|
|
849
|
-
agent: string;
|
|
850
|
-
model: string | null;
|
|
851
|
-
judge_model: string | null;
|
|
852
808
|
skill: string | null;
|
|
853
809
|
base_ref: string | null;
|
|
854
810
|
phase: RunPhase | null;
|
|
@@ -866,6 +822,12 @@ declare function toSnapshot(state: RunState, finished: boolean, uploaded: Readon
|
|
|
866
822
|
branch: string | null;
|
|
867
823
|
base_sha: string | null;
|
|
868
824
|
cli_version: null;
|
|
825
|
+
judge_usage?: JudgeUsageTotals | undefined;
|
|
826
|
+
mode: "local" | "cloud";
|
|
827
|
+
status: string;
|
|
828
|
+
agent: string;
|
|
829
|
+
model: string | null;
|
|
830
|
+
judge_model: string | null;
|
|
869
831
|
};
|
|
870
832
|
interface SyncHandle {
|
|
871
833
|
/** Final sync; resolves with an error message when it did not land. */
|
|
@@ -873,6 +835,244 @@ interface SyncHandle {
|
|
|
873
835
|
}
|
|
874
836
|
declare function startSync(dir: string, cfg: SyncConfig, events: EventEmitter, log: (m: string) => void): SyncHandle;
|
|
875
837
|
|
|
838
|
+
/**
|
|
839
|
+
* Release-kit clips (Plan 025 P5, ADR 0074): short Playwright `recordVideo`
|
|
840
|
+
* recordings of an app's top flows, uploaded into one release's kit so a
|
|
841
|
+
* product-video tool (lazycow `make_product_video`) has real footage.
|
|
842
|
+
*
|
|
843
|
+
* Opt-in and capped: the app turns clips on in its release kit (the server
|
|
844
|
+
* answers 403 CLIPS_OFF otherwise), at most 5 flows of 6 screens, each clip
|
|
845
|
+
* stops before maxSeconds (hard cap 60 s) and is dropped above maxBytes
|
|
846
|
+
* (hard cap 100 MB). Every recording context goes through the write guard,
|
|
847
|
+
* like every other capture.
|
|
848
|
+
*
|
|
849
|
+
* The clips are WebM: source footage the video tool transcodes, never an App
|
|
850
|
+
* Store preview on their own. Mushi does not transcode.
|
|
851
|
+
*/
|
|
852
|
+
|
|
853
|
+
declare const CLIP_LIMITS: {
|
|
854
|
+
readonly maxFlows: 5;
|
|
855
|
+
readonly maxPathsPerFlow: 6;
|
|
856
|
+
readonly defaultSeconds: 30;
|
|
857
|
+
readonly maxSeconds: 60;
|
|
858
|
+
readonly minSeconds: 5;
|
|
859
|
+
readonly defaultBytes: number;
|
|
860
|
+
readonly maxBytes: number;
|
|
861
|
+
/** How long each screen stays on camera after it settles. */
|
|
862
|
+
readonly dwellMs: 1500;
|
|
863
|
+
};
|
|
864
|
+
declare const DEFAULT_CLIP_VIEWPORT: {
|
|
865
|
+
readonly width: 390;
|
|
866
|
+
readonly height: 844;
|
|
867
|
+
};
|
|
868
|
+
interface ClipFlow {
|
|
869
|
+
name: string;
|
|
870
|
+
paths: string[];
|
|
871
|
+
}
|
|
872
|
+
interface ClipResult {
|
|
873
|
+
name: string;
|
|
874
|
+
file: string;
|
|
875
|
+
bytes: number;
|
|
876
|
+
durationMs: number;
|
|
877
|
+
width: number;
|
|
878
|
+
height: number;
|
|
879
|
+
/** The paths the clip actually shows (a flow is cut short when it runs out of time). */
|
|
880
|
+
paths: string[];
|
|
881
|
+
}
|
|
882
|
+
interface ClipSkip {
|
|
883
|
+
name: string;
|
|
884
|
+
reason: string;
|
|
885
|
+
}
|
|
886
|
+
/** Pure: a file-safe name for a flow ("Sign up!" → "sign-up"). */
|
|
887
|
+
declare function clipSlug(name: string): string;
|
|
888
|
+
/**
|
|
889
|
+
* Pure: one `--flow` value, `name:/a,/b` (or just `/a,/b`, named after its
|
|
890
|
+
* first path). Paths must start with `/`. Throws with a plain reason.
|
|
891
|
+
*/
|
|
892
|
+
declare function parseFlow(value: string): ClipFlow;
|
|
893
|
+
/** Pure: cap the flows (count, paths each, unique names) and say what was cut. */
|
|
894
|
+
declare function capFlows(flows: readonly ClipFlow[]): {
|
|
895
|
+
flows: ClipFlow[];
|
|
896
|
+
notes: string[];
|
|
897
|
+
};
|
|
898
|
+
/** Pure: the caps clamped to their hard limits. */
|
|
899
|
+
declare function clampCaps(input: {
|
|
900
|
+
maxSeconds?: number;
|
|
901
|
+
maxBytes?: number;
|
|
902
|
+
}): {
|
|
903
|
+
maxSeconds: number;
|
|
904
|
+
maxBytes: number;
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* Pure: whether there is time for one more screen. A screen costs its
|
|
908
|
+
* navigation and settle (estimated from the slowest so far, at least 3 s)
|
|
909
|
+
* plus the dwell; the clip stops before it would run past maxSeconds.
|
|
910
|
+
*/
|
|
911
|
+
declare function hasTimeForScreen(elapsedMs: number, slowestScreenMs: number, maxSeconds: number): boolean;
|
|
912
|
+
interface RecordClipsOptions {
|
|
913
|
+
baseUrl: string;
|
|
914
|
+
flows: readonly ClipFlow[];
|
|
915
|
+
outDir: string;
|
|
916
|
+
viewport?: {
|
|
917
|
+
width: number;
|
|
918
|
+
height: number;
|
|
919
|
+
};
|
|
920
|
+
maxSeconds?: number;
|
|
921
|
+
maxBytes?: number;
|
|
922
|
+
allow?: readonly AllowRule[];
|
|
923
|
+
/** A cached, signed-in profile: its storage seeds every recording context. */
|
|
924
|
+
profileDir?: string;
|
|
925
|
+
channel?: 'chrome' | 'chromium';
|
|
926
|
+
headless?: boolean;
|
|
927
|
+
log?: (m: string) => void;
|
|
928
|
+
}
|
|
929
|
+
/** Record one clip per flow. Returns the clips kept and the ones dropped (with why). */
|
|
930
|
+
declare function recordClips(opts: RecordClipsOptions): Promise<{
|
|
931
|
+
clips: ClipResult[];
|
|
932
|
+
skipped: ClipSkip[];
|
|
933
|
+
notes: string[];
|
|
934
|
+
guard: GuardLog;
|
|
935
|
+
}>;
|
|
936
|
+
/** Pure: the POST …/kit/uploads body for these clips. */
|
|
937
|
+
declare function clipUploadBody(clips: readonly ClipResult[]): {
|
|
938
|
+
files: {
|
|
939
|
+
name: string;
|
|
940
|
+
kind: "clip";
|
|
941
|
+
mime: "video/webm";
|
|
942
|
+
bytes: number;
|
|
943
|
+
source: "playwright";
|
|
944
|
+
platform: "web";
|
|
945
|
+
durationMs: number;
|
|
946
|
+
width: number;
|
|
947
|
+
height: number;
|
|
948
|
+
surfacePath: string;
|
|
949
|
+
label: string;
|
|
950
|
+
}[];
|
|
951
|
+
};
|
|
952
|
+
type FetchLike = (url: string, init?: RequestInit) => Promise<Response>;
|
|
953
|
+
/** The app's clip settings as the kit route serves them (project_settings.release_kit_clip_*). */
|
|
954
|
+
interface ServerClipCaps {
|
|
955
|
+
clipsEnabled: boolean;
|
|
956
|
+
maxSeconds: number;
|
|
957
|
+
maxBytes: number;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Read the app's clip caps from the release's kit before recording, so a
|
|
961
|
+
* clip is never recorded that the server will refuse. `null` = could not
|
|
962
|
+
* read them (offline, old server, no access): the caller falls back to the
|
|
963
|
+
* local defaults and the server still enforces its caps on upload.
|
|
964
|
+
*/
|
|
965
|
+
declare function fetchClipCaps(cfg: SyncConfig, releaseId: string, fetchImpl?: FetchLike): Promise<ServerClipCaps | null>;
|
|
966
|
+
/**
|
|
967
|
+
* Pure: the caps a recording uses. The lower of what was asked and what the
|
|
968
|
+
* app allows, clamped to the hard limits; `blocked` (with the reason) when
|
|
969
|
+
* the app has clips turned off, so nothing is recorded only to be refused.
|
|
970
|
+
*/
|
|
971
|
+
declare function effectiveClipCaps(requested: {
|
|
972
|
+
maxSeconds?: number;
|
|
973
|
+
maxBytes?: number;
|
|
974
|
+
}, server: ServerClipCaps | null): {
|
|
975
|
+
maxSeconds: number;
|
|
976
|
+
maxBytes: number;
|
|
977
|
+
notes: string[];
|
|
978
|
+
blocked: string | null;
|
|
979
|
+
};
|
|
980
|
+
interface ClipUploadOutcome {
|
|
981
|
+
uploaded: Array<{
|
|
982
|
+
name: string;
|
|
983
|
+
assetId: string;
|
|
984
|
+
}>;
|
|
985
|
+
failed: Array<{
|
|
986
|
+
name: string;
|
|
987
|
+
reason: string;
|
|
988
|
+
}>;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Upload clips into one release's kit: reserve signed URLs, PUT each file,
|
|
992
|
+
* then finalize it with its SHA-256 so the server can prove the bytes. The
|
|
993
|
+
* server's refusal (CLIPS_OFF: turn clips on in the kit) is thrown as is.
|
|
994
|
+
*/
|
|
995
|
+
declare function uploadClips(cfg: SyncConfig, releaseId: string, clips: readonly ClipResult[], fetchImpl?: FetchLike): Promise<ClipUploadOutcome>;
|
|
996
|
+
|
|
997
|
+
interface ResolvedSkill {
|
|
998
|
+
name: string;
|
|
999
|
+
/** Skills this one hands over to, from its "## Related" list and "→ skill" mentions. */
|
|
1000
|
+
related?: string[];
|
|
1001
|
+
/** SKILL.md text. */
|
|
1002
|
+
text: string;
|
|
1003
|
+
/** Every file of the skill folder, by path relative to it (includes SKILL.md). */
|
|
1004
|
+
files: Record<string, Buffer>;
|
|
1005
|
+
/** Where it came from: a path, or owner/repo@ref. */
|
|
1006
|
+
source: string;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* The local studio: start a run (agent, model, skill, pages) and watch it:
|
|
1011
|
+
* phase and progress, the burndown, every attempt's screenshot against the
|
|
1012
|
+
* baseline with a slider and a diff overlay, problem scores, and the agent's
|
|
1013
|
+
* output as it streams. Served on 127.0.0.1 only, behind a random token,
|
|
1014
|
+
* reading nothing but `.mushi/ux/` in the repo.
|
|
1015
|
+
*
|
|
1016
|
+
* `mushi-ux ui` opens it with the launcher; `mushi-ux run` and `open` open it
|
|
1017
|
+
* on one run, read-only.
|
|
1018
|
+
*/
|
|
1019
|
+
|
|
1020
|
+
interface Dashboard {
|
|
1021
|
+
url: string;
|
|
1022
|
+
close(): Promise<void>;
|
|
1023
|
+
}
|
|
1024
|
+
/** Pure: resolve a requested shot path inside the run dir, or null if it escapes. */
|
|
1025
|
+
declare function safeShotPath(runDirPath: string, requested: string): string | null;
|
|
1026
|
+
/** One run, read-only (used by `mushi-ux run` and `open`). `dir` is `<repo>/.mushi/ux/<runId>`. */
|
|
1027
|
+
declare function startDashboard(dir: string, events?: EventEmitter, port?: number): Promise<Dashboard>;
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Turns a running app into a list of surfaces: every same-origin page
|
|
1031
|
+
* reachable from the start paths, plus the tabs, dialogs and menus each page
|
|
1032
|
+
* opens. Runs inside a guarded session, so nothing it clicks can write.
|
|
1033
|
+
*
|
|
1034
|
+
* Pages whose DOM structure matches one already seen (`/reports/1` and
|
|
1035
|
+
* `/reports/2`) are kept once.
|
|
1036
|
+
*/
|
|
1037
|
+
|
|
1038
|
+
interface DiscoverOptions {
|
|
1039
|
+
baseUrl: string;
|
|
1040
|
+
startPaths?: string[];
|
|
1041
|
+
/** Repo (or app) directory to read routes from; see routes.ts. */
|
|
1042
|
+
sourceDir?: string;
|
|
1043
|
+
maxPages?: number;
|
|
1044
|
+
maxStatesPerPage?: number;
|
|
1045
|
+
/** Paths never visited (globs on pathname), on top of sign-out routes. */
|
|
1046
|
+
excludePaths?: string[];
|
|
1047
|
+
/**
|
|
1048
|
+
* Only pathnames equal to or under this prefix are visited, e.g.
|
|
1049
|
+
* `/mushi-mushi/admin` for a console that shares its origin with docs and
|
|
1050
|
+
* a landing site. Omit for the whole origin.
|
|
1051
|
+
*/
|
|
1052
|
+
scopePath?: string;
|
|
1053
|
+
/**
|
|
1054
|
+
* When two pages count as the same: 'shape' (default) by DOM structure, so
|
|
1055
|
+
* `/reports/1` and `/reports/2` are worked on once; 'route' by pathname with
|
|
1056
|
+
* ids collapsed and the query ignored, for an app shell whose sidebar and
|
|
1057
|
+
* header make every page hash alike (the console kept 3 of 75 loads by
|
|
1058
|
+
* shape, 2026-10-24).
|
|
1059
|
+
*/
|
|
1060
|
+
dedupe?: 'shape' | 'route';
|
|
1061
|
+
/**
|
|
1062
|
+
* Visit only startPaths (and the tabs, dialogs and menus they open): no
|
|
1063
|
+
* routes from the source or sitemap, no following links. Set when the
|
|
1064
|
+
* person named the pages.
|
|
1065
|
+
*/
|
|
1066
|
+
onlyStartPaths?: boolean;
|
|
1067
|
+
onProgress?: (msg: string) => void;
|
|
1068
|
+
/** Stops discovery between pages (the studio's Stop button). */
|
|
1069
|
+
signal?: AbortSignal;
|
|
1070
|
+
}
|
|
1071
|
+
/** Pure: same-origin, normalized path (no hash), or null to skip. */
|
|
1072
|
+
declare function normalizeLink(href: string, baseUrl: string): string | null;
|
|
1073
|
+
declare function surfaceKey(path: string, steps: readonly ReplayStep[]): string;
|
|
1074
|
+
declare function discover(session: BrowserSession, opts: DiscoverOptions): Promise<Surface[]>;
|
|
1075
|
+
|
|
876
1076
|
/**
|
|
877
1077
|
* `mushi-ux audit`: find UI/UX bugs on the signed-in screens of a live app
|
|
878
1078
|
* and file each one as a Mushi report, so the fix loop picks it up (ADR 0045).
|
|
@@ -1026,6 +1226,20 @@ interface SuccessCheck {
|
|
|
1026
1226
|
/** GET in the session's own browser context (its cookies); passes on 2xx with a non-empty JSON body. */
|
|
1027
1227
|
api?: string;
|
|
1028
1228
|
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Who the visitor is (ADR 0073): a project persona as the worker claim carries
|
|
1231
|
+
* it. The brief is plain words the visitor model reads; the device, language
|
|
1232
|
+
* and needs change the browser itself, so the app sees a phone, Japanese or
|
|
1233
|
+
* reduced motion for real, not only in the prompt.
|
|
1234
|
+
*/
|
|
1235
|
+
interface FreshEyesPersona {
|
|
1236
|
+
name: string;
|
|
1237
|
+
brief: string;
|
|
1238
|
+
locale: string;
|
|
1239
|
+
device: 'desktop' | 'mobile' | 'tablet';
|
|
1240
|
+
needs: string[];
|
|
1241
|
+
steps: number;
|
|
1242
|
+
}
|
|
1029
1243
|
/** The question to the model: the prompt in a file in an empty folder, so ask mode reads nothing else. */
|
|
1030
1244
|
type FreshAsk = (prompt: string, dir: string) => Promise<{
|
|
1031
1245
|
text: string | null;
|
|
@@ -1177,6 +1391,8 @@ interface FreshEyesOptions {
|
|
|
1177
1391
|
session?: () => Promise<BrowserSession>;
|
|
1178
1392
|
/** The run id to use, when the console queued the run and already named it (`20261028-091500-ab12`). */
|
|
1179
1393
|
runId?: string;
|
|
1394
|
+
/** Who the visitors are (ADR 0073): their brief, device, language and needs. */
|
|
1395
|
+
persona?: FreshEyesPersona;
|
|
1180
1396
|
}
|
|
1181
1397
|
declare function runFreshEyes(opts: FreshEyesOptions): Promise<FreshEyesResult>;
|
|
1182
1398
|
|
|
@@ -1390,6 +1606,617 @@ declare function routesFromSource(root: string): string[];
|
|
|
1390
1606
|
/** Paths listed in /sitemap.xml on the same origin; empty when there is none. */
|
|
1391
1607
|
declare function sitemapPaths(baseUrl: string): Promise<string[]>;
|
|
1392
1608
|
|
|
1609
|
+
/**
|
|
1610
|
+
* FILE: _shared/ux-scorecard.ts (kept byte-identical in packages/ux/src/scorecard-rubric.ts)
|
|
1611
|
+
* PURPOSE: The UX scorecard's rules (ADR 0067): the written rubric, the
|
|
1612
|
+
* prompts, how a model's answer is read, how a page's score is
|
|
1613
|
+
* computed, how issues on many pages group into one root cause, and
|
|
1614
|
+
* which causes are filed as reports.
|
|
1615
|
+
*
|
|
1616
|
+
* The server (api/routes/ux-scorecard.ts, the platform route `ux-scorecard`)
|
|
1617
|
+
* and the CLI (`mushi-ux scorecard`, the local transports) run these same
|
|
1618
|
+
* functions, so a page scored either way reads the same.
|
|
1619
|
+
*
|
|
1620
|
+
* Facts stay in code (ADR 0039): the model gives each rubric dimension a 1–10
|
|
1621
|
+
* score and names issues with quoted evidence; the measured settle time and
|
|
1622
|
+
* the axe counts cap the performance and accessibility scores, the overall
|
|
1623
|
+
* score is computed here from the eight, and only causes with evidence seen on
|
|
1624
|
+
* the page are filed.
|
|
1625
|
+
*
|
|
1626
|
+
* No imports, no Deno or Node globals: vitest and Deno both load it as is.
|
|
1627
|
+
*/
|
|
1628
|
+
declare const UX_SCORECARD_PROMPT_VERSION = "ux-scorecard-2026-11-21.2";
|
|
1629
|
+
declare const UX_DIMENSIONS: readonly ["clarity", "hierarchy", "consistency", "states", "truthfulness", "copy", "accessibility", "performance"];
|
|
1630
|
+
type UxDimension = (typeof UX_DIMENSIONS)[number];
|
|
1631
|
+
type UxSeverity = 'high' | 'medium' | 'low';
|
|
1632
|
+
/** What each dimension asks. The prompt quotes it; the console shows it. */
|
|
1633
|
+
declare const UX_RUBRIC: Readonly<Record<UxDimension, {
|
|
1634
|
+
label: string;
|
|
1635
|
+
asks: string;
|
|
1636
|
+
}>>;
|
|
1637
|
+
/** The words every score anchors to, the same for each dimension. */
|
|
1638
|
+
declare const UX_SCORE_ANCHORS: readonly ["9–10: nothing a user would trip on.", "7–8: small polish only; the page does its job.", "5–6: a user notices a real problem but can still get the job done.", "3–4: a problem misleads the user or stops the page doing its job.", "1–2: the page is broken, empty where it should not be, or says something false."];
|
|
1639
|
+
declare const UX_SCORECARD_LIMITS: {
|
|
1640
|
+
/** Visible text sent per page. */
|
|
1641
|
+
readonly text: 6000;
|
|
1642
|
+
/** Issues kept per page. */
|
|
1643
|
+
readonly issues: 5;
|
|
1644
|
+
/** Claims kept per page, for the cross-page contradiction check. */
|
|
1645
|
+
readonly claims: 12;
|
|
1646
|
+
/** An issue under this confidence is dropped. */
|
|
1647
|
+
readonly minConfidence: 0.5;
|
|
1648
|
+
/** A cause is filed only at or above this confidence. */
|
|
1649
|
+
readonly fileConfidence: 0.6;
|
|
1650
|
+
/** Reports one run may file (one per root cause). */
|
|
1651
|
+
readonly filePerRun: 5;
|
|
1652
|
+
/** Causes a run keeps (stored, synced, shown, filed from): cross-page first, then by rank (topCauses). */
|
|
1653
|
+
readonly causes: 60;
|
|
1654
|
+
};
|
|
1655
|
+
interface UxPageFacts {
|
|
1656
|
+
/** The page's identity across runs: path plus its view-like query (scorecardPageKey). */
|
|
1657
|
+
key: string;
|
|
1658
|
+
/** Same-origin path with query. */
|
|
1659
|
+
path: string;
|
|
1660
|
+
/** What the app calls the page: its nav label, else its heading. */
|
|
1661
|
+
label: string;
|
|
1662
|
+
/** document.title once settled. */
|
|
1663
|
+
title: string;
|
|
1664
|
+
breadcrumb?: string;
|
|
1665
|
+
headings: string[];
|
|
1666
|
+
/** Visible text of the settled page, trimmed. */
|
|
1667
|
+
text: string;
|
|
1668
|
+
/** Visible button and link labels in the main content. */
|
|
1669
|
+
controls: string[];
|
|
1670
|
+
/** Visible text early in the load (about 1 s), when it differs: loading and placeholder states. */
|
|
1671
|
+
earlyText?: string;
|
|
1672
|
+
/** Milliseconds until the page stopped changing; null when it never settled within the wait. */
|
|
1673
|
+
settleMs: number | null;
|
|
1674
|
+
/** Serious and critical axe results; null when axe could not run on the page. */
|
|
1675
|
+
axe: {
|
|
1676
|
+
critical: number;
|
|
1677
|
+
serious: number;
|
|
1678
|
+
rules: string[];
|
|
1679
|
+
} | null;
|
|
1680
|
+
overflowX: boolean;
|
|
1681
|
+
consoleErrors: number;
|
|
1682
|
+
cls: number;
|
|
1683
|
+
viewport: {
|
|
1684
|
+
width: number;
|
|
1685
|
+
height: number;
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
interface UxIssue {
|
|
1689
|
+
dimension: UxDimension;
|
|
1690
|
+
severity: UxSeverity;
|
|
1691
|
+
title: string;
|
|
1692
|
+
problem: string;
|
|
1693
|
+
/** Text quoted from the page (or the screenshot) that shows the problem. */
|
|
1694
|
+
evidence: string;
|
|
1695
|
+
fix: string;
|
|
1696
|
+
/** The shared thing one fix would land in, when it likely repeats on other pages. Empty: this page only. */
|
|
1697
|
+
cause: string;
|
|
1698
|
+
confidence: number;
|
|
1699
|
+
/** The evidence was found in the page's own text, title or controls. */
|
|
1700
|
+
evidenceSeen: boolean;
|
|
1701
|
+
}
|
|
1702
|
+
interface UxClaim {
|
|
1703
|
+
subject: string;
|
|
1704
|
+
value: string;
|
|
1705
|
+
}
|
|
1706
|
+
interface UxPageScore {
|
|
1707
|
+
key: string;
|
|
1708
|
+
/** One line: what the page is. */
|
|
1709
|
+
page: string;
|
|
1710
|
+
scores: Record<UxDimension, number>;
|
|
1711
|
+
why: Partial<Record<UxDimension, string>>;
|
|
1712
|
+
/** Dimensions a measured fact capped below the model's score, with the model's number. */
|
|
1713
|
+
capped: Partial<Record<UxDimension, number>>;
|
|
1714
|
+
overall: number;
|
|
1715
|
+
issues: UxIssue[];
|
|
1716
|
+
claims: UxClaim[];
|
|
1717
|
+
promptVersion: string;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* A page's identity across runs: the path, plus only the query params that
|
|
1721
|
+
* pick a view (`/team?view=sso` and `/team?view=billing` are two pages; a
|
|
1722
|
+
* `?project=` or a record id in the query is not a page). Trailing slashes and
|
|
1723
|
+
* the hash are dropped.
|
|
1724
|
+
*/
|
|
1725
|
+
declare function scorecardPageKey(path: string): string;
|
|
1726
|
+
interface UxPagePromptContext {
|
|
1727
|
+
app: string;
|
|
1728
|
+
/** Labels of the app's other pages in this run: what "consistent" means here. */
|
|
1729
|
+
otherPages: string[];
|
|
1730
|
+
/** What the app is and who uses it, when known. */
|
|
1731
|
+
about?: string;
|
|
1732
|
+
/** Screenshot file names the model can read, in order (local transports). */
|
|
1733
|
+
images?: string[];
|
|
1734
|
+
}
|
|
1735
|
+
/** Pure: the system text for one page's score. */
|
|
1736
|
+
declare function pageSystemPrompt(): string;
|
|
1737
|
+
/** Pure: the user text for one page's score. The screenshots go with it. */
|
|
1738
|
+
declare function pageUserPrompt(f: UxPageFacts, ctx: UxPagePromptContext): string;
|
|
1739
|
+
/** Pure: the first JSON object in a model's text answer, or null. */
|
|
1740
|
+
declare function firstJsonObject(text: string | null | undefined): Record<string, unknown> | null;
|
|
1741
|
+
/** Pure: lower-case, collapsed whitespace, typographic quotes and dashes folded. */
|
|
1742
|
+
declare function normText(s: string): string;
|
|
1743
|
+
/**
|
|
1744
|
+
* Pure: whether quoted evidence appears in the page's own words. The model
|
|
1745
|
+
* often quotes a phrase with quotes or an ellipsis around it; any quoted
|
|
1746
|
+
* fragment of 6+ characters found in the page counts.
|
|
1747
|
+
*/
|
|
1748
|
+
declare function evidenceSeenIn(evidence: string, f: Pick<UxPageFacts, 'text' | 'title' | 'controls' | 'headings' | 'earlyText' | 'breadcrumb'>): boolean;
|
|
1749
|
+
/** Pure: the performance score the measured settle time allows. */
|
|
1750
|
+
declare function performanceCap(settleMs: number | null): number;
|
|
1751
|
+
/** Pure: the accessibility score the measured axe results and sideways scroll allow. */
|
|
1752
|
+
declare function accessibilityCap(f: Pick<UxPageFacts, 'axe' | 'overflowX'>): number;
|
|
1753
|
+
/**
|
|
1754
|
+
* Pure: the page's overall score from its eight. A page is as good as its
|
|
1755
|
+
* worst problem lets it be: one terrible dimension drags it down as much as
|
|
1756
|
+
* the average does (0.5 × mean + 0.5 × min), rounded to a whole number.
|
|
1757
|
+
*/
|
|
1758
|
+
declare function overallScore(scores: Record<UxDimension, number>): number;
|
|
1759
|
+
type ParsedPageScore = {
|
|
1760
|
+
ok: true;
|
|
1761
|
+
value: UxPageScore;
|
|
1762
|
+
} | {
|
|
1763
|
+
ok: false;
|
|
1764
|
+
error: string;
|
|
1765
|
+
};
|
|
1766
|
+
/**
|
|
1767
|
+
* Pure: read a model's answer for one page. All eight scores must be there
|
|
1768
|
+
* (whole numbers 1–10, clamped); the measured facts cap performance and
|
|
1769
|
+
* accessibility; issues without a known dimension, severity, title, evidence
|
|
1770
|
+
* or fix, worded as taste, or under the confidence floor are dropped.
|
|
1771
|
+
*/
|
|
1772
|
+
declare function parsePageAnswer(answer: unknown, facts: UxPageFacts): ParsedPageScore;
|
|
1773
|
+
interface UxCausePage {
|
|
1774
|
+
key: string;
|
|
1775
|
+
label: string;
|
|
1776
|
+
issueTitle: string;
|
|
1777
|
+
evidence: string;
|
|
1778
|
+
}
|
|
1779
|
+
interface UxCause {
|
|
1780
|
+
/** ux:<dimension>:<slug>, the report's pattern_key. */
|
|
1781
|
+
patternKey: string;
|
|
1782
|
+
dimension: UxDimension;
|
|
1783
|
+
severity: UxSeverity;
|
|
1784
|
+
kind: 'shared' | 'contradiction' | 'page';
|
|
1785
|
+
title: string;
|
|
1786
|
+
problem: string;
|
|
1787
|
+
fix: string;
|
|
1788
|
+
pages: UxCausePage[];
|
|
1789
|
+
confidence: number;
|
|
1790
|
+
/** At least one page's evidence was found in its own text. */
|
|
1791
|
+
evidenceSeen: boolean;
|
|
1792
|
+
}
|
|
1793
|
+
/** Pure: the meaningful words of a phrase, for matching causes. */
|
|
1794
|
+
declare function causeTokens(s: string): string[];
|
|
1795
|
+
/** Pure: a short slug of a phrase (at most 6 meaningful words). */
|
|
1796
|
+
declare function causeSlug(s: string): string;
|
|
1797
|
+
/** Pure: whether two cause phrases name the same shared thing. */
|
|
1798
|
+
declare function sameCause(a: string, b: string): boolean;
|
|
1799
|
+
/**
|
|
1800
|
+
* Pure: the pattern key of a cause. When an earlier run's open key names the
|
|
1801
|
+
* same thing in the same dimension, it is reused, so a reworded cause keeps
|
|
1802
|
+
* its report (ADR 0065's lesson: free-text slugs drift; 521 slugs for 550
|
|
1803
|
+
* reports).
|
|
1804
|
+
*/
|
|
1805
|
+
declare function patternKeyFor(dimension: UxDimension, phrase: string, priorKeys?: readonly string[]): string;
|
|
1806
|
+
interface ScoredPage {
|
|
1807
|
+
key: string;
|
|
1808
|
+
label: string;
|
|
1809
|
+
score: UxPageScore;
|
|
1810
|
+
/** The facts it was scored on, when kept: a contradiction's evidence is checked against them. */
|
|
1811
|
+
facts?: UxPageFacts;
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* Pure: group the run's issues into root causes, without a model. Issues on
|
|
1815
|
+
* different pages join when their `cause` names the same shared thing in the
|
|
1816
|
+
* same dimension, or when they quote the same evidence (the same banner text
|
|
1817
|
+
* on ten pages). Everything else stays a one-page cause.
|
|
1818
|
+
*/
|
|
1819
|
+
declare function groupCauses(pages: readonly ScoredPage[], priorKeys?: readonly string[]): UxCause[];
|
|
1820
|
+
/** Pure: how much fixing a cause is worth: severity × reach × confidence. */
|
|
1821
|
+
declare function causeRank(c: Pick<UxCause, 'severity' | 'pages' | 'confidence' | 'kind'>): number;
|
|
1822
|
+
/**
|
|
1823
|
+
* Pure: the causes a run keeps, at most `max`: causes that span pages or
|
|
1824
|
+
* contradict come first, then one-page causes, each by rank. The first real
|
|
1825
|
+
* run (Mushi console, 74 pages, 2026-11-21) grouped 299 issues into 235
|
|
1826
|
+
* causes, past what the routes stored, so every route and the CLI keep these.
|
|
1827
|
+
*/
|
|
1828
|
+
declare function topCauses<T extends Pick<UxCause, 'kind' | 'severity' | 'pages' | 'confidence' | 'patternKey'>>(causes: readonly T[], max?: number): T[];
|
|
1829
|
+
/** Pure: the system and user text of the cross-page pass (text only, one call per run). */
|
|
1830
|
+
declare function groupingPrompt(pages: readonly ScoredPage[], priorKeys?: readonly string[]): {
|
|
1831
|
+
system: string;
|
|
1832
|
+
user: string;
|
|
1833
|
+
};
|
|
1834
|
+
/**
|
|
1835
|
+
* Pure: merge the cross-page pass into the code's grouping. A model cause
|
|
1836
|
+
* must reference issues or pages that exist; its issues leave the groups they
|
|
1837
|
+
* were in, and groups left empty go. A contradiction may cite pages only.
|
|
1838
|
+
*/
|
|
1839
|
+
declare function mergeGrouping(pages: readonly ScoredPage[], base: readonly UxCause[], answer: unknown, priorKeys?: readonly string[]): UxCause[];
|
|
1840
|
+
/** Pure: whether a cause is worth a report: it spans pages, contradicts, or is a high-severity problem, with evidence and confidence. */
|
|
1841
|
+
declare function causeIsFileable(c: UxCause): boolean;
|
|
1842
|
+
interface UxFilingPlan {
|
|
1843
|
+
/** New reports, one per root cause, best first. */
|
|
1844
|
+
file: UxCause[];
|
|
1845
|
+
/** Causes whose pattern already has an open report: its screens are refreshed, no new report. */
|
|
1846
|
+
update: UxCause[];
|
|
1847
|
+
/** Fileable causes left over the run's cap. */
|
|
1848
|
+
overCap: UxCause[];
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Pure: which causes a run files. One report per root cause (pattern key);
|
|
1852
|
+
* a cause whose key has an open report only refreshes that report's pages,
|
|
1853
|
+
* and does not count toward the cap.
|
|
1854
|
+
*/
|
|
1855
|
+
declare function planFiling(causes: readonly UxCause[], openKeys: readonly string[], cap?: number): UxFilingPlan;
|
|
1856
|
+
/** The marker a filed report carries, found by the reports search. */
|
|
1857
|
+
declare function scorecardMarker(patternKey: string): string;
|
|
1858
|
+
/** Pure: the report a cause files. */
|
|
1859
|
+
declare function causeReportBody(c: UxCause, ctx: {
|
|
1860
|
+
baseUrl: string;
|
|
1861
|
+
runId: string;
|
|
1862
|
+
pageScores: Readonly<Record<string, number>>;
|
|
1863
|
+
}): {
|
|
1864
|
+
title: string;
|
|
1865
|
+
description: string;
|
|
1866
|
+
severity: UxSeverity;
|
|
1867
|
+
component: string;
|
|
1868
|
+
};
|
|
1869
|
+
interface ScorecardRow {
|
|
1870
|
+
key: string;
|
|
1871
|
+
label: string;
|
|
1872
|
+
overall: number;
|
|
1873
|
+
scores: Record<UxDimension, number>;
|
|
1874
|
+
issues: UxIssue[];
|
|
1875
|
+
/** Earlier runs' overall scores for this page, oldest first. */
|
|
1876
|
+
history: number[];
|
|
1877
|
+
/** This run minus the previous run, when there is one. */
|
|
1878
|
+
delta: number | null;
|
|
1879
|
+
}
|
|
1880
|
+
/** Pure: pages worst first, each with its trend from earlier runs. */
|
|
1881
|
+
declare function scorecardRows(pages: readonly ScoredPage[], history?: ReadonlyArray<{
|
|
1882
|
+
key: string;
|
|
1883
|
+
overall: number;
|
|
1884
|
+
at: string;
|
|
1885
|
+
}>): ScorecardRow[];
|
|
1886
|
+
/** Pure: the scorecard as Markdown: cross-cutting causes, then pages worst first. */
|
|
1887
|
+
declare function scorecardMarkdown(input: {
|
|
1888
|
+
app: string;
|
|
1889
|
+
url: string;
|
|
1890
|
+
at: string;
|
|
1891
|
+
viewport: {
|
|
1892
|
+
width: number;
|
|
1893
|
+
height: number;
|
|
1894
|
+
};
|
|
1895
|
+
rows: readonly ScorecardRow[];
|
|
1896
|
+
causes: readonly UxCause[];
|
|
1897
|
+
}): string;
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* `mushi-ux scorecard`: score every page of a live app against a written
|
|
1901
|
+
* rubric (ADR 0067), group what is wrong into root causes, and file the top
|
|
1902
|
+
* ones as Mushi reports.
|
|
1903
|
+
*
|
|
1904
|
+
* - Pages: `--path` / `--paths-file` (a route list), else the routes in the
|
|
1905
|
+
* app's source (`--routes-from`), else a crawl under the URL. A page keeps
|
|
1906
|
+
* its view (`/team?view=sso` is its own page).
|
|
1907
|
+
* - Capture: the audit's read-only session (a cached, signed-in profile, the
|
|
1908
|
+
* write guard), one viewport (desktop-first; the app's setting or
|
|
1909
|
+
* `--viewport`). Each page gives an early screenshot (about 1 s), a settled
|
|
1910
|
+
* one, its tab title, text, controls, settle time and axe counts.
|
|
1911
|
+
* `--from-captures` scores captures another browser driver made in the same
|
|
1912
|
+
* layout, so no second browser opens on a profile already in use.
|
|
1913
|
+
* - Score: `--score-via server` sends each page to the `ux-scorecard`
|
|
1914
|
+
* platform route (the app's own key first); `claude-code`, `cursor` and
|
|
1915
|
+
* `anthropic-api` score on this machine. Both run the same rubric module
|
|
1916
|
+
* (scorecard-rubric.ts, byte-identical to the server's).
|
|
1917
|
+
* - Output: scorecard.md and scorecard.json in the run folder; `--sync` puts
|
|
1918
|
+
* it on the console (Check → UX runs → Scorecard); `--file` files one report
|
|
1919
|
+
* per root cause, at most five a run.
|
|
1920
|
+
*/
|
|
1921
|
+
|
|
1922
|
+
type ScoreVia = 'server' | 'claude-code' | 'cursor' | 'anthropic-api';
|
|
1923
|
+
declare const DEFAULT_SCORECARD_VIEWPORT: {
|
|
1924
|
+
readonly width: 1440;
|
|
1925
|
+
readonly height: 900;
|
|
1926
|
+
};
|
|
1927
|
+
/** Model for the local transports (claude-code, anthropic-api): the standard tier. */
|
|
1928
|
+
declare const DEFAULT_SCORECARD_MODEL = "claude-sonnet-5-5";
|
|
1929
|
+
/** In-page: the facts a reader of the page gets, and whether it still looks busy. Kept as source so any driver can evaluate it. */
|
|
1930
|
+
declare const FACTS_SCRIPT = "(() => {\n const visible = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none' }\n const clean = (t) => (t || '').replace(/\\s+/g, ' ').trim()\n const main = document.querySelector('main, [role=\"main\"]') || document.body\n const outside = []\n for (const el of document.querySelectorAll('[role=\"alert\"], [role=\"status\"], [aria-live], header, [class*=\"toast\" i], [class*=\"banner\" i]')) {\n if (main.contains(el) || !visible(el)) continue\n const t = clean(el.innerText)\n if (t && t.length < 400 && !outside.includes(t)) outside.push(t)\n }\n const crumb = document.querySelector('nav[aria-label*=\"readcrumb\" i], [class*=\"breadcrumb\" i]')\n const headings = [...main.querySelectorAll('h1, h2, h3')].filter(visible).map((h) => clean(h.innerText)).filter(Boolean)\n const controls = []\n for (const el of main.querySelectorAll('button, a[href], [role=\"button\"], [role=\"tab\"], select')) {\n if (!visible(el)) continue\n const t = clean(el.getAttribute('aria-label') || el.innerText || el.getAttribute('title') || '')\n if (t && t.length <= 80 && !controls.includes(t)) controls.push(t)\n if (controls.length >= 100) break\n }\n const text = clean(main.innerText)\n const busy = !!document.querySelector('[aria-busy=\"true\"]') || [...document.querySelectorAll('[class*=\"skeleton\" i], .animate-pulse')].some(visible) || /\\b(loading|checking|reading|fetching|composing)\\b[^.\\n]{0,40}(\u2026|\\.\\.\\.)/i.test(text)\n return {\n title: document.title,\n breadcrumb: crumb ? clean(crumb.innerText) : '',\n headings: headings.slice(0, 40),\n text: (outside.length ? 'Outside the page content: ' + outside.join(' | ') + '\\n' : '') + text,\n controls,\n overflowX: document.documentElement.scrollWidth > document.documentElement.clientWidth + 1,\n busy,\n sig: text.length + ':' + text.slice(0, 400),\n }\n})()";
|
|
1931
|
+
interface PageCapture {
|
|
1932
|
+
facts: UxPageFacts;
|
|
1933
|
+
early: Buffer;
|
|
1934
|
+
settled: Buffer;
|
|
1935
|
+
}
|
|
1936
|
+
/** Load one page and capture what a person sees early and once it settles. Works on any Playwright page. */
|
|
1937
|
+
declare function capturePage(page: Page, input: {
|
|
1938
|
+
baseUrl: string;
|
|
1939
|
+
path: string;
|
|
1940
|
+
label?: string;
|
|
1941
|
+
viewport: {
|
|
1942
|
+
width: number;
|
|
1943
|
+
height: number;
|
|
1944
|
+
};
|
|
1945
|
+
ignore?: readonly string[];
|
|
1946
|
+
axe?: boolean;
|
|
1947
|
+
}): Promise<PageCapture>;
|
|
1948
|
+
/** Pure: a folder name for a page key. */
|
|
1949
|
+
declare function captureFolder(key: string): string;
|
|
1950
|
+
/** Captures in `<dir>/pages/<page>/{facts.json, early.png, settled.png}`, as this tool or another driver wrote them. */
|
|
1951
|
+
declare function readCaptures(dir: string): Array<{
|
|
1952
|
+
folder: string;
|
|
1953
|
+
facts: UxPageFacts;
|
|
1954
|
+
}>;
|
|
1955
|
+
interface Scorer {
|
|
1956
|
+
readonly name: string;
|
|
1957
|
+
score(facts: UxPageFacts, folder: string, ctx: {
|
|
1958
|
+
app: string;
|
|
1959
|
+
otherPages: string[];
|
|
1960
|
+
about?: string;
|
|
1961
|
+
}): Promise<{
|
|
1962
|
+
score?: UxPageScore;
|
|
1963
|
+
error?: string;
|
|
1964
|
+
}>;
|
|
1965
|
+
group(pages: readonly ScoredPage[], base: readonly UxCause[], priorKeys: readonly string[]): Promise<{
|
|
1966
|
+
causes: UxCause[];
|
|
1967
|
+
error?: string;
|
|
1968
|
+
}>;
|
|
1969
|
+
/** Screenshot names this scorer already uploaded, per page key (the server scorer uploads as it scores). */
|
|
1970
|
+
readonly uploaded?: ReadonlyMap<string, string[]>;
|
|
1971
|
+
}
|
|
1972
|
+
/** Score on this machine through one of the checker's transports. */
|
|
1973
|
+
declare function localScorer(via: Exclude<ScoreVia, 'server'>, model: string, client?: Anthropic): Scorer;
|
|
1974
|
+
/** Score on the server through the `ux-scorecard` platform route (the app's own key first). */
|
|
1975
|
+
declare function serverScorer(cfg: SyncConfig, runId: string): Scorer;
|
|
1976
|
+
interface ScorecardOptions {
|
|
1977
|
+
url: string;
|
|
1978
|
+
app: string;
|
|
1979
|
+
about?: string;
|
|
1980
|
+
/** Pages to score (paths with their view query). Default: the routes in `routesFrom`, else a crawl. */
|
|
1981
|
+
paths?: string[];
|
|
1982
|
+
routesFrom?: string;
|
|
1983
|
+
maxPages?: number;
|
|
1984
|
+
viewport?: {
|
|
1985
|
+
width: number;
|
|
1986
|
+
height: number;
|
|
1987
|
+
};
|
|
1988
|
+
/** Score captures already on disk instead of opening a browser. */
|
|
1989
|
+
fromCaptures?: string;
|
|
1990
|
+
profileDir?: string;
|
|
1991
|
+
channel?: 'chrome' | 'chromium';
|
|
1992
|
+
allow?: AllowRule[];
|
|
1993
|
+
ignore?: string[];
|
|
1994
|
+
scorer: Scorer;
|
|
1995
|
+
/** Pages scored at once (local transports are slow; the server takes one page a request). */
|
|
1996
|
+
concurrency?: number;
|
|
1997
|
+
/** Earlier runs' pattern keys, so a reworded cause keeps its report. */
|
|
1998
|
+
priorKeys?: string[];
|
|
1999
|
+
/** Earlier runs' page scores, for the trend in scorecard.md. */
|
|
2000
|
+
history?: Array<{
|
|
2001
|
+
key: string;
|
|
2002
|
+
overall: number;
|
|
2003
|
+
at: string;
|
|
2004
|
+
}>;
|
|
2005
|
+
runId: string;
|
|
2006
|
+
outDir?: string;
|
|
2007
|
+
onProgress?: (msg: string) => void;
|
|
2008
|
+
/** After each page is captured or scored (the CLI syncs the run as it goes). */
|
|
2009
|
+
onPage?: (page: ScorecardPageResult) => Promise<void> | void;
|
|
2010
|
+
}
|
|
2011
|
+
interface ScorecardPageResult {
|
|
2012
|
+
facts: UxPageFacts;
|
|
2013
|
+
folder: string;
|
|
2014
|
+
score?: UxPageScore;
|
|
2015
|
+
error?: string;
|
|
2016
|
+
}
|
|
2017
|
+
interface ScorecardResult {
|
|
2018
|
+
runId: string;
|
|
2019
|
+
dir: string;
|
|
2020
|
+
pages: ScorecardPageResult[];
|
|
2021
|
+
causes: UxCause[];
|
|
2022
|
+
groupError?: string;
|
|
2023
|
+
markdown: string;
|
|
2024
|
+
}
|
|
2025
|
+
/** Pure: a scorecard run id in the console's format (yyyymmdd-hhmmss-xxxx). */
|
|
2026
|
+
declare function scorecardRunId(now: Date, rand?: () => number): string;
|
|
2027
|
+
declare function runScorecard(opts: ScorecardOptions): Promise<ScorecardResult>;
|
|
2028
|
+
/** Put the run on the console. Pages scored on the server are left as the server scored them. */
|
|
2029
|
+
declare function syncScorecard(cfg: SyncConfig, input: {
|
|
2030
|
+
runId: string;
|
|
2031
|
+
url: string;
|
|
2032
|
+
viewport: {
|
|
2033
|
+
width: number;
|
|
2034
|
+
height: number;
|
|
2035
|
+
};
|
|
2036
|
+
scoredBy: string;
|
|
2037
|
+
startedAt: string;
|
|
2038
|
+
finished: boolean;
|
|
2039
|
+
error?: string;
|
|
2040
|
+
pages: readonly ScorecardPageResult[];
|
|
2041
|
+
causes?: readonly UxCause[];
|
|
2042
|
+
cliVersion?: string;
|
|
2043
|
+
uploaded?: ReadonlyMap<string, string[]>;
|
|
2044
|
+
}): Promise<string | null>;
|
|
2045
|
+
/** Upload every page's screenshots (local scoring: the server scorer uploads as it scores). */
|
|
2046
|
+
declare function uploadAllShots(cfg: SyncConfig, runId: string, pages: readonly ScorecardPageResult[]): Promise<Map<string, string[]>>;
|
|
2047
|
+
interface ScorecardFileOutcome {
|
|
2048
|
+
filed: Array<{
|
|
2049
|
+
reportId: string;
|
|
2050
|
+
patternKey: string;
|
|
2051
|
+
title: string;
|
|
2052
|
+
}>;
|
|
2053
|
+
updated: Array<{
|
|
2054
|
+
reportId: string;
|
|
2055
|
+
patternKey: string;
|
|
2056
|
+
}>;
|
|
2057
|
+
skipped: Array<{
|
|
2058
|
+
patternKey: string;
|
|
2059
|
+
reason: string;
|
|
2060
|
+
}>;
|
|
2061
|
+
wouldFile?: Array<{
|
|
2062
|
+
patternKey: string;
|
|
2063
|
+
title: string;
|
|
2064
|
+
pages: number;
|
|
2065
|
+
}>;
|
|
2066
|
+
}
|
|
2067
|
+
/** File the run's top root causes (the server plans: one per pattern, the run and app caps). */
|
|
2068
|
+
declare function fileScorecard(cfg: SyncConfig, runId: string, input: {
|
|
2069
|
+
causes?: readonly UxCause[];
|
|
2070
|
+
dryRun?: boolean;
|
|
2071
|
+
}): Promise<ScorecardFileOutcome>;
|
|
2072
|
+
/** The app's earlier scorecard: its viewport setting, open pattern keys and page history, for a new run. */
|
|
2073
|
+
declare function scorecardContext(cfg: SyncConfig): Promise<{
|
|
2074
|
+
viewport: string | null;
|
|
2075
|
+
history: Array<{
|
|
2076
|
+
key: string;
|
|
2077
|
+
overall: number;
|
|
2078
|
+
at: string;
|
|
2079
|
+
}>;
|
|
2080
|
+
priorKeys: string[];
|
|
2081
|
+
}>;
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* What a native screen says (ADR 0073), from the files a phone driver can
|
|
2085
|
+
* write next to its screenshot, with no device access here:
|
|
2086
|
+
*
|
|
2087
|
+
* - `window.xml` Android `uiautomator dump` (adb exec-out uiautomator dump /dev/tty)
|
|
2088
|
+
* - `hierarchy.json` `maestro hierarchy` (Android and iOS)
|
|
2089
|
+
* - `facts.json` any subset of the scorecard's page facts the driver wrote itself
|
|
2090
|
+
*
|
|
2091
|
+
* The scorecard judges a page on its facts (text, controls, headings) and its
|
|
2092
|
+
* screenshots; a phone screen with only pixels would be judged blind. This
|
|
2093
|
+
* reads the visible text and the tappable labels from whichever file is
|
|
2094
|
+
* there, fills every other fact with an honest "not measured" (axe null,
|
|
2095
|
+
* settle time null), and keeps the screen's own name as its path.
|
|
2096
|
+
*
|
|
2097
|
+
* Pure: strings in, facts out. No XML library: uiautomator's dump is flat
|
|
2098
|
+
* attribute soup, and a small attribute reader is enough and safe (it never
|
|
2099
|
+
* resolves entities beyond the five XML ones, never fetches anything).
|
|
2100
|
+
*/
|
|
2101
|
+
|
|
2102
|
+
interface NativeNode {
|
|
2103
|
+
text: string;
|
|
2104
|
+
/** content-desc / accessibilityText: what a screen reader announces. */
|
|
2105
|
+
label: string;
|
|
2106
|
+
className: string;
|
|
2107
|
+
clickable: boolean;
|
|
2108
|
+
heading: boolean;
|
|
2109
|
+
/** Visible on screen (non-empty bounds, not hidden). */
|
|
2110
|
+
visible: boolean;
|
|
2111
|
+
}
|
|
2112
|
+
/** Pure: the nodes of an Android `uiautomator dump`. */
|
|
2113
|
+
declare function parseUiautomator(xml: string): NativeNode[];
|
|
2114
|
+
/** Pure: the nodes of a `maestro hierarchy` dump (depth-first, at most 5,000). */
|
|
2115
|
+
declare function parseMaestroHierarchy(json: string): NativeNode[];
|
|
2116
|
+
/** Pure: the scorecard's text, controls and headings of a screen's nodes. */
|
|
2117
|
+
declare function nodesToContent(nodes: readonly NativeNode[]): {
|
|
2118
|
+
text: string;
|
|
2119
|
+
controls: string[];
|
|
2120
|
+
headings: string[];
|
|
2121
|
+
};
|
|
2122
|
+
/** Pure: width and height of a PNG from its header, or null when the bytes are not a PNG. */
|
|
2123
|
+
declare function pngSize(bytes: Uint8Array): {
|
|
2124
|
+
width: number;
|
|
2125
|
+
height: number;
|
|
2126
|
+
} | null;
|
|
2127
|
+
/** Pure: a screen name as a page key and path (`Onboarding step 1` → `/onboarding-step-1`). */
|
|
2128
|
+
declare function screenPath(name: string): string;
|
|
2129
|
+
/**
|
|
2130
|
+
* Pure: complete scorecard facts for one native screen. `given` is what the
|
|
2131
|
+
* driver wrote in facts.json (any subset; a field there wins), `nodes` the
|
|
2132
|
+
* hierarchy when one was dumped, `png` the settled screenshot's size, `scale`
|
|
2133
|
+
* the device's pixel ratio (pixels per point; 1 keeps pixels).
|
|
2134
|
+
*/
|
|
2135
|
+
declare function nativeFacts(input: {
|
|
2136
|
+
folder: string;
|
|
2137
|
+
given?: Partial<UxPageFacts> | null;
|
|
2138
|
+
nodes?: readonly NativeNode[] | null;
|
|
2139
|
+
png?: {
|
|
2140
|
+
width: number;
|
|
2141
|
+
height: number;
|
|
2142
|
+
} | null;
|
|
2143
|
+
scale?: number;
|
|
2144
|
+
}): UxPageFacts;
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* `mushi-ux upload <dir>`: put screenshots any driver made into a UX scorecard
|
|
2148
|
+
* run (ADR 0073), so a native app's screens are scored on the same rubric,
|
|
2149
|
+
* probes and judge as a web page.
|
|
2150
|
+
*
|
|
2151
|
+
* Layout (the scorecard's own capture layout, as `--from-captures` reads it):
|
|
2152
|
+
*
|
|
2153
|
+
* <dir>/pages/<screen>/settled.png required (or early.png)
|
|
2154
|
+
* <dir>/pages/<screen>/early.png optional: the screen about 1 s in
|
|
2155
|
+
* <dir>/pages/<screen>/facts.json optional: any of the page facts
|
|
2156
|
+
* <dir>/pages/<screen>/window.xml optional: `adb exec-out uiautomator dump /dev/tty`
|
|
2157
|
+
* <dir>/pages/<screen>/hierarchy.json optional: `maestro hierarchy`
|
|
2158
|
+
*
|
|
2159
|
+
* Steps: read and check every screen (a real PNG, at most 8 MB), POST
|
|
2160
|
+
* /v1/ux/captures (one run, its scoring budget reserved), PUT each PNG to its
|
|
2161
|
+
* signed URL, then with `--score` score each screen on the server, group the
|
|
2162
|
+
* causes, close the run, and with `--file` file the top causes as reports.
|
|
2163
|
+
* Templates for Maestro, adb and the iOS simulator: docs/templates/ux-native/.
|
|
2164
|
+
*/
|
|
2165
|
+
|
|
2166
|
+
declare const UPLOAD_PLATFORMS: readonly ["ios", "android", "flutter", "react_native", "capacitor", "web", "other"];
|
|
2167
|
+
type UploadPlatform = (typeof UPLOAD_PLATFORMS)[number];
|
|
2168
|
+
declare const UPLOAD_SOURCES: readonly ["maestro", "adb", "simctl", "sdk", "playwright", "other"];
|
|
2169
|
+
type UploadSource = (typeof UPLOAD_SOURCES)[number];
|
|
2170
|
+
/** The server's caps (POST /v1/ux/captures). */
|
|
2171
|
+
declare const UPLOAD_MAX_PAGES = 60;
|
|
2172
|
+
declare const UPLOAD_MAX_PNG_BYTES: number;
|
|
2173
|
+
interface CapturedScreen {
|
|
2174
|
+
folder: string;
|
|
2175
|
+
facts: UxPageFacts;
|
|
2176
|
+
shots: Array<'early' | 'settled'>;
|
|
2177
|
+
}
|
|
2178
|
+
/** Read every screen under `<dir>/pages`; throws with a plain message on a screen that cannot be uploaded. */
|
|
2179
|
+
declare function readScreens(dir: string, opts?: {
|
|
2180
|
+
scale?: number;
|
|
2181
|
+
}): CapturedScreen[];
|
|
2182
|
+
interface UploadOptions {
|
|
2183
|
+
dir: string;
|
|
2184
|
+
platform: UploadPlatform;
|
|
2185
|
+
device?: string;
|
|
2186
|
+
source?: UploadSource;
|
|
2187
|
+
/** What to call the app in prompts and on the run. */
|
|
2188
|
+
app?: string;
|
|
2189
|
+
about?: string;
|
|
2190
|
+
/** Pixels per point of the device, to record the viewport in points (default 1: pixels). */
|
|
2191
|
+
scale?: number;
|
|
2192
|
+
/** WIDTHxHEIGHT for the run (default: the first screen's). */
|
|
2193
|
+
viewport?: string;
|
|
2194
|
+
/** The most the run may spend on server scoring. */
|
|
2195
|
+
maxCostUsd?: number;
|
|
2196
|
+
/** Score each screen on the server after the upload, group the causes and close the run. */
|
|
2197
|
+
score?: boolean;
|
|
2198
|
+
/** With score: file the top causes as reports. */
|
|
2199
|
+
file?: boolean;
|
|
2200
|
+
/** With file: show what would be filed. */
|
|
2201
|
+
dryRun?: boolean;
|
|
2202
|
+
concurrency?: number;
|
|
2203
|
+
onProgress?: (msg: string) => void;
|
|
2204
|
+
fetchImpl?: typeof fetch;
|
|
2205
|
+
}
|
|
2206
|
+
interface UploadResult {
|
|
2207
|
+
runId: string;
|
|
2208
|
+
pages: number;
|
|
2209
|
+
uploaded: number;
|
|
2210
|
+
reservedUsd: number | null;
|
|
2211
|
+
scored: number;
|
|
2212
|
+
mean: number | null;
|
|
2213
|
+
causes: UxCause[];
|
|
2214
|
+
errors: string[];
|
|
2215
|
+
filed?: ScorecardFileOutcome;
|
|
2216
|
+
consoleUrl: string;
|
|
2217
|
+
}
|
|
2218
|
+
declare function uploadCaptures(cfg: SyncConfig, opts: UploadOptions): Promise<UploadResult>;
|
|
2219
|
+
|
|
1393
2220
|
/**
|
|
1394
2221
|
* The cheap, objective keep-or-revert decision after one agent run. It only
|
|
1395
2222
|
* uses measurements (probes, pixel diff, files changed), never a model's
|
|
@@ -1419,4 +2246,4 @@ interface Verdict {
|
|
|
1419
2246
|
}
|
|
1420
2247
|
declare function decide(input: VerdictInput): Verdict;
|
|
1421
2248
|
|
|
1422
|
-
export { AGENTS, type AgentAdapter, type AgentName, type AgentRunOptions, type AllowRule, type AxeViolation, type BrowserSession, type Candidate, type Capture, type CursorCloudDeps, DEFAULT_JUDGE_MODEL, DEFAULT_SETUP_COMMAND, type Dashboard, type DiscoverOptions, type FreshAction, type FreshAsk, type FreshEyesFinding, type FreshEyesOptions, type FreshEyesResult, type FreshEyesSession, type FreshEyesStep, type GuardPolicy, type Identity, type IterationRecord, type JudgeClaim, type JudgeOptions, type JudgeVerdict, type LayoutIssue, type LoopEvent, type LoopHandle, type LoopOptions, type Opinion, type OpinionCategory, POINTER_PROMPT, type PacketInput, type PageFacts, type Phase, type PhaseName, type ProbeResult, type ReplayStep, type RequirementKind, type RunState, type StallReason, type StepOutcome, type SuccessCheck, type Surface, type SurfaceKind, type SurfaceState, type SurfaceStatus, type SyncConfig, type SyncHandle, type TerminalHandoff, type TerminalOptions, type TerminalResult, VIEWPORTS, type Verdict, type VerdictInput, type Viewport, type WriteMode, buildPacket, captureSurface, cropTop, cursorCloudAdapter, cursorModel, dHash, decide, discover, findDesignFiles, getAgent, hammingHex, httpsRepoUrl, installGuard, isDestructiveLabel, isRequestAllowed, judgeSurface, loadState, newRunId, nextRoutePath, normalizeLink, openSession, pixelDiff, probePenalty, quoteArg, reactRouterPaths, routesFromSource, runDir, runFreshEyes, runProbes, runTerminalSetup, safeShotPath, saveState, settle, sitemapPaths, startDashboard, startLoop, startSync, surfaceKey, syncConfigFromEnv, toSnapshot, unshuffle };
|
|
2249
|
+
export { AGENTS, type AgentAdapter, type AgentName, type AgentRunOptions, type AllowRule, type AxeViolation, type BrowserSession, CLIP_LIMITS, type Candidate, type Capture, type CapturedScreen, type ClipFlow, type ClipResult, type ClipSkip, type ClipUploadOutcome, type CursorCloudDeps, DEFAULT_CLIP_VIEWPORT, DEFAULT_JUDGE_MODEL, DEFAULT_SCORECARD_MODEL, DEFAULT_SCORECARD_VIEWPORT, DEFAULT_SETUP_COMMAND, type Dashboard, type DiscoverOptions, FACTS_SCRIPT, type FreshAction, type FreshAsk, type FreshEyesFinding, type FreshEyesOptions, type FreshEyesPersona, type FreshEyesResult, type FreshEyesSession, type FreshEyesStep, type GuardPolicy, type Identity, type IterationRecord, type JudgeClaim, type JudgeOptions, type JudgeVerdict, type LayoutIssue, type LoopEvent, type LoopHandle, type LoopOptions, type NativeNode, type Opinion, type OpinionCategory, POINTER_PROMPT, type PacketInput, type PageCapture, type PageFacts, type ParsedPageScore, type Phase, type PhaseName, type ProbeResult, type RecordClipsOptions, type ReplayStep, type RequirementKind, type RunState, type ScoreVia, type ScorecardFileOutcome, type ScorecardOptions, type ScorecardPageResult, type ScorecardResult, type ScorecardRow, type ScoredPage, type Scorer, type ServerClipCaps, type StallReason, type StepOutcome, type SuccessCheck, type Surface, type SurfaceKind, type SurfaceState, type SurfaceStatus, type SyncConfig, type SyncHandle, type TerminalHandoff, type TerminalOptions, type TerminalResult, 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, type UploadOptions, type UploadPlatform, type UploadResult, type UploadSource, type UxCause, type UxCausePage, type UxClaim, type UxDimension, type UxFilingPlan, type UxIssue, type UxPageFacts, type UxPagePromptContext, type UxPageScore, type UxSeverity, VIEWPORTS, type Verdict, type VerdictInput, type Viewport, type WriteMode, accessibilityCap, buildPacket, capFlows, captureFolder, capturePage, captureSurface, causeIsFileable, causeRank, causeReportBody, causeSlug, causeTokens, clampCaps, clipSlug, clipUploadBody, 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, reactRouterPaths, readCaptures, readScreens, recordClips, 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, unshuffle, uploadAllShots, uploadCaptures, uploadClips };
|