effect-browser 0.2.0-beta.9 → 0.3.0-beta.5
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 +705 -1184
- package/dist/Browser-CM65Uo7f.mjs +437 -0
- package/dist/Browser-CM65Uo7f.mjs.map +1 -0
- package/dist/Browser.d.mts +115 -3
- package/dist/Browser.mjs +2 -22
- package/dist/BrowserError-DXXIA6Rk.d.mts +135 -0
- package/dist/BrowserError.d.mts +2 -0
- package/dist/BrowserError.mjs +202 -0
- package/dist/BrowserError.mjs.map +1 -0
- package/dist/BrowserEvent-DzdNdvoh.d.mts +277 -0
- package/dist/BrowserEvent.d.mts +2 -0
- package/dist/BrowserEvent.mjs +295 -0
- package/dist/BrowserEvent.mjs.map +1 -0
- package/dist/Cdp.d.mts +32 -0
- package/dist/Cdp.mjs +61 -0
- package/dist/Cdp.mjs.map +1 -0
- package/dist/Change-DNvztNLu.mjs +138 -0
- package/dist/Change-DNvztNLu.mjs.map +1 -0
- package/dist/Change-DVP2IJWm.d.mts +71 -0
- package/dist/Change.d.mts +2 -0
- package/dist/Change.mjs +2 -0
- package/dist/Chromium.d.mts +29 -81
- package/dist/Chromium.mjs +57 -392
- package/dist/Chromium.mjs.map +1 -1
- package/dist/Expect.d.mts +62 -0
- package/dist/Expect.mjs +114 -0
- package/dist/Expect.mjs.map +1 -0
- package/dist/Frame-BERmf_gM.d.mts +117 -0
- package/dist/Frame.d.mts +2 -0
- package/dist/Frame.mjs +123 -0
- package/dist/Frame.mjs.map +1 -0
- package/dist/Moment.d.mts +2 -0
- package/dist/Moment.mjs +288 -0
- package/dist/Moment.mjs.map +1 -0
- package/dist/Motion.d.mts +40 -0
- package/dist/Motion.mjs +122 -0
- package/dist/Motion.mjs.map +1 -0
- package/dist/Page-D4281dIi.mjs +618 -0
- package/dist/Page-D4281dIi.mjs.map +1 -0
- package/dist/Page-DYTdVhYa.d.mts +593 -0
- package/dist/Page.d.mts +2 -0
- package/dist/Page.mjs +2 -0
- package/dist/Plan-CNNOU1Tx.d.mts +112 -0
- package/dist/Plan-Dtrb-8im.mjs +311 -0
- package/dist/Plan-Dtrb-8im.mjs.map +1 -0
- package/dist/Plan.d.mts +2 -3
- package/dist/Plan.mjs +2 -2
- package/dist/Policy.d.mts +76 -0
- package/dist/Policy.mjs +237 -0
- package/dist/Policy.mjs.map +1 -0
- package/dist/Presentation.d.mts +48 -0
- package/dist/Presentation.mjs +117 -0
- package/dist/Presentation.mjs.map +1 -0
- package/dist/Snapshot-B34hZ4Jl.d.mts +68 -0
- package/dist/Snapshot.d.mts +2 -0
- package/dist/Snapshot.mjs +79 -0
- package/dist/Snapshot.mjs.map +1 -0
- package/dist/Stage.d.mts +54 -0
- package/dist/Stage.mjs +133 -0
- package/dist/Stage.mjs.map +1 -0
- package/dist/Supervisor-BtEG93gR.mjs +420 -0
- package/dist/Supervisor-BtEG93gR.mjs.map +1 -0
- package/dist/Supervisor-Im6-wbg5.d.mts +230 -0
- package/dist/Supervisor.d.mts +2 -0
- package/dist/Supervisor.mjs +2 -0
- package/dist/context-DAYjATgC.mjs +137 -0
- package/dist/context-DAYjATgC.mjs.map +1 -0
- package/dist/index.d.mts +17 -14
- package/dist/index.mjs +18 -13
- package/dist/match.inpage-xOe9LNO0.mjs +48 -0
- package/dist/match.inpage-xOe9LNO0.mjs.map +1 -0
- package/dist/page-Banfm_zc.mjs +5097 -0
- package/dist/page-Banfm_zc.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/url-CcL0K7S0.mjs +262 -0
- package/dist/url-CcL0K7S0.mjs.map +1 -0
- package/package.json +96 -61
- package/src/Browser.ts +625 -0
- package/src/BrowserError.ts +225 -0
- package/src/BrowserEvent.ts +294 -0
- package/src/Cdp.ts +101 -0
- package/src/Change.ts +88 -0
- package/src/Chromium.ts +102 -0
- package/src/Expect.ts +180 -0
- package/src/Frame.ts +130 -0
- package/src/Moment.ts +479 -0
- package/src/Motion.ts +166 -0
- package/src/Page.ts +520 -0
- package/src/Plan.ts +350 -0
- package/src/Policy.ts +325 -0
- package/src/Presentation.ts +195 -0
- package/src/Snapshot.ts +89 -0
- package/src/Stage.ts +223 -0
- package/src/Supervisor.ts +353 -0
- package/src/index.ts +20 -0
- package/src/internal/input/actions.ts +607 -0
- package/src/internal/input/dispatch.ts +161 -0
- package/src/internal/input/edit.inpage.ts +162 -0
- package/src/internal/input/evidence.inpage.ts +164 -0
- package/src/internal/input/guard.inpage.ts +605 -0
- package/src/internal/input/guard.ts +183 -0
- package/src/internal/input/keyboard.ts +112 -0
- package/src/internal/input/keys.ts +127 -0
- package/src/internal/input/perform.ts +322 -0
- package/src/internal/input/pointer.ts +153 -0
- package/src/internal/input/replies.ts +159 -0
- package/src/internal/input/settle.ts +50 -0
- package/src/internal/input/style.ts +186 -0
- package/src/internal/input/targets.inpage.ts +293 -0
- package/src/internal/input/targets.ts +148 -0
- package/src/internal/page/bridge.ts +386 -0
- package/src/internal/page/context.ts +302 -0
- package/src/internal/page/lane.ts +301 -0
- package/src/internal/page/navigation.ts +183 -0
- package/src/internal/page/openings.ts +87 -0
- package/src/internal/page/page.ts +137 -0
- package/src/internal/page/url.ts +100 -0
- package/src/internal/page/viewport.ts +43 -0
- package/src/internal/pictures/capture.ts +778 -0
- package/src/internal/pictures/clock.ts +141 -0
- package/src/internal/pictures/pictures.ts +520 -0
- package/src/internal/pictures/transport.ts +242 -0
- package/src/internal/reading/choose.ts +100 -0
- package/src/internal/reading/context.inpage.ts +201 -0
- package/src/internal/reading/controls.inpage.ts +158 -0
- package/src/internal/reading/expect.inpage.ts +70 -0
- package/src/internal/reading/match.inpage.ts +92 -0
- package/src/internal/reading/names.inpage.ts +306 -0
- package/src/internal/reading/outline.inpage.ts +260 -0
- package/src/internal/reading/reading.ts +223 -0
- package/src/internal/reading/ready.inpage.ts +154 -0
- package/src/internal/reading/ready.ts +105 -0
- package/src/internal/reading/subjects.inpage.ts +188 -0
- package/src/internal/reading/text.inpage.ts +135 -0
- package/src/internal/reading/walk.inpage.ts +220 -0
- package/src/internal/supervisor/lifecycle.ts +265 -0
- package/src/internal/timeline/changes.inpage.ts +216 -0
- package/src/internal/timeline/changes.ts +100 -0
- package/src/internal/timeline/events.ts +93 -0
- package/src/internal/timeline/fold.inpage.ts +123 -0
- package/src/internal/timeline/history.inpage.ts +229 -0
- package/src/internal/timeline/marks.inpage.ts +207 -0
- package/src/internal/timeline/record.inpage.ts +133 -0
- package/src/internal/timeline/sight.inpage.ts +122 -0
- package/src/internal/timeline/window.ts +96 -0
- package/src/internal/timeline/words.ts +65 -0
- package/dist/Bootstrap-B9UUXsvF.d.mts +0 -183
- package/dist/Bootstrap-CeQOWBy6.mjs +0 -189
- package/dist/Bootstrap-CeQOWBy6.mjs.map +0 -1
- package/dist/Bootstrap.d.mts +0 -3
- package/dist/Bootstrap.mjs +0 -2
- package/dist/Browser-BF9_sORP.d.mts +0 -388
- package/dist/Browser.mjs.map +0 -1
- package/dist/BrowserData-CPIIIHol.d.mts +0 -585
- package/dist/BrowserData.d.mts +0 -3
- package/dist/BrowserData.mjs +0 -695
- package/dist/BrowserData.mjs.map +0 -1
- package/dist/BrowserRuntime-B6nT1G4X.d.mts +0 -148
- package/dist/BrowserRuntime-C1r2aSRK.mjs +0 -6820
- package/dist/BrowserRuntime-C1r2aSRK.mjs.map +0 -1
- package/dist/BrowserRuntime.d.mts +0 -3
- package/dist/BrowserRuntime.mjs +0 -3
- package/dist/Capture.d.mts +0 -56
- package/dist/Capture.mjs +0 -678
- package/dist/Capture.mjs.map +0 -1
- package/dist/CaptureData-CYriZHX1.mjs +0 -201
- package/dist/CaptureData-CYriZHX1.mjs.map +0 -1
- package/dist/CaptureData.d.mts +0 -219
- package/dist/CaptureData.mjs +0 -2
- package/dist/Errors.d.mts +0 -158
- package/dist/Errors.mjs +0 -207
- package/dist/Errors.mjs.map +0 -1
- package/dist/Images-yCG9BmRU.mjs +0 -76
- package/dist/Images-yCG9BmRU.mjs.map +0 -1
- package/dist/OperationOptions-DAeRS6O9.mjs +0 -55
- package/dist/OperationOptions-DAeRS6O9.mjs.map +0 -1
- package/dist/PageControl.d.mts +0 -15
- package/dist/PageControl.mjs +0 -34
- package/dist/PageControl.mjs.map +0 -1
- package/dist/PageRegistry-B3q9DS3g.mjs +0 -164
- package/dist/PageRegistry-B3q9DS3g.mjs.map +0 -1
- package/dist/Plan-Dyxu2q8C.mjs +0 -543
- package/dist/Plan-Dyxu2q8C.mjs.map +0 -1
- package/dist/PlanData-B668RxbQ.d.mts +0 -4831
- package/dist/PlanData.d.mts +0 -3
- package/dist/PlanData.mjs +0 -268
- package/dist/PlanData.mjs.map +0 -1
- package/dist/PlanInput-BJcPPncs.mjs +0 -75
- package/dist/PlanInput-BJcPPncs.mjs.map +0 -1
- package/dist/PublicSession-DCSMMqOj.mjs +0 -5602
- package/dist/PublicSession-DCSMMqOj.mjs.map +0 -1
- package/dist/Testing.d.mts +0 -479
- package/dist/Testing.mjs +0 -2147
- package/dist/Testing.mjs.map +0 -1
- package/dist/Timeline-fV22Xk-S.d.mts +0 -29
- package/dist/Timeline.d.mts +0 -4
- package/dist/Timeline.mjs +0 -20
- package/dist/Timeline.mjs.map +0 -1
- package/dist/TimelineData-BsOn-YGZ.d.mts +0 -3818
- package/dist/TimelineData.d.mts +0 -3
- package/dist/TimelineData.mjs +0 -482
- package/dist/TimelineData.mjs.map +0 -1
package/dist/Errors.d.mts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
//#region src/Errors.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* What a caller asked the owned browser to do. The vocabulary is closed: the owner stamps it
|
|
5
|
-
* when it admits an operation, so a native step's own name can never become API, and a new
|
|
6
|
-
* spelling is a deliberate edit here rather than a string that merely compiles.
|
|
7
|
-
*/
|
|
8
|
-
export declare const BrowserOperation: Schema.Literals<readonly ["configure", "launch", "connect", "reconnect", "detach", "disconnect", "close", "handoff", "resume", "live-view", "target", "handle", "list-pages", "describe-page", "list-frames", "select-page", "new-page", "close-page", "resize", "ready", "observe", "checkpoint", "control-facts", "revalidate", "read-text", "screenshot", "wait", "resolve", "run", "settled", "navigate", "navigate-stop", "click", "fill", "fill-form", "select-option", "scroll", "click-and-wait", "download-action", "select-files", "file-chooser", "action-result", "pointer-move", "hover", "wheel", "press", "type", "page-control", "page-state", "page-suspend", "page-resume", "capture", "capture-start", "capture-stop", "capture-consume"]>;
|
|
9
|
-
export type BrowserOperation = typeof BrowserOperation.Type;
|
|
10
|
-
/** Dispatch evidence belongs to the operation, independently of its failure reason. */
|
|
11
|
-
export declare const BrowserOutcome: Schema.Literals<readonly ["undispatched", "rejected", "performed", "unknown"]>;
|
|
12
|
-
export type BrowserOutcome = typeof BrowserOutcome.Type;
|
|
13
|
-
/** Limits report measured producer facts; an unavailable measurement is never invented. */
|
|
14
|
-
export declare const LimitDimension: Schema.Literals<readonly ["runs", "actions", "elapsed", "returned-bytes", "pages", "frames", "frame-depth", "buffered-frames", "buffered-bytes", "host-reads", "controls", "text", "code-points", "captures", "frame-bytes", "width", "height", "pixels", "observation-snapshots", "observation-handles", "observation-bytes", "native-operations"]>;
|
|
15
|
-
/** Validated constructors for host reasons. The model receives a separate bounded projection. */
|
|
16
|
-
export declare const Reasons: {
|
|
17
|
-
readonly Configuration: Schema.TaggedStruct<"Configuration", {
|
|
18
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
19
|
-
}>;
|
|
20
|
-
readonly UnregisteredSession: Schema.TaggedStruct<"UnregisteredSession", {}>;
|
|
21
|
-
readonly Unsupported: Schema.TaggedStruct<"Unsupported", {}>;
|
|
22
|
-
readonly Busy: Schema.TaggedStruct<"Busy", {}>;
|
|
23
|
-
readonly QueueFull: Schema.TaggedStruct<"QueueFull", {
|
|
24
|
-
readonly scope: Schema.Literals<readonly ["page", "session", "registry"]>;
|
|
25
|
-
readonly maximum: Schema.Natural;
|
|
26
|
-
readonly observed: Schema.Natural;
|
|
27
|
-
}>;
|
|
28
|
-
readonly QueueExpired: Schema.TaggedStruct<"QueueExpired", {}>;
|
|
29
|
-
readonly Closed: Schema.TaggedStruct<"Closed", {}>;
|
|
30
|
-
readonly Stale: Schema.TaggedStruct<"Stale", {}>;
|
|
31
|
-
readonly NotFound: Schema.TaggedStruct<"NotFound", {}>;
|
|
32
|
-
readonly Missing: Schema.TaggedStruct<"Missing", {}>;
|
|
33
|
-
readonly Ambiguous: Schema.TaggedStruct<"Ambiguous", {
|
|
34
|
-
readonly count: Schema.optionalKey<Schema.Natural>;
|
|
35
|
-
}>;
|
|
36
|
-
readonly Incomplete: Schema.TaggedStruct<"Incomplete", {}>;
|
|
37
|
-
readonly Drifted: Schema.TaggedStruct<"Drifted", {}>;
|
|
38
|
-
readonly Malformed: Schema.TaggedStruct<"Malformed", {
|
|
39
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
40
|
-
}>;
|
|
41
|
-
readonly Limit: Schema.TaggedStruct<"Limit", {
|
|
42
|
-
readonly dimension: Schema.Literals<readonly ["runs", "actions", "elapsed", "returned-bytes", "pages", "frames", "frame-depth", "buffered-frames", "buffered-bytes", "host-reads", "controls", "text", "code-points", "captures", "frame-bytes", "width", "height", "pixels", "observation-snapshots", "observation-handles", "observation-bytes", "native-operations"]>;
|
|
43
|
-
readonly maximum: Schema.Natural;
|
|
44
|
-
readonly observed: Schema.Natural;
|
|
45
|
-
}>;
|
|
46
|
-
readonly Timeout: Schema.TaggedStruct<"Timeout", {}>;
|
|
47
|
-
readonly ScheduleMissed: Schema.TaggedStruct<"ScheduleMissed", {}>;
|
|
48
|
-
readonly TimingBudgetExceeded: Schema.TaggedStruct<"TimingBudgetExceeded", {}>;
|
|
49
|
-
readonly Transport: Schema.TaggedStruct<"Transport", {
|
|
50
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
51
|
-
}>;
|
|
52
|
-
readonly Provider: Schema.TaggedStruct<"Provider", {
|
|
53
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
54
|
-
readonly detail: Schema.optionalKey<Schema.String>;
|
|
55
|
-
}>;
|
|
56
|
-
readonly Authorization: Schema.TaggedStruct<"Authorization", {}>;
|
|
57
|
-
readonly RateLimited: Schema.TaggedStruct<"RateLimited", {
|
|
58
|
-
readonly retryAfterMillis: Schema.optionalKey<Schema.Natural>;
|
|
59
|
-
}>;
|
|
60
|
-
readonly Disconnected: Schema.TaggedStruct<"Disconnected", {}>;
|
|
61
|
-
readonly Active: Schema.TaggedStruct<"Active", {}>;
|
|
62
|
-
readonly Disabled: Schema.TaggedStruct<"Disabled", {}>;
|
|
63
|
-
readonly Expired: Schema.TaggedStruct<"Expired", {}>;
|
|
64
|
-
readonly Failed: Schema.TaggedStruct<"Failed", {}>;
|
|
65
|
-
readonly UnsafeUrl: Schema.TaggedStruct<"UnsafeUrl", {}>;
|
|
66
|
-
readonly ContentType: Schema.TaggedStruct<"ContentType", {}>;
|
|
67
|
-
readonly Timestamp: Schema.TaggedStruct<"Timestamp", {}>;
|
|
68
|
-
readonly Resized: Schema.TaggedStruct<"Resized", {}>;
|
|
69
|
-
readonly TargetChanged: Schema.TaggedStruct<"TargetChanged", {}>;
|
|
70
|
-
readonly Interrupted: Schema.TaggedStruct<"Interrupted", {}>;
|
|
71
|
-
readonly ContextLease: Schema.TaggedStruct<"ContextLease", {}>;
|
|
72
|
-
readonly NotVisible: Schema.TaggedStruct<"NotVisible", {}>;
|
|
73
|
-
readonly Denied: Schema.TaggedStruct<"Denied", {}>;
|
|
74
|
-
readonly NotFocused: Schema.TaggedStruct<"NotFocused", {}>;
|
|
75
|
-
};
|
|
76
|
-
export declare const BrowserReason: Schema.Union<(Schema.TaggedStruct<"Active", {}> | Schema.TaggedStruct<"Ambiguous", {
|
|
77
|
-
readonly count: Schema.optionalKey<Schema.Natural>;
|
|
78
|
-
}> | Schema.TaggedStruct<"Authorization", {}> | Schema.TaggedStruct<"Busy", {}> | Schema.TaggedStruct<"Closed", {}> | Schema.TaggedStruct<"Configuration", {
|
|
79
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
80
|
-
}> | Schema.TaggedStruct<"ContentType", {}> | Schema.TaggedStruct<"ContextLease", {}> | Schema.TaggedStruct<"Denied", {}> | Schema.TaggedStruct<"Disabled", {}> | Schema.TaggedStruct<"Disconnected", {}> | Schema.TaggedStruct<"Drifted", {}> | Schema.TaggedStruct<"Expired", {}> | Schema.TaggedStruct<"Failed", {}> | Schema.TaggedStruct<"Incomplete", {}> | Schema.TaggedStruct<"Interrupted", {}> | Schema.TaggedStruct<"Limit", {
|
|
81
|
-
readonly dimension: Schema.Literals<readonly ["runs", "actions", "elapsed", "returned-bytes", "pages", "frames", "frame-depth", "buffered-frames", "buffered-bytes", "host-reads", "controls", "text", "code-points", "captures", "frame-bytes", "width", "height", "pixels", "observation-snapshots", "observation-handles", "observation-bytes", "native-operations"]>;
|
|
82
|
-
readonly maximum: Schema.Natural;
|
|
83
|
-
readonly observed: Schema.Natural;
|
|
84
|
-
}> | Schema.TaggedStruct<"Malformed", {
|
|
85
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
86
|
-
}> | Schema.TaggedStruct<"Missing", {}> | Schema.TaggedStruct<"NotFocused", {}> | Schema.TaggedStruct<"NotFound", {}> | Schema.TaggedStruct<"NotVisible", {}> | Schema.TaggedStruct<"Provider", {
|
|
87
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
88
|
-
readonly detail: Schema.optionalKey<Schema.String>;
|
|
89
|
-
}> | Schema.TaggedStruct<"QueueExpired", {}> | Schema.TaggedStruct<"QueueFull", {
|
|
90
|
-
readonly scope: Schema.Literals<readonly ["page", "session", "registry"]>;
|
|
91
|
-
readonly maximum: Schema.Natural;
|
|
92
|
-
readonly observed: Schema.Natural;
|
|
93
|
-
}> | Schema.TaggedStruct<"RateLimited", {
|
|
94
|
-
readonly retryAfterMillis: Schema.optionalKey<Schema.Natural>;
|
|
95
|
-
}> | Schema.TaggedStruct<"Resized", {}> | Schema.TaggedStruct<"ScheduleMissed", {}> | Schema.TaggedStruct<"Stale", {}> | Schema.TaggedStruct<"TargetChanged", {}> | Schema.TaggedStruct<"Timeout", {}> | Schema.TaggedStruct<"Timestamp", {}> | Schema.TaggedStruct<"TimingBudgetExceeded", {}> | Schema.TaggedStruct<"Transport", {
|
|
96
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
97
|
-
}> | Schema.TaggedStruct<"UnregisteredSession", {}> | Schema.TaggedStruct<"UnsafeUrl", {}> | Schema.TaggedStruct<"Unsupported", {}>)[]>;
|
|
98
|
-
export type BrowserReason = typeof BrowserReason.Type;
|
|
99
|
-
/**
|
|
100
|
-
* Containment never changes an uncertain mutation into a known action outcome. `PagePaused` is
|
|
101
|
-
* a page's own popup/dialog-policy quarantine: the page stays open for an operator and refuses
|
|
102
|
-
* automation until a drained handoff and explicit release.
|
|
103
|
-
*/
|
|
104
|
-
export declare const Containment: Schema.Union<readonly [Schema.TaggedStruct<"NotRequired", {}>, Schema.TaggedStruct<"PageClosed", {
|
|
105
|
-
readonly pageId: Schema.String;
|
|
106
|
-
readonly generation: Schema.Natural;
|
|
107
|
-
}>, Schema.TaggedStruct<"PagePaused", {
|
|
108
|
-
readonly pageId: Schema.String;
|
|
109
|
-
readonly generation: Schema.Natural;
|
|
110
|
-
}>, Schema.TaggedStruct<"SessionFenced", {
|
|
111
|
-
readonly generation: Schema.Natural;
|
|
112
|
-
}>]>;
|
|
113
|
-
export type Containment = typeof Containment.Type;
|
|
114
|
-
declare const BrowserError_base: Schema.Class<BrowserError, Schema.TaggedStruct<"BrowserError", {
|
|
115
|
-
readonly operation: Schema.Literals<readonly ["configure", "launch", "connect", "reconnect", "detach", "disconnect", "close", "handoff", "resume", "live-view", "target", "handle", "list-pages", "describe-page", "list-frames", "select-page", "new-page", "close-page", "resize", "ready", "observe", "checkpoint", "control-facts", "revalidate", "read-text", "screenshot", "wait", "resolve", "run", "settled", "navigate", "navigate-stop", "click", "fill", "fill-form", "select-option", "scroll", "click-and-wait", "download-action", "select-files", "file-chooser", "action-result", "pointer-move", "hover", "wheel", "press", "type", "page-control", "page-state", "page-suspend", "page-resume", "capture", "capture-start", "capture-stop", "capture-consume"]>;
|
|
116
|
-
readonly reason: Schema.Union<(Schema.TaggedStruct<"Active", {}> | Schema.TaggedStruct<"Ambiguous", {
|
|
117
|
-
readonly count: Schema.optionalKey<Schema.Natural>;
|
|
118
|
-
}> | Schema.TaggedStruct<"Authorization", {}> | Schema.TaggedStruct<"Busy", {}> | Schema.TaggedStruct<"Closed", {}> | Schema.TaggedStruct<"Configuration", {
|
|
119
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
120
|
-
}> | Schema.TaggedStruct<"ContentType", {}> | Schema.TaggedStruct<"ContextLease", {}> | Schema.TaggedStruct<"Denied", {}> | Schema.TaggedStruct<"Disabled", {}> | Schema.TaggedStruct<"Disconnected", {}> | Schema.TaggedStruct<"Drifted", {}> | Schema.TaggedStruct<"Expired", {}> | Schema.TaggedStruct<"Failed", {}> | Schema.TaggedStruct<"Incomplete", {}> | Schema.TaggedStruct<"Interrupted", {}> | Schema.TaggedStruct<"Limit", {
|
|
121
|
-
readonly dimension: Schema.Literals<readonly ["runs", "actions", "elapsed", "returned-bytes", "pages", "frames", "frame-depth", "buffered-frames", "buffered-bytes", "host-reads", "controls", "text", "code-points", "captures", "frame-bytes", "width", "height", "pixels", "observation-snapshots", "observation-handles", "observation-bytes", "native-operations"]>;
|
|
122
|
-
readonly maximum: Schema.Natural;
|
|
123
|
-
readonly observed: Schema.Natural;
|
|
124
|
-
}> | Schema.TaggedStruct<"Malformed", {
|
|
125
|
-
readonly path: Schema.optionalKey<Schema.String>;
|
|
126
|
-
}> | Schema.TaggedStruct<"Missing", {}> | Schema.TaggedStruct<"NotFocused", {}> | Schema.TaggedStruct<"NotFound", {}> | Schema.TaggedStruct<"NotVisible", {}> | Schema.TaggedStruct<"Provider", {
|
|
127
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
128
|
-
readonly detail: Schema.optionalKey<Schema.String>;
|
|
129
|
-
}> | Schema.TaggedStruct<"QueueExpired", {}> | Schema.TaggedStruct<"QueueFull", {
|
|
130
|
-
readonly scope: Schema.Literals<readonly ["page", "session", "registry"]>;
|
|
131
|
-
readonly maximum: Schema.Natural;
|
|
132
|
-
readonly observed: Schema.Natural;
|
|
133
|
-
}> | Schema.TaggedStruct<"RateLimited", {
|
|
134
|
-
readonly retryAfterMillis: Schema.optionalKey<Schema.Natural>;
|
|
135
|
-
}> | Schema.TaggedStruct<"Resized", {}> | Schema.TaggedStruct<"ScheduleMissed", {}> | Schema.TaggedStruct<"Stale", {}> | Schema.TaggedStruct<"TargetChanged", {}> | Schema.TaggedStruct<"Timeout", {}> | Schema.TaggedStruct<"Timestamp", {}> | Schema.TaggedStruct<"TimingBudgetExceeded", {}> | Schema.TaggedStruct<"Transport", {
|
|
136
|
-
readonly status: Schema.optionalKey<Schema.Int>;
|
|
137
|
-
}> | Schema.TaggedStruct<"UnregisteredSession", {}> | Schema.TaggedStruct<"UnsafeUrl", {}> | Schema.TaggedStruct<"Unsupported", {}>)[]>;
|
|
138
|
-
readonly outcome: Schema.Literals<readonly ["undispatched", "rejected", "performed", "unknown"]>;
|
|
139
|
-
readonly containment: Schema.optionalKey<Schema.Union<readonly [Schema.TaggedStruct<"NotRequired", {}>, Schema.TaggedStruct<"PageClosed", {
|
|
140
|
-
readonly pageId: Schema.String;
|
|
141
|
-
readonly generation: Schema.Natural;
|
|
142
|
-
}>, Schema.TaggedStruct<"PagePaused", {
|
|
143
|
-
readonly pageId: Schema.String;
|
|
144
|
-
readonly generation: Schema.Natural;
|
|
145
|
-
}>, Schema.TaggedStruct<"SessionFenced", {
|
|
146
|
-
readonly generation: Schema.Natural;
|
|
147
|
-
}>]>>;
|
|
148
|
-
}>, import("effect/Cause").YieldableError>;
|
|
149
|
-
export declare class BrowserError extends BrowserError_base {}
|
|
150
|
-
declare const InitializationError_base: Schema.Class<InitializationError, Schema.TaggedStruct<"InitializationError", {
|
|
151
|
-
readonly operation: Schema.Literals<readonly ["configure", "register", "ready", "callback", "dispose"]>;
|
|
152
|
-
readonly step: Schema.String;
|
|
153
|
-
readonly reason: Schema.Literals<readonly ["configuration", "unsupported", "origin", "stale", "busy", "closed", "timeout", "input", "output", "native"]>;
|
|
154
|
-
}>, import("effect/Cause").YieldableError>;
|
|
155
|
-
export declare class InitializationError extends InitializationError_base {}
|
|
156
|
-
//#endregion
|
|
157
|
-
export {};
|
|
158
|
-
//# sourceMappingURL=Errors.d.mts.map
|
package/dist/Errors.mjs
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
//#region src/Errors.ts
|
|
3
|
-
/**
|
|
4
|
-
* What a caller asked the owned browser to do. The vocabulary is closed: the owner stamps it
|
|
5
|
-
* when it admits an operation, so a native step's own name can never become API, and a new
|
|
6
|
-
* spelling is a deliberate edit here rather than a string that merely compiles.
|
|
7
|
-
*/
|
|
8
|
-
const BrowserOperation = Schema.Literals([
|
|
9
|
-
"configure",
|
|
10
|
-
"launch",
|
|
11
|
-
"connect",
|
|
12
|
-
"reconnect",
|
|
13
|
-
"detach",
|
|
14
|
-
"disconnect",
|
|
15
|
-
"close",
|
|
16
|
-
"handoff",
|
|
17
|
-
"resume",
|
|
18
|
-
"live-view",
|
|
19
|
-
"target",
|
|
20
|
-
"handle",
|
|
21
|
-
"list-pages",
|
|
22
|
-
"describe-page",
|
|
23
|
-
"list-frames",
|
|
24
|
-
"select-page",
|
|
25
|
-
"new-page",
|
|
26
|
-
"close-page",
|
|
27
|
-
"resize",
|
|
28
|
-
"ready",
|
|
29
|
-
"observe",
|
|
30
|
-
"checkpoint",
|
|
31
|
-
"control-facts",
|
|
32
|
-
"revalidate",
|
|
33
|
-
"read-text",
|
|
34
|
-
"screenshot",
|
|
35
|
-
"wait",
|
|
36
|
-
"resolve",
|
|
37
|
-
"run",
|
|
38
|
-
"settled",
|
|
39
|
-
"navigate",
|
|
40
|
-
"navigate-stop",
|
|
41
|
-
"click",
|
|
42
|
-
"fill",
|
|
43
|
-
"fill-form",
|
|
44
|
-
"select-option",
|
|
45
|
-
"scroll",
|
|
46
|
-
"click-and-wait",
|
|
47
|
-
"download-action",
|
|
48
|
-
"select-files",
|
|
49
|
-
"file-chooser",
|
|
50
|
-
"action-result",
|
|
51
|
-
"pointer-move",
|
|
52
|
-
"hover",
|
|
53
|
-
"wheel",
|
|
54
|
-
"press",
|
|
55
|
-
"type",
|
|
56
|
-
"page-control",
|
|
57
|
-
"page-state",
|
|
58
|
-
"page-suspend",
|
|
59
|
-
"page-resume",
|
|
60
|
-
"capture",
|
|
61
|
-
"capture-start",
|
|
62
|
-
"capture-stop",
|
|
63
|
-
"capture-consume"
|
|
64
|
-
]);
|
|
65
|
-
/** Dispatch evidence belongs to the operation, independently of its failure reason. */
|
|
66
|
-
const BrowserOutcome = Schema.Literals([
|
|
67
|
-
"undispatched",
|
|
68
|
-
"rejected",
|
|
69
|
-
"performed",
|
|
70
|
-
"unknown"
|
|
71
|
-
]);
|
|
72
|
-
/** Limits report measured producer facts; an unavailable measurement is never invented. */
|
|
73
|
-
const LimitDimension = Schema.Literals([
|
|
74
|
-
"runs",
|
|
75
|
-
"actions",
|
|
76
|
-
"elapsed",
|
|
77
|
-
"returned-bytes",
|
|
78
|
-
"pages",
|
|
79
|
-
"frames",
|
|
80
|
-
"frame-depth",
|
|
81
|
-
"buffered-frames",
|
|
82
|
-
"buffered-bytes",
|
|
83
|
-
"host-reads",
|
|
84
|
-
"controls",
|
|
85
|
-
"text",
|
|
86
|
-
"code-points",
|
|
87
|
-
"captures",
|
|
88
|
-
"frame-bytes",
|
|
89
|
-
"width",
|
|
90
|
-
"height",
|
|
91
|
-
"pixels",
|
|
92
|
-
"observation-snapshots",
|
|
93
|
-
"observation-handles",
|
|
94
|
-
"observation-bytes",
|
|
95
|
-
"native-operations"
|
|
96
|
-
]);
|
|
97
|
-
const SchemaPath = Schema.String.check(Schema.isMaxLength(512));
|
|
98
|
-
/**
|
|
99
|
-
* What the native engine said about a failure it raised: its first line, without escape codes,
|
|
100
|
-
* with every address cut to its origin. A host diagnostic, never part of the model projection.
|
|
101
|
-
*/
|
|
102
|
-
const NativeDetail = Schema.String.check(Schema.isMaxLength(512));
|
|
103
|
-
/** Validated constructors for host reasons. The model receives a separate bounded projection. */
|
|
104
|
-
const Reasons = {
|
|
105
|
-
Configuration: Schema.TaggedStruct("Configuration", { path: Schema.optionalKey(SchemaPath) }),
|
|
106
|
-
UnregisteredSession: Schema.TaggedStruct("UnregisteredSession", {}),
|
|
107
|
-
Unsupported: Schema.TaggedStruct("Unsupported", {}),
|
|
108
|
-
Busy: Schema.TaggedStruct("Busy", {}),
|
|
109
|
-
QueueFull: Schema.TaggedStruct("QueueFull", {
|
|
110
|
-
scope: Schema.Literals([
|
|
111
|
-
"page",
|
|
112
|
-
"session",
|
|
113
|
-
"registry"
|
|
114
|
-
]),
|
|
115
|
-
maximum: Schema.Natural,
|
|
116
|
-
observed: Schema.Natural
|
|
117
|
-
}),
|
|
118
|
-
QueueExpired: Schema.TaggedStruct("QueueExpired", {}),
|
|
119
|
-
Closed: Schema.TaggedStruct("Closed", {}),
|
|
120
|
-
Stale: Schema.TaggedStruct("Stale", {}),
|
|
121
|
-
NotFound: Schema.TaggedStruct("NotFound", {}),
|
|
122
|
-
Missing: Schema.TaggedStruct("Missing", {}),
|
|
123
|
-
Ambiguous: Schema.TaggedStruct("Ambiguous", { count: Schema.optionalKey(Schema.Natural) }),
|
|
124
|
-
Incomplete: Schema.TaggedStruct("Incomplete", {}),
|
|
125
|
-
Drifted: Schema.TaggedStruct("Drifted", {}),
|
|
126
|
-
Malformed: Schema.TaggedStruct("Malformed", { path: Schema.optionalKey(SchemaPath) }),
|
|
127
|
-
Limit: Schema.TaggedStruct("Limit", {
|
|
128
|
-
dimension: LimitDimension,
|
|
129
|
-
maximum: Schema.Natural,
|
|
130
|
-
observed: Schema.Natural
|
|
131
|
-
}),
|
|
132
|
-
Timeout: Schema.TaggedStruct("Timeout", {}),
|
|
133
|
-
ScheduleMissed: Schema.TaggedStruct("ScheduleMissed", {}),
|
|
134
|
-
TimingBudgetExceeded: Schema.TaggedStruct("TimingBudgetExceeded", {}),
|
|
135
|
-
Transport: Schema.TaggedStruct("Transport", { status: Schema.optionalKey(Schema.Int) }),
|
|
136
|
-
Provider: Schema.TaggedStruct("Provider", {
|
|
137
|
-
status: Schema.optionalKey(Schema.Int),
|
|
138
|
-
detail: Schema.optionalKey(NativeDetail)
|
|
139
|
-
}),
|
|
140
|
-
Authorization: Schema.TaggedStruct("Authorization", {}),
|
|
141
|
-
RateLimited: Schema.TaggedStruct("RateLimited", { retryAfterMillis: Schema.optionalKey(Schema.Natural) }),
|
|
142
|
-
Disconnected: Schema.TaggedStruct("Disconnected", {}),
|
|
143
|
-
Active: Schema.TaggedStruct("Active", {}),
|
|
144
|
-
Disabled: Schema.TaggedStruct("Disabled", {}),
|
|
145
|
-
Expired: Schema.TaggedStruct("Expired", {}),
|
|
146
|
-
Failed: Schema.TaggedStruct("Failed", {}),
|
|
147
|
-
UnsafeUrl: Schema.TaggedStruct("UnsafeUrl", {}),
|
|
148
|
-
ContentType: Schema.TaggedStruct("ContentType", {}),
|
|
149
|
-
Timestamp: Schema.TaggedStruct("Timestamp", {}),
|
|
150
|
-
Resized: Schema.TaggedStruct("Resized", {}),
|
|
151
|
-
TargetChanged: Schema.TaggedStruct("TargetChanged", {}),
|
|
152
|
-
Interrupted: Schema.TaggedStruct("Interrupted", {}),
|
|
153
|
-
ContextLease: Schema.TaggedStruct("ContextLease", {}),
|
|
154
|
-
NotVisible: Schema.TaggedStruct("NotVisible", {}),
|
|
155
|
-
Denied: Schema.TaggedStruct("Denied", {}),
|
|
156
|
-
NotFocused: Schema.TaggedStruct("NotFocused", {})
|
|
157
|
-
};
|
|
158
|
-
const BrowserReason = Schema.Union(Object.values(Reasons));
|
|
159
|
-
/**
|
|
160
|
-
* Containment never changes an uncertain mutation into a known action outcome. `PagePaused` is
|
|
161
|
-
* a page's own popup/dialog-policy quarantine: the page stays open for an operator and refuses
|
|
162
|
-
* automation until a drained handoff and explicit release.
|
|
163
|
-
*/
|
|
164
|
-
const Containment = Schema.Union([
|
|
165
|
-
Schema.TaggedStruct("NotRequired", {}),
|
|
166
|
-
Schema.TaggedStruct("PageClosed", {
|
|
167
|
-
pageId: Schema.String,
|
|
168
|
-
generation: Schema.Natural
|
|
169
|
-
}),
|
|
170
|
-
Schema.TaggedStruct("PagePaused", {
|
|
171
|
-
pageId: Schema.String,
|
|
172
|
-
generation: Schema.Natural
|
|
173
|
-
}),
|
|
174
|
-
Schema.TaggedStruct("SessionFenced", { generation: Schema.Natural })
|
|
175
|
-
]);
|
|
176
|
-
var BrowserError = class extends Schema.TaggedError()("BrowserError", {
|
|
177
|
-
operation: BrowserOperation,
|
|
178
|
-
reason: BrowserReason,
|
|
179
|
-
outcome: BrowserOutcome,
|
|
180
|
-
containment: Schema.optionalKey(Containment)
|
|
181
|
-
}) {};
|
|
182
|
-
var InitializationError = class extends Schema.TaggedError()("InitializationError", {
|
|
183
|
-
operation: Schema.Literals([
|
|
184
|
-
"configure",
|
|
185
|
-
"register",
|
|
186
|
-
"ready",
|
|
187
|
-
"callback",
|
|
188
|
-
"dispose"
|
|
189
|
-
]),
|
|
190
|
-
step: Schema.String.check(Schema.isMaxLength(128)),
|
|
191
|
-
reason: Schema.Literals([
|
|
192
|
-
"configuration",
|
|
193
|
-
"unsupported",
|
|
194
|
-
"origin",
|
|
195
|
-
"stale",
|
|
196
|
-
"busy",
|
|
197
|
-
"closed",
|
|
198
|
-
"timeout",
|
|
199
|
-
"input",
|
|
200
|
-
"output",
|
|
201
|
-
"native"
|
|
202
|
-
])
|
|
203
|
-
}) {};
|
|
204
|
-
//#endregion
|
|
205
|
-
export { BrowserError, BrowserOperation, BrowserOutcome, BrowserReason, Containment, InitializationError, LimitDimension, Reasons };
|
|
206
|
-
|
|
207
|
-
//# sourceMappingURL=Errors.mjs.map
|
package/dist/Errors.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Errors.mjs","names":[],"sources":["../src/Errors.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\n/**\n * What a caller asked the owned browser to do. The vocabulary is closed: the owner stamps it\n * when it admits an operation, so a native step's own name can never become API, and a new\n * spelling is a deliberate edit here rather than a string that merely compiles.\n */\nexport const BrowserOperation = Schema.Literals([\n // configuration and lifetime\n \"configure\",\n \"launch\",\n \"connect\",\n \"reconnect\",\n \"detach\",\n \"disconnect\",\n \"close\",\n \"handoff\",\n \"resume\",\n \"live-view\",\n // targets\n \"target\",\n \"handle\",\n \"list-pages\",\n \"describe-page\",\n \"list-frames\",\n \"select-page\",\n \"new-page\",\n \"close-page\",\n \"resize\",\n // reading\n \"ready\",\n \"observe\",\n \"checkpoint\",\n \"control-facts\",\n \"revalidate\",\n \"read-text\",\n \"screenshot\",\n \"wait\",\n \"resolve\",\n \"run\",\n \"settled\",\n // input\n \"navigate\",\n \"navigate-stop\",\n \"click\",\n \"fill\",\n \"fill-form\",\n \"select-option\",\n \"scroll\",\n \"click-and-wait\",\n \"download-action\",\n \"select-files\",\n \"file-chooser\",\n \"action-result\",\n // native pointer input\n \"pointer-move\",\n \"hover\",\n \"wheel\",\n // native key input\n \"press\",\n \"type\",\n // page control\n \"page-control\",\n \"page-state\",\n \"page-suspend\",\n \"page-resume\",\n // capture\n \"capture\",\n \"capture-start\",\n \"capture-stop\",\n \"capture-consume\",\n]);\n\nexport type BrowserOperation = typeof BrowserOperation.Type;\n\n/** Dispatch evidence belongs to the operation, independently of its failure reason. */\nexport const BrowserOutcome = Schema.Literals([\"undispatched\", \"rejected\", \"performed\", \"unknown\"]);\n\nexport type BrowserOutcome = typeof BrowserOutcome.Type;\n\n/** Limits report measured producer facts; an unavailable measurement is never invented. */\nexport const LimitDimension = Schema.Literals([\n \"runs\",\n \"actions\",\n \"elapsed\",\n \"returned-bytes\",\n \"pages\",\n \"frames\",\n \"frame-depth\",\n \"buffered-frames\",\n \"buffered-bytes\",\n \"host-reads\",\n \"controls\",\n \"text\",\n \"code-points\",\n \"captures\",\n \"frame-bytes\",\n \"width\",\n \"height\",\n \"pixels\",\n \"observation-snapshots\",\n \"observation-handles\",\n \"observation-bytes\",\n \"native-operations\",\n]);\n\nconst SchemaPath = Schema.String.check(Schema.isMaxLength(512));\n\n/**\n * What the native engine said about a failure it raised: its first line, without escape codes,\n * with every address cut to its origin. A host diagnostic, never part of the model projection.\n */\nconst NativeDetail = Schema.String.check(Schema.isMaxLength(512));\n\n/** Validated constructors for host reasons. The model receives a separate bounded projection. */\nexport const Reasons = {\n Configuration: Schema.TaggedStruct(\"Configuration\", { path: Schema.optionalKey(SchemaPath) }),\n UnregisteredSession: Schema.TaggedStruct(\"UnregisteredSession\", {}),\n Unsupported: Schema.TaggedStruct(\"Unsupported\", {}),\n Busy: Schema.TaggedStruct(\"Busy\", {}),\n QueueFull: Schema.TaggedStruct(\"QueueFull\", {\n scope: Schema.Literals([\"page\", \"session\", \"registry\"]),\n maximum: Schema.Natural,\n observed: Schema.Natural,\n }),\n QueueExpired: Schema.TaggedStruct(\"QueueExpired\", {}),\n Closed: Schema.TaggedStruct(\"Closed\", {}),\n Stale: Schema.TaggedStruct(\"Stale\", {}),\n NotFound: Schema.TaggedStruct(\"NotFound\", {}),\n Missing: Schema.TaggedStruct(\"Missing\", {}),\n Ambiguous: Schema.TaggedStruct(\"Ambiguous\", { count: Schema.optionalKey(Schema.Natural) }),\n Incomplete: Schema.TaggedStruct(\"Incomplete\", {}),\n Drifted: Schema.TaggedStruct(\"Drifted\", {}),\n Malformed: Schema.TaggedStruct(\"Malformed\", { path: Schema.optionalKey(SchemaPath) }),\n Limit: Schema.TaggedStruct(\"Limit\", {\n dimension: LimitDimension,\n maximum: Schema.Natural,\n observed: Schema.Natural,\n }),\n Timeout: Schema.TaggedStruct(\"Timeout\", {}),\n ScheduleMissed: Schema.TaggedStruct(\"ScheduleMissed\", {}),\n TimingBudgetExceeded: Schema.TaggedStruct(\"TimingBudgetExceeded\", {}),\n Transport: Schema.TaggedStruct(\"Transport\", { status: Schema.optionalKey(Schema.Int) }),\n Provider: Schema.TaggedStruct(\"Provider\", {\n status: Schema.optionalKey(Schema.Int),\n detail: Schema.optionalKey(NativeDetail),\n }),\n Authorization: Schema.TaggedStruct(\"Authorization\", {}),\n RateLimited: Schema.TaggedStruct(\"RateLimited\", {\n retryAfterMillis: Schema.optionalKey(Schema.Natural),\n }),\n Disconnected: Schema.TaggedStruct(\"Disconnected\", {}),\n Active: Schema.TaggedStruct(\"Active\", {}),\n Disabled: Schema.TaggedStruct(\"Disabled\", {}),\n Expired: Schema.TaggedStruct(\"Expired\", {}),\n Failed: Schema.TaggedStruct(\"Failed\", {}),\n UnsafeUrl: Schema.TaggedStruct(\"UnsafeUrl\", {}),\n ContentType: Schema.TaggedStruct(\"ContentType\", {}),\n Timestamp: Schema.TaggedStruct(\"Timestamp\", {}),\n Resized: Schema.TaggedStruct(\"Resized\", {}),\n TargetChanged: Schema.TaggedStruct(\"TargetChanged\", {}),\n Interrupted: Schema.TaggedStruct(\"Interrupted\", {}),\n ContextLease: Schema.TaggedStruct(\"ContextLease\", {}),\n NotVisible: Schema.TaggedStruct(\"NotVisible\", {}),\n Denied: Schema.TaggedStruct(\"Denied\", {}),\n NotFocused: Schema.TaggedStruct(\"NotFocused\", {}),\n} as const;\n\nexport const BrowserReason = Schema.Union(Object.values(Reasons));\n\nexport type BrowserReason = typeof BrowserReason.Type;\n\n/**\n * Containment never changes an uncertain mutation into a known action outcome. `PagePaused` is\n * a page's own popup/dialog-policy quarantine: the page stays open for an operator and refuses\n * automation until a drained handoff and explicit release.\n */\nexport const Containment = Schema.Union([\n Schema.TaggedStruct(\"NotRequired\", {}),\n Schema.TaggedStruct(\"PageClosed\", { pageId: Schema.String, generation: Schema.Natural }),\n Schema.TaggedStruct(\"PagePaused\", { pageId: Schema.String, generation: Schema.Natural }),\n Schema.TaggedStruct(\"SessionFenced\", { generation: Schema.Natural }),\n]);\n\nexport type Containment = typeof Containment.Type;\n\nexport class BrowserError extends Schema.TaggedError<BrowserError>()(\"BrowserError\", {\n operation: BrowserOperation,\n reason: BrowserReason,\n outcome: BrowserOutcome,\n containment: Schema.optionalKey(Containment),\n}) {}\n\nexport class InitializationError extends Schema.TaggedError<InitializationError>()(\n \"InitializationError\",\n {\n operation: Schema.Literals([\"configure\", \"register\", \"ready\", \"callback\", \"dispose\"]),\n step: Schema.String.check(Schema.isMaxLength(128)),\n reason: Schema.Literals([\n \"configuration\",\n \"unsupported\",\n \"origin\",\n \"stale\",\n \"busy\",\n \"closed\",\n \"timeout\",\n \"input\",\n \"output\",\n \"native\",\n ]),\n },\n) {}\n"],"mappings":"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"}
|
package/dist/Images-yCG9BmRU.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Reasons } from "./Errors.mjs";
|
|
2
|
-
import { y as failure } from "./PublicSession-DCSMMqOj.mjs";
|
|
3
|
-
//#region src/internal/browser/Images.ts
|
|
4
|
-
const malformed = () => failure(Reasons.Malformed.make({}));
|
|
5
|
-
/** A checked read: a truncated segment is malformed framing, never `undefined` arithmetic. */
|
|
6
|
-
const byteAt = (bytes, index) => {
|
|
7
|
-
const byte = bytes[index];
|
|
8
|
-
if (byte === void 0) throw malformed();
|
|
9
|
-
return byte;
|
|
10
|
-
};
|
|
11
|
-
/** Parse framing only; a caller decoding media must still validate its complete bitstream. */
|
|
12
|
-
const pngGeometry = (bytes) => {
|
|
13
|
-
if (bytes.length < 33 || [
|
|
14
|
-
137,
|
|
15
|
-
80,
|
|
16
|
-
78,
|
|
17
|
-
71,
|
|
18
|
-
13,
|
|
19
|
-
10,
|
|
20
|
-
26,
|
|
21
|
-
10
|
|
22
|
-
].some((b, i) => bytes[i] !== b) || bytes[12] !== 73 || bytes[13] !== 72 || bytes[14] !== 68 || bytes[15] !== 82) throw malformed();
|
|
23
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
24
|
-
if (view.getUint32(8) !== 13) throw malformed();
|
|
25
|
-
const width = view.getUint32(16), height = view.getUint32(20);
|
|
26
|
-
if (width === 0 || height === 0) throw malformed();
|
|
27
|
-
return {
|
|
28
|
-
width,
|
|
29
|
-
height
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
/** JPEG SOF dimensions avoid trusting the requested size or CSS viewport dimensions. */
|
|
33
|
-
const jpegGeometry = (bytes) => {
|
|
34
|
-
if (bytes.length < 4 || bytes[0] !== 255 || bytes[1] !== 216) throw malformed();
|
|
35
|
-
let offset = 2;
|
|
36
|
-
while (offset + 3 < bytes.length) {
|
|
37
|
-
if (bytes[offset++] !== 255) throw malformed();
|
|
38
|
-
while (bytes[offset] === 255) offset++;
|
|
39
|
-
const marker = bytes[offset++];
|
|
40
|
-
if (marker === void 0 || marker === 217 || marker === 218) break;
|
|
41
|
-
if (marker === 1 || marker >= 208 && marker <= 215) continue;
|
|
42
|
-
if (offset + 1 >= bytes.length) throw malformed();
|
|
43
|
-
const size = byteAt(bytes, offset) * 256 + byteAt(bytes, offset + 1);
|
|
44
|
-
if (size < 2 || offset + size > bytes.length) throw malformed();
|
|
45
|
-
if ([
|
|
46
|
-
192,
|
|
47
|
-
193,
|
|
48
|
-
194,
|
|
49
|
-
195,
|
|
50
|
-
197,
|
|
51
|
-
198,
|
|
52
|
-
199,
|
|
53
|
-
201,
|
|
54
|
-
202,
|
|
55
|
-
203,
|
|
56
|
-
205,
|
|
57
|
-
206,
|
|
58
|
-
207
|
|
59
|
-
].includes(marker)) {
|
|
60
|
-
if (size < 8) throw malformed();
|
|
61
|
-
const height = byteAt(bytes, offset + 3) * 256 + byteAt(bytes, offset + 4);
|
|
62
|
-
const width = byteAt(bytes, offset + 5) * 256 + byteAt(bytes, offset + 6);
|
|
63
|
-
if (width === 0 || height === 0) throw malformed();
|
|
64
|
-
return {
|
|
65
|
-
width,
|
|
66
|
-
height
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
offset += size;
|
|
70
|
-
}
|
|
71
|
-
throw malformed();
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
export { pngGeometry as n, jpegGeometry as t };
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=Images-yCG9BmRU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Images-yCG9BmRU.mjs","names":[],"sources":["../src/internal/browser/Images.ts"],"sourcesContent":["import { Reasons } from \"../../Errors.ts\";\nimport { failure } from \"./NativeCalls.ts\";\n\nconst malformed = () => failure(Reasons.Malformed.make({}));\n\n/** A checked read: a truncated segment is malformed framing, never `undefined` arithmetic. */\nconst byteAt = (bytes: Uint8Array, index: number): number => {\n const byte = bytes[index];\n\n if (byte === undefined) throw malformed();\n\n return byte;\n};\n\n/** Parse framing only; a caller decoding media must still validate its complete bitstream. */\nexport const pngGeometry = (bytes: Uint8Array): { width: number; height: number } => {\n const signature = [137, 80, 78, 71, 13, 10, 26, 10];\n\n if (\n bytes.length < 33 ||\n signature.some((b, i) => bytes[i] !== b) ||\n bytes[12] !== 73 ||\n bytes[13] !== 72 ||\n bytes[14] !== 68 ||\n bytes[15] !== 82\n )\n throw malformed();\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n\n if (view.getUint32(8) !== 13) throw malformed();\n\n const width = view.getUint32(16),\n height = view.getUint32(20);\n\n if (width === 0 || height === 0) throw malformed();\n\n return { width, height };\n};\n\n/** JPEG SOF dimensions avoid trusting the requested size or CSS viewport dimensions. */\nexport const jpegGeometry = (bytes: Uint8Array): { width: number; height: number } => {\n if (bytes.length < 4 || bytes[0] !== 255 || bytes[1] !== 216) throw malformed();\n let offset = 2;\n\n while (offset + 3 < bytes.length) {\n if (bytes[offset++] !== 255) throw malformed();\n while (bytes[offset] === 255) offset++;\n const marker = bytes[offset++];\n\n if (marker === undefined || marker === 217 || marker === 218) break;\n if (marker === 1 || (marker >= 208 && marker <= 215)) continue;\n if (offset + 1 >= bytes.length) throw malformed();\n const size = byteAt(bytes, offset) * 256 + byteAt(bytes, offset + 1);\n\n if (size < 2 || offset + size > bytes.length) throw malformed();\n if ([192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207].includes(marker)) {\n if (size < 8) throw malformed();\n const height = byteAt(bytes, offset + 3) * 256 + byteAt(bytes, offset + 4);\n const width = byteAt(bytes, offset + 5) * 256 + byteAt(bytes, offset + 6);\n\n if (width === 0 || height === 0) throw malformed();\n\n return { width, height };\n }\n offset += size;\n }\n throw malformed();\n};\n"],"mappings":";;;AAGA,MAAM,kBAAkB,QAAQ,QAAQ,UAAU,KAAK,CAAC,CAAC,CAAC;;AAG1D,MAAM,UAAU,OAAmB,UAA0B;CAC3D,MAAM,OAAO,MAAM;CAEnB,IAAI,SAAS,KAAA,GAAW,MAAM,UAAU;CAExC,OAAO;AACT;;AAGA,MAAa,eAAe,UAAyD;CAGnF,IACE,MAAM,SAAS,MACf;EAJiB;EAAK;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;CAItC,CAAC,CAAC,MAAM,GAAG,MAAM,MAAM,OAAO,CAAC,KACvC,MAAM,QAAQ,MACd,MAAM,QAAQ,MACd,MAAM,QAAQ,MACd,MAAM,QAAQ,IAEd,MAAM,UAAU;CAClB,MAAM,OAAO,IAAI,SAAS,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU;CAE1E,IAAI,KAAK,UAAU,CAAC,MAAM,IAAI,MAAM,UAAU;CAE9C,MAAM,QAAQ,KAAK,UAAU,EAAE,GAC7B,SAAS,KAAK,UAAU,EAAE;CAE5B,IAAI,UAAU,KAAK,WAAW,GAAG,MAAM,UAAU;CAEjD,OAAO;EAAE;EAAO;CAAO;AACzB;;AAGA,MAAa,gBAAgB,UAAyD;CACpF,IAAI,MAAM,SAAS,KAAK,MAAM,OAAO,OAAO,MAAM,OAAO,KAAK,MAAM,UAAU;CAC9E,IAAI,SAAS;CAEb,OAAO,SAAS,IAAI,MAAM,QAAQ;EAChC,IAAI,MAAM,cAAc,KAAK,MAAM,UAAU;EAC7C,OAAO,MAAM,YAAY,KAAK;EAC9B,MAAM,SAAS,MAAM;EAErB,IAAI,WAAW,KAAA,KAAa,WAAW,OAAO,WAAW,KAAK;EAC9D,IAAI,WAAW,KAAM,UAAU,OAAO,UAAU,KAAM;EACtD,IAAI,SAAS,KAAK,MAAM,QAAQ,MAAM,UAAU;EAChD,MAAM,OAAO,OAAO,OAAO,MAAM,IAAI,MAAM,OAAO,OAAO,SAAS,CAAC;EAEnE,IAAI,OAAO,KAAK,SAAS,OAAO,MAAM,QAAQ,MAAM,UAAU;EAC9D,IAAI;GAAC;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;GAAK;EAAG,CAAC,CAAC,SAAS,MAAM,GAAG;GACtF,IAAI,OAAO,GAAG,MAAM,UAAU;GAC9B,MAAM,SAAS,OAAO,OAAO,SAAS,CAAC,IAAI,MAAM,OAAO,OAAO,SAAS,CAAC;GACzE,MAAM,QAAQ,OAAO,OAAO,SAAS,CAAC,IAAI,MAAM,OAAO,OAAO,SAAS,CAAC;GAExE,IAAI,UAAU,KAAK,WAAW,GAAG,MAAM,UAAU;GAEjD,OAAO;IAAE;IAAO;GAAO;EACzB;EACA,UAAU;CACZ;CACA,MAAM,UAAU;AAClB"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Duration, Option, Schema } from "effect";
|
|
2
|
-
//#region src/internal/browser/OperationOptions.ts
|
|
3
|
-
const FiniteDurationValue = Schema.Union([Schema.TaggedStruct("Millis", { millis: Schema.Finite }), Schema.TaggedStruct("Nanos", { nanos: Schema.BigInt })]);
|
|
4
|
-
const FiniteDurationInput = Schema.Union([
|
|
5
|
-
Schema.Duration.check(Schema.makeFilter((duration) => Schema.is(FiniteDurationValue)(duration.value))),
|
|
6
|
-
Schema.Finite,
|
|
7
|
-
Schema.BigInt,
|
|
8
|
-
Schema.TemplateLiteral([
|
|
9
|
-
Schema.Finite,
|
|
10
|
-
" ",
|
|
11
|
-
Schema.Literals([
|
|
12
|
-
"nano",
|
|
13
|
-
"nanos",
|
|
14
|
-
"micro",
|
|
15
|
-
"micros",
|
|
16
|
-
"milli",
|
|
17
|
-
"millis",
|
|
18
|
-
"second",
|
|
19
|
-
"seconds",
|
|
20
|
-
"minute",
|
|
21
|
-
"minutes",
|
|
22
|
-
"hour",
|
|
23
|
-
"hours",
|
|
24
|
-
"day",
|
|
25
|
-
"days",
|
|
26
|
-
"week",
|
|
27
|
-
"weeks"
|
|
28
|
-
])
|
|
29
|
-
]),
|
|
30
|
-
Schema.Literals(["Infinity", "-Infinity"]),
|
|
31
|
-
Schema.Tuple([Schema.Finite, Schema.Finite]),
|
|
32
|
-
Schema.Struct({
|
|
33
|
-
weeks: Schema.optionalKey(Schema.Finite),
|
|
34
|
-
days: Schema.optionalKey(Schema.Finite),
|
|
35
|
-
hours: Schema.optionalKey(Schema.Finite),
|
|
36
|
-
minutes: Schema.optionalKey(Schema.Finite),
|
|
37
|
-
seconds: Schema.optionalKey(Schema.Finite),
|
|
38
|
-
milliseconds: Schema.optionalKey(Schema.Finite),
|
|
39
|
-
microseconds: Schema.optionalKey(Schema.Finite),
|
|
40
|
-
nanoseconds: Schema.optionalKey(Schema.Finite)
|
|
41
|
-
})
|
|
42
|
-
]).check(Schema.makeFilter((input) => Option.exists(Duration.fromInput(input), (duration) => Duration.isFinite(duration) && !Duration.isNegative(duration) && Number.isFinite(Duration.toMillis(duration))), { message: "Queue duration must be finite and nonnegative" }));
|
|
43
|
-
/** Host configuration only; never part of model-facing request schemas. */
|
|
44
|
-
const AdmissionOptionsSchema = Schema.Struct({ queue: Schema.optionalKey(FiniteDurationInput) });
|
|
45
|
-
const OperationOptionsSchema = Schema.Struct({
|
|
46
|
-
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
47
|
-
minimum: 1,
|
|
48
|
-
maximum: 6e4
|
|
49
|
-
}))),
|
|
50
|
-
admission: Schema.optionalKey(AdmissionOptionsSchema)
|
|
51
|
-
});
|
|
52
|
-
//#endregion
|
|
53
|
-
export { FiniteDurationInput as n, OperationOptionsSchema as r, AdmissionOptionsSchema as t };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=OperationOptions-DAeRS6O9.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OperationOptions-DAeRS6O9.mjs","names":[],"sources":["../src/internal/browser/OperationOptions.ts"],"sourcesContent":["import { Duration, Option, Schema } from \"effect\";\n\nconst FiniteDurationValue = Schema.Union([\n Schema.TaggedStruct(\"Millis\", { millis: Schema.Finite }),\n Schema.TaggedStruct(\"Nanos\", { nanos: Schema.BigInt }),\n]);\n\n// Duration.fromInput intentionally normalizes raw NaN to zero. Validate raw components first\n// so an invalid queue allowance cannot silently become fail-fast admission.\nexport const FiniteDurationInput = Schema.Union([\n // The built-in declaration checks only the Duration marker. Validate its representation\n // before arithmetic so a malformed host value is a typed refusal rather than a defect.\n Schema.Duration.check(\n Schema.makeFilter((duration) => Schema.is(FiniteDurationValue)(duration.value)),\n ),\n Schema.Finite,\n Schema.BigInt,\n Schema.TemplateLiteral([\n Schema.Finite,\n \" \",\n Schema.Literals([\n \"nano\",\n \"nanos\",\n \"micro\",\n \"micros\",\n \"milli\",\n \"millis\",\n \"second\",\n \"seconds\",\n \"minute\",\n \"minutes\",\n \"hour\",\n \"hours\",\n \"day\",\n \"days\",\n \"week\",\n \"weeks\",\n ]),\n ]),\n Schema.Literals([\"Infinity\", \"-Infinity\"]),\n Schema.Tuple([Schema.Finite, Schema.Finite]),\n Schema.Struct({\n weeks: Schema.optionalKey(Schema.Finite),\n days: Schema.optionalKey(Schema.Finite),\n hours: Schema.optionalKey(Schema.Finite),\n minutes: Schema.optionalKey(Schema.Finite),\n seconds: Schema.optionalKey(Schema.Finite),\n milliseconds: Schema.optionalKey(Schema.Finite),\n microseconds: Schema.optionalKey(Schema.Finite),\n nanoseconds: Schema.optionalKey(Schema.Finite),\n }),\n]).check(\n Schema.makeFilter(\n (input) =>\n Option.exists(\n Duration.fromInput(input),\n (duration) =>\n Duration.isFinite(duration) &&\n !Duration.isNegative(duration) &&\n Number.isFinite(Duration.toMillis(duration)),\n ),\n { message: \"Queue duration must be finite and nonnegative\" },\n ),\n);\n\n/** Host configuration only; never part of model-facing request schemas. */\nexport const AdmissionOptionsSchema = Schema.Struct({\n queue: Schema.optionalKey(FiniteDurationInput),\n});\n\nexport const OperationOptionsSchema = Schema.Struct({\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n admission: Schema.optionalKey(AdmissionOptionsSchema),\n});\n"],"mappings":";;AAEA,MAAM,sBAAsB,OAAO,MAAM,CACvC,OAAO,aAAa,UAAU,EAAE,QAAQ,OAAO,OAAO,CAAC,GACvD,OAAO,aAAa,SAAS,EAAE,OAAO,OAAO,OAAO,CAAC,CACvD,CAAC;AAID,MAAa,sBAAsB,OAAO,MAAM;CAG9C,OAAO,SAAS,MACd,OAAO,YAAY,aAAa,OAAO,GAAG,mBAAmB,CAAC,CAAC,SAAS,KAAK,CAAC,CAChF;CACA,OAAO;CACP,OAAO;CACP,OAAO,gBAAgB;EACrB,OAAO;EACP;EACA,OAAO,SAAS;GACd;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;CACH,CAAC;CACD,OAAO,SAAS,CAAC,YAAY,WAAW,CAAC;CACzC,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC;CAC3C,OAAO,OAAO;EACZ,OAAO,OAAO,YAAY,OAAO,MAAM;EACvC,MAAM,OAAO,YAAY,OAAO,MAAM;EACtC,OAAO,OAAO,YAAY,OAAO,MAAM;EACvC,SAAS,OAAO,YAAY,OAAO,MAAM;EACzC,SAAS,OAAO,YAAY,OAAO,MAAM;EACzC,cAAc,OAAO,YAAY,OAAO,MAAM;EAC9C,cAAc,OAAO,YAAY,OAAO,MAAM;EAC9C,aAAa,OAAO,YAAY,OAAO,MAAM;CAC/C,CAAC;AACH,CAAC,CAAC,CAAC,MACD,OAAO,YACJ,UACC,OAAO,OACL,SAAS,UAAU,KAAK,IACvB,aACC,SAAS,SAAS,QAAQ,KAC1B,CAAC,SAAS,WAAW,QAAQ,KAC7B,OAAO,SAAS,SAAS,SAAS,QAAQ,CAAC,CAC/C,GACF,EAAE,SAAS,gDAAgD,CAC7D,CACF;;AAGA,MAAa,yBAAyB,OAAO,OAAO,EAClD,OAAO,OAAO,YAAY,mBAAmB,EAC/C,CAAC;AAED,MAAa,yBAAyB,OAAO,OAAO;CAClD,eAAe,OAAO,YACpB,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAM,CAAC,CAAC,CACnE;CACA,WAAW,OAAO,YAAY,sBAAsB;AACtD,CAAC"}
|
package/dist/PageControl.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { F as PageExecutionState, L as PageSuspension } from "./BrowserData-CPIIIHol.mjs";
|
|
3
|
-
import { l as OperationOptions, u as Page } from "./Browser-BF9_sORP.mjs";
|
|
4
|
-
import { Effect } from "effect";
|
|
5
|
-
//#region src/PageControl.d.ts
|
|
6
|
-
/** Last acknowledged state; no remote guarantee survives connection loss or external control. */
|
|
7
|
-
export declare const state: (page: Page, options?: OperationOptions) => Effect.Effect<PageExecutionState, BrowserError>;
|
|
8
|
-
/** Explicit host-only hold requiring pageControl support; capture ACKs never invoke it. */
|
|
9
|
-
export declare const suspend: (page: Page, options?: OperationOptions) => Effect.Effect<PageSuspension, BrowserError>;
|
|
10
|
-
/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */
|
|
11
|
-
export declare const resume: (page: Page, receipt: PageSuspension, options?: OperationOptions) => Effect.Effect<void, BrowserError>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { PageExecutionState, PageSuspension };
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=PageControl.d.mts.map
|
package/dist/PageControl.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BrowserError, Reasons } from "./Errors.mjs";
|
|
2
|
-
import { PageExecutionState, PageSuspension } from "./BrowserData.mjs";
|
|
3
|
-
import { s as pageControl } from "./PageRegistry-B3q9DS3g.mjs";
|
|
4
|
-
import { n as checkedOperationOptions } from "./PublicSession-DCSMMqOj.mjs";
|
|
5
|
-
import { Effect, Schema } from "effect";
|
|
6
|
-
//#region src/PageControl.ts
|
|
7
|
-
const owner = (page) => Effect.suspend(() => {
|
|
8
|
-
const association = pageControl(page);
|
|
9
|
-
return association === void 0 ? Effect.fail(BrowserError.make({
|
|
10
|
-
operation: "page-control",
|
|
11
|
-
reason: Reasons.UnregisteredSession.make({}),
|
|
12
|
-
outcome: "undispatched"
|
|
13
|
-
})) : Effect.succeed(association);
|
|
14
|
-
});
|
|
15
|
-
const invalid = () => BrowserError.make({
|
|
16
|
-
operation: "page-control",
|
|
17
|
-
reason: Reasons.Configuration.make({}),
|
|
18
|
-
outcome: "undispatched"
|
|
19
|
-
});
|
|
20
|
-
const requested = (page, options) => owner(page).pipe(Effect.flatMap((association) => checkedOperationOptions(options, "page-control").pipe(Effect.map((options) => ({
|
|
21
|
-
port: association.port,
|
|
22
|
-
page: association.page,
|
|
23
|
-
options
|
|
24
|
-
})))));
|
|
25
|
-
/** Last acknowledged state; no remote guarantee survives connection loss or external control. */
|
|
26
|
-
const state = (page, options) => requested(page, options).pipe(Effect.flatMap(({ port, page, options }) => port.state(page, options)));
|
|
27
|
-
/** Explicit host-only hold requiring pageControl support; capture ACKs never invoke it. */
|
|
28
|
-
const suspend = (page, options) => requested(page, options).pipe(Effect.flatMap(({ port, page, options }) => port.suspend(page, options)));
|
|
29
|
-
/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */
|
|
30
|
-
const resume = (page, receipt, options) => Schema.decodeEffect(PageSuspension)(receipt).pipe(Effect.mapError(invalid), Effect.map((value) => Object.freeze(PageSuspension.make({ ...value }))), Effect.flatMap((value) => owner(page).pipe(Effect.flatMap(({ port, page }) => page.pageId !== value.pageId || page.targetId !== value.targetId ? Effect.fail(invalid()) : checkedOperationOptions(options, "page-control").pipe(Effect.flatMap((options) => port.resume(value, options)))))));
|
|
31
|
-
//#endregion
|
|
32
|
-
export { PageExecutionState, PageSuspension, resume, state, suspend };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=PageControl.mjs.map
|
package/dist/PageControl.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageControl.mjs","names":[],"sources":["../src/PageControl.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\n\nimport type { OperationOptions, Page } from \"./Browser.ts\";\nimport { type PageExecutionState, PageSuspension } from \"./BrowserData.ts\";\nimport { BrowserError, Reasons } from \"./Errors.ts\";\nimport { pageControl } from \"./internal/browser/PageRegistry.ts\";\nimport { checkedOperationOptions } from \"./internal/browser/PublicSession.ts\";\nexport { PageExecutionState, PageSuspension } from \"./BrowserData.ts\";\n\nconst owner = (page: Page) =>\n Effect.suspend(() => {\n const association = pageControl(page);\n\n return association === undefined\n ? Effect.fail(\n BrowserError.make({\n operation: \"page-control\",\n reason: Reasons.UnregisteredSession.make({}),\n outcome: \"undispatched\",\n }),\n )\n : Effect.succeed(association);\n });\n\nconst invalid = () =>\n BrowserError.make({\n operation: \"page-control\",\n reason: Reasons.Configuration.make({}),\n outcome: \"undispatched\",\n });\n\nconst requested = (page: Page, options?: OperationOptions) =>\n owner(page).pipe(\n Effect.flatMap((association) =>\n checkedOperationOptions(options, \"page-control\").pipe(\n Effect.map((options) => ({ port: association.port, page: association.page, options })),\n ),\n ),\n );\n\n/** Last acknowledged state; no remote guarantee survives connection loss or external control. */\nexport const state = (\n page: Page,\n options?: OperationOptions,\n): Effect.Effect<PageExecutionState, BrowserError> =>\n requested(page, options).pipe(\n Effect.flatMap(({ port, page, options }) => port.state(page, options)),\n );\n\n/** Explicit host-only hold requiring pageControl support; capture ACKs never invoke it. */\nexport const suspend = (\n page: Page,\n options?: OperationOptions,\n): Effect.Effect<PageSuspension, BrowserError> =>\n requested(page, options).pipe(\n Effect.flatMap(({ port, page, options }) => port.suspend(page, options)),\n );\n\n/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */\nexport const resume = (\n page: Page,\n receipt: PageSuspension,\n options?: OperationOptions,\n): Effect.Effect<void, BrowserError> =>\n Schema.decodeEffect(PageSuspension)(receipt).pipe(\n Effect.mapError(invalid),\n Effect.map((value) => Object.freeze(PageSuspension.make({ ...value }))),\n Effect.flatMap((value) =>\n owner(page).pipe(\n Effect.flatMap(({ port, page }) =>\n page.pageId !== value.pageId || page.targetId !== value.targetId\n ? Effect.fail(invalid())\n : checkedOperationOptions(options, \"page-control\").pipe(\n Effect.flatMap((options) => port.resume(value, options)),\n ),\n ),\n ),\n ),\n );\n"],"mappings":";;;;;;AASA,MAAM,SAAS,SACb,OAAO,cAAc;CACnB,MAAM,cAAc,YAAY,IAAI;CAEpC,OAAO,gBAAgB,KAAA,IACnB,OAAO,KACL,aAAa,KAAK;EAChB,WAAW;EACX,QAAQ,QAAQ,oBAAoB,KAAK,CAAC,CAAC;EAC3C,SAAS;CACX,CAAC,CACH,IACA,OAAO,QAAQ,WAAW;AAChC,CAAC;AAEH,MAAM,gBACJ,aAAa,KAAK;CAChB,WAAW;CACX,QAAQ,QAAQ,cAAc,KAAK,CAAC,CAAC;CACrC,SAAS;AACX,CAAC;AAEH,MAAM,aAAa,MAAY,YAC7B,MAAM,IAAI,CAAC,CAAC,KACV,OAAO,SAAS,gBACd,wBAAwB,SAAS,cAAc,CAAC,CAAC,KAC/C,OAAO,KAAK,aAAa;CAAE,MAAM,YAAY;CAAM,MAAM,YAAY;CAAM;AAAQ,EAAE,CACvF,CACF,CACF;;AAGF,MAAa,SACX,MACA,YAEA,UAAU,MAAM,OAAO,CAAC,CAAC,KACvB,OAAO,SAAS,EAAE,MAAM,MAAM,cAAc,KAAK,MAAM,MAAM,OAAO,CAAC,CACvE;;AAGF,MAAa,WACX,MACA,YAEA,UAAU,MAAM,OAAO,CAAC,CAAC,KACvB,OAAO,SAAS,EAAE,MAAM,MAAM,cAAc,KAAK,QAAQ,MAAM,OAAO,CAAC,CACzE;;AAGF,MAAa,UACX,MACA,SACA,YAEA,OAAO,aAAa,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,KAC3C,OAAO,SAAS,OAAO,GACvB,OAAO,KAAK,UAAU,OAAO,OAAO,eAAe,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,GACtE,OAAO,SAAS,UACd,MAAM,IAAI,CAAC,CAAC,KACV,OAAO,SAAS,EAAE,MAAM,WACtB,KAAK,WAAW,MAAM,UAAU,KAAK,aAAa,MAAM,WACpD,OAAO,KAAK,QAAQ,CAAC,IACrB,wBAAwB,SAAS,cAAc,CAAC,CAAC,KAC/C,OAAO,SAAS,YAAY,KAAK,OAAO,OAAO,OAAO,CAAC,CACzD,CACN,CACF,CACF,CACF"}
|