@design.estate/wcctools 6.1.0 → 7.0.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 (112) hide show
  1. package/changelog.md +41 -0
  2. package/dist_shell/bundle.js +405 -368
  3. package/dist_shell/bundle.js.map +1 -1
  4. package/dist_shell/bundle.js.third-party-notices.json +52 -0
  5. package/dist_shell/bundle.js.third-party-notices.txt +107 -1
  6. package/dist_shell/index.html +1 -1
  7. package/dist_ts/00_commitinfo_data.js +1 -1
  8. package/dist_ts/capture/classes.capturebrowser.d.ts +65 -0
  9. package/dist_ts/capture/classes.capturebrowser.js +251 -0
  10. package/dist_ts/capture/classes.captureservice.d.ts +39 -0
  11. package/dist_ts/capture/classes.captureservice.js +119 -0
  12. package/dist_ts/capture/classes.screencast.d.ts +47 -0
  13. package/dist_ts/capture/classes.screencast.js +127 -0
  14. package/dist_ts/capture/errors.d.ts +14 -0
  15. package/dist_ts/capture/errors.js +23 -0
  16. package/dist_ts/capture/images.d.ts +3 -0
  17. package/dist_ts/capture/images.js +58 -0
  18. package/dist_ts/capture/index.d.ts +4 -0
  19. package/dist_ts/capture/index.js +5 -0
  20. package/dist_ts/capture/interaction.d.ts +11 -0
  21. package/dist_ts/capture/interaction.js +138 -0
  22. package/dist_ts/capture/navigationguard.d.ts +44 -0
  23. package/dist_ts/capture/navigationguard.js +129 -0
  24. package/dist_ts/capture/previewpage.d.ts +29 -0
  25. package/dist_ts/capture/previewpage.js +96 -0
  26. package/dist_ts/capture/request.d.ts +69 -0
  27. package/dist_ts/capture/request.js +239 -0
  28. package/dist_ts/classes.bundlestatus.d.ts +36 -0
  29. package/dist_ts/classes.bundlestatus.js +110 -0
  30. package/dist_ts/classes.devapi.d.ts +3 -0
  31. package/dist_ts/classes.devapi.js +8 -1
  32. package/dist_ts/classes.devserver.d.ts +65 -14
  33. package/dist_ts/classes.devserver.js +157 -52
  34. package/dist_ts/classes.hostpolicy.d.ts +63 -0
  35. package/dist_ts/classes.hostpolicy.js +171 -0
  36. package/dist_ts/cli.js +28 -3
  37. package/dist_ts/cli.screenshot.d.ts +6 -0
  38. package/dist_ts/cli.screenshot.js +89 -0
  39. package/dist_ts/index.d.ts +0 -2
  40. package/dist_ts/index.js +1 -3
  41. package/dist_ts/plugins.d.ts +6 -2
  42. package/dist_ts/plugins.js +8 -3
  43. package/dist_ts_interfaces/capture.d.ts +151 -0
  44. package/dist_ts_interfaces/capture.js +2 -0
  45. package/dist_ts_interfaces/index.d.ts +1 -0
  46. package/dist_ts_interfaces/index.js +2 -1
  47. package/dist_ts_interfaces/requests.d.ts +59 -0
  48. package/dist_ts_shell/bundlestatus.d.ts +15 -0
  49. package/dist_ts_shell/bundlestatus.js +64 -0
  50. package/dist_ts_shell/elements/wcc-contextmenu.d.ts +3 -0
  51. package/dist_ts_shell/elements/wcc-contextmenu.js +18 -3
  52. package/dist_ts_shell/elements/wcc-preview-frame.d.ts +6 -0
  53. package/dist_ts_shell/elements/wcc-preview-frame.js +50 -2
  54. package/dist_ts_shell/elements/wcc-recording-panel.d.ts +9 -0
  55. package/dist_ts_shell/elements/wcc-recording-panel.js +12 -1
  56. package/dist_ts_shell/elements/wcc-shell.d.ts +15 -0
  57. package/dist_ts_shell/elements/wcc-shell.js +45 -3
  58. package/dist_ts_shell/plugins.d.ts +2 -1
  59. package/dist_ts_shell/plugins.js +3 -2
  60. package/dist_ts_shell/services/framesampler.service.d.ts +23 -0
  61. package/dist_ts_shell/services/framesampler.service.js +101 -0
  62. package/dist_ts_web/00_commitinfo_data.js +1 -1
  63. package/package.json +6 -2
  64. package/readme.md +108 -6
  65. package/ts/00_commitinfo_data.ts +1 -1
  66. package/ts/capture/classes.capturebrowser.ts +290 -0
  67. package/ts/capture/classes.captureservice.ts +152 -0
  68. package/ts/capture/classes.screencast.ts +152 -0
  69. package/ts/capture/errors.ts +25 -0
  70. package/ts/capture/images.ts +61 -0
  71. package/ts/capture/index.ts +4 -0
  72. package/ts/capture/interaction.ts +146 -0
  73. package/ts/capture/navigationguard.ts +147 -0
  74. package/ts/capture/previewpage.ts +130 -0
  75. package/ts/capture/request.ts +304 -0
  76. package/ts/classes.bundlestatus.ts +123 -0
  77. package/ts/classes.devapi.ts +9 -0
  78. package/ts/classes.devserver.ts +172 -50
  79. package/ts/classes.hostpolicy.ts +201 -0
  80. package/ts/cli.screenshot.ts +95 -0
  81. package/ts/cli.ts +28 -2
  82. package/ts/index.ts +0 -2
  83. package/ts/plugins.ts +9 -2
  84. package/ts_interfaces/bridge.ts +95 -0
  85. package/ts_interfaces/capture.ts +144 -0
  86. package/ts_interfaces/catalog.ts +37 -0
  87. package/ts_interfaces/index.ts +5 -0
  88. package/ts_interfaces/plugins.ts +3 -0
  89. package/ts_interfaces/requests.ts +104 -0
  90. package/ts_interfaces/standard.ts +103 -0
  91. package/ts_shared/index.ts +1 -0
  92. package/ts_shared/plugins.ts +3 -0
  93. package/ts_shared/previewroute.ts +58 -0
  94. package/ts_shell/bundlestatus.ts +68 -0
  95. package/ts_shell/elements/wcc-contextmenu.ts +306 -0
  96. package/ts_shell/elements/wcc-preview-frame.ts +167 -0
  97. package/ts_shell/elements/wcc-properties.ts +998 -0
  98. package/ts_shell/elements/wcc-record-button.ts +108 -0
  99. package/ts_shell/elements/wcc-recording-panel.ts +1017 -0
  100. package/ts_shell/elements/wcc-shell.ts +485 -0
  101. package/ts_shell/elements/wcc-sidebar.ts +1419 -0
  102. package/ts_shell/index.html +21 -0
  103. package/ts_shell/index.ts +4 -0
  104. package/ts_shell/plugins.ts +12 -0
  105. package/ts_shell/previewconnection.ts +103 -0
  106. package/ts_shell/services/framesampler.service.ts +112 -0
  107. package/ts_shell/services/recorder.service.ts +451 -0
  108. package/ts_shell/types/dom-mediacapture-stub/index.d.ts +12 -0
  109. package/ts_shell/types/dom-mediacapture-stub/package.json +6 -0
  110. package/ts_shell/types/dom-webcodecs-stub/index.d.ts +2 -0
  111. package/ts_shell/types/dom-webcodecs-stub/package.json +6 -0
  112. package/ts_web/00_commitinfo_data.ts +1 -1
