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
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { t as BrowserError } from "../internal/BrowserError-CsuRYcDX.mjs";
|
|
2
|
+
import { o as Page, s as Page_d_exports } from "../internal/Page-BfGxn7oN.mjs";
|
|
3
|
+
import { l as Service, n as Browser_d_exports } from "../internal/Browser-DD9Vm1c-.mjs";
|
|
4
|
+
import { n as Tabs_d_exports, t as Tabs } from "../internal/Tabs-dXMscIUQ.mjs";
|
|
5
|
+
import { ToolError } from "./ToolError.mjs";
|
|
6
|
+
import { Duration, Effect, Schema } from "effect";
|
|
7
|
+
declare namespace PageControl_d_exports {
|
|
8
|
+
export { Action, ActionResult, Controller, Follow, Observation, Options, Ref, Target, make };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A control's ref in an observation, such as `e12`.
|
|
12
|
+
*
|
|
13
|
+
* @stability stable
|
|
14
|
+
* @category schemas
|
|
15
|
+
* @since 0.3.0
|
|
16
|
+
*/
|
|
17
|
+
export declare const Ref: Schema.String;
|
|
18
|
+
/**
|
|
19
|
+
* An action on an observed control.
|
|
20
|
+
*
|
|
21
|
+
* @stability stable
|
|
22
|
+
* @category schemas
|
|
23
|
+
* @since 0.3.0
|
|
24
|
+
*/
|
|
25
|
+
export declare const Action: Schema.Union<readonly [Schema.Struct<{
|
|
26
|
+
readonly kind: Schema.Literal<"click">;
|
|
27
|
+
readonly ref: Schema.String;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
readonly kind: Schema.Literal<"fill">;
|
|
30
|
+
readonly ref: Schema.String;
|
|
31
|
+
readonly value: Schema.String;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly kind: Schema.Literal<"select">;
|
|
34
|
+
readonly ref: Schema.String;
|
|
35
|
+
readonly value: Schema.String;
|
|
36
|
+
}>]>;
|
|
37
|
+
/**
|
|
38
|
+
* @stability stable
|
|
39
|
+
* @category models
|
|
40
|
+
* @since 0.3.0
|
|
41
|
+
*/
|
|
42
|
+
export type Action = typeof Action.Type;
|
|
43
|
+
/**
|
|
44
|
+
* The page's outline and its controls, where the page is scrolled, and a browser's tabs.
|
|
45
|
+
*
|
|
46
|
+
* @stability stable
|
|
47
|
+
* @category schemas
|
|
48
|
+
* @since 0.3.0
|
|
49
|
+
*/
|
|
50
|
+
export declare const Observation: Schema.Struct<{
|
|
51
|
+
readonly text: Schema.String;
|
|
52
|
+
readonly controls: Schema.$Array<Schema.Struct<{
|
|
53
|
+
readonly ref: Schema.String;
|
|
54
|
+
readonly kind: Schema.String;
|
|
55
|
+
readonly name: Schema.String;
|
|
56
|
+
readonly value: Schema.String;
|
|
57
|
+
readonly options: Schema.$Array<Schema.String>;
|
|
58
|
+
readonly optionCount: Schema.optionalKey<Schema.Natural>;
|
|
59
|
+
readonly disabled: Schema.optionalKey<Schema.Boolean>;
|
|
60
|
+
readonly checked: Schema.optionalKey<Schema.Boolean>;
|
|
61
|
+
readonly editable: Schema.optionalKey<Schema.Boolean>;
|
|
62
|
+
}>>;
|
|
63
|
+
readonly page: Schema.Struct<{
|
|
64
|
+
readonly title: Schema.String;
|
|
65
|
+
readonly scrollY: Schema.Finite;
|
|
66
|
+
readonly viewportHeight: Schema.Finite;
|
|
67
|
+
readonly documentHeight: Schema.Finite;
|
|
68
|
+
}>;
|
|
69
|
+
readonly truncated: Schema.Boolean;
|
|
70
|
+
readonly tabs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
71
|
+
readonly ref: Schema.String;
|
|
72
|
+
readonly url: Schema.String;
|
|
73
|
+
readonly active: Schema.Boolean;
|
|
74
|
+
}>>>;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* @stability stable
|
|
78
|
+
* @category models
|
|
79
|
+
* @since 0.3.0
|
|
80
|
+
*/
|
|
81
|
+
export type Observation = typeof Observation.Type;
|
|
82
|
+
/**
|
|
83
|
+
* What actions did: how many completed, the first one's failure, the page after them unless the
|
|
84
|
+
* caller asked not to look, and whether the input reached the browser. Never replay an input
|
|
85
|
+
* whose dispatch is not `not-dispatched`.
|
|
86
|
+
*
|
|
87
|
+
* @stability stable
|
|
88
|
+
* @category schemas
|
|
89
|
+
* @since 0.3.0
|
|
90
|
+
*/
|
|
91
|
+
export declare const ActionResult: Schema.Struct<{
|
|
92
|
+
readonly completed: Schema.Natural;
|
|
93
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
94
|
+
readonly observation: Schema.NullOr<Schema.Struct<{
|
|
95
|
+
readonly text: Schema.String;
|
|
96
|
+
readonly controls: Schema.$Array<Schema.Struct<{
|
|
97
|
+
readonly ref: Schema.String;
|
|
98
|
+
readonly kind: Schema.String;
|
|
99
|
+
readonly name: Schema.String;
|
|
100
|
+
readonly value: Schema.String;
|
|
101
|
+
readonly options: Schema.$Array<Schema.String>;
|
|
102
|
+
readonly optionCount: Schema.optionalKey<Schema.Natural>;
|
|
103
|
+
readonly disabled: Schema.optionalKey<Schema.Boolean>;
|
|
104
|
+
readonly checked: Schema.optionalKey<Schema.Boolean>;
|
|
105
|
+
readonly editable: Schema.optionalKey<Schema.Boolean>;
|
|
106
|
+
}>>;
|
|
107
|
+
readonly page: Schema.Struct<{
|
|
108
|
+
readonly title: Schema.String;
|
|
109
|
+
readonly scrollY: Schema.Finite;
|
|
110
|
+
readonly viewportHeight: Schema.Finite;
|
|
111
|
+
readonly documentHeight: Schema.Finite;
|
|
112
|
+
}>;
|
|
113
|
+
readonly truncated: Schema.Boolean;
|
|
114
|
+
readonly tabs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
115
|
+
readonly ref: Schema.String;
|
|
116
|
+
readonly url: Schema.String;
|
|
117
|
+
readonly active: Schema.Boolean;
|
|
118
|
+
}>>>;
|
|
119
|
+
}>>;
|
|
120
|
+
readonly dispatch: Schema.Literals<readonly ["not-dispatched", "acknowledged", "possibly-dispatched"]>;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* @stability stable
|
|
124
|
+
* @category models
|
|
125
|
+
* @since 0.3.0
|
|
126
|
+
*/
|
|
127
|
+
export type ActionResult = typeof ActionResult.Type;
|
|
128
|
+
/** What `control.wait` waits for, as the `wait` tool takes it. */
|
|
129
|
+
interface WaitRequest {
|
|
130
|
+
readonly selector: string;
|
|
131
|
+
readonly frame?: string | undefined;
|
|
132
|
+
readonly state: "visible" | "hidden" | "enabled" | "text";
|
|
133
|
+
readonly text?: string | undefined;
|
|
134
|
+
readonly timeoutMillis: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* What the controller does when a tab opens: see the module's comment.
|
|
138
|
+
*
|
|
139
|
+
* @stability stable
|
|
140
|
+
* @category models
|
|
141
|
+
* @since 0.3.0
|
|
142
|
+
*/
|
|
143
|
+
export type Follow = "select" | "front" | "never";
|
|
144
|
+
/**
|
|
145
|
+
* What the controller acts on: one page, or a browser's tabs.
|
|
146
|
+
*
|
|
147
|
+
* @stability stable
|
|
148
|
+
* @category models
|
|
149
|
+
* @since 0.3.0
|
|
150
|
+
*/
|
|
151
|
+
export type Target = {
|
|
152
|
+
readonly page: Page;
|
|
153
|
+
} | {
|
|
154
|
+
readonly browser: Service;
|
|
155
|
+
readonly follow?: Follow | undefined;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* @stability stable
|
|
159
|
+
* @category options
|
|
160
|
+
* @since 0.3.0
|
|
161
|
+
*/
|
|
162
|
+
export interface Options {
|
|
163
|
+
/** The user's task, which the input policy's judge reads as what authorizes a risky input. */
|
|
164
|
+
readonly task?: string | undefined;
|
|
165
|
+
/** Resume stable tab identities from a prior finished adapter state. */
|
|
166
|
+
readonly initialTabs?: Tabs | undefined;
|
|
167
|
+
/** Bound on an observation's outline, in characters. Defaults to 8,000. */
|
|
168
|
+
readonly maxChars?: number | undefined;
|
|
169
|
+
/** Bound on a condition wait. Defaults to 5 seconds; an unmet wait returns the page as it is. */
|
|
170
|
+
readonly maxWait?: Duration.Input | undefined;
|
|
171
|
+
/** Give every control's box in the outline, as `WxH at (x,y)` in viewport CSS pixels. */
|
|
172
|
+
readonly boxes?: boolean | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* After an action, give only the outline's lines that are gone and new since the tab's last whole
|
|
175
|
+
* look, when they are fewer than its lines. Defaults to false.
|
|
176
|
+
*/
|
|
177
|
+
readonly changes?: boolean | undefined;
|
|
178
|
+
}
|
|
179
|
+
type Failing<A> = Effect.Effect<A, ToolError>;
|
|
180
|
+
/**
|
|
181
|
+
* The controller, and the tab it acts on, which `BrowserTools` shares.
|
|
182
|
+
*
|
|
183
|
+
* @stability stable
|
|
184
|
+
* @category models
|
|
185
|
+
* @since 0.3.0
|
|
186
|
+
*/
|
|
187
|
+
export interface Controller {
|
|
188
|
+
readonly actions: {
|
|
189
|
+
readonly observe: Failing<Observation>;
|
|
190
|
+
/** Act in order, stopping at the first failure; `observe: false` skips the look after. */
|
|
191
|
+
readonly act: (actions: ReadonlyArray<Action>, options?: {
|
|
192
|
+
readonly observe?: boolean | undefined;
|
|
193
|
+
}) => Failing<ActionResult>;
|
|
194
|
+
};
|
|
195
|
+
readonly control: {
|
|
196
|
+
/** The whole page's outline lines that hold `text`, ignoring case. */
|
|
197
|
+
readonly find: (request: {
|
|
198
|
+
readonly text: string;
|
|
199
|
+
}) => Failing<Observation>;
|
|
200
|
+
readonly inspect: (request: {
|
|
201
|
+
readonly selector?: string | undefined;
|
|
202
|
+
readonly frame?: string | undefined;
|
|
203
|
+
readonly optionFilter?: string | undefined;
|
|
204
|
+
}) => Failing<Observation>;
|
|
205
|
+
readonly navigate: (request: {
|
|
206
|
+
readonly url: string;
|
|
207
|
+
}) => Failing<ActionResult>;
|
|
208
|
+
readonly scroll: (request: {
|
|
209
|
+
readonly ref?: string | undefined;
|
|
210
|
+
readonly deltaX: number;
|
|
211
|
+
readonly deltaY: number;
|
|
212
|
+
}) => Failing<ActionResult>;
|
|
213
|
+
readonly wait: (request: WaitRequest) => Failing<Observation>;
|
|
214
|
+
readonly press: (request: {
|
|
215
|
+
readonly ref: string;
|
|
216
|
+
readonly key: string;
|
|
217
|
+
}) => Failing<ActionResult>;
|
|
218
|
+
readonly selectTab: (request: {
|
|
219
|
+
readonly ref: string;
|
|
220
|
+
}) => Failing<Observation>;
|
|
221
|
+
};
|
|
222
|
+
/** The tab calls act on now: the pinned page, or the one the model last saw. */
|
|
223
|
+
readonly current: Effect.Effect<Page, BrowserError>;
|
|
224
|
+
/** The current tab as a look finds it, following a tab an action opened. */
|
|
225
|
+
readonly look: Effect.Effect<Page, BrowserError>;
|
|
226
|
+
/** Run `run` on the current tab with the task, and say what followed it there. */
|
|
227
|
+
readonly perform: <A>(run: (page: Page) => Effect.Effect<A, BrowserError>) => Effect.Effect<{
|
|
228
|
+
readonly value: A;
|
|
229
|
+
readonly followed: ReadonlyArray<string>;
|
|
230
|
+
}, BrowserError>;
|
|
231
|
+
/** Give `effect` the run's task, for the input policy's judge. */
|
|
232
|
+
readonly withTask: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The controller over `target`, and the tab it acts on.
|
|
236
|
+
*
|
|
237
|
+
* @stability stable
|
|
238
|
+
* @category constructors
|
|
239
|
+
* @since 0.3.0
|
|
240
|
+
*/
|
|
241
|
+
export declare const make: (target: Target, options?: Options | undefined) => Effect.Effect<{
|
|
242
|
+
actions: {
|
|
243
|
+
readonly observe: Failing<Observation>;
|
|
244
|
+
/** Act in order, stopping at the first failure; `observe: false` skips the look after. */
|
|
245
|
+
readonly act: (actions: ReadonlyArray<Action>, options?: {
|
|
246
|
+
readonly observe?: boolean | undefined;
|
|
247
|
+
}) => Failing<ActionResult>;
|
|
248
|
+
};
|
|
249
|
+
control: {
|
|
250
|
+
/** The whole page's outline lines that hold `text`, ignoring case. */
|
|
251
|
+
readonly find: (request: {
|
|
252
|
+
readonly text: string;
|
|
253
|
+
}) => Failing<Observation>;
|
|
254
|
+
readonly inspect: (request: {
|
|
255
|
+
readonly selector?: string | undefined;
|
|
256
|
+
readonly frame?: string | undefined;
|
|
257
|
+
readonly optionFilter?: string | undefined;
|
|
258
|
+
}) => Failing<Observation>;
|
|
259
|
+
readonly navigate: (request: {
|
|
260
|
+
readonly url: string;
|
|
261
|
+
}) => Failing<ActionResult>;
|
|
262
|
+
readonly scroll: (request: {
|
|
263
|
+
readonly ref?: string | undefined;
|
|
264
|
+
readonly deltaX: number;
|
|
265
|
+
readonly deltaY: number;
|
|
266
|
+
}) => Failing<ActionResult>;
|
|
267
|
+
readonly wait: (request: WaitRequest) => Failing<Observation>;
|
|
268
|
+
readonly press: (request: {
|
|
269
|
+
readonly ref: string;
|
|
270
|
+
readonly key: string;
|
|
271
|
+
}) => Failing<ActionResult>;
|
|
272
|
+
readonly selectTab: (request: {
|
|
273
|
+
readonly ref: string;
|
|
274
|
+
}) => Failing<Observation>;
|
|
275
|
+
};
|
|
276
|
+
current: Effect.Effect<Page, never, never> | Effect.Effect<Page, BrowserError, never>;
|
|
277
|
+
look: Effect.Effect<Page, never, never> | Effect.Effect<Page, BrowserError, never>;
|
|
278
|
+
perform: <A>(run: (page: Page) => Effect.Effect<A, BrowserError>) => Effect.Effect<{
|
|
279
|
+
value: A;
|
|
280
|
+
followed: string[];
|
|
281
|
+
}, BrowserError, never>;
|
|
282
|
+
withTask: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
283
|
+
}, never, never>;
|
|
284
|
+
//#endregion
|
|
285
|
+
export { PageControl_d_exports as t };
|
|
286
|
+
//# sourceMappingURL=PageControl.d.mts.map
|