@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/bindings-C00ZfjsX.d.mts +100 -0
- package/dist/index.d.mts +196 -211
- package/dist/index.mjs +157 -163
- package/dist/index.mjs.map +1 -1
- package/dist/interactive-browser.d.mts +144 -2
- package/dist/interactive-browser.mjs +1153 -1
- package/dist/interactive-browser.mjs.map +1 -0
- package/dist/{scheduling-B-OFqoS9.mjs → prepared-admission-D5hQ-ofV.mjs} +121 -432
- package/dist/prepared-admission-D5hQ-ofV.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/scheduling.d.mts +47 -2
- package/dist/scheduling.mjs +339 -1
- package/dist/scheduling.mjs.map +1 -0
- package/dist/subscriptions.d.mts +52 -0
- package/dist/subscriptions.mjs +346 -0
- package/dist/subscriptions.mjs.map +1 -0
- package/package.json +18 -11
- package/src/alarm.ts +264 -265
- package/src/bindings.ts +30 -30
- package/src/client.ts +90 -98
- package/src/config.ts +7 -7
- package/src/index.ts +9 -11
- package/src/layers.ts +178 -257
- package/src/prepared-admission.ts +90 -0
- package/src/scheduling.ts +19 -55
- package/src/subscriptions.ts +661 -0
- package/src/{conversation-object.ts → thread-object.ts} +167 -136
- package/src/transport.ts +15 -15
- package/src/wake-scheduler.ts +17 -22
- package/dist/interactive-browser-BRo-Bfvb.d.mts +0 -144
- package/dist/interactive-browser-Cy5q-ldl.mjs +0 -1154
- package/dist/interactive-browser-Cy5q-ldl.mjs.map +0 -1
- package/dist/scheduling-B-OFqoS9.mjs.map +0 -1
- package/dist/scheduling-BJs_kHTx.d.mts +0 -142
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as ScheduleOwnerObjectClass, c as ScheduleOwnerProtocolError, d as ConversationObjectIdentity, f as ConversationObjectNamespace, g as conversationNamespaceLayer, h as conversationNamespaceFromEnv, i as ScheduleOwnerNamespace, l as makeScheduleOwnerObjectClass, m as DurableObjectContext, n as ScheduleAlarmProtocolError, o as ScheduleOwnerObjectInstance, p as ConversationObjectRpc, r as ScheduleOwnerIdentity, s as ScheduleOwnerObjectRpc, t as CloudflareSchedulingClient, u as CloudflareBindingError } from "./scheduling-BJs_kHTx.mjs";
|
|
5
|
-
import { 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 {
|
|
8
|
-
import {
|
|
9
|
-
import { AgentInputError,
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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/
|
|
55
|
-
/** Head of the minted producer identity `{producerPrefix}:{
|
|
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
|
-
*
|
|
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 `
|
|
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
|
|
177
|
-
type
|
|
178
|
-
declare const
|
|
179
|
-
readonly hit:
|
|
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
|
|
183
|
-
static readonly layer: Layer.Layer<
|
|
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
|
|
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
|
|
215
|
-
static readonly layer: Layer.Layer<
|
|
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 |
|
|
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
|
-
* `
|
|
252
|
-
* `portCall(envelope)` on the stub of the Object that owns the addressed
|
|
253
|
-
* (`namespace.idFromName(
|
|
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
|
|
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 `
|
|
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}:{
|
|
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
|
-
/**
|
|
315
|
-
readonly maintenanceFailpoint?: ((ctx: DurableObjectState) =>
|
|
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
|
-
/**
|
|
348
|
-
|
|
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 `
|
|
358
|
-
type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger |
|
|
359
|
-
declare const
|
|
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
|
|
338
|
+
declare class ThreadObjectPorts extends ThreadObjectPorts_base {}
|
|
369
339
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
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
|
|
387
|
-
|
|
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
|
|
402
|
-
readonly
|
|
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
|
|
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/
|
|
415
|
-
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/
|
|
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
|
-
*
|
|
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/
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
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: "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
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: "
|
|
965
|
-
readonly
|
|
914
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
915
|
+
readonly threadId: string;
|
|
966
916
|
} | {
|
|
967
917
|
readonly _tag: "AppendConflict";
|
|
968
|
-
readonly
|
|
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
|
|
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: "
|
|
988
|
-
readonly operation:
|
|
989
|
-
readonly
|
|
990
|
-
readonly
|
|
991
|
-
|
|
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 `
|
|
996
|
-
declare const ClientSubmitHostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof LedgerError, typeof
|
|
997
|
-
declare const ClientAwaitHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof HostProtocolError]>;
|
|
998
|
-
declare const ClientObserveHostFailure: Schema.Union<readonly [typeof
|
|
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 |
|
|
1003
|
-
type ClientAwaitFailure = typeof ClientAwaitHostFailure.Type |
|
|
1004
|
-
type ClientObserveFailure = typeof ClientObserveHostFailure.Type |
|
|
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 |
|
|
1007
|
-
type ClientApprovalFailure = typeof ClientApprovalHostFailure.Type |
|
|
1008
|
-
type ClientUnknownFailure = typeof ClientUnknownHostFailure.Type |
|
|
1009
|
-
declare const
|
|
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: (
|
|
992
|
+
readonly awaitProgress: (threadId: ThreadId, afterSequence: CanonicalSequence) => Effect.Effect<void, ClientProgressFailure>;
|
|
1019
993
|
/** One bounded page of canonical records. */
|
|
1020
|
-
readonly readPage: (
|
|
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: (
|
|
1003
|
+
readonly readAll: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
|
|
1030
1004
|
/**
|
|
1031
|
-
* Submission-addressed operations take the owning
|
|
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: (
|
|
1036
|
-
readonly resolveApproval: (
|
|
1037
|
-
readonly resolveUnknown: (
|
|
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
|
|
1040
|
-
declare class
|
|
1041
|
-
static readonly layer: Layer.Layer<
|
|
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
|
-
* `
|
|
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
|
|
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` + `
|
|
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
|
|
1063
|
-
interface
|
|
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
|
|
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 |
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
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: "
|
|
1563
|
-
readonly
|
|
1539
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
1540
|
+
readonly threadId: string;
|
|
1564
1541
|
} | {
|
|
1565
1542
|
readonly _tag: "AppendConflict";
|
|
1566
|
-
readonly
|
|
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
|
|
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
|
|
1591
|
-
interface
|
|
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
|
|
1609
|
-
interface
|
|
1610
|
-
new (ctx: DurableObjectState, env: Cloudflare.Env):
|
|
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
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1616
|
-
*
|
|
1617
|
-
*
|
|
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
|
|
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,
|
|
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
|