@effect-agent/platform-cloudflare 0.1.0-beta.15 → 0.1.0-beta.16

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,5 +1,5 @@
1
- import { Context, Effect, Layer, Option, Schema } from "effect";
2
- 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, OperationDenied, OwnershipLost, ProducerId, Receipt, RecoveryExplanation, RecoveryReport, ResolvedBinding, RetryCommand, RetryRefused, RunJournalError, Settlement, SettlementConflict, SubmissionLedger, ToolReconciler, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WakeScheduler } from "@effect-agent/session";
1
+ import { Context, Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
2
+ 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";
3
3
  import { ConversationPortTransport, DoStorageFailpointHandler, DoStorageInitializationError } from "@effect-agent/storage-cloudflare";
4
4
  import { AgentInputError, ConversationId } from "@effect-agent/core";
5
5
  import { DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
@@ -31,6 +31,10 @@ interface ConversationObjectRpc extends Rpc.DurableObjectBranded {
31
31
  submitEncoded(encoded: unknown): Promise<unknown>;
32
32
  /** Wake-hinted, poll-guaranteed settlement wait; answers an `AwaitSettlementResponse`. */
33
33
  awaitSettlementEncoded(encoded: unknown): Promise<unknown>;
34
+ /** Event-driven durable progress wait; answers a `ProgressObserved` host response. */
35
+ awaitProgressEncoded(encoded: unknown): Promise<unknown>;
36
+ /** Best-effort cancellation for one in-flight progress wait. */
37
+ cancelProgressEncoded(encoded: unknown): Promise<unknown>;
34
38
  /** One bounded page of canonical records; answers an `ObservePageResponse`. */
35
39
  observePage(encoded: unknown): Promise<unknown>;
36
40
  /** Durable abort intent; answers an `AbortResponse`. */
@@ -307,6 +311,22 @@ declare class ConversationMaintenance extends ConversationMaintenance_base {
307
311
  */
308
312
  declare const cloudflareWakeSchedulerLayer: Layer.Layer<WakeScheduler, never, DurableAlarmService | ConversationObjectIdentity | ConversationObjectNamespace>;
309
313
  //#endregion
314
+ //#region src/progress-wait.d.ts
315
+ declare const ProgressWaitRegistry_base: Context.ServiceClass<ProgressWaitRegistry, "@effect-agent/platform-cloudflare/ProgressWaitRegistry", {
316
+ /** Register a Scope-owned cancellation signal, observing any early cancel tombstone. */
317
+ readonly subscribe: (waiterId: string) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
318
+ /** Cancel a registered waiter, or remember a bounded early cancellation. */
319
+ readonly cancel: (waiterId: string) => Effect.Effect<void>;
320
+ }>;
321
+ /**
322
+ * Per-incarnation cancellation registry for long-lived progress RPCs. The public runtime owns
323
+ * the actual wake registration; this host-only registry lets an interrupted Worker Effect ask
324
+ * the Object to interrupt its scoped wait before the Worker execution context itself ends.
325
+ */
326
+ declare class ProgressWaitRegistry extends ProgressWaitRegistry_base {
327
+ static readonly layer: Layer.Layer<ProgressWaitRegistry>;
328
+ }
329
+ //#endregion
310
330
  //#region src/transport.d.ts
311
331
  /**
312
332
  * `ConversationPortTransport` over native Durable Object JS RPC (decision D-P6-3): one
@@ -370,6 +390,8 @@ interface CloudflareDurableRuntimeOptions {
370
390
  readonly runtimeFailpoint?: ((ctx: DurableObjectState) => DurableRuntimeFailpointHandler) | undefined;
371
391
  /** Conversation-maintenance generation/alarm fault injection; default none. */
372
392
  readonly maintenanceFailpoint?: ((ctx: DurableObjectState) => ConversationMaintenanceFailpointHandler) | undefined;
393
+ /** Host-supplied fail-closed authorization policy; defaults to service possession. */
394
+ readonly operationAuthorizer?: OperationAuthorizerService | undefined;
373
395
  /**
374
396
  * Reconciliation policy consulted for open ordinary Tool Calls before an Unknown Outcome
375
397
  * is recorded (durability §10, DUR-009). Defaults to the fail-closed
@@ -400,7 +422,7 @@ type CloudflareBindingSource = ReadonlyArray<ResolvedBinding> | Effect.Effect<Re
400
422
  /** Every construction failure of the assembled Cloudflare durable runtime stack. */
401
423
  type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError | DoStorageInitializationError;
402
424
  /** The services `CloudflareDurableRuntime.layer` provides. */
403
- type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ConversationStore | WakeScheduler | DurableRuntimeConfig | AgentBindingResolver | CloudflareDurableRuntimeConfig | ConversationObjectIdentity | DurableAlarmService | ConversationMaintenance | ConversationObjectPorts;
425
+ type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ConversationStore | WakeScheduler | DurableRuntimeConfig | AgentBindingResolver | CloudflareDurableRuntimeConfig | ConversationObjectIdentity | DurableAlarmService | ConversationMaintenance | ConversationObjectPorts | ProgressWaitRegistry;
404
426
  declare const ConversationObjectPorts_base: Context.ServiceClass<ConversationObjectPorts, "@effect-agent/platform-cloudflare/ConversationObjectPorts", {
405
427
  readonly handle: (encoded: unknown) => Effect.Effect<unknown>;
406
428
  }>;
@@ -447,6 +469,10 @@ declare const ConversationClientError_base: Schema.Class<ConversationClientError
447
469
  readonly conversationId: Schema.String;
448
470
  readonly message: Schema.String;
449
471
  readonly cause: Schema.optionalKey<Schema.Defect>;
472
+ /** Cloudflare's own classification for a failure safe to retry with a fresh stub. */
473
+ readonly retryable: Schema.optionalKey<Schema.Boolean>;
474
+ /** Cloudflare overloads are surfaced immediately instead of adding retry pressure. */
475
+ readonly overloaded: Schema.optionalKey<Schema.Boolean>;
450
476
  }>, import("effect/Cause").YieldableError>;
451
477
  /** The Worker-side stub call itself failed (RPC rejection, overload, eviction mid-call). */
452
478
  declare class ConversationClientError extends ConversationClientError_base {}
@@ -470,13 +496,24 @@ declare const ObservePageRequest_base: Schema.Class<ObservePageRequest, Schema.S
470
496
  }>, {}>;
471
497
  /** One bounded page of canonical records after an optional sequence. */
472
498
  declare class ObservePageRequest extends ObservePageRequest_base {}
499
+ declare const AwaitProgressRequest_base: Schema.Class<AwaitProgressRequest, Schema.Struct<{
500
+ readonly afterSequence: Schema.brand<Schema.Natural, "@effect-agent/session/CanonicalSequence">;
501
+ readonly waiterId: Schema.String;
502
+ }>, {}>;
503
+ /** One event-driven wait for canonical progress strictly after this sequence. */
504
+ declare class AwaitProgressRequest extends AwaitProgressRequest_base {}
505
+ declare const CancelProgressRequest_base: Schema.Class<CancelProgressRequest, Schema.Struct<{
506
+ readonly waiterId: Schema.String;
507
+ }>, {}>;
508
+ /** Best-effort cancellation of one in-flight progress RPC. */
509
+ declare class CancelProgressRequest extends CancelProgressRequest_base {}
473
510
  /**
474
511
  * Every typed failure a host entry point can produce, plus the protocol's own errors. Same
475
512
  * closed-union discipline as the WP2 `PortFailure`: members re-decode to the SAME tagged
476
513
  * classes on the Worker side; `cause` chains travel as Schema defects without instance
477
514
  * fidelity (plan §2.8).
478
515
  */
479
- 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 HostProtocolError]>;
516
+ 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]>;
480
517
  type HostFailure = typeof HostFailure.Type;
