@effect-agent/platform-cloudflare 0.1.0-beta.110 → 0.1.0-beta.111

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.
@@ -495,13 +495,13 @@ export declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCo
495
495
  readonly author: string;
496
496
  readonly reason: string;
497
497
  readonly resolution: {
498
- readonly _tag: "SafeToRetry";
499
- } | {
500
498
  readonly _tag: "CompletedWithResult";
501
499
  readonly result: Schema.Json;
502
500
  readonly isFailure: boolean;
503
501
  } | {
504
502
  readonly _tag: "NeverHappened";
503
+ } | {
504
+ readonly _tag: "SafeToRetry";
505
505
  } | {
506
506
  readonly _tag: "AbortSubmission";
507
507
  };
@@ -665,11 +665,6 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
665
665
  readonly createdAt: string;
666
666
  readonly deploymentId: string;
667
667
  readonly payload: {
668
- readonly _tag: "AbortRequested";
669
- readonly submissionId: string;
670
- readonly author: string;
671
- readonly reason: string;
672
- } | {
673
668
  readonly _tag: "ThreadCreated";
674
669
  readonly agentId: string;
675
670
  readonly definitions: {
@@ -947,6 +942,11 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
947
942
  readonly runDisposition?: Schema.Json | undefined;
948
943
  readonly finishReason?: "budget-exhausted" | undefined;
949
944
  readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
945
+ } | {
946
+ readonly _tag: "AbortRequested";
947
+ readonly submissionId: string;
948
+ readonly author: string;
949
+ readonly reason: string;
950
950
  } | {
951
951
  readonly _tag: "SubmissionSettled";
952
952
  readonly submissionId: string;
@@ -1509,13 +1509,13 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
1509
1509
  readonly author: string;
1510
1510
  readonly reason: string;
1511
1511
  readonly resolution: {
1512
- readonly _tag: "SafeToRetry";
1513
- } | {
1514
1512
  readonly _tag: "CompletedWithResult";
1515
1513
  readonly result: Schema.Json;
1516
1514
  readonly isFailure: boolean;
1517
1515
  } | {
1518
1516
  readonly _tag: "NeverHappened";
1517
+ } | {
1518
+ readonly _tag: "SafeToRetry";
1519
1519
  } | {
1520
1520
  readonly _tag: "AbortSubmission";
1521
1521
  };
@@ -1529,6 +1529,19 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
1529
1529
  readonly operation: string;
1530
1530
  readonly message: string;
1531
1531
  readonly cause?: Schema.Json | undefined;
1532
+ } | {
1533
+ readonly _tag: "ThreadNotMaterialized";
1534
+ readonly threadId: string;
1535
+ } | {
1536
+ readonly _tag: "ThreadStoreError";
1537
+ readonly operation: string;
1538
+ readonly message: string;
1539
+ readonly cause?: Schema.Json | undefined;
1540
+ } | {
1541
+ readonly _tag: "LedgerError";
1542
+ readonly operation: string;
1543
+ readonly message: string;
1544
+ readonly cause?: import("effect-agent/failure-diagnostic").Diagnostic | undefined;
1532
1545
  } | {
1533
1546
  readonly _tag: "AdmissionConflict";
1534
1547
  readonly threadId: string;
@@ -1550,19 +1563,6 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
1550
1563
  readonly _tag: "JoinedToHost";
1551
1564
  readonly submissionId: string;
1552
1565
  readonly hostSubmissionId: string;
1553
- } | {
1554
- readonly _tag: "LedgerError";
1555
- readonly operation: string;
1556
- readonly message: string;
1557
- readonly cause?: import("effect-agent/failure-diagnostic").Diagnostic | undefined;
1558
- } | {
1559
- readonly _tag: "ThreadStoreError";
1560
- readonly operation: string;
1561
- readonly message: string;
1562
- readonly cause?: Schema.Json | undefined;
1563
- } | {
1564
- readonly _tag: "ThreadNotMaterialized";
1565
- readonly threadId: string;
1566
1566
  } | {
1567
1567
  readonly _tag: "AppendConflict";
1568
1568
  readonly threadId: string;
@@ -1575,9 +1575,6 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
1575
1575
  readonly threadId: string;
1576
1576
  readonly actualEpoch: number;
1577
1577
  readonly attemptedEpoch: number;
1578
- } | {
1579
- readonly _tag: "HostProtocolError";
1580
- readonly message: string;
1581
1578
  } | {
1582
1579
  readonly _tag: "OperationDenied";
1583
1580
  readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
@@ -1599,6 +1596,9 @@ export declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorde
1599
1596
  readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
1600
1597
  readonly actual: number;
1601
1598
  readonly maximum: number;
1599
+ } | {
1600
+ readonly _tag: "HostProtocolError";
1601
+ readonly message: string;
1602
1602
  } | {
1603
1603
  readonly _tag: "ApprovalConflict";
1604
1604
  readonly submissionId: string;
@@ -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
- * A timeout or interruption leaves the session unusable; no resize is retried.
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 { isBrowserRunUndispatchedActionError as C, browserRunInteractiveLayer as S, BrowserRunSessionLifecycle as T, BrowserRunViewport as _, BrowserRunInteractiveAcquisition as a, browserRunInteractiveHostLayer as b, BrowserRunInteractiveCdpSession as c, BrowserRunInteractivePage as d, BrowserRunInteractiveRequest as f, BrowserRunLiveViewResult as g, BrowserRunLiveViewRequest as h, BrowserRunHandoffState as i, BrowserRunInteractiveContext as l, BrowserRunInteractiveSession as m, BrowserRunHandoffRequest as n, BrowserRunInteractiveBinding as o, BrowserRunInteractiveRequestListener as p, BrowserRunHandoffResult as r, BrowserRunInteractiveBrowser as s, BrowserRunCloudflareCommand as t, BrowserRunInteractiveHost as u, CloudflareInteractiveBrowser as v, BrowserRunCleanupError as w, browserRunInteractiveImplementation as x, CloudflareInteractiveBrowserOptions as y };
171
- //# sourceMappingURL=InteractiveBrowser-CKp6pqmw.d.mts.map
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