@effect-agent/platform-cloudflare 0.1.0-beta.45 → 0.1.0-beta.46

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.
Files changed (97) hide show
  1. package/dist/Alarm.d.mts +119 -0
  2. package/dist/Alarm.mjs +317 -0
  3. package/dist/Alarm.mjs.map +1 -0
  4. package/dist/{browser-rest-capture.d.mts → BrowserRestCapture.d.mts} +5 -4
  5. package/dist/{browser-rest-capture.mjs → BrowserRestCapture.mjs} +5 -4
  6. package/dist/BrowserRestCapture.mjs.map +1 -0
  7. package/dist/{browser-rest-crawl.d.mts → BrowserRestCrawl.d.mts} +4 -3
  8. package/dist/{browser-rest-crawl.mjs → BrowserRestCrawl.mjs} +4 -3
  9. package/dist/BrowserRestCrawl.mjs.map +1 -0
  10. package/dist/{bindings-BrVEOkfe.d.mts → CloudflareBindings.d.mts} +7 -5
  11. package/dist/CloudflareBindings.mjs +98 -0
  12. package/dist/CloudflareBindings.mjs.map +1 -0
  13. package/dist/{browser-quick-action.mjs → CloudflareBrowser-1jeZx3_g.mjs} +19 -4
  14. package/dist/CloudflareBrowser-1jeZx3_g.mjs.map +1 -0
  15. package/dist/{browser-quick-action.d.mts → CloudflareBrowser-DJq53niJ.d.mts} +9 -18
  16. package/dist/CloudflareBrowser.d.mts +2 -0
  17. package/dist/CloudflareBrowser.mjs +2 -0
  18. package/dist/CloudflareCodeMode.d.mts +44 -0
  19. package/dist/CloudflareCodeMode.mjs +618 -0
  20. package/dist/CloudflareCodeMode.mjs.map +1 -0
  21. package/dist/CloudflareConfig-f3CqTel1.d.mts +101 -0
  22. package/dist/CloudflareConfig.d.mts +2 -0
  23. package/dist/CloudflareConfig.mjs +122 -0
  24. package/dist/CloudflareConfig.mjs.map +1 -0
  25. package/dist/CloudflareMemory.d.mts +140 -0
  26. package/dist/CloudflareMemory.mjs +168 -0
  27. package/dist/CloudflareMemory.mjs.map +1 -0
  28. package/dist/{scheduling.d.mts → CloudflareScheduling.d.mts} +9 -6
  29. package/dist/{scheduling.mjs → CloudflareScheduling.mjs} +22 -8
  30. package/dist/CloudflareScheduling.mjs.map +1 -0
  31. package/dist/{subscriptions.d.mts → CloudflareSubscriptions.d.mts} +11 -6
  32. package/dist/{subscriptions.mjs → CloudflareSubscriptions.mjs} +26 -7
  33. package/dist/CloudflareSubscriptions.mjs.map +1 -0
  34. package/dist/CloudflareThreadClient.d.mts +715 -0
  35. package/dist/CloudflareThreadClient.mjs +364 -0
  36. package/dist/CloudflareThreadClient.mjs.map +1 -0
  37. package/dist/{interactive-browser.d.mts → InteractiveBrowser.d.mts} +5 -4
  38. package/dist/{interactive-browser.mjs → InteractiveBrowser.mjs} +6 -4
  39. package/dist/InteractiveBrowser.mjs.map +1 -0
  40. package/dist/{protected-browser.d.mts → ProtectedBrowser.d.mts} +4 -3
  41. package/dist/{protected-browser.mjs → ProtectedBrowser.mjs} +4 -3
  42. package/dist/ProtectedBrowser.mjs.map +1 -0
  43. package/dist/ThreadObject-Ia94R_B1.d.mts +735 -0
  44. package/dist/ThreadObject-IrGuIO4a.mjs +575 -0
  45. package/dist/ThreadObject-IrGuIO4a.mjs.map +1 -0
  46. package/dist/ThreadObject.d.mts +2 -0
  47. package/dist/ThreadObject.mjs +3 -0
  48. package/dist/WakeScheduler.d.mts +23 -0
  49. package/dist/WakeScheduler.mjs +60 -0
  50. package/dist/WakeScheduler.mjs.map +1 -0
  51. package/dist/boundary-BguazVkh.mjs +42 -0
  52. package/dist/boundary-BguazVkh.mjs.map +1 -0
  53. package/dist/{browser-session-lifecycle-ZGgb3pnK.mjs → browser-session-lifecycle-CUbVfEgP.mjs} +2 -2
  54. package/dist/browser-session-lifecycle-CUbVfEgP.mjs.map +1 -0
  55. package/dist/{browser-session-lifecycle-DqntvG-Y.d.mts → browser-session-lifecycle-DJpqLXy_.d.mts} +2 -2
  56. package/dist/index.d.mts +12 -1833
  57. package/dist/index.mjs +12 -1357
  58. package/dist/prepared-admission-DRBhl2Sp.mjs +63 -0
  59. package/dist/prepared-admission-DRBhl2Sp.mjs.map +1 -0
  60. package/package.json +1 -1
  61. package/src/{alarm.ts → Alarm.ts} +6 -7
  62. package/src/{browser-rest-capture.ts → BrowserRestCapture.ts} +3 -3
  63. package/src/{browser-rest-crawl.ts → BrowserRestCrawl.ts} +2 -2
  64. package/src/{bindings.ts → CloudflareBindings.ts} +2 -2
  65. package/src/CloudflareBrowser.ts +15 -0
  66. package/src/{code-mode-executor.ts → CloudflareCodeMode.ts} +3 -3
  67. package/src/{config.ts → CloudflareConfig.ts} +3 -2
  68. package/src/{memory.ts → CloudflareMemory.ts} +15 -12
  69. package/src/{scheduling.ts → CloudflareScheduling.ts} +12 -11
  70. package/src/{subscriptions.ts → CloudflareSubscriptions.ts} +14 -12
  71. package/src/{client.ts → CloudflareThreadClient.ts} +27 -20
  72. package/src/{interactive-browser.ts → InteractiveBrowser.ts} +9 -5
  73. package/src/{thread-object.ts → ThreadObject.ts} +37 -29
  74. package/src/{wake-scheduler.ts → WakeScheduler.ts} +5 -5
  75. package/src/index.ts +11 -30
  76. package/src/{browser-quick-action.ts → internal/browser-quick-action.ts} +10 -8
  77. package/src/{layers.ts → internal/layers.ts} +39 -30
  78. package/src/{prepared-admission.ts → internal/prepared-admission.ts} +7 -7
  79. package/src/{transport.ts → internal/transport.ts} +5 -2
  80. package/src/protected-browser/binding.ts +3 -2
  81. package/src/protected-browser/native.ts +2 -2
  82. package/src/protected-browser/policy.ts +2 -2
  83. package/dist/browser-quick-action.mjs.map +0 -1
  84. package/dist/browser-rest-capture.mjs.map +0 -1
  85. package/dist/browser-rest-crawl.mjs.map +0 -1
  86. package/dist/browser-session-lifecycle-ZGgb3pnK.mjs.map +0 -1
  87. package/dist/index.mjs.map +0 -1
  88. package/dist/interactive-browser.mjs.map +0 -1
  89. package/dist/prepared-admission-BhW2eT_a.mjs +0 -890
  90. package/dist/prepared-admission-BhW2eT_a.mjs.map +0 -1
  91. package/dist/protected-browser.mjs.map +0 -1
  92. package/dist/scheduling.mjs.map +0 -1
  93. package/dist/subscriptions.mjs.map +0 -1
  94. /package/src/{protected-browser.ts → ProtectedBrowser.ts} +0 -0
  95. /package/src/{boundary.ts → internal/boundary.ts} +0 -0
  96. /package/src/{browser-session-lifecycle.ts → internal/browser-session-lifecycle.ts} +0 -0
  97. /package/src/{progress-wait.ts → internal/progress-wait.ts} +0 -0
