effect-browserbase 0.1.0-beta.104 → 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.
- package/README.md +106 -307
- package/dist/Account.d.mts +17 -19
- package/dist/Account.mjs +4 -9
- package/dist/Account.mjs.map +1 -1
- package/dist/{Acquisition-WBafHwXH.mjs → Acquisition-CAsTTXp4.mjs} +25 -70
- package/dist/Acquisition-CAsTTXp4.mjs.map +1 -0
- package/dist/Agents-5HpTp9YE.d.mts +155 -0
- package/dist/Agents.d.mts +3 -156
- package/dist/Agents.mjs +4 -20
- 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-DpSajNai.mjs +270 -0
- package/dist/Browser-DpSajNai.mjs.map +1 -0
- package/dist/Browser.d.mts +26 -143
- package/dist/Browser.mjs +3 -223
- package/dist/BrowserBinding.d.mts +7 -34
- package/dist/BrowserBinding.mjs +30 -1
- package/dist/BrowserBinding.mjs.map +1 -0
- package/dist/Certificates-D4NQmyeA.d.mts +34 -0
- package/dist/Certificates.d.mts +3 -35
- 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-4RMKIpL2.mjs} +12 -12
- package/dist/Client-4RMKIpL2.mjs.map +1 -0
- package/dist/{Client-Ca0zSg1n.d.mts → Client-B_f6bBLT.d.mts} +4 -5
- package/dist/Client.d.mts +3 -2
- package/dist/Client.mjs +1 -1
- package/dist/Connection-sxyxtwlk.mjs +56 -0
- package/dist/Connection-sxyxtwlk.mjs.map +1 -0
- package/dist/ContextCoordination.d.mts +5 -6
- package/dist/ContextCoordination.mjs +2 -9
- package/dist/ContextCoordination.mjs.map +1 -1
- package/dist/{ContextWriter-BrQmoXRg.mjs → ContextWriter-oKWFLHuP.mjs} +8 -12
- package/dist/ContextWriter-oKWFLHuP.mjs.map +1 -0
- package/dist/Contexts-DqdL7cyX.d.mts +31 -0
- package/dist/Contexts.d.mts +3 -32
- package/dist/Contexts.mjs +3 -9
- package/dist/Contexts.mjs.map +1 -1
- package/dist/Downloads-CdhiCO5X.d.mts +43 -0
- package/dist/Downloads.d.mts +3 -44
- 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-DBXuVM1f.d.mts +43 -0
- package/dist/{Extensions-ClZbYb1H.mjs → Extensions-Dg3jHOf0.mjs} +3 -9
- package/dist/Extensions-Dg3jHOf0.mjs.map +1 -0
- package/dist/Extensions.d.mts +3 -44
- package/dist/Extensions.mjs +1 -1
- package/dist/Functions-CsKMMUuZ.d.mts +226 -0
- package/dist/Functions.d.mts +3 -227
- package/dist/Functions.mjs +4 -18
- package/dist/Functions.mjs.map +1 -1
- package/dist/{Launch-BHcAEq05.mjs → Launch-cAdE2rrZ.mjs} +16 -12
- package/dist/Launch-cAdE2rrZ.mjs.map +1 -0
- package/dist/Launch.d.mts +127 -2
- package/dist/Launch.mjs +5 -13
- package/dist/Launch.mjs.map +1 -1
- package/dist/PageFetch-CAMqb5m8.d.mts +39 -0
- package/dist/PageFetch.d.mts +3 -40
- package/dist/PageFetch.mjs +2 -8
- package/dist/PageFetch.mjs.map +1 -1
- package/dist/Projects-tm5bTDH0.d.mts +38 -0
- package/dist/Projects.d.mts +3 -39
- package/dist/Projects.mjs +2 -8
- package/dist/Projects.mjs.map +1 -1
- package/dist/Recordings-bVI33sTq.d.mts +27 -0
- package/dist/Recordings.d.mts +3 -28
- 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-Bo-9xeLz.d.mts +27 -0
- package/dist/Replays.d.mts +3 -28
- package/dist/Replays.mjs +3 -5
- package/dist/Replays.mjs.map +1 -1
- package/dist/Search-1g6TUem7.d.mts +37 -0
- package/dist/Search.d.mts +3 -38
- 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-B8E4kMxo.d.mts → Sessions-BpZgjteE.d.mts} +8 -8
- package/dist/{Sessions-CtbseWEh.mjs → Sessions-suOLSym9.mjs} +34 -18
- package/dist/Sessions-suOLSym9.mjs.map +1 -0
- package/dist/Sessions.d.mts +4 -3
- package/dist/Sessions.mjs +1 -1
- package/dist/Testing.d.mts +119 -0
- package/dist/Testing.mjs +206 -0
- package/dist/Testing.mjs.map +1 -0
- 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-C2neBEpj.d.mts +28 -0
- package/dist/Uploads.d.mts +3 -29
- package/dist/Uploads.mjs +3 -5
- package/dist/Uploads.mjs.map +1 -1
- package/dist/Webhooks-BoeRAxzG.d.mts +59 -0
- package/dist/Webhooks.d.mts +3 -60
- package/dist/Webhooks.mjs +2 -11
- package/dist/Webhooks.mjs.map +1 -1
- package/dist/{WriterFacts-osvYAsIx.d.mts → WriterFacts-BBJRDZYY.d.mts} +8 -15
- package/dist/index.d.mts +27 -31
- package/dist/index.mjs +26 -31
- package/package.json +7 -28
- package/dist/Acquisition-WBafHwXH.mjs.map +0 -1
- package/dist/Association-CEps4hYP.mjs +0 -10
- package/dist/Association-CEps4hYP.mjs.map +0 -1
- package/dist/Bootstrap-BXuzZojd.mjs +0 -194
- package/dist/Bootstrap-BXuzZojd.mjs.map +0 -1
- package/dist/Bootstrap-m7lHgj0D.d.mts +0 -177
- package/dist/Bootstrap.d.mts +0 -2
- package/dist/Bootstrap.mjs +0 -2
- package/dist/Browser.mjs.map +0 -1
- package/dist/BrowserBinding-DlJTGYZL.mjs +0 -2508
- package/dist/BrowserBinding-DlJTGYZL.mjs.map +0 -1
- package/dist/BrowserData-LpcAuAub.d.mts +0 -369
- package/dist/BrowserData.d.mts +0 -2
- package/dist/BrowserData.mjs +0 -442
- package/dist/BrowserData.mjs.map +0 -1
- package/dist/Capture-Bc0z9IAi.mjs +0 -571
- package/dist/Capture-Bc0z9IAi.mjs.map +0 -1
- package/dist/Capture-BvWI-l1A.d.mts +0 -168
- package/dist/Capture.d.mts +0 -2
- package/dist/Capture.mjs +0 -2
- package/dist/Client-D1_xYM9o.mjs.map +0 -1
- package/dist/ContextWriter-BrQmoXRg.mjs.map +0 -1
- package/dist/Extensions-ClZbYb1H.mjs.map +0 -1
- package/dist/Images-DgscEfSf.mjs +0 -127
- package/dist/Images-DgscEfSf.mjs.map +0 -1
- package/dist/Launch-BHcAEq05.mjs.map +0 -1
- package/dist/Launch-C8CfaYxb.d.mts +0 -132
- package/dist/LocalBrowser-BLancJ3R.d.mts +0 -79
- package/dist/LocalBrowser-DsQLWNL1.mjs +0 -439
- package/dist/LocalBrowser-DsQLWNL1.mjs.map +0 -1
- package/dist/LocalBrowser.d.mts +0 -2
- package/dist/LocalBrowser.mjs +0 -2
- package/dist/PageControl.d.mts +0 -16
- package/dist/PageControl.mjs +0 -36
- package/dist/PageControl.mjs.map +0 -1
- package/dist/PageControlAssociation-DabEg5AR.mjs +0 -10
- package/dist/PageControlAssociation-DabEg5AR.mjs.map +0 -1
- package/dist/Session-D4nT9hOO.mjs +0 -1379
- package/dist/Session-D4nT9hOO.mjs.map +0 -1
- package/dist/Sessions-CtbseWEh.mjs.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
1
|
import { ExtensionReference, Identifier } from "./References.mjs";
|
|
3
2
|
import { ExtensionError } from "./Errors.mjs";
|
|
4
3
|
import { SafeFilename } from "./Transfers.mjs";
|
|
5
|
-
import { t as BrowserbaseClient } from "./Client-
|
|
4
|
+
import { t as BrowserbaseClient } from "./Client-4RMKIpL2.mjs";
|
|
6
5
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
7
6
|
//#region src/internal/extension/Archive.ts
|
|
8
7
|
const MAX_ENTRIES = 4096;
|
|
@@ -97,11 +96,6 @@ const inspectExtensionArchive = (archive) => {
|
|
|
97
96
|
};
|
|
98
97
|
//#endregion
|
|
99
98
|
//#region src/Extensions.ts
|
|
100
|
-
var Extensions_exports = /* @__PURE__ */ __exportAll({
|
|
101
|
-
BrowserbaseExtensions: () => BrowserbaseExtensions,
|
|
102
|
-
ExtensionMetadata: () => ExtensionMetadata,
|
|
103
|
-
ExtensionRegistration: () => ExtensionRegistration
|
|
104
|
-
});
|
|
105
99
|
const Timestamp = Schema.String.check(Schema.isMaxLength(64));
|
|
106
100
|
/** The provider documents a 100 MB archive; a caller may request less, never more. */
|
|
107
101
|
const MAX_ARCHIVE_BYTES = 104857600;
|
|
@@ -232,6 +226,6 @@ var BrowserbaseExtensions = class BrowserbaseExtensions extends Context.Service(
|
|
|
232
226
|
}));
|
|
233
227
|
};
|
|
234
228
|
//#endregion
|
|
235
|
-
export {
|
|
229
|
+
export { ExtensionMetadata as n, ExtensionRegistration as r, BrowserbaseExtensions as t };
|
|
236
230
|
|
|
237
|
-
//# sourceMappingURL=Extensions-
|
|
231
|
+
//# sourceMappingURL=Extensions-Dg3jHOf0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extensions-Dg3jHOf0.mjs","names":[],"sources":["../src/internal/extension/Archive.ts","../src/Extensions.ts"],"sourcesContent":["/**\n * A bounded, allocation-free inspection of an extension ZIP: enough to prove a root\n * `manifest.json` and reject traversal before an upload, never an extractor. No entry is\n * decompressed and no path is written; the provider remains the loader of record.\n */\nexport interface ArchiveFacts {\n readonly entries: number;\n /** Uncompressed size the central directory itself declares, not a measured expansion. */\n readonly declaredBytes: number;\n}\n\nexport type ArchiveRejection =\n | \"signature\"\n | \"malformed\"\n | \"unsupported\"\n | \"name\"\n | \"manifest\"\n | \"limit\";\n\nexport type ArchiveResult =\n | { readonly _tag: \"Accepted\"; readonly facts: ArchiveFacts }\n | { readonly _tag: \"Rejected\"; readonly reason: ArchiveRejection };\n\nconst MAX_ENTRIES = 4096;\nconst MAX_NAME_BYTES = 512;\nconst MAX_DECLARED_BYTES = 512 * 1024 * 1024;\nconst EOCD_SIZE = 22;\nconst LOCAL_HEADER_SIZE = 30;\nconst STORED = 0;\nconst DEFLATED = 8;\n\nconst LOCAL_HEADER = 0x04034b50;\nconst CENTRAL_HEADER = 0x02014b50;\nconst END_OF_CENTRAL_DIRECTORY = 0x06054b50;\n\nconst rejected = (reason: ArchiveRejection): ArchiveResult => ({ _tag: \"Rejected\", reason });\n\nconst control = (name: string): boolean =>\n [...name].some((character) => character < \" \" || character === \"\\x7f\");\n\n/** Any `..` or rooted member would name a file outside the extension directory. */\nconst unsafeName = (name: string): boolean =>\n name.length === 0 ||\n name.startsWith(\"/\") ||\n name.includes(\"\\\\\") ||\n name.includes(\"//\") ||\n /^[A-Za-z]:/.test(name) ||\n control(name) ||\n name.split(\"/\").some((segment) => segment === \".\" || segment === \"..\");\n\nexport const inspectExtensionArchive = (archive: Uint8Array): ArchiveResult => {\n if (archive.byteLength < EOCD_SIZE) return rejected(\"malformed\");\n const view = new DataView(archive.buffer, archive.byteOffset, archive.byteLength);\n const u16 = (offset: number) => view.getUint16(offset, true);\n const u32 = (offset: number) => view.getUint32(offset, true);\n\n if (u32(0) !== LOCAL_HEADER) return rejected(\"signature\");\n\n // The comment is bounded by its own 16-bit length, so the record cannot hide further back.\n const earliest = Math.max(0, archive.byteLength - EOCD_SIZE - 0xffff);\n let end = -1;\n\n for (let offset = archive.byteLength - EOCD_SIZE; offset >= earliest; offset--) {\n if (u32(offset) === END_OF_CENTRAL_DIRECTORY) {\n end = offset;\n break;\n }\n }\n if (end < 0) return rejected(\"malformed\");\n\n const entries = u16(end + 10);\n const directorySize = u32(end + 12);\n const directoryOffset = u32(end + 16);\n const commentLength = u16(end + 20);\n\n if (u16(end + 4) !== 0 || u16(end + 6) !== 0 || u16(end + 8) !== entries)\n return rejected(\"unsupported\");\n if (entries === 0xffff || directorySize === 0xffffffff || directoryOffset === 0xffffffff)\n return rejected(\"unsupported\");\n if (end + EOCD_SIZE + commentLength !== archive.byteLength) return rejected(\"malformed\");\n if (directoryOffset + directorySize > end) return rejected(\"malformed\");\n if (entries > MAX_ENTRIES) return rejected(\"limit\");\n\n const names = new TextDecoder(\"utf-8\", { fatal: true });\n const limit = directoryOffset + directorySize;\n let offset = directoryOffset;\n let declaredBytes = 0;\n let manifest = false;\n\n for (let index = 0; index < entries; index++) {\n if (offset + 46 > limit || u32(offset) !== CENTRAL_HEADER) return rejected(\"malformed\");\n const flags = u16(offset + 8);\n const method = u16(offset + 10);\n const compressed = u32(offset + 20);\n const declared = u32(offset + 24);\n const nameLength = u16(offset + 28);\n const extraLength = u16(offset + 30);\n const entryCommentLength = u16(offset + 32);\n const localOffset = u32(offset + 42);\n\n if (declared === 0xffffffff || compressed === 0xffffffff || localOffset === 0xffffffff)\n return rejected(\"unsupported\");\n // An encrypted or unusually compressed member is not something a browser will load.\n if ((flags & 1) !== 0 || (method !== STORED && method !== DEFLATED))\n return rejected(\"unsupported\");\n if (nameLength === 0 || nameLength > MAX_NAME_BYTES) return rejected(\"name\");\n if (offset + 46 + nameLength + extraLength + entryCommentLength > limit)\n return rejected(\"malformed\");\n if (localOffset >= directoryOffset) return rejected(\"malformed\");\n\n let name: string;\n\n try {\n name = names.decode(archive.subarray(offset + 46, offset + 46 + nameLength));\n } catch {\n return rejected(\"name\");\n }\n if (unsafeName(name)) return rejected(\"name\");\n\n // The directory must agree with the local header it points at: a member that describes\n // itself differently in two places has no single meaning worth uploading.\n if (localOffset + LOCAL_HEADER_SIZE > directoryOffset || u32(localOffset) !== LOCAL_HEADER)\n return rejected(\"malformed\");\n const localNameLength = u16(localOffset + 26);\n const localStart = localOffset + LOCAL_HEADER_SIZE;\n\n if (\n (u16(localOffset + 6) & 1) !== 0 ||\n u16(localOffset + 8) !== method ||\n localNameLength !== nameLength ||\n localStart + localNameLength + u16(localOffset + 28) + compressed > directoryOffset\n )\n return rejected(\"malformed\");\n\n try {\n if (names.decode(archive.subarray(localStart, localStart + localNameLength)) !== name)\n return rejected(\"malformed\");\n } catch {\n return rejected(\"name\");\n }\n if (name === \"manifest.json\") manifest = true;\n declaredBytes += declared;\n if (declaredBytes > MAX_DECLARED_BYTES) return rejected(\"limit\");\n offset += 46 + nameLength + extraLength + entryCommentLength;\n }\n if (offset !== limit) return rejected(\"malformed\");\n if (!manifest) return rejected(\"manifest\");\n\n return { _tag: \"Accepted\", facts: { entries, declaredBytes } };\n};\n","import { Context, Effect, Layer, Schema } from \"effect\";\n\nimport { BrowserbaseClient } from \"./Client.ts\";\nimport { type ClientError, ExtensionError } from \"./Errors.ts\";\nimport { inspectExtensionArchive } from \"./internal/extension/Archive.ts\";\nimport { ExtensionReference, Identifier } from \"./References.ts\";\nimport { SafeFilename } from \"./Transfers.ts\";\n\nconst Timestamp = Schema.String.check(Schema.isMaxLength(64));\n\n/** The provider documents a 100 MB archive; a caller may request less, never more. */\nconst MAX_ARCHIVE_BYTES = 100 * 1024 * 1024;\n\nconst ProviderExtension = Schema.Struct({\n id: Identifier,\n projectId: Identifier,\n fileName: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(1024))),\n createdAt: Schema.optionalKey(Timestamp),\n updatedAt: Schema.optionalKey(Timestamp),\n});\n\n/** Only fields the provider actually returned are reported; absence is never invented. */\nexport class ExtensionMetadata extends Schema.Class<ExtensionMetadata>(\n \"BrowserbaseExtensionMetadata\",\n)({\n reference: ExtensionReference,\n fileName: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(1024))),\n createdAt: Schema.optionalKey(Timestamp),\n updatedAt: Schema.optionalKey(Timestamp),\n}) {}\n\n/** Registration evidence is what this package inspected, not a provider load receipt. */\nexport class ExtensionRegistration extends Schema.Class<ExtensionRegistration>(\n \"BrowserbaseExtensionRegistration\",\n)({\n reference: ExtensionReference,\n archiveBytes: Schema.Natural,\n entries: Schema.Natural,\n declaredBytes: Schema.Natural,\n}) {}\n\nexport interface ExtensionUploadOptions {\n /** Portable basename sent with the part; defaults to `extension.zip`. */\n readonly filename?: string;\n readonly maxBytes?: number;\n readonly timeoutMillis?: number;\n}\n\nconst Upload = Schema.Struct({\n filename: Schema.optionalKey(\n SafeFilename.check(Schema.makeFilter((value) => value.toLowerCase().endsWith(\".zip\"))),\n ),\n maxBytes: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: MAX_ARCHIVE_BYTES })),\n ),\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600_000 })),\n ),\n});\n\nconst fromClient = (operation: ExtensionError[\"operation\"], error: ClientError): ExtensionError =>\n ExtensionError.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 configuration = (operation: ExtensionError[\"operation\"]) =>\n ExtensionError.make({ operation, reason: \"configuration\", outcome: \"undispatched\" });\n\nconst malformed = (operation: ExtensionError[\"operation\"], mutation = false) =>\n ExtensionError.make({\n operation,\n reason: \"malformed\",\n ...(mutation ? { outcome: \"unknown\" as const } : {}),\n });\n\n/**\n * A provisioned extension is a durable project resource selected at launch, never uploaded\n * again on connect. The archive is inspected before transport; loading remains the provider's.\n */\nexport class BrowserbaseExtensions extends Context.Service<\n BrowserbaseExtensions,\n {\n readonly register: (\n archive: Uint8Array,\n options?: ExtensionUploadOptions,\n ) => Effect.Effect<ExtensionRegistration, ExtensionError>;\n readonly retrieve: (\n reference: ExtensionReference,\n ) => Effect.Effect<ExtensionMetadata, ExtensionError>;\n readonly delete: (reference: ExtensionReference) => Effect.Effect<void, ExtensionError>;\n }\n>()(\"effect-browserbase/Extensions\") {\n static readonly layer: Layer.Layer<BrowserbaseExtensions, never, BrowserbaseClient> =\n Layer.effect(\n BrowserbaseExtensions,\n Effect.gen(function* () {\n const client = yield* BrowserbaseClient;\n\n const validate = Effect.fnUntraced(function* (\n reference: ExtensionReference,\n operation: ExtensionError[\"operation\"],\n ) {\n const ref = yield* Schema.decodeEffect(ExtensionReference)(reference, {\n onExcessProperty: \"error\",\n }).pipe(Effect.mapError(() => configuration(operation)));\n\n if (ref.projectId !== client.projectId)\n return yield* ExtensionError.make({\n operation,\n reason: \"authorization\",\n outcome: \"undispatched\",\n });\n\n return ref;\n });\n\n const register = Effect.fn(\"BrowserbaseExtensions.register\")(function* (\n archive: Uint8Array,\n options: ExtensionUploadOptions = {},\n ) {\n const value = yield* Schema.decodeEffect(Upload)(options, {\n onExcessProperty: \"error\",\n }).pipe(Effect.mapError(() => configuration(\"extension-register\")));\n\n if (!(archive instanceof Uint8Array)) return yield* configuration(\"extension-register\");\n const maxBytes = value.maxBytes ?? MAX_ARCHIVE_BYTES;\n\n if (archive.byteLength < 1 || archive.byteLength > maxBytes)\n return yield* ExtensionError.make({\n operation: \"extension-archive\",\n reason: \"limit\",\n outcome: \"undispatched\",\n });\n\n // Inspect and send the same immutable bytes: a caller cannot swap the\n // archive between its manifest check and the multipart encoding.\n const owned = new Uint8Array(archive);\n const inspected = inspectExtensionArchive(owned);\n\n if (inspected._tag === \"Rejected\") {\n return yield* ExtensionError.make({\n operation: \"extension-archive\",\n reason:\n inspected.reason === \"limit\"\n ? \"limit\"\n : inspected.reason === \"name\"\n ? \"unsafe-filename\"\n : \"configuration\",\n outcome: \"undispatched\",\n });\n }\n\n const raw = yield* client\n .upload(\n \"/v1/extensions\",\n {\n field: \"file\",\n filename: value.filename ?? \"extension.zip\",\n mediaType: \"application/zip\",\n bytes: owned,\n },\n {\n maxBytes,\n ...(value.timeoutMillis === undefined\n ? {}\n : { timeoutMillis: value.timeoutMillis }),\n },\n )\n .pipe(Effect.mapError((error) => fromClient(\"extension-register\", error)));\n\n const created = yield* Schema.decodeUnknownEffect(ProviderExtension)(raw).pipe(\n Effect.mapError(() => malformed(\"extension-register\", true)),\n );\n\n if (created.projectId !== client.projectId)\n return yield* malformed(\"extension-register\", true);\n\n return ExtensionRegistration.make({\n reference: ExtensionReference.make({\n provider: \"browserbase\",\n projectId: client.projectId,\n extensionId: created.id,\n }),\n archiveBytes: owned.byteLength,\n entries: inspected.facts.entries,\n declaredBytes: inspected.facts.declaredBytes,\n });\n });\n\n const retrieve = Effect.fn(\"BrowserbaseExtensions.retrieve\")(function* (\n reference: ExtensionReference,\n ) {\n const ref = yield* validate(reference, \"extension-retrieve\");\n\n const raw = yield* client\n .json(\"GET\", `/v1/extensions/${encodeURIComponent(ref.extensionId)}`)\n .pipe(Effect.mapError((error) => fromClient(\"extension-retrieve\", error)));\n\n const value = yield* Schema.decodeUnknownEffect(ProviderExtension)(raw).pipe(\n Effect.mapError(() => malformed(\"extension-retrieve\")),\n );\n\n if (value.id !== ref.extensionId || value.projectId !== ref.projectId)\n return yield* malformed(\"extension-retrieve\");\n\n return ExtensionMetadata.make({\n reference: ref,\n ...(value.fileName === undefined ? {} : { fileName: value.fileName }),\n ...(value.createdAt === undefined ? {} : { createdAt: value.createdAt }),\n ...(value.updatedAt === undefined ? {} : { updatedAt: value.updatedAt }),\n });\n });\n\n const remove = Effect.fn(\"BrowserbaseExtensions.delete\")(function* (\n reference: ExtensionReference,\n ) {\n const ref = yield* validate(reference, \"extension-delete\");\n\n yield* client\n .noContent(\"DELETE\", `/v1/extensions/${encodeURIComponent(ref.extensionId)}`)\n .pipe(Effect.mapError((error) => fromClient(\"extension-delete\", error)));\n });\n\n return BrowserbaseExtensions.of({ register, retrieve, delete: remove });\n }),\n );\n}\n"],"mappings":";;;;;;AAuBA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAC3B,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,SAAS;AACf,MAAM,WAAW;AAEjB,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,2BAA2B;AAEjC,MAAM,YAAY,YAA6C;CAAE,MAAM;CAAY;AAAO;AAE1F,MAAM,WAAW,SACf,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,cAAc,YAAY,OAAO,cAAc,GAAM;;AAGvE,MAAM,cAAc,SAClB,KAAK,WAAW,KAChB,KAAK,WAAW,GAAG,KACnB,KAAK,SAAS,IAAI,KAClB,KAAK,SAAS,IAAI,KAClB,aAAa,KAAK,IAAI,KACtB,QAAQ,IAAI,KACZ,KAAK,MAAM,GAAG,CAAC,CAAC,MAAM,YAAY,YAAY,OAAO,YAAY,IAAI;AAEvE,MAAa,2BAA2B,YAAuC;CAC7E,IAAI,QAAQ,aAAa,WAAW,OAAO,SAAS,WAAW;CAC/D,MAAM,OAAO,IAAI,SAAS,QAAQ,QAAQ,QAAQ,YAAY,QAAQ,UAAU;CAChF,MAAM,OAAO,WAAmB,KAAK,UAAU,QAAQ,IAAI;CAC3D,MAAM,OAAO,WAAmB,KAAK,UAAU,QAAQ,IAAI;CAE3D,IAAI,IAAI,CAAC,MAAM,cAAc,OAAO,SAAS,WAAW;CAGxD,MAAM,WAAW,KAAK,IAAI,GAAG,QAAQ,aAAa,YAAY,KAAM;CACpE,IAAI,MAAM;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AO,eAAe,UAAU,oBAAoB,CAAC,CACvD;GAEA,IAAI,MAAM,OAAO,IAAI,eAAe,MAAM,cAAc,IAAI,WAC1D,OAAO,OAAO,UAAU,oBAAoB;GAE9C,OAAO,kBAAkB,KAAK;IAC5B,WAAW;IACX,GAAI,MAAM,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,MAAM,SAAS;IACnE,GAAI,MAAM,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,WAAW,MAAM,UAAU;IACtE,GAAI,MAAM,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,WAAW,MAAM,UAAU;GACxE,CAAC;EACH,CAAC;EAED,MAAM,SAAS,OAAO,GAAG,8BAA8B,CAAC,CAAC,WACvD,WACA;GACA,MAAM,MAAM,OAAO,SAAS,WAAW,kBAAkB;GAEzD,OAAO,OACJ,UAAU,UAAU,kBAAkB,mBAAmB,IAAI,WAAW,GAAG,CAAC,CAC5E,KAAK,OAAO,UAAU,UAAU,WAAW,oBAAoB,KAAK,CAAC,CAAC;EAC3E,CAAC;EAED,OAAO,sBAAsB,GAAG;GAAE;GAAU;GAAU,QAAQ;EAAO,CAAC;CACxE,CAAC,CACH;AACJ"}
|
package/dist/Extensions.d.mts
CHANGED
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
-
declare namespace Extensions_d_exports {
|
|
6
|
-
export { BrowserbaseExtensions, ExtensionMetadata, ExtensionRegistration, ExtensionUploadOptions };
|
|
7
|
-
}
|
|
8
|
-
declare const ExtensionMetadata_base: Schema.Class<ExtensionMetadata, Schema.Struct<{
|
|
9
|
-
readonly reference: typeof ExtensionReference;
|
|
10
|
-
readonly fileName: Schema.optionalKey<Schema.String>;
|
|
11
|
-
readonly createdAt: Schema.optionalKey<Schema.String>;
|
|
12
|
-
readonly updatedAt: Schema.optionalKey<Schema.String>;
|
|
13
|
-
}>, {}>;
|
|
14
|
-
/** Only fields the provider actually returned are reported; absence is never invented. */
|
|
15
|
-
export declare class ExtensionMetadata extends ExtensionMetadata_base {}
|
|
16
|
-
declare const ExtensionRegistration_base: Schema.Class<ExtensionRegistration, Schema.Struct<{
|
|
17
|
-
readonly reference: typeof ExtensionReference;
|
|
18
|
-
readonly archiveBytes: Schema.Natural;
|
|
19
|
-
readonly entries: Schema.Natural;
|
|
20
|
-
readonly declaredBytes: Schema.Natural;
|
|
21
|
-
}>, {}>;
|
|
22
|
-
/** Registration evidence is what this package inspected, not a provider load receipt. */
|
|
23
|
-
export declare class ExtensionRegistration extends ExtensionRegistration_base {}
|
|
24
|
-
export interface ExtensionUploadOptions {
|
|
25
|
-
/** Portable basename sent with the part; defaults to `extension.zip`. */
|
|
26
|
-
readonly filename?: string;
|
|
27
|
-
readonly maxBytes?: number;
|
|
28
|
-
readonly timeoutMillis?: number;
|
|
29
|
-
}
|
|
30
|
-
declare const BrowserbaseExtensions_base: Context.ServiceClass<BrowserbaseExtensions, "effect-browserbase/Extensions", {
|
|
31
|
-
readonly register: (archive: Uint8Array, options?: ExtensionUploadOptions) => Effect.Effect<ExtensionRegistration, ExtensionError>;
|
|
32
|
-
readonly retrieve: (reference: ExtensionReference) => Effect.Effect<ExtensionMetadata, ExtensionError>;
|
|
33
|
-
readonly delete: (reference: ExtensionReference) => Effect.Effect<void, ExtensionError>;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* A provisioned extension is a durable project resource selected at launch, never uploaded
|
|
37
|
-
* again on connect. The archive is inspected before transport; loading remains the provider's.
|
|
38
|
-
*/
|
|
39
|
-
export declare class BrowserbaseExtensions extends BrowserbaseExtensions_base {
|
|
40
|
-
static readonly layer: Layer.Layer<BrowserbaseExtensions, never, BrowserbaseClient>;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { Extensions_d_exports as t };
|
|
44
|
-
//# sourceMappingURL=Extensions.d.mts.map
|
|
1
|
+
import { i as ExtensionUploadOptions, n as ExtensionMetadata, r as ExtensionRegistration, t as BrowserbaseExtensions } from "./Extensions-DBXuVM1f.mjs";
|
|
2
|
+
export { BrowserbaseExtensions, ExtensionMetadata, ExtensionRegistration, ExtensionUploadOptions };
|
|
3
|
+
export {};
|
package/dist/Extensions.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ExtensionMetadata, r as ExtensionRegistration, t as BrowserbaseExtensions } from "./Extensions-
|
|
1
|
+
import { n as ExtensionMetadata, r as ExtensionRegistration, t as BrowserbaseExtensions } from "./Extensions-Dg3jHOf0.mjs";
|
|
2
2
|
export { BrowserbaseExtensions, ExtensionMetadata, ExtensionRegistration };
|
|
@@ -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
|
package/dist/Functions.d.mts
CHANGED
|
@@ -1,227 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
-
declare namespace Functions_d_exports {
|
|
6
|
-
export { BrowserbaseFunctions, FunctionBuild, FunctionInvocation, FunctionInvokeRequest, FunctionLogLine, FunctionMetadata, FunctionPageQuery, FunctionSessionParams, FunctionStatus, FunctionStatusQuery, FunctionVersion, FunctionWaitOptions, OffsetPage };
|
|
7
|
-
}
|
|
8
|
-
declare const Status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
|
|
9
|
-
export type FunctionStatus = typeof Status.Type;
|
|
10
|
-
declare const FunctionMetadata_base: Schema.Class<FunctionMetadata, Schema.Struct<{
|
|
11
|
-
readonly id: Schema.NonEmptyString;
|
|
12
|
-
readonly projectId: Schema.NonEmptyString;
|
|
13
|
-
readonly name: Schema.String;
|
|
14
|
-
readonly createdAt: Schema.String;
|
|
15
|
-
readonly updatedAt: Schema.String;
|
|
16
|
-
}>, {}>;
|
|
17
|
-
export declare class FunctionMetadata extends FunctionMetadata_base {}
|
|
18
|
-
declare const FunctionVersion_base: Schema.Class<FunctionVersion, Schema.Struct<{
|
|
19
|
-
readonly id: Schema.NonEmptyString;
|
|
20
|
-
readonly projectId: Schema.NonEmptyString;
|
|
21
|
-
readonly functionId: Schema.NonEmptyString;
|
|
22
|
-
readonly functionBuildId: Schema.NonEmptyString;
|
|
23
|
-
readonly sessionCreateParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
24
|
-
readonly userParamsSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
25
|
-
readonly createdAt: Schema.String;
|
|
26
|
-
readonly updatedAt: Schema.String;
|
|
27
|
-
}>, {}>;
|
|
28
|
-
export declare class FunctionVersion extends FunctionVersion_base {}
|
|
29
|
-
declare const FunctionBuild_base: Schema.Class<FunctionBuild, Schema.Struct<{
|
|
30
|
-
readonly id: Schema.NonEmptyString;
|
|
31
|
-
readonly projectId: Schema.NonEmptyString;
|
|
32
|
-
readonly request: Schema.Struct<{
|
|
33
|
-
readonly entrypoint: Schema.String;
|
|
34
|
-
readonly functionNames: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
35
|
-
}>;
|
|
36
|
-
readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
|
|
37
|
-
readonly createdAt: Schema.String;
|
|
38
|
-
readonly updatedAt: Schema.String;
|
|
39
|
-
readonly startedAt: Schema.String;
|
|
40
|
-
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
41
|
-
readonly expiresAt: Schema.String;
|
|
42
|
-
readonly cause: Schema.optionalKey<Schema.Struct<{
|
|
43
|
-
readonly code: Schema.String;
|
|
44
|
-
readonly message: Schema.optionalKey<Schema.String>;
|
|
45
|
-
}>>;
|
|
46
|
-
}>, {}>;
|
|
47
|
-
export declare class FunctionBuild extends FunctionBuild_base {}
|
|
48
|
-
declare const FunctionInvocation_base: Schema.Class<FunctionInvocation, Schema.Struct<{
|
|
49
|
-
readonly id: Schema.NonEmptyString;
|
|
50
|
-
readonly projectId: Schema.NonEmptyString;
|
|
51
|
-
readonly functionId: Schema.NonEmptyString;
|
|
52
|
-
readonly versionId: Schema.NonEmptyString;
|
|
53
|
-
readonly sessionId: Schema.NonEmptyString;
|
|
54
|
-
readonly region: Schema.optionalKey<Schema.String>;
|
|
55
|
-
readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
56
|
-
readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>;
|
|
57
|
-
readonly results: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
58
|
-
readonly cause: Schema.optionalKey<Schema.Struct<{
|
|
59
|
-
readonly code: Schema.String;
|
|
60
|
-
readonly message: Schema.optionalKey<Schema.String>;
|
|
61
|
-
}>>;
|
|
62
|
-
readonly createdAt: Schema.String;
|
|
63
|
-
readonly updatedAt: Schema.String;
|
|
64
|
-
readonly startedAt: Schema.String;
|
|
65
|
-
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
66
|
-
readonly expiresAt: Schema.String;
|
|
67
|
-
}>, {}>;
|
|
68
|
-
export declare class FunctionInvocation extends FunctionInvocation_base {}
|
|
69
|
-
declare const FunctionLogLine_base: Schema.Class<FunctionLogLine, Schema.Struct<{
|
|
70
|
-
readonly message: Schema.String;
|
|
71
|
-
readonly timestamp: Schema.Finite;
|
|
72
|
-
}>, {}>;
|
|
73
|
-
export declare class FunctionLogLine extends FunctionLogLine_base {}
|
|
74
|
-
/** The session a Function invocation runs in; the provider's invoke-time subset. */
|
|
75
|
-
export declare const FunctionSessionParams: Schema.Struct<{
|
|
76
|
-
/** Seconds, 60–900; the provider defaults to 900. */
|
|
77
|
-
readonly timeout: Schema.optionalKey<Schema.Int>;
|
|
78
|
-
readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
79
|
-
readonly context: Schema.optionalKey<Schema.Struct<{
|
|
80
|
-
readonly reference: typeof ContextReference;
|
|
81
|
-
readonly persist: Schema.Boolean;
|
|
82
|
-
}>>;
|
|
83
|
-
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
84
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
85
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
86
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
87
|
-
readonly country: Schema.String;
|
|
88
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
89
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
90
|
-
}>>;
|
|
91
|
-
}>, Schema.Struct<{
|
|
92
|
-
readonly type: Schema.Literal<"external">;
|
|
93
|
-
readonly server: Schema.NonEmptyString;
|
|
94
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
95
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
96
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
97
|
-
}>, Schema.Struct<{
|
|
98
|
-
readonly type: Schema.Literal<"none">;
|
|
99
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
100
|
-
}>]>>]>>;
|
|
101
|
-
readonly proxySettings: Schema.optionalKey<Schema.Struct<{
|
|
102
|
-
readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
103
|
-
}>>;
|
|
104
|
-
readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
105
|
-
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
106
|
-
readonly viewport: Schema.optionalKey<Schema.Struct<{
|
|
107
|
-
readonly width: Schema.optionalKey<Schema.Int>;
|
|
108
|
-
readonly height: Schema.optionalKey<Schema.Int>;
|
|
109
|
-
}>>;
|
|
110
|
-
readonly blockAds: Schema.optionalKey<Schema.Boolean>;
|
|
111
|
-
readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
|
|
112
|
-
readonly recordSession: Schema.optionalKey<Schema.Boolean>;
|
|
113
|
-
readonly logSession: Schema.optionalKey<Schema.Boolean>;
|
|
114
|
-
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
115
|
-
readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
116
|
-
readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
117
|
-
readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
|
|
118
|
-
readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
|
|
119
|
-
readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
|
|
120
|
-
readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
|
|
121
|
-
readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
|
|
122
|
-
readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
123
|
-
readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
|
|
124
|
-
}>>;
|
|
125
|
-
}>;
|
|
126
|
-
export type FunctionSessionParams = typeof FunctionSessionParams.Type;
|
|
127
|
-
export declare const FunctionInvokeRequest: Schema.Struct<{
|
|
128
|
-
readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
129
|
-
readonly session: Schema.optionalKey<Schema.Struct<{
|
|
130
|
-
/** Seconds, 60–900; the provider defaults to 900. */
|
|
131
|
-
readonly timeout: Schema.optionalKey<Schema.Int>;
|
|
132
|
-
readonly extensionId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
133
|
-
readonly context: Schema.optionalKey<Schema.Struct<{
|
|
134
|
-
readonly reference: typeof ContextReference;
|
|
135
|
-
readonly persist: Schema.Boolean;
|
|
136
|
-
}>>;
|
|
137
|
-
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
138
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
139
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
140
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
141
|
-
readonly country: Schema.String;
|
|
142
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
143
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
144
|
-
}>>;
|
|
145
|
-
}>, Schema.Struct<{
|
|
146
|
-
readonly type: Schema.Literal<"external">;
|
|
147
|
-
readonly server: Schema.NonEmptyString;
|
|
148
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
149
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
150
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
151
|
-
}>, Schema.Struct<{
|
|
152
|
-
readonly type: Schema.Literal<"none">;
|
|
153
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
154
|
-
}>]>>]>>;
|
|
155
|
-
readonly proxySettings: Schema.optionalKey<Schema.Struct<{
|
|
156
|
-
readonly caCertificates: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
157
|
-
}>>;
|
|
158
|
-
readonly userMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
159
|
-
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
160
|
-
readonly viewport: Schema.optionalKey<Schema.Struct<{
|
|
161
|
-
readonly width: Schema.optionalKey<Schema.Int>;
|
|
162
|
-
readonly height: Schema.optionalKey<Schema.Int>;
|
|
163
|
-
}>>;
|
|
164
|
-
readonly blockAds: Schema.optionalKey<Schema.Boolean>;
|
|
165
|
-
readonly solveCaptchas: Schema.optionalKey<Schema.Boolean>;
|
|
166
|
-
readonly recordSession: Schema.optionalKey<Schema.Boolean>;
|
|
167
|
-
readonly logSession: Schema.optionalKey<Schema.Boolean>;
|
|
168
|
-
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
169
|
-
readonly captchaImageSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
170
|
-
readonly captchaInputSelector: Schema.optionalKey<Schema.NonEmptyString>;
|
|
171
|
-
readonly os: Schema.optionalKey<Schema.Literals<readonly ["windows", "mac", "linux", "mobile", "tablet"]>>;
|
|
172
|
-
readonly size: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
|
|
173
|
-
readonly enableNativeSelectPolyfill: Schema.optionalKey<Schema.Boolean>;
|
|
174
|
-
readonly enablePdfViewer: Schema.optionalKey<Schema.Boolean>;
|
|
175
|
-
readonly extensions: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["onepassword", "browser-events"]>>>;
|
|
176
|
-
readonly allowedDomains: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
177
|
-
readonly ignoreCertificateErrors: Schema.optionalKey<Schema.Boolean>;
|
|
178
|
-
}>>;
|
|
179
|
-
}>>;
|
|
180
|
-
}>;
|
|
181
|
-
export type FunctionInvokeRequest = typeof FunctionInvokeRequest.Type;
|
|
182
|
-
export declare const FunctionPageQuery: Schema.Struct<{
|
|
183
|
-
offset: Schema.optionalKey<Schema.Int>;
|
|
184
|
-
limit: Schema.optionalKey<Schema.Int>;
|
|
185
|
-
}>;
|
|
186
|
-
export type FunctionPageQuery = typeof FunctionPageQuery.Type;
|
|
187
|
-
export declare const FunctionStatusQuery: Schema.Struct<{
|
|
188
|
-
readonly offset: Schema.optionalKey<Schema.Int>;
|
|
189
|
-
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
190
|
-
readonly status: Schema.optionalKey<Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED"]>>;
|
|
191
|
-
}>;
|
|
192
|
-
export type FunctionStatusQuery = typeof FunctionStatusQuery.Type;
|
|
193
|
-
export declare const FunctionWaitOptions: Schema.Struct<{
|
|
194
|
-
readonly timeoutMillis: Schema.Int;
|
|
195
|
-
readonly pollIntervalMillis: Schema.optionalKey<Schema.Int>;
|
|
196
|
-
}>;
|
|
197
|
-
export type FunctionWaitOptions = typeof FunctionWaitOptions.Type;
|
|
198
|
-
export interface OffsetPage<A> {
|
|
199
|
-
readonly items: ReadonlyArray<A>;
|
|
200
|
-
readonly total: number;
|
|
201
|
-
}
|
|
202
|
-
declare const BrowserbaseFunctions_base: Context.ServiceClass<BrowserbaseFunctions, "effect-browserbase/Functions", {
|
|
203
|
-
readonly list: (query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionMetadata>, PlatformError>;
|
|
204
|
-
readonly retrieve: (functionId: string) => Effect.Effect<FunctionMetadata, PlatformError>;
|
|
205
|
-
readonly invoke: (functionId: string, request?: FunctionInvokeRequest) => Effect.Effect<FunctionInvocation, PlatformError>;
|
|
206
|
-
readonly versions: (functionId: string, query?: FunctionPageQuery) => Effect.Effect<OffsetPage<FunctionVersion>, PlatformError>;
|
|
207
|
-
readonly version: (versionId: string) => Effect.Effect<FunctionVersion, PlatformError>;
|
|
208
|
-
readonly invocations: (versionId: string, query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionInvocation>, PlatformError>;
|
|
209
|
-
readonly invocation: (invocationId: string) => Effect.Effect<FunctionInvocation, PlatformError>;
|
|
210
|
-
readonly invocationLogs: (invocationId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
|
|
211
|
-
readonly builds: (query?: FunctionStatusQuery) => Effect.Effect<OffsetPage<FunctionBuild>, PlatformError>;
|
|
212
|
-
readonly build: (buildId: string) => Effect.Effect<FunctionBuild, PlatformError>;
|
|
213
|
-
readonly buildLogs: (buildId: string) => Effect.Effect<OffsetPage<FunctionLogLine>, PlatformError>;
|
|
214
|
-
/** Polls until the invocation is terminal. Interrupting the wait does not cancel it. */
|
|
215
|
-
readonly waitForInvocation: (invocationId: string, options: FunctionWaitOptions) => Effect.Effect<FunctionInvocation, PlatformError>;
|
|
216
|
-
}>;
|
|
217
|
-
/**
|
|
218
|
-
* Browserbase Functions: deployed code invoked in a provider-allocated session. Deployment
|
|
219
|
-
* happens through Browserbase's CLI; this service reads, invokes and observes. `invoke` is
|
|
220
|
-
* never retried, and a lost reply is `outcome: "unknown"`.
|
|
221
|
-
*/
|
|
222
|
-
export declare class BrowserbaseFunctions extends BrowserbaseFunctions_base {
|
|
223
|
-
static readonly layer: Layer.Layer<BrowserbaseFunctions, never, BrowserbaseClient>;
|
|
224
|
-
}
|
|
225
|
-
//#endregion
|
|
226
|
-
export { Functions_d_exports as t };
|
|
227
|
-
//# 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 {};
|
package/dist/Functions.mjs
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
1
|
import { ContextReference, Identifier } from "./References.mjs";
|
|
3
2
|
import { PlatformError } from "./Errors.mjs";
|
|
4
|
-
import { t as BrowserbaseClient } from "./Client-
|
|
3
|
+
import { t as BrowserbaseClient } from "./Client-4RMKIpL2.mjs";
|
|
5
4
|
import { t as resource } from "./Resource-DBksC4zB.mjs";
|
|
6
5
|
import { ProxyRule } from "./Launch.mjs";
|
|
7
|
-
import { n as proxy } from "./Launch-
|
|
8
|
-
import { n as isContextWriterBusy } from "./ContextWriter-
|
|
6
|
+
import { n as proxy } from "./Launch-cAdE2rrZ.mjs";
|
|
7
|
+
import { n as isContextWriterBusy } from "./ContextWriter-oKWFLHuP.mjs";
|
|
9
8
|
import { Clock, Context, Effect, Layer, Schema } from "effect";
|
|
10
9
|
//#region src/Functions.ts
|
|
11
|
-
var Functions_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
-
BrowserbaseFunctions: () => BrowserbaseFunctions,
|
|
13
|
-
FunctionBuild: () => FunctionBuild,
|
|
14
|
-
FunctionInvocation: () => FunctionInvocation,
|
|
15
|
-
FunctionInvokeRequest: () => FunctionInvokeRequest,
|
|
16
|
-
FunctionLogLine: () => FunctionLogLine,
|
|
17
|
-
FunctionMetadata: () => FunctionMetadata,
|
|
18
|
-
FunctionPageQuery: () => FunctionPageQuery,
|
|
19
|
-
FunctionSessionParams: () => FunctionSessionParams,
|
|
20
|
-
FunctionStatusQuery: () => FunctionStatusQuery,
|
|
21
|
-
FunctionVersion: () => FunctionVersion,
|
|
22
|
-
FunctionWaitOptions: () => FunctionWaitOptions
|
|
23
|
-
});
|
|
24
10
|
const Timestamp = Schema.String.check(Schema.isMaxLength(64));
|
|
25
11
|
const JsonObject = Schema.Record(Schema.String, Schema.Json);
|
|
26
12
|
const Name = Schema.String.check(Schema.isMaxLength(1024));
|
|
@@ -327,6 +313,6 @@ var BrowserbaseFunctions = class BrowserbaseFunctions extends Context.Service()(
|
|
|
327
313
|
}));
|
|
328
314
|
};
|
|
329
315
|
//#endregion
|
|
330
|
-
export { BrowserbaseFunctions, FunctionBuild, FunctionInvocation, FunctionInvokeRequest, FunctionLogLine, FunctionMetadata, FunctionPageQuery, FunctionSessionParams, FunctionStatusQuery, FunctionVersion, FunctionWaitOptions
|
|
316
|
+
export { BrowserbaseFunctions, FunctionBuild, FunctionInvocation, FunctionInvokeRequest, FunctionLogLine, FunctionMetadata, FunctionPageQuery, FunctionSessionParams, FunctionStatusQuery, FunctionVersion, FunctionWaitOptions };
|
|
331
317
|
|
|
332
318
|
//# sourceMappingURL=Functions.mjs.map
|