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
package/dist/ai/Tabs.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { t as __exportAll } from "../internal/rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Function, Schema } from "effect";
|
|
3
|
+
//#region src/ai/Tabs.ts
|
|
4
|
+
/**
|
|
5
|
+
* The tabs the tools follow in a browser, as data to save and resume: which one is shown, which
|
|
6
|
+
* were seen, and each one's stable ref. Independent of browser effects.
|
|
7
|
+
*
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @since 0.3.0
|
|
10
|
+
*/
|
|
11
|
+
var Tabs_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Tabs: () => Tabs,
|
|
13
|
+
follow: () => follow,
|
|
14
|
+
make: () => make,
|
|
15
|
+
selected: () => selected
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* @stability stable
|
|
19
|
+
* @category schemas
|
|
20
|
+
* @since 0.3.0
|
|
21
|
+
*/
|
|
22
|
+
var Tabs = class extends Schema.Class("effect-browser/ai/Tabs")({
|
|
23
|
+
shown: Schema.optional(Schema.String),
|
|
24
|
+
seen: Schema.Array(Schema.String),
|
|
25
|
+
refs: Schema.Record(Schema.String, Schema.String)
|
|
26
|
+
}) {};
|
|
27
|
+
/**
|
|
28
|
+
* @stability stable
|
|
29
|
+
* @category constructors
|
|
30
|
+
* @since 0.3.0
|
|
31
|
+
*/
|
|
32
|
+
const make = (seen = []) => new Tabs({
|
|
33
|
+
seen,
|
|
34
|
+
refs: {}
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* The newest unseen tab wins unless following is disabled; a closed selection falls back.
|
|
38
|
+
*
|
|
39
|
+
* @stability stable
|
|
40
|
+
* @category combinators
|
|
41
|
+
* @since 0.3.0
|
|
42
|
+
*/
|
|
43
|
+
const follow = Function.dual(3, (state, open, policy) => {
|
|
44
|
+
const newest = open.filter((id) => !state.seen.includes(id)).at(-1);
|
|
45
|
+
const selected = policy !== "never" && newest !== void 0 ? newest : open.find((id) => id === state.shown) ?? open[0];
|
|
46
|
+
const refs = { ...state.refs };
|
|
47
|
+
for (const id of open) if (refs[id] === void 0) {
|
|
48
|
+
let next = Object.keys(refs).length + 1;
|
|
49
|
+
while (Object.values(refs).includes(`tab${next}`)) next++;
|
|
50
|
+
refs[id] = `tab${next}`;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
selected,
|
|
54
|
+
state: new Tabs({
|
|
55
|
+
shown: selected,
|
|
56
|
+
seen: [.../* @__PURE__ */ new Set([...state.seen, ...open])],
|
|
57
|
+
refs
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* The open tab that `ref` names, if any.
|
|
63
|
+
*
|
|
64
|
+
* @stability stable
|
|
65
|
+
* @category combinators
|
|
66
|
+
* @since 0.3.0
|
|
67
|
+
*/
|
|
68
|
+
const selected = Function.dual(3, (state, open, ref) => open.find((id) => state.refs[id] === ref));
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Tabs, follow, make, selected, Tabs_exports as t };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=Tabs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.mjs","names":[],"sources":["../../src/ai/Tabs.ts"],"sourcesContent":["/**\n * The tabs the tools follow in a browser, as data to save and resume: which one is shown, which\n * were seen, and each one's stable ref. Independent of browser effects.\n *\n * @stability stable\n * @since 0.3.0\n */\nimport { Function, Schema } from \"effect\";\n\n/**\n * @stability stable\n * @category schemas\n * @since 0.3.0\n */\nexport class Tabs extends Schema.Class<Tabs>(\"effect-browser/ai/Tabs\")({\n shown: Schema.optional(Schema.String),\n seen: Schema.Array(Schema.String),\n refs: Schema.Record(Schema.String, Schema.String),\n}) {}\n\n/**\n * @stability stable\n * @category constructors\n * @since 0.3.0\n */\nexport const make = (seen: ReadonlyArray<string> = []): Tabs => new Tabs({ seen, refs: {} });\n\n/**\n * The newest unseen tab wins unless following is disabled; a closed selection falls back.\n *\n * @stability stable\n * @category combinators\n * @since 0.3.0\n */\nexport const follow: {\n (\n open: ReadonlyArray<string>,\n policy: \"select\" | \"front\" | \"never\",\n ): (state: Tabs) => { readonly selected: string | undefined; readonly state: Tabs };\n (\n state: Tabs,\n open: ReadonlyArray<string>,\n policy: \"select\" | \"front\" | \"never\",\n ): { readonly selected: string | undefined; readonly state: Tabs };\n} = Function.dual(\n 3,\n (state: Tabs, open: ReadonlyArray<string>, policy: \"select\" | \"front\" | \"never\") => {\n const newest = open.filter((id) => !state.seen.includes(id)).at(-1);\n\n const selected =\n policy !== \"never\" && newest !== undefined\n ? newest\n : (open.find((id) => id === state.shown) ?? open[0]);\n\n const refs = { ...state.refs };\n\n for (const id of open)\n if (refs[id] === undefined) {\n let next = Object.keys(refs).length + 1;\n\n while (Object.values(refs).includes(`tab${next}`)) next++;\n refs[id] = `tab${next}`;\n }\n\n return {\n selected,\n state: new Tabs({ shown: selected, seen: [...new Set([...state.seen, ...open])], refs }),\n };\n },\n);\n\n/**\n * The open tab that `ref` names, if any.\n *\n * @stability stable\n * @category combinators\n * @since 0.3.0\n */\nexport const selected: {\n (open: ReadonlyArray<string>, ref: string): (state: Tabs) => string | undefined;\n (state: Tabs, open: ReadonlyArray<string>, ref: string): string | undefined;\n} = Function.dual(3, (state: Tabs, open: ReadonlyArray<string>, ref: string) =>\n open.find((id) => state.refs[id] === ref),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,IAAa,OAAb,cAA0B,OAAO,MAAY,wBAAwB,CAAC,CAAC;CACrE,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,MAAM,OAAO,MAAM,OAAO,MAAM;CAChC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM;AAClD,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,MAAa,QAAQ,OAA8B,CAAC,MAAY,IAAI,KAAK;CAAE;CAAM,MAAM,CAAC;AAAE,CAAC;;;;;;;;AAS3F,MAAa,SAUT,SAAS,KACX,IACC,OAAa,MAA6B,WAAyC;CAClF,MAAM,SAAS,KAAK,QAAQ,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;CAElE,MAAM,WACJ,WAAW,WAAW,WAAW,KAAA,IAC7B,SACC,KAAK,MAAM,OAAO,OAAO,MAAM,KAAK,KAAK,KAAK;CAErD,MAAM,OAAO,EAAE,GAAG,MAAM,KAAK;CAE7B,KAAK,MAAM,MAAM,MACf,IAAI,KAAK,QAAQ,KAAA,GAAW;EAC1B,IAAI,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS;EAEtC,OAAO,OAAO,OAAO,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,GAAG;EACnD,KAAK,MAAM,MAAM;CACnB;CAEF,OAAO;EACL;EACA,OAAO,IAAI,KAAK;GAAE,OAAO;GAAU,MAAM,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;GAAG;EAAK,CAAC;CACzF;AACF,CACF;;;;;;;;AASA,MAAa,WAGT,SAAS,KAAK,IAAI,OAAa,MAA6B,QAC9D,KAAK,MAAM,OAAO,MAAM,KAAK,QAAQ,GAAG,CAC1C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as BrowserError } from "../internal/BrowserError-CsuRYcDX.mjs";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
declare namespace ToolError_d_exports {
|
|
4
|
+
export { ToolError, fromBrowserError, isToolError };
|
|
5
|
+
}
|
|
6
|
+
declare const ToolError_base: Schema.Class<ToolError, Schema.TaggedStruct<"ToolError", {
|
|
7
|
+
readonly code: Schema.Literals<readonly ["invalid", "browser"]>;
|
|
8
|
+
readonly message: Schema.String;
|
|
9
|
+
/** Whether the input went: never replay one that is not `not-dispatched`. */
|
|
10
|
+
readonly dispatch: Schema.optionalKey<Schema.Literals<readonly ["not-dispatched", "possibly-dispatched"]>>;
|
|
11
|
+
}>, import("effect/Cause").YieldableError>;
|
|
12
|
+
/**
|
|
13
|
+
* @stability stable
|
|
14
|
+
* @category errors
|
|
15
|
+
* @since 0.3.0
|
|
16
|
+
*/
|
|
17
|
+
export declare class ToolError extends ToolError_base {}
|
|
18
|
+
/**
|
|
19
|
+
* @stability stable
|
|
20
|
+
* @category guards
|
|
21
|
+
* @since 0.3.0
|
|
22
|
+
*/
|
|
23
|
+
export declare const isToolError: <I>(input: I) => input is I & ToolError;
|
|
24
|
+
/**
|
|
25
|
+
* A browser operation's failure as the tools report it.
|
|
26
|
+
*
|
|
27
|
+
* @stability stable
|
|
28
|
+
* @category constructors
|
|
29
|
+
* @since 0.3.0
|
|
30
|
+
*/
|
|
31
|
+
export declare const fromBrowserError: (error: BrowserError) => ToolError;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ToolError_d_exports as t };
|
|
34
|
+
//# sourceMappingURL=ToolError.d.mts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as Tabs_d_exports } from "../internal/Tabs-dXMscIUQ.mjs";
|
|
2
|
+
import { t as ToolError_d_exports } from "./ToolError.mjs";
|
|
3
|
+
import { t as PageControl_d_exports } from "./PageControl.mjs";
|
|
4
|
+
import { t as BrowserTools_d_exports } from "./BrowserTools.mjs";
|
|
5
|
+
import { t as PromptCache_d_exports } from "./PromptCache.mjs";
|
|
6
|
+
export { BrowserTools_d_exports as BrowserTools, PageControl_d_exports as PageControl, PromptCache_d_exports as PromptCache, Tabs_d_exports as Tabs, ToolError_d_exports as ToolError };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { t as BrowserTools_exports } from "../internal/BrowserTools-Yi3lOX4h.mjs";
|
|
2
|
+
import { n as ToolError_exports } from "../internal/ToolError-DArsRS2m.mjs";
|
|
3
|
+
import { t as Tabs_exports } from "./Tabs.mjs";
|
|
4
|
+
import { t as PageControl_exports } from "./PageControl.mjs";
|
|
5
|
+
import { t as PromptCache_exports } from "./PromptCache.mjs";
|
|
6
|
+
export { BrowserTools_exports as BrowserTools, PageControl_exports as PageControl, PromptCache_exports as PromptCache, Tabs_exports as Tabs, ToolError_exports as ToolError };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import { n as Action_d_exports } from "./Action-
|
|
2
|
-
import {
|
|
3
|
-
import { a as BrowserEvent_d_exports } from "./BrowserEvent-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
|
|
8
|
-
import { r as Overlay_d_exports } from "./Overlay-CoGw5tL_.mjs";
|
|
9
|
-
import { n as Pose_d_exports } from "./Pose-2qqGzPvb.mjs";
|
|
10
|
-
import { n as PageTime_d_exports } from "./PageTime-68UPUZpZ.mjs";
|
|
11
|
-
import { i as Snapshot_d_exports } from "./Snapshot-CtBVOtuu.mjs";
|
|
12
|
-
import { n as Window_d_exports } from "./Window-BDa8MtNP.mjs";
|
|
13
|
-
import { t as ActionPort_d_exports } from "./ActionPort.mjs";
|
|
14
|
-
import { n as Browser_d_exports } from "./Browser-DGR6ZEYo.mjs";
|
|
15
|
-
import { t as Clock_d_exports } from "./Clock-Du5nP-nK.mjs";
|
|
16
|
-
import { t as Url_d_exports } from "./Url-B7P-TWwL.mjs";
|
|
17
|
-
import { t as Style_d_exports } from "./Style.mjs";
|
|
18
|
-
export { Action_d_exports as Action, ActionPort_d_exports as ActionPort, Browser_d_exports as Browser, BrowserError_d_exports as BrowserError, BrowserEvent_d_exports as BrowserEvent, Change_d_exports as Change, Clock_d_exports as Clock, Frame_d_exports as Frame, Geometry_d_exports as Geometry, Layout_d_exports as Layout, Overlay_d_exports as Overlay, Page_d_exports as Page, PageTime_d_exports as PageTime, Pose_d_exports as Pose, Snapshot_d_exports as Snapshot, Style_d_exports as Style, Url_d_exports as Url, Window_d_exports as Window };
|
|
1
|
+
import { n as Action_d_exports } from "./internal/Action-CkanNTUw.mjs";
|
|
2
|
+
import { r as BrowserError_d_exports } from "./internal/BrowserError-CsuRYcDX.mjs";
|
|
3
|
+
import { a as BrowserEvent_d_exports } from "./internal/BrowserEvent-tGPYYf6R.mjs";
|
|
4
|
+
import { A as PageTime_d_exports, C as Window_d_exports, D as Text_d_exports, P as Pose_d_exports, U as Layout_d_exports, dt as Change_d_exports, it as Snapshot_d_exports, s as Page_d_exports, xt as Frame_d_exports, z as Overlay_d_exports } from "./internal/Page-BfGxn7oN.mjs";
|
|
5
|
+
import { n as Browser_d_exports } from "./internal/Browser-DD9Vm1c-.mjs";
|
|
6
|
+
import { t as InputStyle_d_exports } from "./InputStyle.mjs";
|
|
7
|
+
export { Action_d_exports as Action, Browser_d_exports as Browser, BrowserError_d_exports as BrowserError, BrowserEvent_d_exports as BrowserEvent, Change_d_exports as Change, Frame_d_exports as Frame, InputStyle_d_exports as InputStyle, Layout_d_exports as Layout, Overlay_d_exports as Overlay, Page_d_exports as Page, PageTime_d_exports as PageTime, Pose_d_exports as Pose, Snapshot_d_exports as Snapshot, Text_d_exports as Text, Window_d_exports as Window };
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { t as Geometry_exports } from "./Geometry.mjs";
|
|
2
|
-
import { t as Url_exports } from "./Url.mjs";
|
|
3
1
|
import { t as Action_exports } from "./Action.mjs";
|
|
4
2
|
import { t as BrowserEvent_exports } from "./BrowserEvent.mjs";
|
|
5
3
|
import { t as BrowserError_exports } from "./BrowserError.mjs";
|
|
4
|
+
import { n as Browser_exports } from "./internal/Browser-vzD7i2oj.mjs";
|
|
5
|
+
import { r as Page_exports } from "./internal/Page-DqF-tuTx.mjs";
|
|
6
|
+
import { n as InputStyle_exports } from "./internal/InputStyle-CPzxoN4g.mjs";
|
|
6
7
|
import { t as Frame_exports } from "./Frame.mjs";
|
|
7
|
-
import { a as Page_exports } from "./Page-BaAOshxo.mjs";
|
|
8
|
-
import { t as Snapshot_exports } from "./Snapshot.mjs";
|
|
9
|
-
import { t as ActionPort_exports } from "./ActionPort.mjs";
|
|
10
|
-
import { t as Clock_exports } from "./Clock.mjs";
|
|
11
|
-
import { n as Browser_exports } from "./Browser-CAQFhTkM.mjs";
|
|
12
|
-
import { n as Style_exports } from "./Style-T3ezDYLI.mjs";
|
|
13
8
|
import { t as Layout_exports } from "./Layout.mjs";
|
|
9
|
+
import { t as Snapshot_exports } from "./Snapshot.mjs";
|
|
10
|
+
import { t as Text_exports } from "./Text.mjs";
|
|
14
11
|
import { t as Change_exports } from "./Change.mjs";
|
|
15
12
|
import { t as Window_exports } from "./Window.mjs";
|
|
16
13
|
import { t as Pose_exports } from "./Pose.mjs";
|
|
17
14
|
import { t as Overlay_exports } from "./Overlay.mjs";
|
|
18
15
|
import { t as PageTime_exports } from "./PageTime.mjs";
|
|
19
|
-
export { Action_exports as Action,
|
|
16
|
+
export { Action_exports as Action, Browser_exports as Browser, BrowserError_exports as BrowserError, BrowserEvent_exports as BrowserEvent, Change_exports as Change, Frame_exports as Frame, InputStyle_exports as InputStyle, Layout_exports as Layout, Overlay_exports as Overlay, Page_exports as Page, PageTime_exports as PageTime, Pose_exports as Pose, Snapshot_exports as Snapshot, Text_exports as Text, Window_exports as Window };
|
|
@@ -2,22 +2,42 @@ import { Schema } from "effect";
|
|
|
2
2
|
declare namespace Action_d_exports {
|
|
3
3
|
export { Action, ClickOptions, Name, PressOptions, ScrollOptions, TypeOptions, nameOf, recorded, targetOf };
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* @stability stable
|
|
7
|
+
* @category options
|
|
8
|
+
* @since 0.3.0
|
|
9
|
+
*/
|
|
5
10
|
declare const ClickOptions: Schema.Struct<{
|
|
6
11
|
readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
|
|
7
12
|
readonly clickCount: Schema.optional<Schema.Finite>;
|
|
8
13
|
readonly holdMillis: Schema.optional<Schema.Finite>;
|
|
9
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* @stability stable
|
|
17
|
+
* @category options
|
|
18
|
+
* @since 0.3.0
|
|
19
|
+
*/
|
|
10
20
|
declare const TypeOptions: Schema.Struct<{
|
|
11
21
|
readonly into: Schema.optional<Schema.String>;
|
|
12
22
|
readonly replace: Schema.optional<Schema.Boolean>;
|
|
13
23
|
readonly submit: Schema.optional<Schema.Boolean>;
|
|
14
24
|
readonly secret: Schema.optional<Schema.Boolean>;
|
|
15
25
|
}>;
|
|
26
|
+
/**
|
|
27
|
+
* @stability stable
|
|
28
|
+
* @category options
|
|
29
|
+
* @since 0.3.0
|
|
30
|
+
*/
|
|
16
31
|
declare const PressOptions: Schema.Struct<{
|
|
17
32
|
readonly on: Schema.optional<Schema.String>;
|
|
18
33
|
readonly times: Schema.optional<Schema.Finite>;
|
|
19
34
|
readonly holdMillis: Schema.optional<Schema.Finite>;
|
|
20
35
|
}>;
|
|
36
|
+
/**
|
|
37
|
+
* @stability stable
|
|
38
|
+
* @category options
|
|
39
|
+
* @since 0.3.0
|
|
40
|
+
*/
|
|
21
41
|
declare const ScrollOptions: Schema.Struct<{
|
|
22
42
|
readonly at: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
23
43
|
readonly x: Schema.Finite;
|
|
@@ -26,6 +46,11 @@ declare const ScrollOptions: Schema.Struct<{
|
|
|
26
46
|
readonly dx: Schema.optional<Schema.Finite>;
|
|
27
47
|
readonly dy: Schema.optional<Schema.Finite>;
|
|
28
48
|
}>;
|
|
49
|
+
/**
|
|
50
|
+
* @stability stable
|
|
51
|
+
* @category schemas
|
|
52
|
+
* @since 0.3.0
|
|
53
|
+
*/
|
|
29
54
|
declare const Action: Schema.TaggedUnion<{
|
|
30
55
|
readonly Act: Schema.TaggedStruct<"Act", {
|
|
31
56
|
readonly document: Schema.Int;
|
|
@@ -94,17 +119,52 @@ declare const Action: Schema.TaggedUnion<{
|
|
|
94
119
|
}>>;
|
|
95
120
|
}>;
|
|
96
121
|
}>;
|
|
122
|
+
/**
|
|
123
|
+
* @stability stable
|
|
124
|
+
* @category models
|
|
125
|
+
* @since 0.3.0
|
|
126
|
+
*/
|
|
97
127
|
type Action = typeof Action.Type;
|
|
128
|
+
/**
|
|
129
|
+
* @stability stable
|
|
130
|
+
* @category schemas
|
|
131
|
+
* @since 0.3.0
|
|
132
|
+
*/
|
|
98
133
|
declare const Name: Schema.Literals<readonly ["click", "hover", "drag", "type", "press", "scroll", "select", "navigate", "back", "reload", "act"]>;
|
|
134
|
+
/**
|
|
135
|
+
* @stability stable
|
|
136
|
+
* @category models
|
|
137
|
+
* @since 0.3.0
|
|
138
|
+
*/
|
|
99
139
|
type Name = typeof Name.Type;
|
|
100
|
-
/**
|
|
101
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Effective semantics suitable for policy and records; credentials never survive.
|
|
142
|
+
*
|
|
143
|
+
* @stability stable
|
|
144
|
+
* @category combinators
|
|
145
|
+
* @since 0.3.0
|
|
146
|
+
*/
|
|
147
|
+
declare const recorded: {
|
|
148
|
+
(revealed: boolean): (value: Action) => Action;
|
|
149
|
+
(value: Action, revealed: boolean): Action;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* @stability stable
|
|
153
|
+
* @category combinators
|
|
154
|
+
* @since 0.3.0
|
|
155
|
+
*/
|
|
102
156
|
declare const nameOf: (action: Action) => Name;
|
|
103
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* The primary target, if this action addresses an element or point.
|
|
159
|
+
*
|
|
160
|
+
* @stability stable
|
|
161
|
+
* @category combinators
|
|
162
|
+
* @since 0.3.0
|
|
163
|
+
*/
|
|
104
164
|
declare const targetOf: (action: Action) => string | {
|
|
105
165
|
readonly x: number;
|
|
106
166
|
readonly y: number;
|
|
107
167
|
} | undefined;
|
|
108
168
|
//#endregion
|
|
109
169
|
export { PressOptions as a, nameOf as c, Name as i, recorded as l, Action_d_exports as n, ScrollOptions as o, ClickOptions as r, TypeOptions as s, Action as t, targetOf as u };
|
|
110
|
-
//# sourceMappingURL=Action-
|
|
170
|
+
//# sourceMappingURL=Action-CkanNTUw.d.mts.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { t as BrowserError } from "./BrowserError-
|
|
2
|
-
import { a as BrowserEvent_d_exports, c as DisconnectCause, i as BrowserEvent, v as RecordedEvent } from "./BrowserEvent-
|
|
3
|
-
import {
|
|
1
|
+
import { t as BrowserError } from "./BrowserError-CsuRYcDX.mjs";
|
|
2
|
+
import { a as BrowserEvent_d_exports, c as DisconnectCause, i as BrowserEvent, v as RecordedEvent } from "./BrowserEvent-tGPYYf6R.mjs";
|
|
3
|
+
import { i as InputGuard, o as Page, s as Page_d_exports } from "./Page-BfGxn7oN.mjs";
|
|
4
4
|
import { Context, DateTime, Duration, Effect, Option, Schema, Scope, Stream } from "effect";
|
|
5
5
|
import { BrowserContext } from "playwright-core";
|
|
6
6
|
declare namespace Browser_d_exports {
|
|
7
|
-
export { Browser$1 as Browser, CaptureSource, EventOptions, InitScript, Options, RequestDecision, RequestPolicy, Service, SuspendOptions, Suspension, make };
|
|
7
|
+
export { Browser$1 as Browser, CaptureSource, EventOptions, InitScript, Options, RequestDecision, RequestPolicy, Service, SuspendOptions, Suspension, make, newPage };
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A script that documents run before their own, such as a consent-banner remover.
|
|
11
|
+
*
|
|
12
|
+
* @stability stable
|
|
13
|
+
* @category models
|
|
14
|
+
* @since 0.3.0
|
|
15
|
+
*/
|
|
10
16
|
interface InitScript {
|
|
11
17
|
/**
|
|
12
18
|
* The documents that run it, by a pattern their address (`location.href`) matches; every
|
|
@@ -16,7 +22,13 @@ interface InitScript {
|
|
|
16
22
|
readonly match?: RegExp | undefined;
|
|
17
23
|
readonly source: string;
|
|
18
24
|
}
|
|
19
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Consumer-owned decision for one request caught by a narrow URL pattern.
|
|
27
|
+
*
|
|
28
|
+
* @stability stable
|
|
29
|
+
* @category models
|
|
30
|
+
* @since 0.3.0
|
|
31
|
+
*/
|
|
20
32
|
type RequestDecision = {
|
|
21
33
|
readonly _tag: "Allowed";
|
|
22
34
|
} | {
|
|
@@ -29,6 +41,11 @@ type RequestDecision = {
|
|
|
29
41
|
readonly headers?: Readonly<Record<string, string>> | undefined;
|
|
30
42
|
readonly body: string;
|
|
31
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* @stability stable
|
|
46
|
+
* @category models
|
|
47
|
+
* @since 0.3.0
|
|
48
|
+
*/
|
|
32
49
|
interface RequestPolicy {
|
|
33
50
|
readonly patterns: ReadonlyArray<string>;
|
|
34
51
|
/**
|
|
@@ -44,6 +61,11 @@ interface RequestPolicy {
|
|
|
44
61
|
}) => Effect.Effect<RequestDecision, BrowserError>;
|
|
45
62
|
readonly timeout?: Duration.Input | undefined;
|
|
46
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @stability stable
|
|
66
|
+
* @category options
|
|
67
|
+
* @since 0.3.0
|
|
68
|
+
*/
|
|
47
69
|
interface Options {
|
|
48
70
|
/** Fixed viewport applied before each existing or newly opened page registers. */
|
|
49
71
|
readonly viewport?: {
|
|
@@ -61,7 +83,7 @@ interface Options {
|
|
|
61
83
|
/** Bound on each navigation; finite and positive. Defaults to 30 seconds. */
|
|
62
84
|
readonly navigationTimeout?: Duration.Input | undefined;
|
|
63
85
|
/**
|
|
64
|
-
* How long each page keeps screencast frames for `
|
|
86
|
+
* How long each page keeps screencast frames for `Frame.recent`, measured back from the newest;
|
|
65
87
|
* finite and positive. Defaults to 5 seconds, a moment's default window.
|
|
66
88
|
*/
|
|
67
89
|
readonly frameHistory?: Duration.Input | undefined;
|
|
@@ -74,7 +96,7 @@ interface Options {
|
|
|
74
96
|
/** Scripts that new documents run before their own, each where its `match` allows. */
|
|
75
97
|
readonly initScripts?: ReadonlyArray<InitScript> | undefined;
|
|
76
98
|
/**
|
|
77
|
-
* Run a page clock in each top document before its own scripts, so `
|
|
99
|
+
* Run a page clock in each top document before its own scripts, so `PageTime.hold` can hold and
|
|
78
100
|
* step its time. It keeps real time until held, but replaces the page's timers, animation
|
|
79
101
|
* frames, `Date` and `performance.now`, which a page script can notice. See `PageTime`.
|
|
80
102
|
*/
|
|
@@ -86,10 +108,20 @@ interface Options {
|
|
|
86
108
|
*/
|
|
87
109
|
readonly maxPages?: number | undefined;
|
|
88
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* @stability stable
|
|
113
|
+
* @category options
|
|
114
|
+
* @since 0.3.0
|
|
115
|
+
*/
|
|
89
116
|
interface EventOptions {
|
|
90
117
|
/** Resume after this sequence; 0 replays from the beginning if it is still retained. */
|
|
91
118
|
readonly after?: number | undefined;
|
|
92
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* @stability stable
|
|
122
|
+
* @category options
|
|
123
|
+
* @since 0.3.0
|
|
124
|
+
*/
|
|
93
125
|
interface SuspendOptions {
|
|
94
126
|
/** Finite, nonnegative drain bound; defaults to the browser's navigationTimeout. */
|
|
95
127
|
readonly drain?: Duration.Input | undefined;
|
|
@@ -98,7 +130,13 @@ declare const Suspension_base: Schema.Class<Suspension, Schema.Struct<{
|
|
|
98
130
|
readonly since: Schema.Int;
|
|
99
131
|
readonly at: Schema.Finite;
|
|
100
132
|
}>, {}>;
|
|
101
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* When admitted input finished; events after `since` describe the handoff interval.
|
|
135
|
+
*
|
|
136
|
+
* @stability stable
|
|
137
|
+
* @category schemas
|
|
138
|
+
* @since 0.3.0
|
|
139
|
+
*/
|
|
102
140
|
declare class Suspension extends Suspension_base {}
|
|
103
141
|
/**
|
|
104
142
|
* A connection to the browser apart from the one that drives its pages, for their screencasts,
|
|
@@ -107,6 +145,10 @@ declare class Suspension extends Suspension_base {}
|
|
|
107
145
|
* on the connection that drives the page. It is read-only. A page's session on it sends the
|
|
108
146
|
* capture's commands alone, and the page's own session keeps its focus emulation, which keeps a
|
|
109
147
|
* tab behind painting.
|
|
148
|
+
*
|
|
149
|
+
* @stability stable
|
|
150
|
+
* @category models
|
|
151
|
+
* @since 0.3.0
|
|
110
152
|
*/
|
|
111
153
|
interface CaptureSource {
|
|
112
154
|
/**
|
|
@@ -119,6 +161,11 @@ interface CaptureSource {
|
|
|
119
161
|
readonly lost: (error: BrowserError) => void;
|
|
120
162
|
}) => Effect.Effect<(method: "Page.enable" | "Page.getFrameTree" | "Page.startScreencast" | "Page.screencastFrameAck" | "Page.stopScreencast", params?: Record<string, unknown>) => Promise<unknown>, BrowserError, Scope.Scope>;
|
|
121
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* @stability stable
|
|
166
|
+
* @category models
|
|
167
|
+
* @since 0.3.0
|
|
168
|
+
*/
|
|
122
169
|
interface Service {
|
|
123
170
|
/** The provider's session id, or a local id. */
|
|
124
171
|
readonly id: string;
|
|
@@ -154,12 +201,29 @@ interface Service {
|
|
|
154
201
|
readonly recentEvents: Effect.Effect<ReadonlyArray<BrowserEvent>>;
|
|
155
202
|
}
|
|
156
203
|
declare const Browser_base: Context.ServiceClass<Browser$1, "effect-browser/Browser", Service>;
|
|
204
|
+
/**
|
|
205
|
+
* @stability stable
|
|
206
|
+
* @category services
|
|
207
|
+
* @since 0.3.0
|
|
208
|
+
*/
|
|
157
209
|
declare class Browser$1 extends Browser_base {}
|
|
210
|
+
/**
|
|
211
|
+
* Open a page in the context's `Browser`, at `url` when given.
|
|
212
|
+
*
|
|
213
|
+
* @stability stable
|
|
214
|
+
* @category constructors
|
|
215
|
+
* @since 0.3.0
|
|
216
|
+
*/
|
|
217
|
+
declare const newPage: (url?: string) => Effect.Effect<Page, BrowserError, Browser$1>;
|
|
158
218
|
/**
|
|
159
219
|
* Build the service over a context the provider owns. The provider closes the context; this only
|
|
160
220
|
* tracks its pages and events, for as long as the surrounding scope is open. Each page's protocol
|
|
161
221
|
* session, capture and listeners end when that page closes or when the scope does, so a closed
|
|
162
222
|
* tab retains nothing and the context keeps none of them afterwards.
|
|
223
|
+
*
|
|
224
|
+
* @stability stable
|
|
225
|
+
* @category constructors
|
|
226
|
+
* @since 0.3.0
|
|
163
227
|
*/
|
|
164
228
|
declare const make: (context: BrowserContext, info: {
|
|
165
229
|
readonly id?: string | undefined;
|
|
@@ -169,5 +233,5 @@ declare const make: (context: BrowserContext, info: {
|
|
|
169
233
|
readonly capture?: CaptureSource | undefined;
|
|
170
234
|
}, options?: Options | undefined) => Effect.Effect<Service, BrowserError, Scope.Scope>;
|
|
171
235
|
//#endregion
|
|
172
|
-
export { InitScript as a, RequestPolicy as c, Suspension as d, make as f, EventOptions as i, Service as l, Browser_d_exports as n, Options as o, CaptureSource as r, RequestDecision as s, Browser$1 as t, SuspendOptions as u };
|
|
173
|
-
//# sourceMappingURL=Browser-
|
|
236
|
+
export { InitScript as a, RequestPolicy as c, Suspension as d, make as f, EventOptions as i, Service as l, Browser_d_exports as n, Options as o, newPage as p, CaptureSource as r, RequestDecision as s, Browser$1 as t, SuspendOptions as u };
|
|
237
|
+
//# sourceMappingURL=Browser-DD9Vm1c-.d.mts.map
|