effect-browserbase 0.2.0-beta.0 → 0.2.0-beta.1

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.
Files changed (91) hide show
  1. package/README.md +47 -4
  2. package/dist/Account.d.mts +15 -15
  3. package/dist/Account.mjs +3 -3
  4. package/dist/{Acquisition-D8o4jtCg.mjs → Acquisition-CAsTTXp4.mjs} +9 -8
  5. package/dist/Acquisition-CAsTTXp4.mjs.map +1 -0
  6. package/dist/Agents-5HpTp9YE.d.mts +155 -0
  7. package/dist/Agents.d.mts +3 -154
  8. package/dist/Agents.mjs +3 -3
  9. package/dist/Allocation.d.mts +4 -4
  10. package/dist/Allocation.mjs +1 -1
  11. package/dist/Browser-DpSajNai.mjs +270 -0
  12. package/dist/Browser-DpSajNai.mjs.map +1 -0
  13. package/dist/Browser.d.mts +6 -5
  14. package/dist/Browser.mjs +2 -266
  15. package/dist/BrowserBinding.mjs +3 -3
  16. package/dist/BrowserBinding.mjs.map +1 -1
  17. package/dist/Certificates-D4NQmyeA.d.mts +34 -0
  18. package/dist/Certificates.d.mts +3 -33
  19. package/dist/Certificates.mjs +1 -1
  20. package/dist/{Client-BQteUePT.mjs → Client-4RMKIpL2.mjs} +11 -9
  21. package/dist/Client-4RMKIpL2.mjs.map +1 -0
  22. package/dist/Client-B_f6bBLT.d.mts +52 -0
  23. package/dist/Client.d.mts +3 -51
  24. package/dist/Client.mjs +1 -1
  25. package/dist/{Connection-DcvJZEdc.mjs → Connection-sxyxtwlk.mjs} +2 -11
  26. package/dist/Connection-sxyxtwlk.mjs.map +1 -0
  27. package/dist/ContextCoordination.d.mts +1 -1
  28. package/dist/ContextCoordination.mjs +1 -1
  29. package/dist/ContextCoordination.mjs.map +1 -1
  30. package/dist/{ContextWriter-BrQmoXRg.mjs → ContextWriter-oKWFLHuP.mjs} +8 -12
  31. package/dist/ContextWriter-oKWFLHuP.mjs.map +1 -0
  32. package/dist/Contexts-DqdL7cyX.d.mts +31 -0
  33. package/dist/Contexts.d.mts +3 -30
  34. package/dist/Contexts.mjs +2 -2
  35. package/dist/Contexts.mjs.map +1 -1
  36. package/dist/Downloads-CdhiCO5X.d.mts +43 -0
  37. package/dist/Downloads.d.mts +3 -42
  38. package/dist/Downloads.mjs +2 -2
  39. package/dist/Downloads.mjs.map +1 -1
  40. package/dist/Extensions-DBXuVM1f.d.mts +43 -0
  41. package/dist/{Extensions-nMNMPGCc.mjs → Extensions-Dg3jHOf0.mjs} +2 -2
  42. package/dist/Extensions-Dg3jHOf0.mjs.map +1 -0
  43. package/dist/Extensions.d.mts +3 -42
  44. package/dist/Extensions.mjs +1 -1
  45. package/dist/Functions-CsKMMUuZ.d.mts +226 -0
  46. package/dist/Functions.d.mts +3 -225
  47. package/dist/Functions.mjs +3 -3
  48. package/dist/{Launch-m0fxzJ49.mjs → Launch-cAdE2rrZ.mjs} +12 -8
  49. package/dist/Launch-cAdE2rrZ.mjs.map +1 -0
  50. package/dist/Launch.d.mts +1 -4
  51. package/dist/Launch.mjs +1 -2
  52. package/dist/Launch.mjs.map +1 -1
  53. package/dist/PageFetch-CAMqb5m8.d.mts +39 -0
  54. package/dist/PageFetch.d.mts +3 -38
  55. package/dist/PageFetch.mjs +1 -1
  56. package/dist/Projects-tm5bTDH0.d.mts +38 -0
  57. package/dist/Projects.d.mts +3 -37
  58. package/dist/Projects.mjs +1 -1
  59. package/dist/Recordings-bVI33sTq.d.mts +27 -0
  60. package/dist/Recordings.d.mts +3 -26
  61. package/dist/Recordings.mjs +2 -2
  62. package/dist/Replays-Bo-9xeLz.d.mts +27 -0
  63. package/dist/Replays.d.mts +3 -26
  64. package/dist/Replays.mjs +2 -2
  65. package/dist/Search-1g6TUem7.d.mts +37 -0
  66. package/dist/Search.d.mts +3 -36
  67. package/dist/Search.mjs +1 -1
  68. package/dist/{Sessions-tFJYaXFq.d.mts → Sessions-BpZgjteE.d.mts} +2 -2
  69. package/dist/{Sessions-DoQGg9nB.mjs → Sessions-suOLSym9.mjs} +2 -2
  70. package/dist/Sessions-suOLSym9.mjs.map +1 -0
  71. package/dist/Sessions.d.mts +1 -1
  72. package/dist/Sessions.mjs +1 -1
  73. package/dist/Testing.d.mts +119 -0
  74. package/dist/Testing.mjs +206 -0
  75. package/dist/Testing.mjs.map +1 -0
  76. package/dist/Uploads-C2neBEpj.d.mts +28 -0
  77. package/dist/Uploads.d.mts +3 -27
  78. package/dist/Uploads.mjs +2 -2
  79. package/dist/Webhooks-BoeRAxzG.d.mts +59 -0
  80. package/dist/Webhooks.d.mts +3 -58
  81. package/dist/Webhooks.mjs +1 -1
  82. package/dist/{WriterFacts-5CPBGG1P.d.mts → WriterFacts-BBJRDZYY.d.mts} +5 -13
  83. package/package.json +6 -2
  84. package/dist/Acquisition-D8o4jtCg.mjs.map +0 -1
  85. package/dist/Browser.mjs.map +0 -1
  86. package/dist/Client-BQteUePT.mjs.map +0 -1
  87. package/dist/Connection-DcvJZEdc.mjs.map +0 -1
  88. package/dist/ContextWriter-BrQmoXRg.mjs.map +0 -1
  89. package/dist/Extensions-nMNMPGCc.mjs.map +0 -1
  90. package/dist/Launch-m0fxzJ49.mjs.map +0 -1
  91. package/dist/Sessions-DoQGg9nB.mjs.map +0 -1