481
518
  declare const SubmitSucceeded_base: Schema.Class<SubmitSucceeded, Schema.TaggedStruct<"SubmitSucceeded", {
482
519
  readonly receipt: typeof Receipt;
@@ -490,6 +527,11 @@ declare const ObservedPage_base: Schema.Class<ObservedPage, Schema.TaggedStruct<
490
527
  readonly records: Schema.$Array<typeof CanonicalRecordEnvelope>;
491
528
  }>, {}>;
492
529
  declare class ObservedPage extends ObservedPage_base {}
530
+ declare const ProgressObserved_base: Schema.Class<ProgressObserved, Schema.TaggedStruct<"ProgressObserved", {}>, {}>;
531
+ /** A record was already committed or an incarnation-local hint says the caller should re-read. */
532
+ declare class ProgressObserved extends ProgressObserved_base {}
533
+ declare const ProgressCancelled_base: Schema.Class<ProgressCancelled, Schema.TaggedStruct<"ProgressCancelled", {}>, {}>;
534
+ declare class ProgressCancelled extends ProgressCancelled_base {}
493
535
  declare const AbortRecorded_base: Schema.Class<AbortRecorded, Schema.TaggedStruct<"AbortRecorded", {
494
536
  readonly intent: typeof AbortIntent;
495
537
  }>, {}>;
