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.
- package/README.md +100 -54
- package/dist/browser-playwright/capture.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli/app.js +6 -2
- package/dist/cli/commands.js +4 -3
- package/dist/cli/doctor.d.ts +17 -2
- package/dist/cli/doctor.js +62 -4
- package/dist/cli/mcp.js +7 -4
- package/dist/cli/report-server.d.ts +19 -10
- package/dist/cli/report-server.js +43 -18
- package/dist/cli/share.js +2 -2
- package/dist/cli/sign-in.d.ts +9 -3
- package/dist/cli/sign-in.js +12 -9
- package/dist/cli/tailnet.d.ts +57 -0
- package/dist/cli/tailnet.js +82 -0
- package/dist/core/index.d.ts +1 -14
- package/dist/core/index.js +3 -14
- package/dist/report/index.d.ts +1 -10
- package/dist/report/index.js +3 -10
- package/dist/schema/index.d.ts +1 -9
- package/dist/schema/index.js +3 -9
- package/package.json +14 -14
- package/dist/core/accounts.d.ts +0 -40
- package/dist/core/accounts.js +0 -95
- package/dist/core/css.d.ts +0 -95
- package/dist/core/css.js +0 -436
- package/dist/core/engine.d.ts +0 -75
- package/dist/core/engine.js +0 -560
- package/dist/core/errors.d.ts +0 -85
- package/dist/core/errors.js +0 -36
- package/dist/core/evidence.d.ts +0 -14
- package/dist/core/evidence.js +0 -131
- package/dist/core/labels.d.ts +0 -47
- package/dist/core/labels.js +0 -199
- package/dist/core/liveness.d.ts +0 -45
- package/dist/core/liveness.js +0 -66
- package/dist/core/marks.d.ts +0 -63
- package/dist/core/marks.js +0 -410
- package/dist/core/services.d.ts +0 -579
- package/dist/core/services.js +0 -25
- package/dist/core/share.d.ts +0 -68
- package/dist/core/share.js +0 -318
- package/dist/core/steps.d.ts +0 -106
- package/dist/core/steps.js +0 -722
- package/dist/core/uploads.d.ts +0 -49
- package/dist/core/uploads.js +0 -133
- package/dist/core/video.d.ts +0 -53
- package/dist/core/video.js +0 -241
- package/dist/core/viewport.d.ts +0 -28
- package/dist/core/viewport.js +0 -50
- package/dist/report/assets.d.ts +0 -34
- package/dist/report/assets.js +0 -105
- package/dist/report/bug.d.ts +0 -11
- package/dist/report/bug.js +0 -20
- package/dist/report/html.d.ts +0 -47
- package/dist/report/html.js +0 -923
- package/dist/report/icons.d.ts +0 -51
- package/dist/report/icons.js +0 -93
- package/dist/report/live.d.ts +0 -7
- package/dist/report/live.js +0 -135
- package/dist/report/logos.d.ts +0 -4
- package/dist/report/logos.js +0 -19
- package/dist/report/markup.d.ts +0 -50
- package/dist/report/markup.js +0 -156
- package/dist/report/menu-bar.d.ts +0 -60
- package/dist/report/menu-bar.js +0 -157
- package/dist/report/player.d.ts +0 -102
- package/dist/report/player.js +0 -315
- package/dist/report/pr-summary.d.ts +0 -11
- package/dist/report/pr-summary.js +0 -119
- package/dist/report/sha256.d.ts +0 -9
- package/dist/report/sha256.js +0 -97
- package/dist/report/share-page.d.ts +0 -48
- package/dist/report/share-page.js +0 -291
- package/dist/report/shots.d.ts +0 -59
- package/dist/report/shots.js +0 -280
- package/dist/report/sign-in.d.ts +0 -41
- package/dist/report/sign-in.js +0 -568
- package/dist/report/styles.d.ts +0 -3
- package/dist/report/styles.js +0 -274
- package/dist/report/view.d.ts +0 -296
- package/dist/report/view.js +0 -702
- package/dist/report/walkthrough.d.ts +0 -93
- package/dist/report/walkthrough.js +0 -716
- package/dist/schema/accounts.d.ts +0 -137
- package/dist/schema/accounts.js +0 -121
- package/dist/schema/config.d.ts +0 -7
- package/dist/schema/config.js +0 -6
- package/dist/schema/doctor.d.ts +0 -46
- package/dist/schema/doctor.js +0 -30
- package/dist/schema/evidence.d.ts +0 -1115
- package/dist/schema/evidence.js +0 -565
- package/dist/schema/findings.d.ts +0 -161
- package/dist/schema/findings.js +0 -82
- package/dist/schema/job.d.ts +0 -1905
- package/dist/schema/job.js +0 -577
- package/dist/schema/ledger.d.ts +0 -1124
- package/dist/schema/ledger.js +0 -285
- package/dist/schema/share.d.ts +0 -55
- package/dist/schema/share.js +0 -64
- package/dist/schema/status.d.ts +0 -7
- package/dist/schema/status.js +0 -11
package/dist/report/assets.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
/*
|
|
3
|
-
* Where the pages load the run's files from. Locally (and by default) every file is linked by its
|
|
4
|
-
* path relative to the run folder, so a report works from disk and after the folder is moved. A
|
|
5
|
-
* host that serves the files from another origin (screw-bugs Cloud: pages on one host, the run's
|
|
6
|
-
* files straight from a bucket on another) passes an asset base URL: then every link to a file of
|
|
7
|
-
* the run (screenshots, the videos and their `#t=` timecodes, the raw JSON files) is that URL
|
|
8
|
-
* plus the file's path, and the page's Content Security Policy lets images and media, and nothing
|
|
9
|
-
* else, load from its origin.
|
|
10
|
-
*
|
|
11
|
-
* Links from one page to the other (the report's "Walkthrough", the walkthrough's "Report")
|
|
12
|
-
* stay relative: they are pages, not files to load, and a host serves them side by side under its
|
|
13
|
-
* own policy, never from the file origin, which should not serve HTML that runs as a page.
|
|
14
|
-
*/
|
|
15
|
-
/** A path segment or the base's path: unreserved characters and valid percent escapes only. */
|
|
16
|
-
const SEGMENT = '(?:[A-Za-z0-9._~-]|%[0-9A-Fa-f]{2})+';
|
|
17
|
-
/**
|
|
18
|
-
* What the URL parser must make of a base: `https://`, a lowercase (punycode for an IDN) host, an
|
|
19
|
-
* optional port, then a path of plain segments ending in `/`: no credentials, query, fragment,
|
|
20
|
-
* quotes, `;`, `,`, spaces or anything else that could end an HTML attribute or a CSP source, or
|
|
21
|
-
* change how a file's path joins onto it.
|
|
22
|
-
*/
|
|
23
|
-
const SHAPE = new RegExp(`^https://[a-z0-9-]+(?:\\.[a-z0-9-]+)*(?::[0-9]{1,5})?/(?:${SEGMENT}/)*$`);
|
|
24
|
-
/**
|
|
25
|
-
* Characters a base may not hold before parsing, though the parser would escape or drop them:
|
|
26
|
-
* quotes, `;`, `,`, `<`, `>`, `\`, whitespace and control characters. Asking for them is a mistake
|
|
27
|
-
* (or an attempt to get out of an attribute or the policy), never something to quietly repair.
|
|
28
|
-
*/
|
|
29
|
-
// oxlint-disable-next-line no-control-regex -- control characters are exactly what is refused
|
|
30
|
-
const FORBIDDEN = /["';,<>\\\s\u0000-\u001f\u007f]/;
|
|
31
|
-
/** A `.` or `..` segment, also percent-escaped, which the parser would quietly resolve away. */
|
|
32
|
-
const DOT_SEGMENT = /\/(?:\.|%2e){1,2}(?:\/|$)/i;
|
|
33
|
-
/**
|
|
34
|
-
* The base as the URL parser writes it (lowercase or punycode host, no default port), when it is
|
|
35
|
-
* a safe one; otherwise why not.
|
|
36
|
-
*/
|
|
37
|
-
const normalize = (text) => {
|
|
38
|
-
if (FORBIDDEN.test(text) || DOT_SEGMENT.test(text))
|
|
39
|
-
return {
|
|
40
|
-
error: 'An asset base URL may not hold quotes, ";", ",", "<", ">", "\\", whitespace, control characters or "." segments',
|
|
41
|
-
};
|
|
42
|
-
let url;
|
|
43
|
-
try {
|
|
44
|
-
url = new URL(text);
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return { error: 'An asset base URL must be an absolute https: URL' };
|
|
48
|
-
}
|
|
49
|
-
if (url.protocol !== 'https:')
|
|
50
|
-
return { error: 'An asset base URL must use https:' };
|
|
51
|
-
if (!text.endsWith('/'))
|
|
52
|
-
return { error: 'An asset base URL must end with "/"' };
|
|
53
|
-
if (url.username !== '' ||
|
|
54
|
-
url.password !== '' ||
|
|
55
|
-
url.search !== '' ||
|
|
56
|
-
url.hash !== '' ||
|
|
57
|
-
text.includes('?') ||
|
|
58
|
-
text.includes('#'))
|
|
59
|
-
return { error: 'An asset base URL may not hold credentials, a query or a fragment' };
|
|
60
|
-
if (!SHAPE.test(url.href))
|
|
61
|
-
return {
|
|
62
|
-
error: 'An asset base URL is https://<host>[:port]/<path>/ with only letters, digits, ".", "_", "~", "-" and percent escapes in its path, ending with "/"',
|
|
63
|
-
};
|
|
64
|
-
return { href: url.href };
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* An asset base URL, for example `https://media.screwbugs.dev/runs/20261103-101500-ab12/`: an
|
|
68
|
-
* `https:` URL ending with `/`, with nothing in it that could get out of an attribute or the
|
|
69
|
-
* Content Security Policy. An uppercase or international host and an explicit `:443` are fine:
|
|
70
|
-
* the pages use the base as the URL parser normalizes it (`assetsOf`).
|
|
71
|
-
*/
|
|
72
|
-
export const AssetBaseUrl = Schema.String.check(Schema.makeFilter((text) => {
|
|
73
|
-
const result = normalize(text);
|
|
74
|
-
return 'href' in result ? true : result.error;
|
|
75
|
-
})).pipe(Schema.brand('AssetBaseUrl'));
|
|
76
|
-
/** Files by relative path, as the run writes them. */
|
|
77
|
-
export const LOCAL_ASSETS = { url: (path) => path, origin: undefined };
|
|
78
|
-
/**
|
|
79
|
-
* The page's assets for `options`. The base URL is checked again here, so a caller that skipped
|
|
80
|
-
* decoding it (or cast a string) cannot get anything unchecked into the page: it throws instead.
|
|
81
|
-
*/
|
|
82
|
-
export const assetsOf = (options) => {
|
|
83
|
-
if (options?.assetBaseUrl === undefined)
|
|
84
|
-
return LOCAL_ASSETS;
|
|
85
|
-
const result = normalize(Schema.decodeUnknownSync(AssetBaseUrl)(options.assetBaseUrl));
|
|
86
|
-
// Decoding just checked it, so this only narrows the type.
|
|
87
|
-
if (!('href' in result))
|
|
88
|
-
throw new Error(result.error);
|
|
89
|
-
const base = result.href;
|
|
90
|
-
return {
|
|
91
|
-
url: (path) => base + path.split('/').map(encodeURIComponent).join('/'),
|
|
92
|
-
origin: new URL(base).origin,
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Both pages' Content Security Policy: nothing by default; images and media from the page's own
|
|
97
|
-
* origin, from disk and (images) data URLs, plus the asset origin when there is one; Google Fonts'
|
|
98
|
-
* stylesheet and fonts; the one script by its hash.
|
|
99
|
-
*/
|
|
100
|
-
export const contentPolicy = (scriptHash, assetOrigin) => {
|
|
101
|
-
const extra = assetOrigin === undefined ? '' : ` ${assetOrigin}`;
|
|
102
|
-
return (`default-src 'none'; img-src 'self' file: data:${extra}; media-src 'self' file:${extra}; ` +
|
|
103
|
-
"font-src https://fonts.gstatic.com; style-src 'unsafe-inline' https://fonts.googleapis.com; " +
|
|
104
|
-
`script-src ${scriptHash}; base-uri 'none'; form-action 'none'`);
|
|
105
|
-
};
|
package/dist/report/bug.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** The bug's color in each GIF, sampled from its palette. */
|
|
2
|
-
export declare const BUG_LIME = "#96F011";
|
|
3
|
-
export declare const BUG_DARK = "#1D1D1D";
|
|
4
|
-
/** idle-dark: the lime bug, for the dark theme. */
|
|
5
|
-
export declare const BUG_GIF_ON_DARK = "data:image/gif;base64,R0lGODlhPAA8AIEAAAAAAJbwEQAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJkAEAACwAAAAAPAA8AAAI3AABCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjwQDiBxJsmRJkAhNqlSJ8uDKlyNbGoQJU2ZBmi9thsTJUqdAnj19AjVpcyhPkEZxIk1a8yPTph5X+nQodSrDqlYVYs2aMihXl16/3gwrduDWsmafnt2odq3GtmTfwj15cW5biHbV4s3LdC9fo37/Ag0sWOnDwkMJI85Z9+9Svo/zRrY7eW5luJfvOnW8GepYop0Zz4yb0fBo0FFpdkXd0fRnuqk972TN0fVs2K1Vg6WNtrfv38AXBgQAIfkECQ8AAAAsCAAMACwALACBAAAAlvARAAAAAAAACKAAAQgcSFBggIMIEypUWLChw4YLI0Z8SNGhxIsIK2ociBHjxo0dL37UGFLiyIolJ558mHLhSoItS66MGXImTY8nb+IcafKlz54+bboMKpQh0Zwqj34EqpRk0qYon0JlqZMpyKpSnWI1ynMr14Jew4odS7as2bNo06pduxMs2aJh4XqVu5UuVrtV8erUe5NvAKpDu7aFmTXqYI6FKda0mDggACH5BAktAAAALAgACAAsADAAgQAAAJbwEQAAAAAAAAixAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHGnypc+ePm26DCqUIdGcKo9+BKqUZNKmKJ9CZamTKciqUp1iNcpzK9eCXsOKHUu2rNmzaNOqXbsTLNmiYeF6lbuVLla7VfHq1HuTbwCqQ7u2hZk16mCOhSnWtJgYsEjGgZd2dJzQL+WMSA8bTBwQACH5BAkPAAAALAgACAAsADAAgQAAAJbwEQAAAAAAAAiwAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHKlTZM6eKnkCdflzaEKbRF++NKl0adCmQpNC/WiUYdGqAZBi1VqVJdavYMOKHUu2rNmzaIF6/crVaNuhb9Ve7TrXbV24d+VG9QnxKciOa63uZdpX6t+dBQlTBWzRL0nGhQUvRgzTMUrIiS0DCAgAOw==";
|
|
6
|
-
/** idle-light: the dark bug, for the light theme. */
|
|
7
|
-
export declare const BUG_GIF_ON_LIGHT = "data:image/gif;base64,R0lGODlhPAA8AIEAAAAAAB0dHQAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJkAEAACwAAAAAPAA8AAAI3AABCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjwQDiBxJsmRJkAhNqlSJ8uDKlyNbGoQJU2ZBmi9thsTJUqdAnj19AjVpcyhPkEZxIk1a8yPTph5X+nQodSrDqlYVYs2aMihXl16/3gwrduDWsmafnt2odq3GtmTfwj15cW5biHbV4s3LdC9fo37/Ag0sWOnDwkMJI85Z9+9Svo/zRrY7eW5luJfvOnW8GepYop0Zz4yb0fBo0FFpdkXd0fRnuqk972TN0fVs2K1Vg6WNtrfv38AXBgQAIfkECQ8AAAAsCAAMACwALACBAAAAHR0dAAAAAAAACKAAAQgcSFBggIMIEypUWLChw4YLI0Z8SNGhxIsIK2ociBHjxo0dL37UGFLiyIolJ558mHLhSoItS66MGXImTY8nb+IcafKlz54+bboMKpQh0Zwqj34EqpRk0qYon0JlqZMpyKpSnWI1ynMr14Jew4odS7as2bNo06pduxMs2aJh4XqVu5UuVrtV8erUe5NvAKpDu7aFmTXqYI6FKda0mDggACH5BAktAAAALAgACAAsADAAgQAAAB0dHQAAAAAAAAixAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHGnypc+ePm26DCqUIdGcKo9+BKqUZNKmKJ9CZamTKciqUp1iNcpzK9eCXsOKHUu2rNmzaNOqXbsTLNmiYeF6lbuVLla7VfHq1HuTbwCqQ7u2hZk16mCOhSnWtJgYsEjGgZd2dJzQL+WMSA8bTBwQACH5BAkPAAAALAgACAAsADAAgQAAAB0dHQAAAAAAAAiwAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHKlTZM6eKnkCdflzaEKbRF++NKl0adCmQpNC/WiUYdGqAZBi1VqVJdavYMOKHUu2rNmzaIF6/crVaNuhb9Ve7TrXbV24d+VG9QnxKciOa63uZdpX6t+dBQlTBWzRL0nGhQUvRgzTMUrIiS0DCAgAOw==";
|
|
8
|
-
/** The GIFs' first frame, the bug at rest, on the same 15 × 15 grid. */
|
|
9
|
-
export declare const BUG_REST_PATH = "M5 2h5v2H5zM4 4h7v1H4zM4 5h2v2H4zM4 7h7v5H4zM2 8h11v2H2zM4 12h3v2H4zM9 12h2v2H9z";
|
|
10
|
-
/** That still frame in one color, as an SVG `data:` URL, for readers who prefer less motion. */
|
|
11
|
-
export declare const bugStill: (color: string) => string;
|
package/dist/report/bug.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* screw-bugs' animated idle bug, the brand mark in both pages' top bar. Two 60 × 60 GIFs from the
|
|
3
|
-
* design handover (idle-dark: a lime bug for the dark theme; idle-light: a dark bug for the light
|
|
4
|
-
* theme; the "long" idle), 4 frames (4000 / 150 / 450 / 150 ms: the bug rests, then moves) of a
|
|
5
|
-
* bug on a 15 × 15 cell grid, 4 px per cell, on a transparent background. Embedded as base64
|
|
6
|
-
* (generated once with `base64 -w0 idle-*-long.gif`), so
|
|
7
|
-
* each page stays one file that loads no image; the CSP allows `data:` images.
|
|
8
|
-
*/
|
|
9
|
-
/** The bug's color in each GIF, sampled from its palette. */
|
|
10
|
-
export const BUG_LIME = '#96F011';
|
|
11
|
-
export const BUG_DARK = '#1D1D1D';
|
|
12
|
-
/** idle-dark: the lime bug, for the dark theme. */
|
|
13
|
-
export const BUG_GIF_ON_DARK = 'data:image/gif;base64,R0lGODlhPAA8AIEAAAAAAJbwEQAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJkAEAACwAAAAAPAA8AAAI3AABCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjwQDiBxJsmRJkAhNqlSJ8uDKlyNbGoQJU2ZBmi9thsTJUqdAnj19AjVpcyhPkEZxIk1a8yPTph5X+nQodSrDqlYVYs2aMihXl16/3gwrduDWsmafnt2odq3GtmTfwj15cW5biHbV4s3LdC9fo37/Ag0sWOnDwkMJI85Z9+9Svo/zRrY7eW5luJfvOnW8GepYop0Zz4yb0fBo0FFpdkXd0fRnuqk972TN0fVs2K1Vg6WNtrfv38AXBgQAIfkECQ8AAAAsCAAMACwALACBAAAAlvARAAAAAAAACKAAAQgcSFBggIMIEypUWLChw4YLI0Z8SNGhxIsIK2ociBHjxo0dL37UGFLiyIolJ558mHLhSoItS66MGXImTY8nb+IcafKlz54+bboMKpQh0Zwqj34EqpRk0qYon0JlqZMpyKpSnWI1ynMr14Jew4odS7as2bNo06pduxMs2aJh4XqVu5UuVrtV8erUe5NvAKpDu7aFmTXqYI6FKda0mDggACH5BAktAAAALAgACAAsADAAgQAAAJbwEQAAAAAAAAixAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHGnypc+ePm26DCqUIdGcKo9+BKqUZNKmKJ9CZamTKciqUp1iNcpzK9eCXsOKHUu2rNmzaNOqXbsTLNmiYeF6lbuVLla7VfHq1HuTbwCqQ7u2hZk16mCOhSnWtJgYsEjGgZd2dJzQL+WMSA8bTBwQACH5BAkPAAAALAgACAAsADAAgQAAAJbwEQAAAAAAAAiwAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHKlTZM6eKnkCdflzaEKbRF++NKl0adCmQpNC/WiUYdGqAZBi1VqVJdavYMOKHUu2rNmzaIF6/crVaNuhb9Ve7TrXbV24d+VG9QnxKciOa63uZdpX6t+dBQlTBWzRL0nGhQUvRgzTMUrIiS0DCAgAOw==';
|
|
14
|
-
/** idle-light: the dark bug, for the light theme. */
|
|
15
|
-
export const BUG_GIF_ON_LIGHT = 'data:image/gif;base64,R0lGODlhPAA8AIEAAAAAAB0dHQAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJkAEAACwAAAAAPAA8AAAI3AABCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjwQDiBxJsmRJkAhNqlSJ8uDKlyNbGoQJU2ZBmi9thsTJUqdAnj19AjVpcyhPkEZxIk1a8yPTph5X+nQodSrDqlYVYs2aMihXl16/3gwrduDWsmafnt2odq3GtmTfwj15cW5biHbV4s3LdC9fo37/Ag0sWOnDwkMJI85Z9+9Svo/zRrY7eW5luJfvOnW8GepYop0Zz4yb0fBo0FFpdkXd0fRnuqk972TN0fVs2K1Vg6WNtrfv38AXBgQAIfkECQ8AAAAsCAAMACwALACBAAAAHR0dAAAAAAAACKAAAQgcSFBggIMIEypUWLChw4YLI0Z8SNGhxIsIK2ociBHjxo0dL37UGFLiyIolJ558mHLhSoItS66MGXImTY8nb+IcafKlz54+bboMKpQh0Zwqj34EqpRk0qYon0JlqZMpyKpSnWI1ynMr14Jew4odS7as2bNo06pduxMs2aJh4XqVu5UuVrtV8erUe5NvAKpDu7aFmTXqYI6FKda0mDggACH5BAktAAAALAgACAAsADAAgQAAAB0dHQAAAAAAAAixAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHGnypc+ePm26DCqUIdGcKo9+BKqUZNKmKJ9CZamTKciqUp1iNcpzK9eCXsOKHUu2rNmzaNOqXbsTLNmiYeF6lbuVLla7VfHq1HuTbwCqQ7u2hZk16mCOhSnWtJgYsEjGgZd2dJzQL+WMSA8bTBwQACH5BAkPAAAALAgACAAsADAAgQAAAB0dHQAAAAAAAAiwAAEIHEhQYICDCBMqVFiwocOGCyNGfEjRocSLCCtqHIgR48aNHS9+1BhS4siKJSeefJhy4UqCLUuujBlyJk2PJ2/iHKlTZM6eKnkCdflzaEKbRF++NKl0adCmQpNC/WiUYdGqAZBi1VqVJdavYMOKHUu2rNmzaIF6/crVaNuhb9Ve7TrXbV24d+VG9QnxKciOa63uZdpX6t+dBQlTBWzRL0nGhQUvRgzTMUrIiS0DCAgAOw==';
|
|
16
|
-
/** The GIFs' first frame, the bug at rest, on the same 15 × 15 grid. */
|
|
17
|
-
export const BUG_REST_PATH = 'M5 2h5v2H5zM4 4h7v1H4zM4 5h2v2H4zM4 7h7v5H4zM2 8h11v2H2zM4 12h3v2H4zM9 12h2v2H9z';
|
|
18
|
-
/** That still frame in one color, as an SVG `data:` URL, for readers who prefer less motion. */
|
|
19
|
-
export const bugStill = (color) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" shape-rendering="crispEdges">` +
|
|
20
|
-
`<path fill="${color}" d="${BUG_REST_PATH}"/></svg>`)}`;
|
package/dist/report/html.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Layer } from 'effect';
|
|
2
|
-
import { ReportRenderer } from '../core/index.js';
|
|
3
|
-
import { type ReportBundle } from '../schema/index.js';
|
|
4
|
-
import { type RenderOptions } from './assets.js';
|
|
5
|
-
/**
|
|
6
|
-
* The page's one script, allowed by its hash in the Content Security Policy. On top of the shared
|
|
7
|
-
* player (see `PLAYER_JS`): the player's column learns where its top is (`--rp-top`) as the page
|
|
8
|
-
* scrolls, resizes or its heading changes, so the player, its controls and the case playing now
|
|
9
|
-
* fit on screen together wherever they are; the case at the reading line (30% down the view under the sticky top
|
|
10
|
-
* bar, or just under the pinned player and its fade on a narrow screen) becomes current as the reader scrolls, and the player jumps to it and loops it
|
|
11
|
-
* (a case with no video to play stops the player, which says so in the video's place); a click
|
|
12
|
-
* on a case, a scrubber segment or a case link makes that case current (scrolling it to the line,
|
|
13
|
-
* with scroll detection held off for 700 ms meanwhile); with "Loop case" off the current case
|
|
14
|
-
* follows the playhead. With "Skip inactive" on (as the walkthrough's, and remembered with it), it
|
|
15
|
-
* jumps over the stretches where nothing happened (`idleStretches`) while it plays; a stretch that
|
|
16
|
-
* runs past the end of the case being looped starts the case again instead. A timecode seeks the player there, playing on only when it was playing.
|
|
17
|
-
* The status filters hide cards (a hidden current case hands over to the
|
|
18
|
-
* first shown). Screenshots open in a modal viewer that steps through the case's shots (arrow
|
|
19
|
-
* keys, Esc, focus back where it was). A screenshot that cannot load says so in its figure, as
|
|
20
|
-
* before; errors can come before the script runs, so it also looks for images that already
|
|
21
|
-
* failed. Without script: the video has its own controls, timecodes open the video at their time
|
|
22
|
-
* and screenshots open the image.
|
|
23
|
-
*/
|
|
24
|
-
export declare const REPORT_SCRIPT = "(()=>{const d=document,r=d.documentElement,K='screw-bugs-theme';\nconst still=()=>matchMedia('(prefers-reduced-motion: reduce)').matches;\nconst topEdge=()=>{const b=d.querySelector('.menubar');return b?Math.max(0,b.getBoundingClientRect().bottom):0};\nconst pad=n=>String(n).padStart(2,'0');\nconst clock=s=>{s=Math.max(0,Math.floor(s||0));const h=Math.floor(s/3600),m=Math.floor(s%3600/60);return(h?h+':'+pad(m):String(m))+':'+pad(s%60)};\nlet theme='system';try{theme=localStorage.getItem(K)||theme}catch(e){}r.dataset.theme=theme;\nconst themeCycle=(b,key)=>{\n const r=document.documentElement,T=['light','dark','system'],N={light:'Light theme',dark:'Dark theme',system:'Theme from system'};\n const at=()=>{const i=T.indexOf(r.dataset.theme);return i<0?2:i};\n const show=()=>{const i=at(),f=document.getElementById('favicon'),h=f&&f.dataset[T[i]];if(h)f.href=h;b.setAttribute('aria-label',N[T[i]]+'. Switch to '+N[T[(i+1)%3]].toLowerCase());b.title=N[T[i]]};\n show();\n b.addEventListener('click',()=>{const m=T[(at()+1)%3];r.dataset.theme=m;if(key)try{localStorage.setItem(key,m)}catch(e){}show()});\n};\nconst chrome=()=>{\n d.querySelectorAll('.menubar .theme').forEach(b=>{themeCycle(b,K);b.hidden=false});\n if(location.protocol==='http:')d.querySelectorAll('a.share-btn').forEach(a=>{a.hidden=false});\n d.querySelectorAll('time.when[datetime]').forEach(e=>{\n const t=new Date(e.getAttribute('datetime'));if(isNaN(t.getTime()))return;const p={};\n try{new Intl.DateTimeFormat('en-US',{month:'short',day:'numeric',year:'numeric',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).formatToParts(t).forEach(x=>{p[x.type]=x.value});\n const y=d.createElement('span');y.className='year';y.textContent=', '+p.year;\n e.replaceChildren(p.month+' '+p.day,y,' '+String.fromCharCode(183)+' '+p.hour+':'+p.minute);\n e.title=new Intl.DateTimeFormat('en-US',{dateStyle:'full',timeStyle:'long'}).format(t)}catch(x){}\n });\n d.querySelectorAll('.prompt').forEach(p=>{\n const t=p.querySelector('.prompt-text'),b=p.querySelector('.prompt-more');if(!t||!b)return;\n const fits=()=>{if(!p.classList.contains('open'))b.hidden=t.scrollHeight<=t.clientHeight+1};\n fits();if(window.ResizeObserver)new ResizeObserver(fits).observe(t);if(d.fonts&&d.fonts.ready)d.fonts.ready.then(fits);\n b.addEventListener('click',()=>{const o=p.classList.toggle('open');b.textContent=o?'Show less':'Show full prompt';b.setAttribute('aria-expanded',String(o));fits()});\n });\n};\nconst bare=u=>{const i=u.indexOf('://');return i<0?u:u.slice(i+3)};\nconst player=(p,o)=>{\n const v=d.getElementById(p+'-video'),fig=v.closest('.player'),note=d.getElementById(p+'-unloaded'),c=d.getElementById(p+'-controls'),url=d.getElementById(p+'-url');\n const srcs=new Map([...fig.querySelectorAll('[data-session-src]')].map(e=>[e.dataset.session,e.dataset.sessionSrc]));\n const order=[...srcs.keys()];\n const urls=[...fig.querySelectorAll('[data-url]')].map(e=>({s:e.dataset.s,t:Number(e.dataset.at),u:e.dataset.url}));\n const dead=new Set(),errs=new Map(),empty=d.getElementById(p+'-none');let shown=0,cur=v.dataset.session,down=null,held=false,ask=0,auto=false,rate=1,raf=0,drag=false;\n const play=c.querySelector('.play'),now=c.querySelector('.now'),total=c.querySelector('.total'),bar=c.querySelector('.scrub'),head=c.querySelector('.head'),tracks=[...c.querySelectorAll('.track')];\n v.removeAttribute('controls');c.hidden=false;\n const big=d.getElementById(p+'-start');\n if(big){big.hidden=false;big.addEventListener('click',()=>{grow();v.play().catch(()=>{})});v.addEventListener('play',()=>big.remove(),{once:true})}\n const track=()=>tracks.find(t=>t.dataset.s===cur);\n const len=()=>{const t=track(),n=t?Number(t.dataset.total):0;return n>0?n:(isFinite(v.duration)?v.duration:0)};\n const paint=()=>{\n const L=len(),t=v.currentTime,f=L?Math.min(1,t/L):0,k=track();\n tracks.forEach(x=>{x.hidden=x!==k});head.style.left=(f*100)+'%';\n const done=k&&k.querySelector('.done');if(done)done.style.width=(f*100)+'%';\n now.textContent=clock(t);total.textContent=clock(L);\n bar.setAttribute('aria-valuemax',String(Math.round(L)));bar.setAttribute('aria-valuenow',String(Math.round(t)));bar.setAttribute('aria-valuetext',clock(t)+' of '+clock(L));\n play.classList.toggle('playing',!v.paused);play.setAttribute('aria-label',v.paused?'Play':'Pause');\n if(url){let u='';if(down!=='')for(const x of urls){if(x.s===cur&&x.t<=t+0.02)u=x.u}url.textContent=bare(u);url.parentElement.title=u}\n };\n const update=()=>{paint();if(o.tick)o.tick(v.currentTime)};\n const frame=()=>{update();raf=v.paused?0:requestAnimationFrame(frame)};\n const show=s=>{if(down===null)held=!v.paused;down=s;v.pause();fig.classList.add('broken');c.hidden=true;if(empty)empty.hidden=true;if(note){++shown;note.hidden=false;const a=note.querySelector('a');if(a){a.href=srcs.get(s);a.textContent=srcs.get(s)}const ft=note.querySelector('.fix-text'),fd=note.querySelector('.fix-done');if(ft){ft.hidden=true;ft.value=''}if(fd)fd.textContent=''}if(o.broken)o.broken()};\n const fine=()=>{if(down===null)return;down=null;fig.classList.remove('broken');c.hidden=false;if(note)note.hidden=true;if(empty)empty.hidden=true;if(o.fine)o.fine()};\n const none=()=>{if(down===null)held=!v.paused;++ask;auto=false;down='';v.pause();fig.classList.add('broken');c.hidden=true;if(note)note.hidden=true;if(empty)empty.hidden=false;paint();if(o.broken)o.broken()};\n const playing=()=>down===null?!v.paused:held;\n const next=s=>order.slice(order.indexOf(s)+1).find(n=>!dead.has(n));\n const load=(s,t,go,a)=>{\n const my=++ask;auto=!!a;if(dead.has(s))return show(s);\n if(s!==cur||!v.currentSrc||v.error){cur=s;v.dataset.session=s;v.src=srcs.get(s);v.load()}\n const done=()=>{if(my!==ask)return;auto=false;fine();v.playbackRate=rate;v.currentTime=t;update();if(go)v.play().catch(()=>{})};\n if(v.readyState>0)done();else v.addEventListener('loadedmetadata',done,{once:true});\n };\n const bad=()=>{const e=v.error;if(!e)return;dead.add(cur);errs.set(cur,'error code '+e.code+(e.message?': '+e.message:''));if(down==='')return;const n=auto?next(cur):undefined;if(n!==undefined)return load(n,0,true,true);auto=false;show(cur)};\n ['timeupdate','seeked','loadedmetadata','pause','play','durationchange'].forEach(n=>v.addEventListener(n,update));\n v.addEventListener('play',()=>{if(!raf)raf=requestAnimationFrame(frame)});\n addEventListener('resize',update);\n v.addEventListener('error',bad);if(v.error)queueMicrotask(bad);\n const fix=d.getElementById(p+'-fix');\n if(fix){const box=fix.parentElement,ta=box.querySelector('.fix-text'),said=box.querySelector('.fix-done');\n fix.addEventListener('click',()=>{\n let t=ta.dataset.template||'';\n [['video',down?srcs.get(down)||'':''],['page',location.href],['browser',navigator.userAgent],['error',errs.get(down)||'nothing']].forEach(([k,x])=>{t=t.split('{'+k+'}').join(x)});\n const g=shown;ta.value=t;const ok=()=>{if(g!==shown)return;said.textContent='Copied. Paste it into your coding agent.'};\n const by=()=>{if(g!==shown)return;ta.hidden=false;ta.focus();ta.setSelectionRange(0,t.length);ta.scrollTop=0;let c=false;try{c=d.execCommand('copy')}catch(x){}if(c)ok();else said.textContent='Copy the prompt below.'};\n if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(t).then(ok,by);else by();\n })}\n v.addEventListener('ended',()=>{if(o.ended&&o.ended())return;const n=next(cur);if(n!==undefined)load(n,0,true,true)});\n play.addEventListener('click',()=>{if(v.paused)v.play().catch(()=>{});else v.pause()});\n v.addEventListener('click',()=>{if(down!==null)return;if(grow())v.play().catch(()=>{});else play.click()});\n c.querySelectorAll('[data-rate]').forEach(b=>b.addEventListener('click',()=>{rate=Number(b.dataset.rate);v.playbackRate=rate;v.defaultPlaybackRate=rate;c.querySelectorAll('[data-rate]').forEach(x=>x.setAttribute('aria-pressed',String(x===b)))}));\n const seek=t=>{const L=len();t=Math.max(0,L?Math.min(L,t):t);v.currentTime=t;if(o.seek)o.seek(t);update()};\n const at=e=>{const b=bar.getBoundingClientRect();return Math.max(0,Math.min(1,(e.clientX-b.left)/b.width))*len()};\n bar.addEventListener('pointerdown',e=>{if(e.button>0||down!==null)return;drag=true;bar.setPointerCapture(e.pointerId);seek(at(e))});\n bar.addEventListener('pointermove',e=>{if(drag)seek(at(e))});\n ['pointerup','pointercancel'].forEach(n=>bar.addEventListener(n,()=>{drag=false}));\n bar.addEventListener('keydown',e=>{\n const k=e.key,t=v.currentTime,by={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1,PageDown:-10,PageUp:10}[k];\n const to=by!==undefined?t+by:k==='Home'?0:k==='End'?len():null;if(to===null)return;e.preventDefault();seek(to);\n });\n const full=c.querySelector('.full'),screen=o.full||fig.querySelector('.screen');\n const api=!!(d.fullscreenEnabled&&screen.requestFullscreen),inPage=()=>!!o.inPage&&(o.inPage()||!api);\n const mark=()=>{const f=d.fullscreenElement===screen||screen.classList.contains('focus');full.classList.toggle('out',f);full.setAttribute('aria-label',f?'Exit fullscreen':'Fullscreen');update()};\n let back=0;const focus=on=>{if(on)back=scrollY;screen.classList.toggle('focus',on);scrollTo({top:on?0:back,behavior:'auto'});mark()};\n const grow=()=>{if(!o.expand||!o.inPage||!o.inPage()||d.fullscreenElement||screen.classList.contains('focus'))return false;focus(true);return true};\n if(!api&&!o.inPage)full.hidden=true;\n else{full.addEventListener('click',()=>{const f=screen.classList.contains('focus');if(d.fullscreenElement){d.exitFullscreen().catch(()=>{});if(f)focus(false)}else if(f)focus(false);else if(inPage())focus(true);else screen.requestFullscreen().catch(()=>{})});\n d.addEventListener('fullscreenchange',mark);\n d.addEventListener('keydown',e=>{if(e.key==='Escape'&&!e.defaultPrevented&&screen.classList.contains('focus')&&!d.querySelector('dialog[open]')){e.preventDefault();focus(false)}})}\n d.addEventListener('keydown',e=>{if(e.key!==' '||down!==null||e.defaultPrevented||d.querySelector('dialog[open]')||e.target.closest('button,a,input,textarea,select,summary,[role=slider]'))return;e.preventDefault();play.click()});\n return {v,load,none,playing,update,len,cur:()=>cur,down:()=>down,has:s=>srcs.has(s)};\n};\n\nconst badImg=i=>{const f=i.closest('figure');if(!f||f.classList.contains('broken'))return;f.classList.add('broken');f.querySelectorAll('.unloaded').forEach(u=>u.removeAttribute('aria-hidden'))};\nconst scan=()=>d.querySelectorAll('figure img').forEach(i=>{if(i.complete&&i.naturalWidth===0)badImg(i)});\nd.addEventListener('error',e=>{const t=e.target;if(t instanceof Element&&t.matches('figure img'))badImg(t)},true);\naddEventListener('load',scan);\nd.addEventListener('DOMContentLoaded',()=>{\n chrome();scan();\n const cards=[...d.querySelectorAll('.case[data-i]')],segs=[...d.querySelectorAll('.seg[data-case]')];\n const np=d.getElementById('rp-now'),loopB=d.getElementById('rp-loop'),skipB=d.getElementById('rp-skip'),dlg=d.getElementById('viewer');\n const idle=[...d.querySelectorAll('.idle[data-a]')].map(e=>({s:e.closest('.track').dataset.s,a:Number(e.dataset.a),b:Number(e.dataset.b)}));\n let skip=!!skipB;const sk='screw-bugs-skip';try{skip=skip&&localStorage.getItem(sk)!=='off'}catch(e){}if(skipB)skipB.setAttribute('aria-pressed',String(skip));\n const N=cards.length,dash=String.fromCharCode(8211);let cur=null,loop=true,lock=0,lastT=0,P=null,sr=0;\n const timed=c=>!!c&&c.dataset.t0!==undefined;\n const span=c=>[Number(c.dataset.t0),Number(c.dataset.t1)];\n const shown=()=>cards.filter(c=>!c.hidden);\n const line=()=>{const b=topEdge();if(matchMedia('(max-width: 900px)').matches){const s=d.querySelector('.rp-left');return s?s.getBoundingClientRect().bottom+24:b+120}return Math.round(b+(innerHeight-b)*0.3)};\n const playable=c=>timed(c)&&!!P&&P.has(c.dataset.s);\n const chip=c=>{if(!playable(c)||P.down()!==null)return '';const s=span(c);return (loop?'Looping ':'Playing ')+clock(s[0])+dash+clock(s[1])};\n const paintNow=()=>{\n if(!np||!cur)return;\n np.querySelector('.np-st').replaceChildren(cur.querySelector('.case-head .st').cloneNode(true));\n np.querySelector('.np-n').textContent=cur.dataset.i+' / '+N;\n np.querySelector('.np-title').textContent=cur.querySelector('.case-go').textContent;\n np.querySelector('.np-status').textContent=cur.dataset.label+': ';\n const ch=np.querySelector('.np-chip'),t=chip(cur);ch.querySelector('span').textContent=t||'No video';ch.classList.toggle('none',!t);\n };\n const toCard=c=>{lock=Date.now()+700;const y=c.getBoundingClientRect().top+scrollY-line()+2;scrollTo({top:Math.max(0,y),behavior:still()?'auto':'smooth'})};\n const setCurrent=(c,seek,scroll)=>{\n if(!c)return;\n if(c!==cur){if(cur){cur.classList.remove('on');cur.removeAttribute('aria-current')}cur=c;c.classList.add('on');c.setAttribute('aria-current','true');segs.forEach(x=>x.classList.toggle('on',x.dataset.case===c.dataset.id));paintNow()}\n if(seek&&P){if(playable(c)){const a=span(c)[0];lastT=a;P.load(c.dataset.s,a,P.playing())}else P.none()}\n if(scroll)toCard(c);\n };\n const caseAt=(s,t)=>{let f=null;for(const c of shown()){if(timed(c)&&c.dataset.s===s){const x=span(c);if(t>=x[0]&&t<x[1])f=c}}return f};\n const onScroll=()=>{\n if(Date.now()<lock)return;const vis=shown();if(!vis.length)return;\n const L=line();let pick=vis[0];for(const c of vis){if(c.getBoundingClientRect().top<=L)pick=c}\n const last=vis[vis.length-1];if(innerHeight+scrollY>=r.scrollHeight-2&&last.getBoundingClientRect().bottom<=innerHeight)pick=last;\n if(pick!==cur)setCurrent(pick,true,false);\n };\n const stk=d.querySelector('.rp-sticky'),head=d.querySelector('.rp-head');\n const fit=()=>{if(stk)stk.style.setProperty('--rp-top',Math.round(stk.getBoundingClientRect().top)+'px')};\n fit();addEventListener('resize',fit);addEventListener('load',fit);\n if(head&&window.ResizeObserver)new ResizeObserver(fit).observe(head);\n addEventListener('scroll',()=>{if(!sr)sr=requestAnimationFrame(()=>{sr=0;fit();onScroll()})},{passive:true});\n if(d.getElementById('rp-video'))P=player('rp',{\n broken:paintNow,fine:paintNow,\n tick:t=>{\n if(!cur||P.down()!==null||P.v.seeking)return;const s=P.cur();\n const lp=loop&&timed(cur)&&cur.dataset.s===s,x=lp?span(cur):null;\n if(lp&&!P.v.paused&&t>=x[1]-0.03&&lastT<x[1]){lastT=x[0];P.v.currentTime=x[0];return}\n if(skip&&!P.v.paused){const gap=idle.find(g=>g.s===s&&t>=g.a&&t<g.b-0.05);if(gap){let to=gap.b;if(lp&&lastT<x[1]&&to>=x[1]-0.03)to=x[0];lastT=to;P.v.currentTime=to;return}}\n if(!loop){const c=caseAt(s,t);if(c&&c!==cur)setCurrent(c,false,true)}\n lastT=t;\n },\n seek:t=>{lastT=t;const c=caseAt(P.cur(),t);if(c&&c!==cur)setCurrent(c,false,true)},\n ended:()=>{\n if(!cur)return false;\n if(loop&&timed(cur)&&cur.dataset.s===P.cur()){P.load(P.cur(),span(cur)[0],true);return true}\n if(!loop){const later=shown().find(c=>timed(c)&&Number(c.dataset.s)>Number(P.cur())&&P.has(c.dataset.s));if(later){setCurrent(later,false,true);P.load(later.dataset.s,span(later)[0],true);return true}}\n return false;\n },\n });\n if(loopB)loopB.addEventListener('click',()=>{loop=!loop;loopB.setAttribute('aria-pressed',String(loop));paintNow()});\n if(skipB)skipB.addEventListener('click',()=>{skip=!skip;skipB.setAttribute('aria-pressed',String(skip));try{localStorage.setItem(sk,skip?'on':'off')}catch(e){}});\n const filter=f=>{\n d.querySelectorAll('[data-filter]').forEach(x=>x.setAttribute('aria-pressed',String(x.dataset.filter===f)));\n cards.forEach(c=>{c.hidden=!(f==='all'||c.dataset.status===f)});\n segs.forEach(x=>{const c=cards.find(k=>k.dataset.id===x.dataset.case);x.classList.toggle('off',!!c&&c.hidden)});\n if(cur&&cur.hidden)setCurrent(shown()[0],true,false);\n };\n d.querySelectorAll('[data-filter]').forEach(b=>b.addEventListener('click',()=>filter(b.dataset.filter)));\n d.querySelectorAll('.filters').forEach(f=>f.classList.add('live'));\n let vCase=null,vIdx=0,opener=null;\n const q=s=>dlg.querySelector(s);\n const list=c=>{const t=c&&c.querySelector('template.shots');return t?[...t.content.children]:[]};\n const showShot=()=>{\n const l=list(vCase),f=l[vIdx];if(!f)return;\n q('.v-body').replaceChildren(f.cloneNode(true));\n q('.v-st').replaceChildren(vCase.querySelector('.case-head .st').cloneNode(true));\n q('.v-title').textContent=vCase.querySelector('.case-go').textContent;\n q('.v-what').textContent=f.dataset.cap+(l.length>1?' ('+(vIdx+1)+' of '+l.length+')':'');\n q('.v-prev').disabled=vIdx===0;q('.v-next').disabled=vIdx>=l.length-1;scan();\n };\n if(dlg){\n q('.v-prev').addEventListener('click',()=>{if(vIdx>0){vIdx--;showShot()}});\n q('.v-next').addEventListener('click',()=>{if(vIdx<list(vCase).length-1){vIdx++;showShot()}});\n q('.v-close').addEventListener('click',()=>dlg.close());\n dlg.addEventListener('click',e=>{if(e.target===dlg)dlg.close()});\n dlg.addEventListener('keydown',e=>{if(e.key==='ArrowLeft'){e.preventDefault();q('.v-prev').click()}else if(e.key==='ArrowRight'){e.preventDefault();q('.v-next').click()}});\n dlg.addEventListener('close',()=>{q('.v-body').replaceChildren();if(opener&&opener.isConnected)opener.focus()});\n }\n d.addEventListener('click',e=>{\n const t=e.target;if(!(t instanceof Element))return;\n const tc=t.closest('a.tc[data-t]');\n if(tc){if(!P||!P.has(tc.dataset.s))return;e.preventDefault();const s=tc.dataset.s,at=Number(tc.dataset.t),c=caseAt(s,at)||tc.closest('.case')||(dlg&&dlg.open?vCase:null);if(dlg&&dlg.open)dlg.close();if(c)setCurrent(c,false,!tc.closest('.case'));lastT=at;P.load(s,at,P.playing());return}\n const go=t.closest('a[href^=\"#case-\"]');\n if(go){const c=d.getElementById(go.getAttribute('href').slice(1));if(!c||!c.matches('.case[data-i]'))return;e.preventDefault();if(c.hidden)filter('all');toCard(c);setCurrent(c,true,false);return}\n const shot=t.closest('[data-shot]');\n if(shot&&dlg&&dlg.showModal){e.preventDefault();opener=shot;vCase=shot.closest('.case');vIdx=Number(shot.dataset.shot)||0;showShot();dlg.showModal();q('.v-close').focus();return}\n const c=t.closest('.case[data-i]');\n if(!c||t.closest('a,summary,details,input,label')||(t.closest('button')&&!t.closest('.case-go')))return;\n toCard(c);setCurrent(c,true,false);\n });\n const first=cards.find(c=>timed(c)&&(!P||P.has(c.dataset.s)))||cards[0];\n if(first){setCurrent(first,false,false);if(timed(first))lastT=span(first)[0]}\n});\n})();";
|
|
25
|
-
/**
|
|
26
|
-
* Images and video load from the run folder by relative path (`'self'`, and `file:` for a report
|
|
27
|
-
* opened from disk); styles are inline, but for Google Fonts' stylesheet, whose fonts come from
|
|
28
|
-
* its font host; the only script is {@link REPORT_SCRIPT}, by its hash. Nothing else loads from
|
|
29
|
-
* the network. A report rendered with an asset base URL also allows images and media (only) from
|
|
30
|
-
* its origin (`reportCsp`).
|
|
31
|
-
*/
|
|
32
|
-
export declare const REPORT_CSP: string;
|
|
33
|
-
/** The report's policy when its files load from `assetOrigin` (see `RenderOptions`). */
|
|
34
|
-
export declare const reportCsp: (assetOrigin?: string) => string;
|
|
35
|
-
/**
|
|
36
|
-
* A self-contained HTML report: inline CSS, one inline script, and from the network only Geist
|
|
37
|
-
* and Geist Mono from Google Fonts (system fonts offline). Screenshots and the video are linked by
|
|
38
|
-
* paths relative to the run folder, so the page works from disk and after the folder is zipped or
|
|
39
|
-
* moved; or, with `options.assetBaseUrl`, under that URL (see `RenderOptions`), and then without
|
|
40
|
-
* the details' raw data row (a host keeps no JSON files). With no options the page is exactly the
|
|
41
|
-
* local one. Code lays out every part and decides every status; the
|
|
42
|
-
* agent's write-up, when it submitted one, fills fixed slots and is labelled as its own. Every
|
|
43
|
-
* piece of text from the job, the page or the agent is escaped.
|
|
44
|
-
*/
|
|
45
|
-
export declare const renderHtmlReport: (bundle: ReportBundle, options?: RenderOptions) => string;
|
|
46
|
-
/** The report module's renderer, for the engine to write a run's report. */
|
|
47
|
-
export declare const ReportRendererHtml: Layer.Layer<ReportRenderer, never, never>;
|