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
package/dist/Account.d.mts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { ClientError } from "./Errors.mjs";
|
|
2
|
-
import { r as ClientOptions, t as BrowserbaseClient } from "./Client-
|
|
3
|
-
import { BrowserbaseAgents } from "./Agents.mjs";
|
|
4
|
-
import { BrowserbaseCertificates } from "./Certificates.mjs";
|
|
5
|
-
import { BrowserbaseContexts } from "./Contexts.mjs";
|
|
6
|
-
import { t as BrowserbaseSessions } from "./Sessions-
|
|
7
|
-
import { BrowserbaseDownloads } from "./Downloads.mjs";
|
|
8
|
-
import { BrowserbaseExtensions } from "./Extensions.mjs";
|
|
9
|
-
import { BrowserbaseFunctions } from "./Functions.mjs";
|
|
10
|
-
import { BrowserbasePageFetch } from "./PageFetch.mjs";
|
|
11
|
-
import { BrowserbaseProjects } from "./Projects.mjs";
|
|
12
|
-
import { BrowserbaseRecordings } from "./Recordings.mjs";
|
|
13
|
-
import { BrowserbaseReplays } from "./Replays.mjs";
|
|
14
|
-
import { BrowserbaseSearch } from "./Search.mjs";
|
|
15
|
-
import { BrowserbaseUploads } from "./Uploads.mjs";
|
|
16
|
-
import { BrowserbaseWebhooks } from "./Webhooks.mjs";
|
|
2
|
+
import { r as ClientOptions, t as BrowserbaseClient } from "./Client-B_f6bBLT.mjs";
|
|
3
|
+
import { p as BrowserbaseAgents } from "./Agents-5HpTp9YE.mjs";
|
|
4
|
+
import { t as BrowserbaseCertificates } from "./Certificates-D4NQmyeA.mjs";
|
|
5
|
+
import { t as BrowserbaseContexts } from "./Contexts-DqdL7cyX.mjs";
|
|
6
|
+
import { t as BrowserbaseSessions } from "./Sessions-BpZgjteE.mjs";
|
|
7
|
+
import { t as BrowserbaseDownloads } from "./Downloads-CdhiCO5X.mjs";
|
|
8
|
+
import { t as BrowserbaseExtensions } from "./Extensions-DBXuVM1f.mjs";
|
|
9
|
+
import { t as BrowserbaseFunctions } from "./Functions-CsKMMUuZ.mjs";
|
|
10
|
+
import { t as BrowserbasePageFetch } from "./PageFetch-CAMqb5m8.mjs";
|
|
11
|
+
import { t as BrowserbaseProjects } from "./Projects-tm5bTDH0.mjs";
|
|
12
|
+
import { t as BrowserbaseRecordings } from "./Recordings-bVI33sTq.mjs";
|
|
13
|
+
import { t as BrowserbaseReplays } from "./Replays-Bo-9xeLz.mjs";
|
|
14
|
+
import { t as BrowserbaseSearch } from "./Search-1g6TUem7.mjs";
|
|
15
|
+
import { t as BrowserbaseUploads } from "./Uploads-C2neBEpj.mjs";
|
|
16
|
+
import { t as BrowserbaseWebhooks } from "./Webhooks-BoeRAxzG.mjs";
|
|
17
17
|
import { Config, Layer } from "effect";
|
|
18
|
-
|
|
19
|
-
export { Services, layer, layerConfig };
|
|
20
|
-
}
|
|
18
|
+
//#region src/Account.d.ts
|
|
21
19
|
/** Every resource service this package owns, on one account's authority. */
|
|
22
20
|
export type Services = BrowserbaseAgents | BrowserbaseCertificates | BrowserbaseClient | BrowserbaseContexts | BrowserbaseDownloads | BrowserbaseExtensions | BrowserbaseFunctions | BrowserbasePageFetch | BrowserbaseProjects | BrowserbaseRecordings | BrowserbaseReplays | BrowserbaseSearch | BrowserbaseSessions | BrowserbaseUploads | BrowserbaseWebhooks;
|
|
23
21
|
/**
|
|
@@ -30,5 +28,5 @@ export declare const layer: (options: ClientOptions) => Layer.Layer<Services, Cl
|
|
|
30
28
|
/** The same bundle, taking account authority from the application's `ConfigProvider`. */
|
|
31
29
|
export declare const layerConfig: (options?: Omit<ClientOptions, "projectId" | "apiKey">) => Layer.Layer<Services, ClientError | Config.ConfigError>;
|
|
32
30
|
//#endregion
|
|
33
|
-
export {
|
|
31
|
+
export {};
|
|
34
32
|
//# sourceMappingURL=Account.d.mts.map
|
package/dist/Account.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as BrowserbaseClient } from "./Client-D1_xYM9o.mjs";
|
|
1
|
+
import { t as BrowserbaseClient } from "./Client-4RMKIpL2.mjs";
|
|
3
2
|
import { BrowserbaseAgents } from "./Agents.mjs";
|
|
4
3
|
import { BrowserbaseCertificates } from "./Certificates.mjs";
|
|
5
4
|
import { BrowserbaseContexts } from "./Contexts.mjs";
|
|
6
|
-
import { t as BrowserbaseSessions } from "./Sessions-
|
|
5
|
+
import { t as BrowserbaseSessions } from "./Sessions-suOLSym9.mjs";
|
|
7
6
|
import { BrowserbaseDownloads } from "./Downloads.mjs";
|
|
8
|
-
import { t as BrowserbaseExtensions } from "./Extensions-
|
|
7
|
+
import { t as BrowserbaseExtensions } from "./Extensions-Dg3jHOf0.mjs";
|
|
9
8
|
import { BrowserbaseFunctions } from "./Functions.mjs";
|
|
10
9
|
import { BrowserbasePageFetch } from "./PageFetch.mjs";
|
|
11
10
|
import { BrowserbaseProjects } from "./Projects.mjs";
|
|
@@ -16,10 +15,6 @@ import { BrowserbaseUploads } from "./Uploads.mjs";
|
|
|
16
15
|
import { BrowserbaseWebhooks } from "./Webhooks.mjs";
|
|
17
16
|
import { Layer } from "effect";
|
|
18
17
|
//#region src/Account.ts
|
|
19
|
-
var Account_exports = /* @__PURE__ */ __exportAll({
|
|
20
|
-
layer: () => layer,
|
|
21
|
-
layerConfig: () => layerConfig
|
|
22
|
-
});
|
|
23
18
|
/**
|
|
24
19
|
* The services that read one Client. Sessions is provided first and kept in the output,
|
|
25
20
|
* because the artifact services read it and a caller composing this Layer should not have
|
|
@@ -36,6 +31,6 @@ const layer = (options) => services.pipe(Layer.provideMerge(BrowserbaseClient.la
|
|
|
36
31
|
/** The same bundle, taking account authority from the application's `ConfigProvider`. */
|
|
37
32
|
const layerConfig = (options = {}) => services.pipe(Layer.provideMerge(BrowserbaseClient.layerConfig(options)));
|
|
38
33
|
//#endregion
|
|
39
|
-
export { layer, layerConfig
|
|
34
|
+
export { layer, layerConfig };
|
|
40
35
|
|
|
41
36
|
//# sourceMappingURL=Account.mjs.map
|
package/dist/Account.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.mjs","names":[],"sources":["../src/Account.ts"],"sourcesContent":["import { type Config, Layer } from \"effect\";\n\nimport { BrowserbaseAgents } from \"./Agents.ts\";\nimport { BrowserbaseCertificates } from \"./Certificates.ts\";\nimport { BrowserbaseClient, type ClientOptions } from \"./Client.ts\";\nimport { BrowserbaseContexts } from \"./Contexts.ts\";\nimport { BrowserbaseDownloads } from \"./Downloads.ts\";\nimport type { ClientError } from \"./Errors.ts\";\nimport { BrowserbaseExtensions } from \"./Extensions.ts\";\nimport { BrowserbaseFunctions } from \"./Functions.ts\";\nimport { BrowserbasePageFetch } from \"./PageFetch.ts\";\nimport { BrowserbaseProjects } from \"./Projects.ts\";\nimport { BrowserbaseRecordings } from \"./Recordings.ts\";\nimport { BrowserbaseReplays } from \"./Replays.ts\";\nimport { BrowserbaseSearch } from \"./Search.ts\";\nimport { BrowserbaseSessions } from \"./Sessions.ts\";\nimport { BrowserbaseUploads } from \"./Uploads.ts\";\nimport { BrowserbaseWebhooks } from \"./Webhooks.ts\";\n\n/** Every resource service this package owns, on one account's authority. */\nexport type Services =\n | BrowserbaseAgents\n | BrowserbaseCertificates\n | BrowserbaseClient\n | BrowserbaseContexts\n | BrowserbaseDownloads\n | BrowserbaseExtensions\n | BrowserbaseFunctions\n | BrowserbasePageFetch\n | BrowserbaseProjects\n | BrowserbaseRecordings\n | BrowserbaseReplays\n | BrowserbaseSearch\n | BrowserbaseSessions\n | BrowserbaseUploads\n | BrowserbaseWebhooks;\n\n/**\n * The services that read one Client. Sessions is provided first and kept in the output,\n * because the artifact services read it and a caller composing this Layer should not have\n * to know which ones do.\n */\nconst services = Layer.mergeAll(\n BrowserbaseAgents.layer,\n BrowserbaseCertificates.layer,\n BrowserbaseContexts.layer,\n BrowserbaseDownloads.layer,\n BrowserbaseExtensions.layer,\n BrowserbaseFunctions.layer,\n BrowserbasePageFetch.layer,\n BrowserbaseProjects.layer,\n BrowserbaseRecordings.layer,\n BrowserbaseReplays.layer,\n BrowserbaseSearch.layer,\n BrowserbaseUploads.layer,\n BrowserbaseWebhooks.layer,\n).pipe(Layer.provideMerge(BrowserbaseSessions.layer));\n\n/**\n * One account for every resource operation, so credentials are composed once rather than\n * per service. Building it performs no I/O, allocates nothing and loads no native peer;\n * `BrowserbaseBrowser.layer` is deliberately separate, because a browser fixes budgets and\n * a connection lifetime that an account does not.\n */\nexport const layer = (options: ClientOptions): Layer.Layer<Services, ClientError> =>\n services.pipe(Layer.provideMerge(BrowserbaseClient.layer(options)));\n\n/** The same bundle, taking account authority from the application's `ConfigProvider`. */\nexport const layerConfig = (\n options: Omit<ClientOptions, \"projectId\" | \"apiKey\"> = {},\n): Layer.Layer<Services, ClientError | Config.ConfigError> =>\n services.pipe(Layer.provideMerge(BrowserbaseClient.layerConfig(options)));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Account.mjs","names":[],"sources":["../src/Account.ts"],"sourcesContent":["import { type Config, Layer } from \"effect\";\n\nimport { BrowserbaseAgents } from \"./Agents.ts\";\nimport { BrowserbaseCertificates } from \"./Certificates.ts\";\nimport { BrowserbaseClient, type ClientOptions } from \"./Client.ts\";\nimport { BrowserbaseContexts } from \"./Contexts.ts\";\nimport { BrowserbaseDownloads } from \"./Downloads.ts\";\nimport type { ClientError } from \"./Errors.ts\";\nimport { BrowserbaseExtensions } from \"./Extensions.ts\";\nimport { BrowserbaseFunctions } from \"./Functions.ts\";\nimport { BrowserbasePageFetch } from \"./PageFetch.ts\";\nimport { BrowserbaseProjects } from \"./Projects.ts\";\nimport { BrowserbaseRecordings } from \"./Recordings.ts\";\nimport { BrowserbaseReplays } from \"./Replays.ts\";\nimport { BrowserbaseSearch } from \"./Search.ts\";\nimport { BrowserbaseSessions } from \"./Sessions.ts\";\nimport { BrowserbaseUploads } from \"./Uploads.ts\";\nimport { BrowserbaseWebhooks } from \"./Webhooks.ts\";\n\n/** Every resource service this package owns, on one account's authority. */\nexport type Services =\n | BrowserbaseAgents\n | BrowserbaseCertificates\n | BrowserbaseClient\n | BrowserbaseContexts\n | BrowserbaseDownloads\n | BrowserbaseExtensions\n | BrowserbaseFunctions\n | BrowserbasePageFetch\n | BrowserbaseProjects\n | BrowserbaseRecordings\n | BrowserbaseReplays\n | BrowserbaseSearch\n | BrowserbaseSessions\n | BrowserbaseUploads\n | BrowserbaseWebhooks;\n\n/**\n * The services that read one Client. Sessions is provided first and kept in the output,\n * because the artifact services read it and a caller composing this Layer should not have\n * to know which ones do.\n */\nconst services = Layer.mergeAll(\n BrowserbaseAgents.layer,\n BrowserbaseCertificates.layer,\n BrowserbaseContexts.layer,\n BrowserbaseDownloads.layer,\n BrowserbaseExtensions.layer,\n BrowserbaseFunctions.layer,\n BrowserbasePageFetch.layer,\n BrowserbaseProjects.layer,\n BrowserbaseRecordings.layer,\n BrowserbaseReplays.layer,\n BrowserbaseSearch.layer,\n BrowserbaseUploads.layer,\n BrowserbaseWebhooks.layer,\n).pipe(Layer.provideMerge(BrowserbaseSessions.layer));\n\n/**\n * One account for every resource operation, so credentials are composed once rather than\n * per service. Building it performs no I/O, allocates nothing and loads no native peer;\n * `BrowserbaseBrowser.layer` is deliberately separate, because a browser fixes budgets and\n * a connection lifetime that an account does not.\n */\nexport const layer = (options: ClientOptions): Layer.Layer<Services, ClientError> =>\n services.pipe(Layer.provideMerge(BrowserbaseClient.layer(options)));\n\n/** The same bundle, taking account authority from the application's `ConfigProvider`. */\nexport const layerConfig = (\n options: Omit<ClientOptions, \"projectId\" | \"apiKey\"> = {},\n): Layer.Layer<Services, ClientError | Config.ConfigError> =>\n services.pipe(Layer.provideMerge(BrowserbaseClient.layerConfig(options)));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,WAAW,MAAM,SACrB,kBAAkB,OAClB,wBAAwB,OACxB,oBAAoB,OACpB,qBAAqB,OACrB,sBAAsB,OACtB,qBAAqB,OACrB,qBAAqB,OACrB,oBAAoB,OACpB,sBAAsB,OACtB,mBAAmB,OACnB,kBAAkB,OAClB,mBAAmB,OACnB,oBAAoB,KACtB,CAAC,CAAC,KAAK,MAAM,aAAa,oBAAoB,KAAK,CAAC;;;;;;;AAQpD,MAAa,SAAS,YACpB,SAAS,KAAK,MAAM,aAAa,kBAAkB,MAAM,OAAO,CAAC,CAAC;;AAGpE,MAAa,eACX,UAAuD,CAAC,MAExD,SAAS,KAAK,MAAM,aAAa,kBAAkB,YAAY,OAAO,CAAC,CAAC"}
|
|
@@ -1,57 +1,15 @@
|
|
|
1
1
|
import { Identifier, SessionReference } from "./References.mjs";
|
|
2
2
|
import { AllocationError, ContextError, SessionError } from "./Errors.mjs";
|
|
3
|
-
import { t as BrowserbaseClient } from "./Client-
|
|
4
|
-
import { t as compileLaunch } from "./Launch-
|
|
5
|
-
import { ProviderSession } from "./SessionData.mjs";
|
|
3
|
+
import { t as BrowserbaseClient } from "./Client-4RMKIpL2.mjs";
|
|
4
|
+
import { t as compileLaunch } from "./Launch-cAdE2rrZ.mjs";
|
|
6
5
|
import { CleanupIssue, CleanupResult } from "./Cleanup.mjs";
|
|
7
|
-
import { i as requireContextWriterPermit } from "./ContextWriter-
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import { Cause, Clock, Data, Effect, ErrorReporter, Exit, Option,
|
|
11
|
-
|
|
12
|
-
const Connection = Schema.Struct({
|
|
13
|
-
...ProviderSession.fields,
|
|
14
|
-
connectUrl: Schema.String.check(Schema.isMaxLength(16384))
|
|
15
|
-
});
|
|
16
|
-
/** A provider-issued endpoint is authority, not a persisted session identifier. */
|
|
17
|
-
const connectionUrl = Schema.String.check(Schema.isMaxLength(16384), Schema.makeFilter((value) => {
|
|
18
|
-
try {
|
|
19
|
-
const url = new URL(value);
|
|
20
|
-
return url.protocol === "wss:" && !url.username && !url.password && !url.port && !url.hash && url.hostname.endsWith(".browserbase.com");
|
|
21
|
-
} catch {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
const connectionAddress = Effect.fnUntraced(function* (client, sessions, reference, timeoutMillis) {
|
|
26
|
-
const fail = (reason) => SessionError.make({
|
|
27
|
-
operation: "session-connect",
|
|
28
|
-
reason
|
|
29
|
-
});
|
|
30
|
-
const ref = yield* Schema.decodeEffect(SessionReference)(reference).pipe(Effect.mapError(() => fail("configuration")));
|
|
31
|
-
if (ref.projectId !== client.projectId) return yield* fail("authorization");
|
|
32
|
-
const deadline = yield* deadlineAfter(timeoutMillis);
|
|
33
|
-
yield* sessions.waitUntilRunning(ref, { timeoutMillis });
|
|
34
|
-
if ((yield* nowMillis) >= deadline) return yield* fail("timeout");
|
|
35
|
-
const raw = yield* until(client.json("GET", `/v1/sessions/${encodeURIComponent(ref.sessionId)}`, void 0, deadline), deadline, () => fail("timeout")).pipe(Effect.mapError((error) => fail(error.reason)));
|
|
36
|
-
const value = yield* Schema.decodeUnknownEffect(Connection)(raw).pipe(Effect.mapError(() => fail("malformed")));
|
|
37
|
-
if (value.id !== ref.sessionId || value.projectId !== ref.projectId) return yield* fail("malformed");
|
|
38
|
-
if (value.status !== "RUNNING") return yield* fail("expired");
|
|
39
|
-
const url = yield* Schema.decodeEffect(connectionUrl)(value.connectUrl).pipe(Effect.mapError(() => fail("unsafe-url")));
|
|
40
|
-
return Redacted.make(url);
|
|
41
|
-
});
|
|
42
|
-
//#endregion
|
|
6
|
+
import { i as requireContextWriterPermit } from "./ContextWriter-oKWFLHuP.mjs";
|
|
7
|
+
import { t as BrowserbaseSessions } from "./Sessions-suOLSym9.mjs";
|
|
8
|
+
import { t as connectionAddress } from "./Connection-sxyxtwlk.mjs";
|
|
9
|
+
import { Cause, Clock, Crypto, Data, Effect, ErrorReporter, Exit, Option, Schema, Scope } from "effect";
|
|
10
|
+
import { cleanupStep, noConnection, reported } from "effect-browser/browser-runtime";
|
|
43
11
|
//#region src/internal/session/Cleanup.ts
|
|
44
|
-
const noLocalConnection =
|
|
45
|
-
fence: Effect.void,
|
|
46
|
-
capture: Effect.void,
|
|
47
|
-
initialization: Effect.void,
|
|
48
|
-
disconnect: Effect.succeed("not-connected")
|
|
49
|
-
};
|
|
50
|
-
/** Bounded host notification of canonical facts. Reporting never changes them. */
|
|
51
|
-
const reported = (effect) => effect.pipe(Effect.interruptible, Effect.timeoutOrElse({
|
|
52
|
-
duration: 2e3,
|
|
53
|
-
orElse: () => Effect.void
|
|
54
|
-
}), Effect.ignore);
|
|
12
|
+
const noLocalConnection = noConnection;
|
|
55
13
|
const defaultCleanupLimits = {
|
|
56
14
|
localStepMillis: 3e3,
|
|
57
15
|
releaseMillis: 4e3,
|
|
@@ -67,36 +25,28 @@ const makeCleanup = Effect.fnUntraced(function* (reference, ownership, sessions,
|
|
|
67
25
|
return {
|
|
68
26
|
close: yield* Effect.cached(Effect.uninterruptible(Effect.gen(function* () {
|
|
69
27
|
const issues = [];
|
|
70
|
-
const step = (name, action, milliseconds) => action.pipe(Effect.
|
|
71
|
-
|
|
72
|
-
orElse: () => Effect.fail(CleanupIssue.make({
|
|
28
|
+
const step = (name, action, milliseconds) => cleanupStep(action, milliseconds).pipe(Effect.tap((result) => Effect.sync(() => {
|
|
29
|
+
if (result._tag === "Failure") issues.push(CleanupIssue.make({
|
|
73
30
|
step: name,
|
|
74
|
-
reason:
|
|
75
|
-
}))
|
|
76
|
-
}), Effect.exit, Effect.tap((exit) => Effect.sync(() => {
|
|
77
|
-
if (Exit.isSuccess(exit)) return;
|
|
78
|
-
const reason = Cause.findErrorOption(exit.cause);
|
|
79
|
-
issues.push(CleanupIssue.make({
|
|
80
|
-
step: name,
|
|
81
|
-
reason: Option.isSome(reason) && reason.value instanceof CleanupIssue ? reason.value.reason : Cause.hasInterrupts(exit.cause) ? "interrupted" : "failed"
|
|
31
|
+
reason: result.reason
|
|
82
32
|
}));
|
|
83
33
|
})));
|
|
84
34
|
yield* step("fence", local.fence, limits.localStepMillis);
|
|
85
35
|
yield* step("capture", local.capture, limits.localStepMillis);
|
|
86
36
|
yield* step("initialization", local.initialization, limits.localStepMillis);
|
|
87
37
|
const disconnected = yield* step("disconnect", local.disconnect, limits.localStepMillis);
|
|
88
|
-
const localState =
|
|
38
|
+
const localState = disconnected._tag === "Success" ? disconnected.value : "failed";
|
|
89
39
|
let releaseRequested = false;
|
|
90
40
|
let remote = ownership === "borrowed" ? "not-owned" : "unknown";
|
|
91
41
|
let observedStatus;
|
|
92
42
|
if (ownership === "owned") {
|
|
93
43
|
const requested = yield* step("release", sessions.requestRelease(reference), limits.releaseMillis);
|
|
94
|
-
releaseRequested =
|
|
44
|
+
releaseRequested = requested._tag === "Success";
|
|
95
45
|
const terminal = yield* step("status", sessions.waitForTerminal(reference, { timeoutMillis: limits.terminalMillis }), limits.terminalMillis);
|
|
96
|
-
if (
|
|
46
|
+
if (terminal._tag === "Success") {
|
|
97
47
|
remote = "confirmed";
|
|
98
48
|
observedStatus = terminal.value.status;
|
|
99
|
-
} else if (
|
|
49
|
+
} else if (requested._tag === "Success") remote = "pending";
|
|
100
50
|
}
|
|
101
51
|
const result = CleanupResult.make({
|
|
102
52
|
reference,
|
|
@@ -166,10 +116,11 @@ const AllocatedIdentity = Schema.Struct({
|
|
|
166
116
|
const acquireRemote = Effect.fnUntraced(function* (options, local = noLocalConnection, limits) {
|
|
167
117
|
const client = yield* BrowserbaseClient;
|
|
168
118
|
const sessions = yield* BrowserbaseSessions;
|
|
119
|
+
const crypto = yield* Crypto.Crypto;
|
|
169
120
|
const parent = yield* Scope.Scope;
|
|
170
121
|
const launch = yield* compileLaunch(options.launch, {
|
|
171
122
|
projectId: client.projectId,
|
|
172
|
-
attemptId:
|
|
123
|
+
attemptId: yield* Effect.orDie(crypto.randomUUIDv4),
|
|
173
124
|
requestedAtMillis: yield* Clock.currentTimeMillis
|
|
174
125
|
});
|
|
175
126
|
const attempt = launch.attempt;
|
|
@@ -216,8 +167,12 @@ const acquireRemote = Effect.fnUntraced(function* (options, local = noLocalConne
|
|
|
216
167
|
cleanup = result;
|
|
217
168
|
writer?.completed(attempt, result);
|
|
218
169
|
}, limits)).close;
|
|
219
|
-
|
|
220
|
-
|
|
170
|
+
const result = cleanup;
|
|
171
|
+
const notify = options.onCleanup;
|
|
172
|
+
if (result !== void 0) {
|
|
173
|
+
yield* reported(Effect.suspend(() => reportCleanup(result)));
|
|
174
|
+
if (notify !== void 0) yield* reported(Effect.suspend(() => notify(result)));
|
|
175
|
+
}
|
|
221
176
|
})));
|
|
222
177
|
const closeScope = yield* Effect.cached(Scope.close(resourceScope, Exit.void));
|
|
223
178
|
yield* Scope.addFinalizer(resourceScope, terminate);
|
|
@@ -275,6 +230,6 @@ const acquireRemote = Effect.fnUntraced(function* (options, local = noLocalConne
|
|
|
275
230
|
}));
|
|
276
231
|
});
|
|
277
232
|
//#endregion
|
|
278
|
-
export { reported as a, noLocalConnection as i, reportCleanup as n,
|
|
233
|
+
export { reported as a, noLocalConnection as i, reportCleanup as n, makeCleanup as r, acquireRemote as t };
|
|
279
234
|
|
|
280
|
-
//# sourceMappingURL=Acquisition-
|
|
235
|
+
//# sourceMappingURL=Acquisition-CAsTTXp4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Acquisition-CAsTTXp4.mjs","names":[],"sources":["../src/internal/session/Cleanup.ts","../src/internal/session/Diagnostics.ts","../src/internal/session/Acquisition.ts"],"sourcesContent":["import { Effect, Option } from \"effect\";\nimport { cleanupStep, noConnection, type ConnectionCleanup } from \"effect-browser/browser-runtime\";\n\nexport { reported } from \"effect-browser/browser-runtime\";\nexport type { ConnectionCleanup as LocalCleanup } from \"effect-browser/browser-runtime\";\n\nimport { CleanupIssue, CleanupResult } from \"../../Cleanup.ts\";\nimport type { SessionReference } from \"../../References.ts\";\nimport type { SessionStatus } from \"../../SessionData.ts\";\nimport type { BrowserbaseSessions } from \"../../Sessions.ts\";\n\nexport const noLocalConnection = noConnection;\n\n/** Internal limits, also injectable by deterministic failure tests. */\nexport interface CleanupLimits {\n readonly localStepMillis: number;\n readonly releaseMillis: number;\n readonly terminalMillis: number;\n}\n\nexport const defaultCleanupLimits: CleanupLimits = {\n localStepMillis: 3000,\n releaseMillis: 4000,\n terminalMillis: 4000,\n};\n\n/**\n * Close is one uninterruptible, bounded transaction over *local cleanup evidence*, not\n * a transaction over the remote browser. Each step observes its own Exit so failures\n * cannot suppress a later disconnect, release request, or exact-session status read.\n */\nexport const makeCleanup = Effect.fnUntraced(function* (\n reference: SessionReference,\n ownership: CleanupResult[\"ownership\"],\n sessions: BrowserbaseSessions[\"Service\"],\n local: ConnectionCleanup,\n report: (result: CleanupResult) => void,\n limits: CleanupLimits = defaultCleanupLimits,\n) {\n let latest: CleanupResult | undefined;\n\n const close = yield* Effect.cached(\n Effect.uninterruptible(\n Effect.gen(function* () {\n const issues: CleanupIssue[] = [];\n\n const step = <A, E>(\n name: CleanupIssue[\"step\"],\n action: Effect.Effect<A, E>,\n milliseconds: number,\n ) =>\n cleanupStep(action, milliseconds).pipe(\n Effect.tap((result) =>\n Effect.sync(() => {\n if (result._tag === \"Failure\")\n issues.push(CleanupIssue.make({ step: name, reason: result.reason }));\n }),\n ),\n );\n\n // The fence runs synchronously before interruptible native teardown begins.\n yield* step(\"fence\", local.fence, limits.localStepMillis);\n yield* step(\"capture\", local.capture, limits.localStepMillis);\n yield* step(\"initialization\", local.initialization, limits.localStepMillis);\n const disconnected = yield* step(\"disconnect\", local.disconnect, limits.localStepMillis);\n const localState = disconnected._tag === \"Success\" ? disconnected.value : \"failed\";\n\n let releaseRequested = false;\n let remote: CleanupResult[\"remote\"] = ownership === \"borrowed\" ? \"not-owned\" : \"unknown\";\n let observedStatus: SessionStatus | undefined;\n\n if (ownership === \"owned\") {\n const requested = yield* step(\n \"release\",\n sessions.requestRelease(reference),\n limits.releaseMillis,\n );\n\n releaseRequested = requested._tag === \"Success\";\n\n // A POST response is never substituted for a passive terminal-state observation.\n const terminal = yield* step(\n \"status\",\n sessions.waitForTerminal(reference, { timeoutMillis: limits.terminalMillis }),\n limits.terminalMillis,\n );\n\n if (terminal._tag === \"Success\") {\n remote = \"confirmed\";\n observedStatus = terminal.value.status;\n } else if (requested._tag === \"Success\") {\n remote = \"pending\";\n }\n }\n\n const result = CleanupResult.make({\n reference,\n ownership,\n releaseRequested,\n remote,\n local: localState,\n ...(observedStatus === undefined ? {} : { observedStatus }),\n issues,\n });\n\n Object.freeze(result.issues);\n latest = Object.freeze(result);\n report(latest);\n\n return latest;\n }),\n ),\n );\n\n return {\n close,\n result: Effect.sync(() => Option.fromNullishOr(latest)),\n };\n});\n","import { Cause, Data, Effect, ErrorReporter } from \"effect\";\n\nimport type { CleanupResult } from \"../../Cleanup.ts\";\nimport type { AllocationAttempt } from \"../../References.ts\";\n\n/**\n * Operator-visible evidence that a session's fate was not settled. It carries identity and\n * outcome labels only: no provider body, connection URL, credential or page content. The\n * transport deliberately disables tracing where credentials travel, so without this an\n * unconfirmed release or an allocation of unknown outcome would leave no trace for anyone who\n * did not register a callback.\n */\nclass SessionUnsettled extends Data.TaggedError(\"BrowserbaseSessionUnsettled\")<{\n readonly message: string;\n readonly details: Readonly<Record<string, string | number>>;\n}> {\n override readonly [ErrorReporter.severity] = \"Warn\" as const;\n\n override get [ErrorReporter.attributes]() {\n return this.details;\n }\n}\n\nconst surface = (message: string, details: Readonly<Record<string, string | number>>) =>\n Effect.logWarning(message).pipe(\n Effect.annotateLogs(details),\n Effect.andThen(ErrorReporter.report(Cause.fail(new SessionUnsettled({ message, details })))),\n );\n\n/** A borrowed scope never owns release, so only its local teardown can be unsettled. */\nexport const reportCleanup = (result: CleanupResult): Effect.Effect<void> => {\n const remoteUnsettled =\n result.ownership === \"owned\" && (result.remote !== \"confirmed\" || !result.releaseRequested);\n\n if (!remoteUnsettled && result.local !== \"failed\" && result.issues.length === 0)\n return Effect.void;\n\n return surface(\"Browserbase session cleanup ended without confirmation\", {\n projectId: result.reference.projectId,\n sessionId: result.reference.sessionId,\n ownership: result.ownership,\n remote: result.remote,\n local: result.local,\n observedStatus: result.observedStatus ?? \"unobserved\",\n issues: result.issues.map((issue) => `${issue.step}:${issue.reason}`).join(\",\") || \"none\",\n });\n};\n\n/** The provider may have allocated a session this process has no reference for. */\nexport const reportAllocationUncertain = (attempt: AllocationAttempt): Effect.Effect<void> =>\n surface(\"Browserbase allocation outcome is unknown\", {\n projectId: attempt.projectId,\n attemptId: attempt.attemptId,\n requestedAtMillis: attempt.requestedAtMillis,\n });\n","import { Clock, Crypto, Effect, Exit, Option, Schema, Scope } from \"effect\";\n\nimport type { CleanupResult } from \"../../Cleanup.ts\";\nimport { BrowserbaseClient } from \"../../Client.ts\";\nimport { AllocationError, ContextError, type ClientError, SessionError } from \"../../Errors.ts\";\nimport type { LaunchRecipe } from \"../../Launch.ts\";\nimport { type AllocationAttempt, Identifier, SessionReference } from \"../../References.ts\";\nimport { BrowserbaseSessions } from \"../../Sessions.ts\";\nimport { connectionAddress } from \"../provider/Connection.ts\";\nimport { compileLaunch } from \"../provider/Launch.ts\";\nimport {\n makeCleanup,\n noLocalConnection,\n reported,\n type CleanupLimits,\n type LocalCleanup,\n} from \"./Cleanup.ts\";\nimport { requireContextWriterPermit, type ContextWriterPermitInternal } from \"./ContextWriter.ts\";\nimport { reportAllocationUncertain, reportCleanup } from \"./Diagnostics.ts\";\nimport type { ContextWriterPermit } from \"./WriterFacts.ts\";\n\nconst AllocatedIdentity = Schema.Struct({ id: Identifier, projectId: Identifier });\n\nexport interface AcquisitionOptions {\n readonly launch: LaunchRecipe;\n readonly contextWriter?: ContextWriterPermit;\n readonly allocationDeadline?: number;\n /** Bounded host notification of the canonical facts. Reporting never changes them. */\n readonly onCleanup?: (result: CleanupResult) => Effect.Effect<void>;\n /** Exactly one notification when a creation attempt's effect on the provider is unknown. */\n readonly onAllocationUncertain?: (attempt: AllocationAttempt) => Effect.Effect<void>;\n}\n\n/**\n * The remote lease is registered before POST. Local connection work is supplied by\n * the same browser owner; the control plane never invents a second operation owner.\n */\nexport const acquireRemote = Effect.fnUntraced(function* (\n options: AcquisitionOptions,\n local: LocalCleanup = noLocalConnection,\n limits?: CleanupLimits,\n) {\n const client = yield* BrowserbaseClient;\n const sessions = yield* BrowserbaseSessions;\n const crypto = yield* Crypto.Crypto;\n const parent = yield* Scope.Scope;\n\n const launch = yield* compileLaunch(options.launch, {\n projectId: client.projectId,\n // Secure randomness is a platform precondition, so its failure is a defect, not an outcome.\n attemptId: yield* Effect.orDie(crypto.randomUUIDv4),\n requestedAtMillis: yield* Clock.currentTimeMillis,\n });\n\n const attempt = launch.attempt;\n let writer: ContextWriterPermitInternal | undefined;\n\n if (launch.context?.persist) {\n if (options.contextWriter === undefined) {\n return yield* ContextError.make({\n operation: \"writer-authority\",\n reason: \"authorization\",\n outcome: \"undispatched\",\n });\n }\n writer = yield* requireContextWriterPermit(options.contextWriter, {\n provider: \"browserbase\",\n projectId: client.projectId,\n contextId: launch.context.id,\n });\n } else if (options.contextWriter !== undefined) {\n return yield* ContextError.make({\n operation: \"writer-authority\",\n reason: \"configuration\",\n outcome: \"undispatched\",\n });\n }\n\n return yield* Effect.uninterruptibleMask((restore) =>\n Effect.gen(function* () {\n const resourceScope = yield* Scope.make();\n let reference: SessionReference | undefined;\n let admitted = false;\n let knownRejection = false;\n let closing = false;\n let cleanup: CleanupResult | undefined;\n\n let uncertainReported = false;\n\n const allocationUncertain = Effect.suspend(() => {\n if (uncertainReported) return Effect.void;\n uncertainReported = true;\n\n return reportAllocationUncertain(attempt).pipe(\n Effect.andThen(\n options.onAllocationUncertain === undefined\n ? Effect.void\n : reported(options.onAllocationUncertain(attempt)),\n ),\n );\n });\n\n const terminate = yield* Effect.cached(\n Effect.uninterruptible(\n Effect.gen(function* () {\n closing = true;\n if (reference === undefined) {\n if (admitted && !knownRejection) {\n writer?.uncertain(attempt);\n yield* allocationUncertain;\n }\n\n return;\n }\n\n const coordinator = yield* makeCleanup(\n reference,\n \"owned\",\n sessions,\n local,\n (result) => {\n cleanup = result;\n writer?.completed(attempt, result);\n },\n limits,\n );\n\n yield* coordinator.close;\n const result = cleanup;\n const notify = options.onCleanup;\n\n if (result !== undefined) {\n yield* reported(Effect.suspend(() => reportCleanup(result)));\n if (notify !== undefined) yield* reported(Effect.suspend(() => notify(result)));\n }\n }),\n ),\n );\n\n const closeScope = yield* Effect.cached(Scope.close(resourceScope, Exit.void));\n\n yield* Scope.addFinalizer(resourceScope, terminate);\n yield* Scope.addFinalizer(parent, closeScope);\n\n const failedAllocation = (error: ClientError): AllocationError => {\n knownRejection = error.outcome === \"rejected\" || error.outcome === \"undispatched\";\n if (knownRejection) writer?.rejected(attempt);\n else writer?.uncertain(attempt);\n const reason = error.reason;\n\n return AllocationError.make({\n attempt,\n outcome: knownRejection ? \"rejected\" : \"unknown\",\n reason:\n reason === \"authorization\" ||\n reason === \"rate-limited\" ||\n reason === \"configuration\" ||\n reason === \"transport\" ||\n reason === \"timeout\" ||\n reason === \"malformed\"\n ? reason\n : \"provider\",\n ...(error.status === undefined ? {} : { status: error.status }),\n ...(error.retryAfterMillis === undefined\n ? {}\n : { retryAfterMillis: error.retryAfterMillis }),\n });\n };\n\n const allocate = Effect.gen(function* () {\n if (writer !== undefined) yield* writer.recordAttempt(attempt);\n admitted = true;\n\n const raw = yield* restore(\n client.json(\"POST\", \"/v1/sessions\", launch.body, options.allocationDeadline),\n ).pipe(Effect.mapError(failedAllocation));\n\n const identity = yield* Schema.decodeUnknownEffect(AllocatedIdentity)(raw).pipe(\n Effect.mapError(() =>\n AllocationError.make({ attempt, outcome: \"unknown\", reason: \"malformed\" }),\n ),\n );\n\n // Save identity before interpreting any connection credentials or provider metadata.\n reference = Object.freeze(\n SessionReference.make({\n provider: \"browserbase\",\n projectId: identity.projectId,\n sessionId: identity.id,\n }),\n );\n writer?.recordSession(attempt, reference);\n if (reference.projectId !== client.projectId) {\n return yield* AllocationError.make({\n attempt,\n reference,\n outcome: \"unknown\",\n reason: \"malformed\",\n });\n }\n const ref = reference;\n\n return {\n reference: ref,\n attempt,\n launch,\n resourceScope,\n isClosed: () => closing,\n connection: (timeoutMillis: number) =>\n Effect.suspend(() =>\n closing\n ? Effect.fail(\n SessionError.make({\n operation: \"session-connect\",\n reason: \"expired\",\n outcome: \"undispatched\",\n }),\n )\n : connectionAddress(client, sessions, ref, timeoutMillis),\n ),\n release: closeScope.pipe(\n Effect.andThen(\n Effect.suspend(() =>\n cleanup === undefined\n ? Effect.die(new Error(\"Owned session closed without cleanup evidence\"))\n : Effect.succeed(cleanup),\n ),\n ),\n ),\n cleanupResult: Effect.sync(() => Option.fromNullishOr(cleanup)),\n };\n });\n\n return yield* allocate.pipe(\n Effect.onError(() => closeScope),\n Effect.onInterrupt(() => closeScope),\n );\n }),\n );\n});\n\nexport type RemoteAcquisition = Effect.Success<ReturnType<typeof acquireRemote>>;\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,oBAAoB;AASjC,MAAa,uBAAsC;CACjD,iBAAiB;CACjB,eAAe;CACf,gBAAgB;AAClB;;;;;;AAOA,MAAa,cAAc,OAAO,WAAW,WAC3C,WACA,WACA,UACA,OACA,QACA,SAAwB,sBACxB;CACA,IAAI;CA2EJ,OAAO;EACL,OAAA,OA1EmB,OAAO,OAC1B,OAAO,gBACL,OAAO,IAAI,aAAa;GACtB,MAAM,SAAyB,CAAC;GAEhC,MAAM,QACJ,MACA,QACA,iBAEA,YAAY,QAAQ,YAAY,CAAC,CAAC,KAChC,OAAO,KAAK,WACV,OAAO,WAAW;IAChB,IAAI,OAAO,SAAS,WAClB,OAAO,KAAK,aAAa,KAAK;KAAE,MAAM;KAAM,QAAQ,OAAO;IAAO,CAAC,CAAC;GACxE,CAAC,CACH,CACF;GAGF,OAAO,KAAK,SAAS,MAAM,OAAO,OAAO,eAAe;GACxD,OAAO,KAAK,WAAW,MAAM,SAAS,OAAO,eAAe;GAC5D,OAAO,KAAK,kBAAkB,MAAM,gBAAgB,OA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AAW;KACX,QAAQ;KACR,SAAS;IACX,CAAC,CACH,IACA,kBAAkB,QAAQ,UAAU,KAAK,aAAa,CAC5D;IACF,SAAS,WAAW,KAClB,OAAO,QACL,OAAO,cACL,YAAY,KAAA,IACR,OAAO,oBAAI,IAAI,MAAM,+CAA+C,CAAC,IACrE,OAAO,QAAQ,OAAO,CAC5B,CACF,CACF;IACA,eAAe,OAAO,WAAW,OAAO,cAAc,OAAO,CAAC;GAChE;EACF,CAEqB,CAAC,CAAC,KACrB,OAAO,cAAc,UAAU,GAC/B,OAAO,kBAAkB,UAAU,CACrC;CACF,CAAC,CACH;AACF,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
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/Agents.d.ts
|
|
6
|
+
declare const AgentRunStatus: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>;
|
|
7
|
+
type AgentRunStatus = typeof AgentRunStatus.Type;
|
|
8
|
+
declare const isTerminalAgentRunStatus: (status: AgentRunStatus) => boolean;
|
|
9
|
+
declare const AgentMetadata_base: Schema.Class<AgentMetadata, Schema.Struct<{
|
|
10
|
+
readonly agentId: Schema.NonEmptyString;
|
|
11
|
+
readonly name: Schema.String;
|
|
12
|
+
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
13
|
+
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
14
|
+
readonly createdAt: Schema.String;
|
|
15
|
+
readonly updatedAt: Schema.String;
|
|
16
|
+
}>, {}>;
|
|
17
|
+
declare class AgentMetadata extends AgentMetadata_base {}
|
|
18
|
+
declare const AgentRun_base: Schema.Class<AgentRun, Schema.Struct<{
|
|
19
|
+
readonly runId: Schema.NonEmptyString;
|
|
20
|
+
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
21
|
+
readonly task: Schema.String;
|
|
22
|
+
readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>;
|
|
23
|
+
readonly sessionId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
24
|
+
readonly sandboxId: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
|
+
readonly result: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
27
|
+
readonly cause: Schema.optionalKey<Schema.Struct<{
|
|
28
|
+
readonly code: Schema.String;
|
|
29
|
+
readonly message: Schema.optionalKey<Schema.String>;
|
|
30
|
+
}>>;
|
|
31
|
+
readonly startedAt: Schema.optionalKey<Schema.String>;
|
|
32
|
+
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
33
|
+
readonly createdAt: Schema.String;
|
|
34
|
+
readonly updatedAt: Schema.String;
|
|
35
|
+
}>, {}>;
|
|
36
|
+
declare class AgentRun extends AgentRun_base {}
|
|
37
|
+
declare const AgentRunMessage_base: Schema.Class<AgentRunMessage, Schema.Struct<{
|
|
38
|
+
readonly id: Schema.String;
|
|
39
|
+
readonly createdAt: Schema.String;
|
|
40
|
+
readonly role: Schema.Literals<readonly ["assistant", "tool"]>;
|
|
41
|
+
readonly content: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
42
|
+
}>, {}>;
|
|
43
|
+
declare class AgentRunMessage extends AgentRunMessage_base {}
|
|
44
|
+
declare const AgentDefinition: Schema.Struct<{
|
|
45
|
+
readonly name: Schema.NonEmptyString;
|
|
46
|
+
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
47
|
+
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
48
|
+
}>;
|
|
49
|
+
type AgentDefinition = typeof AgentDefinition.Type;
|
|
50
|
+
declare const AgentUpdate: Schema.Struct<{
|
|
51
|
+
readonly name: Schema.optionalKey<Schema.NonEmptyString>;
|
|
52
|
+
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
54
|
+
}>;
|
|
55
|
+
type AgentUpdate = typeof AgentUpdate.Type;
|
|
56
|
+
declare const AgentRunRequest: Schema.Struct<{
|
|
57
|
+
readonly task: Schema.NonEmptyString;
|
|
58
|
+
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
59
|
+
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
60
|
+
readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
61
|
+
readonly value: Schema.String;
|
|
62
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
63
|
+
}>>>;
|
|
64
|
+
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
65
|
+
/**
|
|
66
|
+
* A persisting run writes the Context from Browserbase's side, outside
|
|
67
|
+
* `ContextCoordination.withWriter`. It is refused while a local writer holds the
|
|
68
|
+
* Context, but nothing stops a later local writer from racing the hosted run.
|
|
69
|
+
*/
|
|
70
|
+
readonly context: Schema.optionalKey<Schema.Struct<{
|
|
71
|
+
readonly reference: typeof ContextReference;
|
|
72
|
+
readonly persist: Schema.Boolean;
|
|
73
|
+
}>>;
|
|
74
|
+
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
75
|
+
readonly type: Schema.Literal<"browserbase">;
|
|
76
|
+
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
77
|
+
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
78
|
+
readonly country: Schema.String;
|
|
79
|
+
readonly state: Schema.optionalKey<Schema.String>;
|
|
80
|
+
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
81
|
+
}>>;
|
|
82
|
+
}>, Schema.Struct<{
|
|
83
|
+
readonly type: Schema.Literal<"external">;
|
|
84
|
+
readonly server: Schema.NonEmptyString;
|
|
85
|
+
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
86
|
+
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
87
|
+
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
readonly type: Schema.Literal<"none">;
|
|
90
|
+
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
91
|
+
}>]>>]>>;
|
|
92
|
+
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
93
|
+
}>>;
|
|
94
|
+
}>;
|
|
95
|
+
type AgentRunRequest = typeof AgentRunRequest.Type;
|
|
96
|
+
declare const AgentListQuery: Schema.Struct<{
|
|
97
|
+
readonly startAt: Schema.optionalKey<Schema.String>;
|
|
98
|
+
readonly endAt: Schema.optionalKey<Schema.String>;
|
|
99
|
+
readonly cursor: Schema.optionalKey<Schema.NonEmptyString>;
|
|
100
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
101
|
+
}>;
|
|
102
|
+
type AgentListQuery = typeof AgentListQuery.Type;
|
|
103
|
+
declare const AgentRunListQuery: Schema.Struct<{
|
|
104
|
+
readonly startAt: Schema.optionalKey<Schema.String>;
|
|
105
|
+
readonly endAt: Schema.optionalKey<Schema.String>;
|
|
106
|
+
readonly cursor: Schema.optionalKey<Schema.NonEmptyString>;
|
|
107
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>>;
|
|
108
|
+
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
109
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
110
|
+
}>;
|
|
111
|
+
type AgentRunListQuery = typeof AgentRunListQuery.Type;
|
|
112
|
+
declare const AgentMessageQuery: Schema.Struct<{
|
|
113
|
+
readonly since: Schema.optionalKey<Schema.NonEmptyString>;
|
|
114
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
115
|
+
readonly all: Schema.optionalKey<Schema.Boolean>;
|
|
116
|
+
}>;
|
|
117
|
+
type AgentMessageQuery = typeof AgentMessageQuery.Type;
|
|
118
|
+
declare const AgentRunWaitOptions: Schema.Struct<{
|
|
119
|
+
readonly timeoutMillis: Schema.Int;
|
|
120
|
+
readonly pollIntervalMillis: Schema.optionalKey<Schema.Int>;
|
|
121
|
+
}>;
|
|
122
|
+
type AgentRunWaitOptions = typeof AgentRunWaitOptions.Type;
|
|
123
|
+
interface Page<A> {
|
|
124
|
+
readonly items: ReadonlyArray<A>;
|
|
125
|
+
readonly nextCursor: string | undefined;
|
|
126
|
+
}
|
|
127
|
+
interface AgentMessages {
|
|
128
|
+
readonly messages: ReadonlyArray<AgentRunMessage>;
|
|
129
|
+
readonly nextSince: string | undefined;
|
|
130
|
+
}
|
|
131
|
+
declare const BrowserbaseAgents_base: Context.ServiceClass<BrowserbaseAgents, "effect-browserbase/Agents", {
|
|
132
|
+
readonly create: (definition: AgentDefinition) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
133
|
+
readonly list: (query?: AgentListQuery) => Effect.Effect<Page<AgentMetadata>, PlatformError>;
|
|
134
|
+
readonly retrieve: (agentId: string) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
135
|
+
readonly update: (agentId: string, update: AgentUpdate) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
136
|
+
readonly delete: (agentId: string) => Effect.Effect<void, PlatformError>;
|
|
137
|
+
readonly run: (request: AgentRunRequest) => Effect.Effect<AgentRun, PlatformError>;
|
|
138
|
+
readonly retrieveRun: (runId: string) => Effect.Effect<AgentRun, PlatformError>;
|
|
139
|
+
readonly listRuns: (query?: AgentRunListQuery) => Effect.Effect<Page<AgentRun>, PlatformError>;
|
|
140
|
+
readonly stopRun: (runId: string) => Effect.Effect<AgentRun, PlatformError>;
|
|
141
|
+
readonly messages: (runId: string, query?: AgentMessageQuery) => Effect.Effect<AgentMessages, PlatformError>;
|
|
142
|
+
/** Polls until the run is terminal. Interrupting the wait does not stop the run. */
|
|
143
|
+
readonly waitForRun: (runId: string, options: AgentRunWaitOptions) => Effect.Effect<AgentRun, PlatformError>;
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Browserbase Agents: hosted autonomous runs that allocate their own browser sessions and
|
|
147
|
+
* bill inference. Creating or stopping a run is never retried; a lost reply is `unknown`.
|
|
148
|
+
*/
|
|
149
|
+
declare class BrowserbaseAgents extends BrowserbaseAgents_base {
|
|
150
|
+
static readonly layer: Layer.Layer<BrowserbaseAgents, never, BrowserbaseClient>;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { AgentMetadata as a, AgentRunMessage as c, AgentRunWaitOptions as d, AgentUpdate as f, isTerminalAgentRunStatus as h, AgentMessages as i, AgentRunRequest as l, Page as m, AgentListQuery as n, AgentRun as o, BrowserbaseAgents as p, AgentMessageQuery as r, AgentRunListQuery as s, AgentDefinition as t, AgentRunStatus as u };
|
|
154
|
+
export {};
|
|
155
|
+
//# sourceMappingURL=Agents-5HpTp9YE.d.mts.map
|
package/dist/Agents.d.mts
CHANGED
|
@@ -1,156 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
-
declare namespace Agents_d_exports {
|
|
6
|
-
export { AgentDefinition, AgentListQuery, AgentMessageQuery, AgentMessages, AgentMetadata, AgentRun, AgentRunListQuery, AgentRunMessage, AgentRunRequest, AgentRunStatus, AgentRunWaitOptions, AgentUpdate, BrowserbaseAgents, Page, isTerminalAgentRunStatus };
|
|
7
|
-
}
|
|
8
|
-
export declare const AgentRunStatus: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>;
|
|
9
|
-
export type AgentRunStatus = typeof AgentRunStatus.Type;
|
|
10
|
-
export declare const isTerminalAgentRunStatus: (status: AgentRunStatus) => boolean;
|
|
11
|
-
declare const AgentMetadata_base: Schema.Class<AgentMetadata, Schema.Struct<{
|
|
12
|
-
readonly agentId: Schema.NonEmptyString;
|
|
13
|
-
readonly name: Schema.String;
|
|
14
|
-
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
15
|
-
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
16
|
-
readonly createdAt: Schema.String;
|
|
17
|
-
readonly updatedAt: Schema.String;
|
|
18
|
-
}>, {}>;
|
|
19
|
-
export declare class AgentMetadata extends AgentMetadata_base {}
|
|
20
|
-
declare const AgentRun_base: Schema.Class<AgentRun, Schema.Struct<{
|
|
21
|
-
readonly runId: Schema.NonEmptyString;
|
|
22
|
-
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
23
|
-
readonly task: Schema.String;
|
|
24
|
-
readonly status: Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>;
|
|
25
|
-
readonly sessionId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
26
|
-
readonly sandboxId: Schema.optionalKey<Schema.String>;
|
|
27
|
-
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
28
|
-
readonly result: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
29
|
-
readonly cause: Schema.optionalKey<Schema.Struct<{
|
|
30
|
-
readonly code: Schema.String;
|
|
31
|
-
readonly message: Schema.optionalKey<Schema.String>;
|
|
32
|
-
}>>;
|
|
33
|
-
readonly startedAt: Schema.optionalKey<Schema.String>;
|
|
34
|
-
readonly endedAt: Schema.optionalKey<Schema.String>;
|
|
35
|
-
readonly createdAt: Schema.String;
|
|
36
|
-
readonly updatedAt: Schema.String;
|
|
37
|
-
}>, {}>;
|
|
38
|
-
export declare class AgentRun extends AgentRun_base {}
|
|
39
|
-
declare const AgentRunMessage_base: Schema.Class<AgentRunMessage, Schema.Struct<{
|
|
40
|
-
readonly id: Schema.String;
|
|
41
|
-
readonly createdAt: Schema.String;
|
|
42
|
-
readonly role: Schema.Literals<readonly ["assistant", "tool"]>;
|
|
43
|
-
readonly content: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
44
|
-
}>, {}>;
|
|
45
|
-
export declare class AgentRunMessage extends AgentRunMessage_base {}
|
|
46
|
-
export declare const AgentDefinition: Schema.Struct<{
|
|
47
|
-
readonly name: Schema.NonEmptyString;
|
|
48
|
-
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
49
|
-
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
50
|
-
}>;
|
|
51
|
-
export type AgentDefinition = typeof AgentDefinition.Type;
|
|
52
|
-
export declare const AgentUpdate: Schema.Struct<{
|
|
53
|
-
readonly name: Schema.optionalKey<Schema.NonEmptyString>;
|
|
54
|
-
readonly systemPrompt: Schema.optionalKey<Schema.String>;
|
|
55
|
-
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
56
|
-
}>;
|
|
57
|
-
export type AgentUpdate = typeof AgentUpdate.Type;
|
|
58
|
-
export declare const AgentRunRequest: Schema.Struct<{
|
|
59
|
-
readonly task: Schema.NonEmptyString;
|
|
60
|
-
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
61
|
-
readonly resultSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
62
|
-
readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
63
|
-
readonly value: Schema.String;
|
|
64
|
-
readonly description: Schema.optionalKey<Schema.String>;
|
|
65
|
-
}>>>;
|
|
66
|
-
readonly browserSettings: Schema.optionalKey<Schema.Struct<{
|
|
67
|
-
/**
|
|
68
|
-
* A persisting run writes the Context from Browserbase's side, outside
|
|
69
|
-
* `ContextCoordination.withWriter`. It is refused while a local writer holds the
|
|
70
|
-
* Context, but nothing stops a later local writer from racing the hosted run.
|
|
71
|
-
*/
|
|
72
|
-
readonly context: Schema.optionalKey<Schema.Struct<{
|
|
73
|
-
readonly reference: typeof ContextReference;
|
|
74
|
-
readonly persist: Schema.Boolean;
|
|
75
|
-
}>>;
|
|
76
|
-
readonly proxies: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
77
|
-
readonly type: Schema.Literal<"browserbase">;
|
|
78
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
79
|
-
readonly geolocation: Schema.optionalKey<Schema.Struct<{
|
|
80
|
-
readonly country: Schema.String;
|
|
81
|
-
readonly state: Schema.optionalKey<Schema.String>;
|
|
82
|
-
readonly city: Schema.optionalKey<Schema.NonEmptyString>;
|
|
83
|
-
}>>;
|
|
84
|
-
}>, Schema.Struct<{
|
|
85
|
-
readonly type: Schema.Literal<"external">;
|
|
86
|
-
readonly server: Schema.NonEmptyString;
|
|
87
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
88
|
-
readonly username: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
89
|
-
readonly password: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
90
|
-
}>, Schema.Struct<{
|
|
91
|
-
readonly type: Schema.Literal<"none">;
|
|
92
|
-
readonly domainPattern: Schema.optionalKey<Schema.NonEmptyString>;
|
|
93
|
-
}>]>>]>>;
|
|
94
|
-
readonly verified: Schema.optionalKey<Schema.Boolean>;
|
|
95
|
-
}>>;
|
|
96
|
-
}>;
|
|
97
|
-
export type AgentRunRequest = typeof AgentRunRequest.Type;
|
|
98
|
-
export declare const AgentListQuery: Schema.Struct<{
|
|
99
|
-
readonly startAt: Schema.optionalKey<Schema.String>;
|
|
100
|
-
readonly endAt: Schema.optionalKey<Schema.String>;
|
|
101
|
-
readonly cursor: Schema.optionalKey<Schema.NonEmptyString>;
|
|
102
|
-
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
103
|
-
}>;
|
|
104
|
-
export type AgentListQuery = typeof AgentListQuery.Type;
|
|
105
|
-
export declare const AgentRunListQuery: Schema.Struct<{
|
|
106
|
-
readonly startAt: Schema.optionalKey<Schema.String>;
|
|
107
|
-
readonly endAt: Schema.optionalKey<Schema.String>;
|
|
108
|
-
readonly cursor: Schema.optionalKey<Schema.NonEmptyString>;
|
|
109
|
-
readonly status: Schema.optionalKey<Schema.Literals<readonly ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STOPPED", "TIMED_OUT"]>>;
|
|
110
|
-
readonly agentId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
111
|
-
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
112
|
-
}>;
|
|
113
|
-
export type AgentRunListQuery = typeof AgentRunListQuery.Type;
|
|
114
|
-
export declare const AgentMessageQuery: Schema.Struct<{
|
|
115
|
-
readonly since: Schema.optionalKey<Schema.NonEmptyString>;
|
|
116
|
-
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
117
|
-
readonly all: Schema.optionalKey<Schema.Boolean>;
|
|
118
|
-
}>;
|
|
119
|
-
export type AgentMessageQuery = typeof AgentMessageQuery.Type;
|
|
120
|
-
export declare const AgentRunWaitOptions: Schema.Struct<{
|
|
121
|
-
readonly timeoutMillis: Schema.Int;
|
|
122
|
-
readonly pollIntervalMillis: Schema.optionalKey<Schema.Int>;
|
|
123
|
-
}>;
|
|
124
|
-
export type AgentRunWaitOptions = typeof AgentRunWaitOptions.Type;
|
|
125
|
-
export interface Page<A> {
|
|
126
|
-
readonly items: ReadonlyArray<A>;
|
|
127
|
-
readonly nextCursor: string | undefined;
|
|
128
|
-
}
|
|
129
|
-
export interface AgentMessages {
|
|
130
|
-
readonly messages: ReadonlyArray<AgentRunMessage>;
|
|
131
|
-
readonly nextSince: string | undefined;
|
|
132
|
-
}
|
|
133
|
-
declare const BrowserbaseAgents_base: Context.ServiceClass<BrowserbaseAgents, "effect-browserbase/Agents", {
|
|
134
|
-
readonly create: (definition: AgentDefinition) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
135
|
-
readonly list: (query?: AgentListQuery) => Effect.Effect<Page<AgentMetadata>, PlatformError>;
|
|
136
|
-
readonly retrieve: (agentId: string) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
137
|
-
readonly update: (agentId: string, update: AgentUpdate) => Effect.Effect<AgentMetadata, PlatformError>;
|
|
138
|
-
readonly delete: (agentId: string) => Effect.Effect<void, PlatformError>;
|
|
139
|
-
readonly run: (request: AgentRunRequest) => Effect.Effect<AgentRun, PlatformError>;
|
|
140
|
-
readonly retrieveRun: (runId: string) => Effect.Effect<AgentRun, PlatformError>;
|
|
141
|
-
readonly listRuns: (query?: AgentRunListQuery) => Effect.Effect<Page<AgentRun>, PlatformError>;
|
|
142
|
-
readonly stopRun: (runId: string) => Effect.Effect<AgentRun, PlatformError>;
|
|
143
|
-
readonly messages: (runId: string, query?: AgentMessageQuery) => Effect.Effect<AgentMessages, PlatformError>;
|
|
144
|
-
/** Polls until the run is terminal. Interrupting the wait does not stop the run. */
|
|
145
|
-
readonly waitForRun: (runId: string, options: AgentRunWaitOptions) => Effect.Effect<AgentRun, PlatformError>;
|
|
146
|
-
}>;
|
|
147
|
-
/**
|
|
148
|
-
* Browserbase Agents: hosted autonomous runs that allocate their own browser sessions and
|
|
149
|
-
* bill inference. Creating or stopping a run is never retried; a lost reply is `unknown`.
|
|
150
|
-
*/
|
|
151
|
-
export declare class BrowserbaseAgents extends BrowserbaseAgents_base {
|
|
152
|
-
static readonly layer: Layer.Layer<BrowserbaseAgents, never, BrowserbaseClient>;
|
|
153
|
-
}
|
|
154
|
-
//#endregion
|
|
155
|
-
export { Agents_d_exports as t };
|
|
156
|
-
//# sourceMappingURL=Agents.d.mts.map
|
|
1
|
+
import { a as AgentMetadata, c as AgentRunMessage, d as AgentRunWaitOptions, f as AgentUpdate, h as isTerminalAgentRunStatus, i as AgentMessages, l as AgentRunRequest, m as Page, n as AgentListQuery, o as AgentRun, p as BrowserbaseAgents, r as AgentMessageQuery, s as AgentRunListQuery, t as AgentDefinition, u as AgentRunStatus } from "./Agents-5HpTp9YE.mjs";
|
|
2
|
+
export { AgentDefinition, AgentListQuery, AgentMessageQuery, AgentMessages, AgentMetadata, AgentRun, AgentRunListQuery, AgentRunMessage, AgentRunRequest, AgentRunStatus, AgentRunWaitOptions, AgentUpdate, BrowserbaseAgents, Page, isTerminalAgentRunStatus };
|
|
3
|
+
export {};
|