@@ -503,12 +545,12 @@ declare const UnknownResolutionRecorded_base: Schema.Class<UnknownResolutionReco
503
545
  }>, {}>;
504
546
  declare class UnknownResolutionRecorded extends UnknownResolutionRecorded_base {}
505
547
  declare const HostFailed_base: Schema.Class<HostFailed, Schema.TaggedStruct<"HostFailed", {
506
- 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 HostProtocolError]>;
548
+ 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]>;
507
549
  }>, {}>;
508
550
  /** The entry point failed TYPED on the Object; the failure re-decodes verbatim. */
509
551
  declare class HostFailed extends HostFailed_base {}
510
552
  /** The uniform answer of one host entry point. Callers narrow by the tag their call implies. */
511
- declare const HostResponse: Schema.Union<readonly [typeof SubmitSucceeded, typeof SettlementReached, typeof ObservedPage, typeof AbortRecorded, typeof ApprovalRecorded, typeof UnknownResolutionRecorded, typeof HostFailed]>;
553
+ declare const HostResponse: Schema.Union<readonly [typeof SubmitSucceeded, typeof SettlementReached, typeof ObservedPage, typeof ProgressObserved, typeof ProgressCancelled, typeof AbortRecorded, typeof ApprovalRecorded, typeof UnknownResolutionRecorded, typeof HostFailed]>;
512
554
  type HostResponse = typeof HostResponse.Type;
513
555
  declare const decodeSubmitRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<SubmitRequest, Schema.SchemaError, never>;
514
556
  declare const encodeSubmitRequest: (input: SubmitRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
@@ -534,6 +576,15 @@ declare const encodeObservePageRequest: (input: ObservePageRequest, options?: im
534
576
  readonly afterSequence?: number | undefined;
535
577
  readonly limit: number;
536
578
  }, Schema.SchemaError, never>;
579
+ declare const decodeAwaitProgressRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AwaitProgressRequest, Schema.SchemaError, never>;
580
+ declare const encodeAwaitProgressRequest: (input: AwaitProgressRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
581
+ readonly afterSequence: number;
582
+ readonly waiterId: string;
583
+ }, Schema.SchemaError, never>;
584
+ declare const decodeCancelProgressRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<CancelProgressRequest, Schema.SchemaError, never>;
585
+ declare const encodeCancelProgressRequest: (input: CancelProgressRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
586
+ readonly waiterId: string;
587
+ }, Schema.SchemaError, never>;
537
588
  declare const decodeAbortCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortCommand, Schema.SchemaError, never>;
538
589
  declare const encodeAbortCommand: (input: AbortCommand, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
539
590
  readonly submissionId: string;
@@ -566,7 +617,7 @@ declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCommand,
566
617
  readonly _tag: "AbortSubmission";
567
618
  };
568
619
  }, Schema.SchemaError, never>;
569
- declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | SettlementReached | SubmitSucceeded | UnknownResolutionRecorded, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
620
+ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmitSucceeded | UnknownResolutionRecorded, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
570
621
  readonly _tag: "SubmitSucceeded";
