screw-bugs 0.0.0-stage → 0.1.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.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +906 -2
  3. package/bin/screw-bugs.js +29 -0
  4. package/dist/browser-playwright/annotate.d.ts +9 -0
  5. package/dist/browser-playwright/annotate.js +86 -0
  6. package/dist/browser-playwright/capture.d.ts +232 -0
  7. package/dist/browser-playwright/capture.js +1049 -0
  8. package/dist/browser-playwright/frames.d.ts +77 -0
  9. package/dist/browser-playwright/frames.js +191 -0
  10. package/dist/browser-playwright/index.d.ts +2 -0
  11. package/dist/browser-playwright/index.js +2 -0
  12. package/dist/browser-playwright/input.d.ts +44 -0
  13. package/dist/browser-playwright/input.js +116 -0
  14. package/dist/browser-playwright/launch.d.ts +21 -0
  15. package/dist/browser-playwright/launch.js +86 -0
  16. package/dist/browser-playwright/page.d.ts +387 -0
  17. package/dist/browser-playwright/page.js +1930 -0
  18. package/dist/build-info.json +5 -0
  19. package/dist/cli/app.d.ts +19 -0
  20. package/dist/cli/app.js +70 -0
  21. package/dist/cli/build-info.d.ts +52 -0
  22. package/dist/cli/build-info.js +82 -0
  23. package/dist/cli/commands.d.ts +14 -0
  24. package/dist/cli/commands.js +308 -0
  25. package/dist/cli/config.d.ts +16 -0
  26. package/dist/cli/config.js +71 -0
  27. package/dist/cli/doctor.d.ts +19 -0
  28. package/dist/cli/doctor.js +113 -0
  29. package/dist/cli/environment.d.ts +20 -0
  30. package/dist/cli/environment.js +34 -0
  31. package/dist/cli/exit-codes.d.ts +29 -0
  32. package/dist/cli/exit-codes.js +28 -0
  33. package/dist/cli/failure.d.ts +20 -0
  34. package/dist/cli/failure.js +15 -0
  35. package/dist/cli/index.d.ts +6 -0
  36. package/dist/cli/index.js +6 -0
  37. package/dist/cli/install-method.d.ts +96 -0
  38. package/dist/cli/install-method.js +148 -0
  39. package/dist/cli/main.d.ts +1 -0
  40. package/dist/cli/main.js +10 -0
  41. package/dist/cli/mcp.d.ts +30 -0
  42. package/dist/cli/mcp.js +309 -0
  43. package/dist/cli/node-version.d.ts +3 -0
  44. package/dist/cli/node-version.js +22 -0
  45. package/dist/cli/operations.d.ts +127 -0
  46. package/dist/cli/operations.js +337 -0
  47. package/dist/cli/package-info.d.ts +22 -0
  48. package/dist/cli/package-info.js +25 -0
  49. package/dist/cli/report-server.d.ts +170 -0
  50. package/dist/cli/report-server.js +387 -0
  51. package/dist/cli/signals.d.ts +37 -0
  52. package/dist/cli/signals.js +61 -0
  53. package/dist/cli/stamp-build.d.ts +1 -0
  54. package/dist/cli/stamp-build.js +9 -0
  55. package/dist/cli/update-check.d.ts +140 -0
  56. package/dist/cli/update-check.js +316 -0
  57. package/dist/cli/uploads.d.ts +16 -0
  58. package/dist/cli/uploads.js +80 -0
  59. package/dist/core/css.d.ts +95 -0
  60. package/dist/core/css.js +436 -0
  61. package/dist/core/engine.d.ts +65 -0
  62. package/dist/core/engine.js +436 -0
  63. package/dist/core/errors.d.ts +66 -0
  64. package/dist/core/errors.js +30 -0
  65. package/dist/core/evidence.d.ts +14 -0
  66. package/dist/core/evidence.js +127 -0
  67. package/dist/core/index.d.ts +12 -0
  68. package/dist/core/index.js +12 -0
  69. package/dist/core/labels.d.ts +47 -0
  70. package/dist/core/labels.js +199 -0
  71. package/dist/core/liveness.d.ts +45 -0
  72. package/dist/core/liveness.js +64 -0
  73. package/dist/core/marks.d.ts +63 -0
  74. package/dist/core/marks.js +410 -0
  75. package/dist/core/services.d.ts +444 -0
  76. package/dist/core/services.js +22 -0
  77. package/dist/core/steps.d.ts +96 -0
  78. package/dist/core/steps.js +656 -0
  79. package/dist/core/uploads.d.ts +49 -0
  80. package/dist/core/uploads.js +133 -0
  81. package/dist/core/video.d.ts +16 -0
  82. package/dist/core/video.js +101 -0
  83. package/dist/core/viewport.d.ts +28 -0
  84. package/dist/core/viewport.js +50 -0
  85. package/dist/report/html.d.ts +37 -0
  86. package/dist/report/html.js +762 -0
  87. package/dist/report/index.d.ts +5 -0
  88. package/dist/report/index.js +5 -0
  89. package/dist/report/markup.d.ts +27 -0
  90. package/dist/report/markup.js +75 -0
  91. package/dist/report/pr-summary.d.ts +11 -0
  92. package/dist/report/pr-summary.js +110 -0
  93. package/dist/report/sha256.d.ts +9 -0
  94. package/dist/report/sha256.js +97 -0
  95. package/dist/report/styles.d.ts +1 -0
  96. package/dist/report/styles.js +328 -0
  97. package/dist/report/view.d.ts +141 -0
  98. package/dist/report/view.js +368 -0
  99. package/dist/report/walkthrough.d.ts +75 -0
  100. package/dist/report/walkthrough.js +458 -0
  101. package/dist/schema/config.d.ts +7 -0
  102. package/dist/schema/config.js +6 -0
  103. package/dist/schema/doctor.d.ts +46 -0
  104. package/dist/schema/doctor.js +23 -0
  105. package/dist/schema/evidence.d.ts +994 -0
  106. package/dist/schema/evidence.js +521 -0
  107. package/dist/schema/findings.d.ts +159 -0
  108. package/dist/schema/findings.js +80 -0
  109. package/dist/schema/index.d.ts +7 -0
  110. package/dist/schema/index.js +7 -0
  111. package/dist/schema/job.d.ts +1724 -0
  112. package/dist/schema/job.js +505 -0
  113. package/dist/schema/ledger.d.ts +951 -0
  114. package/dist/schema/ledger.js +193 -0
  115. package/dist/schema/status.d.ts +7 -0
  116. package/dist/schema/status.js +11 -0
  117. package/dist/store-local/accounts.d.ts +7 -0
  118. package/dist/store-local/accounts.js +9 -0
  119. package/dist/store-local/index.d.ts +3 -0
  120. package/dist/store-local/index.js +3 -0
  121. package/dist/store-local/paths.d.ts +10 -0
  122. package/dist/store-local/paths.js +17 -0
  123. package/dist/store-local/storage.d.ts +20 -0
  124. package/dist/store-local/storage.js +170 -0
  125. package/package.json +73 -4