package/changelog.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-10-06 - 7.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - `wcctools dev` listens on `127.0.0.1` by default instead of every interface. `--host <address>` (`0.0.0.0` or `::` for every interface) exposes it; `WccDevServer` takes the same as its `host` option.
8
+ - The dev server answers only the hosts it serves: `localhost`, `127.0.0.1`, `::1`, the listen address (with a wildcard listen address, every address of the machine's interfaces) and the names given with `--allowed-host` (repeatable; option `allowedHosts`). Requests and WebSocket upgrades for any other `Host` are refused with `403` and a message naming the `--allowed-host` to add.
9
+ - Typed requests and every other request but `GET`, `HEAD` and `OPTIONS`, and WebSocket connections (shell and preview), are admitted only from the server's own origin (`http://<allowed host>:<port>`); a request without an `Origin` header only from a loopback connection.
10
+ - The preview surface no longer sends CORS headers (`Access-Control-Allow-Origin: *`): other origins can no longer read the catalogue bundle.
11
+ - Because of that origin rule, the shell no longer works through a TLS-terminating reverse proxy, even for an `--allowed-host` name: its typed requests and WebSocket connections carry an `https:` origin and are refused. Reach the dev server over plain HTTP on its own port (for example through an SSH tunnel).
12
+
13
+ ### Features
14
+
15
+ - `wcctools screenshot <item | section/item> --out <file.png|.jpg>` screenshots one demo in a headless Chrome: it bundles the catalogue, serves it on a free loopback port, renders the demo alone on the preview route at a named width (`phone` 400, `phablet` 600, `tablet` 1024, `desktop` 1600, from the dees-domtools breakpoints) or a width in pixels, a height, a theme and a scale, frames the rendered element, the viewport or the whole page, writes the image and stops. It waits only on the preview's own signals (the bridge, the render's completed updates, the fonts), never for a fixed time. `--demo` counts from 0.
16
+ - The dev server's typed API takes captures: `captureScreenshot` (`IReq_CaptureScreenshot`) and `captureInteraction` (`IReq_CaptureInteraction`), which runs scripted steps (`click`, `hover`, `fill`, `press`, `waitFor`, `wait`; selectors pierce open shadow roots) on a rendered demo while recording its screencast and answers per-step results and at most `maxFrames` timestamped JPEG frames, optionally a final screenshot. One headless browser per dev server starts with the first capture, closes after a minute without one and closes with the server; two captures run at once, eight wait, more are refused as busy; every capture has a deadline (30 s for a screenshot, 135 s for an interaction; fire interactions with a matching `timeoutMs`, since `TypedRequest.fire()` gives up after 60 s by default), ends when its client goes away, waits while a bundle builds and is refused while one failed. A capture stays on the preview route: navigations that would replace the preview document (links, form submissions, `location` assignments, reloads, `about:blank` and `blob:` URLs) are cancelled as they start, with request interception as a backstop, and the step that started one fails with `navigation to <url> blocked`. Not covered: `javascript:` URLs that evaluate to a string, and demos that route by `intercept()`-ing cross-document navigations (see Known Limitations). The browser leaves process signals to the application, so `Ctrl+C` stops the server and closes the browser once.
17
+ - The shell samples timestamped JPEG frames from a recording (`sampleVideoFrames` with mediabunny: count, range, maximum width, quality), and its recording panel hands out the finished recording with its trim range (`getRecording()`), for the coming assistant.
18
+ - `@design.estate/wcctools/interfaces` exports the capture contracts (`IWccScreenshotRequest`, `IWccInteractionRequest`, `TWccInteractionStep`, `IWccImage`, `IWccTimedFrame`, …).
19
+
20
+ ### Maintenance
21
+
22
+ - New dependency `@push.rocks/smartbrowser` ^5.1.0 (Puppeteer through its `/automation` entry).
23
+
24
+ ## 2026-10-06 - 6.2.0
25
+
26
+ ### Features
27
+
28
+ - The dev server serves the project directory it is given (`cwd`) instead of reading the process's working directory: tswatch resolves the configuration, bundles, watchers and serve directory against it. `wcctools dev` passes its working directory.
29
+ - The shell shows the catalog's bundle status: a failed bundle shows `bundle failed` with the bundler's message over the preview instead of an endlessly loading preview, and clears when the next run of that bundle finishes. The status (per bundle `started`/`finished`/`failed`, duration, error message) is the typed request `getBundleStatus` (`IReq_GetBundleStatus` in `@design.estate/wcctools/interfaces`), answered when the status changes; a request whose client goes away ends its wait at once, and a server that is stopping refuses the request with a typed error, so the shell backs off instead of asking again at once.
30
+
31
+ ### Fixes
32
+
33
+ - `wcctools dev` installs the process lifecycle itself (smartexit's `ProcessLifecycle`, with tswatch's shutdown deadline), so `SIGINT` and `SIGTERM` stop the server and the watchers once.
34
+ - The dev server registers its shutdown cleanup when it starts and releases it, its bundle-event subscription and everything tswatch registered when it stops: a constructed server registers nothing, a server started again after `stop()` is stopped by a process shutdown again, concurrent `stop()` calls share one stop, and `start()` is refused while the server runs or stops.
35
+ - A shell context menu removed before its listener frame ran no longer leaves its `click`, `contextmenu` and `keydown` listeners on the document.
36
+ - The package entry `dist_ts/index.js` exports only `runCli`; the dev server and API classes were not reachable through any package export.
37
+ - The published package includes `ts_interfaces`, `ts_shared` and `ts_shell`, the sources the shipped source maps point at.
38
+
39
+ ### Maintenance
40
+
41
+ - `@git.zone/tswatch` ^7.0.0: the dev server runs tswatch with an explicit project directory, falls back to the `element` preset explicitly when the configuration has no tswatch block, and no longer relies on tswatch for process signal handling.
42
+ - The lockfile takes `@push.rocks/smartspawn` 3.0.5, whose lazy `threads` loading leaves `SIGINT`/`SIGTERM` to the CLI.
43
+
3
44
  ## 2026-10-06 - 6.1.0
4
45
 
5
46
  ### Features