@effect-agent/platform-cloudflare 0.1.0-beta.110 → 0.1.0-beta.112
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/Alarm.d.mts +34 -8
- package/dist/Alarm.mjs +231 -41
- package/dist/Alarm.mjs.map +1 -1
- package/dist/CloudflareThreadClient.d.mts +49 -42
- package/dist/CloudflareThreadClient.mjs +1 -1
- package/dist/{InteractiveBrowser-CKp6pqmw.d.mts → InteractiveBrowser-BQo7QKaP.d.mts} +64 -7
- package/dist/{InteractiveBrowser-l6J4eP6T.mjs → InteractiveBrowser-CBUFAECo.mjs} +545 -223
- package/dist/InteractiveBrowser-CBUFAECo.mjs.map +1 -0
- package/dist/InteractiveBrowser.d.mts +2 -2
- package/dist/InteractiveBrowser.mjs +2 -2
- package/dist/ProtectedBrowser.d.mts +1 -1
- package/dist/ProtectedBrowser.mjs +1 -1
- package/dist/{ThreadObject-BGla_Obk.mjs → ThreadObject-0k-SVpY_.mjs} +2 -2
- package/dist/ThreadObject-0k-SVpY_.mjs.map +1 -0
- package/dist/{ThreadObject-MSlpVBUD.d.mts → ThreadObject-DVxgrU7c.d.mts} +46 -39
- package/dist/ThreadObject.d.mts +1 -1
- package/dist/ThreadObject.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/Alarm.ts +432 -72
- package/src/InteractiveBrowser.ts +1129 -500
- package/src/ThreadObject.ts +2 -2
- package/dist/InteractiveBrowser-l6J4eP6T.mjs.map +0 -1
- package/dist/ThreadObject-BGla_Obk.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Redacted, Schema, Scope } from "effect";
|
|
2
2
|
import { SandboxImplementation } from "effect-agent/sandbox";
|
|
3
3
|
import { HttpClient } from "effect/unstable/http";
|
|
4
|
-
import { BrowserHandle, BrowserSelectFileRequest, InteractiveBrowser, InteractiveBrowserError, InteractiveBrowserPolicy, InteractiveBrowserPolicyDeniedError } from "effect-agent/interactive-browser";
|
|
4
|
+
import { BrowserExpectedTarget, BrowserHandle, BrowserSelectFileRequest, InteractiveBrowser, InteractiveBrowserError, InteractiveBrowserPolicy, InteractiveBrowserPolicyDeniedError } from "effect-agent/interactive-browser";
|
|
5
5
|
//#region src/internal/browser-session-lifecycle.d.ts
|
|
6
6
|
declare const BrowserRunCleanupError_base: Schema.Class<BrowserRunCleanupError, Schema.TaggedStruct<"BrowserRunCleanupError", {
|
|
7
7
|
readonly reason: Schema.Literals<readonly ["configuration", "authorization", "rate-limited", "provider", "malformed", "timeout", "pending"]>;
|
|
@@ -22,6 +22,25 @@ declare class BrowserRunSessionLifecycle extends BrowserRunSessionLifecycle_base
|
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/InteractiveBrowser.d.ts
|
|
24
24
|
declare const browserRunInteractiveImplementation: SandboxImplementation;
|
|
25
|
+
declare const BrowserRunPageObservation: Schema.fromJsonString<Schema.Struct<{
|
|
26
|
+
readonly documentId: Schema.NonEmptyString;
|
|
27
|
+
readonly pageText: Schema.String;
|
|
28
|
+
readonly selectorMatchCount: Schema.Natural;
|
|
29
|
+
readonly controlsTruncated: Schema.Boolean;
|
|
30
|
+
readonly controls: Schema.$Array<Schema.Struct<{
|
|
31
|
+
readonly kind: Schema.String;
|
|
32
|
+
readonly inputType: Schema.optionalKey<Schema.String>;
|
|
33
|
+
readonly label: Schema.optionalKey<Schema.String>;
|
|
34
|
+
readonly checked: Schema.optionalKey<Schema.Boolean>;
|
|
35
|
+
readonly selected: Schema.optionalKey<Schema.Boolean>;
|
|
36
|
+
readonly disabled: Schema.optionalKey<Schema.Boolean>;
|
|
37
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
38
|
+
readonly valid: Schema.optionalKey<Schema.Boolean>;
|
|
39
|
+
readonly formValid: Schema.optionalKey<Schema.Boolean>;
|
|
40
|
+
readonly nodeId: Schema.NonEmptyString;
|
|
41
|
+
readonly selector: Schema.String;
|
|
42
|
+
}>>;
|
|
43
|
+
}>>;
|
|
25
44
|
declare const BrowserRunViewport_base: Schema.Class<BrowserRunViewport, Schema.Struct<{
|
|
26
45
|
readonly width: Schema.Int;
|
|
27
46
|
readonly height: Schema.Int;
|
|
@@ -74,6 +93,7 @@ interface BrowserRunInteractiveCdpSession {
|
|
|
74
93
|
}
|
|
75
94
|
/** Narrow page boundary used by deterministic tests; SDK values remain in this package. */
|
|
76
95
|
interface BrowserRunInteractivePage {
|
|
96
|
+
readonly identity?: () => Promise<BrowserRunPageIdentity>;
|
|
77
97
|
readonly close: () => Promise<void>;
|
|
78
98
|
readonly setBypassServiceWorker: (enabled: boolean) => Promise<void>;
|
|
79
99
|
readonly setRequestInterception: (enabled: boolean) => Promise<void>;
|
|
@@ -82,9 +102,9 @@ interface BrowserRunInteractivePage {
|
|
|
82
102
|
readonly goto: (url: string) => Promise<void>;
|
|
83
103
|
readonly url: () => unknown;
|
|
84
104
|
readonly readText: (selector: string | undefined, maximumBytes: number) => Promise<unknown>;
|
|
85
|
-
readonly fill: (selector: string, value: string, signal: AbortSignal, onDispatch: () => void) => Promise<unknown>;
|
|
86
|
-
readonly click: (selector: string, signal: AbortSignal, onDispatch: () => void) => Promise<unknown>;
|
|
87
|
-
readonly selectFile: (request: BrowserSelectFileRequest, signal: AbortSignal, onDispatch: () => void) => Promise<unknown>;
|
|
105
|
+
readonly fill: (selector: string, value: string, signal: AbortSignal, onDispatch: () => void, onComplete?: () => void, expectedTarget?: BrowserExpectedTarget) => Promise<unknown>;
|
|
106
|
+
readonly click: (selector: string, signal: AbortSignal, onDispatch: () => void, onComplete?: () => void, expectedTarget?: BrowserExpectedTarget) => Promise<unknown>;
|
|
107
|
+
readonly selectFile: (request: BrowserSelectFileRequest, signal: AbortSignal, onDispatch: () => void, onComplete?: () => void) => Promise<unknown>;
|
|
88
108
|
readonly screenshot: (fullPage: boolean) => Promise<unknown>;
|
|
89
109
|
readonly scroll: (deltaX: number, deltaY: number) => Promise<void>;
|
|
90
110
|
readonly setViewport: (viewport: BrowserRunViewport) => Promise<void>;
|
|
@@ -95,6 +115,11 @@ interface BrowserRunInteractiveContext {
|
|
|
95
115
|
readonly close: () => Promise<void>;
|
|
96
116
|
}
|
|
97
117
|
interface BrowserRunInteractiveBrowser {
|
|
118
|
+
readonly detach?: () => Promise<void>;
|
|
119
|
+
readonly reattach?: (identity: BrowserRunPageIdentity) => Promise<{
|
|
120
|
+
readonly context: BrowserRunInteractiveContext;
|
|
121
|
+
readonly page: BrowserRunInteractivePage;
|
|
122
|
+
} | undefined>;
|
|
98
123
|
readonly createContext: () => Promise<BrowserRunInteractiveContext>;
|
|
99
124
|
readonly close: () => Promise<void>;
|
|
100
125
|
readonly sessionId: () => unknown;
|
|
@@ -115,13 +140,38 @@ declare class BrowserRunInteractiveBinding extends BrowserRunInteractiveBinding_
|
|
|
115
140
|
readonly viewport?: BrowserRunViewport;
|
|
116
141
|
}): Layer.Layer<BrowserRunInteractiveBinding, InteractiveBrowserPolicyDeniedError, BrowserRunSessionLifecycle>;
|
|
117
142
|
}
|
|
143
|
+
declare const BrowserRunPageIdentity_base: Schema.Class<BrowserRunPageIdentity, Schema.Struct<{
|
|
144
|
+
readonly contextId: Schema.String;
|
|
145
|
+
readonly targetId: Schema.String;
|
|
146
|
+
}>, {}>;
|
|
147
|
+
/** Private target identity; never include this checkpoint in model-visible records. */
|
|
148
|
+
declare class BrowserRunPageIdentity extends BrowserRunPageIdentity_base {}
|
|
149
|
+
declare const BrowserRunInteractiveCheckpoint_base: Schema.Class<BrowserRunInteractiveCheckpoint, Schema.Struct<{
|
|
150
|
+
readonly sessionId: Schema.RedactedFromValue<Schema.String>;
|
|
151
|
+
readonly page: typeof BrowserRunPageIdentity;
|
|
152
|
+
readonly policy: typeof InteractiveBrowserPolicy;
|
|
153
|
+
readonly startedAt: Schema.Natural;
|
|
154
|
+
readonly consumedActions: Schema.Natural;
|
|
155
|
+
readonly inputState: Schema.Literals<readonly ["idle", "running", "unknown"]>;
|
|
156
|
+
}>, {}>;
|
|
157
|
+
/** Host-owned recovery data. Persist with the application's input receipts and ownership fence. */
|
|
158
|
+
declare class BrowserRunInteractiveCheckpoint extends BrowserRunInteractiveCheckpoint_base {}
|
|
159
|
+
type BrowserRunInputState = "idle" | "running" | "unknown";
|
|
118
160
|
interface BrowserRunInteractiveSession {
|
|
119
161
|
readonly handle: BrowserHandle;
|
|
162
|
+
readonly checkpoint: Effect.Effect<BrowserRunInteractiveCheckpoint, InteractiveBrowserError>;
|
|
163
|
+
/** Invalidate this owner and disconnect locally, retaining the exact remote page until its deadline.
|
|
164
|
+
* Checkpoint and durable input receipts must be persisted first. Never grants another owner authority.
|
|
165
|
+
*/
|
|
166
|
+
readonly detach: Effect.Effect<void, InteractiveBrowserError>;
|
|
167
|
+
readonly inputState: Effect.Effect<BrowserRunInputState>;
|
|
168
|
+
/** Wait at most 500 ms for local SDK input. A restart/transport-unknown fence cannot be drained. */
|
|
169
|
+
readonly drainInput: Effect.Effect<BrowserRunInputState>;
|
|
120
170
|
readonly sessionId: Redacted.Redacted<string>;
|
|
121
171
|
/**
|
|
122
172
|
* Resize without charging an agent action or changing emulation modes. Shares
|
|
123
173
|
* the handle's fail-fast lock, page-policy preflight, and elapsed deadline.
|
|
124
|
-
*
|
|
174
|
+
* An interrupted resize fences further input until the SDK settles; no resize is retried.
|
|
125
175
|
* The host must authorize callers. No viewer ownership or durable state is added.
|
|
126
176
|
*/
|
|
127
177
|
readonly resizeViewport: (viewport: BrowserRunViewport) => Effect.Effect<void, InteractiveBrowserError>;
|
|
@@ -140,6 +190,13 @@ declare const BrowserRunInteractiveHost_base: Context.ServiceClass<BrowserRunInt
|
|
|
140
190
|
readonly cleanupSemantics?: "confirmed-terminal";
|
|
141
191
|
readonly acquire: (policy: InteractiveBrowserPolicy) => Effect.Effect<BrowserRunInteractiveAcquisition, InteractiveBrowserError, Scope.Scope>;
|
|
142
192
|
readonly open: (policy: InteractiveBrowserPolicy) => Effect.Effect<BrowserRunInteractiveSession, InteractiveBrowserError, Scope.Scope>;
|
|
193
|
+
/** Requires exclusive host ownership. Never allocates a replacement page or replays an action.
|
|
194
|
+
* pendingInput must include durable receipts written after the checkpoint. Unknown input keeps
|
|
195
|
+
* mutations and human control fenced; reads remain available. Only confirmed close ends that fence.
|
|
196
|
+
*/
|
|
197
|
+
readonly resume: (checkpoint: BrowserRunInteractiveCheckpoint, options: {
|
|
198
|
+
readonly pendingInput: boolean;
|
|
199
|
+
}) => Effect.Effect<BrowserRunInteractiveSession, InteractiveBrowserError, Scope.Scope>;
|
|
143
200
|
readonly closeSession: (sessionId: Redacted.Redacted<string>) => Effect.Effect<void, InteractiveBrowserError>;
|
|
144
201
|
}>;
|
|
145
202
|
/** Cloudflare host authority kept separate from the provider-neutral browser handle. */
|
|
@@ -167,5 +224,5 @@ declare const CloudflareInteractiveBrowser: {
|
|
|
167
224
|
hostLayer: (options: CloudflareInteractiveBrowserOptions) => Layer.Layer<BrowserRunInteractiveHost, BrowserRunCleanupError | InteractiveBrowserPolicyDeniedError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
168
225
|
};
|
|
169
226
|
//#endregion
|
|
170
|
-
export {
|
|
171
|
-
//# sourceMappingURL=InteractiveBrowser-
|
|
227
|
+
export { CloudflareInteractiveBrowserOptions as C, isBrowserRunUndispatchedActionError as D, browserRunInteractiveLayer as E, BrowserRunCleanupError as O, CloudflareInteractiveBrowser as S, browserRunInteractiveImplementation as T, BrowserRunLiveViewRequest as _, BrowserRunInputState as a, BrowserRunPageObservation as b, BrowserRunInteractiveBrowser as c, BrowserRunInteractiveContext as d, BrowserRunInteractiveHost as f, BrowserRunInteractiveSession as g, BrowserRunInteractiveRequestListener as h, BrowserRunHandoffState as i, BrowserRunSessionLifecycle as k, BrowserRunInteractiveCdpSession as l, BrowserRunInteractiveRequest as m, BrowserRunHandoffRequest as n, BrowserRunInteractiveAcquisition as o, BrowserRunInteractivePage as p, BrowserRunHandoffResult as r, BrowserRunInteractiveBinding as s, BrowserRunCloudflareCommand as t, BrowserRunInteractiveCheckpoint as u, BrowserRunLiveViewResult as v, browserRunInteractiveHostLayer as w, BrowserRunViewport as x, BrowserRunPageIdentity as y };
|
|
228
|
+
//# sourceMappingURL=InteractiveBrowser-BQo7QKaP.d.mts.map
|