@effect-agent/platform-cloudflare 0.1.0-beta.87 → 0.1.0-beta.89
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/InteractiveBrowser-DUE_m12-.d.mts +161 -0
- package/dist/InteractiveBrowser-DupDtfw2.mjs +1169 -0
- package/dist/InteractiveBrowser-DupDtfw2.mjs.map +1 -0
- package/dist/InteractiveBrowser.d.mts +2 -144
- package/dist/InteractiveBrowser.mjs +1 -1089
- package/dist/ProtectedBrowser.d.mts +70 -14
- package/dist/ProtectedBrowser.mjs +599 -328
- package/dist/ProtectedBrowser.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ProtectedBrowser.ts +7 -0
- package/src/protected-browser/binding.ts +151 -25
- package/src/protected-browser/host.ts +328 -0
- package/src/protected-browser/native.ts +17 -1
- package/src/protected-browser/policy.ts +640 -536
- package/dist/InteractiveBrowser.mjs.map +0 -1
- package/dist/browser-session-lifecycle-CmbQABHC.mjs +0 -84
- package/dist/browser-session-lifecycle-CmbQABHC.mjs.map +0 -1
- package/dist/browser-session-lifecycle-DJpqLXy_.d.mts +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as BrowserRunLiveViewResult, i as BrowserRunHandoffState, m as BrowserRunLiveViewRequest, n as BrowserRunHandoffRequest, w as BrowserRunSessionLifecycle } from "./InteractiveBrowser-DUE_m12-.mjs";
|
|
2
2
|
import { Context, Crypto, Effect, Layer, Redacted, Schema, Scope } from "effect";
|
|
3
3
|
import { InteractiveBrowserPolicy } from "effect-agent/interactive-browser";
|
|
4
|
-
import { CredentialFieldRole, CredentialOrigin, ProtectedBrowser, ProtectedBrowserControl, ProtectedBrowserError, ProtectedCleanup } from "effect-agent/protected-browser";
|
|
4
|
+
import { BrowserCredentialAccess, CredentialFieldRole, CredentialOrigin, ProtectedBrowser, ProtectedBrowserCheckpoint, ProtectedBrowserControl, ProtectedBrowserError, ProtectedBrowserHandle, ProtectedCleanup } from "effect-agent/protected-browser";
|
|
5
5
|
//#region src/protected-browser/policy.d.ts
|
|
6
6
|
declare const ProtectedTransportError_base: Schema.Class<ProtectedTransportError, Schema.TaggedStruct<"ProtectedTransportError", {
|
|
7
7
|
readonly reason: Schema.Literals<readonly ["stale-reference", "needs-attention", "unsupported", "provider"]>;
|
|
@@ -24,6 +24,10 @@ interface ProtectedBrowserTransport {
|
|
|
24
24
|
readonly fill: (ref: string, role: typeof CredentialFieldRole.Type | "text" | "select", value: Redacted.Redacted<string>) => Effect.Effect<void, ProtectedTransportError, ProtectedBrowserDispatch>;
|
|
25
25
|
/** Invalidates local references synchronously before bounded exact-session cleanup. */
|
|
26
26
|
readonly invalidate: () => void;
|
|
27
|
+
/** Forget all discovered controls on a controller transition. */
|
|
28
|
+
readonly resetReferences: () => void;
|
|
29
|
+
/** Host attachment release, available only for transferable provider sessions. */
|
|
30
|
+
readonly detach?: Effect.Effect<void, ProtectedBrowserError>;
|
|
27
31
|
readonly close: Effect.Effect<typeof ProtectedCleanup.Type>;
|
|
28
32
|
}
|
|
29
33
|
declare const BrowserRunProtectedTransport_base: Context.ServiceClass<BrowserRunProtectedTransport, "@effect-agent/platform-cloudflare/BrowserRunProtectedTransport", {
|
|
@@ -44,22 +48,74 @@ declare const ProtectedDiscovery: Schema.Struct<{
|
|
|
44
48
|
readonly controls: Schema.$Array<typeof ProtectedBrowserControl>;
|
|
45
49
|
readonly truncated: Schema.Boolean;
|
|
46
50
|
}>;
|
|
47
|
-
/**
|
|
48
|
-
* Fresh private passes only. Account administrators and Browser Rendering token holders are
|
|
49
|
-
* trusted operators. No viewer, handoff, raw JavaScript, screenshot or plaintext credential API exists.
|
|
50
|
-
* Hosts explicitly authorize post-exposure observations for recipients they trust not to echo.
|
|
51
|
-
*/
|
|
51
|
+
/** Fresh private passes; scoped release confirms exact-session termination. */
|
|
52
52
|
declare const browserRunProtectedLayer: () => Layer.Layer<ProtectedBrowser, never, BrowserRunProtectedTransport | Crypto.Crypto>;
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/protected-browser/binding.d.ts
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
/** Host-private exact page identity; never include it in model-visible results. */
|
|
56
|
+
declare const ProtectedProviderIdentity: Schema.Struct<{
|
|
57
|
+
readonly sessionId: Schema.Redacted<Schema.String>;
|
|
58
|
+
readonly contextId: Schema.Redacted<Schema.NonEmptyString>;
|
|
59
|
+
readonly targetId: Schema.Redacted<Schema.NonEmptyString>;
|
|
60
|
+
}>;
|
|
61
|
+
type ProtectedProviderIdentity = typeof ProtectedProviderIdentity.Type;
|
|
62
|
+
interface ProtectedProviderSession {
|
|
63
|
+
readonly identity: ProtectedProviderIdentity;
|
|
64
|
+
readonly driver: ProtectedBrowserTransport;
|
|
65
|
+
readonly command: (method: "Cloudflare.getLiveView" | "Cloudflare.handoff" | "Cloudflare.getHandoffState", parameters: Readonly<Record<string, string | number>>) => Effect.Effect<unknown, ProtectedBrowserError>;
|
|
66
|
+
readonly detach: Effect.Effect<void, ProtectedBrowserError>;
|
|
67
|
+
}
|
|
68
|
+
declare const BrowserRunProtectedBinding_base: Context.ServiceClass<BrowserRunProtectedBinding, "@effect-agent/platform-cloudflare/BrowserRunProtectedBinding", {
|
|
69
|
+
readonly open: (policy: InteractiveBrowserPolicy, identity?: ProtectedProviderIdentity) => Effect.Effect<ProtectedProviderSession, ProtectedBrowserError, Scope.Scope>;
|
|
70
|
+
}>;
|
|
71
|
+
declare class BrowserRunProtectedBinding extends BrowserRunProtectedBinding_base {}
|
|
72
|
+
/** One binding implementation serves scoped tools and host-managed protected handoffs. */
|
|
60
73
|
declare const browserRunProtectedBindingLayer: (options: {
|
|
61
74
|
readonly browser: Pick<BrowserRun, "fetch">;
|
|
62
|
-
}) => Layer.Layer<BrowserRunProtectedTransport, never, BrowserRunSessionLifecycle | Crypto.Crypto>;
|
|
75
|
+
}) => Layer.Layer<BrowserRunProtectedBinding | BrowserRunProtectedTransport, never, BrowserRunSessionLifecycle | Crypto.Crypto>;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/protected-browser/host.d.ts
|
|
78
|
+
declare const BrowserRunProtectedCheckpoint_base: Schema.Class<BrowserRunProtectedCheckpoint, Schema.Struct<{
|
|
79
|
+
readonly sessionId: Schema.Redacted<Schema.String>;
|
|
80
|
+
readonly contextId: Schema.Redacted<Schema.NonEmptyString>;
|
|
81
|
+
readonly targetId: Schema.Redacted<Schema.NonEmptyString>;
|
|
82
|
+
readonly protected: typeof ProtectedBrowserCheckpoint;
|
|
83
|
+
readonly handoffId: Schema.optionalKey<Schema.Redacted<Schema.NonEmptyString>>;
|
|
84
|
+
}>, {}>;
|
|
85
|
+
/** Host-only receipt. Store atomically with the controller lease; never return it to a model. */
|
|
86
|
+
declare class BrowserRunProtectedCheckpoint extends BrowserRunProtectedCheckpoint_base {}
|
|
87
|
+
interface BrowserRunProtectedSession {
|
|
88
|
+
readonly handle: ProtectedBrowserHandle;
|
|
89
|
+
readonly sessionId: Redacted.Redacted<string>;
|
|
90
|
+
/** Quiesce before publishing a durable human-control request. Persist before detaching. */
|
|
91
|
+
readonly suspend: Effect.Effect<BrowserRunProtectedCheckpoint, ProtectedBrowserError>;
|
|
92
|
+
/** Fences agent tools before dispatch. Persist the returned receipt before detaching. */
|
|
93
|
+
readonly handoff: (request: BrowserRunHandoffRequest) => Effect.Effect<BrowserRunProtectedCheckpoint, ProtectedBrowserError>;
|
|
94
|
+
/** Available only while human control is held; the host must authorize the specific human. */
|
|
95
|
+
readonly getLiveView: (request: BrowserRunLiveViewRequest) => Effect.Effect<BrowserRunLiveViewResult, ProtectedBrowserError>;
|
|
96
|
+
readonly getHandoffState: Effect.Effect<BrowserRunHandoffState, ProtectedBrowserError>;
|
|
97
|
+
/** Requires provider completion and a renewed observation grant. Tools must observe before acting. */
|
|
98
|
+
readonly returnControl: Effect.Effect<void, ProtectedBrowserError>;
|
|
99
|
+
/** Releases this attachment without terminating the remote browser. Only a committed handoff may detach. */
|
|
100
|
+
readonly detach: Effect.Effect<void, ProtectedBrowserError>;
|
|
101
|
+
readonly close: Effect.Effect<typeof ProtectedCleanup.Type>;
|
|
102
|
+
}
|
|
103
|
+
declare const BrowserRunProtectedHost_base: Context.ServiceClass<BrowserRunProtectedHost, "@effect-agent/platform-cloudflare/BrowserRunProtectedHost", {
|
|
104
|
+
readonly open: (policy: InteractiveBrowserPolicy) => Effect.Effect<BrowserRunProtectedSession, ProtectedBrowserError, Scope.Scope | BrowserCredentialAccess>;
|
|
105
|
+
readonly resume: (checkpoint: BrowserRunProtectedCheckpoint) => Effect.Effect<BrowserRunProtectedSession, ProtectedBrowserError, Scope.Scope | BrowserCredentialAccess>;
|
|
106
|
+
readonly closeSession: (sessionId: Redacted.Redacted<string>) => Effect.Effect<typeof ProtectedCleanup.Type>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Host authority for one protected page. The consumer owns durable generation fencing, authorized
|
|
110
|
+
* human recipients, checkpoint integrity, vault exposure metadata, and expiry cleanup. Resume only
|
|
111
|
+
* the latest committed suspended receipt; it never replays browser mutations or creates a page.
|
|
112
|
+
* Hosted passes require Unrestricted network policy: attachment-local request interception
|
|
113
|
+
* cannot enforce an ExactHosts policy during detachment. Current credential grants still apply.
|
|
114
|
+
* Provider inactivity/session deadlines still apply while the host is detached.
|
|
115
|
+
*/
|
|
116
|
+
declare class BrowserRunProtectedHost extends BrowserRunProtectedHost_base {}
|
|
117
|
+
/** Compose with browserRunProtectedBindingLayer and BrowserRunSessionLifecycle. */
|
|
118
|
+
declare const browserRunProtectedHostLayer: () => Layer.Layer<BrowserRunProtectedHost, never, BrowserRunProtectedBinding | BrowserRunSessionLifecycle | Crypto.Crypto>;
|
|
63
119
|
//#endregion
|
|
64
|
-
export { browserRunProtectedBindingLayer, browserRunProtectedLayer };
|
|
120
|
+
export { BrowserRunProtectedCheckpoint, BrowserRunProtectedHost, type BrowserRunProtectedSession, browserRunProtectedBindingLayer, browserRunProtectedHostLayer, browserRunProtectedLayer };
|
|
65
121
|
//# sourceMappingURL=ProtectedBrowser.d.mts.map
|