@@ -0,0 +1,735 @@
1
+ import { DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace } from "./CloudflareBindings.mjs";
2
+ import { c as CloudflarePlatformConfigError, o as CloudflareDurableRuntimeConfig } from "./CloudflareConfig-f3CqTel1.mjs";
3
+ import { DurableAlarmError, DurableAlarmService, ThreadMaintenance, ThreadMaintenanceFailpoint, ThreadMaintenanceFailpointHandler } from "./Alarm.mjs";
4
+ import { HostProtocolError } from "./CloudflareThreadClient.mjs";
5
+ import { AgentRegistration } from "@effect-agent/thread/AgentRegistration";
6
+ import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "@effect-agent/thread/DurableAgentRuntime";
7
+ import { LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger } from "@effect-agent/thread/SubmissionLedger";
8
+ import { Context, Crypto, Effect, Layer, Schema, Scope } from "effect";
9
+ import { DurableObject, DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
10
+ import { DigestError } from "@effect-agent/thread/Digest";
11
+ import { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler } from "@effect-agent/thread/DurableFailpoint";
12
+ import { OperationAuthorizerService, OperationDenied } from "@effect-agent/thread/OperationAuthorizer";
13
+ import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadStore, ThreadStoreError } from "@effect-agent/thread/ThreadStore";
14
+ import { PortRequest, PortResponse } from "@effect-agent/storage-cloudflare/PortProtocol";
15
+ import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "@effect-agent/thread/Admin";
16
+ import { RunJournalError } from "@effect-agent/thread/RunJournal";
17
+ import { WakeScheduler } from "@effect-agent/thread/WakeScheduler";
18
+ import { RunContextPreparation, RunCostEstimator, RunToolAuthorization, RunToolFailureObserver } from "@effect-agent/engine/RunOptions";
19
+ import { DoStorageFailpoint, DoStorageFailpointHandler } from "@effect-agent/storage-cloudflare/DoStorageFailpoint";
20
+ import { DoStorageInitializationError } from "@effect-agent/storage-cloudflare/DoThreadStore";
21
+ import { ToolReconciler } from "@effect-agent/thread/ToolReconciler";
22
+ //#region src/internal/progress-wait.d.ts
23
+ declare const ProgressWaitRegistry_base: Context.ServiceClass<ProgressWaitRegistry, "@effect-agent/platform-cloudflare/ProgressWaitRegistry", {
24
+ /** Register a Scope-owned cancellation signal, observing any early cancel tombstone. */
25
+ readonly subscribe: (waiterId: string) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
26
+ /** Cancel a registered waiter, or remember a bounded early cancellation. */
27
+ readonly cancel: (waiterId: string) => Effect.Effect<void>;
28
+ }>;
29
+ /**
30
+ * Per-incarnation cancellation registry for long-lived progress RPCs. The public runtime owns
31
+ * the actual wake registration; this host-only registry lets an interrupted Worker Effect ask
32
+ * the Object to interrupt its scoped wait before the Worker execution context itself ends.
33
+ */
34
+ declare class ProgressWaitRegistry extends ProgressWaitRegistry_base {
35
+ static readonly layer: Layer.Layer<ProgressWaitRegistry>;
36
+ }
37
+ //#endregion
38
+ //#region src/internal/layers.d.ts
39
+ /**
40
+ * Raw (unvalidated) construction options for `ThreadObject.make`, mirroring
41
+ * `NodeDurableAgentRuntimeOptions`. Optional fields default to the documented production values
42
+ * (`CLOUDFLARE_RUNTIME_DEFAULTS`); everything is schema-decoded into
43
+ * `CloudflareDurableRuntimeConfigValue` before any resource opens (deployment §5 gate 1).
44
+ */
45
+ interface CloudflareDurableRuntimeOptions {
46
+ readonly deploymentId: string;
47
+ /** Head of the minted producer identity `{producerPrefix}:{threadId}`. */
48
+ readonly producerPrefix: string;
49
+ /** Milliseconds; default 30s (D5). */
50
+ readonly ownershipLeaseDuration?: number | undefined;
51
+ /** Milliseconds; default 100. */
52
+ readonly alarmBackoffBase?: number | undefined;
53
+ /** Milliseconds; default 5000. */
54
+ readonly alarmBackoffCap?: number | undefined;
55
+ /** Milliseconds; default 1000. Bounds every alarm re-arm delay. */
56
+ readonly wakeScanInterval?: number | undefined;
57
+ /** Milliseconds; default 500. */
58
+ readonly settlementPollInterval?: number | undefined;
59
+ /** Milliseconds; default 10000. */
60
+ readonly leaseRenewalInterval?: number | undefined;
61
+ /** Milliseconds; default 500. */
62
+ readonly abortPollInterval?: number | undefined;
63
+ /** Deployment-owned pricing authority used by durable cost budgets and settlements. */
64
+ readonly estimateCostMicrousd?: RunCostEstimator | undefined;
65
+ /** Closed trusted Tool failure reporting. Omission masks ambient observers at construction. */
66
+ readonly toolFailureObserver?: RunToolFailureObserver | undefined;
67
+ /** Milliseconds; default 25. */
68
+ readonly observationPollInterval?: number | undefined;
69
+ /** Bytes; default just under the 2 MB platform value limit. */
70
+ readonly maxStoredValueBytes?: number | undefined;
71
+ /** Default false. */
72
+ readonly verifyOnOpen?: boolean | undefined;
73
+ /** Nonterminal Submissions per lane before admission refuses; default 256. */
74
+ readonly maxQueueDepthPerLane?: number | undefined;
75
+ /** Encoded input bytes per Submission; default = the stored-value bound. */
76
+ readonly maxInputBytes?: number | undefined;
77
+ /** `ctx.storage.sql.databaseSize` ceiling at admission; default 9 GB (10 GB platform cap). */
78
+ readonly maxDatabaseBytes?: number | undefined;
79
+ /**
80
+ * Durable Object storage fault injection (`ledger:*` / `append:*` locations). Handlers are
81
+ * constructed per incarnation WITH the live `DurableObjectState`, so eviction harnesses can
82
+ * map an armed hit to `ctx.abort()` — the platform's real failure mode. Default none.
83
+ */
84
+ readonly storageFailpoint?: ((ctx: DurableObjectState) => DoStorageFailpointHandler) | undefined;
85
+ /** Coordinator fault injection (`submit:*` / `terminalize:*` locations); default none. */
86
+ readonly runtimeFailpoint?: ((ctx: DurableObjectState) => DurableRuntimeFailpointHandler) | undefined;
87
+ /** Thread-maintenance generation/alarm fault injection; default none. */
88
+ readonly maintenanceFailpoint?: ((ctx: DurableObjectState) => ThreadMaintenanceFailpointHandler) | undefined;
89
+ /** Host-supplied fail-closed authorization policy; defaults to service possession. */
90
+ readonly operationAuthorizer?: OperationAuthorizerService | undefined;
91
+ /**
92
+ * Reconciliation policy consulted for open ordinary Tool Calls before an Unknown Outcome
93
+ * is recorded (durability §10, DUR-009). Defaults to the fail-closed
94
+ * `ToolReconciler.uncertain`.
95
+ */
96
+ readonly toolReconciler?: Layer.Layer<ToolReconciler> | undefined;
97
+ }
98
+ /** Services supplied before the application graph is built, including its dependencies. */
99
+ type CloudflareBootstrapServices = CloudflareDurableRuntimeConfig | ThreadObjectIdentity | DurableRuntimeConfig | Crypto.Crypto | DoStorageFailpoint | DurableRuntimeFailpoint | ThreadMaintenanceFailpoint | RunContextPreparation | RunToolAuthorization | ToolReconciler;
100
+ /** Every construction failure of the assembled Cloudflare durable runtime stack. */
101
+ type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError | DigestError | DoStorageInitializationError;
102
+ /** The services `ThreadObject.layer` provides. */
103
+ type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ThreadStore | WakeScheduler | DurableAlarmService | ThreadMaintenance | ThreadObjectPorts | ProgressWaitRegistry;
104
+ declare const ThreadObjectPorts_base: Context.ServiceClass<ThreadObjectPorts, "@effect-agent/platform-cloudflare/ThreadObjectPorts", {
105
+ readonly handle: (request: PortRequest) => Effect.Effect<PortResponse>;
106
+ }>;
107
+ /**
108
+ * Owner-side execution port for a `portCall` request the wire endpoint has already decoded.
109
+ * It executes against THIS Object's LOCAL port facets — never the routed decorators, so a
110
+ * request cannot bounce between Objects — and returns the typed response for the endpoint to
111
+ * encode.
112
+ */
113
+ declare class ThreadObjectPorts extends ThreadObjectPorts_base {}
114
+ /**
115
+ * Validate deployment settings and derive services before building application dependencies.
116
+ * The native class factory builds this Layer inside its constructor gate. Custom Effect hosts
117
+ * can provide it around the complete application Layer with the native context already supplied.
118
+ */
119
+ declare const layerConfig: (options: CloudflareDurableRuntimeOptions) => Layer.Layer<CloudflareBootstrapServices, CloudflarePlatformConfigError, DurableObjectContext>;
120
+ /**
121
+ * Register typed Agents and version declarations. Hashing and dependency capture happen in
122
+ * this Layer's Scope, after application Layers have been provided. Every Agent's instruction,
123
+ * Tool, Schema, and model requirements remain visible until satisfied by Layer composition.
124
+ * Use Layer.unwrap for registration values that need effectful application setup.
125
+ */
126
+ declare const layer: <const Entries extends ReadonlyArray<AgentRegistration>>(registrations: Entries) => Layer.Layer<CloudflareDurableRuntimeServices, DigestError | DoStorageInitializationError, DurableObjectContext | ThreadObjectNamespace | Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T) ? T extends Entries[number] ? T extends {
127
+ readonly attemptLayer: (context: import("@effect-agent/thread/AgentRegistration").AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>;
128
+ } ? Requires | Exclude<T extends (infer T_1) ? T_1 extends T ? T_1 extends {
129
+ readonly agent: infer A extends import("@effect-agent/thread/AgentRegistration").ExecutableAgentBinding;
130
+ } ? import("@effect-agent/thread/DurableAgentRuntime").DurableWorkerRequirements<A> : T_1 extends {
131
+ readonly agent: infer D extends import("@effect-agent/core/Agent").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core/Agent").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
132
+ readonly instructions: import("@effect-agent/core/Agent").InstructionSource<never, unknown, unknown>;
133
+ readonly inputPrompt?: import("@effect-agent/core/Agent").InputPromptSource<never, unknown, unknown> | undefined;
134
+ };
135
+ readonly model: infer M extends import("@effect-agent/thread/AgentRegistration").ExecutableAgentBinding["model"];
136
+ } ? import("@effect-agent/thread/DurableAgentRuntime").DurableWorkerRequirements<{
137
+ readonly definition: D;
138
+ readonly model: M;
139
+ }> : never : never : never, Provides> : T extends {
140
+ readonly agent: infer A extends import("@effect-agent/thread/AgentRegistration").ExecutableAgentBinding;
141
+ } ? import("@effect-agent/thread/DurableAgentRuntime").DurableWorkerRequirements<A> : T extends {
142
+ readonly agent: infer D extends import("@effect-agent/core/Agent").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core/Agent").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
143
+ readonly instructions: import("@effect-agent/core/Agent").InstructionSource<never, unknown, unknown>;
144
+ readonly inputPrompt?: import("@effect-agent/core/Agent").InputPromptSource<never, unknown, unknown> | undefined;
145
+ };
146
+ readonly model: infer M extends import("@effect-agent/thread/AgentRegistration").ExecutableAgentBinding["model"];
147
+ } ? import("@effect-agent/thread/DurableAgentRuntime").DurableWorkerRequirements<{
148
+ readonly definition: D;
149
+ readonly model: M;
150
+ }> : never : never : never, import("effect/Scope").Scope> | CloudflareBootstrapServices>;
151
+ declare namespace ThreadObject_d_exports {
152
+ export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, CloudflareBootstrapServices as BootstrapServices, Class, ExplainedRecovery, CloudflareDurableRuntimeInitializationError as InitializationError, Instance, ObligationsScanned, Options, RetryExecuted, CloudflareDurableRuntimeOptions as RuntimeOptions, CloudflareDurableRuntimeServices as Services, VerifiedIntegrity, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, layer, layerConfig, make };
153
+ }
154
+ /**
155
+ * `ThreadObject.make(application, options)` — the Thread Durable Object
156
+ * (plan §1.4,
157
+ * D-P6-1): a factory returning a class that applications export from their Worker entry.
158
+ * One SQLite-backed Object per Thread is the serialized owner (durability §6); the
159
+ * Object never runs `runResolvedWorker`'s infinite loop — each ingress event or alarm runs
160
+ * ONE bounded `runRecovery` + `processThreadResolved` pass, and the persisted alarm
161
+ * (the single multiplexed slot, D-P6-2) finishes accepted work across evictions WITHOUT any
162
+ * incoming request.
163
+ *
164
+ * Constructor gate (`blockConcurrencyWhile`) is LOCAL-ONLY: schema migration and the
165
+ * exact-version check, configuration decode, and the defensive ensure-alarm half of the
166
+ * alarm invariant. It deliberately does NOT run the recovery pass: parent recovery can
167
+ * require child-Object reads and vice versa, and two Objects blocked in constructor gates
168
+ * awaiting each other's RPC would deadlock (plan §1.4). Instead every pass runs
169
+ * `runRecovery` BEFORE any claim, so reconciliation still strictly precedes new work.
170
+ */
171
+ /** Construction options for one deployed Thread Object class. */
172
+ interface Options<ApplicationServices = never, EventServices = never, EventLayerError = never> extends CloudflareDurableRuntimeOptions {
173
+ /** Accept transient native RPC tracing through effect-cf; disabled by default. */
174
+ readonly rpcTracing?: boolean;
175
+ /**
176
+ * Name of the Worker `env` binding carrying THIS class's `DurableObjectNamespace` — the
177
+ * Object's route back to sibling Thread Objects for the WP2 cross-Object port calls
178
+ * and remote wakes (DEPLOY-010: the binding enters through a Layer, never ambiently).
179
+ */
180
+ readonly namespaceBinding: string;
181
+ /** Acquired and finalized per native event, with access to the complete application runtime. */
182
+ readonly eventLayer?: Layer.Layer<EventServices, EventLayerError, RuntimeServices | ApplicationServices | DurableObjectState$1.DurableObjectState | WorkerEnvironment>;
183
+ }
184
+ type EndpointServices = CloudflareDurableRuntimeServices | CloudflareBootstrapServices | DurableObjectContext;
185
+ type RuntimeServices = EndpointServices | ThreadObjectNamespace;
186
+ declare const AdminExplainRequest_base: Schema.Class<AdminExplainRequest, Schema.Struct<{
187
+ readonly submissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
188
+ }>, {}>;
189
+ /** Explain one Submission (`submissionId` present) or every nonterminal lane member. */
190
+ declare class AdminExplainRequest extends AdminExplainRequest_base {}
191
+ declare const AdminVerifyRequest_base: Schema.Class<AdminVerifyRequest, Schema.Struct<{}>, {}>;
192
+ /** Verify carries no parameters — the addressed Object IS the lane. */
193
+ declare class AdminVerifyRequest extends AdminVerifyRequest_base {}
194
+ /** Every typed failure of the four admin entry points, plus the protocol's own errors. */
195
+ declare const AdminFailure: Schema.Union<readonly [typeof OperationDenied, typeof RetryRefused, typeof LedgerError, typeof RunJournalError, typeof DigestError, typeof OwnershipLost, typeof SettlementConflict, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
196
+ type AdminFailure = typeof AdminFailure.Type;
197
+ declare const ExplainedRecovery_base: Schema.Class<ExplainedRecovery, Schema.TaggedStruct<"ExplainedRecovery", {
198
+ readonly explanations: Schema.$Array<typeof RecoveryExplanation>;
199
+ }>, {}>;
200
+ declare class ExplainedRecovery extends ExplainedRecovery_base {}
201
+ declare const VerifiedIntegrity_base: Schema.Class<VerifiedIntegrity, Schema.TaggedStruct<"VerifiedIntegrity", {
202
+ readonly report: typeof IntegrityReport;
203
+ }>, {}>;
204
+ declare class VerifiedIntegrity extends VerifiedIntegrity_base {}
205
+ declare const RetryExecuted_base: Schema.Class<RetryExecuted, Schema.TaggedStruct<"RetryExecuted", {
206
+ readonly report: typeof RecoveryReport;
207
+ }>, {}>;
208
+ declare class RetryExecuted extends RetryExecuted_base {}
209
+ declare const ObligationsScanned_base: Schema.Class<ObligationsScanned, Schema.TaggedStruct<"ObligationsScanned", {
210
+ readonly report: typeof ObligationReport;
211
+ }>, {}>;
212
+ declare class ObligationsScanned extends ObligationsScanned_base {}
213
+ declare const AdminFailed_base: Schema.Class<AdminFailed, Schema.TaggedStruct<"AdminFailed", {
214
+ readonly failure: Schema.Union<readonly [typeof OperationDenied, typeof RetryRefused, typeof LedgerError, typeof RunJournalError, typeof DigestError, typeof OwnershipLost, typeof SettlementConflict, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
215
+ }>, {}>;
216
+ /** The admin entry point failed TYPED on the Object; the failure re-decodes verbatim. */
217
+ declare class AdminFailed extends AdminFailed_base {}
218
+ /** The uniform answer of one admin entry point. Callers narrow by the tag their call implies. */
219
+ declare const AdminResponse: Schema.Union<readonly [typeof ExplainedRecovery, typeof VerifiedIntegrity, typeof RetryExecuted, typeof ObligationsScanned, typeof AdminFailed]>;
220
+ type AdminResponse = typeof AdminResponse.Type;
221
+ declare const decodeAdminExplainRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminExplainRequest, Schema.SchemaError, never>;
222
+ declare const decodeAdminVerifyRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminVerifyRequest, Schema.SchemaError, never>;
223
+ declare const decodeRetryCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<RetryCommand, Schema.SchemaError, never>;
224
+ declare const decodeObligationThresholds: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<ObligationThresholds, Schema.SchemaError, never>;
225
+ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
226
+ readonly _tag: "ExplainedRecovery";
227
+ readonly explanations: readonly {
228
+ readonly submission: {
229
+ readonly submissionId: string;
230
+ readonly threadId: string;
231
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
232
+ readonly queueSequence: number;
233
+ readonly createdAt: string;
234
+ readonly readyAt?: string | undefined;
235
+ readonly ageSeconds: number;
236
+ readonly readyAgeSeconds?: number | undefined;
237
+ readonly parentLinkage?: {
238
+ readonly parentSubmissionId: string;
239
+ readonly parentToolCallId: string;
240
+ } | undefined;
241
+ };
242
+ readonly evidence: {
243
+ readonly threadMaterialized: boolean;
244
+ readonly inputRecorded: boolean;
245
+ readonly abortRecorded: boolean;
246
+ readonly recordedSettlementOutcome?: "aborted" | "completed" | "failed" | undefined;
247
+ readonly openToolCalls: readonly {
248
+ readonly toolCallId: string;
249
+ readonly toolName: string;
250
+ readonly turn: number;
251
+ }[];
252
+ readonly openDelegationCalls: readonly {
253
+ readonly toolCallId: string;
254
+ readonly toolName: string;
255
+ readonly turn: number;
256
+ readonly requested: boolean;
257
+ readonly started: boolean;
258
+ readonly joined: boolean;
259
+ readonly childThreadId?: string | undefined;
260
+ readonly childSubmissionId?: string | undefined;
261
+ readonly admission?: "admitted" | "indeterminate" | "not-admitted" | undefined;
262
+ }[];
263
+ readonly approvalsPending: readonly {
264
+ readonly toolCallId: string;
265
+ readonly turn: number;
266
+ }[];
267
+ readonly unknownCalls: readonly {
268
+ readonly toolCallId: string;
269
+ readonly toolName: string;
270
+ readonly reason: string;
271
+ readonly recordedAt: string;
272
+ readonly resolved: boolean;
273
+ }[];
274
+ readonly approvalDecisions: readonly {
275
+ readonly submissionId: string;
276
+ readonly toolCallId: string;
277
+ readonly decision: "approved" | "denied";
278
+ readonly resolver: string;
279
+ readonly reason: string;
280
+ readonly decidedAt: string;
281
+ readonly canonicalRecordId?: string | undefined;
282
+ }[];
283
+ readonly unknownResolutions: readonly {
284
+ readonly submissionId: string;
285
+ readonly toolCallId: string;
286
+ readonly author: string;
287
+ readonly reason: string;
288
+ readonly resolution: {
289
+ readonly _tag: "SafeToRetry";
290
+ } | {
291
+ readonly _tag: "CompletedWithResult";
292
+ readonly result: Schema.Json;
293
+ readonly isFailure: boolean;
294
+ } | {
295
+ readonly _tag: "NeverHappened";
296
+ } | {
297
+ readonly _tag: "AbortSubmission";
298
+ };
299
+ readonly resolvedAt: string;
300
+ readonly canonicalRecordId?: string | undefined;
301
+ }[];
302
+ readonly childAttachments: readonly {
303
+ readonly toolCallId: string;
304
+ readonly childSubmissionId: string;
305
+ readonly childState: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
306
+ readonly childOutcome?: "aborted" | "completed" | "failed" | undefined;
307
+ }[];
308
+ readonly joins: readonly {
309
+ readonly submissionId: string;
310
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
311
+ readonly hostSubmissionId: string;
312
+ }[];
313
+ readonly hostSubmissionId?: string | undefined;
314
+ readonly suspension?: {
315
+ readonly reason: {
316
+ readonly _tag: "ApprovalPending";
317
+ readonly toolCallIds: readonly [string, ...string[]];
318
+ } | {
319
+ readonly _tag: "WaitingForChild";
320
+ readonly children: readonly [{
321
+ readonly toolCallId: string;
322
+ readonly childSubmissionId: string;
323
+ }, ...{
324
+ readonly toolCallId: string;
325
+ readonly childSubmissionId: string;
326
+ }[]];
327
+ };
328
+ readonly suspendedAt: string;
329
+ } | undefined;
330
+ readonly abortIntent?: {
331
+ readonly submissionId: string;
332
+ readonly author: string;
333
+ readonly reason: string;
334
+ readonly requestedAt: string;
335
+ readonly canonicalRecordId?: string | undefined;
336
+ } | undefined;
337
+ };
338
+ readonly decision: {
339
+ readonly _tag: "CompleteMaterialization";
340
+ readonly submissionId: string;
341
+ } | {
342
+ readonly _tag: "RepairReadiness";
343
+ readonly submissionId: string;
344
+ } | {
345
+ readonly _tag: "ApplyInput";
346
+ readonly submissionId: string;
347
+ } | {
348
+ readonly _tag: "RepairInputMarker";
349
+ readonly submissionId: string;
350
+ } | {
351
+ readonly _tag: "ResumeFromTurnBoundary";
352
+ readonly submissionId: string;
353
+ } | {
354
+ readonly _tag: "AppendReservedSettlement";
355
+ readonly submissionId: string;
356
+ readonly settlementId: string;
357
+ readonly outcome: "aborted" | "completed" | "failed";
358
+ } | {
359
+ readonly _tag: "FinalizeLedgerFromHistory";
360
+ readonly submissionId: string;
361
+ readonly settlementId: string;
362
+ readonly outcome: "aborted" | "completed" | "failed";
363
+ } | {
364
+ readonly _tag: "SettleAborted";
365
+ readonly submissionId: string;
366
+ } | {
367
+ readonly _tag: "MarkUnknown";
368
+ readonly submissionId: string;
369
+ readonly reason: string;
370
+ readonly openToolCallIds: readonly string[];
371
+ } | {
372
+ readonly _tag: "ResumePendingToolBatch";
373
+ readonly submissionId: string;
374
+ readonly turn: number;
375
+ } | {
376
+ readonly _tag: "AwaitApprovalDecision";
377
+ readonly submissionId: string;
378
+ } | {
379
+ readonly _tag: "ResumeSuspended";
380
+ readonly submissionId: string;
381
+ } | {
382
+ readonly _tag: "AwaitUnknownResolution";
383
+ readonly submissionId: string;
384
+ } | {
385
+ readonly _tag: "ApplyUnknownResolutions";
386
+ readonly submissionId: string;
387
+ } | {
388
+ readonly _tag: "RevertJoining";
389
+ readonly submissionId: string;
390
+ } | {
391
+ readonly _tag: "RepairJoinMarker";
392
+ readonly submissionId: string;
393
+ } | {
394
+ readonly _tag: "SettleJoinedWithHost";
395
+ readonly submissionId: string;
396
+ readonly outcome: "aborted" | "completed" | "failed";
397
+ } | {
398
+ readonly _tag: "AwaitHostSettlement";
399
+ readonly submissionId: string;
400
+ readonly hostSubmissionId?: string | undefined;
401
+ } | {
402
+ readonly _tag: "CompleteChildAdmission";
403
+ readonly submissionId: string;
404
+ readonly toolCallId: string;
405
+ } | {
406
+ readonly _tag: "AwaitChildAdmissionResolution";
407
+ readonly submissionId: string;
408
+ readonly toolCallId: string;
409
+ } | {
410
+ readonly _tag: "RepairSubagentStartLink";
411
+ readonly submissionId: string;
412
+ readonly toolCallId: string;
413
+ } | {
414
+ readonly _tag: "EnsureWaitingForChild";
415
+ readonly submissionId: string;
416
+ readonly children: readonly [{
417
+ readonly toolCallId: string;
418
+ readonly childSubmissionId: string;
419
+ }, ...{
420
+ readonly toolCallId: string;
421
+ readonly childSubmissionId: string;
422
+ }[]];
423
+ } | {
424
+ readonly _tag: "AwaitChildSettlement";
425
+ readonly submissionId: string;
426
+ } | {
427
+ readonly _tag: "ResumeWaitingParent";
428
+ readonly submissionId: string;
429
+ readonly children: readonly [{
430
+ readonly toolCallId: string;
431
+ readonly childSubmissionId: string;
432
+ }, ...{
433
+ readonly toolCallId: string;
434
+ readonly childSubmissionId: string;
435
+ }[]];
436
+ } | {
437
+ readonly _tag: "ApplyJoinAccounting";
438
+ readonly submissionId: string;
439
+ readonly toolCallId: string;
440
+ readonly reservationId: string;
441
+ } | {
442
+ readonly _tag: "PropagateChildAbort";
443
+ readonly submissionId: string;
444
+ readonly children: readonly [{
445
+ readonly toolCallId: string;
446
+ readonly childSubmissionId: string;
447
+ }, ...{
448
+ readonly toolCallId: string;
449
+ readonly childSubmissionId: string;
450
+ }[]];
451
+ } | {
452
+ readonly _tag: "ReleaseOrphanChildReservation";
453
+ readonly submissionId: string;
454
+ readonly reservationIds: readonly [string, ...string[]];
455
+ } | {
456
+ readonly _tag: "AwaitParentEstablishment";
457
+ readonly submissionId: string;
458
+ readonly parentSubmissionId: string;
459
+ readonly parentToolCallId: string;
460
+ } | {
461
+ readonly _tag: "NoAction";
462
+ readonly submissionId: string;
463
+ };
464
+ readonly decisionMeaning: string;
465
+ readonly disposition: "deferred" | "none" | "repaired" | "unknown";
466
+ readonly explainedAt: string;
467
+ }[];
468
+ } | {
469
+ readonly _tag: "VerifiedIntegrity";
470
+ readonly report: {
471
+ readonly threadId: string;
472
+ readonly tailSequence: number;
473
+ readonly recordCount: number;
474
+ readonly submissionCount: number;
475
+ readonly checks: readonly {
476
+ readonly name: "all-settled" | "checkpoint-binding" | "digest-chain" | "fifo-input-order" | "fifo-settlement-order" | "ledger-canonical-agreement" | "record-identity" | "schema-round-trip" | "sequence-contiguity" | "terminal-uniqueness";
477
+ readonly status: "failed" | "passed" | "skipped";
478
+ readonly detail?: string | undefined;
479
+ }[];
480
+ readonly ok: boolean;
481
+ };
482
+ } | {
483
+ readonly _tag: "RetryExecuted";
484
+ readonly report: {
485
+ readonly submissionId: string;
486
+ readonly threadId: string;
487
+ readonly decision: {
488
+ readonly _tag: "CompleteMaterialization";
489
+ readonly submissionId: string;
490
+ } | {
491
+ readonly _tag: "RepairReadiness";
492
+ readonly submissionId: string;
493
+ } | {
494
+ readonly _tag: "ApplyInput";
495
+ readonly submissionId: string;
496
+ } | {
497
+ readonly _tag: "RepairInputMarker";
498
+ readonly submissionId: string;
499
+ } | {
500
+ readonly _tag: "ResumeFromTurnBoundary";
501
+ readonly submissionId: string;
502
+ } | {
503
+ readonly _tag: "AppendReservedSettlement";
504
+ readonly submissionId: string;
505
+ readonly settlementId: string;
506
+ readonly outcome: "aborted" | "completed" | "failed";
507
+ } | {
508
+ readonly _tag: "FinalizeLedgerFromHistory";
509
+ readonly submissionId: string;
510
+ readonly settlementId: string;
511
+ readonly outcome: "aborted" | "completed" | "failed";
512
+ } | {
513
+ readonly _tag: "SettleAborted";
514
+ readonly submissionId: string;
515
+ } | {
516
+ readonly _tag: "MarkUnknown";
517
+ readonly submissionId: string;
518
+ readonly reason: string;
519
+ readonly openToolCallIds: readonly string[];
520
+ } | {
521
+ readonly _tag: "ResumePendingToolBatch";
522
+ readonly submissionId: string;
523
+ readonly turn: number;
524
+ } | {
525
+ readonly _tag: "AwaitApprovalDecision";
526
+ readonly submissionId: string;
527
+ } | {
528
+ readonly _tag: "ResumeSuspended";
529
+ readonly submissionId: string;
530
+ } | {
531
+ readonly _tag: "AwaitUnknownResolution";
532
+ readonly submissionId: string;
533
+ } | {
534
+ readonly _tag: "ApplyUnknownResolutions";
535
+ readonly submissionId: string;
536
+ } | {
537
+ readonly _tag: "RevertJoining";
538
+ readonly submissionId: string;
539
+ } | {
540
+ readonly _tag: "RepairJoinMarker";
541
+ readonly submissionId: string;
542
+ } | {
543
+ readonly _tag: "SettleJoinedWithHost";
544
+ readonly submissionId: string;
545
+ readonly outcome: "aborted" | "completed" | "failed";
546
+ } | {
547
+ readonly _tag: "AwaitHostSettlement";
548
+ readonly submissionId: string;
549
+ readonly hostSubmissionId?: string | undefined;
550
+ } | {
551
+ readonly _tag: "CompleteChildAdmission";
552
+ readonly submissionId: string;
553
+ readonly toolCallId: string;
554
+ } | {
555
+ readonly _tag: "AwaitChildAdmissionResolution";
556
+ readonly submissionId: string;
557
+ readonly toolCallId: string;
558
+ } | {
559
+ readonly _tag: "RepairSubagentStartLink";
560
+ readonly submissionId: string;
561
+ readonly toolCallId: string;
562
+ } | {
563
+ readonly _tag: "EnsureWaitingForChild";
564
+ readonly submissionId: string;
565
+ readonly children: readonly [{
566
+ readonly toolCallId: string;
567
+ readonly childSubmissionId: string;
568
+ }, ...{
569
+ readonly toolCallId: string;
570
+ readonly childSubmissionId: string;
571
+ }[]];
572
+ } | {
573
+ readonly _tag: "AwaitChildSettlement";
574
+ readonly submissionId: string;
575
+ } | {
576
+ readonly _tag: "ResumeWaitingParent";
577
+ readonly submissionId: string;
578
+ readonly children: readonly [{
579
+ readonly toolCallId: string;
580
+ readonly childSubmissionId: string;
581
+ }, ...{
582
+ readonly toolCallId: string;
583
+ readonly childSubmissionId: string;
584
+ }[]];
585
+ } | {
586
+ readonly _tag: "ApplyJoinAccounting";
587
+ readonly submissionId: string;
588
+ readonly toolCallId: string;
589
+ readonly reservationId: string;
590
+ } | {
591
+ readonly _tag: "PropagateChildAbort";
592
+ readonly submissionId: string;
593
+ readonly children: readonly [{
594
+ readonly toolCallId: string;
595
+ readonly childSubmissionId: string;
596
+ }, ...{
597
+ readonly toolCallId: string;
598
+ readonly childSubmissionId: string;
599
+ }[]];
600
+ } | {
601
+ readonly _tag: "ReleaseOrphanChildReservation";
602
+ readonly submissionId: string;
603
+ readonly reservationIds: readonly [string, ...string[]];
604
+ } | {
605
+ readonly _tag: "AwaitParentEstablishment";
606
+ readonly submissionId: string;
607
+ readonly parentSubmissionId: string;
608
+ readonly parentToolCallId: string;
609
+ } | {
610
+ readonly _tag: "NoAction";
611
+ readonly submissionId: string;
612
+ };
613
+ readonly disposition: "deferred" | "none" | "repaired" | "unknown";
614
+ };
615
+ } | {
616
+ readonly _tag: "ObligationsScanned";
617
+ readonly report: {
618
+ readonly thresholds: {
619
+ readonly agingSeconds: number;
620
+ readonly overdueSeconds: number;
621
+ };
622
+ readonly entries: readonly {
623
+ readonly submissionId: string;
624
+ readonly threadId: string;
625
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
626
+ readonly blockedOn: "approval" | "ready-aged" | "running-aged" | "unknown" | "waitingForChild";
627
+ readonly ageSeconds: number;
628
+ readonly severity: "aging" | "ok" | "overdue";
629
+ }[];
630
+ readonly generatedAt: string;
631
+ };
632
+ } | {
633
+ readonly _tag: "AdminFailed";
634
+ readonly failure: {
635
+ readonly _tag: "DurableAlarmError";
636
+ readonly operation: string;
637
+ readonly message: string;
638
+ readonly cause?: Schema.Json | undefined;
639
+ } | {
640
+ readonly _tag: "SettlementConflict";
641
+ readonly submissionId: string;
642
+ readonly existingOutcome: "aborted" | "completed" | "failed";
643
+ } | {
644
+ readonly _tag: "LedgerError";
645
+ readonly operation: string;
646
+ readonly message: string;
647
+ readonly cause?: Schema.Json | undefined;
648
+ } | {
649
+ readonly _tag: "ThreadStoreError";
650
+ readonly operation: string;
651
+ readonly message: string;
652
+ readonly cause?: Schema.Json | undefined;
653
+ } | {
654
+ readonly _tag: "ThreadNotMaterialized";
655
+ readonly threadId: string;
656
+ } | {
657
+ readonly _tag: "AppendConflict";
658
+ readonly threadId: string;
659
+ readonly batchId: string;
660
+ readonly reason: "batch-digest" | "record-identity" | "tail";
661
+ readonly actualTailSequence?: number | undefined;
662
+ readonly actualTailDigest?: string | undefined;
663
+ } | {
664
+ readonly _tag: "FenceRejected";
665
+ readonly threadId: string;
666
+ readonly actualEpoch: number;
667
+ readonly attemptedEpoch: number;
668
+ } | {
669
+ readonly _tag: "OperationDenied";
670
+ readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
671
+ readonly reason: string;
672
+ readonly threadId?: string | undefined;
673
+ readonly submissionId?: string | undefined;
674
+ } | {
675
+ readonly _tag: "RetryRefused";
676
+ readonly submissionId: string;
677
+ readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
678
+ readonly decisionTag: string;
679
+ readonly message: string;
680
+ } | {
681
+ readonly _tag: "RunJournalError";
682
+ readonly message: string;
683
+ readonly cause?: Schema.Json | undefined;
684
+ } | {
685
+ readonly _tag: "DigestError";
686
+ readonly message: string;
687
+ readonly cause?: Schema.Json | undefined;
688
+ } | {
689
+ readonly _tag: "OwnershipLost";
690
+ readonly submissionId: string;
691
+ readonly actualEpoch: number;
692
+ } | {
693
+ readonly _tag: "DurableRuntimeFailpointError";
694
+ 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";
695
+ } | {
696
+ readonly _tag: "HostProtocolError";
697
+ readonly message: string;
698
+ };
699
+ }, Schema.SchemaError, never>;
700
+ declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
701
+ /** The public endpoints and effect-cf invocation hook of one Thread Object instance. */
702
+ interface Instance<EventServices = never> extends InstanceType<DurableObject.DurableObjectClass<Record<never, never>, RuntimeServices | EventServices>> {
703
+ submitEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
704
+ awaitSettlementEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
705
+ awaitProgressEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
706
+ cancelProgressEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
707
+ observePage(encoded: unknown, traceContext?: unknown): Promise<unknown>;
708
+ abortEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
709
+ resolveApprovalEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
710
+ resolveUnknownEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
711
+ explainEncoded(encoded: unknown): Promise<unknown>;
712
+ verifyEncoded(encoded: unknown): Promise<unknown>;
713
+ retryEncoded(encoded: unknown): Promise<unknown>;
714
+ obligationsEncoded(encoded: unknown): Promise<unknown>;
715
+ portCall(encoded: unknown): Promise<unknown>;
716
+ wake(): Promise<void>;
717
+ alarm(alarmInfo?: AlarmInvocationInfo): Promise<void> | void;
718
+ }
719
+ /** The constructor shape workerd instantiates for each Thread Object. */
720
+ interface Class<EventServices = never> {
721
+ new (ctx: DurableObjectState, env: Cloudflare.Env): Instance<EventServices>;
722
+ }
723
+ /**
724
+ * Export a composed application Layer as a native Durable Object class.
725
+ * Bootstrap services are provided to the whole graph before it acquires, so application Layers
726
+ * can yield effect-cf's WorkerEnvironment and DurableObjectState, derived identity, and Crypto.
727
+ * Application dependencies remain visible until Layer.provide satisfies them. effect-cf owns the
728
+ * cached ManagedRuntime, native RPC methods, event scopes, and telemetry flushing.
729
+ * Initialization is local and bounded inside the constructor gate. Cloudflare eviction does not
730
+ * guarantee finalizers; put resources requiring timely release in scoped operations or eventLayer.
731
+ */
732
+ declare const make: <ApplicationServices, ApplicationError, EventServices = never, EventLayerError = never>(applicationLayer: Layer.Layer<CloudflareDurableRuntimeServices | ApplicationServices, ApplicationError, CloudflareBootstrapServices | DurableObjectState$1.DurableObjectState | WorkerEnvironment | DurableObjectContext | ThreadObjectNamespace>, options: Options<ApplicationServices, EventServices, EventLayerError>) => Class<ApplicationServices | EventServices>;
733
+ //#endregion
734
+ export { CloudflareDurableRuntimeOptions as C, layerConfig as E, CloudflareDurableRuntimeInitializationError as S, layer as T, decodeObligationThresholds as _, AdminVerifyRequest as a, make as b, Instance as c, RetryExecuted as d, ThreadObject_d_exports as f, decodeAdminVerifyRequest as g, decodeAdminResponse as h, AdminResponse as i, ObligationsScanned as l, decodeAdminExplainRequest as m, AdminFailed as n, Class as o, VerifiedIntegrity as p, AdminFailure as r, ExplainedRecovery as s, AdminExplainRequest as t, Options as u, decodeRetryCommand as v, CloudflareDurableRuntimeServices as w, CloudflareBootstrapServices as x, encodeAdminResponse as y };
735
+ //# sourceMappingURL=ThreadObject-Ia94R_B1.d.mts.map