@effect-agent/platform-cloudflare 0.1.0-beta.36 → 0.1.0-beta.37
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/dist/index.d.mts +9 -103
- package/dist/index.mjs +8 -824
- package/dist/index.mjs.map +1 -1
- package/dist/interactive-browser.d.mts +27 -5
- package/dist/interactive-browser.mjs +530 -69
- package/dist/interactive-browser.mjs.map +1 -1
- package/dist/scheduling-B-OFqoS9.mjs +1189 -0
- package/dist/scheduling-B-OFqoS9.mjs.map +1 -0
- package/dist/scheduling-BJs_kHTx.d.mts +142 -0
- package/dist/scheduling.d.mts +2 -0
- package/dist/scheduling.mjs +2 -0
- package/package.json +11 -10
- package/src/index.ts +1 -0
- package/src/interactive-browser.ts +843 -75
- package/src/layers.ts +1 -1
- package/src/scheduling.ts +676 -0
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Redacted, Schema, Scope } from "effect";
|
|
2
|
-
import { BrowserHandle, InteractiveBrowser, InteractiveBrowserError, InteractiveBrowserPolicy, SandboxImplementation } from "@effect-agent/sandbox";
|
|
2
|
+
import { BrowserHandle, InteractiveBrowser, InteractiveBrowserError, InteractiveBrowserPolicy, InteractiveBrowserPolicyDeniedError, SandboxImplementation } from "@effect-agent/sandbox";
|
|
3
3
|
//#region src/interactive-browser.d.ts
|
|
4
4
|
declare const browserRunInteractiveImplementation: SandboxImplementation;
|
|
5
|
+
declare const BrowserRunViewport_base: Schema.Class<BrowserRunViewport, Schema.Struct<{
|
|
6
|
+
readonly width: Schema.Int;
|
|
7
|
+
readonly height: Schema.Int;
|
|
8
|
+
readonly deviceScaleFactor: Schema.optionalKey<Schema.Finite>;
|
|
9
|
+
}>, {}>;
|
|
10
|
+
/**
|
|
11
|
+
* Host presentation state in CSS pixels. Dimensions are integers in 1..2048,
|
|
12
|
+
* density is finite in 1..2 (default 1), and neither scaled dimension may exceed
|
|
13
|
+
* 2048 pixels. Mobile, touch, and orientation emulation are not supported.
|
|
14
|
+
*/
|
|
15
|
+
declare class BrowserRunViewport extends BrowserRunViewport_base {}
|
|
5
16
|
declare const BrowserRunLiveViewRequest_base: Schema.Class<BrowserRunLiveViewRequest, Schema.Struct<{
|
|
6
17
|
readonly mode: Schema.Literal<"tab">;
|
|
7
18
|
readonly expiresInMs: Schema.Int;
|
|
@@ -51,10 +62,11 @@ interface BrowserRunInteractivePage {
|
|
|
51
62
|
readonly goto: (url: string) => Promise<void>;
|
|
52
63
|
readonly url: () => unknown;
|
|
53
64
|
readonly readText: (selector: string | undefined, maximumBytes: number) => Promise<unknown>;
|
|
54
|
-
readonly fill: (selector: string, value: string) => Promise<
|
|
55
|
-
readonly click: (selector: string) => Promise<
|
|
65
|
+
readonly fill: (selector: string, value: string, signal: AbortSignal, onDispatch: () => void) => Promise<unknown>;
|
|
66
|
+
readonly click: (selector: string, signal: AbortSignal, onDispatch: () => void) => Promise<unknown>;
|
|
56
67
|
readonly screenshot: (fullPage: boolean) => Promise<unknown>;
|
|
57
68
|
readonly scroll: (deltaX: number, deltaY: number) => Promise<void>;
|
|
69
|
+
readonly setViewport: (viewport: BrowserRunViewport) => Promise<void>;
|
|
58
70
|
readonly createCdpSession: () => Promise<BrowserRunInteractiveCdpSession>;
|
|
59
71
|
}
|
|
60
72
|
interface BrowserRunInteractiveContext {
|
|
@@ -77,11 +89,19 @@ declare const BrowserRunInteractiveBinding_base: Context.ServiceClass<BrowserRun
|
|
|
77
89
|
declare class BrowserRunInteractiveBinding extends BrowserRunInteractiveBinding_base {
|
|
78
90
|
static layer(options: {
|
|
79
91
|
readonly browser: BrowserRun;
|
|
80
|
-
|
|
92
|
+
readonly viewport?: BrowserRunViewport;
|
|
93
|
+
}): Layer.Layer<BrowserRunInteractiveBinding, InteractiveBrowserPolicyDeniedError>;
|
|
81
94
|
}
|
|
82
95
|
interface BrowserRunInteractiveSession {
|
|
83
96
|
readonly handle: BrowserHandle;
|
|
84
97
|
readonly sessionId: Redacted.Redacted<string>;
|
|
98
|
+
/**
|
|
99
|
+
* Resize without charging an agent action or changing emulation modes. Shares
|
|
100
|
+
* the handle's fail-fast lock, page-policy preflight, and elapsed deadline.
|
|
101
|
+
* A timeout or interruption leaves the session unusable; no resize is retried.
|
|
102
|
+
* The host must authorize callers. No viewer ownership or durable state is added.
|
|
103
|
+
*/
|
|
104
|
+
readonly resizeViewport: (viewport: BrowserRunViewport) => Effect.Effect<void, InteractiveBrowserError>;
|
|
85
105
|
readonly getLiveView: (request: BrowserRunLiveViewRequest) => Effect.Effect<BrowserRunLiveViewResult, InteractiveBrowserError>;
|
|
86
106
|
readonly handoff: (request: BrowserRunHandoffRequest) => Effect.Effect<BrowserRunHandoffResult, InteractiveBrowserError>;
|
|
87
107
|
readonly getHandoffState: Effect.Effect<BrowserRunHandoffState, InteractiveBrowserError>;
|
|
@@ -93,10 +113,12 @@ declare const BrowserRunInteractiveHost_base: Context.ServiceClass<BrowserRunInt
|
|
|
93
113
|
}>;
|
|
94
114
|
/** Cloudflare host authority kept separate from the provider-neutral browser handle. */
|
|
95
115
|
declare class BrowserRunInteractiveHost extends BrowserRunInteractiveHost_base {}
|
|
116
|
+
/** Recognizes a local pre-dispatch refusal without exposing selector or page content. */
|
|
117
|
+
declare const isBrowserRunUndispatchedActionError: (error: unknown) => boolean;
|
|
96
118
|
/** Cloudflare host controls and private session identity for one scoped Browser Run pass. */
|
|
97
119
|
declare const browserRunInteractiveHostLayer: () => Layer.Layer<BrowserRunInteractiveHost, never, BrowserRunInteractiveBinding>;
|
|
98
120
|
/** Worker-only generic adapter; Cloudflare identity and controls remain host-only. */
|
|
99
121
|
declare const browserRunInteractiveLayer: () => Layer.Layer<InteractiveBrowser, never, BrowserRunInteractiveBinding>;
|
|
100
122
|
//#endregion
|
|
101
|
-
export { BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, browserRunInteractiveHostLayer, browserRunInteractiveImplementation, browserRunInteractiveLayer };
|
|
123
|
+
export { BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, BrowserRunViewport, browserRunInteractiveHostLayer, browserRunInteractiveImplementation, browserRunInteractiveLayer, isBrowserRunUndispatchedActionError };
|
|
102
124
|
//# sourceMappingURL=interactive-browser.d.mts.map
|