effect-browser 0.3.0-beta.24 → 0.3.0-beta.25
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 +333 -157
- package/dist/Action.d.mts +1 -1
- package/dist/Action.mjs +61 -9
- package/dist/Action.mjs.map +1 -1
- package/dist/Browser.d.mts +2 -2
- package/dist/Browser.mjs +2 -2
- package/dist/BrowserError.d.mts +2 -2
- package/dist/BrowserError.mjs +194 -41
- package/dist/BrowserError.mjs.map +1 -1
- package/dist/BrowserEvent.d.mts +1 -1
- package/dist/BrowserEvent.mjs +166 -35
- package/dist/BrowserEvent.mjs.map +1 -1
- package/dist/Cdp.d.mts +15 -0
- package/dist/Cdp.mjs +22 -0
- package/dist/Cdp.mjs.map +1 -0
- package/dist/Change.d.mts +2 -2
- package/dist/Change.mjs +33 -6
- package/dist/Change.mjs.map +1 -1
- package/dist/Frame.d.mts +2 -2
- package/dist/Frame.mjs +132 -14
- package/dist/Frame.mjs.map +1 -1
- package/dist/{Style.d.mts → InputStyle.d.mts} +93 -25
- package/dist/{Style.mjs → InputStyle.mjs} +1 -1
- package/dist/Layout.d.mts +2 -2
- package/dist/Layout.mjs +58 -16
- package/dist/Layout.mjs.map +1 -1
- package/dist/Overlay.d.mts +2 -2
- package/dist/Overlay.mjs +33 -5
- package/dist/Overlay.mjs.map +1 -1
- package/dist/Page.d.mts +2 -2
- package/dist/Page.mjs +2 -2
- package/dist/PageTime.d.mts +2 -2
- package/dist/PageTime.mjs +13 -3
- package/dist/PageTime.mjs.map +1 -1
- package/dist/Pose.d.mts +2 -2
- package/dist/Pose.mjs +30 -9
- package/dist/Pose.mjs.map +1 -1
- package/dist/Site.d.mts +288 -18
- package/dist/Site.mjs +11 -3
- package/dist/Site.mjs.map +1 -1
- package/dist/Snapshot.d.mts +2 -2
- package/dist/Snapshot.mjs +87 -6
- package/dist/Snapshot.mjs.map +1 -1
- package/dist/Text.d.mts +2 -0
- package/dist/Text.mjs +45 -0
- package/dist/Text.mjs.map +1 -0
- package/dist/Window.d.mts +2 -2
- package/dist/Window.mjs +31 -6
- package/dist/Window.mjs.map +1 -1
- package/dist/ai/BrowserTools.d.mts +4987 -0
- package/dist/ai/BrowserTools.mjs +3 -0
- package/dist/ai/PageControl.d.mts +286 -0
- package/dist/ai/PageControl.mjs +426 -0
- package/dist/ai/PageControl.mjs.map +1 -0
- package/dist/ai/PromptCache.d.mts +16 -0
- package/dist/ai/PromptCache.mjs +72 -0
- package/dist/ai/PromptCache.mjs.map +1 -0
- package/dist/ai/Tabs.d.mts +2 -0
- package/dist/ai/Tabs.mjs +72 -0
- package/dist/ai/Tabs.mjs.map +1 -0
- package/dist/ai/ToolError.d.mts +34 -0
- package/dist/ai/ToolError.mjs +2 -0
- package/dist/ai/index.d.mts +6 -0
- package/dist/ai/index.mjs +6 -0
- package/dist/index.d.mts +7 -18
- package/dist/index.mjs +6 -9
- package/dist/{Action-24sLOubi.d.mts → internal/Action-CkanNTUw.d.mts} +64 -4
- package/dist/{Browser-DGR6ZEYo.d.mts → internal/Browser-DD9Vm1c-.d.mts} +75 -11
- package/dist/{Browser-CAQFhTkM.mjs → internal/Browser-vzD7i2oj.mjs} +174 -237
- package/dist/internal/Browser-vzD7i2oj.mjs.map +1 -0
- package/dist/{BrowserError-BlcmLVzn.d.mts → internal/BrowserError-CsuRYcDX.d.mts} +187 -28
- package/dist/{BrowserEvent-C2p-NwuU.d.mts → internal/BrowserEvent-tGPYYf6R.d.mts} +168 -13
- package/dist/internal/BrowserTools-Yi3lOX4h.mjs +497 -0
- package/dist/internal/BrowserTools-Yi3lOX4h.mjs.map +1 -0
- package/dist/{Style-T3ezDYLI.mjs → internal/InputStyle-CPzxoN4g.mjs} +75 -20
- package/dist/internal/InputStyle-CPzxoN4g.mjs.map +1 -0
- package/dist/{moment/Moment.mjs → internal/Moment-CstaX1mR.mjs} +49 -16
- package/dist/internal/Moment-CstaX1mR.mjs.map +1 -0
- package/dist/{moment/Moment.d.mts → internal/Moment-DOcldBdf.d.mts} +53 -20
- package/dist/internal/Page-BfGxn7oN.d.mts +1553 -0
- package/dist/{Page-BaAOshxo.mjs → internal/Page-DqF-tuTx.mjs} +62 -74
- package/dist/internal/Page-DqF-tuTx.mjs.map +1 -0
- package/dist/internal/Release-CFONkPDP.d.mts +39 -0
- package/dist/internal/Stage-D5ymSXDT.mjs +298 -0
- package/dist/internal/Stage-D5ymSXDT.mjs.map +1 -0
- package/dist/internal/Stillness-DCPeAN1a.mjs +1124 -0
- package/dist/internal/Stillness-DCPeAN1a.mjs.map +1 -0
- package/dist/internal/Supervisor-BcY_QNIY.d.mts +108 -0
- package/dist/internal/Supervisor-BcglY23c.mjs +531 -0
- package/dist/internal/Supervisor-BcglY23c.mjs.map +1 -0
- package/dist/internal/Tabs-dXMscIUQ.d.mts +52 -0
- package/dist/internal/TestPage-CYiYbh63.d.mts +159 -0
- package/dist/internal/ToolError-DArsRS2m.mjs +117 -0
- package/dist/internal/ToolError-DArsRS2m.mjs.map +1 -0
- package/dist/{plan/index.d.mts → internal/Walk-BNXcfZ2z.d.mts} +59 -35
- package/dist/{plan/index.mjs → internal/Walk-C5ky7uSf.mjs} +83 -51
- package/dist/internal/Walk-C5ky7uSf.mjs.map +1 -0
- package/dist/{ActionPort.mjs → internal/action-port-B5EkeGOR.mjs} +6 -12
- package/dist/internal/action-port-B5EkeGOR.mjs.map +1 -0
- package/dist/internal/cdp/workerd.d.mts +13 -0
- package/dist/internal/cdp/workerd.mjs +19 -0
- package/dist/internal/cdp/workerd.mjs.map +1 -0
- package/dist/{Clock.mjs → internal/clock-BKSAEf00.mjs} +13 -13
- package/dist/internal/clock-BKSAEf00.mjs.map +1 -0
- package/dist/{connection-Db-YtlbE.d.mts → internal/connection-BaB0vp1o.d.mts} +6 -6
- package/dist/{connection-C_jWYIwe.mjs → internal/connection-C2X4GmXM.mjs} +19 -15
- package/dist/internal/connection-C2X4GmXM.mjs.map +1 -0
- package/dist/internal/events-DzCrww-y.mjs +72 -0
- package/dist/internal/events-DzCrww-y.mjs.map +1 -0
- package/dist/internal/fold.inpage-uhrT-dOB.mjs +49 -0
- package/dist/internal/fold.inpage-uhrT-dOB.mjs.map +1 -0
- package/dist/internal/functions-jBOs6GKv.mjs +27 -0
- package/dist/internal/functions-jBOs6GKv.mjs.map +1 -0
- package/dist/{Geometry-DJx9qrYy.d.mts → internal/geometry-Dhj_ztJs.d.mts} +3 -3
- package/dist/{Geometry.mjs → internal/geometry-Lxyflb9J.mjs} +3 -12
- package/dist/internal/geometry-Lxyflb9J.mjs.map +1 -0
- package/dist/{Matching.mjs → internal/matching-Cs-UeOY0.mjs} +3 -3
- package/dist/internal/matching-Cs-UeOY0.mjs.map +1 -0
- package/dist/internal/page-DFQb-YOK.mjs +436 -0
- package/dist/internal/page-DFQb-YOK.mjs.map +1 -0
- package/dist/{pose.inpage-CLq7Mfdr.mjs → internal/pose.inpage-CBFeWcVa.mjs} +2 -48
- package/dist/internal/pose.inpage-CBFeWcVa.mjs.map +1 -0
- package/dist/{Url.mjs → internal/url-DB0pQYk6.mjs} +3 -12
- package/dist/internal/url-DB0pQYk6.mjs.map +1 -0
- package/dist/policy/Policy.d.mts +60 -6
- package/dist/policy/Policy.mjs +52 -9
- package/dist/policy/Policy.mjs.map +1 -1
- package/dist/policy/index.d.mts +2 -0
- package/dist/policy/index.mjs +2 -0
- package/dist/{film → presentation}/Film.d.mts +83 -16
- package/dist/{film → presentation}/Film.mjs +82 -30
- package/dist/presentation/Film.mjs.map +1 -0
- package/dist/presentation/Motion.d.mts +5 -1
- package/dist/presentation/Motion.mjs +16 -2
- package/dist/presentation/Motion.mjs.map +1 -1
- package/dist/presentation/Presentation.d.mts +42 -7
- package/dist/presentation/Presentation.mjs +26 -9
- package/dist/presentation/Presentation.mjs.map +1 -1
- package/dist/presentation/Stage.d.mts +40 -6
- package/dist/presentation/Stage.mjs +1 -262
- package/dist/presentation/index.d.mts +5 -0
- package/dist/presentation/index.mjs +5 -0
- package/dist/supervisor/Release.d.mts +2 -0
- package/dist/supervisor/Release.mjs +40 -0
- package/dist/supervisor/Release.mjs.map +1 -0
- package/dist/supervisor/Supervisor.d.mts +2 -104
- package/dist/supervisor/Supervisor.mjs +2 -515
- package/dist/supervisor/index.d.mts +3 -0
- package/dist/supervisor/index.mjs +3 -0
- package/dist/testing/HttpCassette.d.mts +98 -0
- package/dist/testing/HttpCassette.mjs +146 -0
- package/dist/testing/HttpCassette.mjs.map +1 -0
- package/dist/testing/Story.d.mts +31 -0
- package/dist/testing/Story.mjs +76 -0
- package/dist/testing/Story.mjs.map +1 -0
- package/dist/testing/TestBrowser.d.mts +191 -0
- package/dist/testing/TestBrowser.mjs +105 -0
- package/dist/testing/TestBrowser.mjs.map +1 -0
- package/dist/testing/TestModel.d.mts +133 -0
- package/dist/testing/TestModel.mjs +209 -0
- package/dist/testing/TestModel.mjs.map +1 -0
- package/dist/testing/TestPage.d.mts +2 -0
- package/dist/testing/TestPage.mjs +47 -0
- package/dist/testing/TestPage.mjs.map +1 -0
- package/dist/testing/index.d.mts +6 -311
- package/dist/testing/index.mjs +6 -521
- package/dist/timeline/Moment.d.mts +3 -0
- package/dist/timeline/Moment.mjs +3 -0
- package/dist/timeline/Stillness.d.mts +34 -0
- package/dist/timeline/Stillness.mjs +2 -0
- package/dist/timeline/index.d.mts +3 -0
- package/dist/timeline/index.mjs +3 -0
- package/dist/walk/Walk.d.mts +2 -0
- package/dist/walk/Walk.mjs +2 -0
- package/dist/walk/index.d.mts +2 -0
- package/dist/walk/index.mjs +2 -0
- package/package.json +54 -163
- package/src/Action.ts +73 -8
- package/src/Browser.ts +75 -9
- package/src/BrowserError.ts +258 -63
- package/src/BrowserEvent.ts +252 -55
- package/src/Cdp.ts +42 -0
- package/src/Change.ts +68 -3
- package/src/Frame.ts +247 -14
- package/src/{Style.ts → InputStyle.ts} +98 -22
- package/src/Layout.ts +95 -24
- package/src/Overlay.ts +42 -3
- package/src/Page.ts +144 -320
- package/src/PageTime.ts +29 -4
- package/src/Pose.ts +38 -7
- package/src/Site.ts +15 -3
- package/src/Snapshot.ts +179 -3
- package/src/Text.ts +60 -0
- package/src/Window.ts +53 -3
- package/src/ai/BrowserTools.ts +778 -0
- package/src/ai/PageControl.ts +702 -0
- package/src/ai/PromptCache.ts +87 -0
- package/src/ai/Tabs.ts +84 -0
- package/src/ai/ToolError.ts +50 -0
- package/src/ai/index.ts +36 -0
- package/src/ai/internal/crops.ts +38 -0
- package/src/ai/internal/points.ts +57 -0
- package/src/ai/internal/receipts.ts +107 -0
- package/src/index.ts +83 -6
- package/src/{ActionPort.ts → internal/action-port.ts} +3 -3
- package/src/{providers → internal/cdp}/connection.ts +19 -12
- package/src/internal/cdp/workerd.ts +36 -0
- package/src/{Clock.ts → internal/clock.ts} +20 -0
- package/src/internal/input/actions.ts +1 -1
- package/src/internal/input/dispatch.ts +2 -2
- package/src/internal/input/guard.inpage.ts +1 -1
- package/src/internal/input/guard.ts +1 -1
- package/src/internal/input/perform.ts +5 -5
- package/src/internal/input/pointer.ts +2 -2
- package/src/internal/input/targets.inpage.ts +3 -3
- package/src/{Matching.ts → internal/matching.ts} +6 -6
- package/src/internal/page/bridge.ts +2 -2
- package/src/internal/page/clock.inpage.ts +1 -1
- package/src/internal/page/compose.inpage.ts +2 -2
- package/src/internal/page/context.ts +2 -2
- package/src/internal/page/functions.ts +84 -0
- package/src/internal/page/navigation.ts +1 -1
- package/src/internal/page/openings.ts +2 -2
- package/src/internal/page/page.ts +33 -35
- package/src/internal/page/port.ts +14 -8
- package/src/internal/page/replies.ts +1 -1
- package/src/internal/page/requests.ts +1 -1
- package/src/internal/page/scripts.ts +1 -1
- package/src/internal/page/time.ts +1 -1
- package/src/internal/pictures/capture.ts +1 -4
- package/src/internal/pictures/dimensions.ts +1 -1
- package/src/internal/pictures/frame.ts +1 -1
- package/src/internal/pictures/pictures.ts +53 -61
- package/src/internal/reading/context.inpage.ts +2 -2
- package/src/internal/reading/expect.inpage.ts +1 -1
- package/src/internal/reading/layout.inpage.ts +3 -3
- package/src/internal/reading/layout.ts +5 -5
- package/src/internal/reading/outline.inpage.ts +3 -3
- package/src/internal/reading/reading.ts +11 -19
- package/src/internal/reading/ready.inpage.ts +2 -2
- package/src/internal/reading/ready.ts +3 -2
- package/src/internal/reading/subjects.inpage.ts +3 -3
- package/src/internal/reading/text.inpage.ts +2 -2
- package/src/internal/reading/walk.inpage.ts +1 -1
- package/src/internal/timeline/changes.inpage.ts +2 -2
- package/src/internal/timeline/changes.ts +3 -4
- package/src/internal/timeline/sight.inpage.ts +2 -2
- package/src/internal/timeline/window.ts +3 -4
- package/src/policy/Policy.ts +70 -16
- package/src/policy/index.ts +12 -0
- package/src/{film → presentation}/Film.ts +104 -37
- package/src/presentation/Motion.ts +45 -3
- package/src/presentation/Presentation.ts +47 -14
- package/src/presentation/Stage.ts +73 -35
- package/src/presentation/index.ts +30 -0
- package/src/presentation/{feed.ts → internal/feed.ts} +1 -1
- package/src/supervisor/Release.ts +45 -0
- package/src/supervisor/Supervisor.ts +80 -5
- package/src/supervisor/index.ts +18 -0
- package/src/supervisor/{contract.ts → internal/contract.ts} +14 -10
- package/src/supervisor/{lifecycle.ts → internal/lifecycle.ts} +7 -7
- package/src/supervisor/{runtime.ts → internal/runtime.ts} +7 -7
- package/src/testing/HttpCassette.ts +260 -0
- package/src/testing/Story.ts +103 -0
- package/src/testing/TestBrowser.ts +14 -4
- package/src/testing/TestModel.ts +297 -0
- package/src/testing/TestPage.ts +92 -4
- package/src/testing/index.ts +35 -1
- package/src/testing/{evidence.ts → internal/evidence.ts} +19 -11
- package/src/testing/{model.ts → internal/model.ts} +14 -8
- package/src/testing/{page.ts → internal/page.ts} +55 -56
- package/src/{moment → timeline}/Moment.ts +79 -29
- package/src/{stillness → timeline}/Stillness.ts +61 -43
- package/src/timeline/index.ts +18 -0
- package/src/{stillness/Pixels.ts → timeline/internal/pixels.ts} +2 -2
- package/src/{moment → timeline/internal}/words.ts +2 -2
- package/src/walk/Walk.ts +165 -0
- package/src/walk/index.ts +12 -0
- package/src/{plan → walk/internal}/choose.ts +23 -14
- package/src/{plan → walk/internal}/data.ts +37 -14
- package/src/{plan → walk/internal}/execute.ts +79 -36
- package/src/{plan → walk/internal}/record.ts +6 -6
- package/src/{plan → walk/internal}/targets.ts +35 -25
- package/dist/ActionPort.d.mts +0 -15
- package/dist/ActionPort.mjs.map +0 -1
- package/dist/Browser-CAQFhTkM.mjs.map +0 -1
- package/dist/Change-CxT1mp2e.d.mts +0 -80
- package/dist/Clock-Du5nP-nK.d.mts +0 -57
- package/dist/Clock.d.mts +0 -2
- package/dist/Clock.mjs.map +0 -1
- package/dist/Frame-UEH2hO5T.d.mts +0 -124
- package/dist/Geometry.d.mts +0 -2
- package/dist/Geometry.mjs.map +0 -1
- package/dist/Matching-MtcWZ_hA.d.mts +0 -266
- package/dist/Matching.d.mts +0 -2
- package/dist/Matching.mjs.map +0 -1
- package/dist/Overlay-CoGw5tL_.d.mts +0 -27
- package/dist/Page-BaAOshxo.mjs.map +0 -1
- package/dist/Page-CLzh5E9w.d.mts +0 -718
- package/dist/PageTime-68UPUZpZ.d.mts +0 -29
- package/dist/Pose-2qqGzPvb.d.mts +0 -32
- package/dist/Released-tURbFmal.d.mts +0 -15
- package/dist/Snapshot-CtBVOtuu.d.mts +0 -73
- package/dist/Stillness-BwP0RdI4.mjs +0 -157
- package/dist/Stillness-BwP0RdI4.mjs.map +0 -1
- package/dist/Style-T3ezDYLI.mjs.map +0 -1
- package/dist/Url-B7P-TWwL.d.mts +0 -26
- package/dist/Url.d.mts +0 -2
- package/dist/Url.mjs.map +0 -1
- package/dist/Window-BDa8MtNP.d.mts +0 -34
- package/dist/connection-C_jWYIwe.mjs.map +0 -1
- package/dist/film/Film.mjs.map +0 -1
- package/dist/moment/Moment.mjs.map +0 -1
- package/dist/plan/index.mjs.map +0 -1
- package/dist/pose.inpage-CLq7Mfdr.mjs.map +0 -1
- package/dist/presentation/Stage.mjs.map +0 -1
- package/dist/presentation/feed.d.mts +0 -20
- package/dist/presentation/feed.mjs +0 -18
- package/dist/presentation/feed.mjs.map +0 -1
- package/dist/providers/Cdp.d.mts +0 -9
- package/dist/providers/Cdp.mjs +0 -15
- package/dist/providers/Cdp.mjs.map +0 -1
- package/dist/providers/Chromium.d.mts +0 -32
- package/dist/providers/Chromium.mjs +0 -55
- package/dist/providers/Chromium.mjs.map +0 -1
- package/dist/providers/Released.d.mts +0 -2
- package/dist/providers/Released.mjs +0 -12
- package/dist/providers/Released.mjs.map +0 -1
- package/dist/stillness/Stillness.d.mts +0 -12
- package/dist/stillness/Stillness.mjs +0 -2
- package/dist/supervisor/Supervisor.mjs.map +0 -1
- package/dist/testing/index.mjs.map +0 -1
- package/dist/workerd/Cdp.d.mts +0 -8
- package/dist/workerd/Cdp.mjs +0 -13
- package/dist/workerd/Cdp.mjs.map +0 -1
- package/src/plan/index.ts +0 -36
- package/src/providers/Cdp.ts +0 -16
- package/src/providers/Chromium.ts +0 -99
- package/src/providers/Released.ts +0 -13
- package/src/workerd/Cdp.ts +0 -11
- /package/dist/{fold.inpage-CyVZQHZL.d.mts → internal/fold.inpage-CyVZQHZL.d.mts} +0 -0
- /package/dist/{rolldown-runtime-D7D4PA-g.mjs → internal/rolldown-runtime-D7D4PA-g.mjs} +0 -0
- /package/src/{Geometry.ts → internal/geometry.ts} +0 -0
- /package/src/{Url.ts → internal/url.ts} +0 -0
- /package/src/{stillness → timeline/internal}/utilsBundle.d.ts +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { t as BrowserError } from "./BrowserError-BlcmLVzn.mjs";
|
|
2
|
-
import { i as Point } from "./Geometry-DJx9qrYy.mjs";
|
|
3
|
-
import { t as Content } from "./Overlay-CoGw5tL_.mjs";
|
|
4
|
-
import { t as Pose } from "./Pose-2qqGzPvb.mjs";
|
|
5
|
-
import { Duration, Effect } from "effect";
|
|
6
|
-
declare namespace PageTime_d_exports {
|
|
7
|
-
export { Held, Step };
|
|
8
|
-
}
|
|
9
|
-
/** What else changes with page time in the same call to the page. */
|
|
10
|
-
interface Step {
|
|
11
|
-
/** Scroll the document to this many CSS pixels down it first, at once. */
|
|
12
|
-
readonly scroll?: number | undefined;
|
|
13
|
-
/** Then pose these elements and take the pose off any other, as `Poses.set` does; the page's poses must be open. */
|
|
14
|
-
readonly poses?: ReadonlyArray<Pose> | undefined;
|
|
15
|
-
/** Then show this in the page's overlay, which must be open. */
|
|
16
|
-
readonly overlay?: Content | undefined;
|
|
17
|
-
}
|
|
18
|
-
interface Held {
|
|
19
|
-
/**
|
|
20
|
-
* Move page time on by `by`, in one call to the page, after the actions asked before it. Says
|
|
21
|
-
* where the document is scrolled to after it.
|
|
22
|
-
*/
|
|
23
|
-
readonly advance: (by: Duration.Input, step?: Step) => Effect.Effect<Point, BrowserError>;
|
|
24
|
-
/** How far this hold has moved page time, across the documents it held. */
|
|
25
|
-
readonly elapsed: Effect.Effect<Duration.Duration>;
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { PageTime_d_exports as n, Step as r, Held as t };
|
|
29
|
-
//# sourceMappingURL=PageTime-68UPUZpZ.d.mts.map
|
package/dist/Pose-2qqGzPvb.d.mts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { t as BrowserError } from "./BrowserError-BlcmLVzn.mjs";
|
|
2
|
-
import { Effect, Schema } from "effect";
|
|
3
|
-
declare namespace Pose_d_exports {
|
|
4
|
-
export { Pose, Poses };
|
|
5
|
-
}
|
|
6
|
-
/** How an element is posed. A part left out changes nothing: no move, a scale of 1, no turn. */
|
|
7
|
-
declare const Pose: Schema.Struct<{
|
|
8
|
-
/** The element, by a ref from the page's current document, such as a `Layout` place's. */
|
|
9
|
-
readonly ref: Schema.String;
|
|
10
|
-
readonly dx: Schema.optional<Schema.Finite>;
|
|
11
|
-
readonly dy: Schema.optional<Schema.Finite>;
|
|
12
|
-
readonly sx: Schema.optional<Schema.Finite>;
|
|
13
|
-
readonly sy: Schema.optional<Schema.Finite>;
|
|
14
|
-
/** Degrees, clockwise. */
|
|
15
|
-
readonly rotate: Schema.optional<Schema.Finite>;
|
|
16
|
-
/** The point it turns and scales about, in the viewport. */
|
|
17
|
-
readonly origin: Schema.optional<Schema.Struct<{
|
|
18
|
-
readonly x: Schema.Finite;
|
|
19
|
-
readonly y: Schema.Finite;
|
|
20
|
-
}>>;
|
|
21
|
-
}>;
|
|
22
|
-
type Pose = typeof Pose.Type;
|
|
23
|
-
interface Poses {
|
|
24
|
-
/**
|
|
25
|
-
* Pose these elements, in one call to the page, and take the pose off every other. A ref the
|
|
26
|
-
* document no longer has fails with `StaleRef`, and posing nothing.
|
|
27
|
-
*/
|
|
28
|
-
readonly set: (poses: ReadonlyArray<Pose>) => Effect.Effect<void, BrowserError>;
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
export { Pose_d_exports as n, Poses as r, Pose as t };
|
|
32
|
-
//# sourceMappingURL=Pose-2qqGzPvb.d.mts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
//#region src/providers/Released.d.ts
|
|
3
|
-
declare const Settled_base: Schema.Class<Settled, Schema.TaggedStruct<"Settled", {}>, {}>;
|
|
4
|
-
/** The provider confirmed the resource ended. */
|
|
5
|
-
declare class Settled extends Settled_base {}
|
|
6
|
-
declare const Unconfirmed_base: Schema.Class<Unconfirmed, Schema.TaggedStruct<"Unconfirmed", {
|
|
7
|
-
readonly detail: Schema.String;
|
|
8
|
-
}>, {}>;
|
|
9
|
-
/** The resource may still run, and bill, because its end could not be confirmed. */
|
|
10
|
-
declare class Unconfirmed extends Unconfirmed_base {}
|
|
11
|
-
declare const Released: Schema.Union<readonly [typeof Settled, typeof Unconfirmed]>;
|
|
12
|
-
type Released = typeof Released.Type;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Settled as n, Unconfirmed as r, Released as t };
|
|
15
|
-
//# sourceMappingURL=Released-tURbFmal.d.mts.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
declare namespace Snapshot_d_exports {
|
|
3
|
-
export { Control, Snapshot, SnapshotOptions };
|
|
4
|
-
}
|
|
5
|
-
declare const Control_base: Schema.Class<Control, Schema.Struct<{
|
|
6
|
-
readonly ref: Schema.String;
|
|
7
|
-
/** Its role, such as `button` or `textbox`, or `clickable` for an element without one. */
|
|
8
|
-
readonly kind: Schema.String;
|
|
9
|
-
/** Its accessible name. */
|
|
10
|
-
readonly name: Schema.String;
|
|
11
|
-
/** What it holds: a field's text, `••••` for a secret one, or a select's chosen labels. */
|
|
12
|
-
readonly value: Schema.String;
|
|
13
|
-
/** A select's option labels, at most 64. */
|
|
14
|
-
readonly options: Schema.optional<Schema.$Array<Schema.String>>;
|
|
15
|
-
/** How many options a select has, when it has options. */
|
|
16
|
-
readonly optionCount: Schema.optional<Schema.Int>;
|
|
17
|
-
readonly disabled: Schema.optional<Schema.Boolean>;
|
|
18
|
-
/** Whether it is checked, for what can be checked. */
|
|
19
|
-
readonly checked: Schema.optional<Schema.Boolean>;
|
|
20
|
-
/** True for a field that takes typed text. */
|
|
21
|
-
readonly editable: Schema.optional<Schema.Boolean>;
|
|
22
|
-
}>, {}>;
|
|
23
|
-
/** A control the outline shows, as a value: its ref, what it is and what it holds. */
|
|
24
|
-
declare class Control extends Control_base {}
|
|
25
|
-
declare const Snapshot_base: Schema.Class<Snapshot, Schema.Struct<{
|
|
26
|
-
readonly url: Schema.String;
|
|
27
|
-
readonly title: Schema.String;
|
|
28
|
-
/** One line per control, heading or text block, indented by landmark. */
|
|
29
|
-
readonly text: Schema.String;
|
|
30
|
-
/** True when `text` was cut at `maxChars`. */
|
|
31
|
-
readonly truncated: Schema.Boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Parts of the page left out because they lie above or below the viewport, each an element out
|
|
34
|
-
* of view with all it holds (viewport snapshots only).
|
|
35
|
-
*/
|
|
36
|
-
readonly above: Schema.Finite;
|
|
37
|
-
readonly below: Schema.Finite;
|
|
38
|
-
readonly viewport: Schema.Struct<{
|
|
39
|
-
readonly width: Schema.Finite;
|
|
40
|
-
readonly height: Schema.Finite;
|
|
41
|
-
}>;
|
|
42
|
-
readonly scroll: Schema.Struct<{
|
|
43
|
-
readonly y: Schema.Finite;
|
|
44
|
-
readonly height: Schema.Finite;
|
|
45
|
-
}>;
|
|
46
|
-
/** The controls the outline shows, in its order. */
|
|
47
|
-
readonly controls: Schema.$Array<typeof Control>;
|
|
48
|
-
}>, {}>;
|
|
49
|
-
declare class Snapshot extends Snapshot_base {
|
|
50
|
-
/** The snapshot as one block of text for a model: header, outline and what was left out. */
|
|
51
|
-
get rendered(): string;
|
|
52
|
-
}
|
|
53
|
-
interface SnapshotOptions {
|
|
54
|
-
/** Read the whole page instead of the viewport. Defaults to false. */
|
|
55
|
-
readonly full?: boolean | undefined;
|
|
56
|
-
/** Keep only lines containing this text (case-insensitive). */
|
|
57
|
-
readonly query?: string | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Read only inside the elements this CSS selector matches, such as `form` or `#results`. A
|
|
60
|
-
* selector that matches nothing reads nothing; one that is not CSS is an `InvalidRequest`.
|
|
61
|
-
*/
|
|
62
|
-
readonly within?: string | undefined;
|
|
63
|
-
/** Bound on the outline's length. Defaults to 12,000 characters. */
|
|
64
|
-
readonly maxChars?: number | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Give every control's box, as `WxH at (x,y)` in viewport CSS pixels, as a canvas's or a frame's
|
|
67
|
-
* always has. Defaults to false.
|
|
68
|
-
*/
|
|
69
|
-
readonly boxes?: boolean | undefined;
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { Snapshot_d_exports as i, Snapshot as n, SnapshotOptions as r, Control as t };
|
|
73
|
-
//# sourceMappingURL=Snapshot-CtBVOtuu.d.mts.map
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { Failed, Timeout, refuse, undispatched } from "./BrowserError.mjs";
|
|
2
|
-
import { monotonicMillis } from "./Clock.mjs";
|
|
3
|
-
import { Clock, Duration, Effect, Option, Schedule, Stream } from "effect";
|
|
4
|
-
import { jpegjs } from "playwright-core/lib/utilsBundle";
|
|
5
|
-
//#region src/stillness/Pixels.ts
|
|
6
|
-
/**
|
|
7
|
-
* Where a page's screen moves, from its screencast frames: each frame decoded and cut into
|
|
8
|
-
* 16-pixel blocks, a block moving where a few of its pixels, sampled every other one, changed by
|
|
9
|
-
* more than JPEG's noise in any color channel.
|
|
10
|
-
* What moved among the frames before an input is the page's background, such as an idle
|
|
11
|
-
* animation; foreground stillness ignores it.
|
|
12
|
-
*
|
|
13
|
-
* Frames use Playwright's bundled JPEG decoder. The package build ships that exact decoder
|
|
14
|
-
* alone, keeping its Node utility bundle out of Workers. Source runs use its native export,
|
|
15
|
-
* whose untyped entry point is declared by `utilsBundle.d.ts`.
|
|
16
|
-
*/
|
|
17
|
-
const picture = (frame) => jpegjs.decode(frame.data, { useTArray: true });
|
|
18
|
-
/** A sample changed where any color channel moved more than this, beyond JPEG's noise. */
|
|
19
|
-
const noise = 32;
|
|
20
|
-
/** The blocks where two pictures differ, by `row * columns + column`; -1 for different sizes. */
|
|
21
|
-
const moved = (from, to) => {
|
|
22
|
-
if (from.width !== to.width || from.height !== to.height) return [-1];
|
|
23
|
-
const columns = Math.ceil(from.width / 16);
|
|
24
|
-
const counts = /* @__PURE__ */ new Map();
|
|
25
|
-
const differs = (at) => Math.abs((from.data[at] ?? 0) - (to.data[at] ?? 0)) > noise;
|
|
26
|
-
for (let y = 0; y < from.height; y += 2) for (let x = 0; x < from.width; x += 2) {
|
|
27
|
-
const at = (y * from.width + x) * 4;
|
|
28
|
-
const block = Math.floor(y / 16) * columns + Math.floor(x / 16);
|
|
29
|
-
if (differs(at) || differs(at + 1) || differs(at + 2)) counts.set(block, (counts.get(block) ?? 0) + 1);
|
|
30
|
-
}
|
|
31
|
-
return [...counts].flatMap(([block, count]) => count >= 3 ? [block] : []);
|
|
32
|
-
};
|
|
33
|
-
/** The blocks that moved from one picture to the next and their neighbours; none past a resize. */
|
|
34
|
-
const background = (pictures) => {
|
|
35
|
-
const columns = Math.ceil((pictures[0]?.width ?? 0) / 16);
|
|
36
|
-
const around = (block) => [
|
|
37
|
-
-1,
|
|
38
|
-
0,
|
|
39
|
-
1
|
|
40
|
-
].flatMap((row) => [
|
|
41
|
-
-1,
|
|
42
|
-
0,
|
|
43
|
-
1
|
|
44
|
-
].filter((step) => block >= 0 && block % columns + step >= 0).filter((step) => block % columns + step < columns).map((step) => block + row * columns + step));
|
|
45
|
-
return new Set(pictures.flatMap((to, index) => moved(pictures[index - 1] ?? to, to).flatMap(around)));
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* The blocks a picture's boxes cover, and those around them, for boxes in CSS pixels and `scale`
|
|
49
|
-
* picture pixels to a CSS pixel: where an overlay draws, which is not the page's motion.
|
|
50
|
-
*/
|
|
51
|
-
const covering = (boxes, scale, picture) => {
|
|
52
|
-
const columns = Math.ceil(picture.width / 16);
|
|
53
|
-
const rows = Math.ceil(picture.height / 16);
|
|
54
|
-
const blocks = /* @__PURE__ */ new Set();
|
|
55
|
-
const block = (at, count) => Math.min(count - 1, Math.max(0, Math.floor(at / 16)));
|
|
56
|
-
for (const { x, y, width, height } of boxes) for (let row = block(y * scale, rows) - 1; row <= block((y + height) * scale, rows) + 1; row++) for (let column = block(x * scale, columns) - 1; column <= block((x + width) * scale, columns) + 1; column++) if (row >= 0 && row < rows && column >= 0 && column < columns) blocks.add(row * columns + column);
|
|
57
|
-
return blocks;
|
|
58
|
-
};
|
|
59
|
-
/** Whether anything moved from one picture to another outside the background. */
|
|
60
|
-
const stirs = (from, to, mask) => moved(from, to).some((block) => !mask.has(block));
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/stillness/Stillness.ts
|
|
63
|
-
/** Screen and foreground stillness over the public page capture and owning clock. */
|
|
64
|
-
const observe = (page, options, timeout) => Effect.gen(function* () {
|
|
65
|
-
const now = () => monotonicMillis(page.clock);
|
|
66
|
-
const deadline = now() + Duration.toMillis(timeout);
|
|
67
|
-
const settled = () => page.ready({
|
|
68
|
-
quietMillis: options.quietMillis,
|
|
69
|
-
timeout: Duration.millis(Math.max(0, deadline - now()))
|
|
70
|
-
});
|
|
71
|
-
const quiet = (millis) => Effect.gen(function* () {
|
|
72
|
-
const capture = yield* page.capture();
|
|
73
|
-
const foreground = options.still === "foreground";
|
|
74
|
-
let counts = yield* capture.stats();
|
|
75
|
-
let stirred = now();
|
|
76
|
-
let reference;
|
|
77
|
-
const decoded = (frame) => Effect.try({
|
|
78
|
-
try: () => picture(frame),
|
|
79
|
-
catch: (error) => undispatched("ready", new Failed({ detail: `no picture: ${String(error)}` }))
|
|
80
|
-
});
|
|
81
|
-
const inputAt = (yield* page.recentEvents).findLast((event) => event._tag === "Action")?.startedAt ?? Number.NEGATIVE_INFINITY;
|
|
82
|
-
const document = (yield* page.state).document;
|
|
83
|
-
const before = (foreground ? yield* page.recentFrames : []).filter((frame) => frame.hostTime < inputAt && frame.hostTime >= inputAt - 1500 && frame.document === document);
|
|
84
|
-
const sampled = before.filter((_, index) => index % Math.ceil(before.length / 8) === 0);
|
|
85
|
-
const mask = background(yield* Effect.forEach(sampled, decoded));
|
|
86
|
-
let width;
|
|
87
|
-
const covered = new Set(mask);
|
|
88
|
-
const outside = (seen, overlay) => Effect.gen(function* () {
|
|
89
|
-
if (overlay === void 0) return covered;
|
|
90
|
-
width ??= (yield* page.viewport).width;
|
|
91
|
-
for (const block of covering(overlay, seen.width / width, seen)) covered.add(block);
|
|
92
|
-
return covered;
|
|
93
|
-
});
|
|
94
|
-
const look = Effect.gen(function* () {
|
|
95
|
-
const stats = yield* capture.stats();
|
|
96
|
-
const { frame: latest, overlay } = yield* page.state;
|
|
97
|
-
const comparing = foreground || overlay !== void 0;
|
|
98
|
-
const arrived = stats.received !== counts.received;
|
|
99
|
-
const unseen = stats.accepted - counts.accepted;
|
|
100
|
-
counts = stats;
|
|
101
|
-
if (latest === void 0 || !capture.isCurrent(latest)) stirred = now();
|
|
102
|
-
else if (!comparing ? arrived || stats.ackBacklog > 0 : !arrived && stats.ackBacklog > 0) stirred = now();
|
|
103
|
-
else if (comparing && (unseen > 0 || reference === void 0)) {
|
|
104
|
-
const frames = (yield* page.recentFrames).slice(-Math.max(1, Math.min(8, unseen)));
|
|
105
|
-
if (unseen > frames.length) stirred = now();
|
|
106
|
-
for (const frame of frames) {
|
|
107
|
-
const seen = yield* decoded(frame);
|
|
108
|
-
if (reference === void 0 || stirs(reference, seen, yield* outside(seen, overlay))) {
|
|
109
|
-
reference = seen;
|
|
110
|
-
stirred = now();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return now() - stirred;
|
|
115
|
-
});
|
|
116
|
-
const spell = Effect.repeat(look, {
|
|
117
|
-
schedule: Schedule.fixed(Duration.millis(foreground ? 100 : 25)),
|
|
118
|
-
until: (still) => still >= millis
|
|
119
|
-
});
|
|
120
|
-
const still = Effect.gen(function* () {
|
|
121
|
-
for (;;) {
|
|
122
|
-
yield* spell;
|
|
123
|
-
const before = counts.received;
|
|
124
|
-
yield* Effect.all([settled(), capture.sync], {
|
|
125
|
-
concurrency: 2,
|
|
126
|
-
discard: true
|
|
127
|
-
});
|
|
128
|
-
if ((yield* look) >= millis && (foreground || (yield* page.state).overlay !== void 0 || counts.received === before)) return;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return yield* Effect.raceFirst(capture.stream.pipe(Stream.runDrain, Effect.andThen(Effect.never)), still);
|
|
132
|
-
});
|
|
133
|
-
yield* page.afterInput(Effect.void);
|
|
134
|
-
if (options.still === "content") {
|
|
135
|
-
yield* page.changes();
|
|
136
|
-
yield* Effect.sleep(Duration.millis(options.quietMillis));
|
|
137
|
-
return yield* settled();
|
|
138
|
-
}
|
|
139
|
-
yield* settled();
|
|
140
|
-
yield* quiet(options.quietMillis);
|
|
141
|
-
});
|
|
142
|
-
const wait = (page, options) => Effect.gen(function* () {
|
|
143
|
-
if (!Number.isFinite(options.quietMillis) || options.quietMillis < 0) return yield* refuse("stillness", "quietMillis must be finite and nonnegative");
|
|
144
|
-
const input = options.timeout ?? Duration.seconds(15);
|
|
145
|
-
const components = typeof input === "number" ? [input] : typeof input === "object" && !Duration.isDuration(input) ? Object.values(input) : [];
|
|
146
|
-
const timeout = Duration.fromInput(input);
|
|
147
|
-
if (components.some((value) => typeof value === "number" && !Number.isFinite(value)) || Option.isNone(timeout) || !Duration.isFinite(timeout.value) || Duration.isNegative(timeout.value)) return yield* refuse("stillness", "timeout must be a finite nonnegative duration");
|
|
148
|
-
const duration = timeout.value;
|
|
149
|
-
return yield* observe(page, options, duration).pipe(Effect.timeoutOrElse({
|
|
150
|
-
duration,
|
|
151
|
-
orElse: () => Effect.fail(undispatched("stillness", new Timeout({ millis: Duration.toMillis(duration) })))
|
|
152
|
-
}));
|
|
153
|
-
}).pipe(Effect.scoped, Effect.provideService(Clock.Clock, page.clock), Effect.withSpan("Stillness.wait"));
|
|
154
|
-
//#endregion
|
|
155
|
-
export { wait as t };
|
|
156
|
-
|
|
157
|
-
//# sourceMappingURL=Stillness-BwP0RdI4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stillness-BwP0RdI4.mjs","names":["Motion.picture","Motion.background","Motion.covering","Motion.stirs"],"sources":["../src/stillness/Pixels.ts","../src/stillness/Stillness.ts"],"sourcesContent":["/**\n * Where a page's screen moves, from its screencast frames: each frame decoded and cut into\n * 16-pixel blocks, a block moving where a few of its pixels, sampled every other one, changed by\n * more than JPEG's noise in any color channel.\n * What moved among the frames before an input is the page's background, such as an idle\n * animation; foreground stillness ignores it.\n *\n * Frames use Playwright's bundled JPEG decoder. The package build ships that exact decoder\n * alone, keeping its Node utility bundle out of Workers. Source runs use its native export,\n * whose untyped entry point is declared by `utilsBundle.d.ts`.\n */\n// oxlint-disable-next-line typescript/triple-slash-reference -- a declaration of an untyped module cannot be imported, and every program that compiles this source needs it\n/// <reference path=\"./utilsBundle.d.ts\" />\nimport { jpegjs } from \"playwright-core/lib/utilsBundle\";\n\nimport type { Box } from \"../BrowserEvent.ts\";\nimport type { Frame } from \"../Frame.ts\";\n\n/** A decoded frame: RGBA, `width` pixels a row. */\nexport type Picture = ReturnType<typeof jpegjs.decode>;\n\nexport const picture = (frame: Frame): Picture => jpegjs.decode(frame.data, { useTArray: true });\n\n/** A sample changed where any color channel moved more than this, beyond JPEG's noise. */\nconst noise = 32;\n\n/** The blocks where two pictures differ, by `row * columns + column`; -1 for different sizes. */\nconst moved = (from: Picture, to: Picture): ReadonlyArray<number> => {\n if (from.width !== to.width || from.height !== to.height) return [-1];\n const columns = Math.ceil(from.width / 16);\n const counts = new Map<number, number>();\n const differs = (at: number) => Math.abs((from.data[at] ?? 0) - (to.data[at] ?? 0)) > noise;\n\n for (let y = 0; y < from.height; y += 2)\n for (let x = 0; x < from.width; x += 2) {\n const at = (y * from.width + x) * 4;\n const block = Math.floor(y / 16) * columns + Math.floor(x / 16);\n\n if (differs(at) || differs(at + 1) || differs(at + 2))\n counts.set(block, (counts.get(block) ?? 0) + 1);\n }\n\n // At least three changed samples, so a stray one is no motion.\n return [...counts].flatMap(([block, count]) => (count >= 3 ? [block] : []));\n};\n\n/** The blocks that moved from one picture to the next and their neighbours; none past a resize. */\nexport const background = (pictures: ReadonlyArray<Picture>): ReadonlySet<number> => {\n const columns = Math.ceil((pictures[0]?.width ?? 0) / 16);\n\n const around = (block: number) =>\n [-1, 0, 1].flatMap((row) =>\n [-1, 0, 1]\n .filter((step) => block >= 0 && (block % columns) + step >= 0)\n .filter((step) => (block % columns) + step < columns)\n .map((step) => block + row * columns + step),\n );\n\n return new Set(\n pictures.flatMap((to, index) => moved(pictures[index - 1] ?? to, to).flatMap(around)),\n );\n};\n\n/**\n * The blocks a picture's boxes cover, and those around them, for boxes in CSS pixels and `scale`\n * picture pixels to a CSS pixel: where an overlay draws, which is not the page's motion.\n */\nexport const covering = (boxes: ReadonlyArray<Box>, scale: number, picture: Picture) => {\n const columns = Math.ceil(picture.width / 16);\n const rows = Math.ceil(picture.height / 16);\n const blocks = new Set<number>();\n\n const block = (at: number, count: number) =>\n Math.min(count - 1, Math.max(0, Math.floor(at / 16)));\n\n for (const { x, y, width, height } of boxes)\n for (let row = block(y * scale, rows) - 1; row <= block((y + height) * scale, rows) + 1; row++)\n for (\n let column = block(x * scale, columns) - 1;\n column <= block((x + width) * scale, columns) + 1;\n column++\n )\n if (row >= 0 && row < rows && column >= 0 && column < columns)\n blocks.add(row * columns + column);\n\n return blocks;\n};\n\n/** Whether anything moved from one picture to another outside the background. */\nexport const stirs = (from: Picture, to: Picture, mask: ReadonlySet<number>) =>\n moved(from, to).some((block) => !mask.has(block));\n","/** Screen and foreground stillness over the public page capture and owning clock. */\nimport { Clock, Duration, Effect, Option, Schedule, Stream } from \"effect\";\n\nimport { Failed, refuse, Timeout, undispatched } from \"../BrowserError.ts\";\nimport type { Box } from \"../BrowserEvent.ts\";\nimport { monotonicMillis } from \"../Clock.ts\";\nimport type { Frame } from \"../Frame.ts\";\nimport type { Page } from \"../Page.ts\";\nimport * as Motion from \"./Pixels.ts\";\n\nexport interface Options {\n readonly still?: \"screen\" | \"content\" | \"foreground\" | undefined;\n readonly quietMillis: number;\n readonly timeout?: Duration.Input | undefined;\n}\n\nconst observe = (page: Page, options: Options, timeout: Duration.Duration) =>\n Effect.gen(function* () {\n const now = () => monotonicMillis(page.clock);\n const deadline = now() + Duration.toMillis(timeout);\n\n const settled = () =>\n page.ready({\n quietMillis: options.quietMillis,\n timeout: Duration.millis(Math.max(0, deadline - now())),\n });\n\n // A capture the wait starts sends its first frame late, over half a second from a hosted\n // browser, so the spell counts from that frame (#202); Chrome sends one as a capture starts,\n // even of a still page.\n const quiet = (millis: number) =>\n Effect.gen(function* () {\n const capture = yield* page.capture();\n\n const foreground = options.still === \"foreground\";\n let counts = yield* capture.stats();\n let stirred = now();\n let reference: Motion.Picture | undefined;\n\n const decoded = (frame: Frame) =>\n Effect.try({\n try: () => Motion.picture(frame),\n catch: (error) =>\n undispatched(\"ready\", new Failed({ detail: `no picture: ${String(error)}` })),\n });\n\n // The background: what moved in up to eight frames of the document's 1.5 s before its\n // latest input, as far back as the capture keeps them.\n const inputAt =\n (yield* page.recentEvents).findLast((event) => event._tag === \"Action\")?.startedAt ??\n Number.NEGATIVE_INFINITY;\n\n const document = (yield* page.state).document;\n\n const before = (foreground ? yield* page.recentFrames : []).filter(\n (frame) =>\n frame.hostTime < inputAt &&\n frame.hostTime >= inputAt - 1500 &&\n frame.document === document,\n );\n\n const sampled = before.filter((_, index) => index % Math.ceil(before.length / 8) === 0);\n const mask = Motion.background(yield* Effect.forEach(sampled, decoded));\n // Where the page's overlay draws is not the page's motion: while it shows, frames are\n // compared, as in the foreground, outside everywhere it has drawn during the wait.\n let width: number | undefined;\n const covered = new Set(mask);\n\n const outside = (seen: Motion.Picture, overlay: ReadonlyArray<Box> | undefined) =>\n Effect.gen(function* () {\n if (overlay === undefined) return covered;\n width ??= (yield* page.viewport).width;\n for (const block of Motion.covering(overlay, seen.width / width, seen))\n covered.add(block);\n\n return covered;\n });\n\n // How long the screen has been still: since a frame, or an unanswered acknowledgement. In\n // the foreground, since a frame moved outside the background, or acknowledgements went\n // unanswered with no frame coming.\n const look = Effect.gen(function* () {\n const stats = yield* capture.stats();\n const { frame: latest, overlay } = yield* page.state;\n const comparing = foreground || overlay !== undefined;\n const arrived = stats.received !== counts.received;\n const unseen = stats.accepted - counts.accepted;\n\n counts = stats;\n if (latest === undefined || !capture.isCurrent(latest)) stirred = now();\n else if (!comparing ? arrived || stats.ackBacklog > 0 : !arrived && stats.ackBacklog > 0)\n stirred = now();\n else if (comparing && (unseen > 0 || reference === undefined)) {\n // A move and its return between looks both count. Bound decoding; any frames lost\n // from history, or beyond this batch, deny a quiet spell rather than hiding motion.\n const frames = (yield* page.recentFrames).slice(-Math.max(1, Math.min(8, unseen)));\n\n if (unseen > frames.length) stirred = now();\n for (const frame of frames) {\n const seen = yield* decoded(frame);\n\n if (\n reference === undefined ||\n Motion.stirs(reference, seen, yield* outside(seen, overlay))\n ) {\n reference = seen;\n stirred = now();\n }\n }\n }\n\n return now() - stirred;\n });\n\n // Decode at a fixed cadence: adding a delay after a full batch lets its backlog grow.\n const spell = Effect.repeat(look, {\n schedule: Schedule.fixed(Duration.millis(foreground ? 100 : 25)),\n until: (still) => still >= millis,\n });\n\n const still = Effect.gen(function* () {\n for (;;) {\n yield* spell;\n const before = counts.received;\n\n yield* Effect.all([settled(), capture.sync], { concurrency: 2, discard: true });\n if (\n (yield* look) >= millis &&\n (foreground ||\n (yield* page.state).overlay !== undefined ||\n counts.received === before)\n )\n return;\n }\n });\n\n return yield* Effect.raceFirst(\n capture.stream.pipe(Stream.runDrain, Effect.andThen(Effect.never)),\n still,\n );\n });\n\n yield* page.afterInput(Effect.void);\n if (options.still === \"content\") {\n yield* page.changes();\n yield* Effect.sleep(Duration.millis(options.quietMillis));\n\n return yield* settled();\n }\n yield* settled();\n yield* quiet(options.quietMillis);\n });\n\nexport const wait = (page: Page, options: Options) =>\n Effect.gen(function* () {\n if (!Number.isFinite(options.quietMillis) || options.quietMillis < 0)\n return yield* refuse(\"stillness\", \"quietMillis must be finite and nonnegative\");\n const input = options.timeout ?? Duration.seconds(15);\n\n const components =\n typeof input === \"number\"\n ? [input]\n : typeof input === \"object\" && !Duration.isDuration(input)\n ? Object.values(input)\n : [];\n\n const timeout = Duration.fromInput(input);\n\n if (\n components.some((value) => typeof value === \"number\" && !Number.isFinite(value)) ||\n Option.isNone(timeout) ||\n !Duration.isFinite(timeout.value) ||\n Duration.isNegative(timeout.value)\n )\n return yield* refuse(\"stillness\", \"timeout must be a finite nonnegative duration\");\n const duration = timeout.value;\n\n return yield* observe(page, options, duration).pipe(\n Effect.timeoutOrElse({\n duration,\n orElse: () =>\n Effect.fail(\n undispatched(\"stillness\", new Timeout({ millis: Duration.toM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|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Style-T3ezDYLI.mjs","names":["Keys.description","description"],"sources":["../src/internal/input/keys.ts","../src/Style.ts"],"sourcesContent":["/**\n * Key aliases for Playwright and printable US key descriptions for pipelined Chromium typing.\n */\n\nconst aliases: Record<string, string> = {\n ctrl: \"Control\",\n control: \"Control\",\n cmd: \"Meta\",\n command: \"Meta\",\n meta: \"Meta\",\n win: \"Meta\",\n super: \"Meta\",\n mod: \"ControlOrMeta\",\n alt: \"Alt\",\n option: \"Alt\",\n shift: \"Shift\",\n enter: \"Enter\",\n return: \"Enter\",\n esc: \"Escape\",\n escape: \"Escape\",\n tab: \"Tab\",\n space: \"Space\",\n spacebar: \"Space\",\n \" \": \"Space\",\n backspace: \"Backspace\",\n delete: \"Delete\",\n del: \"Delete\",\n insert: \"Insert\",\n home: \"Home\",\n end: \"End\",\n pageup: \"PageUp\",\n pagedown: \"PageDown\",\n up: \"ArrowUp\",\n down: \"ArrowDown\",\n left: \"ArrowLeft\",\n right: \"ArrowRight\",\n arrowup: \"ArrowUp\",\n arrowdown: \"ArrowDown\",\n arrowleft: \"ArrowLeft\",\n arrowright: \"ArrowRight\",\n};\n\nconst named = new Set(Object.values(aliases));\n\n/** Parse and validate the whole chord before sending any down events. */\nexport const parts = (keys: string): ReadonlyArray<string> | undefined => {\n const tokens: Array<string> = [];\n let building = \"\";\n\n // Like Playwright, a plus without a preceding token is the literal plus key: Control++.\n for (const character of keys) {\n if (character === \"+\" && building.trim() !== \"\") {\n tokens.push(building);\n building = \"\";\n } else building += character;\n }\n tokens.push(building);\n if (tokens.length > 4) return undefined;\n const out: Array<string> = [];\n\n for (const token of tokens) {\n const part = token === \" \" ? \"Space\" : token.trim();\n const lower = part.toLowerCase();\n const alias = Object.hasOwn(aliases, lower) ? aliases[lower] : undefined;\n\n if (alias !== undefined) out.push(alias);\n else if (\n named.has(part) ||\n /^F([1-9]|1[0-2])$/.test(part) ||\n /^(Key[A-Z]|Digit[0-9]|Numpad[0-9])$/.test(part) ||\n description(part) !== undefined\n )\n out.push(part);\n else return undefined;\n }\n\n return out;\n};\n\ninterface Description {\n readonly code: string;\n readonly keyCode: number;\n readonly key: string;\n readonly text: string;\n}\n\nconst punctuation: ReadonlyArray<readonly [string, string, number]> = [\n [\"`~\", \"Backquote\", 192],\n [\"-_\", \"Minus\", 189],\n [\"=+\", \"Equal\", 187],\n [\"\\\\|\", \"Backslash\", 220],\n [\"[{\", \"BracketLeft\", 219],\n [\"]}\", \"BracketRight\", 221],\n [\";:\", \"Semicolon\", 186],\n [\"'\\\"\", \"Quote\", 222],\n [\",<\", \"Comma\", 188],\n [\".>\", \"Period\", 190],\n [\"/?\", \"Slash\", 191],\n [\" \", \"Space\", 32],\n];\n\n/**\n * Match Playwright's pinned US layout for literal typing. Uppercase and shifted punctuation\n * carry their literal text without synthesizing Shift. Newlines also use insertText so a text\n * payload cannot submit a form; only an explicit Enter or submit option may do that.\n */\nexport const description = (character: string): Description | undefined => {\n // Prose correction uses the same raw key path so its deletion has a matched release.\n if (character === \"Backspace\")\n return { code: \"Backspace\", keyCode: 8, key: \"Backspace\", text: \"\" };\n if (character.length !== 1) return undefined;\n if (/^[A-Za-z]$/.test(character)) {\n const upper = character.toUpperCase();\n\n return { code: `Key${upper}`, keyCode: upper.charCodeAt(0), key: character, text: character };\n }\n const digit = \"0123456789\".indexOf(character);\n const number = digit === -1 ? \")!@#$%^&*(\".indexOf(character) : digit;\n\n if (number !== -1)\n return { code: `Digit${number}`, keyCode: 48 + number, key: character, text: character };\n const symbol = punctuation.find(([characters]) => characters.includes(character));\n\n return symbol === undefined\n ? undefined\n : { code: symbol[1], keyCode: symbol[2], key: character, text: character };\n};\n","/**\n * How input is sent: plainly, as fast as the page takes it, or performed for viewers, with a\n * pointer that glides, keys typed at a person's pace, held buttons and wheels in bursts. A page's\n * actions take one, and the input reaches the same controls either way; only its timing, and\n * what viewers see of it, differ. A presenter builds the performed one.\n */\nimport {\n Context,\n type Duration,\n Effect,\n type MutableRef,\n type Option,\n Random,\n Schema,\n} from \"effect\";\n\nimport { undispatched, type BrowserError, InvalidRequest, refuse } from \"./BrowserError.ts\";\nimport type { ActionAnnounced } from \"./BrowserEvent.ts\";\nimport type * as Motion from \"./Geometry.ts\";\nimport { normal } from \"./Geometry.ts\";\nimport * as Keys from \"./internal/input/keys.ts\";\nimport type { Point } from \"./Page.ts\";\n\nexport interface TypingEvent {\n /** From the start of the typing. */\n readonly afterMillis: number;\n readonly phase: \"down\" | \"up\" | \"insert\";\n readonly key: string;\n}\n\nexport interface WheelStep {\n readonly dx: number;\n readonly dy: number;\n /** From the first step. */\n readonly afterMillis: number;\n}\n\nexport interface Style {\n /** Own presentation only after policy allows input; wait options belong to the page. */\n readonly withInput?:\n | ((options: {\n readonly operation: string;\n readonly wait: Duration.Duration;\n readonly failFast: boolean;\n }) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | BrowserError, R>)\n | undefined;\n /**\n * Wait for this once an action has announced its target, before its pointer travels there. It\n * holds the page's turn and spends the action's deadline, which bounds it; the target is not\n * found again after it.\n */\n readonly lead?: ((announced: ActionAnnounced) => Effect.Effect<void>) | undefined;\n /**\n * Whether viewers watch the input: then the pointer clicks into a field before typing, finds\n * what lies under it as it scrolls, and scrolls to a target out of view with the wheel.\n */\n readonly shown: boolean;\n /** Where viewers last saw the pointer, which the next glide starts from; else the page's own. */\n readonly pointer: MutableRef.MutableRef<Option.Option<Point>> | undefined;\n /** The pointer's path to `to`, ending exactly there. */\n readonly glide: (\n from: Point,\n to: Point,\n dragging: boolean,\n ) => Effect.Effect<ReadonlyArray<Motion.Sample>>;\n /** How long a button stays down when a click does not say. */\n readonly hold: Effect.Effect<number, BrowserError>;\n /** The key events that type `text`, or one insertion of it under a guard, timed from the start. */\n readonly typing: (\n text: string,\n guarded: boolean,\n ) => Effect.Effect<ReadonlyArray<TypingEvent>, BrowserError>;\n /** The pause between repeated presses of the same keys. */\n readonly keyGap: Effect.Effect<number, BrowserError>;\n /** A wheel scroll as the wheel turns: in one step, or in notches and bursts. */\n readonly wheel: (dx: number, dy: number) => Effect.Effect<ReadonlyArray<WheelStep>, BrowserError>;\n}\n\n/** Each key as it comes, with no pause; a drag moves in eight short steps so its target sees it. */\nexport const plain: Style = {\n shown: false,\n pointer: undefined,\n glide: (from, to, dragging) =>\n Effect.succeed(\n dragging\n ? Array.from({ length: 8 }, (_, index) => ({\n x: index === 7 ? to.x : from.x + ((to.x - from.x) * (index + 1)) / 8,\n y: index === 7 ? to.y : from.y + ((to.y - from.y) * (index + 1)) / 8,\n afterMillis: (index + 1) * 8,\n }))\n : [{ ...to, afterMillis: 0 }],\n ),\n hold: Effect.succeed(0),\n typing: (text, guarded) =>\n Effect.succeed(\n guarded && text !== \"\"\n ? [{ afterMillis: 0, phase: \"insert\", key: text }]\n : [...text].flatMap((key): ReadonlyArray<TypingEvent> =>\n Keys.description(key) === undefined\n ? [{ afterMillis: 0, phase: \"insert\", key }]\n : [\n { afterMillis: 0, phase: \"down\", key },\n { afterMillis: 0, phase: \"up\", key },\n ],\n ),\n ),\n keyGap: Effect.succeed(0),\n wheel: (dx, dy) => Effect.succeed([{ dx, dy, afterMillis: 0 }]),\n};\n\n// A right-skewed draw, clamped so that cleanup and deadlines stay predictable; 1 - U keeps the\n// logarithm defined when Random returns zero.\nconst lognormal = Effect.fnUntraced(function* (\n median: number,\n sigma: number,\n minimum: number,\n maximum: number,\n) {\n return Math.max(minimum, Math.min(maximum, median * Math.exp(sigma * (yield* normal))));\n});\n\n/** A pause around `median`, as the research measured reactions: at most four times it. */\nexport const pause = (median: number, sigma: number) =>\n median <= 0 ? Effect.succeed(0) : lognormal(median, sigma, 0, median * 4);\n\n// A mouse press about 80 ms long on average, a key about 110 ms, each now and then longer: their\n// medians are the means times exp(-sigma^2 / 2).\nconst pressHold = lognormal(75.2, 0.35, 35, 200);\nconst keyHold = lognormal(107.8, 0.2, 60, 220);\nconst eventOrder = { up: 0, insert: 1, down: 2 };\n\n/**\n * Plan the whole text before any key goes, so holds overlap without waiting on the network. A\n * physical key is never held twice, as with A and a, or ! and 1. The first key waits for the hand\n * to reach the keys, each later one follows the last by a gap drawn around `gap`, and a word's\n * first key comes 60 ms later.\n */\nexport const maximumDurationMillis = 10_000;\n\nconst Delay = Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: maximumDurationMillis }));\n\nconst ordered = <A extends { readonly afterMillis: number }>(sample: Schema.Codec<A>) =>\n Schema.Array(sample).check(\n Schema.makeFilter(\n (samples) =>\n samples.every(\n (event, index) => event.afterMillis >= (samples[index - 1]?.afterMillis ?? 0),\n ),\n { expected: \"nondecreasing input offsets\" },\n ),\n );\n\nconst Typing = ordered(\n Schema.Struct({\n afterMillis: Delay,\n phase: Schema.Literals([\"down\", \"up\", \"insert\"]),\n key: Schema.String,\n }),\n).check(\n Schema.makeFilter(\n (events) => {\n const held = new Set<string>();\n\n for (const event of events) {\n if (event.phase === \"insert\") continue;\n const code = Keys.description(event.key)?.code;\n\n if (code === undefined || (event.phase === \"down\") === held.has(code)) return false;\n if (event.phase === \"down\") held.add(code);\n else held.delete(code);\n }\n\n return held.size === 0;\n },\n { expected: \"matched key holds\" },\n ),\n);\n\nconst Wheel = ordered(Schema.Struct({ afterMillis: Delay, dx: Schema.Finite, dy: Schema.Finite }));\n\nconst decode =\n <A>(schema: Schema.Codec<A>, operation: string) =>\n (value: unknown) =>\n Schema.decodeUnknownEffect(schema)(value).pipe(\n Effect.catch(() =>\n refuse(operation, \"style must provide a finite bounded ordered input schedule\"),\n ),\n );\n\n/** Copy and validate custom schedules before their first input; planning uses the action bound. */\nexport const validated = (style: Style): Style => ({\n ...style,\n hold: style.hold.pipe(Effect.flatMap(decode(Delay, \"click\"))),\n keyGap: style.keyGap.pipe(Effect.flatMap(decode(Delay, \"press\"))),\n typing: (text, guarded) =>\n style.typing(text, guarded).pipe(Effect.flatMap(decode(Typing, \"type\"))),\n wheel: (dx, dy) => style.wheel(dx, dy).pipe(Effect.flatMap(decode(Wheel, \"scroll\"))),\n});\n\nconst overBudget = (operation: string) =>\n undispatched(\n operation,\n new InvalidRequest({\n detail: `presentation must take at most ${maximumDurationMillis} milliseconds`,\n }),\n );\n\nconst typing = Effect.fnUntraced(function* (\n text: string,\n gap: number,\n): Effect.fn.Return<ReadonlyArray<TypingEvent>, BrowserError> {\n const events: Array<TypingEvent> = [];\n const releases = new Map<string, number>();\n let due = text === \"\" ? 0 : yield* Random.nextBetween(150, 400);\n let previous = \"\";\n\n for (const character of text) {\n if (due > maximumDurationMillis) return yield* overBudget(\"type\");\n if (/\\s/u.test(previous) && /[\\p{L}\\p{N}]/u.test(character)) due += 60;\n const description = Keys.description(character);\n\n if (description === undefined)\n events.push({ afterMillis: due, phase: \"insert\", key: character });\n else {\n due = Math.max(due, (releases.get(description.code) ?? -1) + 1);\n const released = due + (yield* keyHold);\n\n events.push(\n { afterMillis: due, phase: \"down\", key: character },\n { afterMillis: released, phase: \"up\", key: character },\n );\n releases.set(description.code, released);\n }\n due += yield* Random.nextBetween(gap / 2, (gap * 3) / 2);\n previous = character;\n }\n\n if (events.some((event) => event.afterMillis > maximumDurationMillis))\n return yield* overBudget(\"type\");\n\n return events.toSorted(\n (left, right) =>\n left.afterMillis - right.afterMillis || eventOrder[left.phase] - eventOrder[right.phase],\n );\n});\n\n/** A word is five characters; the gap leaves room for each word's later start. */\nexport const keyGap = (wordsPerMinute: number) => 12_000 / wordsPerMinute - 10;\n\n/**\n * The wheel in 100 px notches, 30 to 140 ms apart, in bursts of at most nine, with 0.6 to 2.6 s\n * between bursts, as people scroll.\n */\nconst bursts = Effect.fnUntraced(function* (dx: number, dy: number) {\n const notches = Math.max(1, Math.ceil(Math.hypot(dx, dy) / 100));\n\n // Even the shortest possible schedule exceeds the cap; refuse before allocating it.\n if (notches > 1 + maximumDurationMillis / 30) return yield* overBudget(\"scroll\");\n const steps: Array<WheelStep> = [];\n let due = 0;\n\n for (let index = 0; index < notches; index++) {\n if (index > 0)\n due += yield* index % 9 === 0 ? Random.nextBetween(600, 2600) : Random.nextBetween(30, 140);\n if (due > maximumDurationMillis) return yield* overBudget(\"scroll\");\n steps.push({ dx: dx / notches, dy: dy / notches, afterMillis: due });\n }\n\n return steps;\n});\n\n/**\n * A wheel that eases over `durationMillis`: a step each frame, sixty a second, slow at first and\n * last, so a scroll that viewers watch glides to where it goes. A style takes it as its `wheel`;\n * a film scrolls on its own time instead.\n */\nexport const eased =\n (durationMillis: number): Style[\"wheel\"] =>\n (dx, dy) => {\n if (!Number.isFinite(durationMillis) || durationMillis < 0)\n return refuse(\"scroll\", \"an eased scroll lasts a finite, nonnegative time\");\n if (durationMillis > maximumDurationMillis) return Effect.fail(overBudget(\"scroll\"));\n const count = Math.max(1, Math.round((durationMillis * 60) / 1000));\n\n // How far along the scroll is at the end of `index` steps, smoothly in and out.\n const along = (index: number) => {\n const x = index / count;\n\n return x * x * (3 - 2 * x);\n };\n\n return Effect.succeed(\n Array.from({ length: count }, (_, index) => {\n const share = along(index + 1) - along(index);\n\n return { dx: dx * share, dy: dy * share, afterMillis: (index * durationMillis) / count };\n }),\n );\n };\n\n/** Input performed for viewers, with this pointer and pace. */\nexport const performed = (options: {\n readonly pointer: MutableRef.MutableRef<Option.Option<Point>>;\n readonly motion: Motion.Planner;\n readonly wordsPerMinute: number;\n}): Style => {\n const gap = keyGap(options.wordsPerMinute);\n\n return {\n shown: true,\n pointer: options.pointer,\n glide: (from, to) => options.motion.plan(from, to),\n hold: pressHold,\n typing: (text) => typing(text, gap),\n keyGap: Random.nextBetween(gap / 2, (gap * 3) / 2),\n wheel: bursts,\n };\n};\n\n/** Input style in this fiber; plain input is the default. */\nexport const Current = Context.Reference<Style>(\"effect-browser/Style\", {\n defaultValue: () => plain,\n});\n\n/** Apply a style through page input, including pages selected later by a browser adapter. */\nexport const provide =\n (style: Style) =>\n <A, E, R>(effect: Effect.Effect<A, E, R>) =>\n Effect.provideService(effect, Current, style);\n"],"mappings":";;;;;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AAQ,iBAAkB;EAAM;CACzF,CAAC,CACH;AACF;;AAGF,MAAa,aAAa,YAIb;CACX,MAAM,MAAM,OAAO,QAAQ,cAAc;CAEzC,OAAO;EACL,OAAO;EACP,SAAS,QAAQ;EACjB,QAAQ,MAAM,OAAO,QAAQ,OAAO,KAAK,MAAM,EAAE;EACjD,MAAM;EACN,SAAS,SAAS,OAAO,MAAM,GAAG;EAClC,QAAQ,OAAO,YAAY,MAAM,GAAI,MAAM,IAAK,CAAC;EACjD,OAAO;CACT;AACF;;AAGA,MAAa,UAAU,QAAQ,UAAiB,wBAAwB,EACtE,oBAAoB,MACtB,CAAC;;AAGD,MAAa,WACV,WACS,WACR,OAAO,eAAe,QAAQ,SAAS,KAAK"}
|
package/dist/Url-B7P-TWwL.d.mts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
declare namespace Url_d_exports {
|
|
2
|
-
export { addresses, parse, quoted, redact, redactWithin, withheld };
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Addresses: reading one the way a person types it, for `Page.goto` and the browser tools alike,
|
|
6
|
-
* and reporting one without the values that are credentials, by one rule that the page script runs
|
|
7
|
-
* too, for the outline's links.
|
|
8
|
-
*/
|
|
9
|
-
/** The URL `input` names. Without a scheme it is a web address: HTTPS, or HTTP on loopback. */
|
|
10
|
-
declare const parse: (input: string) => URL | null;
|
|
11
|
-
/**
|
|
12
|
-
* The rule that reports an address without its credentials. The page script runs it too, so it
|
|
13
|
-
* stays self-contained, as `names.inpage.ts` says a page-side part must.
|
|
14
|
-
*/
|
|
15
|
-
declare const addresses: () => {
|
|
16
|
-
withheld: "••••••••";
|
|
17
|
-
redact: (url: string) => string;
|
|
18
|
-
};
|
|
19
|
-
declare const withheld: "••••••••", redact: (url: string) => string;
|
|
20
|
-
/** An address inside text, as a failure's message quotes one. */
|
|
21
|
-
declare const quoted: RegExp;
|
|
22
|
-
/** `text` with each address in it redacted. */
|
|
23
|
-
declare const redactWithin: (text: string) => string;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { redact as a, quoted as i, addresses as n, redactWithin as o, parse as r, withheld as s, Url_d_exports as t };
|
|
26
|
-
//# sourceMappingURL=Url-B7P-TWwL.d.mts.map
|
package/dist/Url.d.mts
DELETED
package/dist/Url.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Url.mjs","names":[],"sources":["../src/Url.ts"],"sourcesContent":["/**\n * Addresses: reading one the way a person types it, for `Page.goto` and the browser tools alike,\n * and reporting one without the values that are credentials, by one rule that the page script runs\n * too, for the outline's links.\n */\n\nconst scheme = /^[a-z][a-z0-9+.-]*:/i;\n\n// `localhost:3000` and `example.com:8080/a` look like a scheme to the URL parser; a port decides.\nconst hostAndPort = /^[^\\s/?#@:]+:\\d+(?:[/?#]|$)/;\n\nconst loopback = /^(?:localhost|127(?:\\.\\d+){3}|\\[::1\\])(?:[:/?#]|$)/i;\n\n/** The URL `input` names. Without a scheme it is a web address: HTTPS, or HTTP on loopback. */\nexport const parse = (input: string): URL | null => {\n const text = input.trim();\n\n if (scheme.test(text) && !hostAndPort.test(text)) return URL.parse(text);\n\n return URL.parse(`${loopback.test(text) ? \"http\" : \"https\"}://${text}`);\n};\n\n/**\n * The rule that reports an address without its credentials. The page script runs it too, so it\n * stays self-contained, as `names.inpage.ts` says a page-side part must.\n */\nexport const addresses = () => {\n // What a credential's value reads as, as a secret field's text does (`Page.redacted`).\n const withheld = \"••••••••\" as const;\n\n // A parameter's name, compared in lowercase without separators, says it is a credential: a token,\n // secret, password, signature, assertion, session id or one-time code, or a code or key of a kind\n // that signs someone in or signs a request, such as `verification_code` or `api_key`.\n const credential =\n /token|secret|passw|passcode|passphrase|signature|credential|assertion|verifier|bearer|jwt|hmac|apikey|accesskey|privatekey|sess(?:ion)?id|saml(?:response|art)|(?:sig|otp)$|(?:auth|api|access|private|secret|signing|client|encryption|licen[cs]e|session|master|app|device|verification|verify|confirmation|confirm|activation|activate|reset|recovery|login|security|magic|onetime|mfa|2fa|sms|email|otp|oob)(?:code|key)$|^(?:auth|authorization|pwd|pass)$/;\n\n // These names as often say what an address is about, such as a stock code, a support ticket or a\n // conference session. Under them a value is a credential when it looks generated, at least 16\n // characters with letters and digits, as tokens, session ids and authorization codes do.\n const ambiguous = /^(?:code|key|session|sid|ticket)$/;\n\n const secret = (name: string, value: string) => {\n const bare = name.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n\n return (\n value !== \"\" &&\n (credential.test(bare) ||\n (ambiguous.test(bare) && value.length >= 16 && /\\d/.test(value) && /[a-z]/i.test(value)))\n );\n };\n\n // Parameters as written, each credential's value withheld: a query's, a fragment's written as a\n // query, or a path's segments', as a Java session id is.\n const masked = (parameters: string, separator: string) =>\n parameters\n .split(separator)\n .map((parameter) => {\n const [name = \"\", value = \"\"] = [...new URLSearchParams(parameter)][0] ?? [];\n\n return secret(name, value)\n ? `${parameter.slice(0, parameter.indexOf(\"=\") + 1)}${withheld}`\n : parameter;\n })\n .join(separator);\n\n /**\n * `url` as the library reports it: without userinfo, and with each credential's value withheld,\n * so the rest keeps its identity, such as a chart's `?ticker=ETH`. An address without a host,\n * such as `data:` or `about:blank`, is content or a fixed name, and stays as it is.\n */\n const redact = (url: string): string => {\n const parsed = URL.parse(url);\n\n if (parsed === null || parsed.host === \"\") return url;\n parsed.username = \"\";\n parsed.password = \"\";\n parsed.pathname = masked(parsed.pathname, \";\");\n parsed.search = masked(parsed.search.slice(1), \"&\");\n if (parsed.hash.includes(\"=\")) {\n const fragment = parsed.hash.slice(1);\n const question = fragment.indexOf(\"?\");\n // A route before the parameters, as in `#/inbox?token=…`, stays.\n const start = question >= 0 && question < fragment.indexOf(\"=\") ? question + 1 : 0;\n\n parsed.hash = fragment.slice(0, start) + masked(fragment.slice(start), \"&\");\n }\n\n return parsed.href.replaceAll(encodeURIComponent(withheld), withheld);\n };\n\n return { withheld, redact };\n};\n\nexport const { withheld, redact } = addresses();\n\n/** An address inside text, as a failure's message quotes one. */\nexport const quoted = /[a-z][a-z\\d+.-]*:\\/\\/[^\\s\"'<>]+/gi;\n\n/** `text` with each address in it redacted. */\nexport const redactWithin = (text: string) => text.replace(quoted, (url) => redact(url));\n"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAM,SAAS;AAGf,MAAM,cAAc;AAEpB,MAAM,WAAW;;AAGjB,MAAa,SAAS,UAA8B;CAClD,MAAM,OAAO,MAAM,KAAK;CAExB,IAAI,OAAO,KAAK,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,GAAG,OAAO,IAAI,MAAM,IAAI;CAEvE,OAAO,IAAI,MAAM,GAAG,SAAS,KAAK,IAAI,IAAI,SAAS,QAAQ,KAAK,MAAM;AACxE;;;;;AAMA,MAAa,kBAAkB;CAE7B,MAAM,WAAW;CAKjB,MAAM,aACJ;CAKF,MAAM,YAAY;CAElB,MAAM,UAAU,MAAc,UAAkB;EAC9C,MAAM,OAAO,KAAK,YAAY,CAAC,CAAC,QAAQ,cAAc,EAAE;EAExD,OACE,UAAU,OACT,WAAW,KAAK,IAAI,KAClB,UAAU,KAAK,IAAI,KAAK,MAAM,UAAU,MAAM,KAAK,KAAK,KAAK,KAAK,SAAS,KAAK,KAAK;CAE5F;CAIA,MAAM,UAAU,YAAoB,cAClC,WACG,MAAM,SAAS,CAAC,CAChB,KAAK,cAAc;EAClB,MAAM,CAAC,OAAO,IAAI,QAAQ,MAAM,CAAC,GAAG,IAAI,gBAAgB,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;EAE3E,OAAO,OAAO,MAAM,KAAK,IACrB,GAAG,UAAU,MAAM,GAAG,UAAU,QAAQ,GAAG,IAAI,CAAC,IAAI,aACpD;CACN,CAAC,CAAC,CACD,KAAK,SAAS;;;;;;CAOnB,MAAM,UAAU,QAAwB;EACtC,MAAM,SAAS,IAAI,MAAM,GAAG;EAE5B,IAAI,WAAW,QAAQ,OAAO,SAAS,IAAI,OAAO;EAClD,OAAO,WAAW;EAClB,OAAO,WAAW;EAClB,OAAO,WAAW,OAAO,OAAO,UAAU,GAAG;EAC7C,OAAO,SAAS,OAAO,OAAO,OAAO,MAAM,CAAC,GAAG,GAAG;EAClD,IAAI,OAAO,KAAK,SAAS,GAAG,GAAG;GAC7B,MAAM,WAAW,OAAO,KAAK,MAAM,CAAC;GACpC,MAAM,WAAW,SAAS,QAAQ,GAAG;GAErC,MAAM,QAAQ,YAAY,KAAK,WAAW,SAAS,QAAQ,GAAG,IAAI,WAAW,IAAI;GAEjF,OAAO,OAAO,SAAS,MAAM,GAAG,KAAK,IAAI,OAAO,SAAS,MAAM,KAAK,GAAG,GAAG;EAC5E;EAEA,OAAO,OAAO,KAAK,WAAW,mBAAmB,QAAQ,GAAG,QAAQ;CACtE;CAEA,OAAO;EAAE;EAAU;CAAO;AAC5B;AAEA,MAAa,EAAE,UAAU,WAAW,UAAU;;AAG9C,MAAa,SAAS;;AAGtB,MAAa,gBAAgB,SAAiB,KAAK,QAAQ,SAAS,QAAQ,OAAO,GAAG,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { t as BrowserError } from "./BrowserError-BlcmLVzn.mjs";
|
|
2
|
-
import { C as TextInserted, D as WheelScrolled, E as TrackPlanned, T as TrackPerformed, _ as PointerReleased, b as SessionEnding, d as Navigated, f as PageClosed, g as PointerPressed, h as PageUntracked, l as Disconnected, m as PageOpened, n as ActionAnnounced, o as CursorChanged, p as PageLoaded, s as DialogShown, t as Action, u as KeyChanged, y as RequestRefused } from "./BrowserEvent-C2p-NwuU.mjs";
|
|
3
|
-
import { r as Changes } from "./Change-CxT1mp2e.mjs";
|
|
4
|
-
import { r as Frame } from "./Frame-UEH2hO5T.mjs";
|
|
5
|
-
import { Schema } from "effect";
|
|
6
|
-
declare namespace Window_d_exports {
|
|
7
|
-
export { Window };
|
|
8
|
-
}
|
|
9
|
-
declare const Window_base: Schema.Class<Window, Schema.Struct<{
|
|
10
|
-
readonly page: Schema.String;
|
|
11
|
-
/** Where the window starts, in host monotonic milliseconds on the owning browser’s clock. */
|
|
12
|
-
readonly since: Schema.Finite;
|
|
13
|
-
/** Where it ends, never after it was taken. */
|
|
14
|
-
readonly until: Schema.Finite;
|
|
15
|
-
/** The page's events after `since`, up to `until`, oldest first, without the input presentation track. */
|
|
16
|
-
readonly events: Schema.$Array<Schema.Union<readonly [typeof RequestRefused, typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof ActionAnnounced, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>>;
|
|
17
|
-
/**
|
|
18
|
-
* What visibly changed after `since`, up to `until`; absent where `missing` says why. A page's
|
|
19
|
-
* first window starts its record, so the record sees none of it.
|
|
20
|
-
*/
|
|
21
|
-
readonly changes: Schema.optional<typeof Changes>;
|
|
22
|
-
/** Screencast frames painted from `since` to `until`, oldest first, as far back as kept. */
|
|
23
|
-
readonly frames: Schema.$Array<typeof Frame>;
|
|
24
|
-
/**
|
|
25
|
-
* Why each part that could not be read is missing: the read of its changes, by whatever
|
|
26
|
-
* operation failed there, or a moment's picture (`frame`) or outline (`snapshot`).
|
|
27
|
-
*/
|
|
28
|
-
readonly missing: Schema.$Array<typeof BrowserError>;
|
|
29
|
-
}>, {}>;
|
|
30
|
-
/** A page's events, changes and frames over one window of its browser's host clock. */
|
|
31
|
-
declare class Window extends Window_base {}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { Window_d_exports as n, Window as t };
|
|
34
|
-
//# sourceMappingURL=Window-BDa8MtNP.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection-C_jWYIwe.mjs","names":["Errors.InvalidRequest","Url.quoted","Errors.Timeout","Browser.make","Browser.Browser"],"sources":["../src/providers/connection.ts"],"sourcesContent":["/**\n * A browser reached over the Chrome DevTools Protocol: a Chrome started with\n * `--remote-debugging-port`, or any provider that hands out a CDP WebSocket URL.\n *\n * Closing the scope disconnects. It does not close the remote browser; its owner does that.\n *\n * @since 0.3.0\n */\nimport { type DateTime, Effect, Layer, Redacted } from \"effect\";\nimport type { Browser as PlaywrightBrowser } from \"playwright-core\";\n\nimport * as Browser from \"../Browser.ts\";\nimport * as Errors from \"../BrowserError.ts\";\nimport { reasonOf, undispatched } from \"../BrowserError.ts\";\nimport * as Url from \"../Url.ts\";\n\n/** The runtime connector receives the bound and cancellation signal owned by the opening scope. */\nexport interface ConnectOptions {\n readonly timeout: number;\n readonly headers?: Readonly<Record<string, string>> | undefined;\n readonly signal: AbortSignal;\n}\n\n/**\n * Return a real Playwright CDP browser whose `close()` disconnects without ending the remote\n * browser. Honor `signal` to cancel work; a browser returned after cancellation is disconnected.\n * The endpoint and headers may contain credentials and must not be logged.\n */\nexport type Connector = (endpoint: string, options: ConnectOptions) => Promise<PlaywrightBrowser>;\n\nexport interface Options extends Browser.Options, Pick<ConnectOptions, \"headers\"> {\n /**\n * `ws://`, `wss://` or `http://` DevTools endpoint. Often a credential, so it may be redacted;\n * connect failures never include its userinfo, path or query.\n */\n readonly endpoint: string | Redacted.Redacted<string>;\n /** Runtime-supplied Playwright connection. Required by the `workerd` entry. */\n readonly connect?: Connector | undefined;\n /** Identifies the session in `Browser.id`. Defaults to `\"cdp\"`. */\n readonly id?: string | undefined;\n readonly provider?: string | undefined;\n /** Bound on connecting. Defaults to 30 seconds. */\n readonly connectTimeoutMillis?: number | undefined;\n /** When the provider ends the session on its own, as a hosted session's timeout does. */\n readonly expiresAt?: DateTime.Utc | undefined;\n /**\n * A connection apart from this one for the pages' screencasts, as a hosted provider supplies.\n * Without one, each page's capture runs on its own session.\n */\n readonly capture?: Browser.CaptureSource | undefined;\n}\n\n/** Runtime facades supply the default transport; the shared lifetime imports no Node transport. */\nexport const make = (defaultConnect?: Connector) => {\n const open = Effect.fn(\"Cdp.open\")(function* (options: Options) {\n const endpoint = Redacted.isRedacted(options.endpoint)\n ? Redacted.value(options.endpoint)\n : options.endpoint;\n\n const timeout = options.connectTimeoutMillis ?? 30_000;\n const connector = options.connect ?? defaultConnect;\n const headers = options.headers === undefined ? undefined : { ...options.headers };\n\n const invalid = (detail: string) =>\n undispatched(\"connect\", new Errors.InvalidRequest({ detail }));\n\n if (!Number.isFinite(timeout) || timeout <= 0)\n return yield* invalid(\"connectTimeoutMillis must be finite and greater than zero\");\n if (connector === undefined)\n return yield* invalid(\"This runtime requires a CDP connect callback\");\n\n // Inspect before URL normalization or truncation. Withhold an echoed diagnostic entirely so\n // overlapping header values cannot leave fragments; other URLs keep only their scheme and host.\n const redact = (message: string) => {\n if (Object.values(headers ?? {}).some((value) => value !== \"\" && message.includes(value)))\n return \"CDP diagnostic withheld\";\n\n const origins = message.replace(Url.quoted, (url) => {\n const parsed = URL.parse(url);\n\n return parsed?.host ? `${parsed.protocol}//${parsed.host}` : \"<url>\";\n });\n\n return endpoint === \"\" ? origins : origins.replaceAll(endpoint, \"<endpoint>\");\n };\n\n const failed = (cause: unknown, timeoutMillis?: number) =>\n undispatched(\"connect\", reasonOf(cause, timeoutMillis, \"connection\", redact));\n\n // The endpoint is often a credential, so the connect span names no part of it.\n const connected = yield* Effect.acquireRelease(\n Effect.tryPromise({\n try: (signal) =>\n connector(endpoint, {\n timeout,\n signal,\n ...(headers === undefined ? {} : { headers: { ...headers } }),\n }).then(async (browser) => {\n // Cancellation can precede a connector that ignores its signal. Its late browser still\n // belongs to this acquisition, so disconnect it before dropping the promise result.\n if (signal.aborted) await browser.close().catch(() => undefined);\n\n return browser;\n }),\n catch: (cause) => failed(cause, timeout),\n }).pipe(\n Effect.timeoutOrElse({\n duration: timeout,\n orElse: () =>\n Effect.fail(undispatched(\"connect\", new Errors.Timeout({ millis: timeout }))),\n }),\n Effect.withSpan(\"Cdp.connect\", {}, { captureStackTrace: false }),\n ),\n (browser) => Effect.tryPromise(() => browser.close()).pipe(Effect.ignore),\n { interruptible: true },\n );\n\n const context =\n connected.contexts()[0] ??\n (yield* Effect.tryPromise({\n try: () => connected.newContext(),\n catch: (cause) => failed(cause),\n }));\n\n const { id = \"cdp\", provider = \"cdp\", expiresAt, capture } = options;\n\n return yield* Browser.make(context, { id, provider, expiresAt, capture }, options);\n });\n\n const layer = (options: Options): Layer.Layer<Browser.Browser, Errors.BrowserError> =>\n Layer.effect(Browser.Browser, open(options));\n\n return { open, layer };\n};\n"],"mappings":";;;;;;;;;;;;;;AAqDA,MAAa,QAAQ,mBAA+B;CAClD,MAAM,OAAO,OAAO,GAAG,UAAU,CAAC,CAAC,WAAW,SAAkB;EAC9D,MAAM,WAAW,SAAS,WAAW,QAAQ,QAAQ,IACjD,SAAS,MAAM,QAAQ,QAAQ,IAC/B,QAAQ;EAEZ,MAAM,UAAU,QAAQ,wBAAwB;EAChD,MAAM,YAAY,QAAQ,WAAW;EACrC,MAAM,UAAU,QAAQ,YAAY,KAAA,IAAY,KAAA,IAAY,EAAE,GAAG,QAAQ,QAAQ;EAEjF,MAAM,WAAW,WACf,aAAa,WAAW,IAAIA,eAAsB,EAAE,OAAO,CAAC,CAAC;EAE/D,IAAI,CAAC,OAAO,SAAS,OAAO,KAAK,WAAW,GAC1C,OAAO,OAAO,QAAQ,2DAA2D;EACnF,IAAI,cAAc,KAAA,GAChB,OAAO,OAAO,QAAQ,8CAA8C;EAItE,MAAM,UAAU,YAAoB;GAClC,IAAI,OAAO,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,UAAU,UAAU,MAAM,QAAQ,SAAS,KAAK,CAAC,GACtF,OAAO;GAET,MAAM,UAAU,QAAQ,QAAQC,SAAa,QAAQ;IACnD,MAAM,SAAS,IAAI,MAAM,GAAG;IAE5B,OAAO,QAAQ,OAAO,GAAG,OAAO,SAAS,IAAI,OAAO,SAAS;GAC/D,CAAC;GAED,OAAO,aAAa,KAAK,UAAU,QAAQ,WAAW,UAAU,YAAY;EAC9E;EAEA,MAAM,UAAU,OAAgB,kBAC9B,aAAa,WAAW,SAAS,OAAO,eAAe,cAAc,MAAM,CAAC;EAG9E,MAAM,YAAY,OAAO,OAAO,eAC9B,OAAO,WAAW;GAChB,MAAM,WACJ,UAAU,UAAU;IAClB;IACA;IACA,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,QAAQ,EAAE;GAC7D,CAAC,CAAC,CAAC,KAAK,OAAO,YAAY;IAGzB,IAAI,OAAO,SAAS,MAAM,QAAQ,MAAM,CAAC,CAAC,YAAY,KAAA,CAAS;IAE/D,OAAO;GACT,CAAC;GACH,QAAQ,UAAU,OAAO,OAAO,OAAO;EACzC,CAAC,CAAC,CAAC,KACD,OAAO,cAAc;GACnB,UAAU;GACV,cACE,OAAO,KAAK,aAAa,WAAW,IAAIC,QAAe,EAAE,QAAQ,QAAQ,CAAC,CAAC,CAAC;EAChF,CAAC,GACD,OAAO,SAAS,eAAe,CAAC,GAAG,EAAE,mBAAmB,MAAM,CAAC,CACjE,IACC,YAAY,OAAO,iBAAiB,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,GACxE,EAAE,eAAe,KAAK,CACxB;EAEA,MAAM,UACJ,UAAU,SAAS,CAAC,CAAC,OACpB,OAAO,OAAO,WAAW;GACxB,WAAW,UAAU,WAAW;GAChC,QAAQ,UAAU,OAAO,KAAK;EAChC,CAAC;EAEH,MAAM,EAAE,KAAK,OAAO,WAAW,OAAO,WAAW,YAAY;EAE7D,OAAO,OAAOC,OAAa,SAAS;GAAE;GAAI;GAAU;GAAW;EAAQ,GAAG,OAAO;CACnF,CAAC;CAED,MAAM,SAAS,YACb,MAAM,OAAOC,SAAiB,KAAK,OAAO,CAAC;CAE7C,OAAO;EAAE;EAAM;CAAM;AACvB"}
|
package/dist/film/Film.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Film.mjs","names":[],"sources":["../../src/film/Film.ts"],"sourcesContent":["/**\n * Filming a page as a function of time: a new screenshot at each time a caller asks for, of the\n * page as it is at that film time, with what the caller draws over it then. Film time comes from\n * a held page (`Page.hold`), which steps to each frame however long the last one took, so a\n * frame costs one call to step the page and one screenshot; from a page that seeks itself; or\n * from real time. The frames are pictures; encoding them is the caller's.\n *\n * Loading takes real time, so a film holds its time while the page loads a new document: the\n * first frame that finds one waits for it to be ready, measures its layout, and says so as a\n * `Passage`, which `at` sees from then on. On real time the film's start moves on by the wait.\n *\n * @since 0.3.0\n */\nimport { Clock, Duration, Effect, Schema, Stream } from \"effect\";\n\nimport { Action } from \"../Action.ts\";\nimport { type BrowserError, refuse } from \"../BrowserError.ts\";\nimport { monotonicMillis } from \"../Clock.ts\";\nimport { Image } from \"../Frame.ts\";\nimport { Point } from \"../Geometry.ts\";\nimport { Layout, type Picks } from \"../Layout.ts\";\nimport type { Content, Overlay } from \"../Overlay.ts\";\nimport { type Page, ResolvedTarget, type ScreenshotOptions } from \"../Page.ts\";\nimport type { Held, Step } from \"../PageTime.ts\";\n\n/**\n * What a frame shows over the page, and, on held time, where the page is scrolled to then and how\n * its elements are posed, with the page's poses open.\n */\nexport type At = Step;\n\n/** Frames at `fps` from `from` (0 by default) until before `to`, or at these times, in ms. */\nexport type Times =\n | { readonly fps: number; readonly from?: number | undefined; readonly to: number }\n | ReadonlyArray<number>;\n\n/**\n * Where film time comes from: a held page, stepped to each frame; a page's own seek, given each\n * frame's time; or real time from the film's start, each frame taken when its time comes.\n */\nexport type Time =\n | Held\n | { readonly seek: (t: number) => Effect.Effect<void, BrowserError> }\n | \"real\";\n\nexport interface Options<E = never> {\n readonly times: Times;\n readonly time: Time;\n /** What the page shows at a film time, each frame's and each input's, from the passages so far. */\n readonly at?:\n | ((t: number, film: { readonly passages: ReadonlyArray<Passage> }) => Effect.Effect<At, E>)\n | undefined;\n /** What to measure in each new document the film arrives in. */\n readonly picks?: Picks | undefined;\n /**\n * Inputs sent at their film times, in time order, each before the first frame at or after it:\n * the page is moved to its time, and on held time it answers as its time is stepped on. One that\n * fails fails the film.\n */\n readonly inputs?: ReadonlyArray<Contact> | undefined;\n /** The page's overlay, open, that `at`'s drawings go to. */\n readonly overlay?: Overlay | undefined;\n /**\n * How each frame is taken. For frames with more pixels than the layout, paint the page first\n * (`Page.paint`) and take them at `scale: \"device\"`.\n */\n readonly image?: Pick<ScreenshotOptions, \"format\" | \"quality\" | \"scale\"> | undefined;\n /** How many times a frame's screenshot is taken again after it times out. Defaults to 2. */\n readonly retries?: number | undefined;\n}\n\nconst Count = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\nconst Millis = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\n/** An input to send at film time `t`, in ms, with the caller's name for it. */\nexport const Contact = Schema.Struct({\n t: Millis,\n action: Action,\n label: Schema.optional(Schema.String),\n});\n\nexport type Contact = typeof Contact.Type;\n\n/** An input as it was sent, at its film time. */\nexport class Sent extends Schema.Class<Sent>(\"effect-browser/Sent\")({\n t: Millis,\n label: Schema.optional(Schema.String),\n action: Action,\n /** What a click resolved its target to, before its input. */\n target: Schema.optional(ResolvedTarget),\n /** The page's document after it. */\n document: Count,\n}) {}\n\n/** The page's move to a new document, at the film time of the first frame that found it. */\nexport class Passage extends Schema.Class<Passage>(\"effect-browser/Passage\")({\n t: Millis,\n /** The address of the document it left. */\n left: Schema.String,\n document: Count,\n url: Schema.String,\n /** Real milliseconds from the film's last step on the page before to the document's being ready. */\n loadedAfter: Millis,\n /** The new document's layout, ready, with the film's `picks`. */\n layout: Layout,\n}) {}\n\n/** One frame: its picture at film time `t`, in ms, and what taking it cost in real time. */\nexport class Shot extends Schema.Class<Shot>(\"effect-browser/Shot\")({\n index: Count,\n t: Millis,\n image: Image,\n /** The page's document and address after the picture, as `Page.state` gives them. */\n document: Count,\n url: Schema.String,\n /** Where the document was scrolled to, in CSS pixels, on held time. */\n scroll: Schema.optional(Point),\n /** The inputs sent since the frame before. */\n sent: Schema.Array(Sent),\n /** The new document this frame was the first to find. */\n passage: Schema.optional(Passage),\n /** Screenshots that timed out before this one. */\n retries: Count,\n /** Real milliseconds from the frame's start to its picture. */\n took: Millis,\n /**\n * When its picture was taken, in host monotonic milliseconds on the browser's clock, as a\n * `Change`'s times are. On held time, the first shot at or after a change's `at` is the first\n * that shows it; on real time, the page may change while it is pictured.\n */\n at: Schema.Finite,\n}) {}\n\n/** What a film cost, from its shots. */\nexport class Summary extends Schema.Class<Summary>(\"effect-browser/FilmSummary\")({\n frames: Count,\n retries: Count,\n /** Real milliseconds, all frames' and the slowest one's. */\n took: Millis,\n slowest: Millis,\n /** Every input sent, and every passage, in order. */\n sent: Schema.Array(Sent),\n passages: Schema.Array(Passage),\n}) {}\n\nconst operation = \"Film.frames\";\n\nfunction* rated(fps: number, from: number, to: number) {\n const count = Math.round(((to - from) * fps) / 1000);\n\n for (let index = 0; index < count; index++) yield from + (index * 1000) / fps;\n}\n\nconst timesOf = (times: Times): Effect.Effect<Iterable<number>, BrowserError> => {\n if (\"fps\" in times) {\n const { fps, from = 0, to } = times;\n\n return [fps, from, to].every(Number.isFinite) && fps > 0 && from >= 0 && to >= from\n ? Effect.succeed(rated(fps, from, to))\n : refuse(\n operation,\n \"a film's rate is positive and runs from a nonnegative time to a later one\",\n );\n }\n\n return times.every(\n (t, index) => Number.isFinite(t) && t >= 0 && (index === 0 || t >= (times[index - 1] ?? t)),\n )\n ? Effect.succeed(times)\n : refuse(operation, \"a film's times are finite, nonnegative and in order\");\n};\n\n// `move` takes the page to film time `t`, showing `at` there; `drawn` says whether to draw its\n// overlay. On held time, it says where the document is scrolled to. `skip` leaves real time that\n// film time does not count.\ninterface Mover {\n readonly move: (\n t: number,\n at: At,\n drawn: boolean,\n ) => Effect.Effect<Point | undefined, BrowserError>;\n readonly skip: (millis: number) => void;\n}\n\nconst mover = (page: Page, time: Time, overlay: Overlay | undefined): Mover => {\n if (typeof time === \"object\" && \"advance\" in time) {\n let now = 0;\n\n const move: Mover[\"move\"] = (t, { scroll, poses, overlay: content }, drawn) =>\n time\n .advance(Duration.millis(t - now), {\n scroll,\n poses,\n overlay: drawn ? content : undefined,\n })\n .pipe(\n Effect.tap(() =>\n Effect.sync(() => {\n now = t;\n }),\n ),\n );\n\n return { move, skip: () => undefined };\n }\n let start: number | undefined;\n\n const arrive =\n time === \"real\"\n ? (t: number) =>\n Effect.suspend(() => {\n const now = monotonicMillis(page.clock);\n\n start ??= now;\n\n return Effect.sleep(Duration.millis(Math.max(0, start + t - now))).pipe(\n Effect.provideService(Clock.Clock, page.clock),\n );\n })\n : time.seek;\n\n const move: Mover[\"move\"] = (t, at, drawn) =>\n at.scroll === undefined && at.poses === undefined\n ? arrive(t).pipe(\n Effect.andThen(\n drawn && at.overlay !== undefined && overlay !== undefined\n ? overlay.draw(at.overlay)\n : Effect.void,\n ),\n Effect.as(undefined),\n )\n : refuse(operation, \"a film scrolls and poses the page only on held time\");\n\n return {\n move,\n skip: (millis) => {\n if (start !== undefined) start += millis;\n },\n };\n};\n\n// A new screenshot, taken again after one that times out, with how many did.\nconst picture = (page: Page, image: Options[\"image\"], retries: number) =>\n Effect.gen(function* () {\n let timedOut = 0;\n\n const taken = yield* page.screenshot({ ...image, maxAge: 0 }).pipe(\n Effect.tapError((error) =>\n Effect.sync(() => (timedOut += error.reason._tag === \"Timeout\" ? 1 : 0)),\n ),\n Effect.retry({ times: retries, while: (error) => error.reason._tag === \"Timeout\" }),\n );\n\n return { image: taken, retries: timedOut };\n });\n\nconst keyOf = (content: Content | undefined) =>\n content === undefined ? undefined : content._tag === \"Svg\" ? `svg:${content.markup}` : \"empty\";\n\n/**\n * Frames of `page` at `times`, one at a time: each moves the page to its film time, draws what\n * `at` gives there when it changed, and takes a new screenshot, again after one that times out.\n */\nexport const frames = <E = never>(\n page: Page,\n options: Options<E>,\n): Stream.Stream<Shot, BrowserError | E> =>\n Stream.unwrap(\n Effect.gen(function* () {\n const times = yield* timesOf(options.times);\n const retries = options.retries ?? 2;\n\n if (!Number.isSafeInteger(retries) || retries < 0)\n return yield* refuse(operation, \"retries must be a nonnegative safe integer\");\n const inputs = (options.inputs ?? []).toSorted((one, other) => one.t - other.t);\n\n if (!inputs.every(({ t }) => Number.isFinite(t) && t >= 0))\n return yield* refuse(operation, \"an input's time is finite and nonnegative\");\n let next = 0;\n const { move, skip } = mover(page, options.time, options.overlay);\n const now = () => monotonicMillis(page.clock);\n const passages: Array<Passage> = [];\n\n const at = (t: number) =>\n options.at === undefined ? Effect.succeed<At>({}) : options.at(t, { passages });\n\n let shown: string | undefined;\n let { document: seen, url: was } = yield* page.state;\n let stepped = now();\n\n // Take the page to film time `t`, and note when, as a passage's wait counts from it.\n const step = (t: number, showing: At, drawn: boolean) =>\n Effect.tap(move(t, showing, drawn), () => Effect.sync(() => (stepped = now())));\n\n // A document the page moved to since the last frame, once it is ready.\n const arrival = (t: number) =>\n Effect.gen(function* () {\n const { document, url } = yield* page.state;\n\n if (document === seen) return undefined;\n yield* page.ready();\n const layout = yield* page.layout(options.picks ?? {});\n const loadedAfter = now() - stepped;\n\n skip(loadedAfter);\n const passage = new Passage({ t, left: was, document, url, loadedAfter, layout });\n\n [seen, was] = [document, url];\n passages.push(passage);\n\n return passage;\n });\n\n const send = ({ t, action, label }: Contact) =>\n Effect.gen(function* () {\n yield* step(t, yield* at(t), false);\n const done = yield* page.perform(action);\n const { document } = yield* page.state;\n const target = Schema.is(ResolvedTarget)(done) ? done : undefined;\n\n return new Sent({ t, label, action, target, document });\n });\n\n const shoot = (t: number, index: number) =>\n Effect.gen(function* () {\n const started = now();\n const sent: Array<Sent> = [];\n\n for (\n let input = inputs[next];\n input !== undefined && input.t <= t;\n input = inputs[++next]\n )\n sent.push(yield* send(input));\n const passage = yield* arrival(t);\n const showing = yield* at(t);\n const key = keyOf(showing.overlay);\n\n if (key !== undefined && options.overlay === undefined)\n return yield* refuse(operation, \"drawing needs the page's overlay, open, in `overlay`\");\n const scroll = yield* step(t, showing, key !== undefined && key !== shown);\n\n shown = key ?? shown;\n const taken = yield* picture(page, options.image, retries);\n const pictured = now();\n const { document, url } = yield* page.state;\n\n return new Shot({\n index,\n t,\n image: taken.image,\n document,\n url,\n scroll,\n sent,\n passage,\n retries: taken.retries,\n took: pictured - started,\n at: pictured,\n });\n });\n\n return Stream.fromIterable(times).pipe(\n Stream.zipWithIndex,\n Stream.mapEffect(([t, index]) => shoot(t, index)),\n );\n }),\n );\n\n/** Run a film's shots, which a caller has usually written out on the way, to what they cost. */\nexport const summary = <E, R>(shots: Stream.Stream<Shot, E, R>): Effect.Effect<Summary, E, R> =>\n Stream.runFold(\n shots,\n () => new Summary({ frames: 0, retries: 0, took: 0, slowest: 0, sent: [], passages: [] }),\n (sum, shot) =>\n new Summary({\n frames: sum.frames + 1,\n retries: sum.retries + shot.retries,\n took: sum.took + shot.took,\n slowest: Math.max(sum.slowest, shot.took),\n sent: [...sum.sent, ...shot.sent],\n passages: shot.passage === undefined ? sum.passages : [...sum.passages, shot.passage],\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAM,QAAQ,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAC/D,MAAM,SAAS,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;;AAGnE,MAAa,UAAU,OAAO,OAAO;CACnC,GAAG;CACH,QAAQ;CACR,OAAO,OAAO,SAAS,OAAO,MAAM;AACtC,CAAC;;AAKD,IAAa,OAAb,cAA0B,OAAO,MAAY,qBAAqB,CAAC,CAAC;CAClE,GAAG;CACH,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,QAAQ;;CAER,QAAQ,OAAO,SAAS,cAAc;;CAEtC,UAAU;AACZ,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,UAAb,cAA6B,OAAO,MAAe,wBAAwB,CAAC,CAAC;CAC3E,GAAG;;CAEH,MAAM,OAAO;CACb,UAAU;CACV,KAAK,OAAO;;CAEZ,aAAa;;CAEb,QAAQ;AACV,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAA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