@effect-agent/platform-cloudflare 0.1.0-beta.44 → 0.1.0-beta.45
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 +30 -30
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{prepared-admission-BKp_Upw2.mjs → prepared-admission-BhW2eT_a.mjs} +3 -3
- package/dist/prepared-admission-BhW2eT_a.mjs.map +1 -0
- package/dist/scheduling.mjs +1 -1
- package/dist/subscriptions.mjs +1 -1
- package/package.json +1 -1
- package/src/alarm.ts +259 -265
- package/src/layers.ts +3 -3
- package/dist/prepared-admission-BKp_Upw2.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -211,7 +211,7 @@ declare const ThreadMaintenance_base: Context.ServiceClass<ThreadMaintenance, "@
|
|
|
211
211
|
* recovery states leave their generation dirty and retain bounded backoff rearming.
|
|
212
212
|
*/
|
|
213
213
|
declare class ThreadMaintenance extends ThreadMaintenance_base {
|
|
214
|
-
static readonly layer:
|
|
214
|
+
static readonly layer: Layer.Layer<ThreadMaintenance, never, DurableAgentRuntime | SubmissionLedger | DurableAlarmService | ThreadMaintenanceFailpoint | CloudflareDurableRuntimeConfig | ThreadObjectIdentity | DurableObjectContext>;
|
|
215
215
|
}
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region src/wake-scheduler.d.ts
|
|
@@ -264,7 +264,7 @@ declare const threadPortTransportLayer: Layer.Layer<ThreadPortTransport, never,
|
|
|
264
264
|
//#region src/layers.d.ts
|
|
265
265
|
/**
|
|
266
266
|
* Raw (unvalidated) construction options for `ThreadObject.make`, mirroring
|
|
267
|
-
* `
|
|
267
|
+
* `NodeDurableAgentRuntimeOptions`. Optional fields default to the documented production values
|
|
268
268
|
* (`CLOUDFLARE_RUNTIME_DEFAULTS`); everything is schema-decoded into
|
|
269
269
|
* `CloudflareDurableRuntimeConfigValue` before any resource opens (deployment §5 gate 1).
|
|
270
270
|
*/
|
|
@@ -1217,13 +1217,13 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
1217
1217
|
readonly author: string;
|
|
1218
1218
|
readonly reason: string;
|
|
1219
1219
|
readonly resolution: {
|
|
1220
|
-
readonly _tag: "SafeToRetry";
|
|
1221
|
-
} | {
|
|
1222
1220
|
readonly _tag: "CompletedWithResult";
|
|
1223
1221
|
readonly result: Schema.Json;
|
|
1224
1222
|
readonly isFailure: boolean;
|
|
1225
1223
|
} | {
|
|
1226
1224
|
readonly _tag: "NeverHappened";
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly _tag: "SafeToRetry";
|
|
1227
1227
|
} | {
|
|
1228
1228
|
readonly _tag: "AbortSubmission";
|
|
1229
1229
|
};
|
|
@@ -1563,14 +1563,38 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
1563
1563
|
} | {
|
|
1564
1564
|
readonly _tag: "AdminFailed";
|
|
1565
1565
|
readonly failure: {
|
|
1566
|
-
readonly _tag: "
|
|
1566
|
+
readonly _tag: "OperationDenied";
|
|
1567
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1568
|
+
readonly reason: string;
|
|
1569
|
+
readonly threadId?: string | undefined;
|
|
1570
|
+
readonly submissionId?: string | undefined;
|
|
1571
|
+
} | {
|
|
1572
|
+
readonly _tag: "RetryRefused";
|
|
1567
1573
|
readonly submissionId: string;
|
|
1568
|
-
readonly
|
|
1574
|
+
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
1575
|
+
readonly decisionTag: string;
|
|
1576
|
+
readonly message: string;
|
|
1569
1577
|
} | {
|
|
1570
1578
|
readonly _tag: "LedgerError";
|
|
1571
1579
|
readonly operation: string;
|
|
1572
1580
|
readonly message: string;
|
|
1573
1581
|
readonly cause?: Schema.Json | undefined;
|
|
1582
|
+
} | {
|
|
1583
|
+
readonly _tag: "RunJournalError";
|
|
1584
|
+
readonly message: string;
|
|
1585
|
+
readonly cause?: Schema.Json | undefined;
|
|
1586
|
+
} | {
|
|
1587
|
+
readonly _tag: "DigestError";
|
|
1588
|
+
readonly message: string;
|
|
1589
|
+
readonly cause?: Schema.Json | undefined;
|
|
1590
|
+
} | {
|
|
1591
|
+
readonly _tag: "OwnershipLost";
|
|
1592
|
+
readonly submissionId: string;
|
|
1593
|
+
readonly actualEpoch: number;
|
|
1594
|
+
} | {
|
|
1595
|
+
readonly _tag: "SettlementConflict";
|
|
1596
|
+
readonly submissionId: string;
|
|
1597
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1574
1598
|
} | {
|
|
1575
1599
|
readonly _tag: "ThreadStoreError";
|
|
1576
1600
|
readonly operation: string;
|
|
@@ -1591,30 +1615,6 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
1591
1615
|
readonly threadId: string;
|
|
1592
1616
|
readonly actualEpoch: number;
|
|
1593
1617
|
readonly attemptedEpoch: number;
|
|
1594
|
-
} | {
|
|
1595
|
-
readonly _tag: "OperationDenied";
|
|
1596
|
-
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1597
|
-
readonly reason: string;
|
|
1598
|
-
readonly threadId?: string | undefined;
|
|
1599
|
-
readonly submissionId?: string | undefined;
|
|
1600
|
-
} | {
|
|
1601
|
-
readonly _tag: "RetryRefused";
|
|
1602
|
-
readonly submissionId: string;
|
|
1603
|
-
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
1604
|
-
readonly decisionTag: string;
|
|
1605
|
-
readonly message: string;
|
|
1606
|
-
} | {
|
|
1607
|
-
readonly _tag: "RunJournalError";
|
|
1608
|
-
readonly message: string;
|
|
1609
|
-
readonly cause?: Schema.Json | undefined;
|
|
1610
|
-
} | {
|
|
1611
|
-
readonly _tag: "DigestError";
|
|
1612
|
-
readonly message: string;
|
|
1613
|
-
readonly cause?: Schema.Json | undefined;
|
|
1614
|
-
} | {
|
|
1615
|
-
readonly _tag: "OwnershipLost";
|
|
1616
|
-
readonly submissionId: string;
|
|
1617
|
-
readonly actualEpoch: number;
|
|
1618
1618
|
} | {
|
|
1619
1619
|
readonly _tag: "DurableRuntimeFailpointError";
|
|
1620
1620
|
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-start-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:after-reserve" | "tools:after-prepared-append" | "tools:before-prepared-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { $ as CloudflarePlatformConfigError, A as decodeUnknownResolutionCommand, B as DurableAlarmError, C as decodeApprovalDecisionCommand, D as decodeObservePageRequest, E as decodeHostResponse, F as encodeHostResponse, G as safeCauseDiagnostic, H as MaintenancePassReport, I as encodeObservePageRequest, J as CLOUDFLARE_DATABASE_CAP_BYTES, K as safeCauseMessage, L as encodeReceipt, M as encodeApprovalDecisionCommand, N as encodeAwaitProgressRequest, O as decodeReceipt, P as encodeCancelProgressRequest, Q as CloudflareDurableRuntimeConfigValue, R as encodeSubmitRequest, S as decodeAbortCommand, T as decodeCancelProgressRequest, U as ThreadMaintenance, V as DurableAlarmService, W as ThreadMaintenanceFailpoint, X as CloudflareAdmissionLimitsValue, Y as CLOUDFLARE_RUNTIME_DEFAULTS, Z as CloudflareDurableRuntimeConfig, _ as SubmitRequest, a as AwaitProgressRequest, at as threadNamespaceFromEnv, b as UnknownResolutionRecorded, c as HostFailed, d as HostResponse, et as DEFAULT_MAX_DATABASE_BYTES, f as ObservePageRequest, g as SettlementReached, h as ProgressObserved, i as ApprovalRecorded, it as ThreadObjectNamespace, j as encodeAbortCommand, k as decodeSubmitRequest, l as HostFailure, m as ProgressCancelled, n as cloudflareScheduledInputAdmissionLayer, nt as DurableObjectContext, o as CancelProgressRequest, ot as threadNamespaceLayer, p as ObservedPage, q as AdmissionLimitExceeded, r as AbortRecorded, rt as ThreadObjectIdentity, s as CloudflareThreadClient, t as cloudflarePreparedInputAdmissionLayer, tt as CloudflareBindingError, u as HostProtocolError, v as SubmitSucceeded, w as decodeAwaitProgressRequest, x as boundHostDiagnostic, y as ThreadClientError, z as encodeUnknownResolutionCommand } from "./prepared-admission-
|
|
2
|
+
import { $ as CloudflarePlatformConfigError, A as decodeUnknownResolutionCommand, B as DurableAlarmError, C as decodeApprovalDecisionCommand, D as decodeObservePageRequest, E as decodeHostResponse, F as encodeHostResponse, G as safeCauseDiagnostic, H as MaintenancePassReport, I as encodeObservePageRequest, J as CLOUDFLARE_DATABASE_CAP_BYTES, K as safeCauseMessage, L as encodeReceipt, M as encodeApprovalDecisionCommand, N as encodeAwaitProgressRequest, O as decodeReceipt, P as encodeCancelProgressRequest, Q as CloudflareDurableRuntimeConfigValue, R as encodeSubmitRequest, S as decodeAbortCommand, T as decodeCancelProgressRequest, U as ThreadMaintenance, V as DurableAlarmService, W as ThreadMaintenanceFailpoint, X as CloudflareAdmissionLimitsValue, Y as CLOUDFLARE_RUNTIME_DEFAULTS, Z as CloudflareDurableRuntimeConfig, _ as SubmitRequest, a as AwaitProgressRequest, at as threadNamespaceFromEnv, b as UnknownResolutionRecorded, c as HostFailed, d as HostResponse, et as DEFAULT_MAX_DATABASE_BYTES, f as ObservePageRequest, g as SettlementReached, h as ProgressObserved, i as ApprovalRecorded, it as ThreadObjectNamespace, j as encodeAbortCommand, k as decodeSubmitRequest, l as HostFailure, m as ProgressCancelled, n as cloudflareScheduledInputAdmissionLayer, nt as DurableObjectContext, o as CancelProgressRequest, ot as threadNamespaceLayer, p as ObservedPage, q as AdmissionLimitExceeded, r as AbortRecorded, rt as ThreadObjectIdentity, s as CloudflareThreadClient, t as cloudflarePreparedInputAdmissionLayer, tt as CloudflareBindingError, u as HostProtocolError, v as SubmitSucceeded, w as decodeAwaitProgressRequest, x as boundHostDiagnostic, y as ThreadClientError, z as encodeUnknownResolutionCommand } from "./prepared-admission-BhW2eT_a.mjs";
|
|
3
3
|
import { CloudflareSchedulingClient, ScheduleAlarmProtocolError, ScheduleOwnerIdentity, ScheduleOwnerNamespace, ScheduleOwnerProtocolError, makeScheduleOwnerObjectClass } from "./scheduling.mjs";
|
|
4
4
|
import { CloudflareSubscriptionConfigError, CloudflareSubscriptionsClient, SubscriptionAlarmProtocolError, SubscriptionPartitionIdentity, SubscriptionPartitionNamespace, SubscriptionPartitionProtocolError, makeSubscriptionPartitionObjectClass, sourcePartitionName, validateCloudflareSubscriptionLimits } from "./subscriptions.mjs";
|
|
5
5
|
import { CloudflareBrowser } from "./browser-quick-action.mjs";
|
|
@@ -251,8 +251,8 @@ const layerFromBindings = (bindings) => Layer.unwrap(Effect.gen(function* () {
|
|
|
251
251
|
})).pipe(Layer.provide(localPorts));
|
|
252
252
|
const routedPorts = Layer.mergeAll(routedSubmissionLedgerLayer({ localThreadId: threadId }), routedThreadStoreLayer({ localThreadId: threadId })).pipe(Layer.provide(localPorts), Layer.provide(threadPortTransportLayer));
|
|
253
253
|
const base = Layer.mergeAll(DurableAlarmService.layer, ProgressWaitRegistry.layer);
|
|
254
|
-
const runtimeStack = DurableAgentRuntime.
|
|
255
|
-
return Layer.mergeAll(runtimeStack, ThreadMaintenance.layer
|
|
254
|
+
const runtimeStack = DurableAgentRuntime.layerWithBindings(bindings).pipe(Layer.provideMerge(routedPorts), Layer.provideMerge(cloudflareWakeSchedulerLayer), Layer.provideMerge(base));
|
|
255
|
+
return Layer.mergeAll(runtimeStack, ThreadMaintenance.layer.pipe(Layer.provide(runtimeStack)), portsEndpointLayer);
|
|
256
256
|
}));
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region src/thread-object.ts
|