@effect-agent/platform-cloudflare 0.1.0-beta.35 → 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 +4 -98
- package/dist/index.mjs +8 -817
- 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/alarm.ts +19 -2
- 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
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BrowserQuickActionBrowserBinding, BrowserQuickActionCaptureOptions, BrowserQuickActionClient, BrowserQuickActionRpcError, BrowserQuickActionWorkersAi, BrowserQuickActionWorkersAiPolicy, BrowserQuickActionWorkersAiPolicyError, browserQuickActionCaptureLayer, browserQuickActionImplementation, browserQuickActionScreenshotLayer, browserQuickActionWorkersAiCaptureLayer } from "./browser-quick-action.mjs";
|
|
2
2
|
import { BrowserRestCaptureOptions, browserRestCaptureImplementation, browserRestCaptureLayer, browserRestWorkersAiCaptureLayer } from "./browser-rest-capture.mjs";
|
|
3
3
|
import { BrowserRestCrawlOptions, browserRestCrawlImplementation, browserRestCrawlLayer } from "./browser-rest-crawl.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { a as ScheduleOwnerObjectClass, c as ScheduleOwnerProtocolError, d as ConversationObjectIdentity, f as ConversationObjectNamespace, g as conversationNamespaceLayer, h as conversationNamespaceFromEnv, i as ScheduleOwnerNamespace, l as makeScheduleOwnerObjectClass, m as DurableObjectContext, n as ScheduleAlarmProtocolError, o as ScheduleOwnerObjectInstance, p as ConversationObjectRpc, r as ScheduleOwnerIdentity, s as ScheduleOwnerObjectRpc, t as CloudflareSchedulingClient, u as CloudflareBindingError } from "./scheduling-BJs_kHTx.mjs";
|
|
5
|
+
import { BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, BrowserRunViewport, browserRunInteractiveHostLayer, browserRunInteractiveImplementation, browserRunInteractiveLayer, isBrowserRunUndispatchedActionError } from "./interactive-browser.mjs";
|
|
5
6
|
import { Context, Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
|
|
6
7
|
import { AbortCommand, AbortIntent, AdmissionConflict, AgentBindingResolver, AppendConflict, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, CanonicalRecordEnvelope, CanonicalSequence, ConversationNotMaterialized, ConversationStore, ConversationStoreError, DefinitionDigests, DigestError, DurableAgentRuntime, DurableBindingFailure, DurableRuntimeConfig, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler, DurableSubmitAgent, DurableSubmitOptions, DurableWorkerFailure, FenceRejected, IntegrityReport, JoinedToHost, LedgerError, ObligationReport, ObligationThresholds, OperationAuthorizerService, OperationDenied, OwnershipLost, ProducerId, Receipt, RecoveryExplanation, RecoveryReport, ResolvedBinding, RetryCommand, RetryRefused, RunJournalError, Settlement, SettlementConflict, SubmissionLedger, ToolReconciler, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WakeScheduler } from "@effect-agent/session";
|
|
7
8
|
import { ConversationPortTransport, DoStorageFailpointHandler, DoStorageInitializationError, PortRequest, PortResponse } from "@effect-agent/storage-cloudflare";
|
|
@@ -9,101 +10,6 @@ import { AgentInputError, ConversationId } from "@effect-agent/core";
|
|
|
9
10
|
import { RunContextPreparation, RunCostEstimator, RunToolFailureObserver } from "@effect-agent/engine";
|
|
10
11
|
import { DurableObject, DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
|
|
11
12
|
import { CodeExecutor, SandboxImplementation } from "@effect-agent/sandbox";
|
|
12
|
-
//#region src/bindings.d.ts
|
|
13
|
-
declare const CloudflareBindingError_base: Schema.Class<CloudflareBindingError, Schema.TaggedStruct<"CloudflareBindingError", {
|
|
14
|
-
readonly binding: Schema.String;
|
|
15
|
-
readonly message: Schema.String;
|
|
16
|
-
}>, import("effect/Cause").YieldableError>;
|
|
17
|
-
/**
|
|
18
|
-
* Cloudflare platform bindings as Effect services (DEPLOY-010: "Cloudflare platform bindings
|
|
19
|
-
* are supplied as Effect services/Layers"). Application code never reads `env` or touches a
|
|
20
|
-
* `DurableObjectState` directly — the Conversation Object class constructs these Layers once
|
|
21
|
-
* per incarnation and everything downstream consumes the services.
|
|
22
|
-
*/
|
|
23
|
-
/** A Cloudflare platform binding was missing or carried the wrong shape (DEPLOY-003/010). */
|
|
24
|
-
declare class CloudflareBindingError extends CloudflareBindingError_base {}
|
|
25
|
-
/**
|
|
26
|
-
* The RPC surface one Conversation Durable Object exposes to Workers and to sibling
|
|
27
|
-
* Conversation Objects. `makeConversationObjectClass` implements it; the Worker-side client
|
|
28
|
-
* and the cross-Object transport call it through `DurableObjectNamespace` stubs. Every
|
|
29
|
-
* `encoded` value is a Schema-encoded envelope (`client.ts` wire schemas for host entry
|
|
30
|
-
* points, `@effect-agent/storage-cloudflare` port envelopes for `portCall`), so the RPC
|
|
31
|
-
* boundary carries only structured-cloneable JSON. The optional trailing trace context is
|
|
32
|
-
* transient native RPC metadata, stripped by an opted-in effect-cf receiver before decoding
|
|
33
|
-
* the host envelope. It never enters durable state.
|
|
34
|
-
*/
|
|
35
|
-
interface ConversationObjectRpc extends Rpc.DurableObjectBranded {
|
|
36
|
-
/** Admission-limits gate + `DurableAgentRuntime.submit`; answers a `SubmitResponse`. */
|
|
37
|
-
submitEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
38
|
-
/** Wake-hinted, poll-guaranteed settlement wait; answers an `AwaitSettlementResponse`. */
|
|
39
|
-
awaitSettlementEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
40
|
-
/** Event-driven durable progress wait; answers a `ProgressObserved` host response. */
|
|
41
|
-
awaitProgressEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
42
|
-
/** Best-effort cancellation for one in-flight progress wait. */
|
|
43
|
-
cancelProgressEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
44
|
-
/** One bounded page of canonical records; answers an `ObservePageResponse`. */
|
|
45
|
-
observePage(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
46
|
-
/** Durable abort intent; answers an `AbortResponse`. */
|
|
47
|
-
abortEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
48
|
-
/** Durable approval decision (plan §2.6); answers a `ResolveApprovalResponse`. */
|
|
49
|
-
resolveApprovalEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
50
|
-
/** Authorized DUR-017 Unknown-Outcome resolution; answers a `ResolveUnknownResponse`. */
|
|
51
|
-
resolveUnknownEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
52
|
-
/** Owner-side cross-Object port endpoint (WP2 envelopes, executed on LOCAL facets). */
|
|
53
|
-
portCall(encoded: unknown): Promise<unknown>;
|
|
54
|
-
/** Droppable liveness hint from another Object: arms an immediate alarm. */
|
|
55
|
-
wake(): Promise<void>;
|
|
56
|
-
}
|
|
57
|
-
declare const ConversationObjectNamespace_base: Context.ServiceClass<ConversationObjectNamespace, "@effect-agent/platform-cloudflare/ConversationObjectNamespace", {
|
|
58
|
-
readonly namespace: DurableObjectNamespace<ConversationObjectRpc>;
|
|
59
|
-
/** Stable binding name for opted-in native RPC tracing; absent by default. */
|
|
60
|
-
readonly rpcTracing?: string;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* The `DurableObjectNamespace` binding that addresses Conversation Objects. The Object
|
|
64
|
-
* identity rule is `namespace.idFromName(conversationId)` (plan §1.2): Conversation IDs are
|
|
65
|
-
* globally unique, so the mapping is total and deterministic and no directory service exists.
|
|
66
|
-
*/
|
|
67
|
-
declare class ConversationObjectNamespace extends ConversationObjectNamespace_base {
|
|
68
|
-
static layer(namespace: DurableObjectNamespace<ConversationObjectRpc>): Layer.Layer<ConversationObjectNamespace>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Narrow one `env` member to a `DurableObjectNamespace`. `env` is an untyped platform value,
|
|
72
|
-
* and a namespace binding is a host object no Schema can decode, so this is the documented
|
|
73
|
-
* narrowest-boundary check (structural probe for the namespace surface the transport uses);
|
|
74
|
-
* a missing or misshaped binding fails typed before any Layer is built.
|
|
75
|
-
*/
|
|
76
|
-
declare const conversationNamespaceFromEnv: (env: unknown, binding: string) => Effect.Effect<DurableObjectNamespace<ConversationObjectRpc>, CloudflareBindingError, never>;
|
|
77
|
-
/**
|
|
78
|
-
* Build the namespace from Worker `env` (fails typed). Enable `rpcTracing` only when the
|
|
79
|
-
* receiver also opts into the effect-cf native RPC trace-context contract.
|
|
80
|
-
*/
|
|
81
|
-
declare const conversationNamespaceLayer: (env: unknown, binding: string, options?: {
|
|
82
|
-
readonly rpcTracing?: boolean;
|
|
83
|
-
}) => Layer.Layer<ConversationObjectNamespace, CloudflareBindingError>;
|
|
84
|
-
declare const DurableObjectContext_base: Context.ServiceClass<DurableObjectContext, "@effect-agent/platform-cloudflare/DurableObjectContext", {
|
|
85
|
-
readonly ctx: DurableObjectState;
|
|
86
|
-
readonly env: unknown;
|
|
87
|
-
}>;
|
|
88
|
-
/**
|
|
89
|
-
* The live Durable Object execution context of THIS incarnation. Only Layer construction and
|
|
90
|
-
* the alarm service consume it; important state never lives on it (`ctx.storage` is truth,
|
|
91
|
-
* everything in memory is a cache — deployment spec §11).
|
|
92
|
-
*/
|
|
93
|
-
declare class DurableObjectContext extends DurableObjectContext_base {
|
|
94
|
-
static layer(ctx: DurableObjectState, env: unknown): Layer.Layer<DurableObjectContext>;
|
|
95
|
-
}
|
|
96
|
-
declare const ConversationObjectIdentity_base: Context.ServiceClass<ConversationObjectIdentity, "@effect-agent/platform-cloudflare/ConversationObjectIdentity", {
|
|
97
|
-
readonly conversationId: ConversationId;
|
|
98
|
-
readonly producerId: ProducerId;
|
|
99
|
-
}>;
|
|
100
|
-
/**
|
|
101
|
-
* The Conversation identity this Object serializes and the producer identity its Attempts
|
|
102
|
-
* write with (`{producerPrefix}:{conversationId}`, plan §1.4). Derived once per incarnation
|
|
103
|
-
* from `ctx.id.name` — the Object identity rule guarantees the name IS the Conversation ID.
|
|
104
|
-
*/
|
|
105
|
-
declare class ConversationObjectIdentity extends ConversationObjectIdentity_base {}
|
|
106
|
-
//#endregion
|
|
107
13
|
//#region src/config.d.ts
|
|
108
14
|
declare const CloudflarePlatformConfigError_base: Schema.Class<CloudflarePlatformConfigError, Schema.TaggedStruct<"CloudflarePlatformConfigError", {
|
|
109
15
|
readonly message: Schema.String;
|
|
@@ -416,7 +322,7 @@ interface CloudflareDurableRuntimeOptions {
|
|
|
416
322
|
*/
|
|
417
323
|
readonly toolReconciler?: Layer.Layer<ToolReconciler> | undefined;
|
|
418
324
|
/**
|
|
419
|
-
* Registered worker Bindings resolved at durable claim time
|
|
325
|
+
* Registered worker Bindings resolved at durable claim time:
|
|
420
326
|
* build each with `DurableWorkerBinding.make(binding, digests)`. The callback receives the live
|
|
421
327
|
* Object context and derived identities and is evaluated once per incarnation during Layer
|
|
422
328
|
* construction. Defaults to the empty registration (every resolved claim fails closed).
|
|
@@ -1736,5 +1642,5 @@ interface DynamicWorkerCodeExecutorOptions {
|
|
|
1736
1642
|
/** Layer building the Dynamic Worker `CodeExecutor` from resolved bindings. */
|
|
1737
1643
|
declare const dynamicWorkerCodeExecutorLayer: (options: DynamicWorkerCodeExecutorOptions) => Layer.Layer<CodeExecutor>;
|
|
1738
1644
|
//#endregion
|
|
1739
|
-
export { AbortRecorded, AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, AdmissionLimitExceeded, ApprovalRecorded, AwaitProgressRequest, BrowserQuickActionBrowserBinding, BrowserQuickActionCaptureOptions, BrowserQuickActionClient, BrowserQuickActionRpcError, BrowserQuickActionWorkersAi, BrowserQuickActionWorkersAiPolicy, BrowserQuickActionWorkersAiPolicyError, BrowserRestCaptureOptions, BrowserRestCrawlOptions, BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, CLOUDFLARE_DATABASE_CAP_BYTES, CLOUDFLARE_RUNTIME_DEFAULTS, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareAdmissionLimitsValue, CloudflareBindingError, CloudflareBindingSource, CloudflareBindingSourceContext, CloudflareConversationClient, CloudflareDurableRuntime, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflareDurableRuntimeInitializationError, CloudflareDurableRuntimeOptions, CloudflareDurableRuntimeServices, CloudflarePlatformConfigError, CloudflareRunContextLayer, CloudflareRunContextSource, CloudflareRuntimeSourceContext, ConversationClientError, ConversationMaintenance, ConversationMaintenanceFailpoint, ConversationMaintenanceFailpointHandler, ConversationMaintenanceFailpointLocation, ConversationObjectClass, ConversationObjectIdentity, ConversationObjectInstance, ConversationObjectNamespace, ConversationObjectOptions, ConversationObjectPorts, ConversationObjectRpc, DEFAULT_MAX_DATABASE_BYTES, DurableAlarmError, DurableAlarmService, DurableObjectContext, DynamicWorkerCodeExecutorOptions, ExplainedRecovery, HostFailed, HostFailure, HostProtocolError, HostResponse, MaintenancePassFailure, MaintenancePassReport, ObligationsScanned, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, ProgressWaitRegistry, RetryExecuted, SettlementReached, SubmitRequest, SubmitSucceeded, UnknownResolutionRecorded, VerifiedIntegrity, boundHostDiagnostic, browserQuickActionCaptureLayer, browserQuickActionImplementation, browserQuickActionScreenshotLayer, browserQuickActionWorkersAiCaptureLayer, browserRestCaptureImplementation, browserRestCaptureLayer, browserRestCrawlImplementation, browserRestCrawlLayer, browserRestWorkersAiCaptureLayer, browserRunInteractiveHostLayer, browserRunInteractiveImplementation, browserRunInteractiveLayer, cloudflareWakeSchedulerLayer, conversationNamespaceFromEnv, conversationNamespaceLayer, conversationPortTransportLayer, decodeAbortCommand, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObligationThresholds, decodeObservePageRequest, decodeReceipt, decodeRetryCommand, decodeSubmitRequest, decodeUnknownResolutionCommand, disposeRpcHandle, dynamicWorkerCodeExecutorLayer, dynamicWorkerImplementation, encodeAbortCommand, encodeAdminResponse, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, makeConversationObjectClass };
|
|
1645
|
+
export { AbortRecorded, AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, AdmissionLimitExceeded, ApprovalRecorded, AwaitProgressRequest, BrowserQuickActionBrowserBinding, BrowserQuickActionCaptureOptions, BrowserQuickActionClient, BrowserQuickActionRpcError, BrowserQuickActionWorkersAi, BrowserQuickActionWorkersAiPolicy, BrowserQuickActionWorkersAiPolicyError, BrowserRestCaptureOptions, BrowserRestCrawlOptions, BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, BrowserRunViewport, CLOUDFLARE_DATABASE_CAP_BYTES, CLOUDFLARE_RUNTIME_DEFAULTS, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareAdmissionLimitsValue, CloudflareBindingError, CloudflareBindingSource, CloudflareBindingSourceContext, CloudflareConversationClient, CloudflareDurableRuntime, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflareDurableRuntimeInitializationError, CloudflareDurableRuntimeOptions, CloudflareDurableRuntimeServices, CloudflarePlatformConfigError, CloudflareRunContextLayer, CloudflareRunContextSource, CloudflareRuntimeSourceContext, CloudflareSchedulingClient, ConversationClientError, ConversationMaintenance, ConversationMaintenanceFailpoint, ConversationMaintenanceFailpointHandler, ConversationMaintenanceFailpointLocation, ConversationObjectClass, ConversationObjectIdentity, ConversationObjectInstance, ConversationObjectNamespace, ConversationObjectOptions, ConversationObjectPorts, ConversationObjectRpc, DEFAULT_MAX_DATABASE_BYTES, DurableAlarmError, DurableAlarmService, DurableObjectContext, DynamicWorkerCodeExecutorOptions, ExplainedRecovery, HostFailed, HostFailure, HostProtocolError, HostResponse, MaintenancePassFailure, MaintenancePassReport, ObligationsScanned, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, ProgressWaitRegistry, RetryExecuted, ScheduleAlarmProtocolError, ScheduleOwnerIdentity, ScheduleOwnerNamespace, ScheduleOwnerObjectClass, ScheduleOwnerObjectInstance, ScheduleOwnerObjectRpc, ScheduleOwnerProtocolError, SettlementReached, SubmitRequest, SubmitSucceeded, UnknownResolutionRecorded, VerifiedIntegrity, boundHostDiagnostic, browserQuickActionCaptureLayer, browserQuickActionImplementation, browserQuickActionScreenshotLayer, browserQuickActionWorkersAiCaptureLayer, browserRestCaptureImplementation, browserRestCaptureLayer, browserRestCrawlImplementation, browserRestCrawlLayer, browserRestWorkersAiCaptureLayer, browserRunInteractiveHostLayer, browserRunInteractiveImplementation, browserRunInteractiveLayer, cloudflareWakeSchedulerLayer, conversationNamespaceFromEnv, conversationNamespaceLayer, conversationPortTransportLayer, decodeAbortCommand, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObligationThresholds, decodeObservePageRequest, decodeReceipt, decodeRetryCommand, decodeSubmitRequest, decodeUnknownResolutionCommand, disposeRpcHandle, dynamicWorkerCodeExecutorLayer, dynamicWorkerImplementation, encodeAbortCommand, encodeAdminResponse, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, isBrowserRunUndispatchedActionError, makeConversationObjectClass, makeScheduleOwnerObjectClass };
|
|
1740
1646
|
//# sourceMappingURL=index.d.mts.map
|