@page-scanner/cli 0.1.1 → 0.2.1

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 (55) hide show
  1. package/README.md +58 -4
  2. package/dist/api.d.ts +82 -2
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +147 -18
  5. package/dist/api.js.map +1 -1
  6. package/dist/batch.d.ts +60 -0
  7. package/dist/batch.d.ts.map +1 -0
  8. package/dist/batch.js +116 -0
  9. package/dist/batch.js.map +1 -0
  10. package/dist/cli/args.d.ts +27 -4
  11. package/dist/cli/args.d.ts.map +1 -1
  12. package/dist/cli/args.js +129 -10
  13. package/dist/cli/args.js.map +1 -1
  14. package/dist/cli/commands.d.ts +2 -0
  15. package/dist/cli/commands.d.ts.map +1 -1
  16. package/dist/cli/commands.js +170 -14
  17. package/dist/cli/commands.js.map +1 -1
  18. package/dist/daemon/rpc-server.d.ts.map +1 -1
  19. package/dist/daemon/rpc-server.js +17 -1
  20. package/dist/daemon/rpc-server.js.map +1 -1
  21. package/dist/diff/image.d.ts +42 -0
  22. package/dist/diff/image.d.ts.map +1 -0
  23. package/dist/diff/image.js +144 -0
  24. package/dist/diff/image.js.map +1 -0
  25. package/dist/diff/index.d.ts +46 -0
  26. package/dist/diff/index.d.ts.map +1 -0
  27. package/dist/diff/index.js +108 -0
  28. package/dist/diff/index.js.map +1 -0
  29. package/dist/diff/png.d.ts +12 -0
  30. package/dist/diff/png.d.ts.map +1 -0
  31. package/dist/diff/png.js +169 -0
  32. package/dist/diff/png.js.map +1 -0
  33. package/dist/diff/text.d.ts +54 -0
  34. package/dist/diff/text.d.ts.map +1 -0
  35. package/dist/diff/text.js +198 -0
  36. package/dist/diff/text.js.map +1 -0
  37. package/dist/index.d.ts +6 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +6 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/output.d.ts +10 -0
  42. package/dist/output.d.ts.map +1 -1
  43. package/dist/output.js +24 -4
  44. package/dist/output.js.map +1 -1
  45. package/dist/protocol.d.ts +37 -2
  46. package/dist/protocol.d.ts.map +1 -1
  47. package/dist/protocol.js +23 -2
  48. package/dist/protocol.js.map +1 -1
  49. package/dist/verify.d.ts +31 -0
  50. package/dist/verify.d.ts.map +1 -0
  51. package/dist/verify.js +115 -0
  52. package/dist/verify.js.map +1 -0
  53. package/dist/version.d.ts +1 -1
  54. package/dist/version.js +1 -1
  55. package/package.json +3 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../src/batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI;SACR,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC;IACrE,CAAC;IACD,KAAK,MAAM,CAAC,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IAAI,KAAK,YAAY;QAC3B,KAAK,CAAC,IAAI,KAAK,mBAAmB;QAClC,KAAK,CAAC,IAAI,KAAK,iBAAiB;QAChC,KAAK,CAAC,IAAI,KAAK,eAAe;QAC9B,KAAK,CAAC,IAAI,KAAK,aAAa,CAC7B,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
- import { type ExportFormatId, type PageSizeId, type VideoHandling } from '../protocol.js';
2
- export declare const COMMANDS: readonly ["pair", "status", "browsers", "tabs", "scan", "serve", "stop", "help", "version"];
1
+ import { type ExportFormatId, type PageSizeId, type CaptureWidth, type ColorSchemePreference, type VideoHandling } from '../protocol.js';
2
+ export declare const COMMANDS: readonly ["pair", "status", "browsers", "tabs", "scan", "diff", "verify", "serve", "stop", "help", "version"];
3
3
  export type CommandName = (typeof COMMANDS)[number];
