effect-browserbase 0.1.0-beta.104 → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -305
- package/dist/Account.d.mts +4 -6
- package/dist/Account.mjs +4 -9
- package/dist/Account.mjs.map +1 -1
- package/dist/{Acquisition-WBafHwXH.mjs → Acquisition-D8o4jtCg.mjs} +22 -68
- package/dist/Acquisition-D8o4jtCg.mjs.map +1 -0
- package/dist/Agents.d.mts +4 -6
- package/dist/Agents.mjs +3 -19
- package/dist/Agents.mjs.map +1 -1
- package/dist/Allocation.d.mts +9 -11
- package/dist/Allocation.mjs +2 -4
- package/dist/Allocation.mjs.map +1 -1
- package/dist/Browser.d.mts +23 -141
- package/dist/Browser.mjs +208 -164
- package/dist/Browser.mjs.map +1 -1
- package/dist/BrowserBinding.d.mts +7 -34
- package/dist/BrowserBinding.mjs +30 -1
- package/dist/BrowserBinding.mjs.map +1 -0
- package/dist/Certificates.d.mts +3 -5
- package/dist/Certificates.mjs +2 -7
- package/dist/Certificates.mjs.map +1 -1
- package/dist/{Cleanup-G2YpTCuU.d.mts → Cleanup-DMTDBir8.d.mts} +5 -6
- package/dist/Cleanup.d.mts +3 -2
- package/dist/Cleanup.mjs +1 -6
- package/dist/Cleanup.mjs.map +1 -1
- package/dist/{Client-D1_xYM9o.mjs → Client-BQteUePT.mjs} +2 -4
- package/dist/{Client-D1_xYM9o.mjs.map → Client-BQteUePT.mjs.map} +1 -1
- package/dist/Client.d.mts +51 -2
- package/dist/Client.mjs +1 -1
- package/dist/Connection-DcvJZEdc.mjs +65 -0
- package/dist/Connection-DcvJZEdc.mjs.map +1 -0
- package/dist/ContextCoordination.d.mts +5 -6
- package/dist/ContextCoordination.mjs +1 -8
- package/dist/ContextCoordination.mjs.map +1 -1
- package/dist/Contexts.d.mts +4 -6
- package/dist/Contexts.mjs +2 -8
- package/dist/Contexts.mjs.map +1 -1
- package/dist/Downloads.d.mts +6 -8
- package/dist/Downloads.mjs +3 -8
- package/dist/Downloads.mjs.map +1 -1
- package/dist/Errors.d.mts +3 -26
- package/dist/Errors.mjs +1 -137
- package/dist/Errors.mjs.map +1 -1
- package/dist/{Extensions-ClZbYb1H.mjs → Extensions-nMNMPGCc.mjs} +3 -9
- package/dist/{Extensions-ClZbYb1H.mjs.map → Extensions-nMNMPGCc.mjs.map} +1 -1
- package/dist/Extensions.d.mts +4 -6
- package/dist/Extensions.mjs +1 -1
- package/dist/Functions.d.mts +4 -6
- package/dist/Functions.mjs +3 -17
- package/dist/Functions.mjs.map +1 -1
- package/dist/{Launch-BHcAEq05.mjs → Launch-m0fxzJ49.mjs} +5 -5
- package/dist/Launch-m0fxzJ49.mjs.map +1 -0
- package/dist/Launch.d.mts +130 -2
- package/dist/Launch.mjs +4 -11
- package/dist/Launch.mjs.map +1 -1
- package/dist/PageFetch.d.mts +3 -5
- package/dist/PageFetch.mjs +2 -8
- package/dist/PageFetch.mjs.map +1 -1
- package/dist/Projects.d.mts +3 -5
- package/dist/Projects.mjs +2 -8
- package/dist/Projects.mjs.map +1 -1
- package/dist/Recordings.d.mts +6 -8
- package/dist/Recordings.mjs +3 -5
- package/dist/Recordings.mjs.map +1 -1
- package/dist/{References-URDAtapt.d.mts → References-DOH3Wu44.d.mts} +5 -6
- package/dist/References.d.mts +3 -2
- package/dist/References.mjs +10 -18
- package/dist/References.mjs.map +1 -1
- package/dist/Replays.d.mts +6 -8
- package/dist/Replays.mjs +3 -5
- package/dist/Replays.mjs.map +1 -1
- package/dist/Search.d.mts +3 -5
- package/dist/Search.mjs +2 -9
- package/dist/Search.mjs.map +1 -1
- package/dist/{SessionData-DRKcKCqw.d.mts → SessionData-5xYZDshJ.d.mts} +5 -6
- package/dist/SessionData.d.mts +3 -2
- package/dist/SessionData.mjs +1 -8
- package/dist/SessionData.mjs.map +1 -1
- package/dist/{Sessions-CtbseWEh.mjs → Sessions-DoQGg9nB.mjs} +34 -18
- package/dist/Sessions-DoQGg9nB.mjs.map +1 -0
- package/dist/{Sessions-B8E4kMxo.d.mts → Sessions-tFJYaXFq.d.mts} +8 -8
- package/dist/Sessions.d.mts +4 -3
- package/dist/Sessions.mjs +1 -1
- package/dist/{Transfers-Czv5IZzJ.d.mts → Transfers-GVqzrDWl.d.mts} +22 -9
- package/dist/Transfers.d.mts +3 -2
- package/dist/Transfers.mjs +12 -28
- package/dist/Transfers.mjs.map +1 -1
- package/dist/Uploads.d.mts +6 -8
- package/dist/Uploads.mjs +3 -5
- package/dist/Uploads.mjs.map +1 -1
- package/dist/Webhooks.d.mts +3 -5
- package/dist/Webhooks.mjs +2 -11
- package/dist/Webhooks.mjs.map +1 -1
- package/dist/{WriterFacts-osvYAsIx.d.mts → WriterFacts-5CPBGG1P.d.mts} +4 -3
- package/dist/index.d.mts +27 -31
- package/dist/index.mjs +26 -31
- package/package.json +3 -28
- package/dist/Acquisition-WBafHwXH.mjs.map +0 -1
- package/dist/Association-CEps4hYP.mjs +0 -10
- package/dist/Association-CEps4hYP.mjs.map +0 -1
- package/dist/Bootstrap-BXuzZojd.mjs +0 -194
- package/dist/Bootstrap-BXuzZojd.mjs.map +0 -1
- package/dist/Bootstrap-m7lHgj0D.d.mts +0 -177
- package/dist/Bootstrap.d.mts +0 -2
- package/dist/Bootstrap.mjs +0 -2
- package/dist/BrowserBinding-DlJTGYZL.mjs +0 -2508
- package/dist/BrowserBinding-DlJTGYZL.mjs.map +0 -1
- package/dist/BrowserData-LpcAuAub.d.mts +0 -369
- package/dist/BrowserData.d.mts +0 -2
- package/dist/BrowserData.mjs +0 -442
- package/dist/BrowserData.mjs.map +0 -1
- package/dist/Capture-Bc0z9IAi.mjs +0 -571
- package/dist/Capture-Bc0z9IAi.mjs.map +0 -1
- package/dist/Capture-BvWI-l1A.d.mts +0 -168
- package/dist/Capture.d.mts +0 -2
- package/dist/Capture.mjs +0 -2
- package/dist/Client-Ca0zSg1n.d.mts +0 -53
- package/dist/Images-DgscEfSf.mjs +0 -127
- package/dist/Images-DgscEfSf.mjs.map +0 -1
- package/dist/Launch-BHcAEq05.mjs.map +0 -1
- package/dist/Launch-C8CfaYxb.d.mts +0 -132
- package/dist/LocalBrowser-BLancJ3R.d.mts +0 -79
- package/dist/LocalBrowser-DsQLWNL1.mjs +0 -439
- package/dist/LocalBrowser-DsQLWNL1.mjs.map +0 -1
- package/dist/LocalBrowser.d.mts +0 -2
- package/dist/LocalBrowser.mjs +0 -2
- package/dist/PageControl.d.mts +0 -16
- package/dist/PageControl.mjs +0 -36
- package/dist/PageControl.mjs.map +0 -1
- package/dist/PageControlAssociation-DabEg5AR.mjs +0 -10
- package/dist/PageControlAssociation-DabEg5AR.mjs.map +0 -1
- package/dist/Session-D4nT9hOO.mjs +0 -1379
- package/dist/Session-D4nT9hOO.mjs.map +0 -1
- package/dist/Sessions-CtbseWEh.mjs.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { E as PageInfo, L as Target } from "./BrowserData-LpcAuAub.mjs";
|
|
3
|
-
import { BrowserSession } from "./Browser.mjs";
|
|
4
|
-
import { Effect, Schema, Scope, Stream } from "effect";
|
|
5
|
-
//#region src/internal/capture/CaptureTypes.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Binary frame data, not a live capability or a JSON/thread/Tool value. Decoding validates
|
|
8
|
-
* fields; it does not copy bytes, decode JPEG pixels, prove target authority, or repair clocks.
|
|
9
|
-
* Capture itself owns the byte copy, freezes its shared target identity, and verifies JPEG framing.
|
|
10
|
-
*/
|
|
11
|
-
declare const CapturedFrame: Schema.Struct<{
|
|
12
|
-
readonly bytes: Schema.Uint8Array;
|
|
13
|
-
readonly mediaType: Schema.Literal<"image/jpeg">;
|
|
14
|
-
readonly target: typeof Target;
|
|
15
|
-
readonly sequence: Schema.Natural;
|
|
16
|
-
/**
|
|
17
|
-
* Which document of its page this frame was received during: 0 at the start, one more for each
|
|
18
|
-
* main-frame navigation the interval observed. It is attribution by receipt order, not proof
|
|
19
|
-
* of whose pixels these are: a frame received just after a navigation can still show the
|
|
20
|
-
* document before it. Always 0 for an interval that lasts one document.
|
|
21
|
-
*/
|
|
22
|
-
readonly document: Schema.Natural;
|
|
23
|
-
readonly sourceTimeMillis: Schema.Finite;
|
|
24
|
-
readonly sourceClock: Schema.Literal<"presentation-unix-millis">;
|
|
25
|
-
readonly receivedMonotonicNanos: Schema.BigInt;
|
|
26
|
-
readonly width: Schema.Int;
|
|
27
|
-
readonly height: Schema.Int;
|
|
28
|
-
readonly viewportWidth: Schema.Int;
|
|
29
|
-
readonly viewportHeight: Schema.Int;
|
|
30
|
-
}>;
|
|
31
|
-
type CapturedFrame = typeof CapturedFrame.Type;
|
|
32
|
-
/** Source-fit request in pixels. Actual JPEG bounds are checked before any frame is delivered. */
|
|
33
|
-
declare const CaptureSize: Schema.Struct<{
|
|
34
|
-
readonly width: Schema.Int;
|
|
35
|
-
readonly height: Schema.Int;
|
|
36
|
-
}>;
|
|
37
|
-
type CaptureSize = typeof CaptureSize.Type;
|
|
38
|
-
/** Optional capture data. Defaults are applied at admission, not during schema decoding. */
|
|
39
|
-
declare const CaptureOptions: Schema.Struct<{
|
|
40
|
-
/** Pin to a page from `session.pages`; omission preserves selected-page behavior. */
|
|
41
|
-
readonly target: Schema.optionalKey<typeof PageInfo>;
|
|
42
|
-
readonly maxFrames: Schema.optionalKey<Schema.Int>;
|
|
43
|
-
readonly maxBufferedBytes: Schema.optionalKey<Schema.Int>;
|
|
44
|
-
readonly maxFrameBytes: Schema.optionalKey<Schema.Int>;
|
|
45
|
-
readonly maxDurationMillis: Schema.optionalKey<Schema.Int>;
|
|
46
|
-
readonly quality: Schema.optionalKey<Schema.Int>;
|
|
47
|
-
/** Source fit only. Does not resize the viewport or impose an FPS cap. */
|
|
48
|
-
readonly size: Schema.optionalKey<Schema.Struct<{
|
|
49
|
-
readonly width: Schema.Int;
|
|
50
|
-
readonly height: Schema.Int;
|
|
51
|
-
}>>;
|
|
52
|
-
/**
|
|
53
|
-
* `document`, the default, ends the interval when its page navigates. `page` follows the page
|
|
54
|
-
* across documents, so a capture started before a navigation covers the loading in between.
|
|
55
|
-
* It applies to a page's main frame; a capture bound to a child frame still ends with it.
|
|
56
|
-
*/
|
|
57
|
-
readonly lifetime: Schema.optionalKey<Schema.Literals<readonly ["document", "page"]>>;
|
|
58
|
-
}>;
|
|
59
|
-
type CaptureOptions = typeof CaptureOptions.Type;
|
|
60
|
-
declare const CaptureSummary_base: Schema.Class<CaptureSummary, Schema.Struct<{
|
|
61
|
-
readonly target: typeof Target;
|
|
62
|
-
readonly reason: Schema.String;
|
|
63
|
-
readonly received: Schema.Natural;
|
|
64
|
-
readonly delivered: Schema.Natural;
|
|
65
|
-
readonly dropped: Schema.Natural;
|
|
66
|
-
readonly duplicates: Schema.Natural;
|
|
67
|
-
/** Arrived after a newer frame was accepted; counted within `dropped`, never reordered in. */
|
|
68
|
-
readonly late: Schema.Natural;
|
|
69
|
-
readonly peakBufferedFrames: Schema.Natural;
|
|
70
|
-
readonly peakBufferedBytes: Schema.Natural;
|
|
71
|
-
readonly bufferedFrames: Schema.Natural;
|
|
72
|
-
readonly bufferedBytes: Schema.Natural;
|
|
73
|
-
readonly sourceFirstMillis: Schema.NullOr<Schema.Finite>;
|
|
74
|
-
readonly sourceLastMillis: Schema.NullOr<Schema.Finite>;
|
|
75
|
-
/**
|
|
76
|
-
* The captured frame's address when this interval began watching it: the URL of document 0.
|
|
77
|
-
* It is read in the same turn the watch is installed, so no navigation can fall between them.
|
|
78
|
-
*/
|
|
79
|
-
readonly initialUrl: Schema.NullOr<Schema.String>;
|
|
80
|
-
/**
|
|
81
|
-
* Each main-frame navigation a `page` interval observed, in order, with the last frame
|
|
82
|
-
* received before it and the address the new document committed. The native screencast is
|
|
83
|
-
* never restarted for one, so a boundary is not a gap this package introduced; what Chromium
|
|
84
|
-
* omitted while loading stays `upstreamDrops`. A boundary is the commit. When that navigation
|
|
85
|
-
* started and when its document finished loading are the caller's to stamp, on this same
|
|
86
|
-
* clock, around the operation that caused it. A title is page state, not part of a transition.
|
|
87
|
-
*/
|
|
88
|
-
readonly documentBoundaries: Schema.$Array<Schema.Struct<{
|
|
89
|
-
readonly document: Schema.Natural;
|
|
90
|
-
readonly observedMonotonicNanos: Schema.BigInt;
|
|
91
|
-
readonly afterSequence: Schema.NullOr<Schema.Natural>;
|
|
92
|
-
readonly url: Schema.NullOr<Schema.String>;
|
|
93
|
-
}>>;
|
|
94
|
-
/** More navigations were observed than are recorded above. Frames still count them all. */
|
|
95
|
-
readonly documentBoundariesTruncated: Schema.Boolean;
|
|
96
|
-
readonly nativeStop: Schema.Literals<readonly ["confirmed", "unconfirmed"]>;
|
|
97
|
-
/** Package accounting cannot measure frames omitted by Chromium, transport, or the provider. */
|
|
98
|
-
readonly upstreamDrops: Schema.Literal<"unknown">;
|
|
99
|
-
readonly error: Schema.optionalKey<typeof BrowserError>;
|
|
100
|
-
}>, {}>;
|
|
101
|
-
declare class CaptureSummary extends CaptureSummary_base {}
|
|
102
|
-
declare const CaptureSnapshot_base: Schema.Class<CaptureSnapshot, Schema.Struct<{
|
|
103
|
-
readonly target: typeof Target;
|
|
104
|
-
readonly received: Schema.Natural;
|
|
105
|
-
readonly delivered: Schema.Natural;
|
|
106
|
-
readonly dropped: Schema.Natural;
|
|
107
|
-
readonly duplicates: Schema.Natural;
|
|
108
|
-
readonly late: Schema.Natural;
|
|
109
|
-
readonly peakBufferedFrames: Schema.Natural;
|
|
110
|
-
readonly peakBufferedBytes: Schema.Natural;
|
|
111
|
-
readonly bufferedFrames: Schema.Natural;
|
|
112
|
-
readonly bufferedBytes: Schema.Natural;
|
|
113
|
-
readonly sourceFirstMillis: Schema.NullOr<Schema.Finite>;
|
|
114
|
-
readonly sourceLastMillis: Schema.NullOr<Schema.Finite>;
|
|
115
|
-
readonly initialUrl: Schema.NullOr<Schema.String>;
|
|
116
|
-
readonly documentBoundaries: Schema.$Array<Schema.Struct<{
|
|
117
|
-
readonly document: Schema.Natural;
|
|
118
|
-
readonly observedMonotonicNanos: Schema.BigInt;
|
|
119
|
-
readonly afterSequence: Schema.NullOr<Schema.Natural>;
|
|
120
|
-
readonly url: Schema.NullOr<Schema.String>;
|
|
121
|
-
}>>;
|
|
122
|
-
readonly documentBoundariesTruncated: Schema.Boolean;
|
|
123
|
-
readonly upstreamDrops: Schema.Literal<"unknown">;
|
|
124
|
-
readonly error: Schema.optionalKey<typeof BrowserError>;
|
|
125
|
-
readonly phase: Schema.Literals<readonly ["capturing", "stopping", "stopped"]>;
|
|
126
|
-
readonly observedMonotonicNanos: Schema.BigInt;
|
|
127
|
-
/** Keeps counting when the bounded boundary prefix is truncated. */
|
|
128
|
-
readonly currentDocument: Schema.Natural;
|
|
129
|
-
/** No reason is reported while the capture still accepts frames. */
|
|
130
|
-
readonly reason: Schema.NullOr<Schema.String>;
|
|
131
|
-
/** Null until the native cleanup attempt settles; unconfirmed never means stopped remotely. */
|
|
132
|
-
readonly nativeStop: Schema.NullOr<Schema.Literals<readonly ["confirmed", "unconfirmed"]>>;
|
|
133
|
-
}>, {}>;
|
|
134
|
-
/**
|
|
135
|
-
* Host-side metadata at one instant, without reading or waking the page. The boundary prefix
|
|
136
|
-
* and loss counters are the same facts as the final summary, independent of frame consumption.
|
|
137
|
-
* `stopped` means native cleanup settled; buffered frames may still be drained afterwards.
|
|
138
|
-
*/
|
|
139
|
-
declare class CaptureSnapshot extends CaptureSnapshot_base {}
|
|
140
|
-
/** Live stream/Effect capabilities intentionally have no data schema or serialization contract. */
|
|
141
|
-
interface CaptureInterval {
|
|
142
|
-
/** Single subscription. Ending or interrupting it stops this interval, not its browser. */
|
|
143
|
-
readonly frames: Stream.Stream<CapturedFrame, BrowserError>;
|
|
144
|
-
/**
|
|
145
|
-
* A bounded copy of recorded metadata, available during capture and after cleanup. No native
|
|
146
|
-
* work, budget charge or subscription. Drain frames, then read `completed` for final accounting.
|
|
147
|
-
*/
|
|
148
|
-
readonly snapshot: Effect.Effect<CaptureSnapshot>;
|
|
149
|
-
readonly stop: Effect.Effect<CaptureSummary>;
|
|
150
|
-
readonly completed: Effect.Effect<CaptureSummary>;
|
|
151
|
-
}
|
|
152
|
-
declare namespace Capture_d_exports {
|
|
153
|
-
export { CaptureInterval, CaptureOptions, CaptureSize, CaptureSnapshot, CaptureSummary, CapturedFrame, start };
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Capture one remote page independently of the session's selected page.
|
|
157
|
-
*
|
|
158
|
-
* Requires the exact live session returned by the host; copying a session object or decoding
|
|
159
|
-
* a durable reference cannot copy its capture authority. The private owner is not frame data.
|
|
160
|
-
* `CapturedFrame` and `CaptureOptions` are Schema values as well as structural types. Frame
|
|
161
|
-
* decoding checks binary/metadata fields, not the complete JPEG bitstream or target authority,
|
|
162
|
-
* and does not copy bytes. Options decoding preserves omissions; admission applies defaults.
|
|
163
|
-
* `CaptureInterval` remains a live scoped capability, not a schema or JSON/Tool value.
|
|
164
|
-
*/
|
|
165
|
-
declare const start: <E>(session: BrowserSession<E>, options?: CaptureOptions) => Effect.Effect<CaptureInterval, BrowserError, Scope.Scope>;
|
|
166
|
-
//#endregion
|
|
167
|
-
export { CaptureSize as a, CapturedFrame as c, CaptureOptions as i, start as n, CaptureSnapshot as o, CaptureInterval as r, CaptureSummary as s, Capture_d_exports as t };
|
|
168
|
-
//# sourceMappingURL=Capture-BvWI-l1A.d.mts.map
|
package/dist/Capture.d.mts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as CaptureSize, c as CapturedFrame, i as CaptureOptions, n as start, o as CaptureSnapshot, r as CaptureInterval, s as CaptureSummary } from "./Capture-BvWI-l1A.mjs";
|
|
2
|
-
export { type CaptureInterval, CaptureOptions, CaptureSize, CaptureSnapshot, CaptureSummary, CapturedFrame, start };
|
package/dist/Capture.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ClientError } from "./Errors.mjs";
|
|
2
|
-
import { Config, Context, Effect, Layer, Redacted, Schema, Stream } from "effect";
|
|
3
|
-
declare namespace Client_d_exports {
|
|
4
|
-
export { BrowserbaseClient, ClientMethod, ClientOptions, MultipartFile, UploadLimits };
|
|
5
|
-
}
|
|
6
|
-
/** Account authority only. Launch recipes and browser-operation policy do not belong here. */
|
|
7
|
-
interface ClientOptions {
|
|
8
|
-
readonly projectId: string;
|
|
9
|
-
readonly apiKey: Redacted.Redacted<string>;
|
|
10
|
-
/** Exact HTTPS origins approved for credential-free media/artifact transfers. */
|
|
11
|
-
readonly artifactOrigins?: ReadonlyArray<string>;
|
|
12
|
-
readonly requestTimeoutMillis?: number;
|
|
13
|
-
}
|
|
14
|
-
type ClientMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
15
|
-
/** One bounded in-memory file part. A filesystem path is never a transport input. */
|
|
16
|
-
interface MultipartFile {
|
|
17
|
-
readonly field: string;
|
|
18
|
-
readonly filename: string;
|
|
19
|
-
readonly mediaType: string;
|
|
20
|
-
readonly bytes: Uint8Array;
|
|
21
|
-
}
|
|
22
|
-
/** Upload bounds are caller-owned; an omitted timeout keeps the 60-second default. */
|
|
23
|
-
interface UploadLimits {
|
|
24
|
-
readonly maxBytes: number;
|
|
25
|
-
readonly timeoutMillis?: number;
|
|
26
|
-
}
|
|
27
|
-
declare const BrowserbaseClient_base: Context.ServiceClass<BrowserbaseClient, "effect-browserbase/Client", {
|
|
28
|
-
readonly projectId: string;
|
|
29
|
-
readonly json: (method: ClientMethod, path: string, body?: Schema.Json, outerDeadline?: number) => Effect.Effect<Schema.Json, ClientError>;
|
|
30
|
-
readonly noContent: (method: Exclude<ClientMethod, "GET">, path: string, body?: Schema.Json, outerDeadline?: number) => Effect.Effect<void, ClientError>;
|
|
31
|
-
/** One bounded multipart mutation. A lost reply stays unknown and is never retried. */
|
|
32
|
-
readonly upload: (path: string, part: MultipartFile, limits: UploadLimits, outerDeadline?: number) => Effect.Effect<Schema.Json, ClientError>;
|
|
33
|
-
readonly text: (path: string, maximum: number, types: ReadonlyArray<string>) => Effect.Effect<string, ClientError>;
|
|
34
|
-
readonly bytes: (path: string, maximum: number, types: ReadonlyArray<string>, timeoutMillis?: number, outerDeadline?: number) => Stream.Stream<Uint8Array, ClientError>;
|
|
35
|
-
readonly media: (url: Redacted.Redacted<string>, maximum: number, types: ReadonlyArray<string>, timeoutMillis?: number, outerDeadline?: number) => Stream.Stream<Uint8Array, ClientError>;
|
|
36
|
-
readonly validateMediaUrl: (value: string) => boolean;
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* One immutable Browserbase account and approved transport, shared by every resource Layer.
|
|
40
|
-
* Constructing the Layer performs no request and never loads the native browser peer.
|
|
41
|
-
*/
|
|
42
|
-
declare class BrowserbaseClient extends BrowserbaseClient_base {
|
|
43
|
-
static layer(options: ClientOptions): Layer.Layer<BrowserbaseClient, ClientError>;
|
|
44
|
-
/**
|
|
45
|
-
* Account authority from the application's `ConfigProvider` (the environment by default):
|
|
46
|
-
* `BROWSERBASE_PROJECT_ID` and a redacted `BROWSERBASE_API_KEY`. Transport options stay
|
|
47
|
-
* explicit. Configuration is read when the Layer is built, never at import.
|
|
48
|
-
*/
|
|
49
|
-
static layerConfig(options?: Omit<ClientOptions, "projectId" | "apiKey">): Layer.Layer<BrowserbaseClient, ClientError | Config.ConfigError>;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { MultipartFile as a, Client_d_exports as i, ClientMethod as n, UploadLimits as o, ClientOptions as r, BrowserbaseClient as t };
|
|
53
|
-
//# sourceMappingURL=Client-Ca0zSg1n.d.mts.map
|
package/dist/Images-DgscEfSf.mjs
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
//#region src/internal/browser/NativeCalls.ts
|
|
4
|
-
/**
|
|
5
|
-
* A native step failed. It names no operation: the owner stamps the one the caller asked for
|
|
6
|
-
* when it admits the work, so a step's own vocabulary can never become public API.
|
|
7
|
-
*/
|
|
8
|
-
var NativeFailure = class extends Schema.TaggedError()("NativeFailure", {
|
|
9
|
-
reason: BrowserError.fields.reason,
|
|
10
|
-
outcome: BrowserError.fields.outcome
|
|
11
|
-
}) {};
|
|
12
|
-
/**
|
|
13
|
-
* The only way a native failure becomes public. A fenced ticket already speaks publicly and
|
|
14
|
-
* passes through with the operation the owner gave it; a native failure keeps its reason and
|
|
15
|
-
* takes the caller's operation; anything else is the caller's fallback.
|
|
16
|
-
*/
|
|
17
|
-
const publicError = (error, operation, fallback) => {
|
|
18
|
-
if (Schema.is(BrowserError)(error)) return error;
|
|
19
|
-
const known = Schema.is(NativeFailure)(error) ? error : fallback;
|
|
20
|
-
return BrowserError.make({
|
|
21
|
-
operation,
|
|
22
|
-
reason: known.reason,
|
|
23
|
-
...known.outcome === void 0 ? {} : { outcome: known.outcome }
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
/** Shared by the Playwright driver's seams, so every native call fails in the same vocabulary. */
|
|
27
|
-
const failure = (reason, outcome) => NativeFailure.make({
|
|
28
|
-
reason,
|
|
29
|
-
...outcome === void 0 ? {} : { outcome }
|
|
30
|
-
});
|
|
31
|
-
const safeDecode = (codec, raw) => {
|
|
32
|
-
try {
|
|
33
|
-
return Schema.decodeUnknownSync(codec)(raw);
|
|
34
|
-
} catch {
|
|
35
|
-
throw failure("malformed");
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* No raw exception from Playwright crosses this private boundary. A ticket's own fence is
|
|
40
|
-
* already a public error and passes through with the operation the owner gave it.
|
|
41
|
-
*/
|
|
42
|
-
const sanitize = (action) => Promise.resolve().then(action).catch((error) => {
|
|
43
|
-
throw Schema.is(BrowserError)(error) || Schema.is(NativeFailure)(error) ? error : failure("provider");
|
|
44
|
-
});
|
|
45
|
-
const closeWithin = async (action, milliseconds = 2e3) => {
|
|
46
|
-
let timer;
|
|
47
|
-
try {
|
|
48
|
-
await Promise.race([Promise.resolve().then(action), new Promise((_, reject) => {
|
|
49
|
-
timer = setTimeout(() => reject(failure("timeout")), milliseconds);
|
|
50
|
-
})]);
|
|
51
|
-
} finally {
|
|
52
|
-
clearTimeout(timer);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const timeout = (ticket) => {
|
|
56
|
-
ticket.check();
|
|
57
|
-
return ticket.remainingMillis();
|
|
58
|
-
};
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/internal/capture/Images.ts
|
|
61
|
-
const malformed = () => failure("malformed");
|
|
62
|
-
/** Parse framing only; a caller decoding media must still validate its complete bitstream. */
|
|
63
|
-
const pngGeometry = (bytes) => {
|
|
64
|
-
if (bytes.length < 33 || [
|
|
65
|
-
137,
|
|
66
|
-
80,
|
|
67
|
-
78,
|
|
68
|
-
71,
|
|
69
|
-
13,
|
|
70
|
-
10,
|
|
71
|
-
26,
|
|
72
|
-
10
|
|
73
|
-
].some((b, i) => bytes[i] !== b) || bytes[12] !== 73 || bytes[13] !== 72 || bytes[14] !== 68 || bytes[15] !== 82) throw malformed();
|
|
74
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
75
|
-
if (view.getUint32(8) !== 13) throw malformed();
|
|
76
|
-
const width = view.getUint32(16), height = view.getUint32(20);
|
|
77
|
-
if (width === 0 || height === 0) throw malformed();
|
|
78
|
-
return {
|
|
79
|
-
width,
|
|
80
|
-
height
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
/** JPEG SOF dimensions avoid trusting the requested size or CSS viewport dimensions. */
|
|
84
|
-
const jpegGeometry = (bytes) => {
|
|
85
|
-
if (bytes.length < 4 || bytes[0] !== 255 || bytes[1] !== 216) throw malformed();
|
|
86
|
-
let offset = 2;
|
|
87
|
-
while (offset + 3 < bytes.length) {
|
|
88
|
-
if (bytes[offset++] !== 255) throw malformed();
|
|
89
|
-
while (bytes[offset] === 255) offset++;
|
|
90
|
-
const marker = bytes[offset++];
|
|
91
|
-
if (marker === void 0 || marker === 217 || marker === 218) break;
|
|
92
|
-
if (marker === 1 || marker >= 208 && marker <= 215) continue;
|
|
93
|
-
if (offset + 1 >= bytes.length) throw malformed();
|
|
94
|
-
const size = bytes[offset] * 256 + bytes[offset + 1];
|
|
95
|
-
if (size < 2 || offset + size > bytes.length) throw malformed();
|
|
96
|
-
if ([
|
|
97
|
-
192,
|
|
98
|
-
193,
|
|
99
|
-
194,
|
|
100
|
-
195,
|
|
101
|
-
197,
|
|
102
|
-
198,
|
|
103
|
-
199,
|
|
104
|
-
201,
|
|
105
|
-
202,
|
|
106
|
-
203,
|
|
107
|
-
205,
|
|
108
|
-
206,
|
|
109
|
-
207
|
|
110
|
-
].includes(marker)) {
|
|
111
|
-
if (size < 8) throw malformed();
|
|
112
|
-
const height = bytes[offset + 3] * 256 + bytes[offset + 4];
|
|
113
|
-
const width = bytes[offset + 5] * 256 + bytes[offset + 6];
|
|
114
|
-
if (width === 0 || height === 0) throw malformed();
|
|
115
|
-
return {
|
|
116
|
-
width,
|
|
117
|
-
height
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
offset += size;
|
|
121
|
-
}
|
|
122
|
-
throw malformed();
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
export { failure as a, sanitize as c, closeWithin as i, timeout as l, pngGeometry as n, publicError as o, NativeFailure as r, safeDecode as s, jpegGeometry as t };
|
|
126
|
-
|
|
127
|
-
//# sourceMappingURL=Images-DgscEfSf.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Images-DgscEfSf.mjs","names":[],"sources":["../src/internal/browser/NativeCalls.ts","../src/internal/capture/Images.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { BrowserError, type BrowserOperation } from \"../../Errors.ts\";\nimport type { Ticket } from \"./Owner.ts\";\n\n/**\n * A native step failed. It names no operation: the owner stamps the one the caller asked for\n * when it admits the work, so a step's own vocabulary can never become public API.\n */\nexport class NativeFailure extends Schema.TaggedError<NativeFailure>()(\"NativeFailure\", {\n reason: BrowserError.fields.reason,\n outcome: BrowserError.fields.outcome,\n}) {}\n\n/**\n * The only way a native failure becomes public. A fenced ticket already speaks publicly and\n * passes through with the operation the owner gave it; a native failure keeps its reason and\n * takes the caller's operation; anything else is the caller's fallback.\n */\nexport const publicError = (\n error: unknown,\n operation: BrowserOperation,\n fallback: Pick<BrowserError, \"reason\" | \"outcome\">,\n): BrowserError => {\n if (Schema.is(BrowserError)(error)) return error;\n const known = Schema.is(NativeFailure)(error) ? error : fallback;\n\n return BrowserError.make({\n operation,\n reason: known.reason,\n ...(known.outcome === undefined ? {} : { outcome: known.outcome }),\n });\n};\n\n/** Shared by the Playwright driver's seams, so every native call fails in the same vocabulary. */\nexport const failure = (reason: BrowserError[\"reason\"], outcome?: BrowserError[\"outcome\"]) =>\n NativeFailure.make({ reason, ...(outcome === undefined ? {} : { outcome }) });\n\nexport const safeDecode = <A>(codec: Schema.Codec<A, unknown, never, never>, raw: unknown): A => {\n try {\n return Schema.decodeUnknownSync(codec)(raw);\n } catch {\n throw failure(\"malformed\");\n }\n};\n\n/**\n * No raw exception from Playwright crosses this private boundary. A ticket's own fence is\n * already a public error and passes through with the operation the owner gave it.\n */\nexport const sanitize = <A>(action: () => Promise<A>): Promise<A> =>\n Promise.resolve()\n .then(action)\n .catch((error: unknown) => {\n throw Schema.is(BrowserError)(error) || Schema.is(NativeFailure)(error)\n ? error\n : failure(\"provider\");\n });\n\nexport const closeWithin = async (\n action: () => Promise<unknown>,\n milliseconds = 2000,\n): Promise<void> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n try {\n await Promise.race([\n Promise.resolve().then(action),\n new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(failure(\"timeout\")), milliseconds);\n }),\n ]);\n } finally {\n clearTimeout(timer);\n }\n};\n\n// The native timeout is finite as well as Effect's authoritative deadline. It cannot undo dispatch.\nexport const timeout = (ticket: Ticket) => {\n ticket.check();\n\n return ticket.remainingMillis();\n};\n","import { failure } from \"../browser/NativeCalls.ts\";\n\nconst malformed = () => failure(\"malformed\");\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 = bytes[offset] * 256 + 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 = bytes[offset + 3] * 256 + bytes[offset + 4];\n const width = bytes[offset + 5] * 256 + 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":";;;;;;;AASA,IAAa,gBAAb,cAAmC,OAAO,YAA2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S,MAAM,GAAG;GACtF,IAAI,OAAO,GAAG,MAAM,UAAU;GAC9B,MAAM,SAAS,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS;GACxD,MAAM,QAAQ,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS;GAEvD,IAAI,UAAU,KAAK,WAAW,GAAG,MAAM,UAAU;GAEjD,OAAO;IAAE;IAAO;GAAO;EACzB;EACA,UAAU;CACZ;CACA,MAAM,UAAU;AAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Launch-BHcAEq05.mjs","names":[],"sources":["../src/internal/provider/Launch.ts"],"sourcesContent":["import { Effect, Redacted, Schema } from \"effect\";\n\nimport { Viewport } from \"../../BrowserData.ts\";\nimport { BrowserError } from \"../../Errors.ts\";\nimport { LaunchRecipe, type ProxyRule } from \"../../Launch.ts\";\nimport { AllocationAttempt } from \"../../References.ts\";\n\nexport interface CompiledLaunch {\n readonly attempt: AllocationAttempt;\n readonly body: Schema.Json;\n readonly viewport: Viewport | undefined;\n readonly keepAlive: boolean;\n readonly context: { readonly id: string; readonly persist: boolean } | undefined;\n readonly recordSession: boolean;\n}\n\nexport const proxy = (rule: ProxyRule): Schema.Json =>\n rule.type === \"external\"\n ? {\n type: rule.type,\n server: rule.server,\n ...(rule.domainPattern === undefined ? {} : { domainPattern: rule.domainPattern }),\n ...(rule.username === undefined ? {} : { username: Redacted.value(rule.username) }),\n ...(rule.password === undefined ? {} : { password: Redacted.value(rule.password) }),\n }\n : rule.type === \"none\"\n ? {\n type: rule.type,\n ...(rule.domainPattern === undefined ? {} : { domainPattern: rule.domainPattern }),\n }\n : {\n type: rule.type,\n ...(rule.domainPattern === undefined ? {} : { domainPattern: rule.domainPattern }),\n ...(rule.geolocation === undefined ? {} : { geolocation: { ...rule.geolocation } }),\n };\n\n/** One validation/copy/compiler path. No legacy constructor or second default body exists. */\nexport const compileLaunch = Effect.fnUntraced(function* (\n input: unknown,\n identity: Pick<AllocationAttempt, \"projectId\" | \"attemptId\" | \"requestedAtMillis\">,\n): Effect.fn.Return<CompiledLaunch, BrowserError> {\n const recipe = yield* Schema.decodeUnknownEffect(LaunchRecipe)(input, {\n onExcessProperty: \"error\",\n }).pipe(\n Effect.mapError(() =>\n BrowserError.make({ operation: \"launch\", reason: \"configuration\", outcome: \"undispatched\" }),\n ),\n );\n\n const attempt = Object.freeze(\n AllocationAttempt.make({ ...identity, timeoutSeconds: recipe.remoteTimeoutSeconds }),\n );\n\n const settings = recipe.provider.browserSettings ?? {};\n\n const fail = () =>\n BrowserError.make({ operation: \"launch\", reason: \"configuration\", outcome: \"undispatched\" });\n\n // The qualified reference is the only extension spelling, so a foreign project cannot\n // reach POST and there is no second alias whose precedence would have to be invented.\n if (\n (recipe.context !== undefined && recipe.context.reference.projectId !== attempt.projectId) ||\n (recipe.extension !== undefined && recipe.extension.projectId !== attempt.projectId) ||\n (settings.verified === true && recipe.viewport._tag !== \"ProviderManaged\") ||\n (settings.os !== undefined && settings.verified !== true)\n )\n return yield* fail();\n\n const viewport =\n recipe.viewport._tag === \"Fixed\"\n ? yield* Schema.decodeEffect(Viewport)({\n width: recipe.viewport.width,\n height: recipe.viewport.height,\n }).pipe(Effect.mapError(fail))\n : undefined;\n\n if (Array.isArray(recipe.provider.proxies)) {\n for (const rule of recipe.provider.proxies) {\n if (\n rule.type === \"browserbase\" &&\n rule.geolocation?.state !== undefined &&\n rule.geolocation.country !== \"US\"\n )\n return yield* fail();\n if (rule.type === \"external\") {\n const valid = yield* Effect.try({\n try: () => {\n const url = new URL(rule.server);\n\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n !url.username &&\n !url.password &&\n !url.hash\n );\n },\n catch: fail,\n });\n\n if (!valid) return yield* fail();\n }\n }\n }\n for (const domain of settings.allowedDomains ?? []) {\n const valid = yield* Effect.try({\n try: () => {\n const url = new URL(`https://${domain}/`);\n\n return (\n !domain.includes(\"*\") &&\n url.hostname === domain &&\n !url.port &&\n !url.username &&\n !url.password\n );\n },\n catch: fail,\n });\n\n if (!valid) return yield* fail();\n }\n const metadata = recipe.provider.userMetadata ?? {};\n\n if (\n Object.keys(metadata).length > 32 ||\n Object.keys(metadata).some(\n (key) => key === \"effectAgentAttempt\" || key.startsWith(\"browserbaseIntegration\"),\n )\n )\n return yield* fail();\n const keepAlive = recipe.keepAlive ?? false;\n\n const context =\n recipe.context === undefined\n ? undefined\n : { id: recipe.context.reference.contextId, persist: recipe.context.persist };\n\n const recordSession = settings.recordSession ?? false;\n\n const body = {\n projectId: attempt.projectId,\n timeout: recipe.remoteTimeoutSeconds,\n keepAlive,\n ...(recipe.provider.region === undefined ? {} : { region: recipe.provider.region }),\n proxies: Array.isArray(recipe.provider.proxies)\n ? recipe.provider.proxies.map(proxy)\n : (recipe.provider.proxies ?? false),\n ...(recipe.provider.proxySettings === undefined\n ? {}\n : { proxySettings: recipe.provider.proxySettings }),\n ...(recipe.extension === undefined ? {} : { extensionId: recipe.extension.extensionId }),\n browserSettings: {\n ...settings,\n recordSession,\n logSession: settings.logSession ?? false,\n solveCaptchas: settings.solveCaptchas ?? false,\n ...(context === undefined ? {} : { context }),\n ...(viewport === undefined\n ? {}\n : { viewport: { width: viewport.width, height: viewport.height } }),\n },\n userMetadata: { ...metadata, browserbaseIntegrationAttempt: attempt.attemptId },\n };\n\n // Own all nested values, including arrays. The admitted body never observes later caller mutation.\n const encoded = yield* Effect.try({ try: () => JSON.stringify(body), catch: fail });\n\n if (new TextEncoder().encode(encoded).length > 64 * 1024) return yield* fail();\n\n const owned = yield* Schema.decodeEffect(Schema.fromJsonString(Schema.Json))(encoded).pipe(\n Effect.mapError(fail),\n );\n\n return { attempt, body: owned, viewport, keepAlive, context, recordSession };\n});\n"],"mappings":";;;;;;AAgBA,MAAa,SAAS,SACpB,KAAK,SAAS,aACV;CACE,MAAM,KAAK;CACX,QAAQ,KAAK;CACb,GAAI,KAAK,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,KAAK,cAAc;CAChF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import { n as ContextReference, r as ExtensionReference } from "./References-URDAtapt.mjs";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
declare namespace Launch_d_exports {
|
|
4
|
-
export { LaunchRecipe, ProviderLaunchOptions, ProxyRule, recipe };
|
|
5
|
-
}
|
|
6
|
-
declare const ProxyRule: Schema.Union<readonly [Schema.Struct<{
|
|
7
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
8
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
9
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
10
|
-
readonly country: Schema.String;
|
|
11
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
12
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
13
|
-
}>>;
|
|
14
|
-
}>, Schema.Struct<{
|
|
15
|
-
readonly type: Schema.Literal<"external">;
|
|
16
|
-
readonly server: Schema.NonEmptyString;
|
|
17
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
18
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
19
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
20
|
-
}>, Schema.Struct<{
|
|
21
|
-
readonly type: Schema.Literal<"none">;
|
|
22
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
23
|
-
}>]>;
|
|
24
|
-
type ProxyRule = typeof ProxyRule.Type;
|
|
25
|
-
/** SDK 2.20 browser subset. Names follow Browserbase; ownership-managed fields are excluded. */
|
|
26
|
-
declare const ProviderLaunchOptions: Schema.Struct<{
|
|
27
|
-
readonly region: Schema.optionalKey<Schema.Literals<readonly ["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"]>>;
|
|
28
|
-
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
29
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
30
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
31
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
32
|
-
readonly country: Schema.String;
|
|
33
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
34
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
35
|
-
}>>;
|
|
36
|
-
}>, Schema.Struct<{
|
|
37
|
-
readonly type: Schema.Literal<"external">;
|
|
38
|
-
readonly server: Schema.NonEmptyString;
|
|
39
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
40
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
41
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
42
|
-
}>, Schema.Struct<{
|
|
43
|
-
readonly type: Schema.Literal<"none">;
|
|
44
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
45
|
-
}>]>>]>>;
|
|
46
|
-
readonly proxySettings: Schema.optionalKey<Schema.Struct<{
|
|
47
|
-
readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
48
|
-
}>>;
|
|
49
|
-
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
50
|
-
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
51
|
-
readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
|
|
52
|
-
readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
53
|
-
readonly blockAds: Schema.optionalKey<Schema.Boolean>;
|
|
54
|
-
readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
55
|
-
readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
56
|
-
readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
|
|
57
|
-
readonly logSession: Schema.optionalKey<Schema.Boolean>;
|
|
58
|
-
readonly recordSession: Schema.optionalKey<Schema.Boolean>;
|
|
59
|
-
readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
|
|
60
|
-
}>>;
|
|
61
|
-
readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
62
|
-
}>;
|
|
63
|
-
type ProviderLaunchOptions = typeof ProviderLaunchOptions.Type;
|
|
64
|
-
/** Connection behavior and business budgets are not provider session lifetime. */
|
|
65
|
-
declare const LaunchRecipe: Schema.Struct<{
|
|
66
|
-
readonly remoteTimeoutSeconds: Schema.Int;
|
|
67
|
-
readonly keepAlive: Schema.optionalKey<Schema.Boolean>;
|
|
68
|
-
readonly context: Schema.optionalKey<Schema.Struct<{
|
|
69
|
-
readonly reference: typeof ContextReference;
|
|
70
|
-
readonly persist: Schema.Boolean;
|
|
71
|
-
}>>;
|
|
72
|
-
/**
|
|
73
|
-
* Project-qualified selection of an already provisioned extension, never an upload. It is
|
|
74
|
-
* the only spelling: the compiler alone projects it to the provider's `extensionId`, so an
|
|
75
|
-
* unqualified identifier cannot reach the provider unchecked.
|
|
76
|
-
*/
|
|
77
|
-
readonly extension: Schema.optionalKey<typeof ExtensionReference>;
|
|
78
|
-
readonly viewport: Schema.Union<readonly [Schema.Struct<{
|
|
79
|
-
readonly _tag: Schema.Literal<"ProviderManaged">;
|
|
80
|
-
}>, Schema.Struct<{
|
|
81
|
-
readonly _tag: Schema.Literal<"Fixed">;
|
|
82
|
-
readonly width: Schema.Int;
|
|
83
|
-
readonly height: Schema.Int;
|
|
84
|
-
}>]>;
|
|
85
|
-
readonly provider: Schema.Struct<{
|
|
86
|
-
readonly region: Schema.optionalKey<Schema.Literals<readonly ["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"]>>;
|
|
87
|
-
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
88
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
89
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
90
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
91
|
-
readonly country: Schema.String;
|
|
92
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
93
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
94
|
-
}>>;
|
|
95
|
-
}>, Schema.Struct<{
|
|
96
|
-
readonly type: Schema.Literal<"external">;
|
|
97
|
-
readonly server: Schema.NonEmptyString;
|
|
98
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
99
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
100
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
101
|
-
}>, Schema.Struct<{
|
|
102
|
-
readonly type: Schema.Literal<"none">;
|
|
103
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
104
|
-
}>]>>]>>;
|
|
105
|
-
readonly proxySettings: Schema.optionalKey<Schema.Struct<{
|
|
106
|
-
readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
107
|
-
}>>;
|
|
108
|
-
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
109
|
-
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
110
|
-
readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
|
|
111
|
-
readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
112
|
-
readonly blockAds: Schema.optionalKey<Schema.Boolean>;
|
|
113
|
-
readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
114
|
-
readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
115
|
-
readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
|
|
116
|
-
readonly logSession: Schema.optionalKey<Schema.Boolean>;
|
|
117
|
-
readonly recordSession: Schema.optionalKey<Schema.Boolean>;
|
|
118
|
-
readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
|
|
119
|
-
}>>;
|
|
120
|
-
readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
121
|
-
}>;
|
|
122
|
-
}>;
|
|
123
|
-
type LaunchRecipe = typeof LaunchRecipe.Type;
|
|
124
|
-
/**
|
|
125
|
-
* A recipe with the smallest reasonable choices filled in: a five-minute provider lifetime,
|
|
126
|
-
* a provider-managed viewport (which Verified requires) and no provider options. Privacy
|
|
127
|
-
* defaults are unchanged: recording, logging and captcha solving stay off unless requested.
|
|
128
|
-
*/
|
|
129
|
-
declare const recipe: (options?: Partial<LaunchRecipe>) => LaunchRecipe;
|
|
130
|
-
//#endregion
|
|
131
|
-
export { recipe as a, ProxyRule as i, Launch_d_exports as n, ProviderLaunchOptions as r, LaunchRecipe as t };
|
|
132
|
-
//# sourceMappingURL=Launch-C8CfaYxb.d.mts.map
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { BrowserError, InitializationError } from "./Errors.mjs";
|
|
2
|
-
import { V as Viewport, i as BrowserPolicy, n as AutomationOptions } from "./BrowserData-LpcAuAub.mjs";
|
|
3
|
-
import { BrowserSession, OpenOptions } from "./Browser.mjs";
|
|
4
|
-
import { Context, Effect, Layer, Option, Redacted, Schema, Scope } from "effect";
|
|
5
|
-
//#region src/internal/browser/LocalData.d.ts
|
|
6
|
-
declare const LocalReference_base: Schema.Class<LocalReference, Schema.Struct<{
|
|
7
|
-
readonly provider: Schema.Literal<"local">;
|
|
8
|
-
readonly id: Schema.NonEmptyString;
|
|
9
|
-
}>, {}>;
|
|
10
|
-
/** Identifies this local ownership lifetime, not a Browserbase resource or a reusable endpoint. */
|
|
11
|
-
declare class LocalReference extends LocalReference_base {}
|
|
12
|
-
declare const LocalCleanupIssue_base: Schema.Class<LocalCleanupIssue, Schema.Struct<{
|
|
13
|
-
readonly step: Schema.Literals<readonly ["fence", "capture", "initialization", "disconnect", "terminate", "profile"]>;
|
|
14
|
-
readonly reason: Schema.Literals<readonly ["timeout", "failed", "interrupted"]>;
|
|
15
|
-
}>, {}>;
|
|
16
|
-
declare class LocalCleanupIssue extends LocalCleanupIssue_base {}
|
|
17
|
-
declare const LocalCleanupResult_base: Schema.Class<LocalCleanupResult, Schema.Struct<{
|
|
18
|
-
readonly reference: typeof LocalReference;
|
|
19
|
-
readonly ownership: Schema.Literals<readonly ["owned", "borrowed"]>;
|
|
20
|
-
readonly connection: Schema.Literals<readonly ["closed", "failed", "not-connected", "pending"]>;
|
|
21
|
-
readonly process: Schema.Literals<readonly ["terminated", "unknown", "not-owned"]>;
|
|
22
|
-
readonly issues: Schema.$Array<typeof LocalCleanupIssue>;
|
|
23
|
-
}>, {}>;
|
|
24
|
-
/** Connection teardown and observed process exit are separate facts; no provider status exists. */
|
|
25
|
-
declare class LocalCleanupResult extends LocalCleanupResult_base {}
|
|
26
|
-
declare const LocalLaunch: Schema.Struct<{
|
|
27
|
-
readonly executablePath: Schema.optionalKey<Schema.NonEmptyString>;
|
|
28
|
-
readonly headless: Schema.optionalKey<Schema.Boolean>;
|
|
29
|
-
/** Enabled by default; a trusted host must explicitly choose a sandbox exception. */
|
|
30
|
-
readonly chromiumSandbox: Schema.optionalKey<Schema.Boolean>;
|
|
31
|
-
readonly args: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
32
|
-
readonly proxy: Schema.optionalKey<Schema.Struct<{
|
|
33
|
-
readonly server: Schema.NonEmptyString;
|
|
34
|
-
readonly bypass: Schema.optionalKey<Schema.NonEmptyString>;
|
|
35
|
-
}>>;
|
|
36
|
-
readonly startupTimeoutMillis: Schema.optionalKey<Schema.Int>;
|
|
37
|
-
}>;
|
|
38
|
-
type LocalLaunch = typeof LocalLaunch.Type;
|
|
39
|
-
declare namespace LocalBrowser_d_exports {
|
|
40
|
-
export { LocalAcquisition, LocalAttachRequest, LocalBrowser, LocalBrowserOptions, LocalCleanupIssue, LocalCleanupResult, LocalLaunch, LocalReference, LocalSession };
|
|
41
|
-
}
|
|
42
|
-
/** Host-only process configuration. Building this layer neither loads Playwright nor starts Chromium. */
|
|
43
|
-
interface LocalBrowserOptions extends AutomationOptions {
|
|
44
|
-
readonly launch?: LocalLaunch;
|
|
45
|
-
readonly viewport?: Viewport;
|
|
46
|
-
readonly onCleanup?: (result: LocalCleanupResult) => Effect.Effect<void>;
|
|
47
|
-
}
|
|
48
|
-
/** A local lifetime has modeled browser authority, never Browserbase resource or release authority. */
|
|
49
|
-
interface LocalSession<E = never> extends BrowserSession<E> {
|
|
50
|
-
readonly reference: LocalReference;
|
|
51
|
-
readonly close: Effect.Effect<LocalCleanupResult>;
|
|
52
|
-
readonly cleanupResult: Effect.Effect<Option.Option<LocalCleanupResult>>;
|
|
53
|
-
}
|
|
54
|
-
interface LocalAcquisition<E = never> {
|
|
55
|
-
readonly reference: LocalReference;
|
|
56
|
-
readonly failure: Effect.Effect<never, E | InitializationError>;
|
|
57
|
-
readonly connect: Effect.Effect<LocalSession<E>, BrowserError | InitializationError | E>;
|
|
58
|
-
readonly close: Effect.Effect<LocalCleanupResult>;
|
|
59
|
-
}
|
|
60
|
-
interface LocalAttachRequest<E = never, R = never> extends OpenOptions<E, R> {
|
|
61
|
-
readonly policy: BrowserPolicy;
|
|
62
|
-
/** Resolve this exact target; without it, multiple open pages are an ambiguity error. */
|
|
63
|
-
readonly target?: {
|
|
64
|
-
readonly targetId: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
declare const LocalBrowser_base: Context.ServiceClass<LocalBrowser, "effect-browserbase/LocalBrowser", {
|
|
68
|
-
readonly acquire: <E = never, R = never>(policy: BrowserPolicy, request?: OpenOptions<E, R>) => Effect.Effect<LocalAcquisition<E>, BrowserError, Scope.Scope | Exclude<R, Scope.Scope>>;
|
|
69
|
-
readonly open: <E = never, R = never>(policy: BrowserPolicy, request?: OpenOptions<E, R>) => Effect.Effect<LocalSession<E>, BrowserError | InitializationError | E, Scope.Scope | Exclude<R, Scope.Scope>>;
|
|
70
|
-
/** A concrete loopback ws://.../devtools/browser/... endpoint; this scope owns only its connection. */
|
|
71
|
-
readonly attach: <E = never, R = never>(endpoint: Redacted.Redacted<string>, request: LocalAttachRequest<E, R>) => Effect.Effect<LocalSession<E>, BrowserError | InitializationError | E, Scope.Scope | Exclude<R, Scope.Scope>>;
|
|
72
|
-
readonly withBrowser: <E, R, A, E2, R2>(policy: BrowserPolicy, request: OpenOptions<E, R>, use: (session: LocalSession<E>) => Effect.Effect<A, E2, R2>) => Effect.Effect<A, BrowserError | InitializationError | E | E2, Exclude<R | R2, Scope.Scope>>;
|
|
73
|
-
}>;
|
|
74
|
-
declare class LocalBrowser extends LocalBrowser_base {
|
|
75
|
-
static layer(options?: LocalBrowserOptions): Layer.Layer<LocalBrowser, BrowserError>;
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { LocalBrowser_d_exports as a, LocalCleanupResult as c, LocalBrowserOptions as i, LocalLaunch as l, LocalAttachRequest as n, LocalSession as o, LocalBrowser as r, LocalCleanupIssue as s, LocalAcquisition as t, LocalReference as u };
|
|
79
|
-
//# sourceMappingURL=LocalBrowser-BLancJ3R.d.mts.map
|