effect-browserbase 0.1.0-beta.102 → 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 -231
- 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 +25 -140
- package/dist/Browser.mjs +266 -1
- package/dist/Browser.mjs.map +1 -0
- 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 -30
- package/dist/index.mjs +26 -30
- package/package.json +3 -24
- 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/Browser-joE4Zgys.mjs +0 -1557
- package/dist/Browser-joE4Zgys.mjs.map +0 -1
- package/dist/BrowserBinding-qbQA6JhH.mjs +0 -2452
- package/dist/BrowserBinding-qbQA6JhH.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-CZJPuD7b.mjs +0 -532
- package/dist/Capture-CZJPuD7b.mjs.map +0 -1
- package/dist/Capture-Dr5MkIJb.d.mts +0 -125
- 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/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/Sessions-CtbseWEh.mjs.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { E as PageInfo, L as Target } from "./BrowserData-LpcAuAub.mjs";
|
|
3
|
-
import { BrowserbaseSession } 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
|
-
/** Live stream/Effect capabilities intentionally have no data schema or serialization contract. */
|
|
103
|
-
interface CaptureInterval {
|
|
104
|
-
/** Single subscription. Ending or interrupting it stops this interval, not its browser. */
|
|
105
|
-
readonly frames: Stream.Stream<CapturedFrame, BrowserError>;
|
|
106
|
-
readonly stop: Effect.Effect<CaptureSummary>;
|
|
107
|
-
readonly completed: Effect.Effect<CaptureSummary>;
|
|
108
|
-
}
|
|
109
|
-
declare namespace Capture_d_exports {
|
|
110
|
-
export { CaptureInterval, CaptureOptions, CaptureSize, CaptureSummary, CapturedFrame, start };
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Capture one remote page independently of the session's selected page.
|
|
114
|
-
*
|
|
115
|
-
* Requires the exact live session returned by the host; copying a session object or decoding
|
|
116
|
-
* a durable reference cannot copy its capture authority. The private owner is not frame data.
|
|
117
|
-
* `CapturedFrame` and `CaptureOptions` are Schema values as well as structural types. Frame
|
|
118
|
-
* decoding checks binary/metadata fields, not the complete JPEG bitstream or target authority,
|
|
119
|
-
* and does not copy bytes. Options decoding preserves omissions; admission applies defaults.
|
|
120
|
-
* `CaptureInterval` remains a live scoped capability, not a schema or JSON/Tool value.
|
|
121
|
-
*/
|
|
122
|
-
declare const start: <E>(session: BrowserbaseSession<E>, options?: CaptureOptions) => Effect.Effect<CaptureInterval, BrowserError, Scope.Scope>;
|
|
123
|
-
//#endregion
|
|
124
|
-
export { CaptureSize as a, CaptureOptions as i, start as n, CaptureSummary as o, CaptureInterval as r, CapturedFrame as s, Capture_d_exports as t };
|
|
125
|
-
//# sourceMappingURL=Capture-Dr5MkIJb.d.mts.map
|
package/dist/Capture.d.mts
DELETED
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,YAA2B,CAAC,CAAC,iBAAiB;CACtF,QAAQ,aAAa,OAAO;CAC5B,SAAS,aAAa,OAAO;AAC/B,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,MAAa,eACX,OACA,WACA,aACiB;CACjB,IAAI,OAAO,GAAG,YAAY,CAAC,CAAC,KAAK,GAAG,OAAO;CAC3C,MAAM,QAAQ,OAAO,GAAG,aAAa,CAAC,CAAC,KAAK,IAAI,QAAQ;CAExD,OAAO,aAAa,KAAK;EACvB;EACA,QAAQ,MAAM;EACd,GAAI,MAAM,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,SAAS,MAAM,QAAQ;CAClE,CAAC;AACH;;AAGA,MAAa,WAAW,QAAgC,YACtD,cAAc,KAAK;CAAE;CAAQ,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;AAAG,CAAC;AAE9E,MAAa,cAAiB,OAA+C,QAAoB;CAC/F,IAAI;EACF,OAAO,OAAO,kBAAkB,KAAK,CAAC,CAAC,GAAG;CAC5C,QAAQ;EACN,MAAM,QAAQ,WAAW;CAC3B;AACF;;;;;AAMA,MAAa,YAAe,WAC1B,QAAQ,QAAQ,CAAC,CACd,KAAK,MAAM,CAAC,CACZ,OAAO,UAAmB;CACzB,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,KAAK,KAAK,OAAO,GAAG,aAAa,CAAC,CAAC,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;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,MAAM,UAAU,MAAM,MAAM,SAAS;EAElD,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,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,GAAI,KAAK,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,SAAS,MAAM,KAAK,QAAQ,EAAE;CACjF,GAAI,KAAK,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,SAAS,MAAM,KAAK,QAAQ,EAAE;AACnF,IACA,KAAK,SAAS,SACZ;CACE,MAAM,KAAK;CACX,GAAI,KAAK,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,KAAK,cAAc;AAClF,IACA;CACE,MAAM,KAAK;CACX,GAAI,KAAK,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,KAAK,cAAc;CAChF,GAAI,KAAK,gBAAgB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,KAAK,YAAY,EAAE;AACnF;;AAGR,MAAa,gBAAgB,OAAO,WAAW,WAC7C,OACA,UACgD;CAChD,MAAM,SAAS,OAAO,OAAO,oBAAoB,YAAY,CAAC,CAAC,OAAO,EACpE,kBAAkB,QACpB,CAAC,CAAC,CAAC,KACD,OAAO,eACL,aAAa,KAAK;EAAE,WAAW;EAAU,QAAQ;EAAiB,SAAS;CAAe,CAAC,CAC7F,CACF;CAEA,MAAM,UAAU,OAAO,OACrB,kBAAkB,KAAK;EAAE,GAAG;EAAU,gBAAgB,OAAO;CAAqB,CAAC,CACrF;CAEA,MAAM,WAAW,O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,IAAI;EAAE,WAAW,KAAK,UAAU,IAAI;EAAG,OAAO;CAAK,CAAC;CAElF,IAAI,IAAI,YAAY,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,OAAW,OAAO,OAAO,KAAK;CAM7E,OAAO;EAAE;EAAS,MAAM,OAJH,OAAO,aAAa,OAAO,eAAe,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KACpF,OAAO,SAAS,IAAI,CACtB;EAE+B;EAAU;EAAW;EAAS;CAAc;AAC7E,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
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
|
package/dist/PageControl.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { D as PageSuspension, E as PageInfo, T as PageExecutionState } from "./BrowserData-LpcAuAub.mjs";
|
|
3
|
-
import { BrowserbaseSession } from "./Browser.mjs";
|
|
4
|
-
import { Effect } from "effect";
|
|
5
|
-
declare namespace PageControl_d_exports {
|
|
6
|
-
export { PageExecutionState, PageSuspension, resume, state, suspend };
|
|
7
|
-
}
|
|
8
|
-
/** Last acknowledged state; no remote guarantee survives connection loss or external control. */
|
|
9
|
-
export declare const state: <E>(session: BrowserbaseSession<E>, page: PageInfo) => Effect.Effect<PageExecutionState, BrowserError>;
|
|
10
|
-
/** Explicit host-only hold requiring InteractiveOptions.pageControl; capture ACKs never invoke it. */
|
|
11
|
-
export declare const suspend: <E>(session: BrowserbaseSession<E>, page: PageInfo) => Effect.Effect<PageSuspension, BrowserError>;
|
|
12
|
-
/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */
|
|
13
|
-
export declare const resume: <E>(session: BrowserbaseSession<E>, receipt: PageSuspension) => Effect.Effect<void, BrowserError>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { PageExecutionState, PageSuspension, PageControl_d_exports as t };
|
|
16
|
-
//# sourceMappingURL=PageControl.d.mts.map
|
package/dist/PageControl.mjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { BrowserError } from "./Errors.mjs";
|
|
3
|
-
import { PageExecutionState, PageInfo, PageSuspension } from "./BrowserData.mjs";
|
|
4
|
-
import { n as pageControl } from "./PageControlAssociation-DabEg5AR.mjs";
|
|
5
|
-
import { Effect, Schema } from "effect";
|
|
6
|
-
//#region src/PageControl.ts
|
|
7
|
-
var PageControl_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
PageExecutionState: () => PageExecutionState,
|
|
9
|
-
PageSuspension: () => PageSuspension,
|
|
10
|
-
resume: () => resume,
|
|
11
|
-
state: () => state,
|
|
12
|
-
suspend: () => suspend
|
|
13
|
-
});
|
|
14
|
-
const owner = (session) => Effect.suspend(() => {
|
|
15
|
-
const port = pageControl(session);
|
|
16
|
-
return port === void 0 ? Effect.fail(BrowserError.make({
|
|
17
|
-
operation: "page-control",
|
|
18
|
-
reason: "unsupported",
|
|
19
|
-
outcome: "undispatched"
|
|
20
|
-
})) : Effect.succeed(port);
|
|
21
|
-
});
|
|
22
|
-
const invalid = () => BrowserError.make({
|
|
23
|
-
operation: "page-control",
|
|
24
|
-
reason: "configuration",
|
|
25
|
-
outcome: "undispatched"
|
|
26
|
-
});
|
|
27
|
-
/** Last acknowledged state; no remote guarantee survives connection loss or external control. */
|
|
28
|
-
const state = (session, page) => Schema.decodeEffect(PageInfo)(page).pipe(Effect.mapError(invalid), Effect.map((value) => Object.freeze(PageInfo.make({ ...value }))), Effect.flatMap((value) => owner(session).pipe(Effect.flatMap((port) => port.state(value)))));
|
|
29
|
-
/** Explicit host-only hold requiring InteractiveOptions.pageControl; capture ACKs never invoke it. */
|
|
30
|
-
const suspend = (session, page) => Schema.decodeEffect(PageInfo)(page).pipe(Effect.mapError(invalid), Effect.map((value) => Object.freeze(PageInfo.make({ ...value }))), Effect.flatMap((value) => owner(session).pipe(Effect.flatMap((port) => port.suspend(value)))));
|
|
31
|
-
/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */
|
|
32
|
-
const resume = (session, receipt) => Schema.decodeEffect(PageSuspension)(receipt).pipe(Effect.mapError(invalid), Effect.map((value) => Object.freeze(PageSuspension.make({ ...value }))), Effect.flatMap((value) => owner(session).pipe(Effect.flatMap((port) => port.resume(value)))));
|
|
33
|
-
//#endregion
|
|
34
|
-
export { PageExecutionState, PageSuspension, resume, state, suspend, PageControl_exports as t };
|
|
35
|
-
|
|
36
|
-
//# 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 { BrowserbaseSession } from \"./Browser.ts\";\nimport { type PageExecutionState, PageInfo, PageSuspension } from \"./BrowserData.ts\";\nimport { BrowserError } from \"./Errors.ts\";\nimport { pageControl } from \"./internal/browser/PageControlAssociation.ts\";\nexport { PageExecutionState, PageSuspension } from \"./BrowserData.ts\";\n\nconst owner = <E>(session: BrowserbaseSession<E>) =>\n Effect.suspend(() => {\n const port = pageControl(session);\n\n return port === undefined\n ? Effect.fail(\n BrowserError.make({\n operation: \"page-control\",\n reason: \"unsupported\",\n outcome: \"undispatched\",\n }),\n )\n : Effect.succeed(port);\n });\n\nconst invalid = () =>\n BrowserError.make({\n operation: \"page-control\",\n reason: \"configuration\",\n outcome: \"undispatched\",\n });\n\n/** Last acknowledged state; no remote guarantee survives connection loss or external control. */\nexport const state = <E>(\n session: BrowserbaseSession<E>,\n page: PageInfo,\n): Effect.Effect<PageExecutionState, BrowserError> =>\n Schema.decodeEffect(PageInfo)(page).pipe(\n Effect.mapError(invalid),\n Effect.map((value) => Object.freeze(PageInfo.make({ ...value }))),\n Effect.flatMap((value) => owner(session).pipe(Effect.flatMap((port) => port.state(value)))),\n );\n\n/** Explicit host-only hold requiring InteractiveOptions.pageControl; capture ACKs never invoke it. */\nexport const suspend = <E>(\n session: BrowserbaseSession<E>,\n page: PageInfo,\n): Effect.Effect<PageSuspension, BrowserError> =>\n Schema.decodeEffect(PageInfo)(page).pipe(\n Effect.mapError(invalid),\n Effect.map((value) => Object.freeze(PageInfo.make({ ...value }))),\n Effect.flatMap((value) => owner(session).pipe(Effect.flatMap((port) => port.suspend(value)))),\n );\n\n/** Consumes the exact live receipt. Activation is intentional; stale receipts never replay commands. */\nexport const resume = <E>(\n session: BrowserbaseSession<E>,\n receipt: PageSuspension,\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) => owner(session).pipe(Effect.flatMap((port) => port.resume(value)))),\n );\n"],"mappings":";;;;;;;;;;;;;AAQA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/internal/browser/PageControlAssociation.ts
|
|
2
|
-
const owners = /* @__PURE__ */ new WeakMap();
|
|
3
|
-
const associatePageControl = (session, port) => {
|
|
4
|
-
owners.set(session, port);
|
|
5
|
-
};
|
|
6
|
-
const pageControl = (session) => owners.get(session);
|
|
7
|
-
//#endregion
|
|
8
|
-
export { pageControl as n, associatePageControl as t };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=PageControlAssociation-DabEg5AR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageControlAssociation-DabEg5AR.mjs","names":[],"sources":["../src/internal/browser/PageControlAssociation.ts"],"sourcesContent":["import type { Effect } from \"effect\";\n\nimport type { PageExecutionState, PageInfo, PageSuspension } from \"../../BrowserData.ts\";\nimport type { BrowserError } from \"../../Errors.ts\";\n\nexport interface PageControlPort {\n readonly state: (page: PageInfo) => Effect.Effect<PageExecutionState, BrowserError>;\n readonly suspend: (page: PageInfo) => Effect.Effect<PageSuspension, BrowserError>;\n readonly resume: (receipt: PageSuspension) => Effect.Effect<void, BrowserError>;\n}\n\nconst owners = new WeakMap<object, PageControlPort>();\n\nexport const associatePageControl = (session: object, port: PageControlPort): void => {\n owners.set(session, port);\n};\n\nexport const pageControl = (session: object): PageControlPort | undefined => owners.get(session);\n"],"mappings":";AAWA,MAAM,yBAAS,IAAI,QAAiC;AAEpD,MAAa,wBAAwB,SAAiB,SAAgC;CACpF,OAAO,IAAI,SAAS,IAAI;AAC1B;AAEA,MAAa,eAAe,YAAiD,OAAO,IAAI,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sessions-CtbseWEh.mjs","names":[],"sources":["../src/internal/browser/LiveView.ts","../src/Sessions.ts"],"sourcesContent":["import { Effect, Redacted, Schema } from \"effect\";\n\nimport type { BrowserbaseClient } from \"../../Client.ts\";\nimport { BrowserError, ClientError } from \"../../Errors.ts\";\nimport { Identifier, type SessionReference } from \"../../References.ts\";\n\nconst LiveUrl = Schema.String.check(\n Schema.isMaxLength(16384),\n Schema.makeFilter((value) => {\n try {\n const url = new URL(value);\n\n return (\n url.protocol === \"https:\" &&\n !url.username &&\n !url.password &&\n (url.hostname === \"browserbase.com\" || url.hostname.endsWith(\".browserbase.com\"))\n );\n } catch {\n return false;\n }\n }),\n);\n\nconst Live = Schema.Struct({\n debuggerFullscreenUrl: LiveUrl,\n pages: Schema.Array(Schema.Struct({ id: Identifier, debuggerFullscreenUrl: LiveUrl })).check(\n Schema.isMaxLength(64),\n ),\n});\n\nexport interface LiveView {\n readonly session: Redacted.Redacted<string>;\n readonly pages: ReadonlyArray<{\n readonly liveViewPageId: string;\n readonly url: Redacted.Redacted<string>;\n }>;\n readonly requestedTtlSeconds: number;\n}\n\n/**\n * Issuing a debugger URL is an authorization step, not proof that an operator took control.\n * The URL is redacted here so it cannot be logged or returned as an ordinary model value.\n */\nexport const issueLiveUrls = Effect.fnUntraced(function* (\n client: BrowserbaseClient[\"Service\"],\n reference: SessionReference,\n expiresInSeconds: number,\n) {\n if (!Number.isSafeInteger(expiresInSeconds) || expiresInSeconds < 1 || expiresInSeconds > 21600)\n return yield* ClientError.make({\n operation: \"provider-read\",\n reason: \"configuration\",\n outcome: \"undispatched\",\n });\n if (reference.projectId !== client.projectId)\n return yield* ClientError.make({\n operation: \"provider-read\",\n reason: \"authorization\",\n outcome: \"undispatched\",\n });\n\n const raw = yield* client.json(\n \"GET\",\n `/v1/sessions/${encodeURIComponent(reference.sessionId)}/debug?expiresIn=${expiresInSeconds}`,\n );\n\n const value = yield* Schema.decodeUnknownEffect(Live)(raw).pipe(\n Effect.mapError(() => ClientError.make({ operation: \"provider-read\", reason: \"malformed\" })),\n );\n\n return {\n session: Redacted.make(value.debuggerFullscreenUrl),\n pages: value.pages.map((page) => ({\n liveViewPageId: page.id,\n url: Redacted.make(page.debuggerFullscreenUrl),\n })),\n requestedTtlSeconds: expiresInSeconds,\n } satisfies LiveView;\n});\n\nexport const issueLiveView = (\n client: BrowserbaseClient[\"Service\"],\n reference: SessionReference,\n expiresInSeconds: number,\n) =>\n issueLiveUrls(client, reference, expiresInSeconds).pipe(\n Effect.mapError((error) => BrowserError.make({ operation: \"live-view\", reason: error.reason })),\n );\n","import { Clock, Context, Effect, Layer, Schema } from \"effect\";\n\nimport { BrowserbaseClient } from \"./Client.ts\";\nimport type { ClientError } from \"./Errors.ts\";\nimport { SessionError } from \"./Errors.ts\";\nimport { issueLiveUrls, type LiveView } from \"./internal/browser/LiveView.ts\";\nexport type { LiveView } from \"./internal/browser/LiveView.ts\";\nimport { SessionReference } from \"./References.ts\";\nimport {\n ProviderSession,\n SessionMetadata,\n SessionStatus,\n isTerminalSessionStatus,\n} from \"./SessionData.ts\";\nexport { SessionMetadata, SessionStatus, isTerminalSessionStatus } from \"./SessionData.ts\";\n\nexport const SessionListQuery = Schema.Struct({\n status: Schema.optionalKey(SessionStatus),\n q: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(2048))),\n});\n\nexport type SessionListQuery = typeof SessionListQuery.Type;\n\nexport const SessionWaitOptions = Schema.Struct({\n timeoutMillis: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n pollIntervalMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 25, maximum: 5000 })),\n ),\n});\n\nexport type SessionWaitOptions = typeof SessionWaitOptions.Type;\n\nconst Millis = Schema.Finite;\n\n/**\n * One CDP-level log entry. Protocol payloads are present only when requested: they carry\n * page content, cookies and typed input, so they are host evidence, never model input.\n */\nexport class SessionLogEntry extends Schema.Class<SessionLogEntry>(\"BrowserbaseSessionLogEntry\")({\n method: Schema.String.check(Schema.isMaxLength(256)),\n pageId: Schema.Int,\n frameId: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(256))),\n loaderId: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(256))),\n timestamp: Schema.optionalKey(Millis),\n requestTimestamp: Schema.optionalKey(Millis),\n responseTimestamp: Schema.optionalKey(Millis),\n params: Schema.optionalKey(Schema.Json),\n result: Schema.optionalKey(Schema.Json),\n}) {}\n\nconst ProviderLog = Schema.Struct({\n method: SessionLogEntry.fields.method,\n pageId: Schema.Int,\n sessionId: Schema.String,\n frameId: SessionLogEntry.fields.frameId,\n loaderId: SessionLogEntry.fields.loaderId,\n timestamp: Schema.optionalKey(Millis),\n request: Schema.optionalKey(\n Schema.Struct({\n params: Schema.optionalKey(Schema.Json),\n timestamp: Schema.optionalKey(Millis),\n }),\n ),\n response: Schema.optionalKey(\n Schema.Struct({\n result: Schema.optionalKey(Schema.Json),\n timestamp: Schema.optionalKey(Millis),\n }),\n ),\n});\n\nexport interface SessionLogOptions {\n /** Include CDP `params`/`result` payloads. Off by default; see `SessionLogEntry`. */\n readonly includePayloads?: boolean;\n}\n\nconst now = Clock.monotonicTimeNanos.pipe(Effect.map((value) => Number(value) / 1000000));\n\nconst fromClient = (operation: SessionError[\"operation\"], error: ClientError): SessionError =>\n SessionError.make({\n operation,\n reason: error.reason,\n ...(error.outcome === undefined ? {} : { outcome: error.outcome }),\n ...(error.status === undefined ? {} : { status: error.status }),\n ...(error.retryAfterMillis === undefined ? {} : { retryAfterMillis: error.retryAfterMillis }),\n });\n\nconst malformed = (operation: SessionError[\"operation\"], mutation = false) =>\n SessionError.make({\n operation,\n reason: \"malformed\",\n ...(mutation ? { outcome: \"unknown\" as const } : {}),\n });\n\nconst configuration = (operation: SessionError[\"operation\"]) =>\n SessionError.make({ operation, reason: \"configuration\", outcome: \"undispatched\" });\n\n/** Passive inspection never releases a remote session. Release is a separate explicit mutation. */\nexport class BrowserbaseSessions extends Context.Service<\n BrowserbaseSessions,\n {\n readonly retrieve: (\n reference: SessionReference,\n ) => Effect.Effect<SessionMetadata, SessionError>;\n readonly list: (\n query?: SessionListQuery,\n ) => Effect.Effect<ReadonlyArray<SessionMetadata>, SessionError>;\n readonly requestRelease: (\n reference: SessionReference,\n ) => Effect.Effect<SessionMetadata, SessionError>;\n readonly waitForTerminal: (\n reference: SessionReference,\n options: SessionWaitOptions,\n ) => Effect.Effect<SessionMetadata, SessionError>;\n readonly waitUntilRunning: (\n reference: SessionReference,\n options: SessionWaitOptions,\n ) => Effect.Effect<SessionMetadata, SessionError>;\n /** Session logs, bounded by the 1 MiB control-plane reply limit (`reason: \"limit\"`). */\n readonly logs: (\n reference: SessionReference,\n options?: SessionLogOptions,\n ) => Effect.Effect<ReadonlyArray<SessionLogEntry>, SessionError>;\n /**\n * Redacted Live View URLs for any session in the project, owned or not. Issuing a URL\n * grants view and input access to whoever holds it; it does not pause automation.\n */\n readonly liveUrls: (\n reference: SessionReference,\n expiresInSeconds?: number,\n ) => Effect.Effect<LiveView, SessionError>;\n }\n>()(\"effect-browserbase/Sessions\") {\n static readonly layer: Layer.Layer<BrowserbaseSessions, never, BrowserbaseClient> = Layer.effect(\n BrowserbaseSessions,\n Effect.gen(function* () {\n const client = yield* BrowserbaseClient;\n\n const validate = Effect.fnUntraced(function* (\n reference: SessionReference,\n operation: SessionError[\"operation\"],\n ) {\n const ref = yield* Schema.decodeEffect(SessionReference)(reference, {\n onExcessProperty: \"error\",\n }).pipe(Effect.mapError(() => configuration(operation)));\n\n if (ref.projectId !== client.projectId)\n return yield* SessionError.make({\n operation,\n reason: \"authorization\",\n outcome: \"undispatched\",\n });\n\n return ref;\n });\n\n const decode = Effect.fnUntraced(function* (\n raw: unknown,\n operation: SessionError[\"operation\"],\n expected?: SessionReference,\n mutation = false,\n ) {\n const value = yield* Schema.decodeUnknownEffect(ProviderSession)(raw).pipe(\n Effect.mapError(() => malformed(operation, mutation)),\n );\n\n if (\n value.projectId !== client.projectId ||\n (expected !== undefined &&\n (value.id !== expected.sessionId || value.projectId !== expected.projectId))\n )\n return yield* malformed(operation, mutation);\n const { id, projectId, ...metadata } = value;\n\n return SessionMetadata.make({\n reference: SessionReference.make({ provider: \"browserbase\", projectId, sessionId: id }),\n ...metadata,\n });\n });\n\n const read = Effect.fnUntraced(function* (reference: SessionReference, deadline?: number) {\n const ref = yield* validate(reference, \"session-retrieve\");\n\n const raw = yield* client\n .json(\"GET\", `/v1/sessions/${encodeURIComponent(ref.sessionId)}`, undefined, deadline)\n .pipe(Effect.mapError((error) => fromClient(\"session-retrieve\", error)));\n\n return yield* decode(raw, \"session-retrieve\", ref);\n });\n\n const retrieve = Effect.fn(\"BrowserbaseSessions.retrieve\")(function* (\n reference: SessionReference,\n ) {\n return yield* read(reference);\n });\n\n const list = Effect.fn(\"BrowserbaseSessions.list\")(function* (query: SessionListQuery = {}) {\n const checked = yield* Schema.decodeEffect(SessionListQuery)(query, {\n onExcessProperty: \"error\",\n }).pipe(Effect.mapError(() => configuration(\"session-list\")));\n\n const search = new URLSearchParams();\n\n if (checked.status !== undefined) search.set(\"status\", checked.status);\n if (checked.q !== undefined) search.set(\"q\", checked.q);\n\n const raw = yield* client\n .json(\"GET\", `/v1/sessions${search.size === 0 ? \"\" : `?${search}`}`)\n .pipe(Effect.mapError((error) => fromClient(\"session-list\", error)));\n\n const rows = yield* Schema.decodeUnknownEffect(\n Schema.Array(ProviderSession).check(Schema.isMaxLength(1024)),\n )(raw).pipe(Effect.mapError(() => malformed(\"session-list\")));\n\n if (new Set(rows.map((row) => row.id)).size !== rows.length)\n return yield* malformed(\"session-list\");\n const output: SessionMetadata[] = [];\n\n for (const row of rows) output.push(yield* decode(row, \"session-list\"));\n\n return output;\n });\n\n const requestRelease = Effect.fn(\"BrowserbaseSessions.requestRelease\")(function* (\n reference: SessionReference,\n ) {\n const ref = yield* validate(reference, \"session-release\");\n\n const raw = yield* client\n .json(\"POST\", `/v1/sessions/${encodeURIComponent(ref.sessionId)}`, {\n projectId: ref.projectId,\n status: \"REQUEST_RELEASE\",\n })\n .pipe(Effect.mapError((error) => fromClient(\"session-release\", error)));\n\n return yield* decode(raw, \"session-release\", ref, true);\n });\n\n const wait = Effect.fnUntraced(function* (\n reference: SessionReference,\n options: SessionWaitOptions,\n untilRunning: boolean,\n ) {\n const bounds = yield* Schema.decodeEffect(SessionWaitOptions)(options, {\n onExcessProperty: \"error\",\n }).pipe(Effect.mapError(() => configuration(\"session-wait\")));\n\n const deadline = (yield* now) + bounds.timeoutMillis;\n\n for (;;) {\n const remaining = deadline - (yield* now);\n\n if (remaining <= 0)\n return yield* SessionError.make({ operation: \"session-wait\", reason: \"timeout\" });\n\n // The deadline bounds the provider read too, not just sleeps between reads.\n const metadata = yield* read(reference, deadline).pipe(\n Effect.timeoutOrElse({\n duration: remaining,\n orElse: () =>\n Effect.fail(SessionError.make({ operation: \"session-wait\", reason: \"timeout\" })),\n }),\n );\n\n if (\n untilRunning ? metadata.status === \"RUNNING\" : isTerminalSessionStatus(metadata.status)\n )\n return metadata;\n if (untilRunning && isTerminalSessionStatus(metadata.status))\n return yield* SessionError.make({ operation: \"session-wait\", reason: \"expired\" });\n yield* Effect.sleep(\n Math.max(0, Math.min(bounds.pollIntervalMillis ?? 250, deadline - (yield* now))),\n );\n }\n });\n\n const logs = Effect.fn(\"BrowserbaseSessions.logs\")(function* (\n reference: SessionReference,\n options: SessionLogOptions = {},\n ) {\n const ref = yield* validate(reference, \"session-logs\");\n\n const raw = yield* client\n .json(\"GET\", `/v1/sessions/${encodeURIComponent(ref.sessionId)}/logs`)\n .pipe(Effect.mapError((error) => fromClient(\"session-logs\", error)));\n\n const rows = yield* Schema.decodeUnknownEffect(\n Schema.Array(ProviderLog).check(Schema.isMaxLength(100_000)),\n )(raw).pipe(Effect.mapError(() => malformed(\"session-logs\")));\n\n if (rows.some((row) => row.sessionId !== ref.sessionId))\n return yield* malformed(\"session-logs\");\n\n return rows.map((row) =>\n SessionLogEntry.make({\n method: row.method,\n pageId: row.pageId,\n ...(row.frameId === undefined ? {} : { frameId: row.frameId }),\n ...(row.loaderId === undefined ? {} : { loaderId: row.loaderId }),\n ...(row.timestamp === undefined ? {} : { timestamp: row.timestamp }),\n ...(row.request?.timestamp === undefined\n ? {}\n : { requestTimestamp: row.request.timestamp }),\n ...(row.response?.timestamp === undefined\n ? {}\n : { responseTimestamp: row.response.timestamp }),\n ...(options.includePayloads === true && row.request?.params !== undefined\n ? { params: row.request.params }\n : {}),\n ...(options.includePayloads === true && row.response?.result !== undefined\n ? { result: row.response.result }\n : {}),\n }),\n );\n });\n\n const liveUrls = Effect.fn(\"BrowserbaseSessions.liveUrls\")(function* (\n reference: SessionReference,\n expiresInSeconds = 300,\n ) {\n const ref = yield* validate(reference, \"session-live-view\");\n\n return yield* issueLiveUrls(client, ref, expiresInSeconds).pipe(\n Effect.mapError((error) => fromClient(\"session-live-view\", error)),\n );\n });\n\n return BrowserbaseSessions.of({\n logs,\n liveUrls,\n retrieve,\n list,\n requestRelease,\n waitForTerminal: (ref, options) => wait(ref, options, false),\n waitUntilRunning: (ref, options) => wait(ref, options, true),\n });\n }),\n );\n}\n"],"mappings":";;;;;;;AAMA,MAAM,UAAU,OAAO,OAAO,MAC5B,OAAO,YAAY,KAAK,GACxB,OAAO,YAAY,UAAU;CAC3B,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,KAAK;EAEzB,OACE,IAAI,aAAa,YACjB,CAAC,IAAI,YACL,CAAC,IAAI,aACJ,IAAI,aAAa,qBAAqB,IAAI,SAAS,SAAS,kBAAkB;CAEnF,QAAQ;EACN,OAAO;CACT;AACF,CAAC,CACH;AAEA,MAAM,OAAO,OAAO,OAAO;CACzB,uBAAuB;CACvB,OAAO,OAAO,MAAM,OAAO,OAAO;EAAE,IAAI;EAAY,uBAAuB;CAAQ,CAAC,CAAC,CAAC,CAAC,MACrF,OAAO,YAAY,EAAE,CACvB;AACF,CAAC;;;;;AAeD,MAAa,gBAAgB,OAAO,WAAW,WAC7C,QACA,WACA,kBACA;CACA,IAAI,CAAC,OAAO,cAAc,gBAAgB,KAAK,mBAAmB,KAAK,mBAAmB,OACxF,OAAO,OAAO,YAAY,KAAK;EAC7B,WAAW;EACX,QAAQ;EACR,SAAS;CACX,CAAC;CACH,IAAI,UAAU,cAAc,OAAO,WACjC,OAAO,OAAO,YAAY,K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