@@ -0,0 +1,226 @@
1
+ import { n as ContextReference } from "./References-DOH3Wu44.mjs";
2
+ import { PlatformError } from "./Errors.mjs";
3
+ import { t as BrowserbaseClient } from "./Client-B_f6bBLT.mjs";
4
+ import { Context, Effect, Layer, Schema } from "effect";
5
+ //#region src/Functions.d.ts
6
+ declare const Status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
7
+ type FunctionStatus = typeof Status.Type;
8
+ declare const FunctionMetadata_base: Schema.Class<FunctionMetadata, Schema.Struct<{
9
+ readonly id: Schema.NonEmptyString;
10
+ readonly projectId: Schema.NonEmptyString;
11
+ readonly name: Schema.String;
12
+ readonly createdAt: Schema.String;
13
+ readonly updatedAt: Schema.String;
14
+ }>, {}>;
15
+ declare class FunctionMetadata extends FunctionMetadata_base {}
16
+ declare const FunctionVersion_base: Schema.Class<FunctionVersion, Schema.Struct<{
17
+ readonly id: Schema.NonEmptyString;
18
+ readonly projectId: Schema.NonEmptyString;
19
+ readonly functionId: Schema.NonEmptyString;
20
+ readonly functionBuildId: Schema.NonEmptyString;
21
+ readonly sessionCreateParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
22
+ readonly userParamsSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
23
+ readonly createdAt: Schema.String;
24
+ readonly updatedAt: Schema.String;
25
+ }>, {}>;
26
+ declare class FunctionVersion extends FunctionVersion_base {}
27
+ declare const FunctionBuild_base: Schema.Class<FunctionBuild, Schema.Struct<{
28
+ readonly id: Schema.NonEmptyString;
29
+ readonly projectId: Schema.NonEmptyString;
30
+ readonly request: Schema.Struct<{
31
+ readonly entrypoint: Schema.String;
32
+ readonly functionNames: Schema.optionalKey<Schema.$Array<Schema.String>>;
33
+ }>;
34
+ readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
35
+ readonly createdAt: Schema.String;
36
+ readonly updatedAt: Schema.String;
37
+ readonly startedAt: Schema.String;
38
+ readonly endedAt: Schema.optionalKey<Schema.String>;
39
+ readonly expiresAt: Schema.String;
40
+ readonly cause: Schema.optionalKey<Schema.Struct<{
41
+ readonly code: Schema.String;
42
+ readonly message: Schema.optionalKey<Schema.String>;
43
+ }>>;
44
+ }>, {}>;
45
+ declare class FunctionBuild extends FunctionBuild_base {}
46
+ declare const FunctionInvocation_base: Schema.Class<FunctionInvocation, Schema.Struct<{
47
+ readonly id: Schema.NonEmptyString;
48
+ readonly projectId: Schema.NonEmptyString;
49
+ readonly functionId: Schema.NonEmptyString;
50
+ readonly versionId: Schema.NonEmptyString;
51
+ readonly sessionId: Schema.NonEmptyString;
52
+ readonly region: Schema.optionalKey<Schema.String>;
53
+ readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
54
+ readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
55
+ readonly results: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
56
+ readonly cause: Schema.optionalKey<Schema.Struct<{
57
+ readonly code: Schema.String;
58
+ readonly message: Schema.optionalKey<Schema.String>;
59
+ }>>;
60
+ readonly createdAt: Schema.String;
61
+ readonly updatedAt: Schema.String;
62
+ readonly startedAt: Schema.String;
63
+ readonly endedAt: Schema.optionalKey<Schema.String>;
64
+ readonly expiresAt: Schema.String;
65
+ }>, {}>;
66
+ declare class FunctionInvocation extends FunctionInvocation_base {}
67
+ declare const FunctionLogLine_base: Schema.Class<FunctionLogLine, Schema.Struct<{
68
+ readonly message: Schema.String;
69
+ readonly timestamp: Schema.Finite;
70
+ }>, {}>;
71
+ declare class FunctionLogLine extends FunctionLogLine_base {}
72
+ /** The session a Function invocation runs in; the provider's invoke-time subset. */
73
+ declare const FunctionSessionParams: Schema.Struct<{
74
+ /** Seconds, 60–900; the provider defaults to 900. */
75
+ readonly timeout: Schema.optionalKey<Schema.Int>;
76
+ readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
77
+ readonly context: Schema.optionalKey<Schema.Struct<{
78
+ readonly reference: typeof ContextReference;
79
+ readonly persist: Schema.Boolean;
80
+ }>>;
81
+ readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
82
+ readonly type: Schema.Literal<"browserbase">;
83
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
84
+ readonly geolocation: Schema.optionalKey<Schema.Struct<{
85
+ readonly country: Schema.String;
86
+ readonly state: Schema.optionalKey<Schema.String>;
87
+ readonly city: Schema.optionalKey<Schema.NonEmptyString>;
88
+ }>>;
89
+ }>, Schema.Struct<{
90
+ readonly type: Schema.Literal<"external">;
91
+ readonly server: Schema.NonEmptyString;
92
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
93
+ readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
94
+ readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
95
+ }>, Schema.Struct<{
96
+ readonly type: Schema.Literal<"none">;
97
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
98
+ }>]>>]>>;
99
+ readonly proxySettings: Schema.optionalKey<Schema.Struct<{
100
+ readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
101
+ }>>;
102
+ readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
103
+ readonly browserSettings: Schema.optionalKey<Schema.Struct<{
104
+ readonly viewport: Schema.optionalKey<Schema.Struct<{
105
+ readonly width: Schema.optionalKey<Schema.Int>;
106
+ readonly height: Schema.optionalKey<Schema.Int>;
107
+ }>>;
108
+ readonly blockAds: Schema.optionalKey<Schema.Boolean>;
109
+ readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
110
+ readonly recordSession: Schema.optionalKey<Schema.Boolean>;
111
+ readonly logSession: Schema.optionalKey<Schema.Boolean>;
112
+ readonly verified: Schema.optionalKey<Schema.Boolean>;
113
+ readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
114
+ readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
115
+ readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
116
+ readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
117
+ readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
118
+ readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
119
+ readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
120
+ readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
121
+ readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
122
+ }>>;
123
+ }>;
124
+ type FunctionSessionParams = typeof FunctionSessionParams.Type;
125
+ declare const FunctionInvokeRequest: Schema.Struct<{
126
+ readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
127
+ readonly session: Schema.optionalKey<Schema.Struct<{
128
+ /** Seconds, 60–900; the provider defaults to 900. */
129
+ readonly timeout: Schema.optionalKey<Schema.Int>;
130
+ readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
131
+ readonly context: Schema.optionalKey<Schema.Struct<{
132
+ readonly reference: typeof ContextReference;
133
+ readonly persist: Schema.Boolean;
134
+ }>>;
135
+ readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
136
+ readonly type: Schema.Literal<"browserbase">;
137
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
138
+ readonly geolocation: Schema.optionalKey<Schema.Struct<{
139
+ readonly country: Schema.String;
140
+ readonly state: Schema.optionalKey<Schema.String>;
141
+ readonly city: Schema.optionalKey<Schema.NonEmptyString>;
142
+ }>>;
143
+ }>, Schema.Struct<{
144
+ readonly type: Schema.Literal<"external">;
145
+ readonly server: Schema.NonEmptyString;
146
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
147
+ readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
148
+ readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
149
+ }>, Schema.Struct<{
150
+ readonly type: Schema.Literal<"none">;
151
+ readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
152
+ }>]>>]>>;
153
+ readonly proxySettings: Schema.optionalKey<Schema.Struct<{
154
+ readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
155
+ }>>;
156
+ readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
157
+ readonly browserSettings: Schema.optionalKey<Schema.Struct<{
158
+ readonly viewport: Schema.optionalKey<Schema.Struct<{
159
+ readonly width: Schema.optionalKey<Schema.Int>;
160
+ readonly height: Schema.optionalKey<Schema.Int>;
161
+ }>>;
162
+ readonly blockAds: Schema.optionalKey<Schema.Boolean>;
163
+ readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
164
+ readonly recordSession: Schema.optionalKey<Schema.Boolean>;
165
+ readonly logSession: Schema.optionalKey<Schema.Boolean>;
166
+ readonly verified: Schema.optionalKey<Schema.Boolean>;
167
+ readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
168
+ readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
169
+ readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
170
+ readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
171
+ readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
172
+ readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
173
+ readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
174
+ readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
175
+ readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
176
+ }>>;
177
+ }>>;
178
+ }>;
179
+ type FunctionInvokeRequest = typeof FunctionInvokeRequest.Type;
180
+ declare const FunctionPageQuery: Schema.Struct<{
181
+ offset: Schema.optionalKey<Schema.Int>;
182
+ limit: Schema.optionalKey<Schema.Int>;
183
+ }>;
184
+ type FunctionPageQuery = typeof FunctionPageQuery.Type;
185
+ declare const FunctionStatusQuery: Schema.Struct<{
186
+ readonly offset: Schema.optionalKey<Schema.Int>;
187
+ readonly limit: Schema.optionalKey<Schema.Int>;
188
+ readonly status: Schema.optionalKey<Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>>;
189
+ }>;
190
+ type FunctionStatusQuery = typeof FunctionStatusQuery.Type;
191
+ declare const FunctionWaitOptions: Schema.Struct<{
192
+ readonly timeoutMillis: Schema.Int;
193
+ readonly pollIntervalMillis: Schema.optionalKey<Schema.Int>;
194
+ }>;
195
+ type FunctionWaitOptions = typeof FunctionWaitOptions.Type;
196
+ interface OffsetPage<A> {
197
+ readonly items: ReadonlyArray<A>;
198
+ readonly total: number;
199
+ }
200
+ declare const BrowserbaseFunctions_base: Context.ServiceClass<BrowserbaseFunctions, "effect-browserbase/Functions", {
201
+ readonly list: (query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionMetadata>, PlatformError>;
202
+ readonly retrieve: (functionId: string) => Effect.Effect<FunctionMetadata, PlatformError>;
203
+ readonly invoke: (functionId: string, request?: FunctionInvokeRequest) => Effect.Effect<FunctionInvocation, PlatformError>;
204
+ readonly versions: (functionId: string, query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionVersion>, PlatformError>;
205
+ readonly version: (versionId: string) => Effect.Effect<FunctionVersion, PlatformError>;
206
+ readonly invocations: (versionId: string, query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionInvocation>, PlatformError>;
207
+ readonly invocation: (invocationId: string) => Effect.Effect<FunctionInvocation, PlatformError>;
208
+ readonly invocationLogs: (invocationId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
209
+ readonly builds: (query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionBuild>, PlatformError>;
210
+ readonly build: (buildId: string) => Effect.Effect<FunctionBuild, PlatformError>;
211
+ readonly buildLogs: (buildId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
212
+ /** Polls until the invocation is terminal. Interrupting the wait does not cancel it. */
213
+ readonly waitForInvocation: (invocationId: string, options: FunctionWaitOptions) => Effect.Effect<FunctionInvocation, PlatformError>;
214
+ }>;
215
+ /**
216
+ * Browserbase Functions: deployed code invoked in a provider-allocated session. Deployment
217
+ * happens through Browserbase's CLI; this service reads, invokes and observes. `invoke` is
218
+ * never retried, and a lost reply is `outcome: "unknown"`.
219
+ */
220
+ declare class BrowserbaseFunctions extends BrowserbaseFunctions_base {
221
+ static readonly layer: Layer.Layer<BrowserbaseFunctions, never, BrowserbaseClient>;
222
+ }
223
+ //#endregion
224
+ export { FunctionLogLine as a, FunctionSessionParams as c, FunctionVersion as d, FunctionWaitOptions as f, FunctionInvokeRequest as i, FunctionStatus as l, FunctionBuild as n, FunctionMetadata as o, OffsetPage as p, FunctionInvocation as r, FunctionPageQuery as s, BrowserbaseFunctions as t, FunctionStatusQuery as u };
225
+ export {};
226
+ //# sourceMappingURL=Functions-CsKMMUuZ.d.mts.map
@@ -1,225 +1,3 @@
1
- import { n as ContextReference } from "./References-DOH3Wu44.mjs";
2
- import { PlatformError } from "./Errors.mjs";
3
- import { BrowserbaseClient } from "./Client.mjs";
4
- import { Context, Effect, Layer, Schema } from "effect";
5
- //#region src/Functions.d.ts
6
- declare const Status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
7
- export type FunctionStatus = typeof Status.Type;
8
- declare const FunctionMetadata_base: Schema.Class<FunctionMetadata, Schema.Struct<{
9
- readonly id: Schema.NonEmptyString;
10
- readonly projectId: Schema.NonEmptyString;
11
- readonly name: Schema.String;
12
- readonly createdAt: Schema.String;
13
- readonly updatedAt: Schema.String;
14
- }>, {}>;
15
- export declare class FunctionMetadata extends FunctionMetadata_base {}
16
- declare const FunctionVersion_base: Schema.Class<FunctionVersion, Schema.Struct<{
17
- readonly id: Schema.NonEmptyString;
18
- readonly projectId: Schema.NonEmptyString;
19
- readonly functionId: Schema.NonEmptyString;
20
- readonly functionBuildId: Schema.NonEmptyString;
21
- readonly sessionCreateParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
22
- readonly userParamsSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
23
- readonly createdAt: Schema.String;
24
- readonly updatedAt: Schema.String;
25
- }>, {}>;
26
- export declare class FunctionVersion extends FunctionVersion_base {}
27
- declare const FunctionBuild_base: Schema.Class<FunctionBuild, Schema.Struct<{
28
- readonly id: Schema.NonEmptyString;
29
- readonly projectId: Schema.NonEmptyString;
30
- readonly request: Schema.Struct<{
31
- readonly entrypoint: Schema.String;
32
- readonly functionNames: Schema.optionalKey<Schema.$Array<Schema.String>>;
33
- }>;
34
- readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
35
- readonly createdAt: Schema.String;
36
- readonly updatedAt: Schema.String;
37
- readonly startedAt: Schema.String;
38
- readonly endedAt: Schema.optionalKey<Schema.String>;
39
- readonly expiresAt: Schema.String;
40
- readonly cause: Schema.optionalKey<Schema.Struct<{
41
- readonly code: Schema.String;
42
- readonly message: Schema.optionalKey<Schema.String>;
43
- }>>;
44
- }>, {}>;
45
- export declare class FunctionBuild extends FunctionBuild_base {}
46
- declare const FunctionInvocation_base: Schema.Class<FunctionInvocation, Schema.Struct<{
47
- readonly id: Schema.NonEmptyString;
48
- readonly projectId: Schema.NonEmptyString;
49
- readonly functionId: Schema.NonEmptyString;
50
- readonly versionId: Schema.NonEmptyString;
51
- readonly sessionId: Schema.NonEmptyString;
52
- readonly region: Schema.optionalKey<Schema.String>;
53
- readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
54
- readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
55
- readonly results: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
56
- readonly cause: Schema.optionalKey<Schema.Struct<{
57
- readonly code: Schema.String;
58
- readonly message: Schema.optionalKey<Schema.String>;
59
- }>>;
60
- readonly createdAt: Schema.String;
61
- readonly updatedAt: Schema.String;
62
- readonly startedAt: Schema.String;
63
- readonly endedAt: Schema.optionalKey<Schema.String>;
64
- readonly expiresAt: Schema.String;
65
- }>, {}>;
66
- export declare class FunctionInvocation extends FunctionInvocation_base {}
67
- declare const FunctionLogLine_base: Schema.Class<FunctionLogLine, Schema.Struct<{
68
- readonly message: Schema.String;
69
- readonly timestamp: Schema.Finite;
70
- }>, {}>;
71
- export declare class FunctionLogLine extends FunctionLogLine_base {}
72
- /** The session a Function invocation runs in; the provider's invoke-time subset. */
73
- export declare const FunctionSessionParams: Schema.Struct<{
74
- /** Seconds, 60–900; the provider defaults to 900. */
75
- readonly timeout: Schema.optionalKey<Schema.Int>;
76
- readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
77
- readonly context: Schema.optionalKey<Schema.Struct<{
78
- readonly reference: typeof ContextReference;
79
- readonly persist: Schema.Boolean;
80
- }>>;
81
- readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
82
- readonly type: Schema.Literal<"browserbase">;
83
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
84
- readonly geolocation: Schema.optionalKey<Schema.Struct<{
85
- readonly country: Schema.String;
86
- readonly state: Schema.optionalKey<Schema.String>;
87
- readonly city: Schema.optionalKey<Schema.NonEmptyString>;
88
- }>>;
89
- }>, Schema.Struct<{
90
- readonly type: Schema.Literal<"external">;
91
- readonly server: Schema.NonEmptyString;
92
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
93
- readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
94
- readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
95
- }>, Schema.Struct<{
96
- readonly type: Schema.Literal<"none">;
97
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
98
- }>]>>]>>;
99
- readonly proxySettings: Schema.optionalKey<Schema.Struct<{
100
- readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
101
- }>>;
102
- readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
103
- readonly browserSettings: Schema.optionalKey<Schema.Struct<{
104
- readonly viewport: Schema.optionalKey<Schema.Struct<{
105
- readonly width: Schema.optionalKey<Schema.Int>;
106
- readonly height: Schema.optionalKey<Schema.Int>;
107
- }>>;
108
- readonly blockAds: Schema.optionalKey<Schema.Boolean>;
109
- readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
110
- readonly recordSession: Schema.optionalKey<Schema.Boolean>;
111
- readonly logSession: Schema.optionalKey<Schema.Boolean>;
112
- readonly verified: Schema.optionalKey<Schema.Boolean>;
113
- readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
114
- readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
115
- readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
116
- readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
117
- readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
118
- readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
119
- readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
120
- readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
121
- readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
122
- }>>;
123
- }>;
124
- export type FunctionSessionParams = typeof FunctionSessionParams.Type;
125
- export declare const FunctionInvokeRequest: Schema.Struct<{
126
- readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
127
- readonly session: Schema.optionalKey<Schema.Struct<{
128
- /** Seconds, 60–900; the provider defaults to 900. */
129
- readonly timeout: Schema.optionalKey<Schema.Int>;
130
- readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
131
- readonly context: Schema.optionalKey<Schema.Struct<{
132
- readonly reference: typeof ContextReference;
133
- readonly persist: Schema.Boolean;
134
- }>>;
135
- readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
136
- readonly type: Schema.Literal<"browserbase">;
137
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
138
- readonly geolocation: Schema.optionalKey<Schema.Struct<{
139
- readonly country: Schema.String;
140
- readonly state: Schema.optionalKey<Schema.String>;
141
- readonly city: Schema.optionalKey<Schema.NonEmptyString>;
142
- }>>;
143
- }>, Schema.Struct<{
144
- readonly type: Schema.Literal<"external">;
145
- readonly server: Schema.NonEmptyString;
146
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
147
- readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
148
- readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
149
- }>, Schema.Struct<{
150
- readonly type: Schema.Literal<"none">;
151
- readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
152
- }>]>>]>>;
153
- readonly proxySettings: Schema.optionalKey<Schema.Struct<{
154
- readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
155
- }>>;
156
- readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
157
- readonly browserSettings: Schema.optionalKey<Schema.Struct<{
158
- readonly viewport: Schema.optionalKey<Schema.Struct<{
159
- readonly width: Schema.optionalKey<Schema.Int>;
160
- readonly height: Schema.optionalKey<Schema.Int>;
161
- }>>;
162
- readonly blockAds: Schema.optionalKey<Schema.Boolean>;
163
- readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
164
- readonly recordSession: Schema.optionalKey<Schema.Boolean>;
165
- readonly logSession: Schema.optionalKey<Schema.Boolean>;
166
- readonly verified: Schema.optionalKey<Schema.Boolean>;
167
- readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
168
- readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
169
- readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
170
- readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
171
- readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
172
- readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
173
- readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
174
- readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
175
- readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
176
- }>>;
177
- }>>;
178
- }>;
179
- export type FunctionInvokeRequest = typeof FunctionInvokeRequest.Type;
180
- export declare const FunctionPageQuery: Schema.Struct<{
181
- offset: Schema.optionalKey<Schema.Int>;
182
- limit: Schema.optionalKey<Schema.Int>;
183
- }>;
184
- export type FunctionPageQuery = typeof FunctionPageQuery.Type;
185
- export declare const FunctionStatusQuery: Schema.Struct<{
186
- readonly offset: Schema.optionalKey<Schema.Int>;
187
- readonly limit: Schema.optionalKey<Schema.Int>;
188
- readonly status: Schema.optionalKey<Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>>;
189
- }>;
190
- export type FunctionStatusQuery = typeof FunctionStatusQuery.Type;
191
- export declare const FunctionWaitOptions: Schema.Struct<{
192
- readonly timeoutMillis: Schema.Int;
193
- readonly pollIntervalMillis: Schema.optionalKey<Schema.Int>;
194
- }>;
195
- export type FunctionWaitOptions = typeof FunctionWaitOptions.Type;
196
- export interface OffsetPage<A> {
197
- readonly items: ReadonlyArray<A>;
198
- readonly total: number;
199
- }
200
- declare const BrowserbaseFunctions_base: Context.ServiceClass<BrowserbaseFunctions, "effect-browserbase/Functions", {
201
- readonly list: (query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionMetadata>, PlatformError>;
202
- readonly retrieve: (functionId: string) => Effect.Effect<FunctionMetadata, PlatformError>;
203
- readonly invoke: (functionId: string, request?: FunctionInvokeRequest) => Effect.Effect<FunctionInvocation, PlatformError>;
204
- readonly versions: (functionId: string, query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionVersion>, PlatformError>;
205
- readonly version: (versionId: string) => Effect.Effect<FunctionVersion, PlatformError>;
206
- readonly invocations: (versionId: string, query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionInvocation>, PlatformError>;
207
- readonly invocation: (invocationId: string) => Effect.Effect<FunctionInvocation, PlatformError>;
208
- readonly invocationLogs: (invocationId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
209
- readonly builds: (query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionBuild>, PlatformError>;
210
- readonly build: (buildId: string) => Effect.Effect<FunctionBuild, PlatformError>;
211
- readonly buildLogs: (buildId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
212
- /** Polls until the invocation is terminal. Interrupting the wait does not cancel it. */
213
- readonly waitForInvocation: (invocationId: string, options: FunctionWaitOptions) => Effect.Effect<FunctionInvocation, PlatformError>;
214
- }>;
215
- /**
216
- * Browserbase Functions: deployed code invoked in a provider-allocated session. Deployment
217
- * happens through Browserbase's CLI; this service reads, invokes and observes. `invoke` is
218
- * never retried, and a lost reply is `outcome: "unknown"`.
219
- */
220
- export declare class BrowserbaseFunctions extends BrowserbaseFunctions_base {
221
- static readonly layer: Layer.Layer<BrowserbaseFunctions, never, BrowserbaseClient>;
222
- }
223
- //#endregion
224
- export {};
225
- //# sourceMappingURL=Functions.d.mts.map
1
+ import { a as FunctionLogLine, c as FunctionSessionParams, d as FunctionVersion, f as FunctionWaitOptions, i as FunctionInvokeRequest, l as FunctionStatus, n as FunctionBuild, o as FunctionMetadata, p as OffsetPage, r as FunctionInvocation, s as FunctionPageQuery, t as BrowserbaseFunctions, u as FunctionStatusQuery } from "./Functions-CsKMMUuZ.mjs";
2
+ export { BrowserbaseFunctions, FunctionBuild, FunctionInvocation, FunctionInvokeRequest, FunctionLogLine, FunctionMetadata, FunctionPageQuery, FunctionSessionParams, FunctionStatus, FunctionStatusQuery, FunctionVersion, FunctionWaitOptions, OffsetPage };
3
+ export {};
@@ -1,10 +1,10 @@
1
1
  import { ContextReference, Identifier } from "./References.mjs";
2
2
  import { PlatformError } from "./Errors.mjs";
3
- import { t as BrowserbaseClient } from "./Client-BQteUePT.mjs";
3
+ import { t as BrowserbaseClient } from "./Client-4RMKIpL2.mjs";
4
4
  import { t as resource } from "./Resource-DBksC4zB.mjs";
5
5
  import { ProxyRule } from "./Launch.mjs";
6
- import { n as proxy } from "./Launch-m0fxzJ49.mjs";
7
- import { n as isContextWriterBusy } from "./ContextWriter-BrQmoXRg.mjs";
6
+ import { n as proxy } from "./Launch-cAdE2rrZ.mjs";
7
+ import { n as isContextWriterBusy } from "./ContextWriter-oKWFLHuP.mjs";
8
8
  import { Clock, Context, Effect, Layer, Schema } from "effect";
9
9
  //#region src/Functions.ts
10
10
  const Timestamp = Schema.String.check(Schema.isMaxLength(64));
@@ -3,6 +3,13 @@ import { LaunchRecipe } from "./Launch.mjs";
3
3
  import { Effect, Redacted, Schema } from "effect";
4
4
  import { Viewport } from "effect-browser/browser-data";
5
5
  import { BrowserError, Reasons } from "effect-browser/errors";
6
+ //#region src/internal/List.ts
7
+ /**
8
+ * `Array.isArray` narrows to `any[]`, which erases a readonly array's element type. This keeps
9
+ * the same runtime check and the declared element type.
10
+ */
11
+ const isList = (value) => Array.isArray(value);
12
+ //#endregion
6
13
  //#region src/internal/provider/Launch.ts
7
14
  const proxy = (rule) => rule.type === "external" ? {
8
15
  type: rule.type,
@@ -40,7 +47,7 @@ const compileLaunch = Effect.fnUntraced(function* (input, identity) {
40
47
  width: recipe.viewport.width,
41
48
  height: recipe.viewport.height
42
49
  }).pipe(Effect.mapError(fail)) : void 0;
43
- if (Array.isArray(recipe.provider.proxies)) for (const rule of recipe.provider.proxies) {
50
+ if (isList(recipe.provider.proxies)) for (const rule of recipe.provider.proxies) {
44
51
  if (rule.type === "browserbase" && rule.geolocation?.state !== void 0 && rule.geolocation.country !== "US") return yield* fail();
45
52
  if (rule.type === "external") {
46
53
  if (!(yield* Effect.try({
@@ -72,7 +79,7 @@ const compileLaunch = Effect.fnUntraced(function* (input, identity) {
72
79
  timeout: recipe.remoteTimeoutSeconds,
73
80
  keepAlive,
74
81
  ...recipe.provider.region === void 0 ? {} : { region: recipe.provider.region },
75
- proxies: Array.isArray(recipe.provider.proxies) ? recipe.provider.proxies.map(proxy) : recipe.provider.proxies ?? false,
82
+ proxies: isList(recipe.provider.proxies) ? recipe.provider.proxies.map(proxy) : recipe.provider.proxies ?? false,
76
83
  ...recipe.provider.proxySettings === void 0 ? {} : { proxySettings: recipe.provider.proxySettings },
77
84
  ...recipe.extension === void 0 ? {} : { extensionId: recipe.extension.extensionId },
78
85
  browserSettings: {
@@ -91,10 +98,7 @@ const compileLaunch = Effect.fnUntraced(function* (input, identity) {
91
98
  browserbaseIntegrationAttempt: attempt.attemptId
92
99
  }
93
100
  };
94
- const encoded = yield* Effect.try({
95
- try: () => JSON.stringify(body),
96
- catch: fail
97
- });
101
+ const encoded = yield* Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown))(body).pipe(Effect.mapError(fail));
98
102
  if (new TextEncoder().encode(encoded).length > 65536) return yield* fail();
99
103
  return {
100
104
  attempt,
@@ -106,6 +110,6 @@ const compileLaunch = Effect.fnUntraced(function* (input, identity) {
106
110
  };
107
111
  });
108
112
  //#endregion
109
- export { proxy as n, compileLaunch as t };
113
+ export { proxy as n, isList as r, compileLaunch as t };
110
114
 
111
- //# sourceMappingURL=Launch-m0fxzJ49.mjs.map
115
+ //# sourceMappingURL=Launch-cAdE2rrZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Launch-cAdE2rrZ.mjs","names":[],"sources":["../src/internal/List.ts","../src/internal/provider/Launch.ts"],"sourcesContent":["/**\n * `Array.isArray` narrows to `any[]`, which erases a readonly array's element type. This keeps\n * the same runtime check and the declared element type.\n */\nexport const isList = <T>(value: T): value is Extract<T, ReadonlyArray<unknown>> =>\n Array.isArray(value);\n","import { Effect, Redacted, Schema } from \"effect\";\nimport { Viewport } from \"effect-browser/browser-data\";\nimport { BrowserError, Reasons } from \"effect-browser/errors\";\n\nimport { LaunchRecipe, type ProxyRule } from \"../../Launch.ts\";\nimport { AllocationAttempt } from \"../../References.ts\";\nimport { isList } from \"../List.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({\n operation: \"launch\",\n reason: Reasons.Configuration.make({}),\n outcome: \"undispatched\",\n }),\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({\n operation: \"launch\",\n reason: Reasons.Configuration.make({}),\n outcome: \"undispatched\",\n });\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 (isList(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: isList(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* Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown))(body).pipe(\n Effect.mapError(fail),\n );\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":";;;;;;;;;;AAIA,MAAa,UAAa,UACxB,MAAM,QAAQ,KAAK;;;ACYrB,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,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schema.Struct<{
73
73
  * unqualified identifier cannot reach the provider unchecked.
74
74
  */
75
75
  readonly extension: Schema.optionalKey<typeof ExtensionReference>;
76
- readonly viewport: Schema.Union<readonly [Schema.Struct<{
77
- readonly _tag: Schema.Literal<"ProviderManaged">;
78
- }>, Schema.Struct<{
79
- readonly _tag: Schema.Literal<"Fixed">;
76
+ readonly viewport: Schema.Union<readonly [Schema.TaggedStruct<"ProviderManaged", {}>, Schema.TaggedStruct<"Fixed", {
80
77
  readonly width: Schema.Int;
81
78
  readonly height: Schema.Int;
82
79
  }>]>;
package/dist/Launch.mjs CHANGED
@@ -74,8 +74,7 @@ const LaunchRecipe = Schema.Struct({
74
74
  * unqualified identifier cannot reach the provider unchecked.
75
75
  */
76
76
  extension: Schema.optionalKey(ExtensionReference),
77
- viewport: Schema.Union([Schema.Struct({ _tag: Schema.Literal("ProviderManaged") }), Schema.Struct({
78
- _tag: Schema.Literal("Fixed"),
77
+ viewport: Schema.Union([Schema.TaggedStruct("ProviderManaged", {}), Schema.TaggedStruct("Fixed", {
79
78
  width: Viewport.fields.width,
80
79
  height: Viewport.fields.height
81
80
  })]),
@@ -1 +1 @@
1
- {"version":3,"file":"Launch.mjs","names":["Identifier"],"sources":["../src/Launch.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { Viewport } from \"effect-browser/browser-data\";\n\nimport { ContextReference, ExtensionReference, Identifier } from \"./References.ts\";\n\nconst BoundedString = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\nconst ProxySecret = Schema.Redacted(Schema.String.check(Schema.isMaxLength(8192)));\n\nconst Geolocation = Schema.Struct({\n country: Schema.String.check(Schema.isPattern(/^[A-Z]{2}$/)),\n state: Schema.optionalKey(Schema.String.check(Schema.isPattern(/^[A-Z]{2}$/))),\n city: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(256))),\n});\n\nexport const ProxyRule = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"browserbase\"),\n domainPattern: Schema.optionalKey(BoundedString),\n geolocation: Schema.optionalKey(Geolocation),\n }),\n Schema.Struct({\n type: Schema.Literal(\"external\"),\n server: BoundedString,\n domainPattern: Schema.optionalKey(BoundedString),\n username: Schema.optionalKey(ProxySecret),\n password: Schema.optionalKey(ProxySecret),\n }),\n Schema.Struct({ type: Schema.Literal(\"none\"), domainPattern: Schema.optionalKey(BoundedString) }),\n]);\n\nexport type ProxyRule = typeof ProxyRule.Type;\n\n/** SDK 2.20 browser subset. Names follow Browserbase; ownership-managed fields are excluded. */\nexport const ProviderLaunchOptions = Schema.Struct({\n region: Schema.optionalKey(\n Schema.Literals([\"us-west-2\", \"us-east-1\", \"eu-central-1\", \"ap-southeast-1\"]),\n ),\n proxies: Schema.optionalKey(\n Schema.Union([Schema.Boolean, Schema.Array(ProxyRule).check(Schema.isMaxLength(64))]),\n ),\n proxySettings: Schema.optionalKey(\n Schema.Struct({\n caCertificates: Schema.optionalKey(\n Schema.Array(Identifier).check(Schema.isMaxLength(64), Schema.isUnique()),\n ),\n }),\n ),\n browserSettings: Schema.optionalKey(\n Schema.Struct({\n verified: Schema.optionalKey(Schema.Boolean),\n os: Schema.optionalKey(Schema.Literals([\"windows\", \"mac\", \"linux\", \"mobile\", \"tablet\"])),\n allowedDomains: Schema.optionalKey(\n Schema.Array(BoundedString).check(Schema.isMaxLength(64), Schema.isUnique()),\n ),\n blockAds: Schema.optionalKey(Schema.Boolean),\n captchaImageSelector: Schema.optionalKey(BoundedString),\n captchaInputSelector: Schema.optionalKey(BoundedString),\n ignoreCertificateErrors: Schema.optionalKey(Schema.Boolean),\n logSession: Schema.optionalKey(Schema.Boolean),\n recordSession: Schema.optionalKey(Schema.Boolean),\n solveCaptchas: Schema.optionalKey(Schema.Boolean),\n }),\n ),\n userMetadata: Schema.optionalKey(\n Schema.Record(Schema.String.check(Schema.isMaxLength(128)), Schema.Json),\n ),\n});\n\nexport type ProviderLaunchOptions = typeof ProviderLaunchOptions.Type;\n\n/** Connection behavior and business budgets are not provider session lifetime. */\nexport const LaunchRecipe = Schema.Struct({\n remoteTimeoutSeconds: Schema.Int.check(Schema.isBetween({ minimum: 60, maximum: 21600 })),\n keepAlive: Schema.optionalKey(Schema.Boolean),\n context: Schema.optionalKey(\n Schema.Struct({ reference: ContextReference, persist: Schema.Boolean }),\n ),\n /**\n * Project-qualified selection of an already provisioned extension, never an upload. It is\n * the only spelling: the compiler alone projects it to the provider's `extensionId`, so an\n * unqualified identifier cannot reach the provider unchecked.\n */\n extension: Schema.optionalKey(ExtensionReference),\n viewport: Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"ProviderManaged\") }),\n Schema.Struct({\n _tag: Schema.Literal(\"Fixed\"),\n width: Viewport.fields.width,\n height: Viewport.fields.height,\n }),\n ]),\n provider: ProviderLaunchOptions,\n});\n\nexport type LaunchRecipe = typeof LaunchRecipe.Type;\n\n/**\n * A recipe with the smallest reasonable choices filled in: a five-minute provider lifetime,\n * a provider-managed viewport (which Verified requires) and no provider options. Privacy\n * defaults are unchanged: recording, logging and captcha solving stay off unless requested.\n */\nexport const recipe = (options: Partial<LaunchRecipe> = {}): LaunchRecipe => ({\n remoteTimeoutSeconds: 300,\n viewport: { _tag: \"ProviderManaged\" },\n provider: {},\n ...options,\n});\n"],"mappings":";;;;AAKA,MAAM,gBAAgB,OAAO,eAAe,MAAM,OAAO,YAAY,IAAI,CAAC;AAC1E,MAAM,cAAc,OAAO,SAAS,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC,CAAC;AAEjF,MAAM,cAAc,OAAO,OAAO;CAChC,SAAS,OAAO,OAAO,MAAM,OAAO,UAAU,YAAY,CAAC;CAC3D,OAAO,OAAO,YAAY,OAAO,OAAO,MAAM,OAAO,UAAU,YAAY,CAAC,CAAC;CAC7E,MAAM,OAAO,YAAY,OAAO,eAAe,MAAM,OAAO,YAAY,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED,MAAa,YAAY,OAAO,MAAM;CACpC,OAAO,OAAO;EACZ,MAAM,O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OAAO,YAAY,OAAO,OAAO;EAChD,eAAe,OAAO,YAAY,OAAO,OAAO;CAClD,CAAC,CACH;CACA,cAAc,OAAO,YACnB,OAAO,OAAO,OAAO,OAAO,MAAM,OAAO,YAAY,GAAG,CAAC,GAAG,OAAO,IAAI,CACzE;AACF,CAAC;;AAKD,MAAa,eAAe,OAAO,OAAO;CACxC,sBAAsB,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAI,SAAS;CAAM,CAAC,CAAC;CACxF,WAAW,OAAO,YAAY,OAAO,OAAO;CAC5C,SAAS,OAAO,YACd,OAAO,OAAO;EAAE,WAAW;EAAkB,SAAS,OAAO;CAAQ,CAAC,CACxE;;;;;;CAMA,WAAW,OAAO,YAAY,kBAAkB;CAChD,UAAU,OAAO,MAAM,CACrB,OAAO,OAAO,EAAE,MAAM,OAAO,QAAQ,iBAAiB,EAAE,CAAC,GACzD,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,OAAO;EAC5B,OAAO,SAAS,OAAO;EACvB,QAAQ,SAAS,OAAO;CAC1B,CAAC,CACH,CAAC;CACD,UAAU;AACZ,CAAC;;;;;;AASD,MAAa,UAAU,UAAiC,CAAC,OAAqB;CAC5E,sBAAsB;CACtB,UAAU,EAAE,MAAM,kBAAkB;CACpC,UAAU,CAAC;CACX,GAAG;AACL"}
1
+ {"version":3,"file":"Launch.mjs","names":["Identifier"],"sources":["../src/Launch.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { Viewport } from \"effect-browser/browser-data\";\n\nimport { ContextReference, ExtensionReference, Identifier } from \"./References.ts\";\n\nconst BoundedString = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\nconst ProxySecret = Schema.Redacted(Schema.String.check(Schema.isMaxLength(8192)));\n\nconst Geolocation = Schema.Struct({\n country: Schema.String.check(Schema.isPattern(/^[A-Z]{2}$/)),\n state: Schema.optionalKey(Schema.String.check(Schema.isPattern(/^[A-Z]{2}$/))),\n city: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(256))),\n});\n\nexport const ProxyRule = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"browserbase\"),\n domainPattern: Schema.optionalKey(BoundedString),\n geolocation: Schema.optionalKey(Geolocation),\n }),\n Schema.Struct({\n type: Schema.Literal(\"external\"),\n server: BoundedString,\n domainPattern: Schema.optionalKey(BoundedString),\n username: Schema.optionalKey(ProxySecret),\n password: Schema.optionalKey(ProxySecret),\n }),\n Schema.Struct({ type: Schema.Literal(\"none\"), domainPattern: Schema.optionalKey(BoundedString) }),\n]);\n\nexport type ProxyRule = typeof ProxyRule.Type;\n\n/** SDK 2.20 browser subset. Names follow Browserbase; ownership-managed fields are excluded. */\nexport const ProviderLaunchOptions = Schema.Struct({\n region: Schema.optionalKey(\n Schema.Literals([\"us-west-2\", \"us-east-1\", \"eu-central-1\", \"ap-southeast-1\"]),\n ),\n proxies: Schema.optionalKey(\n Schema.Union([Schema.Boolean, Schema.Array(ProxyRule).check(Schema.isMaxLength(64))]),\n ),\n proxySettings: Schema.optionalKey(\n Schema.Struct({\n caCertificates: Schema.optionalKey(\n Schema.Array(Identifier).check(Schema.isMaxLength(64), Schema.isUnique()),\n ),\n }),\n ),\n browserSettings: Schema.optionalKey(\n Schema.Struct({\n verified: Schema.optionalKey(Schema.Boolean),\n os: Schema.optionalKey(Schema.Literals([\"windows\", \"mac\", \"linux\", \"mobile\", \"tablet\"])),\n allowedDomains: Schema.optionalKey(\n Schema.Array(BoundedString).check(Schema.isMaxLength(64), Schema.isUnique()),\n ),\n blockAds: Schema.optionalKey(Schema.Boolean),\n captchaImageSelector: Schema.optionalKey(BoundedString),\n captchaInputSelector: Schema.optionalKey(BoundedString),\n ignoreCertificateErrors: Schema.optionalKey(Schema.Boolean),\n logSession: Schema.optionalKey(Schema.Boolean),\n recordSession: Schema.optionalKey(Schema.Boolean),\n solveCaptchas: Schema.optionalKey(Schema.Boolean),\n }),\n ),\n userMetadata: Schema.optionalKey(\n Schema.Record(Schema.String.check(Schema.isMaxLength(128)), Schema.Json),\n ),\n});\n\nexport type ProviderLaunchOptions = typeof ProviderLaunchOptions.Type;\n\n/** Connection behavior and business budgets are not provider session lifetime. */\nexport const LaunchRecipe = Schema.Struct({\n remoteTimeoutSeconds: Schema.Int.check(Schema.isBetween({ minimum: 60, maximum: 21600 })),\n keepAlive: Schema.optionalKey(Schema.Boolean),\n context: Schema.optionalKey(\n Schema.Struct({ reference: ContextReference, persist: Schema.Boolean }),\n ),\n /**\n * Project-qualified selection of an already provisioned extension, never an upload. It is\n * the only spelling: the compiler alone projects it to the provider's `extensionId`, so an\n * unqualified identifier cannot reach the provider unchecked.\n */\n extension: Schema.optionalKey(ExtensionReference),\n viewport: Schema.Union([\n Schema.TaggedStruct(\"ProviderManaged\", {}),\n Schema.TaggedStruct(\"Fixed\", {\n width: Viewport.fields.width,\n height: Viewport.fields.height,\n }),\n ]),\n provider: ProviderLaunchOptions,\n});\n\nexport type LaunchRecipe = typeof LaunchRecipe.Type;\n\n/**\n * A recipe with the smallest reasonable choices filled in: a five-minute provider lifetime,\n * a provider-managed viewport (which Verified requires) and no provider options. Privacy\n * defaults are unchanged: recording, logging and captcha solving stay off unless requested.\n */\nexport const recipe = (options: Partial<LaunchRecipe> = {}): LaunchRecipe => ({\n remoteTimeoutSeconds: 300,\n viewport: { _tag: \"ProviderManaged\" },\n provider: {},\n ...options,\n});\n"],"mappings":";;;;AAKA,MAAM,gBAAgB,OAAO,eAAe,MAAM,OAAO,YAAY,IAAI,CAAC;AAC1E,MAAM,cAAc,OAAO,SAAS,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC,CAAC;AAEjF,MAAM,cAAc,OAAO,OAAO;CAChC,SAAS,OAAO,OAAO,MAAM,OAAO,UAAU,YAAY,CAAC;CAC3D,OAAO,OAAO,YAAY,OAAO,OAAO,MAAM,OAAO,UAAU,YAAY,CAAC,CAAC;CAC7E,MAAM,OAAO,YAAY,OAAO,eAAe,MAAM,OAAO,YAAY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