screw-bugs 0.1.9 → 0.1.11

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.
Files changed (102) hide show
  1. package/README.md +100 -54
  2. package/dist/browser-playwright/capture.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli/app.js +6 -2
  5. package/dist/cli/commands.js +4 -3
  6. package/dist/cli/doctor.d.ts +17 -2
  7. package/dist/cli/doctor.js +62 -4
  8. package/dist/cli/mcp.js +7 -4
  9. package/dist/cli/report-server.d.ts +19 -10
  10. package/dist/cli/report-server.js +43 -18
  11. package/dist/cli/share.js +2 -2
  12. package/dist/cli/sign-in.d.ts +9 -3
  13. package/dist/cli/sign-in.js +12 -9
  14. package/dist/cli/tailnet.d.ts +57 -0
  15. package/dist/cli/tailnet.js +82 -0
  16. package/dist/core/index.d.ts +1 -14
  17. package/dist/core/index.js +3 -14
  18. package/dist/report/index.d.ts +1 -10
  19. package/dist/report/index.js +3 -10
  20. package/dist/schema/index.d.ts +1 -9
  21. package/dist/schema/index.js +3 -9
  22. package/package.json +14 -14
  23. package/dist/core/accounts.d.ts +0 -40
  24. package/dist/core/accounts.js +0 -95
  25. package/dist/core/css.d.ts +0 -95
  26. package/dist/core/css.js +0 -436
  27. package/dist/core/engine.d.ts +0 -75
  28. package/dist/core/engine.js +0 -560
  29. package/dist/core/errors.d.ts +0 -85
  30. package/dist/core/errors.js +0 -36
  31. package/dist/core/evidence.d.ts +0 -14
  32. package/dist/core/evidence.js +0 -131
  33. package/dist/core/labels.d.ts +0 -47
  34. package/dist/core/labels.js +0 -199
  35. package/dist/core/liveness.d.ts +0 -45
  36. package/dist/core/liveness.js +0 -66
  37. package/dist/core/marks.d.ts +0 -63
  38. package/dist/core/marks.js +0 -410
  39. package/dist/core/services.d.ts +0 -579
  40. package/dist/core/services.js +0 -25
  41. package/dist/core/share.d.ts +0 -68
  42. package/dist/core/share.js +0 -318
  43. package/dist/core/steps.d.ts +0 -106
  44. package/dist/core/steps.js +0 -722
  45. package/dist/core/uploads.d.ts +0 -49
  46. package/dist/core/uploads.js +0 -133
  47. package/dist/core/video.d.ts +0 -53
  48. package/dist/core/video.js +0 -241
  49. package/dist/core/viewport.d.ts +0 -28
  50. package/dist/core/viewport.js +0 -50
  51. package/dist/report/assets.d.ts +0 -34
  52. package/dist/report/assets.js +0 -105
  53. package/dist/report/bug.d.ts +0 -11
  54. package/dist/report/bug.js +0 -20
  55. package/dist/report/html.d.ts +0 -47
  56. package/dist/report/html.js +0 -923
  57. package/dist/report/icons.d.ts +0 -51
  58. package/dist/report/icons.js +0 -93
  59. package/dist/report/live.d.ts +0 -7
  60. package/dist/report/live.js +0 -135
  61. package/dist/report/logos.d.ts +0 -4
  62. package/dist/report/logos.js +0 -19
  63. package/dist/report/markup.d.ts +0 -50
  64. package/dist/report/markup.js +0 -156
  65. package/dist/report/menu-bar.d.ts +0 -60
  66. package/dist/report/menu-bar.js +0 -157
  67. package/dist/report/player.d.ts +0 -102
  68. package/dist/report/player.js +0 -315
  69. package/dist/report/pr-summary.d.ts +0 -11
  70. package/dist/report/pr-summary.js +0 -119
  71. package/dist/report/sha256.d.ts +0 -9
  72. package/dist/report/sha256.js +0 -97
  73. package/dist/report/share-page.d.ts +0 -48
  74. package/dist/report/share-page.js +0 -291
  75. package/dist/report/shots.d.ts +0 -59
  76. package/dist/report/shots.js +0 -280
  77. package/dist/report/sign-in.d.ts +0 -41
  78. package/dist/report/sign-in.js +0 -568
  79. package/dist/report/styles.d.ts +0 -3
  80. package/dist/report/styles.js +0 -274
  81. package/dist/report/view.d.ts +0 -296
  82. package/dist/report/view.js +0 -702
  83. package/dist/report/walkthrough.d.ts +0 -93
  84. package/dist/report/walkthrough.js +0 -716
  85. package/dist/schema/accounts.d.ts +0 -137
  86. package/dist/schema/accounts.js +0 -121
  87. package/dist/schema/config.d.ts +0 -7
  88. package/dist/schema/config.js +0 -6
  89. package/dist/schema/doctor.d.ts +0 -46
  90. package/dist/schema/doctor.js +0 -30
  91. package/dist/schema/evidence.d.ts +0 -1115
  92. package/dist/schema/evidence.js +0 -565
  93. package/dist/schema/findings.d.ts +0 -161
  94. package/dist/schema/findings.js +0 -82
  95. package/dist/schema/job.d.ts +0 -1905
  96. package/dist/schema/job.js +0 -577
  97. package/dist/schema/ledger.d.ts +0 -1124
  98. package/dist/schema/ledger.js +0 -285
  99. package/dist/schema/share.d.ts +0 -55
  100. package/dist/schema/share.js +0 -64
  101. package/dist/schema/status.d.ts +0 -7
  102. package/dist/schema/status.js +0 -11