@@ -0,0 +1,328 @@
1
+ import { CROP_WIDE } from './view.js';
2
+ /*
3
+ * The report's styles. Colors are tokens with a light and a dark set: the system's choice by
4
+ * default (`prefers-color-scheme`), or the reader's from the theme switch (`data-theme` on the
5
+ * root, set by the page's script). Marks drawn over screenshots keep one color in both themes,
6
+ * since screenshots have none, with a light and a dark halo so they read on any page.
7
+ */
8
+ const light = `
9
+ --bg: #f6f5f1; --paper: #fffefb; --ink: #1c1b18; --ink-2: #4f4c45; --ink-3: #75716a;
10
+ --rule: #e4e1d8; --rule-2: #d3cfc3; --accent: #2b4bdb;
11
+ --passed: #18703f; --passed-bg: #e3f2e8;
12
+ --failed: #b42d26; --failed-bg: #fbe7e4;
13
+ --blocked: #8a5100; --blocked-bg: #fbefd9;
14
+ --not_verified: #5f5e5a; --not_verified-bg: #ebeae5;
15
+ --agent: #5b3fc4; --agent-bg: #f3f0fd; --agent-rule: #cdc2f5;
16
+ --code: #1f5fae; --code-bg: #e8f0fb;
17
+ --legend-red: #c42b2b; --legend-green: #13784a;
18
+ --marker: #e4f86a; --marker-ink: #1c1b18; --marker-hover: #d4ec3c;
19
+ --player: #121212;
20
+ color-scheme: light;
21
+ `;
22
+ const dark = `
23
+ --bg: #121210; --paper: #1b1b18; --ink: #edece7; --ink-2: #c3c0b7; --ink-3: #9a978e;
24
+ --rule: #2d2c28; --rule-2: #3d3c36; --accent: #9db1ff;
25
+ --passed: #6fd897; --passed-bg: #15291c;
26
+ --failed: #ff8a7e; --failed-bg: #351a17;
27
+ --blocked: #f4bd5c; --blocked-bg: #31260f;
28
+ --not_verified: #b3b1a9; --not_verified-bg: #272723;
29
+ --agent: #c3b5ff; --agent-bg: #211c35; --agent-rule: #4a3f7a;
30
+ --code: #8cbcff; --code-bg: #15233a;
31
+ --legend-red: #ff8a84; --legend-green: #6fd897;
32
+ --marker: #d9ec5a; --marker-ink: #121210; --marker-hover: #e8f77f;
33
+ --player: #000;
34
+ color-scheme: dark;
35
+ `;
36
+ export const styles = /* css */ `
37
+ :root { ${light}
38
+ --mark-red: #e5484d; --mark-green: #12a150; --mark-step: #2f6fd6;
39
+ --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
40
+ --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
41
+ }
42
+ @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { ${dark} } }
43
+ :root[data-theme="dark"] { ${dark} }
44
+ * { box-sizing: border-box; }
45
+ html { background: var(--bg); }
46
+ body { margin: 0; color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
47
+ .page { max-width: 980px; margin: 0 auto; padding: 28px 28px 64px; }
48
+ a { color: var(--accent); text-underline-offset: 2px; }
49
+ :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
50
+ code { font: 0.86em var(--mono); }
51
+ q.value { quotes: "\\201C" "\\201D"; font-weight: 600; }
52
+ .note { color: var(--ink-3); }
53
+ .label { margin: 0 0 12px; font: 600 11.5px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
54
+ h1, h2, h3, h4 { text-wrap: balance; }
55
+
56
+ .by { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 4px; font: 600 11px/1.6 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
57
+ .by .icon { width: 13px; height: 13px; }
58
+ .by-agent { color: var(--agent); background: var(--agent-bg); border: 1px dashed var(--agent-rule); }
59
+ .by-code { color: var(--code); background: var(--code-bg); border: 1px solid color-mix(in srgb, var(--code) 30%, transparent); }
60
+ .agent { border-left: 3px dashed var(--agent-rule); padding-left: 18px; }
61
+
62
+ .masthead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
63
+ .brand { font-weight: 700; letter-spacing: -0.01em; }
64
+ .brand-sub { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
65
+ .job { flex: 1; }
66
+ .walkthrough-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; }
67
+ .walkthrough-link .icon { width: 13px; height: 13px; }
68
+ .job code { color: var(--ink-2); }
69
+ .theme { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
70
+ .theme[hidden] { display: none; }
71
+ .theme button { font: 500 12.5px/1 var(--sans); color: var(--ink-2); background: var(--paper); border: 0; padding: 6px 10px; cursor: pointer; }
72
+ .theme button + button { border-left: 1px solid var(--rule-2); }
73
+ .theme button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
74
+
75
+ .intro { padding: 44px 0 8px; }
76
+ .kicker { margin: 0 0 18px; color: var(--ink-3); font-size: 14.5px; }
77
+ .headline-block { margin: 0; }
78
+ .headline-block .by { margin-bottom: 10px; }
79
+ .headline { margin: 0; font: 600 clamp(25px, 1.6vw + 18px, 36px)/1.18 var(--sans); letter-spacing: -0.015em; max-width: 46ch; overflow-wrap: anywhere; }
80
+ .standfirst { margin: 18px 0 0; font: 400 18px/1.55 var(--sans); color: var(--ink-2); max-width: 44em; overflow-wrap: anywhere; }
81
+ .derived { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); font-style: italic; }
82
+ .asked { margin: 22px 0 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--rule-2); }
83
+ .asked .label { margin-bottom: 4px; }
84
+ .asked-text { margin: 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
85
+ .verdict { margin: 30px 0 0; font-weight: 600; font-size: 15px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
86
+ .verdict.good { color: var(--passed); }
87
+ .verdict.bad { color: var(--failed); }
88
+ .verdict.partial { color: var(--blocked); }
89
+ .not-tested { margin: 16px 0 0; padding: 12px 16px 12px 18px; background: var(--blocked-bg); border: 1px dashed var(--blocked); border-left: 3px dashed var(--blocked); border-radius: 4px; }
90
+ .not-tested h2 { margin: 0 0 6px; font: 600 15.5px/1.3 var(--sans); color: var(--blocked); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
91
+ .not-tested ul { margin: 0; padding-left: 20px; }
92
+ .not-tested li { margin-bottom: 3px; overflow-wrap: anywhere; }
93
+ .not-tested .why { color: var(--ink-2); }
94
+
95
+ .alert { margin: 20px 0 0; padding: 12px 16px; border: 1px solid var(--failed); border-left-width: 4px; background: var(--failed-bg); border-radius: 4px; overflow-wrap: anywhere; }
96
+
97
+ .results { margin-top: 26px; }
98
+ .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
99
+ .tile { padding: 14px 16px 12px; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--c); border-radius: 4px; }
100
+ .tile.zero { border-top-color: var(--rule-2); }
101
+ .tile.zero .tile-count { color: var(--ink-3); }
102
+ .tile-count { display: block; font: 500 32px/1 var(--sans); letter-spacing: -0.01em; }
103
+ .tile-label { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
104
+ .tile .icon { color: var(--c); }
105
+ .tile.zero .icon { color: var(--ink-3); }
106
+ .bar { display: flex; gap: 2px; height: 6px; margin: 14px 0 0; border-radius: 3px; overflow: hidden; }
107
+ .seg { background: var(--c); min-width: 6px; }
108
+ .seg.s-not_verified { background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 5px); }
109
+ .index { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--rule); }
110
+ .index li { border-bottom: 1px solid var(--rule); }
111
+ .index a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: inherit; text-decoration: none; }
112
+ .index a:hover .index-title { text-decoration: underline; text-underline-offset: 3px; }
113
+ .index-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
114
+
115
+ .s-passed { --c: var(--passed); --c-bg: var(--passed-bg); }
116
+ .s-failed { --c: var(--failed); --c-bg: var(--failed-bg); }
117
+ .s-blocked { --c: var(--blocked); --c-bg: var(--blocked-bg); }
118
+ .s-not_verified { --c: var(--not_verified); --c-bg: var(--not_verified-bg); }
119
+
120
+ .icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
121
+ .badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--c); background: var(--c-bg); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
122
+ .badge .icon { width: 14px; height: 14px; }
123
+ .s-not_verified.badge { border-style: dashed; }
124
+ .case-n { font: 500 12px var(--mono); color: var(--ink-3); }
125
+
126
+ .band { margin: 48px 0 0; padding: 28px 28px 30px; border-radius: 8px; }
127
+ .agent-band { background: var(--agent-bg); border: 1px dashed var(--agent-rule); }
128
+ .band-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
129
+ .band-head h2 { margin: 0; font: 600 30px/1.1 var(--sans); letter-spacing: -0.015em; }
130
+ .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 14.5px; margin: 0 0 6px; }
131
+ .lg-red, .lg-green, .lg-step { display: inline-flex; align-items: baseline; gap: 7px; }
132
+ .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; }
133
+ .lg-red .key { border-color: var(--mark-red); background: var(--mark-red); }
134
+ .lg-green .key { border-color: var(--mark-green); background: var(--mark-green); }
135
+ .lg-step .key { border: 2px dashed var(--mark-step); background: transparent; }
136
+ .legend .key { min-width: 22px; height: 14px; background: transparent; }
137
+ .lg-red strong { color: var(--legend-red); }
138
+ .lg-green strong { color: var(--legend-green); }
139
+ .fixes { list-style: none; margin: 0; padding: 0; }
140
+ .fix { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 26px 0 0; margin-top: 22px; border-top: 1px solid var(--agent-rule); }
141
+ .rank { display: block; font: 600 48px/0.9 var(--sans); color: var(--ink); }
142
+ .sev { display: block; margin-top: 8px; font-weight: 700; font-size: 14px; }
143
+ .sev-high { color: var(--failed); }
144
+ .sev-medium { color: var(--blocked); }
145
+ .sev-low { color: var(--ink-3); }
146
+ .fix h3 { margin: 0 0 6px; font: 600 22px/1.25 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
147
+ .fix p { margin: 0 0 10px; overflow-wrap: anywhere; }
148
+ .fix-cases { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
149
+ .crop { margin: 14px 0 0; }
150
+ .crop .frame { position: relative; display: grid; overflow: hidden; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule-2); background: var(--paper); }
151
+ .crop figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
152
+
153
+ .details { margin-top: 48px; }
154
+ .meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
155
+ .meta div { padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
156
+ .meta dt { font: 600 11px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
157
+ .meta dd { margin: 3px 0 0; overflow-wrap: anywhere; }
158
+ .meta div:first-child { grid-column: span 3; }
159
+ .meta div:nth-child(7) { grid-column: span 3; }
160
+ .video-line { display: block; }
161
+ .warn { color: var(--failed); font-weight: 600; }
162
+ .session-note { margin: 12px 0 0; color: var(--ink-2); font-size: 14.5px; }
163
+ .state { text-transform: capitalize; }
164
+ .state-errored { color: var(--failed); font-weight: 600; }
165
+ .state-finished { font-weight: 600; }
166
+
167
+ .cases { margin-top: 48px; }
168
+ .case { position: relative; margin: 0 0 20px; padding: 24px 26px 26px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
169
+ .case::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: 6px 0 0 6px; background: var(--c); }
170
+ .case.s-not_verified::before { background: repeating-linear-gradient(180deg, var(--c) 0 6px, transparent 6px 10px); }
171
+ .case-head { display: flex; align-items: baseline; gap: 12px; }
172
+ .case-head h3 { flex: 1; min-width: 0; margin: 0; font: 600 21px/1.3 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
173
+ .case-head .badge { align-self: center; }
174
+ .case-id { margin: 4px 0 0 32px; font-size: 12.5px; color: var(--ink-3); }
175
+ .success, .continued { margin: 14px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
176
+ .success .label, .continued .label { display: inline; margin: 0 6px 0 0; }
177
+ .reason { margin: 14px 0 0; padding: 12px 14px; background: var(--c-bg); border-radius: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
178
+ .case > .label { margin-top: 24px; }
179
+
180
+ .player { margin: 18px 0 0; }
181
+ .player video { display: block; width: 100%; max-height: 560px; aspect-ratio: auto 16 / 10; background: var(--player); border-radius: 6px; }
182
+ .device-mobile .player video { aspect-ratio: auto 9 / 19.5; }
183
+ /* Players load nothing until played: a clear button says so, and where the case starts. */
184
+ .screen { position: relative; }
185
+ .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px 10px 14px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font: 600 15px/1.2 var(--sans); text-decoration: none; white-space: nowrap; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
186
+ .play:hover { background: rgba(0,0,0,.86); }
187
+ .play .icon { width: 18px; height: 18px; fill: currentColor; }
188
+ .play strong { font-weight: 700; }
189
+ .started .play { display: none; }
190
+ .filebar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-top: 8px; font-size: 13.5px; color: var(--ink-2); }
191
+ .file { font: 12px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
192
+ .file a, a.file { color: inherit; }
193
+ .video-problem { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--blocked); border-left-width: 4px; background: var(--blocked-bg); border-radius: 4px; }
194
+
195
+ .tc { display: inline-block; font: 600 0.92em/1.3 var(--sans); color: var(--marker-ink); background: var(--marker); border-radius: 2px; padding: 1px 6px 1px 5px; text-decoration: none; white-space: nowrap; }
196
+ .tc::before { content: ""; display: inline-block; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-right: 5px; vertical-align: 1px; }
197
+ a.tc:hover { background: var(--marker-hover); }
198
+ .tc.off { background: transparent; color: var(--ink-3); padding: 0; }
199
+ .tc.off::before { display: none; }
200
+
201
+ .writeup { margin: 22px 0 0; }
202
+ .agent-head { margin: 0 0 10px; }
203
+ .outcome { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
204
+ .outcome .did { grid-column: 1 / -1; }
205
+ .writeup h4 { margin: 10px 0 6px; font: 600 15.5px/1.3 var(--sans); }
206
+ .writeup h4.ok { color: var(--passed); }
207
+ .writeup h4.bad { color: var(--failed); }
208
+ .writeup ul { margin: 0; padding-left: 20px; }
209
+ .writeup li { margin-bottom: 4px; overflow-wrap: anywhere; }
210
+ .writeup .note { margin: 0; }
211
+ .moments { list-style: none; margin: 0; padding: 0; }
212
+ .moments li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
213
+ .moments .tc { justify-self: start; }
214
+ .observed { margin-top: 12px; padding: 8px 12px 10px; border: 1px dashed var(--blocked); border-radius: 4px; background: var(--blocked-bg); }
215
+ .observed h4 { margin-top: 0; color: var(--blocked); }
216
+
217
+ .shot { margin: 0; position: relative; }
218
+ .shot .frame { position: relative; display: grid; border-radius: 4px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--rule-2); }
219
+ /* Frames size what is drawn over them (container units); figures pick their wide or narrow crop. */
220
+ .frame { container-type: inline-size; }
221
+ .shot, .crop { container: fig / inline-size; }
222
+ .shot img { display: block; width: 100%; height: auto; }
223
+ .frame.zoom img { position: absolute; max-width: none; height: auto; }
224
+ /* What a frame says when its image cannot load: under the image, so it shows only then. At the
225
+ top, clear of the boxes a zoomed frame has in its middle; the script centers it and hides them. */
226
+ .frame { text-decoration: none; }
227
+ .frame > img, .frame > .unloaded { grid-area: 1 / 1; }
228
+ .frame > img { color: transparent; }
229
+ .frame > .unloaded { align-self: start; justify-self: center; max-width: 34em; padding: 12px 16px; font-size: 13px; line-height: 1.45; text-align: center; color: var(--ink-2); overflow-wrap: anywhere; }
230
+ .unloaded code { font: 12px var(--mono); }
231
+ .broken .frame { background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-2); }
232
+ .broken .frame > img, .broken .mk, .broken .mk-switch { display: none; }
233
+ .broken .frame > .unloaded { align-self: center; color: var(--ink); }
234
+ .player .unloaded { margin: 0; padding: 28px 20px; border: 1px dashed var(--rule-2); border-radius: 6px; background: var(--paper); text-align: center; overflow-wrap: anywhere; }
235
+ .player.broken .screen { display: none; }
236
+ .zoomed { font-family: var(--sans); }
237
+ .shot figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; font-size: 13px; color: var(--ink-2); }
238
+ .cap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
239
+ .shot-id { font: 12px var(--mono); color: var(--ink-3); }
240
+ .shot.prominent { margin-top: 18px; }
241
+ .shot.prominent .frame { box-shadow: 0 0 0 1px var(--c), 0 0 0 4px var(--c-bg); }
242
+ .shot.missing figcaption { color: var(--ink-3); }
243
+ .shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
244
+ .shots .shot.marked { grid-column: 1 / -1; }
245
+
246
+ /* Marks go over their element and draw outside it: a line \`--gap\` away from its edges, with a
247
+ white ring on either side and a dark one outside, so they read on any page and never cover what
248
+ they mark. Lines and labels shrink with the frame (container units), down to a readable least;
249
+ the report's code works out the same sizes to place labels (see \`reach\`, \`labelSize\`). Only on
250
+ an edge of the image (\`.fl-*\`), with no room outside, does the line go inside. */
251
+ .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; }
252
+ .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); }
253
+ .mk.fl-t { --t: 0px; } .mk.fl-r { --r: 0px; } .mk.fl-b { --b: 0px; } .mk.fl-l { --l: 0px; }
254
+ .mk:is(.fl-t, .cut-t) { --ot: 0px; } .mk:is(.fl-r, .cut-r) { --or: 0px; }
255
+ .mk:is(.fl-b, .cut-b) { --ob: 0px; } .mk:is(.fl-l, .cut-l) { --ol: 0px; }
256
+ .mk-red { --mk-c: var(--mark-red); }
257
+ .mk-green { --mk-c: var(--mark-green); }
258
+ .mk-step { --mk-c: var(--mark-step); --bw: clamp(1px, 0.3cqi, 2px); }
259
+ .mk-step::before { border-style: dashed; }
260
+ .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); }
261
+ .mk-step .mk-n { font-weight: 600; }
262
+ /* Labels sit outside their box, on the side code picked (see placeLabels), never over the element. */
263
+ .at-above-start, .at-above-end { bottom: calc(100% + var(--ot) + 4px); }
264
+ .at-below-start, .at-below-end { top: calc(100% + var(--ob) + 4px); }
265
+ .at-above-start, .at-below-start { left: calc(-1 * var(--ol)); }
266
+ .at-above-end, .at-below-end { right: calc(-1 * var(--or)); }
267
+ .at-right { left: calc(100% + var(--or) + 4px); top: calc(-1 * var(--ot)); }
268
+ .at-left { right: calc(100% + var(--ol) + 4px); top: calc(-1 * var(--ot)); }
269
+ .at-inside { left: 0; top: 0; }
270
+ .mk-toggle { position: absolute; opacity: 0; pointer-events: none; }
271
+ .mk-toggle:not(:checked) ~ .frame .mk { display: none; }
272
+ .mk-switch { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 999px; padding: 0 9px 0 7px; background: var(--paper); }
273
+ .mk-switch::before { content: "\\2713 "; color: var(--passed); }
274
+ .mk-toggle:not(:checked) ~ figcaption .mk-switch::before { content: "\\2715 "; color: var(--ink-3); }
275
+ .mk-toggle:focus-visible ~ figcaption .mk-switch { outline: 3px solid var(--accent); outline-offset: 2px; }
276
+ .mk-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
277
+ .mk-legend li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
278
+ .mk-legend .unplaced .key { opacity: .45; }
279
+ @container fig (width < ${CROP_WIDE.frame}px) { :is(.shot, .crop) .v-wide { display: none; } }
280
+ @container fig (width >= ${CROP_WIDE.frame}px) { :is(.shot, .crop) .v-narrow { display: none; } }
281
+
282
+ .steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
283
+ .step { display: grid; grid-template-columns: 26px 18px minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--rule); }
284
+ .step:first-child { border-top: 0; }
285
+ .step-n { font: 500 12px var(--mono); color: var(--ink-3); text-align: right; }
286
+ .step-mark { align-self: start; display: flex; padding-top: 4px; color: var(--passed); }
287
+ .step-mark .icon { width: 14px; height: 14px; }
288
+ .step-text { overflow-wrap: anywhere; }
289
+ .step-text code { padding: 1px 5px; border-radius: 3px; background: var(--bg); }
290
+ .step-files { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
291
+ .step-file { display: block; }
292
+ .step-time .tc { font-size: 12.5px; }
293
+ .step-state { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
294
+ .step.st-not-run .step-text, .step.st-not-run .step-n, .step.st-not-run .step-mark { color: var(--ink-3); }
295
+ .step.st-decided { background: var(--c-bg); box-shadow: inset 3px 0 0 var(--c); }
296
+ .step.st-decided .step-mark, .step.st-decided .step-state { color: var(--c); font-weight: 600; }
297
+ .steps-toggle { margin-top: 22px; }
298
+ .steps-toggle summary { cursor: pointer; color: var(--ink-2); font-size: 13.5px; margin-bottom: 10px; }
299
+
300
+ .next { margin: 6px 0 0; padding-left: 22px; }
301
+ .next li { margin: 6px 0; overflow-wrap: anywhere; }
302
+
303
+ .foot { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
304
+ .foot strong { color: var(--ink-2); }
305
+
306
+ @media (max-width: 680px) {
307
+ .page { padding: 18px 16px 48px; }
308
+ .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
309
+ .meta div:first-child, .meta div:nth-child(7) { grid-column: span 2; }
310
+ .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
311
+ .case { padding: 18px 16px 20px; }
312
+ .case-id { margin-left: 0; }
313
+ .band { padding: 20px 16px; }
314
+ .fix { grid-template-columns: 1fr; gap: 6px; }
315
+ .rank { display: inline; font-size: 30px; margin-right: 10px; }
316
+ .sev { display: inline; }
317
+ .outcome { grid-template-columns: 1fr; }
318
+ .step { grid-template-columns: 22px 16px minmax(0, 1fr); }
319
+ .step-time, .step-state { grid-column: 3; }
320
+ }
321
+ @media print {
322
+ html { background: #fff; }
323
+ .theme, .mk-switch { display: none; }
324
+ .case, .fix { break-inside: avoid; }
325
+ .steps-toggle:not([open]) > *:not(summary) { display: block; }
326
+ }
327
+ @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
328
+ `;
@@ -0,0 +1,141 @@
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
+ export declare const countsOf: (cases: ReadonlyArray<CaseEntry>) => Record<CaseStatus, number>;
5
+ /** A piece of a step's description: plain words, a quoted value, or code (URLs, keys, CSS). */
6
+ export type TextPart = {
7
+ readonly kind: 'text';
8
+ readonly text: string;
9
+ } | {
10
+ readonly kind: 'value';
11
+ readonly text: string;
12
+ } | {
13
+ readonly kind: 'code';
14
+ readonly text: string;
15
+ };
16
+ /** A step as a sentence, such as Click button “Sign up”. */
17
+ export declare const stepParts: (step: Step) => ReadonlyArray<TextPart>;
18
+ export declare const stepText: (step: Step) => string;
19
+ /** A step's own `timeoutMs` in words, when it is not the default, such as `waited up to 120 s`. */
20
+ export declare const waitNote: (step: Step, ran: boolean) => string | undefined;
21
+ /**
22
+ * The files an upload step sends, each with its size once it ran and what the job says it is.
23
+ * `sizes` come from the ledger (`StepTiming.files`), by file name.
24
+ */
25
+ export declare const uploadNotes: (step: Step, sizes?: ReadonlyArray<{
26
+ readonly name: string;
27
+ readonly size: number;
28
+ }>) => ReadonlyArray<{
29
+ readonly name: string;
30
+ readonly size?: number;
31
+ readonly about?: string;
32
+ /** Said when the job skipped its content check on purpose. */
33
+ readonly note?: string;
34
+ }>;
35
+ /** A file size as people read it: `840 B`, `12 KB`, `3.4 MB`. */
36
+ export declare const formatBytes: (bytes: number) => string;
37
+ /** Whether a step ran, decided the case, or never ran. `unknown` when the ledger cannot say. */
38
+ export type StepState = 'done' | 'decided' | 'not-run' | 'unknown';
39
+ export interface StepView {
40
+ /** As the ledger counts steps: 1-based, and 0 for the opening navigation the engine adds. */
41
+ readonly index: number;
42
+ readonly step: Step;
43
+ readonly implicit: boolean;
44
+ readonly state: StepState;
45
+ /** When it ran, in ms into the session's video; missing in older runs. */
46
+ readonly timing: StepTiming | undefined;
47
+ }
48
+ /** A screenshot as the report shows it. */
49
+ export interface ShotView {
50
+ readonly path: string;
51
+ /** What the ledger knows about it; undefined in runs from before screenshots had records. */
52
+ readonly shot: Shot | undefined;
53
+ /** The agent's highlights on it, placed by code, numbered in this order. */
54
+ readonly marks: ReadonlyArray<PlacedMark>;
55
+ /** Boxes of the page's elements on it, which labels keep off; empty when not saved. */
56
+ readonly elements: ReadonlyArray<Box>;
57
+ }
58
+ /** The session video a case can be watched in, or why there is none. */
59
+ export interface VideoView {
60
+ readonly session: Session;
61
+ /** Relative path, when the video file was saved. */
62
+ readonly path: string | undefined;
63
+ readonly problem: string | undefined;
64
+ }
65
+ export interface CaseView {
66
+ readonly entry: CaseEntry;
67
+ /** Undefined when the ledger has a case the job does not (a damaged or edited run folder). */
68
+ readonly spec: CaseSpec | undefined;
69
+ readonly steps: ReadonlyArray<StepView>;
70
+ /** The screenshot taken when a failed or blocked case stopped. */
71
+ readonly failureShot: ShotView | undefined;
72
+ readonly otherShots: ReadonlyArray<ShotView>;
73
+ /** The agent's write-up of this case, if it gave one. */
74
+ readonly findings: CaseFindings | undefined;
75
+ readonly video: VideoView | undefined;
76
+ }
77
+ /** The video of `entry`'s session, if the run had sessions. */
78
+ export declare const videoOf: (bundle: ReportBundle, entry: CaseEntry) => VideoView | undefined;
79
+ export declare const caseViews: (bundle: ReportBundle) => ReadonlyArray<CaseView>;
80
+ /**
81
+ * `3 areas not tested`, when the agent's write-up names any: next to the counts, so passing cases
82
+ * are not read as everything working.
83
+ */
84
+ export declare const notTestedCount: (bundle: ReportBundle) => string | undefined;
85
+ /** The agent's fixes, most severe first; the agent's own order within a severity. */
86
+ export declare const fixesOf: (bundle: ReportBundle) => {
87
+ readonly title: string;
88
+ readonly severity: "high" | "low" | "medium";
89
+ readonly caseIds: readonly string[];
90
+ readonly why: string;
91
+ }[];
92
+ export declare const severityLabel: Record<Severity, string>;
93
+ /**
94
+ * `0:07.3`, `1:05.0`, `1:02:03.4`: a timecode as people read it, from ms, to the nearest tenth of
95
+ * a second (so 59.96 s is `1:00.0`).
96
+ */
97
+ export declare const formatTimecode: (ms: number) => string;
98
+ /** A time to seek to, for a media fragment (`#t=6.25`) and the page's script: seconds, to the ms. */
99
+ export declare const fragmentSeconds: (ms: number) => string;
100
+ /** How far a crop zooms in, for a frame shown at least `frame` CSS pixels wide. */
101
+ export interface CropOptions {
102
+ /** The narrowest the frame is shown, in CSS pixels: rooms and readability are worked out for it. */
103
+ readonly frame: number;
104
+ /**
105
+ * The most it zooms in: the crop is at least a `1 / maxZoom` share of the image's width. Past
106
+ * `ZOOM`, only as far as `readable` needs.
107
+ */
108
+ readonly maxZoom: number;
109
+ /**
110
+ * The height in CSS pixels the shortest box should have at `frame`. A box too wide for that,
111
+ * such as a line of text across the whole page, is shown around its text and images (its
112
+ * `content`), and the rest of it is cut off by the crop's edges; the whole image is a click
113
+ * away. A box whose content is not known is shown whole rather than cut where its text may not be.
114
+ */
115
+ readonly readable?: number;
116
+ /** The tallest shape the crop may have, as width / height. */
117
+ readonly minShape: number;
118
+ }
119
+ /** A box to zoom in on, with where its text and images are inside it, when known. */
120
+ export interface CropBox extends Box {
121
+ readonly content?: Box | undefined;
122
+ }
123
+ /**
124
+ * The part of a `width` × `height` screenshot a frame shows, zoomed in on `boxes`: all of them
125
+ * with room around (for their lines and labels), at least a `1 / maxZoom` share of the image's
126
+ * width, in the image's shape but no taller than `minShape` (so a full-page screenshot gives a
127
+ * strip of the page). Undefined when there are no boxes or the part would be most of the image.
128
+ */
129
+ export declare const cropAround: (width: number, height: number, boxes: ReadonlyArray<CropBox>, { frame, maxZoom, readable, minShape }?: CropOptions) => Box | undefined;
130
+ /**
131
+ * How far a frame zooms in on its boxes: as wide as the case or wider, and on a narrow screen (or
132
+ * in the grid of thumbnails), where it zooms in more so the marked element stays readable. A
133
+ * figure whose two crops differ has a frame for each, and its width picks one; `CROP_NARROW.frame`
134
+ * is also the narrowest a frame is shown.
135
+ */
136
+ export declare const CROP_WIDE: CropOptions;
137
+ export declare const CROP_NARROW: CropOptions;
138
+ /** `29 Oct 2026, 10:48:57 UTC`: the same for every reader, wherever the report is opened. */
139
+ export declare const formatTime: (iso: string) => string;
140
+ /** `850 ms`, `4.2 s`, `3 min 05 s`; undefined while the run has not finished. */
141
+ export declare const durationOf: (startedAt: string, finishedAt: string | undefined) => string | undefined;