571
622
  readonly receipt: {
572
623
  readonly receiptId: string;
@@ -597,42 +648,6 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
597
648
  readonly createdAt: string;
598
649
  readonly deploymentId: string;
599
650
  readonly payload: {
600
- readonly _tag: "ToolCallPrepared";
601
- readonly runId: string;
602
- readonly turnId: string;
603
- readonly turn: number;
604
- readonly toolCallId: string;
605
- readonly toolName: string;
606
- readonly parameters: Schema.Json;
607
- readonly parametersDigest: string;
608
- } | {
609
- readonly _tag: "ToolCallUnknown";
610
- readonly runId: string;
611
- readonly turn: number;
612
- readonly toolCallId: string;
613
- readonly toolName: string;
614
- readonly reason: string;
615
- } | {
616
- readonly _tag: "ToolApprovalDecided";
617
- readonly runId: string;
618
- readonly turn: number;
619
- readonly toolCallId: string;
620
- readonly decision: "approved" | "denied";
621
- readonly resolver: string;
622
- readonly reason: string;
623
- } | {
624
- readonly _tag: "ToolCallResolved";
625
- readonly runId: string;
626
- readonly toolCallId: string;
627
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
628
- readonly author: string;
629
- readonly reason: string;
630
- } | {
631
- readonly _tag: "AbortRequested";
632
- readonly submissionId: string;
633
- readonly author: string;
634
- readonly reason: string;
635
- } | {
636
651
  readonly _tag: "ConversationCreated";
637
652
  readonly agentId: string;
638
653
  readonly definitions: {
@@ -660,6 +675,15 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
660
675
  readonly inputTokens?: number | undefined;
661
676
  readonly outputTokens?: number | undefined;
662
677
  readonly costMicrousd?: number | undefined;
678
+ } | {
679
+ readonly _tag: "ToolCallPrepared";
680
+ readonly runId: string;
681
+ readonly turnId: string;
682
+ readonly turn: number;
683
+ readonly toolCallId: string;
684
+ readonly toolName: string;
685
+ readonly parameters: Schema.Json;
686
+ readonly parametersDigest: string;
663
687
  } | {
664
688
  readonly _tag: "ToolCallSettled";
665
689
  readonly runId: string;
@@ -667,6 +691,20 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
667
691
  readonly toolName: string;
668
692
  readonly result: Schema.Json;
669
693
  readonly isFailure: boolean;
694
+ } | {
695
+ readonly _tag: "ToolCallUnknown";
696
+ readonly runId: string;
697
+ readonly turn: number;
698
+ readonly toolCallId: string;
699
+ readonly toolName: string;
700
+ readonly reason: string;
701
+ } | {
702
+ readonly _tag: "ToolCallResolved";
703
+ readonly runId: string;
704
+ readonly toolCallId: string;
705
+ readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
706
+ readonly author: string;
707
+ readonly reason: string;
670
708
  } | {
671
709
  readonly _tag: "ToolStepSettled";
672
710
  readonly runId: string;
@@ -682,6 +720,14 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
682
720
  readonly toolCallId: string;
683
721
  readonly toolName: string;
684
722
  readonly parametersDigest: string;
723
+ } | {
724
+ readonly _tag: "ToolApprovalDecided";
725
+ readonly runId: string;
726
+ readonly turn: number;
727
+ readonly toolCallId: string;
728
+ readonly decision: "approved" | "denied";
729
+ readonly resolver: string;
730
+ readonly reason: string;
685
731
  } | {
686
732
  readonly _tag: "ModelResponseInterrupted";
687
733
  readonly runId: string;
@@ -703,6 +749,11 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
703
749
  readonly _tag: "RunCompleted";
704
750
  readonly runId: string;
705
751
  readonly output: Schema.Json;
752
+ } | {
753
+ readonly _tag: "AbortRequested";
754
+ readonly submissionId: string;
755
+ readonly author: string;
756
+ readonly reason: string;
706
757
  } | {
707
758
  readonly _tag: "SubmissionSettled";
708
759
  readonly submissionId: string;
@@ -780,6 +831,10 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
780
831
  };
781
832
  };
782
833
  }[];