@@ -1,274 +0,0 @@
1
- import { menuBarStyles } from './menu-bar.js';
2
- import { CROP_WIDE } from './view.js';
3
- /*
4
- * The styles both pages share: the report and the walkthrough. Colors are tokens with a light and
5
- * a dark set (greys are Radix Olive, the accent is screw-bugs' lime), plus shadcn/ui's `--input`
6
- * (a switch's track when off) and `--ring` (the focus ring) mapped onto them: the system's choice by
7
- * default (`prefers-color-scheme`), or the reader's from the theme button (`data-theme` on the
8
- * root, set by the page's script). Lime is only ever a fill behind dark text. Recordings,
9
- * screenshots and the marks drawn over them keep their colors in both themes.
10
- *
11
- * Fonts: Geist and Geist Mono, loaded from Google Fonts by each page's head (`webFonts` in
12
- * markup.ts). Offline, the system's fonts after them in `--sans` and `--mono` take their place,
13
- * and no weight or slant is ever faked (`font-synthesis: none`).
14
- */
15
- export const light = `
16
- --bg: #ffffff; --bg-2: #f9f9f9; --panel: #fcfdfc; --subtle: #eff1ef;
17
- --border: #d7dad7; --border-strong: #b9bcb8;
18
- --muted: #60655f; --header: #9a9e98; --text: #1d211c;
19
- --accent: #94f20d; --on-accent: #1d211c; --accent-subtle: #eef6d6; --accent-border: #abc978;
20
- --fail: #e54d2e; --fail-text: #d13415; --pass: #8d8d8d;
21
- --link: #1d211c;
22
- --input: var(--border-strong); --ring: var(--header);
23
- --shadow: 0 16px 40px -4px rgba(29, 33, 28, .14), 0 2px 6px rgba(29, 33, 28, .08);
24
- --scrim: rgba(29, 33, 28, .55);
25
- --caption: #d7dad7; --caption-border: #b9bcb8; --video-edge: #111210;
26
- color-scheme: light;
27
- `;
28
- export const dark = `
29
- --bg: #111210; --bg-2: #181917; --panel: #181917; --subtle: #212220;
30
- --border: #383a36; --border-strong: #5c625b;
31
- --muted: #afb5ad; --header: #5c625b; --text: #eceeec;
32
- --accent: #94f20d; --on-accent: #1d211c; --accent-subtle: #1f2917; --accent-border: #496231;
33
- --fail: #e54d2e; --fail-text: #ff977d; --pass: #8d8d8d;
34
- --link: #eceeec;
35
- --input: var(--border-strong); --ring: var(--muted);
36
- --shadow: 0 20px 48px -4px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
37
- --scrim: rgba(0, 0, 0, .7);
38
- --caption: #181917; --caption-border: #383a36; --video-edge: #383a36;
39
- color-scheme: dark;
40
- `;
41
- export const styles = /* css */ `:root { ${light}
42
- --video: #111210;
43
- --mark-red: #e5484d; --mark-green: #12a150; --mark-step: #2f6fd6;
44
- --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
45
- --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
46
- /* The type scale (the design's typography spec), as \`font\` values: Geist for everything but
47
- times, counts, URL-like labels and metadata, which are Geist Mono. Medium is 500, never 600;
48
- 700 only for the title and the verdict, the only two with letter-spacing (\`--ls-title\`,
49
- \`--ls-lead\`). Nothing is uppercase but the "Fix first" label. */
50
- --t-title: 700 28px/36px var(--sans); --ls-title: -0.9px;
51
- --t-lead: 700 20px/26px var(--sans); --ls-lead: -0.5px;
52
- --t-body-lg: 400 16px/22px var(--sans);
53
- --t-prompt: 400 16px/21px var(--sans);
54
- --t-heading-sm: 500 16px/21px var(--sans);
55
- --t-card-title: 500 15px/19px var(--sans);
56
- --t-body: 400 14px/20px var(--sans);
57
- --t-body-tight: 400 14px/18px var(--sans);
58
- --t-control: 400 13px/17px var(--sans);
59
- --t-small: 400 12px/16px var(--sans);
60
- --t-small-strong: 500 12px/16px var(--sans);
61
- --t-mono: 400 12px/16px var(--mono);
62
- --t-mono-strong: 500 12px/16px var(--mono);
63
- --bar: 56px;
64
- /* shadcn/ui's states, in this palette: the soft 3 px focus ring (its ring color at half), and
65
- the hover fill of a subtle control. */
66
- --ring-soft: color-mix(in srgb, var(--ring) 50%, transparent);
67
- --focus: 0 0 0 3px var(--ring-soft);
68
- --subtle-hover: color-mix(in srgb, var(--subtle), var(--border) 60%);
69
- --ease: .15s ease;
70
- }
71
- @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { ${dark} } }
72
- :root[data-theme="dark"] { ${dark} }
73
- * { box-sizing: border-box; }
74
- html { background: var(--bg); scroll-padding-top: var(--bar); }
75
- body { margin: 0; color: var(--text); font: var(--t-body); font-synthesis: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
76
- a { color: var(--link); text-underline-offset: 2px; }
77
- :focus-visible { outline: 2px solid transparent; outline-offset: 2px; border-radius: 4px; box-shadow: var(--focus); }
78
- button { font: inherit; color: inherit; }
79
- /* Controls change color and ring smoothly, as shadcn/ui's do; a disabled one fades and takes no
80
- clicks. */
81
- button, summary, a, label.toggle input, .knob { transition: color var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease), opacity var(--ease); }
82
- button:disabled { opacity: .5; pointer-events: none; }
83
- strong, b { font-weight: 500; }
84
- code { font: 0.88em var(--mono); }
85
- q.value { quotes: "\\201C" "\\201D"; }
86
- [hidden] { display: none !important; }
87
- .note { color: var(--muted); }
88
- .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
89
- .label { margin: 0 0 10px; font: var(--t-small-strong); color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
90
- h1, h2, h3, h4 { text-wrap: balance; }
91
-
92
- /* The menu bar (\`menu-bar.ts\`). It stays on top while the page scrolls, \`--bar\` high (as it is):
93
- whatever else sticks goes under it. */
94
- ${menuBarStyles}
95
- /* The bug of the page's theme, and brand logos (logos.ts), in their own colors. */
96
- .bug { display: block; flex: none; width: 24px; height: 24px; }
97
- .bug img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
98
- .logo { display: block; flex: none; }
99
- .bug-dark, .gh-dark { display: none; }
100
- @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.bug-light, .gh-light) { display: none; } :root:not([data-theme="light"]) :is(.bug-dark, .gh-dark) { display: block; } }
101
- :root[data-theme="dark"] :is(.bug-light, .gh-light) { display: none; }
102
- :root[data-theme="dark"] :is(.bug-dark, .gh-dark) { display: block; }
103
-
104
- /* What was asked, in quotes, clamped; "read full prompt" opens it in place. */
105
- .prompt { margin: 0 auto; max-width: 46em; text-align: center; font: var(--t-prompt); color: var(--muted); }
106
- .prompt-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
107
- .prompt.open .prompt-text { display: block; -webkit-line-clamp: none; line-clamp: none; }
108
- .prompt-more { margin-top: 2px; font: var(--t-small); color: var(--muted); background: none; border: 0; border-radius: 4px; padding: 4px 2px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
109
- .prompt-more:hover { color: var(--text); }
110
-
111
- /* Status icons: a filled circle with a glyph; never color alone (a label always goes with it). */
112
- .st { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--sc); color: #fff; }
113
- .st svg { width: 14px; height: 14px; }
114
- .s-passed { --sc: var(--pass); --st: var(--muted); }
115
- .s-failed, .s-blocked, .s-not_verified { --sc: var(--fail); --st: var(--fail-text); }
116
- .s-not_verified .st { background: transparent; color: var(--fail); box-shadow: inset 0 0 0 2px var(--fail); }
117
- .tag { display: inline-flex; align-items: center; gap: 6px; }
118
- .st-label { font: var(--t-small-strong); color: var(--st); white-space: nowrap; }
119
- /* Lucide icons (icons.ts), sized where they are used. */
120
- .icon { flex: none; display: block; }
121
-
122
- figure { margin: 0; }
123
-
124
- /* The player: a simplified browser window (desktop) or phone (mobile), never covered by controls. */
125
- .window { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--subtle); box-shadow: var(--shadow); }
126
- .toolbar { position: relative; display: flex; align-items: center; height: 40px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); }
127
- .dots { display: flex; gap: 8px; }
128
- .dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
129
- .dots i:nth-child(2) { background: #febc2e; }
130
- .dots i:nth-child(3) { background: #28c840; }
131
- .url { position: absolute; left: 50%; transform: translateX(-50%); width: min(380px, 60%); height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font: var(--t-small); color: var(--muted); white-space: nowrap; overflow: hidden; }
132
- .url span { overflow: hidden; text-overflow: ellipsis; }
133
- .url:empty::before, .url span:empty::before { content: "\\00a0"; }
134
- .screen { position: relative; aspect-ratio: var(--ar, 16 / 10); background: var(--video); }
135
- .screen video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--video); cursor: pointer; }
136
- .device-mobile .window { border-radius: 28px; padding: 8px 8px 10px; background: var(--subtle); }
137
- .device-mobile .toolbar { height: 38px; border: 0; padding: 0; margin-bottom: 8px; }
138
- .device-mobile .dots { display: none; }
139
- .device-mobile .url { width: 100%; height: 30px; border-radius: 10px; }
140
- .device-mobile .screen { border-radius: 20px; overflow: hidden; }
141
- /* What the window adds around its screen, in height and in width (toolbar, padding and borders,
142
- from the rules above): a page that fits the window into a space works out its size from these. */
143
- :root { --win-h: 43px; --win-w: 2px; }
144
- .device-mobile { --win-h: 66px; --win-w: 18px; }
145
- .screen:fullscreen { aspect-ratio: auto; border-radius: 0; }
146
- .unloaded-video { margin: 0; padding: 28px 20px; background: var(--panel); text-align: center; overflow-wrap: anywhere; font: var(--t-body); }
147
- .player.broken .screen { display: none; }
148
- /* Under the note for a video that does not load: a button that copies a prompt for the reader's
149
- coding agent, what it did, and the prompt in a box when the browser would not copy it. */
150
- .fix-video { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
151
- .fix-copy { padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-2); cursor: pointer; }
152
- .fix-copy:hover { background: var(--panel); }
153
- .fix-done:empty { display: none; }
154
- .fix-done { color: var(--muted); }
155
- .fix-text:not([hidden]) { display: block; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-2); color: inherit; font: 400 12px/18px var(--mono); text-align: left; resize: vertical; }
156
- /* The big play button over a video that has not played yet: the whole screen is its target, the
157
- circle in the middle shows it. It is over the video, so its colors are the same in both themes. */
158
- .big-play { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 0; border: 0; border-radius: inherit; background: rgba(0, 0, 0, .18); color: #fff; cursor: pointer; }
159
- .big-play span { display: grid; place-items: center; width: clamp(48px, 22%, 88px); aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .62); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 6px 24px rgba(0, 0, 0, .35); transition: transform .15s ease, background-color .15s ease; }
160
- .big-play svg { width: 42%; height: 42%; margin-left: 8%; }
161
- .big-play:hover span { background: rgba(0, 0, 0, .78); transform: scale(1.06); }
162
- .big-play:focus-visible { box-shadow: none; }
163
- .big-play:focus-visible span { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), var(--focus); }
164
- .novideo { margin: 0; padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--bg-2); color: var(--muted); }
165
-
166
- /* Controls: time · scrubber · length; then play, speed, a toggle and fullscreen. */
167
- .controls { display: grid; gap: 10px; margin: 14px auto 0; }
168
- .line1 { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font: var(--t-mono); color: var(--text); }
169
- .line1 .total { color: var(--muted); text-align: right; }
170
- .scrub { position: relative; height: 28px; cursor: pointer; touch-action: none; }
171
- .scrub:focus-visible { border-radius: 8px; }
172
- .track { position: absolute; inset: 11px 0; border-radius: 3px; background: var(--subtle); }
173
- .done { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--text); }
174
- .idle { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--border-strong); }
175
- .seg { position: absolute; top: -1px; bottom: -1px; border-radius: 3px; background: color-mix(in srgb, var(--pass) 40%, transparent); }
176
- .seg.s-failed, .seg.s-blocked, .seg.s-not_verified { background: var(--fail); }
177
- .seg.off { opacity: .35; }
178
- .seg.on { outline: 2px solid var(--accent); outline-offset: 2px; }
179
- .head { position: absolute; top: 4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
180
- .line2 { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
181
- /* Buttons, toggle groups and switches with shadcn/ui's states (hover, focus ring, pressed),
182
- in the design's shapes and colors. */
183
- .play { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); cursor: pointer; }
184
- .play:hover { background: color-mix(in srgb, var(--text) 88%, var(--bg)); }
185
- .play svg { width: 15px; height: 15px; }
186
- .play .i-pause, .play.playing .i-play { display: none; }
187
- .play.playing .i-pause { display: block; }
188
- .speed { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--subtle); }
189
- .speed button { min-width: 40px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: var(--t-control); cursor: pointer; }
190
- .speed button:hover { color: var(--text); background: var(--subtle-hover); }
191
- .speed button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
192
- .toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 2px; font: var(--t-control); color: var(--text); cursor: pointer; }
193
- /* A switch: its track is the focus ring's place, not the whole button with its words. */
194
- .toggle .knob, label.toggle input { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--input); }
195
- .toggle:focus-visible { box-shadow: none; }
196
- .toggle:focus-visible .knob, label.toggle input:focus-visible { box-shadow: var(--focus); }
197
- .toggle .knob::after, label.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: left .15s; }
198
- .toggle[aria-pressed="true"] .knob, label.toggle input:checked { background: var(--accent); }
199
- .toggle[aria-pressed="true"] .knob::after, label.toggle input:checked::after { left: 17px; background: var(--on-accent); }
200
- label.toggle input { appearance: none; margin: 0; cursor: pointer; }
201
- .full { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--subtle); color: var(--text); cursor: pointer; }
202
- .full:hover { background: var(--subtle-hover); }
203
- .full .i-out, .full.out .i-full { display: none; }
204
- .full.out .i-out { display: block; }
205
- .chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--subtle); font: var(--t-mono); color: var(--muted); white-space: nowrap; }
206
-
207
- /* Screenshots: a frame per image, the agent's marks and step boxes drawn over it by code. */
208
- .frame { position: relative; display: grid; overflow: hidden; text-decoration: none; container-type: inline-size; background: var(--bg-2); }
209
- .frame img { display: block; width: 100%; height: auto; }
210
- .frame.zoom img { position: absolute; max-width: none; height: auto; }
211
- .frame > img, .frame > .unloaded { grid-area: 1 / 1; }
212
- .frame > img { color: transparent; }
213
- .frame > .unloaded { align-self: start; justify-self: center; max-width: 34em; padding: 10px 12px; font: var(--t-small); text-align: center; color: var(--muted); overflow-wrap: anywhere; }
214
- .unloaded code { font: var(--t-mono); }
215
- .broken .frame > img, .broken .mk { display: none; }
216
- .broken .frame > .unloaded { align-self: center; color: var(--text); }
217
- .shot, .crop { container: fig / inline-size; }
218
-
219
- /* Marks go over their element and draw outside it: a line \`--gap\` away from its edges, with a
220
- white ring on either side and a dark one outside, so they read on any page and never cover what
221
- they mark. Lines and labels shrink with the frame (container units), down to a readable least;
222
- the report's code works out the same sizes to place labels (see \`reach\`, \`labelSize\`). Only on
223
- an edge of the image (\`.fl-*\`), with no room outside, does the line go inside. */
224
- .mk { --bw: clamp(1.5px, 0.4cqi, 3px); --gap: clamp(1px, 0.25cqi, 2px); --in: calc(-1 * (var(--gap) + var(--bw))); --t: var(--in); --r: var(--in); --b: var(--in); --l: var(--in); --out: calc(var(--gap) + var(--bw) + 2px); --ot: var(--out); --or: var(--out); --ob: var(--out); --ol: var(--out); position: absolute; pointer-events: none; }
225
- .mk::before { content: ""; position: absolute; inset: var(--t) var(--r) var(--b) var(--l); border: var(--bw) solid var(--mk-c); border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.95), 0 0 0 2px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.95); }
226
- .mk.fl-t { --t: 0px; } .mk.fl-r { --r: 0px; } .mk.fl-b { --b: 0px; } .mk.fl-l { --l: 0px; }
227
- .mk:is(.fl-t, .cut-t) { --ot: 0px; } .mk:is(.fl-r, .cut-r) { --or: 0px; }
228
- .mk:is(.fl-b, .cut-b) { --ob: 0px; } .mk:is(.fl-l, .cut-l) { --ol: 0px; }
229
- .mk-red { --mk-c: var(--mark-red); }
230
- .mk-green { --mk-c: var(--mark-green); }
231
- .mk-step { --mk-c: var(--mark-step); --bw: clamp(1px, 0.3cqi, 2px); }
232
- .mk-step::before { border-style: dashed; }
233
- .mk-n { position: absolute; padding: 1px 0.5em; border-radius: 3px; font: 700 clamp(10px, 2cqi, 12px)/1.4 var(--sans); color: #fff; white-space: nowrap; background: var(--mk-c); box-shadow: 0 0 0 1.5px rgba(255,255,255,.95); }
234
- /* The agent's marks are labelled bold, as on their annotated copies; a step's own box, medium. */
235
- .mk-step .mk-n { font-weight: 500; }
236
- /* Labels sit outside their box, on the side code picked (see placeLabels), never over the element. */
237
- .at-above-start, .at-above-end { bottom: calc(100% + var(--ot) + 4px); }
238
- .at-below-start, .at-below-end { top: calc(100% + var(--ob) + 4px); }
239
- .at-above-start, .at-below-start { left: calc(-1 * var(--ol)); }
240
- .at-above-end, .at-below-end { right: calc(-1 * var(--or)); }
241
- .at-right { left: calc(100% + var(--or) + 4px); top: calc(-1 * var(--ot)); }
242
- .at-left { right: calc(100% + var(--ol) + 4px); top: calc(-1 * var(--ot)); }
243
- .at-inside { left: 0; top: 0; }
244
- .mk-toggle { position: absolute; opacity: 0; pointer-events: none; }
245
- .mk-toggle:not(:checked) ~ .frame .mk { display: none; }
246
- .mk-switch { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: var(--t-small-strong); color: var(--muted); border-radius: 999px; padding: 3px 10px 3px 8px; background: var(--subtle); transition: background-color var(--ease), box-shadow var(--ease); }
247
- .mk-switch:hover { background: var(--subtle-hover); color: var(--text); }
248
- .mk-toggle:checked ~ * .mk-switch .i-off, .mk-toggle:not(:checked) ~ * .mk-switch .i-on { display: none; }
249
- .mk-toggle:focus-visible ~ * .mk-switch { box-shadow: var(--focus); }
250
- .lg-red, .lg-green, .lg-step { display: inline-flex; align-items: baseline; gap: 7px; }
251
- .key { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border: 3px solid; border-radius: 3px; font: 700 11px/1 var(--sans); color: #fff; align-self: center; }
252
- .lg-red .key { border-color: var(--mark-red); background: var(--mark-red); }
253
- .lg-green .key { border-color: var(--mark-green); background: var(--mark-green); }
254
- .lg-step .key { border: 2px dashed var(--mark-step); background: transparent; }
255
- .mk-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font: var(--t-control); }
256
- .mk-legend li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
257
- .mk-legend .unplaced .key { opacity: .45; }
258
- @container fig (width < ${CROP_WIDE.frame}px) { :is(.shot, .crop) .v-wide { display: none; } }
259
- @container fig (width >= ${CROP_WIDE.frame}px) { :is(.shot, .crop) .v-narrow { display: none; } }
260
-
261
- @media (min-width: 768px) { :root { --bar: 72px; } }
262
- @media (max-width: 680px) {
263
- .speed button { min-width: 36px; }
264
- }
265
- @media (max-width: 900px) {
266
- .line2 { gap: 8px; }
267
- .toggle .wide { display: none; }
268
- }
269
- @media print {
270
- html { background: #fff; }
271
- .mk-switch, .controls { display: none; }
272
- }
273
- @media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::backdrop { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
274
- `;
@@ -1,296 +0,0 @@
1
- import { type Box, type CaseEntry, type CaseFindings, type CaseSpec, type CaseStatus, type PlacedMark, type ReportBundle, type Session, type Severity, type Shot, type Step, type StepTiming } from '../schema/index.js';
2
- export declare const statuses: ReadonlyArray<CaseStatus>;
3
- export declare const statusLabel: Record<CaseStatus, string>;
4
- /**
5
- * The code's result, shown under the agent's verdict on a case its findings mark failed:
6
- * `Checks passed`, `Checks: blocked`.
7
- */
8
- export declare const checksNote: (status: CaseStatus) => string;
9
- export declare const countsOf: (cases: ReadonlyArray<CaseEntry>) => Record<CaseStatus, number>;
10
- /** A piece of a step's description: plain words, a quoted value, or code (URLs, keys, CSS). */
11
- export type TextPart = {
12
- readonly kind: 'text';
13
- readonly text: string;
14
- } | {
15
- readonly kind: 'value';
16
- readonly text: string;
17
- } | {
18
- readonly kind: 'code';
19
- readonly text: string;
20
- };
21
- /** A step as a sentence, such as Click button “Sign up”. */
22
- export declare const stepParts: (step: Step) => ReadonlyArray<TextPart>;
23
- export declare const stepText: (step: Step) => string;
24
- /** A step's own `timeoutMs` in words, when it is not the default, such as `waited up to 120 s`. */
25
- export declare const waitNote: (step: Step, ran: boolean) => string | undefined;
26
- /**
27
- * The files an upload step sends, each with its size once it ran and what the job says it is.
28
- * `sizes` come from the ledger (`StepTiming.files`), by file name.
29
- */
30
- export declare const uploadNotes: (step: Step, sizes?: ReadonlyArray<{
31
- readonly name: string;
32
- readonly size: number;
33
- }>) => ReadonlyArray<{
34
- readonly name: string;
35
- readonly size?: number;
36
- readonly about?: string;
37
- /** Said when the job skipped its content check on purpose. */
38
- readonly note?: string;
39
- }>;
40
- /** A file size as people read it: `840 B`, `12 KB`, `3.4 MB`. */
41
- export declare const formatBytes: (bytes: number) => string;
42
- /** Whether a step ran, decided the case, or never ran. `unknown` when the ledger cannot say. */
43
- export type StepState = 'done' | 'decided' | 'not-run' | 'unknown';
44
- export interface StepView {
45
- /** As the ledger counts steps: 1-based, and 0 for the opening navigation the engine adds. */
46
- readonly index: number;
47
- readonly step: Step;
48
- readonly implicit: boolean;
49
- readonly state: StepState;
50
- /** When it ran, in ms into the session's video; missing in older runs. */
51
- readonly timing: StepTiming | undefined;
52
- }
53
- /** A screenshot as the report shows it. */
54
- export interface ShotView {
55
- readonly path: string;
56
- /** What the ledger knows about it; undefined in runs from before screenshots had records. */
57
- readonly shot: Shot | undefined;
58
- /** The agent's highlights on it, placed by code, numbered in this order. */
59
- readonly marks: ReadonlyArray<PlacedMark>;
60
- /** Boxes of the page's elements on it, which labels keep off; empty when not saved. */
61
- readonly elements: ReadonlyArray<Box>;
62
- }
63
- /** The session video a case can be watched in, or why there is none. */
64
- export interface VideoView {
65
- readonly session: Session;
66
- /** Relative path, when the video file was saved. */
67
- readonly path: string | undefined;
68
- readonly problem: string | undefined;
69
- }
70
- export interface CaseView {
71
- readonly entry: CaseEntry;
72
- /** Undefined when the ledger has a case the job does not (a damaged or edited run folder). */
73
- readonly spec: CaseSpec | undefined;
74
- readonly steps: ReadonlyArray<StepView>;
75
- /** The screenshot taken when a failed or blocked case stopped. */
76
- readonly failureShot: ShotView | undefined;
77
- readonly otherShots: ReadonlyArray<ShotView>;
78
- /** The agent's write-up of this case, if it gave one. */
79
- readonly findings: CaseFindings | undefined;
80
- /** The status the run's code gave the case; `entry.status` is the one results show. */
81
- readonly checkStatus: CaseStatus;
82
- /** What is wrong, when the agent's findings mark the case failed (see `judgedCase`). */
83
- readonly agentFailed: string | undefined;
84
- readonly video: VideoView | undefined;
85
- }
86
- /** The video of `entry`'s session, if the run had sessions. */
87
- export declare const videoOf: (bundle: ReportBundle, entry: CaseEntry) => VideoView | undefined;
88
- export declare const caseViews: (bundle: ReportBundle) => ReadonlyArray<CaseView>;
89
- /**
90
- * `3 areas not tested`, when the agent's write-up names any: next to the counts, so passing cases
91
- * are not read as everything working.
92
- */
93
- export declare const notTestedCount: (bundle: ReportBundle) => string | undefined;
94
- /** The agent's fixes, most severe first; the agent's own order within a severity. */
95
- export declare const fixesOf: (bundle: ReportBundle) => {
96
- readonly title: string;
97
- readonly severity: "high" | "low" | "medium";
98
- readonly caseIds: readonly string[];
99
- readonly why: string;
100
- }[];
101
- export declare const severityLabel: Record<Severity, string>;
102
- /**
103
- * `0:07.3`, `1:05.0`, `1:02:03.4`: a timecode as people read it, from ms, to the nearest tenth of
104
- * a second (so 59.96 s is `1:00.0`).
105
- */
106
- export declare const formatTimecode: (ms: number) => string;
107
- /** A time to seek to, for a media fragment (`#t=6.25`) and the page's script: seconds, to the ms. */
108
- export declare const fragmentSeconds: (ms: number) => string;
109
- /** How far a crop zooms in, for a frame shown at least `frame` CSS pixels wide. */
110
- export interface CropOptions {
111
- /** The narrowest the frame is shown, in CSS pixels: rooms and readability are worked out for it. */
112
- readonly frame: number;
113
- /**
114
- * The most it zooms in: the crop is at least a `1 / maxZoom` share of the image's width. Past
115
- * `ZOOM`, only as far as `readable` needs.
116
- */
117
- readonly maxZoom: number;
118
- /**
119
- * The height in CSS pixels the shortest box should have at `frame`. A box too wide for that,
120
- * such as a line of text across the whole page, is shown around its text and images (its
121
- * `content`), and the rest of it is cut off by the crop's edges; the whole image is a click
122
- * away. A box whose content is not known is shown whole rather than cut where its text may not be.
123
- */
124
- readonly readable?: number;
125
- /** The tallest shape the crop may have, as width / height. */
126
- readonly minShape: number;
127
- }
128
- /** A box to zoom in on, with where its text and images are inside it, when known. */
129
- export interface CropBox extends Box {
130
- readonly content?: Box | undefined;
131
- }
132
- /**
133
- * The part of a `width` × `height` screenshot a frame shows, zoomed in on `boxes`: all of them
134
- * with room around (for their lines and labels), at least a `1 / maxZoom` share of the image's
135
- * width, in the image's shape but no taller than `minShape` (so a full-page screenshot gives a
136
- * strip of the page). Undefined when there are no boxes or the part would be most of the image.
137
- */
138
- export declare const cropAround: (width: number, height: number, boxes: ReadonlyArray<CropBox>, { frame, maxZoom, readable, minShape }?: CropOptions) => Box | undefined;
139
- /**
140
- * How far a frame zooms in on its boxes: as wide as the case or wider, and on a narrow screen (or
141
- * in the grid of thumbnails), where it zooms in more so the marked element stays readable. A
142
- * figure whose two crops differ has a frame for each, and its width picks one; `CROP_NARROW.frame`
143
- * is also the narrowest a frame is shown.
144
- */
145
- export declare const CROP_WIDE: CropOptions;
146
- export declare const CROP_NARROW: CropOptions;
147
- /** `29 Oct 2026, 10:48:57 UTC`: the same for every reader, wherever the report is opened. */
148
- export declare const formatTime: (iso: string) => string;
149
- /** `850 ms`, `4.2 s`, `3 min 05 s`; undefined while the run has not finished. */
150
- export declare const durationOf: (startedAt: string, finishedAt: string | undefined) => string | undefined;
151
- /** `0:13`, `1:05`, `1:02:03`: a time on the player's clock, to the second. */
152
- export declare const formatClock: (ms: number) => string;
153
- /**
154
- * `Nov 4, 2026 · 23:50 UTC`: when a run started, the same for every reader, as the pages say it
155
- * without script (with it, their script says it in the reader's own time, in the same form).
156
- */
157
- export declare const formatDate: (iso: string) => string;
158
- /** How long the run took, in ms; undefined while it has not finished. */
159
- export declare const runMs: (bundle: ReportBundle) => number | undefined;
160
- /** An address as the player's URL field shows it: without `https://`, cut to `max` characters. */
161
- export declare const displayUrl: (url: string, max?: number) => string;
162
- /** The browser for the meta row: its name and major version, and whether Chrome's logo goes with it. */
163
- export interface BrowserWords {
164
- readonly text: string;
165
- /** Chrome's logo: for Chrome and Chromium (Playwright's own build and its headless shell). */
166
- readonly chromeLogo: boolean;
167
- }
168
- /**
169
- * The browser the run recorded, in words such as `Chrome 131` or `Chromium 131`; undefined for a
170
- * run that recorded none, which shows no browser at all.
171
- */
172
- export declare const browserWords: (browser: ReportBundle['browser']) => BrowserWords | undefined;
173
- /** The device in a word or two for the meta row: its own label when that says more. */
174
- export declare const deviceWords: (device: ReportBundle['device']) => string;
175
- /** How long a session's video is, in ms: as the file gives it, else as recorded, else as far as
176
- * anything in it was timed. Undefined when nothing in it was. */
177
- export declare const sessionLength: (bundle: ReportBundle, session: number) => number | undefined;
178
- /** Where a case is on its session's video. */
179
- export interface CaseSpan {
180
- readonly session: number;
181
- readonly startMs: number;
182
- readonly endMs: number;
183
- }
184
- /**
185
- * Each case's place on its session's video, by case ID: from its start to its end, or, for a case
186
- * whose end was not recorded (a run still going), to its last step's end, else the next case's
187
- * start, else the end of the video. Cases whose start was not recorded have none.
188
- */
189
- export declare const caseSpans: (bundle: ReportBundle) => ReadonlyMap<string, CaseSpan>;
190
- /** An address the page was known to be at, from a moment of a session's video on. */
191
- export interface UrlPoint {
192
- readonly session: number;
193
- readonly ms: number;
194
- readonly url: string;
195
- }
196
- /**
197
- * Every moment the run recorded the page's address, in time order: each screenshot's saved page
198
- * state (when it was taken), each `goto` step that ran (when it ended, at the address it opened),
199
- * and the page when each case ended. Between them the address is the last one recorded; before
200
- * the first, unknown.
201
- */
202
- export declare const urlTimeline: (bundle: ReportBundle, views?: ReadonlyArray<CaseView>) => ReadonlyArray<UrlPoint>;
203
- /** The address at `ms` into a session's video: the last one recorded by then, if any. */
204
- export declare const urlAt: (points: ReadonlyArray<UrlPoint>, session: number, ms: number) => string | undefined;
205
- /** A stretch of a session's video in which nothing happened: what "Skip inactive" jumps over. */
206
- export interface IdleStretch {
207
- readonly session: number;
208
- readonly fromMs: number;
209
- readonly toMs: number;
210
- }
211
- /** Idle stretches shorter than this are played: skipping them would only make the video jump. */
212
- export declare const IDLE_MIN_MS = 1500;
213
- /** How much of an idle stretch is still played at either end, so a step's result can be seen. */
214
- export declare const IDLE_MARGIN_MS = 300;
215
- /**
216
- * Around a recorded action (a press of the mouse or a key) the video is never idle, even where
217
- * it stands still: the walkthrough's cursor glides to it before (`GLIDE_S`) and its ripple and
218
- * label show after.
219
- */
220
- export declare const ACTION_BEFORE_MS = 600;
221
- export declare const ACTION_AFTER_MS = 1500;
222
- /**
223
- * The stretches of each session's video where nothing happened, at least `IDLE_MIN_MS` long once
224
- * `IDLE_MARGIN_MS` is kept at either end (none at the very start of the video). Where the run
225
- * measured its video (`Session.still`), they are where its picture stood still, even while a step
226
- * waited, except around each recorded action (`ACTION_BEFORE_MS`, `ACTION_AFTER_MS`; the whole
227
- * step for an action recorded without a time, whose label shows while its step plays). For an
228
- * older run they are where no step ran: before the first step, between steps and after the last
229
- * one (to the end of the video, when its length is known); there a step that waited is not idle,
230
- * since what it waited for may show at any moment.
231
- */
232
- export declare const idleStretches: (bundle: ReportBundle) => ReadonlyArray<IdleStretch>;
233
- /**
234
- * What a screenshot is in its case's story: `actual` is how the page was when a case that did not
235
- * pass stopped (the screenshot taken then, else its last one); `expected` is one the agent marked
236
- * only in green (as expected) and nowhere red. Every other is a plain screenshot. screw-bugs takes
237
- * no reference screenshot, so nothing else is ever called expected.
238
- */
239
- export type ShotRole = 'actual' | 'expected' | 'shot';
240
- export interface CaseShot {
241
- readonly shot: ShotView;
242
- readonly role: ShotRole;
243
- /** Its name, as the ledger has it, or as older runs' file names give it. */
244
- readonly name: string;
245
- /** `Step 3 of 5`, `Opening page`, or undefined when the ledger does not say which step. */
246
- readonly step: string | undefined;
247
- }
248
- /** Every screenshot of a case, in the order they were taken, with what each is. */
249
- export declare const caseShots: (view: CaseView) => ReadonlyArray<CaseShot>;
250
- /**
251
- * What a case's card shows of its screenshots: for a case that did not pass, the page when it
252
- * stopped (`Actual`), beside an `Expected` one where the agent marked one so; for one that passed,
253
- * up to two the agent marked (it saw something there), else up to two small ones. `more` counts
254
- * the rest, which the screenshot viewer steps through.
255
- */
256
- export declare const cardShots: (shots: ReadonlyArray<CaseShot>) => {
257
- readonly large: ReadonlyArray<CaseShot>;
258
- readonly small: ReadonlyArray<CaseShot>;
259
- readonly more: number;
260
- };
261
- /**
262
- * The report's heading: the name the job gave the run; else the app's own page title as the run
263
- * recorded it (that of the first case, in run order, whose page facts at its end have one); else
264
- * the target's host. Only what the job said or the run recorded, never a guess.
265
- */
266
- export declare const reportHeading: (bundle: ReportBundle) => string;
267
- /**
268
- * The counts in a sentence. With areas the agent did not test, a run whose cases all passed says
269
- * `7 of 7 cases passed · 3 areas not tested`, never that all passed.
270
- */
271
- export declare const verdictOf: (bundle: ReportBundle) => string;
272
- /** `2 failed`, `1 not verified`: a count of cases with a status, as the filters say it. */
273
- export declare const countWords: (status: CaseStatus, n: number) => string;
274
- /**
275
- * The evaluation at the top of the report. With the agent's write-up: its headline as the verdict,
276
- * the code's counts under it, one issue per fix (most severe first) and the agent's first fix as
277
- * the one to fix first. Without one: the counts alone, and no issues. Nothing here is made up.
278
- */
279
- export interface Evaluation {
280
- readonly verdict: string;
281
- /** Whether the verdict is the agent's words (else it is the code's counts). */
282
- readonly byAgent: boolean;
283
- /** One line under the verdict: the counts, decided by code. */
284
- readonly counts: string;
285
- readonly issues: ReadonlyArray<{
286
- readonly title: string;
287
- readonly why: string;
288
- readonly severity: Severity;
289
- readonly caseIds: ReadonlyArray<string>;
290
- }>;
291
- readonly fixFirst: {
292
- readonly title: string;
293
- readonly why: string;
294
- } | undefined;
295
- }
296
- export declare const evaluationOf: (bundle: ReportBundle) => Evaluation;