@effect-agent/platform-cloudflare 0.1.0-beta.38 → 0.1.0-beta.39

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 CHANGED
@@ -1,13 +1,11 @@
1
- import { BrowserQuickActionBrowserBinding, BrowserQuickActionCaptureOptions, BrowserQuickActionClient, BrowserQuickActionRpcError, BrowserQuickActionWorkersAi, BrowserQuickActionWorkersAiPolicy, BrowserQuickActionWorkersAiPolicyError, browserQuickActionCaptureLayer, browserQuickActionImplementation, browserQuickActionScreenshotLayer, browserQuickActionWorkersAiCaptureLayer } from "./browser-quick-action.mjs";
2
- import { BrowserRestCaptureOptions, browserRestCaptureImplementation, browserRestCaptureLayer, browserRestWorkersAiCaptureLayer } from "./browser-rest-capture.mjs";
3
- import { BrowserRestCrawlOptions, browserRestCrawlImplementation, browserRestCrawlLayer } from "./browser-rest-crawl.mjs";
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 { S as BrowserRunSessionLifecycle, _ as browserRunInteractiveHostLayer, a as BrowserRunInteractiveBinding, b as isBrowserRunUndispatchedActionError, c as BrowserRunInteractiveContext, d as BrowserRunInteractiveRequest, f as BrowserRunInteractiveRequestListener, g as BrowserRunViewport, h as BrowserRunLiveViewResult, i as BrowserRunHandoffState, l as BrowserRunInteractiveHost, m as BrowserRunLiveViewRequest, n as BrowserRunHandoffRequest, o as BrowserRunInteractiveBrowser, p as BrowserRunInteractiveSession, r as BrowserRunHandoffResult, s as BrowserRunInteractiveCdpSession, t as BrowserRunCloudflareCommand, u as BrowserRunInteractivePage, v as browserRunInteractiveImplementation, x as BrowserRunCleanupError, y as browserRunInteractiveLayer } from "./interactive-browser-BRo-Bfvb.mjs";
1
+ import { a as ThreadObjectRpc, i as ThreadObjectNamespace, n as DurableObjectContext, o as threadNamespaceFromEnv, r as ThreadObjectIdentity, s as threadNamespaceLayer, t as CloudflareBindingError } from "./bindings-C00ZfjsX.mjs";
2
+ import { CloudflareSchedulingClient, ScheduleAlarmProtocolError, ScheduleOwnerIdentity, ScheduleOwnerNamespace, ScheduleOwnerObjectClass, ScheduleOwnerObjectInstance, ScheduleOwnerObjectRpc, ScheduleOwnerProtocolError, makeScheduleOwnerObjectClass } from "./scheduling.mjs";
3
+ import { CloudflareSubscriptionConfigError, CloudflareSubscriptionsClient, SubscriptionAlarmProtocolError, SubscriptionPartitionIdentity, SubscriptionPartitionNamespace, SubscriptionPartitionObjectClass, SubscriptionPartitionObjectInstance, SubscriptionPartitionObjectRpc, SubscriptionPartitionProtocolError, makeSubscriptionPartitionObjectClass, sourcePartitionName, validateCloudflareSubscriptionLimits } from "./subscriptions.mjs";
6
4
  import { Context, Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
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";
8
- import { ConversationPortTransport, DoStorageFailpointHandler, DoStorageInitializationError, PortRequest, PortResponse } from "@effect-agent/storage-cloudflare";
9
- import { AgentInputError, ConversationId } from "@effect-agent/core";
10
- import { RunContextPreparation, RunCostEstimator, RunToolFailureObserver } from "@effect-agent/engine";
5
+ import { DoStorageFailpoint, DoStorageFailpointHandler, DoStorageInitializationError, PortRequest, PortResponse, ThreadPortTransport } from "@effect-agent/storage-cloudflare";
6
+ import { AbortCommand, AbortIntent, AdmissionConflict, AgentRegistration, AppendConflict, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, CanonicalRecordEnvelope, CanonicalSequence, DefinitionDigests, DigestError, DurableAgentRuntime, DurableBindingFailure, DurableRuntimeConfig, DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler, DurableSubmitAgent, DurableSubmitOptions, DurableWorkerFailure, FenceRejected, IntegrityReport, JoinedToHost, LedgerError, ObligationReport, ObligationThresholds, OperationAuthorizerService, OperationDenied, OwnershipLost, PreparedInputAdmission, Receipt, RecoveryExplanation, RecoveryReport, ResolvedBinding, RetryCommand, RetryRefused, RunJournalError, ScheduledInputAdmission, Settlement, SettlementConflict, SubmissionLedger, ThreadNotMaterialized, ThreadStore, ThreadStoreError, ToolReconciler, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WakeScheduler } from "@effect-agent/thread";
7
+ import { AgentInputError, ThreadId } from "@effect-agent/core";
8
+ import { RunContextPreparation, RunCostEstimator, RunToolAuthorization, RunToolFailureObserver } from "@effect-agent/engine";
11
9
  import { DurableObject, DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
12
10
  import { CodeExecutor, SandboxImplementation } from "@effect-agent/sandbox";
13
11
  //#region src/config.d.ts
@@ -27,7 +25,7 @@ declare const AdmissionLimitExceeded_base: Schema.Class<AdmissionLimitExceeded,
27
25
  * (deployment spec §8, DEPLOY-007: "Admission has explicit bounded quota and overload
28
26
  * behavior... a typed rejection"). This is the DC analogue of `NodeDurableHost`'s
29
27
  * `AdmissionClosed` host gate: the port surface stays untouched, the refusal happens in the
30
- * Conversation Object's submit entry point before `DurableAgentRuntime.submit` runs, and
28
+ * Thread Object's submit entry point before `DurableAgentRuntime.submit` runs, and
31
29
  * nothing was admitted or written.
32
30
  */
33
31
  declare class AdmissionLimitExceeded extends AdmissionLimitExceeded_base {
@@ -38,7 +36,7 @@ declare const CLOUDFLARE_DATABASE_CAP_BYTES = 10000000000;
38
36
  /** Default database-size admission ceiling: a 1 GB safety margin under the platform cap. */
39
37
  declare const DEFAULT_MAX_DATABASE_BYTES = 9000000000;
40
38
  declare const CloudflareAdmissionLimitsValue_base: Schema.Class<CloudflareAdmissionLimitsValue, Schema.Struct<{
41
- /** Maximum nonterminal Submissions per Conversation lane before new admissions refuse. */
39
+ /** Maximum nonterminal Submissions per Thread lane before new admissions refuse. */
42
40
  readonly maxQueueDepthPerLane: Schema.Int;
43
41
  /** Maximum encoded input bytes; never above the storage per-value bound. */
44
42
  readonly maxInputBytes: Schema.Int;
@@ -46,13 +44,13 @@ declare const CloudflareAdmissionLimitsValue_base: Schema.Class<CloudflareAdmiss
46
44
  readonly maxDatabaseBytes: Schema.Int;
47
45
  }>, {}>;
48
46
  /**
49
- * Explicit bounded admission quotas checked by the Conversation Object BEFORE admission
47
+ * Explicit bounded admission quotas checked by the Thread Object BEFORE admission
50
48
  * (exit gate "resource limits are checked before admission").
51
49
  */
52
50
  declare class CloudflareAdmissionLimitsValue extends CloudflareAdmissionLimitsValue_base {}
53
51
  declare const CloudflareDurableRuntimeConfigValue_base: Schema.Class<CloudflareDurableRuntimeConfigValue, Schema.Struct<{
54
- readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/session/DeploymentId">;
55
- /** Head of the minted producer identity `{producerPrefix}:{conversationId}`. */
52
+ readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
53
+ /** Head of the minted producer identity `{producerPrefix}:{threadId}`. */
56
54
  readonly producerPrefix: Schema.NonEmptyString;
57
55
  /** Submission ownership lease duration (D5); fences work across Object incarnations. */
58
56
  readonly ownershipLeaseDuration: Schema.Int;
@@ -81,7 +79,7 @@ declare const CloudflareDurableRuntimeConfigValue_base: Schema.Class<CloudflareD
81
79
  }>, {}>;
82
80
  /**
83
81
  * Validated Cloudflare durable runtime configuration. The producer identity of one
84
- * Conversation Object is `{producerPrefix}:{conversationId}` — stable across incarnations of
82
+ * Thread Object is `{producerPrefix}:{threadId}` — stable across incarnations of
85
83
  * the same deployment, distinct across deployments — and producer-epoch fencing (not the
86
84
  * producer name) remains the correctness authority (DUR-006).
87
85
  */
@@ -89,7 +87,7 @@ declare class CloudflareDurableRuntimeConfigValue extends CloudflareDurableRunti
89
87
  declare const CloudflareDurableRuntimeConfig_base: Context.ServiceClass<CloudflareDurableRuntimeConfig, "@effect-agent/platform-cloudflare/CloudflareDurableRuntimeConfig", CloudflareDurableRuntimeConfigValue>;
90
88
  /** Explicit configuration authority for the assembled Cloudflare durable runtime. */
91
89
  declare class CloudflareDurableRuntimeConfig extends CloudflareDurableRuntimeConfig_base {}
92
- /** Documented production defaults applied by `CloudflareDurableRuntime.layer`. */
90
+ /** Documented production defaults applied by `ThreadObject.layer`. */
93
91
  declare const CLOUDFLARE_RUNTIME_DEFAULTS: {
94
92
  readonly ownershipLeaseDuration: number;
95
93
  readonly alarmBackoffBase: 100;
@@ -173,17 +171,17 @@ declare const MaintenancePassReport_base: Schema.Class<MaintenancePassReport, Sc
173
171
  /** What one maintenance pass did — auditable evidence mirroring `NodeDurableHost`'s report. */
174
172
  declare class MaintenancePassReport extends MaintenancePassReport_base {}
175
173
  /** Fault boundaries around every maintenance-owned durable mutation. */
176
- type ConversationMaintenanceFailpointLocation = "maintenance:dirty:before" | "maintenance:dirty:after" | "maintenance:mutation:armed" | "maintenance:mutation:finished" | "maintenance:ensure:before" | "maintenance:ensure:after" | "maintenance:begin:before" | "maintenance:begin:after" | "maintenance:finish:before" | "maintenance:finish:after";
177
- type ConversationMaintenanceFailpointHandler = (location: ConversationMaintenanceFailpointLocation) => Effect.Effect<void>;
178
- declare const ConversationMaintenanceFailpoint_base: Context.ServiceClass<ConversationMaintenanceFailpoint, "@effect-agent/platform-cloudflare/ConversationMaintenanceFailpoint", {
179
- readonly hit: ConversationMaintenanceFailpointHandler;
174
+ type ThreadMaintenanceFailpointLocation = "maintenance:dirty:before" | "maintenance:dirty:after" | "maintenance:mutation:armed" | "maintenance:mutation:finished" | "maintenance:ensure:before" | "maintenance:ensure:after" | "maintenance:begin:before" | "maintenance:begin:after" | "maintenance:finish:before" | "maintenance:finish:after";
175
+ type ThreadMaintenanceFailpointHandler = (location: ThreadMaintenanceFailpointLocation) => Effect.Effect<void>;
176
+ declare const ThreadMaintenanceFailpoint_base: Context.ServiceClass<ThreadMaintenanceFailpoint, "@effect-agent/platform-cloudflare/ThreadMaintenanceFailpoint", {
177
+ readonly hit: ThreadMaintenanceFailpointHandler;
180
178
  }>;
181
179
  /** Test-only fault authority; production uses the inert layer. */
182
- declare class ConversationMaintenanceFailpoint extends ConversationMaintenanceFailpoint_base {
183
- static readonly layer: Layer.Layer<ConversationMaintenanceFailpoint, never, never>;
180
+ declare class ThreadMaintenanceFailpoint extends ThreadMaintenanceFailpoint_base {
181
+ static readonly layer: Layer.Layer<ThreadMaintenanceFailpoint, never, never>;
184
182
  }
185
183
  type MaintenancePassFailure = DurableWorkerFailure | DurableBindingFailure | DurableAlarmError;
186
- declare const ConversationMaintenance_base: Context.ServiceClass<ConversationMaintenance, "@effect-agent/platform-cloudflare/ConversationMaintenance", {
184
+ declare const ThreadMaintenance_base: Context.ServiceClass<ThreadMaintenance, "@effect-agent/platform-cloudflare/ThreadMaintenance", {
187
185
  /** One idempotent maintenance pass; failures propagate so workerd retries the alarm. */
188
186
  readonly pass: Effect.Effect<MaintenancePassReport, MaintenancePassFailure>;
189
187
  /**
@@ -211,8 +209,8 @@ declare const ConversationMaintenance_base: Context.ServiceClass<ConversationMai
211
209
  * 4. Stable external waits acknowledge and clear. Autonomous retry, indeterminate, and lease
212
210
  * recovery states leave their generation dirty and retain bounded backoff rearming.
213
211
  */
214
- declare class ConversationMaintenance extends ConversationMaintenance_base {
215
- static readonly layer: Layer.Layer<ConversationMaintenance, never, DurableAgentRuntime | AgentBindingResolver | SubmissionLedger | DurableAlarmService | ConversationMaintenanceFailpoint | CloudflareDurableRuntimeConfig | ConversationObjectIdentity | DurableObjectContext>;
212
+ declare class ThreadMaintenance extends ThreadMaintenance_base {
213
+ static readonly layer: (bindings: ReadonlyArray<ResolvedBinding>) => Layer.Layer<ThreadMaintenance, never, DurableAgentRuntime | SubmissionLedger | DurableAlarmService | ThreadMaintenanceFailpoint | CloudflareDurableRuntimeConfig | ThreadObjectIdentity | DurableObjectContext>;
216
214
  }
217
215
  //#endregion
218
216
  //#region src/wake-scheduler.d.ts
@@ -228,7 +226,7 @@ declare class ConversationMaintenance extends ConversationMaintenance_base {
228
226
  * subscription accelerates waiters within one incarnation and the settlement poll interval
229
227
  * is the correctness path.
230
228
  */
231
- declare const cloudflareWakeSchedulerLayer: Layer.Layer<WakeScheduler, never, DurableAlarmService | ConversationObjectIdentity | ConversationObjectNamespace>;
229
+ declare const cloudflareWakeSchedulerLayer: Layer.Layer<WakeScheduler, never, DurableAlarmService | ThreadObjectIdentity | ThreadObjectNamespace>;
232
230
  //#endregion
233
231
  //#region src/progress-wait.d.ts
234
232
  declare const ProgressWaitRegistry_base: Context.ServiceClass<ProgressWaitRegistry, "@effect-agent/platform-cloudflare/ProgressWaitRegistry", {
@@ -248,9 +246,9 @@ declare class ProgressWaitRegistry extends ProgressWaitRegistry_base {
248
246
  //#endregion
249
247
  //#region src/transport.d.ts
250
248
  /**
251
- * `ConversationPortTransport` over native Durable Object JS RPC (decision D-P6-3): one
252
- * `portCall(envelope)` on the stub of the Object that owns the addressed Conversation
253
- * (`namespace.idFromName(conversationId)` — the identity rule, plan §1.2). The envelopes are
249
+ * `ThreadPortTransport` over native Durable Object JS RPC (decision D-P6-3): one
250
+ * `portCall(envelope)` on the stub of the Object that owns the addressed Thread
251
+ * (`namespace.idFromName(threadId)` — the identity rule, plan §1.2). The envelopes are
254
252
  * already Schema-encoded JSON, so the RPC boundary carries only structured-cloneable values;
255
253
  * the protocol module stays transport-agnostic and fetch-with-JSON remains the documented
256
254
  * fallback carrier.
@@ -260,18 +258,18 @@ declare class ProgressWaitRegistry extends ProgressWaitRegistry_base {
260
258
  * when present) and NEVER as a fabricated answer: on `resolveAdmission` the routing layer
261
259
  * turns exactly this error into `AdmissionIndeterminate` (SUB-031).
262
260
  */
263
- declare const conversationPortTransportLayer: Layer.Layer<ConversationPortTransport, never, ConversationObjectNamespace>;
261
+ declare const threadPortTransportLayer: Layer.Layer<ThreadPortTransport, never, ThreadObjectNamespace>;
264
262
  //#endregion
265
263
  //#region src/layers.d.ts
266
264
  /**
267
- * Raw (unvalidated) construction options for `CloudflareDurableRuntime.layer`, mirroring
265
+ * Raw (unvalidated) construction options for `ThreadObject.make`, mirroring
268
266
  * `NodeDurableRuntimeOptions`. Optional fields default to the documented production values
269
267
  * (`CLOUDFLARE_RUNTIME_DEFAULTS`); everything is schema-decoded into
270
268
  * `CloudflareDurableRuntimeConfigValue` before any resource opens (deployment §5 gate 1).
271
269
  */
272
270
  interface CloudflareDurableRuntimeOptions {
273
271
  readonly deploymentId: string;
274
- /** Head of the minted producer identity `{producerPrefix}:{conversationId}`. */
272
+ /** Head of the minted producer identity `{producerPrefix}:{threadId}`. */
275
273
  readonly producerPrefix: string;
276
274
  /** Milliseconds; default 30s (D5). */
277
275
  readonly ownershipLeaseDuration?: number | undefined;
@@ -311,8 +309,8 @@ interface CloudflareDurableRuntimeOptions {
311
309
  readonly storageFailpoint?: ((ctx: DurableObjectState) => DoStorageFailpointHandler) | undefined;
312
310
  /** Coordinator fault injection (`submit:*` / `terminalize:*` locations); default none. */
313
311
  readonly runtimeFailpoint?: ((ctx: DurableObjectState) => DurableRuntimeFailpointHandler) | undefined;
314
- /** Conversation-maintenance generation/alarm fault injection; default none. */
315
- readonly maintenanceFailpoint?: ((ctx: DurableObjectState) => ConversationMaintenanceFailpointHandler) | undefined;
312
+ /** Thread-maintenance generation/alarm fault injection; default none. */
313
+ readonly maintenanceFailpoint?: ((ctx: DurableObjectState) => ThreadMaintenanceFailpointHandler) | undefined;
316
314
  /** Host-supplied fail-closed authorization policy; defaults to service possession. */
317
315
  readonly operationAuthorizer?: OperationAuthorizerService | undefined;
318
316
  /**
@@ -321,42 +319,14 @@ interface CloudflareDurableRuntimeOptions {
321
319
  * `ToolReconciler.uncertain`.
322
320
  */
323
321
  readonly toolReconciler?: Layer.Layer<ToolReconciler> | undefined;
324
- /**
325
- * Registered worker Bindings resolved at durable claim time:
326
- * build each with `DurableWorkerBinding.make(binding, digests)`. The callback receives the live
327
- * Object context and derived identities and is evaluated once per incarnation during Layer
328
- * construction. Defaults to the empty registration (every resolved claim fails closed).
329
- */
330
- readonly bindings?: CloudflareBindingSource | undefined;
331
- /**
332
- * Generic Run context acquired with this Durable Object incarnation. It may prepare model
333
- * context and/or authorize exact model-declared application Tool Calls at action time. The
334
- * Layer may depend
335
- * only on `Crypto.Crypto`, which this platform supplies with `BrowserCrypto`; hosts must close
336
- * every application-specific service before passing it here. Default absent.
337
- */
338
- readonly runContext?: CloudflareRunContextSource | undefined;
339
- }
340
- /** Per-incarnation host values available to Effect-native runtime extension factories. */
341
- interface CloudflareRuntimeSourceContext {
342
- readonly ctx: DurableObjectState;
343
- readonly env: unknown;
344
- readonly conversationId: ConversationId;
345
- readonly producerId: ProducerId;
346
322
  }
347
- /** Per-incarnation host values available while registered worker Bindings are captured. */
348
- interface CloudflareBindingSourceContext extends CloudflareRuntimeSourceContext {}
349
- /** Captures registered worker Bindings once for each Durable Object incarnation. */
350
- type CloudflareBindingSource = (context: CloudflareBindingSourceContext) => Effect.Effect<ReadonlyArray<ResolvedBinding>, never, never>;
351
- /** A closed Run-context service whose only remaining requirement is platform Crypto. */
352
- type CloudflareRunContextLayer = Layer.Layer<RunContextPreparation, never, Crypto.Crypto>;
353
- /** One Layer or a per-incarnation factory over explicit Cloudflare host values. */
354
- type CloudflareRunContextSource = CloudflareRunContextLayer | ((context: CloudflareRuntimeSourceContext) => CloudflareRunContextLayer);
323
+ /** Services supplied before the application graph is built, including its dependencies. */
324
+ type CloudflareBootstrapServices = CloudflareDurableRuntimeConfig | ThreadObjectIdentity | DurableRuntimeConfig | Crypto.Crypto | DoStorageFailpoint | DurableRuntimeFailpoint | ThreadMaintenanceFailpoint | RunContextPreparation | RunToolAuthorization | ToolReconciler;
355
325
  /** Every construction failure of the assembled Cloudflare durable runtime stack. */
356
- type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError | DoStorageInitializationError;
357
- /** The services `CloudflareDurableRuntime.layer` provides. */
358
- type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ConversationStore | WakeScheduler | DurableRuntimeConfig | AgentBindingResolver | CloudflareDurableRuntimeConfig | ConversationObjectIdentity | DurableAlarmService | ConversationMaintenance | ConversationObjectPorts | ProgressWaitRegistry;
359
- declare const ConversationObjectPorts_base: Context.ServiceClass<ConversationObjectPorts, "@effect-agent/platform-cloudflare/ConversationObjectPorts", {
326
+ type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError | DigestError | DoStorageInitializationError;
327
+ /** The services `ThreadObject.layer` provides. */
328
+ type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ThreadStore | WakeScheduler | DurableAlarmService | ThreadMaintenance | ThreadObjectPorts | ProgressWaitRegistry;
329
+ declare const ThreadObjectPorts_base: Context.ServiceClass<ThreadObjectPorts, "@effect-agent/platform-cloudflare/ThreadObjectPorts", {
360
330
  readonly handle: (request: PortRequest) => Effect.Effect<PortResponse>;
361
331
  }>;
362
332
  /**
@@ -365,27 +335,20 @@ declare const ConversationObjectPorts_base: Context.ServiceClass<ConversationObj
365
335
  * request cannot bounce between Objects — and returns the typed response for the endpoint to
366
336
  * encode.
367
337
  */
368
- declare class ConversationObjectPorts extends ConversationObjectPorts_base {}
338
+ declare class ThreadObjectPorts extends ThreadObjectPorts_base {}
369
339
  /**
370
- * The DC Layer assembly (deployment §12: a Layer-assembly library, not an app entrypoint;
371
- * plan §1.4). `layer(options)` decodes the configuration, derives this Object's Conversation
372
- * and producer identities, opens the Object's private SQLite database through
373
- * `@effect/sql-sqlite-do` for BOTH the Conversation Log and the Submission Ledger (so claims
374
- * fence the same producer epochs — ADR-0011 D7 transposed), wraps the local port facets with
375
- * the WP2 cross-Object routing decorators over the Durable Object RPC transport, wires the
376
- * alarm-backed wake scheduler and the maintenance pass, defaults reconciliation to the
377
- * fail-closed `ToolReconciler.uncertain`, and provides a ready `DurableAgentRuntime` on top.
378
- *
379
- * Storage compatibility is verified during construction: an incompatible database fails the
380
- * Layer typed (`DoStorageCompatibilityError`) before anything is mutated (DEPLOY-008).
381
- *
382
- * Requires only the two binding services (`DurableObjectContext`,
383
- * `ConversationObjectNamespace`) — platform values enter exclusively through Layers
384
- * (DEPLOY-010).
340
+ * Validate deployment settings and derive services before building application dependencies.
341
+ * The native class factory builds this Layer inside its constructor gate. Custom Effect hosts
342
+ * can provide it around the complete application Layer with the native context already supplied.
385
343
  */
386
- declare class CloudflareDurableRuntime {
387
- static layer(options: CloudflareDurableRuntimeOptions): Layer.Layer<CloudflareDurableRuntimeServices, CloudflareDurableRuntimeInitializationError, DurableObjectContext | ConversationObjectNamespace>;
388
- }
344
+ declare const layerConfig: (options: CloudflareDurableRuntimeOptions) => Layer.Layer<CloudflareBootstrapServices, CloudflarePlatformConfigError, DurableObjectContext>;
345
+ /**
346
+ * Register typed Agents and version declarations. Hashing and dependency capture happen in
347
+ * this Layer's Scope, after application Layers have been provided. Every Agent's instruction,
348
+ * Tool, Schema, and model requirements remain visible until satisfied by Layer composition.
349
+ * Use Layer.unwrap for registration values that need effectful application setup.
350
+ */
351
+ 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 AgentRegistration<infer A extends import("@effect-agent/thread").ExecutableAgentBinding> ? import("@effect-agent/thread").DurableWorkerRequirements<A> : never : never : never, import("effect/Scope").Scope> | CloudflareBootstrapServices>;
389
352
  //#endregion
390
353
  //#region src/client.d.ts
391
354
  /** Truncate a diagnostic string to the host protocol's bounded length. */
@@ -398,8 +361,8 @@ declare const HostProtocolError_base: Schema.Class<HostProtocolError, Schema.Tag
398
361
  * response could not be encoded/decoded. Never carries operation semantics.
399
362
  */
400
363
  declare class HostProtocolError extends HostProtocolError_base {}
401
- declare const ConversationClientError_base: Schema.Class<ConversationClientError, Schema.TaggedStruct<"ConversationClientError", {
402
- readonly conversationId: Schema.String;
364
+ declare const ThreadClientError_base: Schema.Class<ThreadClientError, Schema.TaggedStruct<"ThreadClientError", {
365
+ readonly threadId: Schema.String;
403
366
  readonly message: Schema.String;
404
367
  readonly cause: Schema.optionalKey<Schema.Defect>;
405
368
  /** Cloudflare's own classification for a failure safe to retry with a fresh stub. */
@@ -408,11 +371,11 @@ declare const ConversationClientError_base: Schema.Class<ConversationClientError
408
371
  readonly overloaded: Schema.optionalKey<Schema.Boolean>;
409
372
  }>, import("effect/Cause").YieldableError>;
410
373
  /** The Worker-side stub call itself failed (RPC rejection, overload, eviction mid-call). */
411
- declare class ConversationClientError extends ConversationClientError_base {}
374
+ declare class ThreadClientError extends ThreadClientError_base {}
412
375
  declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
413
376
  readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
414
- readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/session/Principal">;
415
- readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/session/IdempotencyKey">;
377
+ readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
378
+ readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
416
379
  readonly definitions: typeof DefinitionDigests;
417
380
  readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
418
381
  }>, {}>;
@@ -420,17 +383,17 @@ declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
420
383
  * One durable submission, input ALREADY encoded by the caller through the Agent Binding's
421
384
  * input schema (the Worker bundles the same Agent definitions as the Object, so schema
422
385
  * validation happens client-side; the resolved Binding re-validates at claim time). The
423
- * Conversation identity is deliberately absent — the addressed Object IS the lane.
386
+ * Thread identity is deliberately absent — the addressed Object IS the lane.
424
387
  */
425
388
  declare class SubmitRequest extends SubmitRequest_base {}
426
389
  declare const ObservePageRequest_base: Schema.Class<ObservePageRequest, Schema.Struct<{
427
- readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/session/CanonicalSequence">>;
390
+ readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
428
391
  readonly limit: Schema.Int;
429
392
  }>, {}>;
430
393
  /** One bounded page of canonical records after an optional sequence. */
431
394
  declare class ObservePageRequest extends ObservePageRequest_base {}
432
395
  declare const AwaitProgressRequest_base: Schema.Class<AwaitProgressRequest, Schema.Struct<{
433
- readonly afterSequence: Schema.brand<Schema.Natural, "@effect-agent/session/CanonicalSequence">;
396
+ readonly afterSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
434
397
  readonly waiterId: Schema.String;
435
398
  }>, {}>;
436
399
  /** One event-driven wait for canonical progress strictly after this sequence. */
@@ -446,7 +409,7 @@ declare class CancelProgressRequest extends CancelProgressRequest_base {}
446
409
  * classes on the Worker side; `cause` chains travel as Schema defects without instance
447
410
  * fidelity (plan §2.8).
448
411
  */
449
- declare const HostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
412
+ declare const HostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
450
413
  type HostFailure = typeof HostFailure.Type;
451
414
  declare const SubmitSucceeded_base: Schema.Class<SubmitSucceeded, Schema.TaggedStruct<"SubmitSucceeded", {
452
415
  readonly receipt: typeof Receipt;
@@ -478,7 +441,7 @@ declare const UnknownResolutionRecorded_base: Schema.Class<UnknownResolutionReco
478
441
  }>, {}>;
479
442
  declare class UnknownResolutionRecorded extends UnknownResolutionRecorded_base {}
480
443
  declare const HostFailed_base: Schema.Class<HostFailed, Schema.TaggedStruct<"HostFailed", {
481
- readonly failure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
444
+ readonly failure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
482
445
  }>, {}>;
483
446
  /** The entry point failed TYPED on the Object; the failure re-decodes verbatim. */
484
447
  declare class HostFailed extends HostFailed_base {}
@@ -501,7 +464,7 @@ declare const decodeReceipt: (input: unknown, options?: import("effect/SchemaAST
501
464
  declare const encodeReceipt: (input: Receipt, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
502
465
  readonly receiptId: string;
503
466
  readonly submissionId: string;
504
- readonly conversationId: string;
467
+ readonly threadId: string;
505
468
  readonly queueSequence: number;
506
469
  }, Schema.SchemaError, never>;
507
470
  declare const decodeObservePageRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<ObservePageRequest, Schema.SchemaError, never>;
@@ -539,13 +502,13 @@ declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCommand,
539
502
  readonly author: string;
540
503
  readonly reason: string;
541
504
  readonly resolution: {
505
+ readonly _tag: "SafeToRetry";
506
+ } | {
542
507
  readonly _tag: "CompletedWithResult";
543
508
  readonly result: Schema.Json;
544
509
  readonly isFailure: boolean;
545
510
  } | {
546
511
  readonly _tag: "NeverHappened";
547
- } | {
548
- readonly _tag: "SafeToRetry";
549
512
  } | {
550
513
  readonly _tag: "AbortSubmission";
551
514
  };
@@ -555,7 +518,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
555
518
  readonly receipt: {
556
519
  readonly receiptId: string;
557
520
  readonly submissionId: string;
558
- readonly conversationId: string;
521
+ readonly threadId: string;
559
522
  readonly queueSequence: number;
560
523
  };
561
524
  } | {
@@ -609,18 +572,23 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
609
572
  } | {
610
573
  readonly _tag: "ObservedPage";
611
574
  readonly records: readonly {
612
- readonly conversationId: string;
575
+ readonly threadId: string;
613
576
  readonly batchId: string;
614
577
  readonly sequence: number;
615
578
  readonly offset: string;
616
579
  readonly record: {
617
580
  readonly recordId: string;
618
- readonly family: "conversation";
581
+ readonly family: "thread";
619
582
  readonly schemaVersion: 1;
620
583
  readonly createdAt: string;
621
584
  readonly deploymentId: string;
622
585
  readonly payload: {
623
- readonly _tag: "ConversationCreated";
586
+ readonly _tag: "AbortRequested";
587
+ readonly submissionId: string;
588
+ readonly author: string;
589
+ readonly reason: string;
590
+ } | {
591
+ readonly _tag: "ThreadCreated";
624
592
  readonly agentId: string;
625
593
  readonly definitions: {
626
594
  readonly agent: string;
@@ -629,18 +597,25 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
629
597
  };
630
598
  } | {
631
599
  readonly _tag: "UserInputRecorded";
632
- readonly submissionId: string;
600
+ readonly submissionId?: string | undefined;
633
601
  readonly kind: "follow-up" | "steering" | "user";
634
602
  readonly runId?: string | undefined;
635
603
  readonly input: Schema.Json;
636
604
  } | {
637
605
  readonly _tag: "RunStarted";
638
606
  readonly runId: string;
607
+ readonly policyAccountingVersion: 1;
639
608
  readonly maxDurationMillis: number;
609
+ } | {
610
+ readonly _tag: "RunPolicyUsageReserved";
611
+ readonly runId: string;
612
+ readonly programmaticToolCalls: number;
613
+ readonly finalizationUsed: boolean;
640
614
  } | {
641
615
  readonly _tag: "ModelCompleted";
642
616
  readonly runId: string;
643
617
  readonly output: Schema.Json;
618
+ readonly messages?: Schema.Json | undefined;
644
619
  } | {
645
620
  readonly _tag: "ModelResponseRecorded";
646
621
  readonly runId: string;
@@ -679,6 +654,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
679
654
  readonly toolName: string;
680
655
  readonly parameters: Schema.Json;
681
656
  readonly parametersDigest: string;
657
+ readonly executionKind?: "delegation" | "ordinary" | undefined;
682
658
  } | {
683
659
  readonly _tag: "ToolCallSettled";
684
660
  readonly runId: string;
@@ -686,6 +662,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
686
662
  readonly toolName: string;
687
663
  readonly result: Schema.Json;
688
664
  readonly isFailure: boolean;
665
+ readonly budgetRejected?: true | undefined;
689
666
  } | {
690
667
  readonly _tag: "ToolCallUnknown";
691
668
  readonly runId: string;
@@ -747,11 +724,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
747
724
  readonly runDisposition?: Schema.Json | undefined;
748
725
  readonly finishReason?: "budget-exhausted" | undefined;
749
726
  readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
750
- } | {
751
- readonly _tag: "AbortRequested";
752
- readonly submissionId: string;
753
- readonly author: string;
754
- readonly reason: string;
755
727
  } | {
756
728
  readonly _tag: "SubmissionSettled";
757
729
  readonly submissionId: string;
@@ -816,14 +788,15 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
816
788
  readonly grantDigest: string;
817
789
  readonly reservationId: string;
818
790
  readonly reservationDigest: string;
819
- readonly childConversationId: string;
791
+ readonly childThreadId: string;
820
792
  readonly childPrincipal: string;
821
793
  readonly childIdempotencyKey: string;
794
+ readonly toolCallAllowance?: number | undefined;
822
795
  } | {
823
796
  readonly _tag: "SubagentStarted";
824
797
  readonly runId: string;
825
798
  readonly toolCallId: string;
826
- readonly childConversationId: string;
799
+ readonly childThreadId: string;
827
800
  readonly childSubmissionId: string;
828
801
  readonly childReceiptId: string;
829
802
  readonly childRunId: string;
@@ -844,7 +817,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
844
817
  readonly parentLink: {
845
818
  readonly delegationId: string;
846
819
  readonly parentAgentId: string;
847
- readonly parentConversationId: string;
820
+ readonly parentThreadId: string;
848
821
  readonly parentRunId: string;
849
822
  readonly parentToolCallId: string;
850
823
  readonly depth: number;
@@ -857,6 +830,7 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
857
830
  };
858
831
  readonly childInputDigest: string;
859
832
  readonly grantDigest: string;
833
+ readonly toolCallAllowance?: number | undefined;
860
834
  } | {
861
835
  readonly _tag: "RepairAnnotated";
862
836
  readonly reason: string;
@@ -896,13 +870,13 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
896
870
  readonly author: string;
897
871
  readonly reason: string;
898
872
  readonly resolution: {
873
+ readonly _tag: "SafeToRetry";
874
+ } | {
899
875
  readonly _tag: "CompletedWithResult";
900
876
  readonly result: Schema.Json;
901
877
  readonly isFailure: boolean;
902
878
  } | {
903
879
  readonly _tag: "NeverHappened";
904
- } | {
905
- readonly _tag: "SafeToRetry";
906
880
  } | {
907
881
  readonly _tag: "AbortSubmission";
908
882
  };
@@ -912,23 +886,8 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
912
886
  } | {
913
887
  readonly _tag: "HostFailed";
914
888
  readonly failure: {
915
- readonly _tag: "DurableAlarmError";
916
- readonly operation: string;
917
- readonly message: string;
918
- readonly cause?: Schema.Json | undefined;
919
- } | {
920
- readonly _tag: "HostProtocolError";
921
- readonly message: string;
922
- } | {
923
- readonly _tag: "AgentInputError";
924
- readonly message: string;
925
- } | {
926
- readonly _tag: "DigestError";
927
- readonly message: string;
928
- readonly cause?: Schema.Json | undefined;
929
- } | {
930
889
  readonly _tag: "AdmissionConflict";
931
- readonly conversationId: string;
890
+ readonly threadId: string;
932
891
  readonly principal: string;
933
892
  readonly idempotencyKey: string;
934
893
  readonly existingInputDigest: string;
@@ -937,15 +896,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
937
896
  readonly _tag: "SettlementConflict";
938
897
  readonly submissionId: string;
939
898
  readonly existingOutcome: "aborted" | "completed" | "failed";
940
- } | {
941
- readonly _tag: "ApprovalConflict";
942
- readonly submissionId: string;
943
- readonly toolCallId: string;
944
- readonly existingDecision: "approved" | "denied";
945
- } | {
946
- readonly _tag: "UnknownResolutionConflict";
947
- readonly submissionId: string;
948
- readonly toolCallId: string;
949
899
  } | {
950
900
  readonly _tag: "JoinedToHost";
951
901
  readonly submissionId: string;
@@ -956,57 +906,81 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
956
906
  readonly message: string;
957
907
  readonly cause?: Schema.Json | undefined;
958
908
  } | {
959
- readonly _tag: "ConversationStoreError";
909
+ readonly _tag: "ThreadStoreError";
960
910
  readonly operation: string;
961
911
  readonly message: string;
962
912
  readonly cause?: Schema.Json | undefined;
963
913
  } | {
964
- readonly _tag: "ConversationNotMaterialized";
965
- readonly conversationId: string;
914
+ readonly _tag: "ThreadNotMaterialized";
915
+ readonly threadId: string;
966
916
  } | {
967
917
  readonly _tag: "AppendConflict";
968
- readonly conversationId: string;
918
+ readonly threadId: string;
969
919
  readonly batchId: string;
970
920
  readonly reason: "batch-digest" | "record-identity" | "tail";
971
921
  readonly actualTailSequence?: number | undefined;
972
922
  readonly actualTailDigest?: string | undefined;
973
923
  } | {
974
924
  readonly _tag: "FenceRejected";
975
- readonly conversationId: string;
925
+ readonly threadId: string;
976
926
  readonly actualEpoch: number;
977
927
  readonly attemptedEpoch: number;
928
+ } | {
929
+ readonly _tag: "OperationDenied";
930
+ readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
931
+ readonly reason: string;
932
+ readonly threadId?: string | undefined;
933
+ readonly submissionId?: string | undefined;
934
+ } | {
935
+ readonly _tag: "AgentInputError";
936
+ readonly message: string;
937
+ } | {
938
+ readonly _tag: "DigestError";
939
+ readonly message: string;
940
+ readonly cause?: Schema.Json | undefined;
978
941
  } | {
979
942
  readonly _tag: "DurableRuntimeFailpointError";
980
- 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" | "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" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append";
943
+ 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";
981
944
  } | {
982
945
  readonly _tag: "AdmissionLimitExceeded";
983
946
  readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
984
947
  readonly actual: number;
985
948
  readonly maximum: number;
986
949
  } | {
987
- readonly _tag: "OperationDenied";
988
- readonly operation: "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
989
- readonly reason: string;
990
- readonly conversationId?: string | undefined;
991
- readonly submissionId?: string | undefined;
950
+ readonly _tag: "DurableAlarmError";
951
+ readonly operation: string;
952
+ readonly message: string;
953
+ readonly cause?: Schema.Json | undefined;
954
+ } | {
955
+ readonly _tag: "HostProtocolError";
956
+ readonly message: string;
957
+ } | {
958
+ readonly _tag: "ApprovalConflict";
959
+ readonly submissionId: string;
960
+ readonly toolCallId: string;
961
+ readonly existingDecision: "approved" | "denied";
962
+ } | {
963
+ readonly _tag: "UnknownResolutionConflict";
964
+ readonly submissionId: string;
965
+ readonly toolCallId: string;
992
966
  };
993
967
  }, Schema.SchemaError, never>;
994
968
  declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
995
- /** Failure surface of `CloudflareConversationClient.submit`. */
996
- declare const ClientSubmitHostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof LedgerError, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof HostProtocolError]>;
997
- declare const ClientAwaitHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof HostProtocolError]>;
998
- declare const ClientObserveHostFailure: Schema.Union<readonly [typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof OperationDenied, typeof HostProtocolError]>;
999
- declare const ClientAbortHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof JoinedToHost, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
969
+ /** Failure surface of `CloudflareThreadClient.submit`. */
970
+ declare const ClientSubmitHostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof HostProtocolError]>;
971
+ declare const ClientAwaitHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof OperationDenied, typeof HostProtocolError]>;
972
+ declare const ClientObserveHostFailure: Schema.Union<readonly [typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof OperationDenied, typeof HostProtocolError]>;
973
+ declare const ClientAbortHostFailure: Schema.Union<readonly [typeof OperationDenied, typeof LedgerError, typeof SettlementConflict, typeof JoinedToHost, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
1000
974
  declare const ClientApprovalHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof ApprovalConflict, typeof OperationDenied, typeof DurableAlarmError, typeof HostProtocolError]>;
1001
975
  declare const ClientUnknownHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof DurableRuntimeFailpointError, typeof OperationDenied, typeof DurableAlarmError, typeof HostProtocolError]>;
1002
- type ClientSubmitFailure = typeof ClientSubmitHostFailure.Type | ConversationClientError;
1003
- type ClientAwaitFailure = typeof ClientAwaitHostFailure.Type | ConversationClientError;
1004
- type ClientObserveFailure = typeof ClientObserveHostFailure.Type | ConversationClientError;
976
+ type ClientSubmitFailure = typeof ClientSubmitHostFailure.Type | ThreadClientError;
977
+ type ClientAwaitFailure = typeof ClientAwaitHostFailure.Type | ThreadClientError;
978
+ type ClientObserveFailure = typeof ClientObserveHostFailure.Type | ThreadClientError;
1005
979
  type ClientProgressFailure = ClientObserveFailure;
1006
- type ClientAbortFailure = typeof ClientAbortHostFailure.Type | ConversationClientError;
1007
- type ClientApprovalFailure = typeof ClientApprovalHostFailure.Type | ConversationClientError;
1008
- type ClientUnknownFailure = typeof ClientUnknownHostFailure.Type | ConversationClientError;
1009
- declare const CloudflareConversationClient_base: Context.ServiceClass<CloudflareConversationClient, "@effect-agent/platform-cloudflare/CloudflareConversationClient", {
980
+ type ClientAbortFailure = typeof ClientAbortHostFailure.Type | ThreadClientError;
981
+ type ClientApprovalFailure = typeof ClientApprovalHostFailure.Type | ThreadClientError;
982
+ type ClientUnknownFailure = typeof ClientUnknownHostFailure.Type | ThreadClientError;
983
+ declare const CloudflareThreadClient_base: Context.ServiceClass<CloudflareThreadClient, "@effect-agent/platform-cloudflare/CloudflareThreadClient", {
1010
984
  /** Encode the input client-side, then durably submit to the owning Object. */
1011
985
  readonly submit: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: DurableSubmitOptions) => Effect.Effect<Receipt, ClientSubmitFailure, InputSchema["EncodingServices"]>;
1012
986
  /** Wake-hinted, poll-guaranteed settlement wait executed inside the owning Object. */
@@ -1015,9 +989,9 @@ declare const CloudflareConversationClient_base: Context.ServiceClass<Cloudflare
1015
989
  * Wait without polling until progress after `afterSequence` is already durable or hinted.
1016
990
  * The result is deliberately void: canonical records remain authoritative and must be read.
1017
991
  */
1018
- readonly awaitProgress: (conversationId: ConversationId, afterSequence: CanonicalSequence) => Effect.Effect<void, ClientProgressFailure>;
992
+ readonly awaitProgress: (threadId: ThreadId, afterSequence: CanonicalSequence) => Effect.Effect<void, ClientProgressFailure>;
1019
993
  /** One bounded page of canonical records. */
1020
- readonly readPage: (conversationId: ConversationId, options?: {
994
+ readonly readPage: (threadId: ThreadId, options?: {
1021
995
  readonly afterSequence?: CanonicalSequence | undefined;
1022
996
  readonly limit?: number | undefined;
1023
997
  }) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
@@ -1026,29 +1000,30 @@ declare const CloudflareConversationClient_base: Context.ServiceClass<Cloudflare
1026
1000
  * snapshot read, not a live observation — callers wanting liveness re-read after
1027
1001
  * `awaitSettlement`.
1028
1002
  */
1029
- readonly readAll: (conversationId: ConversationId) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
1003
+ readonly readAll: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
1030
1004
  /**
1031
- * Submission-addressed operations take the owning Conversation explicitly (from the
1005
+ * Submission-addressed operations take the owning Thread explicitly (from the
1032
1006
  * Receipt): minted Submission identities stay OPAQUE outside the storage adapter that
1033
1007
  * minted them (D-P6-5), so the client never parses one to find the lane.
1034
1008
  */
1035
- readonly abort: (conversationId: ConversationId, command: AbortCommand) => Effect.Effect<AbortIntent, ClientAbortFailure>;
1036
- readonly resolveApproval: (conversationId: ConversationId, command: ApprovalDecisionCommand) => Effect.Effect<ApprovalDecisionIntent, ClientApprovalFailure>;
1037
- readonly resolveUnknown: (conversationId: ConversationId, command: UnknownResolutionCommand) => Effect.Effect<UnknownResolutionIntent, ClientUnknownFailure>;
1009
+ readonly abort: (threadId: ThreadId, command: AbortCommand) => Effect.Effect<AbortIntent, ClientAbortFailure>;
1010
+ readonly resolveApproval: (threadId: ThreadId, command: ApprovalDecisionCommand) => Effect.Effect<ApprovalDecisionIntent, ClientApprovalFailure>;
1011
+ readonly resolveUnknown: (threadId: ThreadId, command: UnknownResolutionCommand) => Effect.Effect<UnknownResolutionIntent, ClientUnknownFailure>;
1038
1012
  }>;
1039
- /** Worker-side client over the Conversation Object namespace (DEPLOY-010). */
1040
- declare class CloudflareConversationClient extends CloudflareConversationClient_base {
1041
- static readonly layer: Layer.Layer<CloudflareConversationClient, never, ConversationObjectNamespace | Crypto.Crypto>;
1013
+ /** Worker-side client over the Thread Object namespace (DEPLOY-010). */
1014
+ declare class CloudflareThreadClient extends CloudflareThreadClient_base {
1015
+ static readonly layer: Layer.Layer<CloudflareThreadClient, never, ThreadObjectNamespace | Crypto.Crypto>;
1016
+ }
1017
+ declare namespace thread_object_d_exports {
1018
+ 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 };
1042
1019
  }
1043
- //#endregion
1044
- //#region src/conversation-object.d.ts
1045
1020
  /**
1046
- * `makeConversationObjectClass(options, observability?)` — the Conversation Durable Object
1021
+ * `ThreadObject.make(application, options)` — the Thread Durable Object
1047
1022
  * (plan §1.4,
1048
1023
  * D-P6-1): a factory returning a class that applications export from their Worker entry.
1049
- * One SQLite-backed Object per Conversation is the serialized owner (durability §6); the
1024
+ * One SQLite-backed Object per Thread is the serialized owner (durability §6); the
1050
1025
  * Object never runs `runResolvedWorker`'s infinite loop — each ingress event or alarm runs
1051
- * ONE bounded `runRecovery` + `processConversationResolved` pass, and the persisted alarm
1026
+ * ONE bounded `runRecovery` + `processThreadResolved` pass, and the persisted alarm
1052
1027
  * (the single multiplexed slot, D-P6-2) finishes accepted work across evictions WITHOUT any
1053
1028
  * incoming request.
1054
1029
  *
@@ -1059,19 +1034,21 @@ declare class CloudflareConversationClient extends CloudflareConversationClient_
1059
1034
  * awaiting each other's RPC would deadlock (plan §1.4). Instead every pass runs
1060
1035
  * `runRecovery` BEFORE any claim, so reconciliation still strictly precedes new work.
1061
1036
  */
1062
- /** Construction options for one deployed Conversation Object class. */
1063
- interface ConversationObjectOptions extends CloudflareDurableRuntimeOptions {
1037
+ /** Construction options for one deployed Thread Object class. */
1038
+ interface Options<ApplicationServices = never, EventServices = never, EventLayerError = never> extends CloudflareDurableRuntimeOptions {
1064
1039
  /** Accept transient native RPC tracing through effect-cf; disabled by default. */
1065
1040
  readonly rpcTracing?: boolean;
1066
1041
  /**
1067
1042
  * Name of the Worker `env` binding carrying THIS class's `DurableObjectNamespace` — the
1068
- * Object's route back to sibling Conversation Objects for the WP2 cross-Object port calls
1043
+ * Object's route back to sibling Thread Objects for the WP2 cross-Object port calls
1069
1044
  * and remote wakes (DEPLOY-010: the binding enters through a Layer, never ambiently).
1070
1045
  */
1071
1046
  readonly namespaceBinding: string;
1047
+ /** Acquired and finalized per native event, with access to the complete application runtime. */
1048
+ readonly eventLayer?: Layer.Layer<EventServices, EventLayerError, RuntimeServices | ApplicationServices | DurableObjectState$1.DurableObjectState | WorkerEnvironment>;
1072
1049
  }
1073
- type EndpointServices = CloudflareDurableRuntimeServices | DurableObjectContext;
1074
- type RuntimeServices = EndpointServices | ConversationObjectNamespace;
1050
+ type EndpointServices = CloudflareDurableRuntimeServices | CloudflareBootstrapServices | DurableObjectContext;
1051
+ type RuntimeServices = EndpointServices | ThreadObjectNamespace;
1075
1052
  declare const AdminExplainRequest_base: Schema.Class<AdminExplainRequest, Schema.Struct<{
1076
1053
  readonly submissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
1077
1054
  }>, {}>;
@@ -1081,7 +1058,7 @@ declare const AdminVerifyRequest_base: Schema.Class<AdminVerifyRequest, Schema.S
1081
1058
  /** Verify carries no parameters — the addressed Object IS the lane. */
1082
1059
  declare class AdminVerifyRequest extends AdminVerifyRequest_base {}
1083
1060
  /** Every typed failure of the four admin entry points, plus the protocol's own errors. */
1084
- declare const AdminFailure: Schema.Union<readonly [typeof OperationDenied, typeof RetryRefused, typeof LedgerError, typeof RunJournalError, typeof DigestError, typeof OwnershipLost, typeof SettlementConflict, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
1061
+ 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]>;
1085
1062
  type AdminFailure = typeof AdminFailure.Type;
1086
1063
  declare const ExplainedRecovery_base: Schema.Class<ExplainedRecovery, Schema.TaggedStruct<"ExplainedRecovery", {
1087
1064
  readonly explanations: Schema.$Array<typeof RecoveryExplanation>;
@@ -1100,7 +1077,7 @@ declare const ObligationsScanned_base: Schema.Class<ObligationsScanned, Schema.T
1100
1077
  }>, {}>;
1101
1078
  declare class ObligationsScanned extends ObligationsScanned_base {}
1102
1079
  declare const AdminFailed_base: Schema.Class<AdminFailed, Schema.TaggedStruct<"AdminFailed", {
1103
- readonly failure: Schema.Union<readonly [typeof OperationDenied, typeof RetryRefused, typeof LedgerError, typeof RunJournalError, typeof DigestError, typeof OwnershipLost, typeof SettlementConflict, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
1080
+ 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]>;
1104
1081
  }>, {}>;
1105
1082
  /** The admin entry point failed TYPED on the Object; the failure re-decodes verbatim. */
1106
1083
  declare class AdminFailed extends AdminFailed_base {}
@@ -1116,7 +1093,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1116
1093
  readonly explanations: readonly {
1117
1094
  readonly submission: {
1118
1095
  readonly submissionId: string;
1119
- readonly conversationId: string;
1096
+ readonly threadId: string;
1120
1097
  readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
1121
1098
  readonly queueSequence: number;
1122
1099
  readonly createdAt: string;
@@ -1129,7 +1106,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1129
1106
  } | undefined;
1130
1107
  };
1131
1108
  readonly evidence: {
1132
- readonly conversationMaterialized: boolean;
1109
+ readonly threadMaterialized: boolean;
1133
1110
  readonly inputRecorded: boolean;
1134
1111
  readonly abortRecorded: boolean;
1135
1112
  readonly recordedSettlementOutcome?: "aborted" | "completed" | "failed" | undefined;
@@ -1145,7 +1122,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1145
1122
  readonly requested: boolean;
1146
1123
  readonly started: boolean;
1147
1124
  readonly joined: boolean;
1148
- readonly childConversationId?: string | undefined;
1125
+ readonly childThreadId?: string | undefined;
1149
1126
  readonly childSubmissionId?: string | undefined;
1150
1127
  readonly admission?: "admitted" | "indeterminate" | "not-admitted" | undefined;
1151
1128
  }[];
@@ -1357,7 +1334,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1357
1334
  } | {
1358
1335
  readonly _tag: "VerifiedIntegrity";
1359
1336
  readonly report: {
1360
- readonly conversationId: string;
1337
+ readonly threadId: string;
1361
1338
  readonly tailSequence: number;
1362
1339
  readonly recordCount: number;
1363
1340
  readonly submissionCount: number;
@@ -1372,7 +1349,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1372
1349
  readonly _tag: "RetryExecuted";
1373
1350
  readonly report: {
1374
1351
  readonly submissionId: string;
1375
- readonly conversationId: string;
1352
+ readonly threadId: string;
1376
1353
  readonly decision: {
1377
1354
  readonly _tag: "CompleteMaterialization";
1378
1355
  readonly submissionId: string;
@@ -1510,7 +1487,7 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1510
1487
  };
1511
1488
  readonly entries: readonly {
1512
1489
  readonly submissionId: string;
1513
- readonly conversationId: string;
1490
+ readonly threadId: string;
1514
1491
  readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
1515
1492
  readonly blockedOn: "approval" | "ready-aged" | "running-aged" | "unknown" | "waitingForChild";
1516
1493
  readonly ageSeconds: number;
@@ -1522,9 +1499,9 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1522
1499
  readonly _tag: "AdminFailed";
1523
1500
  readonly failure: {
1524
1501
  readonly _tag: "OperationDenied";
1525
- readonly operation: "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
1502
+ readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
1526
1503
  readonly reason: string;
1527
- readonly conversationId?: string | undefined;
1504
+ readonly threadId?: string | undefined;
1528
1505
  readonly submissionId?: string | undefined;
1529
1506
  } | {
1530
1507
  readonly _tag: "RetryRefused";
@@ -1554,28 +1531,28 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1554
1531
  readonly submissionId: string;
1555
1532
  readonly existingOutcome: "aborted" | "completed" | "failed";
1556
1533
  } | {
1557
- readonly _tag: "ConversationStoreError";
1534
+ readonly _tag: "ThreadStoreError";
1558
1535
  readonly operation: string;
1559
1536
  readonly message: string;
1560
1537
  readonly cause?: Schema.Json | undefined;
1561
1538
  } | {
1562
- readonly _tag: "ConversationNotMaterialized";
1563
- readonly conversationId: string;
1539
+ readonly _tag: "ThreadNotMaterialized";
1540
+ readonly threadId: string;
1564
1541
  } | {
1565
1542
  readonly _tag: "AppendConflict";
1566
- readonly conversationId: string;
1543
+ readonly threadId: string;
1567
1544
  readonly batchId: string;
1568
1545
  readonly reason: "batch-digest" | "record-identity" | "tail";
1569
1546
  readonly actualTailSequence?: number | undefined;
1570
1547
  readonly actualTailDigest?: string | undefined;
1571
1548
  } | {
1572
1549
  readonly _tag: "FenceRejected";
1573
- readonly conversationId: string;
1550
+ readonly threadId: string;
1574
1551
  readonly actualEpoch: number;
1575
1552
  readonly attemptedEpoch: number;
1576
1553
  } | {
1577
1554
  readonly _tag: "DurableRuntimeFailpointError";
1578
- 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" | "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" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append";
1555
+ 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";
1579
1556
  } | {
1580
1557
  readonly _tag: "DurableAlarmError";
1581
1558
  readonly operation: string;
@@ -1587,8 +1564,8 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1587
1564
  };
1588
1565
  }, Schema.SchemaError, never>;
1589
1566
  declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
1590
- /** The public endpoints and effect-cf invocation hook of one Conversation Object instance. */
1591
- interface ConversationObjectInstance<EventServices = never> extends InstanceType<DurableObject.DurableObjectClass<Record<never, never>, RuntimeServices | EventServices>> {
1567
+ /** The public endpoints and effect-cf invocation hook of one Thread Object instance. */
1568
+ interface Instance<EventServices = never> extends InstanceType<DurableObject.DurableObjectClass<Record<never, never>, RuntimeServices | EventServices>> {
1592
1569
  submitEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
1593
1570
  awaitSettlementEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
1594
1571
  awaitProgressEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
@@ -1605,18 +1582,26 @@ interface ConversationObjectInstance<EventServices = never> extends InstanceType
1605
1582
  wake(): Promise<void>;
1606
1583
  alarm(alarmInfo?: AlarmInvocationInfo): Promise<void> | void;
1607
1584
  }
1608
- /** The constructor shape workerd instantiates for each Conversation Object. */
1609
- interface ConversationObjectClass<EventServices = never> {
1610
- new (ctx: DurableObjectState, env: Cloudflare.Env): ConversationObjectInstance<EventServices>;
1585
+ /** The constructor shape workerd instantiates for each Thread Object. */
1586
+ interface Class<EventServices = never> {
1587
+ new (ctx: DurableObjectState, env: Cloudflare.Env): Instance<EventServices>;
1611
1588
  }
1612
1589
  /**
1613
- * Build the application's Conversation Object class (export it from the Worker entry).
1614
- * effect-cf owns the cached ManagedRuntime, native RPC methods, event scopes, and post-handler
1615
- * OTLP flush scheduling for RPC and alarm events. The optional outer Layer is built per native
1616
- * event, so a host can install Tracer/Logger/Metric services and `OtlpExporter.Flusher` without
1617
- * Effect Agent owning exporter lifecycle machinery.
1590
+ * Export a composed application Layer as a native Durable Object class.
1591
+ * Bootstrap services are provided to the whole graph before it acquires, so application Layers
1592
+ * can yield effect-cf's WorkerEnvironment and DurableObjectState, derived identity, and Crypto.
1593
+ * Application dependencies remain visible until Layer.provide satisfies them. effect-cf owns the
1594
+ * cached ManagedRuntime, native RPC methods, event scopes, and telemetry flushing.
1595
+ * Initialization is local and bounded inside the constructor gate. Cloudflare eviction does not
1596
+ * guarantee finalizers; put resources requiring timely release in scoped operations or eventLayer.
1618
1597
  */
1619
- declare const makeConversationObjectClass: <EventLayerError = never, EventServices = never>(options: ConversationObjectOptions, observability?: Layer.Layer<EventServices, EventLayerError, DurableObjectContext | ConversationObjectNamespace | DurableObjectState$1.DurableObjectState | WorkerEnvironment>) => ConversationObjectClass<EventServices>;
1598
+ 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>;
1599
+ //#endregion
1600
+ //#region src/prepared-admission.d.ts
1601
+ /** Ordinary prepared admission through one freshly addressed Thread Object call. */
1602
+ declare const cloudflarePreparedInputAdmissionLayer: Layer.Layer<PreparedInputAdmission, never, CloudflareThreadClient>;
1603
+ /** Compatibility adapter retaining Scheduling's public admission port. */
1604
+ declare const cloudflareScheduledInputAdmissionLayer: Layer.Layer<ScheduledInputAdmission, never, PreparedInputAdmission>;
1620
1605
  //#endregion
1621
1606
  //#region src/code-mode-executor.d.ts
1622
1607
  /**
@@ -1642,5 +1627,5 @@ interface DynamicWorkerCodeExecutorOptions {
1642
1627
  /** Layer building the Dynamic Worker `CodeExecutor` from resolved bindings. */
1643
1628
  declare const dynamicWorkerCodeExecutorLayer: (options: DynamicWorkerCodeExecutorOptions) => Layer.Layer<CodeExecutor>;
1644
1629
  //#endregion
1645
- export { AbortRecorded, AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, AdmissionLimitExceeded, ApprovalRecorded, AwaitProgressRequest, BrowserQuickActionBrowserBinding, BrowserQuickActionCaptureOptions, BrowserQuickActionClient, BrowserQuickActionRpcError, BrowserQuickActionWorkersAi, BrowserQuickActionWorkersAiPolicy, BrowserQuickActionWorkersAiPolicyError, BrowserRestCaptureOptions, BrowserRestCrawlOptions, BrowserRunCleanupError, BrowserRunCloudflareCommand, BrowserRunHandoffRequest, BrowserRunHandoffResult, BrowserRunHandoffState, BrowserRunInteractiveBinding, BrowserRunInteractiveBrowser, BrowserRunInteractiveCdpSession, BrowserRunInteractiveContext, BrowserRunInteractiveHost, BrowserRunInteractivePage, BrowserRunInteractiveRequest, BrowserRunInteractiveRequestListener, BrowserRunInteractiveSession, BrowserRunLiveViewRequest, BrowserRunLiveViewResult, BrowserRunSessionLifecycle, 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 };
1630
+ export { AbortRecorded, AdmissionLimitExceeded, ApprovalRecorded, AwaitProgressRequest, CLOUDFLARE_DATABASE_CAP_BYTES, CLOUDFLARE_RUNTIME_DEFAULTS, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareAdmissionLimitsValue, CloudflareBindingError, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflarePlatformConfigError, CloudflareSchedulingClient, CloudflareSubscriptionConfigError, CloudflareSubscriptionsClient, CloudflareThreadClient, DEFAULT_MAX_DATABASE_BYTES, DurableAlarmError, DurableAlarmService, DurableObjectContext, DynamicWorkerCodeExecutorOptions, HostFailed, HostFailure, HostProtocolError, HostResponse, MaintenancePassFailure, MaintenancePassReport, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, ProgressWaitRegistry, ScheduleAlarmProtocolError, ScheduleOwnerIdentity, ScheduleOwnerNamespace, ScheduleOwnerObjectClass, ScheduleOwnerObjectInstance, ScheduleOwnerObjectRpc, ScheduleOwnerProtocolError, SettlementReached, SubmitRequest, SubmitSucceeded, SubscriptionAlarmProtocolError, SubscriptionPartitionIdentity, SubscriptionPartitionNamespace, SubscriptionPartitionObjectClass, SubscriptionPartitionObjectInstance, SubscriptionPartitionObjectRpc, SubscriptionPartitionProtocolError, ThreadClientError, ThreadMaintenance, ThreadMaintenanceFailpoint, ThreadMaintenanceFailpointHandler, ThreadMaintenanceFailpointLocation, thread_object_d_exports as ThreadObject, ThreadObjectIdentity, ThreadObjectNamespace, ThreadObjectPorts, ThreadObjectRpc, UnknownResolutionRecorded, boundHostDiagnostic, cloudflarePreparedInputAdmissionLayer, cloudflareScheduledInputAdmissionLayer, cloudflareWakeSchedulerLayer, decodeAbortCommand, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObservePageRequest, decodeReceipt, decodeSubmitRequest, decodeUnknownResolutionCommand, disposeRpcHandle, dynamicWorkerCodeExecutorLayer, dynamicWorkerImplementation, encodeAbortCommand, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, makeScheduleOwnerObjectClass, makeSubscriptionPartitionObjectClass, sourcePartitionName, threadNamespaceFromEnv, threadNamespaceLayer, threadPortTransportLayer, validateCloudflareSubscriptionLimits };
1646
1631
  //# sourceMappingURL=index.d.mts.map