834
+ } | {
835
+ readonly _tag: "ProgressObserved";
836
+ } | {
837
+ readonly _tag: "ProgressCancelled";
783
838
  } | {
784
839
  readonly _tag: "AbortRecorded";
785
840
  readonly intent: {
@@ -826,6 +881,12 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
826
881
  readonly failure: {
827
882
  readonly _tag: "HostProtocolError";
828
883
  readonly message: string;
884
+ } | {
885
+ readonly _tag: "OperationDenied";
886
+ readonly operation: "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
887
+ readonly reason: string;
888
+ readonly conversationId?: string | undefined;
889
+ readonly submissionId?: string | undefined;
829
890
  } | {
830
891
  readonly _tag: "AgentInputError";
831
892
  readonly message: string;
@@ -897,19 +958,25 @@ declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | Hos
897
958
  readonly cause?: Schema.Json | undefined;
898
959
  };
899
960
  }, Schema.SchemaError, never>;
900
- declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | SettlementReached | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
961
+ declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
901
962
  /** Failure surface of `CloudflareConversationClient.submit`. */
902
963
  type ClientSubmitFailure = AgentInputError | DigestError | AdmissionConflict | LedgerError | ConversationStoreError | ConversationNotMaterialized | AppendConflict | FenceRejected | DurableRuntimeFailpointError | AdmissionLimitExceeded | DurableAlarmError | HostProtocolError | ConversationClientError;
903
964
  type ClientAwaitFailure = LedgerError | SettlementConflict | HostProtocolError | ConversationClientError;
904
- type ClientObserveFailure = ConversationStoreError | ConversationNotMaterialized | HostProtocolError | ConversationClientError;
965
+ type ClientObserveFailure = ConversationStoreError | ConversationNotMaterialized | OperationDenied | HostProtocolError | ConversationClientError;
966
+ type ClientProgressFailure = ConversationStoreError | ConversationNotMaterialized | OperationDenied | HostProtocolError | ConversationClientError;
905
967
  type ClientAbortFailure = LedgerError | SettlementConflict | JoinedToHost | DurableRuntimeFailpointError | DurableAlarmError | HostProtocolError | ConversationClientError;
906
- type ClientApprovalFailure = LedgerError | SettlementConflict | ApprovalConflict | DurableAlarmError | HostProtocolError | ConversationClientError;
907
- type ClientUnknownFailure = LedgerError | SettlementConflict | UnknownResolutionConflict | JoinedToHost | DurableRuntimeFailpointError | DurableAlarmError | HostProtocolError | ConversationClientError;
968
+ type ClientApprovalFailure = LedgerError | SettlementConflict | ApprovalConflict | OperationDenied | DurableAlarmError | HostProtocolError | ConversationClientError;
969
+ type ClientUnknownFailure = LedgerError | SettlementConflict | UnknownResolutionConflict | JoinedToHost | DurableRuntimeFailpointError | OperationDenied | DurableAlarmError | HostProtocolError | ConversationClientError;
908
970
  declare const CloudflareConversationClient_base: Context.ServiceClass<CloudflareConversationClient, "@effect-agent/platform-cloudflare/CloudflareConversationClient", {
909
971
  /** Encode the input client-side, then durably submit to the owning Object. */
910
972
  readonly submit: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: DurableSubmitOptions) => Effect.Effect<Receipt, ClientSubmitFailure, InputSchema["EncodingServices"]>;
911
973
  /** Wake-hinted, poll-guaranteed settlement wait executed inside the owning Object. */
912
974
  readonly awaitSettlement: (receipt: Receipt) => Effect.Effect<Settlement, ClientAwaitFailure>;
975
+ /**
976
+ * Wait without polling until progress after `afterSequence` is already durable or hinted.
977
+ * The result is deliberately void: canonical records remain authoritative and must be read.
978
+ */
979
+ readonly awaitProgress: (conversationId: ConversationId, afterSequence: CanonicalSequence) => Effect.Effect<void, ClientProgressFailure>;
913
980
  /** One bounded page of canonical records. */
914
981
  readonly readPage: (conversationId: ConversationId, options?: {
915
982
  readonly afterSequence?: CanonicalSequence | undefined;
@@ -932,7 +999,7 @@ declare const CloudflareConversationClient_base: Context.ServiceClass<Cloudflare
932
999
  }>;
933
1000
  /** Worker-side client over the Conversation Object namespace (DEPLOY-010). */
934
1001
  declare class CloudflareConversationClient extends CloudflareConversationClient_base {
935
- static readonly layer: Layer.Layer<CloudflareConversationClient, never, ConversationObjectNamespace>;
1002
+ static readonly layer: Layer.Layer<CloudflareConversationClient, never, ConversationObjectNamespace | Crypto.Crypto>;
936
1003
  }
937
1004
  //#endregion
938
1005
  //#region src/conversation-object.d.ts
@@ -1411,21 +1478,38 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1411
1478
  } | {
1412
1479
  readonly _tag: "AdminFailed";
1413
1480
  readonly failure: {
1414
- readonly _tag: "HostProtocolError";
1481
+ readonly _tag: "OperationDenied";
1482
+ readonly operation: "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
1483
+ readonly reason: string;
1484
+ readonly conversationId?: string | undefined;
1485
+ readonly submissionId?: string | undefined;
1486
+ } | {
1487
+ readonly _tag: "RetryRefused";
1488
+ readonly submissionId: string;
1489
+ readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
1490
+ readonly decisionTag: string;
1415
1491
  readonly message: string;
1492
+ } | {
1493
+ readonly _tag: "LedgerError";
1494
+ readonly operation: string;
1495
+ readonly message: string;
1496
+ readonly cause?: Schema.Json | undefined;
1497
+ } | {
1498
+ readonly _tag: "RunJournalError";
1499
+ readonly message: string;
1500
+ readonly cause?: Schema.Json | undefined;
1416
1501
  } | {
1417
1502
  readonly _tag: "DigestError";
1418
1503
  readonly message: string;
1419
1504
  readonly cause?: Schema.Json | undefined;
1505
+ } | {
1506
+ readonly _tag: "OwnershipLost";
1507
+ readonly submissionId: string;
1508
+ readonly actualEpoch: number;
1420
1509
  } | {
1421
1510
  readonly _tag: "SettlementConflict";
1422
1511
  readonly submissionId: string;
1423
1512
  readonly existingOutcome: "aborted" | "completed" | "failed";
1424
- } | {
1425
- readonly _tag: "LedgerError";
1426
- readonly operation: string;
1427
- readonly message: string;
1428
- readonly cause?: Schema.Json | undefined;
1429
1513
  } | {
1430
1514
  readonly _tag: "ConversationStoreError";
1431
1515
  readonly operation: string;
@@ -1455,25 +1539,8 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
1455
1539
  readonly message: string;
1456
1540
  readonly cause?: Schema.Json | undefined;
1457
1541
  } | {
1458
- readonly _tag: "OperationDenied";
1459
- readonly operation: "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
1460
- readonly reason: string;
1461
- readonly conversationId?: string | undefined;
1462
- readonly submissionId?: string | undefined;
1463
- } | {
1464
- readonly _tag: "RetryRefused";
1465
- readonly submissionId: string;
1466
- readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
1467
- readonly decisionTag: string;
1468
- readonly message: string;
1469
- } | {
1470
- readonly _tag: "RunJournalError";
1542
+ readonly _tag: "HostProtocolError";
1471
1543
  readonly message: string;
1472
- readonly cause?: Schema.Json | undefined;
1473
- } | {
1474
- readonly _tag: "OwnershipLost";
1475
- readonly submissionId: string;
1476
- readonly actualEpoch: number;
1477
1544
  };
1478
1545
  }, Schema.SchemaError, never>;
1479
1546
  declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
@@ -1481,6 +1548,8 @@ declare const decodeAdminResponse: (input: unknown, options?: import("effect/Sch
1481
1548
  interface ConversationObjectInstance extends DurableObject$1 {
1482
1549
  submitEncoded(encoded: unknown): Promise<unknown>;
1483
1550
  awaitSettlementEncoded(encoded: unknown): Promise<unknown>;
1551
+ awaitProgressEncoded(encoded: unknown): Promise<unknown>;
1552
+ cancelProgressEncoded(encoded: unknown): Promise<unknown>;
1484
1553
  observePage(encoded: unknown): Promise<unknown>;
1485
1554
  abortEncoded(encoded: unknown): Promise<unknown>;
1486
1555
  resolveApprovalEncoded(encoded: unknown): Promise<unknown>;
@@ -1549,5 +1618,5 @@ interface DynamicWorkerCodeExecutorOptions {
1549
1618
  /** Layer building the Dynamic Worker `CodeExecutor` from resolved bindings. */
1550
1619
  declare const dynamicWorkerCodeExecutorLayer: (options: DynamicWorkerCodeExecutorOptions) => Layer.Layer<CodeExecutor>;
1551
1620
  //#endregion
1552
- export { AbortRecorded, AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, AdmissionLimitExceeded, ApprovalRecorded, CLOUDFLARE_DATABASE_CAP_BYTES, CLOUDFLARE_RUNTIME_DEFAULTS, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareAdmissionLimitsValue, CloudflareBindingError, CloudflareBindingSource, CloudflareBindingSourceContext, CloudflareConversationClient, CloudflareDurableRuntime, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflareDurableRuntimeInitializationError, CloudflareDurableRuntimeOptions, CloudflareDurableRuntimeServices, CloudflarePlatformConfigError, CodeModeHostEntrypoint, CodeModeHostStub, 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, RetryExecuted, SettlementReached, SubmitRequest, SubmitSucceeded, UnknownResolutionRecorded, VerifiedIntegrity, boundHostDiagnostic, cloudflareWakeSchedulerLayer, conversationNamespaceFromEnv, conversationNamespaceLayer, conversationPortTransportLayer, decodeAbortCommand, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeApprovalDecisionCommand, decodeHostResponse, decodeObligationThresholds, decodeObservePageRequest, decodeReceipt, decodeRetryCommand, decodeSubmitRequest, decodeUnknownResolutionCommand, dynamicWorkerCodeExecutorLayer, dynamicWorkerImplementation, encodeAbortCommand, encodeAdminResponse, encodeApprovalDecisionCommand, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, makeConversationObjectClass };
1621
+ export { AbortRecorded, AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, AdmissionLimitExceeded, ApprovalRecorded, AwaitProgressRequest, 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, CodeModeHostEntrypoint, CodeModeHostStub, ConversationClientError, ConversationMaintenance, ConversationMaintenanceFailpoint, ConversationMaintenanceFailpointHandler, ConversationMaintenanceFailpointLocation, ConversationObjectClass, ConversationObjectIdentity, ConversationObjectInstance, ConversationObjectNamespace, ConversationObjectOptions, ConversationObjectPorts, ConversationObjectRpc, DEFAULT_MAX_DATABASE_BYTES, DurableAlarmError, DurableAlarmService, DurableObjectContext, DynamicWorkerCodeExecutorOptions, ExplainedRecovery, HostFailed, HostFailure, HostProtocolError, HostResponse, MaintenancePassFailure, MaintenancePassReport, ObligationsScanned, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, ProgressWaitRegistry, RetryExecuted, SettlementReached, SubmitRequest, SubmitSucceeded, UnknownResolutionRecorded, VerifiedIntegrity, boundHostDiagnostic, cloudflareWakeSchedulerLayer, conversationNamespaceFromEnv, conversationNamespaceLayer, conversationPortTransportLayer, decodeAbortCommand, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObligationThresholds, decodeObservePageRequest, decodeReceipt, decodeRetryCommand, decodeSubmitRequest, decodeUnknownResolutionCommand, dynamicWorkerCodeExecutorLayer, dynamicWorkerImplementation, encodeAbortCommand, encodeAdminResponse, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, makeConversationObjectClass };
1553
1622
  //# sourceMappingURL=index.d.mts.map