4
4
  export interface PairArgs {
5
5
  command: 'pair';
@@ -25,6 +25,14 @@ export interface TabsArgs {
25
25
  export interface ScanArgs {
26
26
  command: 'scan';
27
27
  url?: string;
28
+ /** Several addresses, from repeated --url; a batch (#59). */
29
+ urls?: string[];
30
+ /** A file of addresses, one to a line, or `-` for standard input; a batch too. */
31
+ urlsFile?: string;
32
+ /** The file name template for what a scan writes. */
33
+ name?: string;
34
+ /** The page's text as Markdown beside the file, or instead of it (#61). */
35
+ markdown?: 'beside' | 'only';
28
36
  tabId?: number;
29
37
  windowId?: number;
30
38
  browser?: string;
@@ -32,12 +40,27 @@ export interface ScanArgs {
32
40
  pageSize: PageSizeId;
33
41
  quality?: number;
34
42
  videoHandling?: VideoHandling;
43
+ colorScheme?: ColorSchemePreference;
44
+ captureWidth?: CaptureWidth;
35
45
  openEditor: boolean;
36
46
  out?: string;
37
47
  waitSeconds: number;
38
48
  timeoutSeconds: number;
39
49
  json: boolean;
40
50
  }
51
+ export interface DiffArgs {
52
+ command: 'diff';
53
+ old: string;
54
+ new: string;
55
+ out?: string;
56
+ json: boolean;
57
+ }
58
+ export interface VerifyArgs {
59
+ command: 'verify';
60
+ file: string;
61
+ record?: string;
62
+ json: boolean;
63
+ }
41
64
  export interface ServeArgs {
42
65
  command: 'serve';
43
66
  daemon: boolean;
@@ -53,8 +76,8 @@ export interface HelpArgs {
53
76
  export interface VersionArgs {
54
77
  command: 'version';
55
78
  }
56
- export type ParsedArgs = PairArgs | StatusArgs | BrowsersArgs | TabsArgs | ScanArgs | ServeArgs | StopArgs | HelpArgs | VersionArgs;
57
- export declare const USAGE = "page-scanner - capture a whole web page from the command line,\nthrough the Page Scanner Chrome extension.\n\nUsage:\n page-scanner pair [--port <n>] [--rotate] [--wait <s>=120] [--no-wait]\n [--json]\n page-scanner status [--json]\n page-scanner browsers [--json]\n page-scanner tabs [--browser <id|label>] [--wait <s>=30] [--json]\n page-scanner scan (--url <u> | --tab <id>) [--window <id>]\n [--browser <id|label>] [--format pdf|png|jpeg=pdf]\n [--page-size auto|a4|letter=a4] [--quality <0-1>]\n [--video frame|blank] [--open-editor]\n [--out <file|dir>] [--wait <s>=30]\n [--timeout <s>=120]\n [--json]\n page-scanner serve [--daemon] [--idle <min>]\n page-scanner stop [--json]\n page-scanner --version | --help (-v and -h also work)\n\nCommands:\n pair Write the port and token the browser needs, then wait for it.\n status Say whether there is a pairing, a daemon and a browser.\n browsers List the browsers connected right now.\n tabs List one browser's windows and tabs.\n scan Capture a page and write it to a file.\n serve Run the bridge in this terminal, or start it in the background.\n stop Stop the background bridge.\n\n--browser takes a browserId or a label, matched without regard to case, and\nis needed only when more than one browser is connected. --wait 0 means do\nnot wait at all. --json prints one JSON document on stdout, on success and\non failure alike.\n\nExit codes:\n 0 success\n 1 the browser was reached and the work failed\n 2 the arguments were wrong\n 3 no usable browser: none connected, several connected, or the one\n named is not\n 4 not paired: run `page-scanner pair`\n 5 the daemon would not start\n";
79
+ export type ParsedArgs = PairArgs | StatusArgs | BrowsersArgs | TabsArgs | ScanArgs | DiffArgs | VerifyArgs | ServeArgs | StopArgs | HelpArgs | VersionArgs;
80
+ export declare const USAGE = "page-scanner - capture a whole web page from the command line,\nthrough the Page Scanner Chrome extension.\n\nUsage:\n page-scanner pair [--port <n>] [--rotate] [--wait <s>=120] [--no-wait]\n [--json]\n page-scanner status [--json]\n page-scanner browsers [--json]\n page-scanner tabs [--browser <id|label>] [--wait <s>=30] [--json]\n page-scanner scan (--url <u>... | --urls <file|-> | --tab <id>)\n [--window <id>] [--name <template>]\n [--markdown beside|only]\n [--browser <id|label>] [--format pdf|png|jpeg=pdf]\n [--page-size auto|a4|letter=a4] [--quality <0-1>]\n [--video frame|blank] [--scheme auto|light|dark]\n [--page-width window|a4|letter] [--open-editor]\n [--out <file|dir>] [--wait <s>=30]\n [--timeout <s>=120]\n [--json]\n page-scanner diff <old> <new> [--out <file>] [--json]\n page-scanner verify <file> [--record <file.integrity.json>] [--json]\n page-scanner serve [--daemon] [--idle <min>]\n page-scanner stop [--json]\n page-scanner --version | --help (-v and -h also work)\n\nCommands:\n pair Write the port and token the browser needs, then wait for it.\n status Say whether there is a pairing, a daemon and a browser.\n browsers List the browsers connected right now.\n tabs List one browser's windows and tabs.\n scan Capture a page, or a list of them, and write each to a file.\n diff Say what changed between two captures of a page.\n verify Check a file against the integrity record exported beside it.\n serve Run the bridge in this terminal, or start it in the background.\n stop Stop the background bridge.\n\n--scheme picks which of a page's two themes to capture. The default, auto,\nis the one the browser is set to, in the PDF as well as the preview: Chrome\nprints every page light unless it is told otherwise.\n\n--page-width lays the page out at the width of a sheet before capturing it,\nthe way a narrow window would, so the PDF prints at 1:1 instead of being\nscaled down. A 1280 px window on A4 is scaled to 55 %, which puts 16 px\nbody text at 6.5 pt; --page-width a4 puts it at 12.\n\n--url can be given more than once, and --urls reads a file of addresses,\none to a line (# starts a comment, - reads standard input). A list is\nscanned one page at a time into --out, which is then a directory; a page\nthat fails is reported and the next one scanned, and the exit code is 1\nif any failed. Schedule it with cron, launchd or Task Scheduler.\n\n--name sets the file name inside --out: {n} (the page's place in the\nlist), {host}, {name} (the name the browser suggests), {date} and {time}\n(when the run started), {ext}. A / makes a subdirectory. Without it, a\nfile takes the browser's name, with -2, -3 when two pages share one.\n\n--markdown writes the page's text as Markdown: beside puts a .md next to\nthe file, only writes the .md alone. The headings, title and language come\nback in --json as \"page\".\n\ndiff compares two Markdown files (from --markdown) a passage at a time,\nprinting what diff -u prints, or two PNGs pixel by pixel, writing the newer\none with the changed regions outlined (--out, or <new>.diff.png). A PDF is\ncompared by the .md beside it. It exits 0 when nothing changed and 1 when\nsomething did, the way diff does.\n\nverify checks a file's SHA-256 against the record the extension wrote\nbeside it (<file>.integrity.json unless --record names another) and, when\nthe record is signed, the signature. It exits 0 when both hold and 1 when\neither does not. It says nothing about the time, which is the capturing\ncomputer's clock.\n\n--browser takes a browserId or a label, matched without regard to case, and\nis needed only when more than one browser is connected. --wait 0 means do\nnot wait at all. --json prints one JSON document on stdout, on success and\non failure alike.\n\nExit codes:\n 0 success\n 1 the browser was reached and the work failed\n 2 the arguments were wrong\n 3 no usable browser: none connected, several connected, or the one\n named is not\n 4 not paired: run `page-scanner pair`\n 5 the daemon would not start\n";
58
81
  /**
59
82
  * `argv` is what follows the node executable and the script, i.e.
60
83
  * `process.argv.slice(2)`.
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,QAAQ,6FAUX,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,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pB;AAED,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,WAAW,CAAC;AAQhB,eAAO,MAAM,KAAK,2wIAqFjB,CAAC;AAqaF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAuCpD"}
package/dist/cli/args.js CHANGED
@@ -13,13 +13,15 @@
13
13
  */
14
14
  import { parseArgs as parseNodeArgs } from 'node:util';
15
15
  import { PageScannerError } from '../errors.js';
16
- import { DEFAULT_PAGE_SIZE, EXPORT_FORMAT_IDS, PAGE_SIZE_IDS, VIDEO_HANDLINGS, } from '../protocol.js';
16
+ import { DEFAULT_PAGE_SIZE, EXPORT_FORMAT_IDS, PAGE_SIZE_IDS, CAPTURE_WIDTHS, COLOR_SCHEME_PREFERENCES, VIDEO_HANDLINGS, } from '../protocol.js';
17
17
  export const COMMANDS = [
18
18
  'pair',
19
19
  'status',
20
20
  'browsers',
21
21
  'tabs',
22
22
  'scan',
23
+ 'diff',
24
+ 'verify',
23
25
  'serve',
24
26
  'stop',
25
27
  'help',
@@ -39,13 +41,18 @@ Usage:
39
41
  page-scanner status [--json]
40
42
  page-scanner browsers [--json]
41
43
  page-scanner tabs [--browser <id|label>] [--wait <s>=${TABS_WAIT_SECONDS}] [--json]
42
- page-scanner scan (--url <u> | --tab <id>) [--window <id>]
44
+ page-scanner scan (--url <u>... | --urls <file|-> | --tab <id>)
45
+ [--window <id>] [--name <template>]
46
+ [--markdown beside|only]
43
47
  [--browser <id|label>] [--format pdf|png|jpeg=pdf]
44
48
  [--page-size auto|a4|letter=a4] [--quality <0-1>]
45
- [--video frame|blank] [--open-editor]
49
+ [--video frame|blank] [--scheme auto|light|dark]
50
+ [--page-width window|a4|letter] [--open-editor]
46
51
  [--out <file|dir>] [--wait <s>=${SCAN_WAIT_SECONDS}]
47
52
  [--timeout <s>=${SCAN_TIMEOUT_SECONDS}]
48
53
  [--json]
54
+ page-scanner diff <old> <new> [--out <file>] [--json]
55
+ page-scanner verify <file> [--record <file.integrity.json>] [--json]
49
56
  page-scanner serve [--daemon] [--idle <min>]
50
57
  page-scanner stop [--json]
51
58
  page-scanner --version | --help (-v and -h also work)
@@ -55,10 +62,48 @@ Commands:
55
62
  status Say whether there is a pairing, a daemon and a browser.
56
63
  browsers List the browsers connected right now.
57
64
  tabs List one browser's windows and tabs.
58
- scan Capture a page and write it to a file.
65
+ scan Capture a page, or a list of them, and write each to a file.
66
+ diff Say what changed between two captures of a page.
67
+ verify Check a file against the integrity record exported beside it.
59
68
  serve Run the bridge in this terminal, or start it in the background.
60
69
  stop Stop the background bridge.
61
70
 
71
+ --scheme picks which of a page's two themes to capture. The default, auto,
72
+ is the one the browser is set to, in the PDF as well as the preview: Chrome
73
+ prints every page light unless it is told otherwise.
74
+
75
+ --page-width lays the page out at the width of a sheet before capturing it,
76
+ the way a narrow window would, so the PDF prints at 1:1 instead of being
77
+ scaled down. A 1280 px window on A4 is scaled to 55 %, which puts 16 px
78
+ body text at 6.5 pt; --page-width a4 puts it at 12.
79
+
80
+ --url can be given more than once, and --urls reads a file of addresses,
81
+ one to a line (# starts a comment, - reads standard input). A list is
82
+ scanned one page at a time into --out, which is then a directory; a page
83
+ that fails is reported and the next one scanned, and the exit code is 1
84
+ if any failed. Schedule it with cron, launchd or Task Scheduler.
85
+
86
+ --name sets the file name inside --out: {n} (the page's place in the
87
+ list), {host}, {name} (the name the browser suggests), {date} and {time}
88
+ (when the run started), {ext}. A / makes a subdirectory. Without it, a
89
+ file takes the browser's name, with -2, -3 when two pages share one.
90
+
91
+ --markdown writes the page's text as Markdown: beside puts a .md next to
92
+ the file, only writes the .md alone. The headings, title and language come
93
+ back in --json as "page".
94
+
95
+ diff compares two Markdown files (from --markdown) a passage at a time,
96
+ printing what diff -u prints, or two PNGs pixel by pixel, writing the newer
97
+ one with the changed regions outlined (--out, or <new>.diff.png). A PDF is
98
+ compared by the .md beside it. It exits 0 when nothing changed and 1 when
99
+ something did, the way diff does.
100
+
101
+ verify checks a file's SHA-256 against the record the extension wrote
102
+ beside it (<file>.integrity.json unless --record names another) and, when
103
+ the record is signed, the signature. It exits 0 when both hold and 1 when
104
+ either does not. It says nothing about the time, which is the capturing
105
+ computer's clock.
106
+
62
107
  --browser takes a browserId or a label, matched without regard to case, and
63
108
  is needed only when more than one browser is connected. --wait 0 means do
64
109
  not wait at all. --json prints one JSON document on stdout, on success and
@@ -249,7 +294,10 @@ function parseScan(argv) {
249
294
  allowPositionals: false,
250
295
  options: {
251
296
  help: { type: 'boolean', short: 'h' },
252
- url: { type: 'string' },
297
+ url: { type: 'string', multiple: true },
298
+ urls: { type: 'string' },
299
+ name: { type: 'string' },
300
+ markdown: { type: 'string' },
253
301
  tab: { type: 'string' },
254
302
  window: { type: 'string' },
255
303
  browser: { type: 'string' },
@@ -257,6 +305,8 @@ function parseScan(argv) {
257
305
  'page-size': { type: 'string' },
258
306
  quality: { type: 'string' },
259
307
  video: { type: 'string' },
308
+ scheme: { type: 'string' },
309
+ 'page-width': { type: 'string' },
260
310
  'open-editor': { type: 'boolean' },
261
311
  out: { type: 'string' },
262
312
  wait: { type: 'string' },
@@ -269,15 +319,25 @@ function parseScan(argv) {
269
319
  // Exactly one target. Neither leaves nothing to scan; both would make the
270
320
  // extension choose, and the two mean different things (open a tab, or use
271
321
  // the one already open).
272
- if (values.url === undefined && values.tab === undefined) {
273
- throw badRequest('scan needs a page to capture: give --url <address> or --tab <id>.', 'Run `page-scanner tabs` to see the tabs that are open.');
322
+ const urls = (values.url ?? []).map((url) => requireText('--url', url));
323
+ const urlsFile = optionalText('--urls', values.urls);
324
+ if (urls.length === 0 && urlsFile === undefined && values.tab === undefined) {
325
+ throw badRequest('scan needs a page to capture: give --url <address>, --urls <file> or --tab <id>.', 'Run `page-scanner tabs` to see the tabs that are open.');
326
+ }
327
+ if ((urls.length > 0 || urlsFile !== undefined) && values.tab !== undefined) {
328
+ throw badRequest('scan takes --url or --urls, or --tab, not both.');
274
329
  }
275
- if (values.url !== undefined && values.tab !== undefined) {
276
- throw badRequest('scan takes --url or --tab, not both.');
330
+ const batch = urls.length > 1 || urlsFile !== undefined;
331
+ if (batch && values['open-editor'] === true) {
332
+ throw badRequest('--open-editor opens a tab for each page, so it is not for a list.');
277
333
  }
278
334
  return {
279
335
  command: 'scan',
280
- url: optionalText('--url', values.url),
336
+ ...(batch ? { urls, ...(urlsFile !== undefined ? { urlsFile } : {}) } : { url: urls[0] }),
337
+ name: optionalText('--name', values.name),
338
+ markdown: values.markdown === undefined
339
+ ? undefined
340
+ : requireEnum('--markdown', values.markdown, ['beside', 'only']),
281
341
  tabId: optionalInteger('--tab', values.tab),
282
342
  windowId: optionalInteger('--window', values.window),
283
343
  browser: optionalText('--browser', values.browser),
@@ -293,6 +353,12 @@ function parseScan(argv) {
293
353
  videoHandling: values.video === undefined
294
354
  ? undefined
295
355
  : requireEnum('--video', values.video, VIDEO_HANDLINGS),
356
+ colorScheme: values.scheme === undefined
357
+ ? undefined
358
+ : requireEnum('--scheme', values.scheme, COLOR_SCHEME_PREFERENCES),
359
+ captureWidth: values['page-width'] === undefined
360
+ ? undefined
361
+ : requireEnum('--page-width', values['page-width'], CAPTURE_WIDTHS),
296
362
  openEditor: values['open-editor'] === true,
297
363
  out: optionalText('--out', values.out),
298
364
  waitSeconds: values.wait === undefined ? SCAN_WAIT_SECONDS : requireSeconds('--wait', values.wait),
@@ -302,6 +368,55 @@ function parseScan(argv) {
302
368
  json: values.json === true,
303
369
  };
304
370
  }
371
+ function parseDiff(argv) {
372
+ const { values, positionals } = readOptions(() => parseNodeArgs({
373
+ args: argv,
374
+ strict: true,
375
+ allowPositionals: true,
376
+ options: {
377
+ help: { type: 'boolean', short: 'h' },
378
+ out: { type: 'string' },
379
+ json: { type: 'boolean' },
380
+ },
381
+ }));
382
+ if (wantsHelp(values))
383
+ return { command: 'help' };
384
+ const [older, newer, ...rest] = positionals;
385
+ if (older === undefined || newer === undefined || rest.length > 0) {
386
+ throw badRequest(`diff takes two captures, the older and the newer (got ${positionals.length}).`, 'For example: page-scanner diff monday/pricing.md tuesday/pricing.md');
387
+ }
388
+ return {
389
+ command: 'diff',
390
+ old: requireText('<old>', older),
391
+ new: requireText('<new>', newer),
392
+ out: optionalText('--out', values.out),
393
+ json: values.json === true,
394
+ };
395
+ }
396
+ function parseVerify(argv) {
397
+ const { values, positionals } = readOptions(() => parseNodeArgs({
398
+ args: argv,
399
+ strict: true,
400
+ allowPositionals: true,
401
+ options: {
402
+ help: { type: 'boolean', short: 'h' },
403
+ record: { type: 'string' },
404
+ json: { type: 'boolean' },
405
+ },
406
+ }));
407
+ if (wantsHelp(values))
408
+ return { command: 'help' };
409
+ const [file, ...rest] = positionals;
410
+ if (file === undefined || rest.length > 0) {
411
+ throw badRequest(`verify takes one file (got ${positionals.length}).`, 'For example: page-scanner verify terms.pdf');
412
+ }
413
+ return {
414
+ command: 'verify',
415
+ file: requireText('<file>', file),
416
+ record: optionalText('--record', values.record),
417
+ json: values.json === true,
418
+ };
419
+ }
305
420
  function parseServe(argv) {
306
421
  const { values } = readOptions(() => parseNodeArgs({
307
422
  args: argv,
@@ -375,6 +490,10 @@ export function parseArgs(argv) {
375
490
  return parseTabs(rest);
376
491
  case 'scan':
377
492
  return parseScan(rest);
493
+ case 'diff':
494
+ return parseDiff(rest);
495
+ case 'verify':
496
+ return parseVerify(rest);
378
497
  case 'serve':
379
498
  return parseServe(rest);
380
499
  case 'stop':
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,iB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K,CAAC,qBAAqB,iBAAiB,GAAG,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,OAAO;YACV,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,KAAK,MAAM;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAC7B,KAAK,SAAS;YACZ,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAClC,CAAC;AACH,CAAC"}
@@ -2,6 +2,8 @@ import type { ParsedArgs } from './args.js';
2
2
  export interface CommandIo {
3
3
  stdout: (text: string) => void;
4
4
  stderr: (text: string) => void;
5
+ /** Standard input, all of it, for `--urls -`. Read only when asked for. */
6
+ stdin?: () => string;
5
7
  }
6
8
  /** Runs one parsed command and returns the process exit code. */
7
9
  export declare function runCommand(parsed: ParsedArgs, io: CommandIo): Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAsFD,iEAAiE;AACjE,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAkJnF"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,WAAW,CAAC;AAItD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACtB;AAkQD,iEAAiE;AACjE,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CA4JnF"}
@@ -13,8 +13,13 @@
13
13
  * parse prose.
14
14
  * - The pairing token is printed by `pair`, on stdout, and nowhere else ever.
15
15
  */
16
- import { listBrowsers, listTabs, pair, scan, status, stop, waitForBrowser, } from '../api.js';
17
- import { CONNECT_HINT, PAIR_COMMAND, exitCodeFor, toPageScannerError } from '../errors.js';
16
+ import { readFileSync } from 'node:fs';
17
+ import { resolve } from 'node:path';
18
+ import { listBrowsers, listTabs, pair, scan, scanMany, checkBatch, checkOutput, status, stop, waitForBrowser, } from '../api.js';
19
+ import { CONNECT_HINT, PAIR_COMMAND, PageScannerError, exitCodeFor, toPageScannerError, } from '../errors.js';
20
+ import { readUrlList } from '../batch.js';
21
+ import { diffCaptures } from '../diff/index.js';
22
+ import { verifyCapture } from '../verify.js';
18
23
  import { formatBrowsers, formatDuration, formatTabs, formatTruncation } from './format.js';
19
24
  import { USAGE } from './args.js';
20
25
  import { CLI_VERSION } from '../version.js';
@@ -52,9 +57,22 @@ function reportScan(io, result, format, useJson) {
52
57
  json(io, { ok: true, ...result });
53
58
  return;
54
59
  }
60
+ notesFor(io, result, format);
61
+ printPaths(io, result);
62
+ }
63
+ /** The file, then the Markdown beside it when there is one: one path to a line. */
64
+ function printPaths(io, result) {
65
+ line(io, result.path);
66
+ const markdown = result.page?.markdownPath;
67
+ if (markdown && markdown !== result.path)
68
+ line(io, markdown);
69
+ }
70
+ /** What a person should know about a capture beyond where it went. */
71
+ function notesFor(io, result, format) {
55
72
  if (result.truncated)
56
73
  note(io, formatTruncation(result.truncated));
57
- if (result.mode === 'raster') {
74
+ // Nothing to say about how the picture was made when only the text was written.
75
+ if (result.mode === 'raster' && result.page?.markdownPath !== result.path) {
58
76
  // Worth saying for a PDF, where it is the difference between a document
59
77
  // and a picture of one. For a PNG or a JPEG the output is an image
60
78
  // either way, and the only thing that changed is how it was assembled.
@@ -63,7 +81,147 @@ function reportScan(io, result, format, useJson) {
63
81
  "PDF's text is an image, not text."
64
82
  : 'Chrome would not attach its debugger, so this was stitched from screenshots.');
65
83
  }
66
- line(io, result.path);
84
+ }
85
+ /** The addresses of a batch: every --url, then the list file's. */
86
+ function batchUrls(parsed, io) {
87
+ const urls = [...(parsed.urls ?? [])];
88
+ if (parsed.urlsFile !== undefined) {
89
+ let text;
90
+ try {
91
+ text =
92
+ parsed.urlsFile === '-'
93
+ ? (io.stdin ?? (() => readFileSync(0, 'utf8')))()
94
+ : readFileSync(resolve(parsed.urlsFile), 'utf8');
95
+ }
96
+ catch (error) {
97
+ throw new PageScannerError('BAD_REQUEST', `--urls could not read ${JSON.stringify(parsed.urlsFile)}: ${error instanceof Error ? error.message : String(error)}`);
98
+ }
99
+ urls.push(...readUrlList(text));
100
+ }
101
+ return urls;
102
+ }
103
+ /**
104
+ * A batch as it goes: each path on stdout the moment it is written, each
105
+ * failure on stderr, and a count at the end. `--json` is one document at the
106
+ * end instead. Exit 1 when any page failed, and the ending failure's own code
107
+ * when one stopped the run.
108
+ */
109
+ async function runBatch(parsed, io) {
110
+ const urls = batchUrls(parsed, io);
111
+ checkBatch(urls, scanOptionsOf(parsed));
112
+ await warnIfWaiting(io, parsed.waitSeconds, parsed.json);
113
+ const result = await scanMany(urls, {
114
+ ...scanOptionsOf(parsed),
115
+ onItem: (item) => {
116
+ if (parsed.json)
117
+ return;
118
+ if (item.ok) {
119
+ notesFor(io, item, parsed.format);
120
+ printPaths(io, item);
121
+ }
122
+ else {
123
+ note(io, `Failed: ${item.url}: ${item.error.message}`);
124
+ }
125
+ },
126
+ });
127
+ const stoppedCode = result.stopped ? exitCodeFor(result.stopped.code) : 0;
128
+ const code = stoppedCode || (result.failed > 0 ? 1 : 0);
129
+ if (parsed.json) {
130
+ json(io, { ok: code === 0, count: urls.length, ...result });
131
+ return code;
132
+ }
133
+ if (result.stopped) {
134
+ note(io, result.stopped.message);
135
+ if (result.stopped.hint)
136
+ note(io, result.stopped.hint);
137
+ }
138
+ const tried = result.results.length;
139
+ note(io, `Wrote ${result.written} of ${urls.length}` +
140
+ (result.failed > 0 ? `; ${result.failed} failed` : '') +
141
+ (result.stopped ? `; stopped with ${urls.length - tried} left` : '') +
142
+ '.');
143
+ return code;
144
+ }
145
+ /**
146
+ * What changed, on the two streams: the diff itself (or the outlined
147
+ * picture's path) on stdout, a one-line count on stderr. Exit 1 when
148
+ * something changed, as diff(1) does, so a scheduled job can branch on it.
149
+ */
150
+ function reportDiff(io, result, useJson) {
151
+ const code = result.changed ? 1 : 0;
152
+ if (useJson) {
153
+ json(io, { ok: true, ...result });
154
+ return code;
155
+ }
156
+ if (result.kind === 'text') {
157
+ if (result.sameAddress === false) {
158
+ note(io, `These are two different pages: ${result.old.source} and ${result.new.source}.`);
159
+ }
160
+ if (!result.changed) {
161
+ note(io, 'No change in the text.');
162
+ return code;
163
+ }
164
+ line(io, result.unified);
165
+ note(io, `${result.added} ${result.added === 1 ? 'line' : 'lines'} added, ` +
166
+ `${result.removed} removed.`);
167
+ return code;
168
+ }
169
+ if (!result.changed) {
170
+ note(io, 'No change in the picture.');
171
+ return code;
172
+ }
173
+ if (result.path)
174
+ line(io, result.path);
175
+ const percent = result.changedFraction * 100;
176
+ note(io, `${result.regions.length} ${result.regions.length === 1 ? 'region' : 'regions'} changed, ` +
177
+ `${percent < 0.1 ? '<0.1' : percent.toFixed(1)}% of the picture.` +
178
+ (result.old.width !== result.new.width || result.old.height !== result.new.height
179
+ ? ` The captures are ${result.old.width}x${result.old.height} and ` +
180
+ `${result.new.width}x${result.new.height} px.`
181
+ : ''));
182
+ return code;
183
+ }
184
+ /** What `verify` found, a line per question, on stdout; exit 1 when either answer is no. */
185
+ function reportVerify(io, result, useJson) {
186
+ const code = result.verified ? 0 : 1;
187
+ if (useJson) {
188
+ json(io, { ok: true, ...result });
189
+ return code;
190
+ }
191
+ line(io, result.file.matches
192
+ ? `The file matches its record: SHA-256 ${result.file.sha256}, ${result.file.bytes} bytes.`
193
+ : `The file does not match its record: SHA-256 ${result.file.sha256}, ${result.file.bytes} bytes, ` +
194
+ `where the record has ${result.record.expectedSha256}, ${result.record.expectedBytes} bytes.`);
195
+ if (result.signature === null)
196
+ line(io, 'The record is not signed.');
197
+ else if (result.signature.valid) {
198
+ line(io, `Signed by the key ${result.signature.keyThumbprint}, and the signature holds.`);
199
+ }
200
+ else
201
+ line(io, 'The record’s signature does not hold: the record was changed after it was signed.');
202
+ if (result.record.captured || result.record.url) {
203
+ line(io, `It records ${result.record.url ?? 'no address'}, captured ${result.record.captured ?? 'at no stated time'} ` +
204
+ 'by the capturing computer’s clock, which nothing here can confirm.');
205
+ }
206
+ return code;
207
+ }
208
+ function scanOptionsOf(parsed) {
209
+ return {
210
+ ...(parsed.windowId !== undefined ? { windowId: parsed.windowId } : {}),
211
+ ...(parsed.browser !== undefined ? { browser: parsed.browser } : {}),
212
+ ...(parsed.quality !== undefined ? { quality: parsed.quality } : {}),
213
+ ...(parsed.videoHandling !== undefined ? { videoHandling: parsed.videoHandling } : {}),
214
+ ...(parsed.colorScheme !== undefined ? { colorScheme: parsed.colorScheme } : {}),
215
+ ...(parsed.captureWidth !== undefined ? { captureWidth: parsed.captureWidth } : {}),
216
+ ...(parsed.out !== undefined ? { out: parsed.out } : {}),
217
+ ...(parsed.name !== undefined ? { name: parsed.name } : {}),
218
+ ...(parsed.markdown !== undefined ? { markdown: parsed.markdown } : {}),
219
+ format: parsed.format,
220
+ pageSize: parsed.pageSize,
221
+ openEditor: parsed.openEditor,
222
+ waitSeconds: parsed.waitSeconds,
223
+ timeoutSeconds: parsed.timeoutSeconds,
224
+ };
67
225
  }
68
226
  function reportStatus(io, report, useJson) {
69
227
  if (useJson) {
@@ -175,24 +333,22 @@ export async function runCommand(parsed, io) {
175
333
  return 0;
176
334
  }
177
335
  case 'scan': {
336
+ if (parsed.urls !== undefined)
337
+ return await runBatch(parsed, io);
338
+ checkOutput(scanOptionsOf(parsed), 1);
178
339
  await warnIfWaiting(io, parsed.waitSeconds, parsed.json);
179
340
  const result = await scan({
180
341
  ...(parsed.url !== undefined ? { url: parsed.url } : {}),
181
342
  ...(parsed.tabId !== undefined ? { tabId: parsed.tabId } : {}),
182
- ...(parsed.windowId !== undefined ? { windowId: parsed.windowId } : {}),
183
- ...(parsed.browser !== undefined ? { browser: parsed.browser } : {}),
184
- ...(parsed.quality !== undefined ? { quality: parsed.quality } : {}),
185
- ...(parsed.videoHandling !== undefined ? { videoHandling: parsed.videoHandling } : {}),
186
- ...(parsed.out !== undefined ? { out: parsed.out } : {}),
187
- format: parsed.format,
188
- pageSize: parsed.pageSize,
189
- openEditor: parsed.openEditor,
190
- waitSeconds: parsed.waitSeconds,
191
- timeoutSeconds: parsed.timeoutSeconds,
343
+ ...scanOptionsOf(parsed),
192
344
  });
193
345
  reportScan(io, result, parsed.format, parsed.json);
194
346
  return 0;
195
347
  }
348
+ case 'diff':
349
+ return reportDiff(io, diffCaptures(parsed.old, parsed.new, parsed.out !== undefined ? { out: parsed.out } : {}), parsed.json);
350
+ case 'verify':
351
+ return reportVerify(io, await verifyCapture(parsed.file, parsed.record !== undefined ? { record: parsed.record } : {}), parsed.json);
196
352
  case 'stop': {
197
353
  const wasRunning = await stop();
198
354
  if (parsed.json)