@voltro/workflow 0.84.0 → 0.85.0

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.ts CHANGED
@@ -2,28 +2,26 @@ import { Cause } from 'effect';
2
2
  import { ColumnBuilder } from '@voltro/database';
3
3
  import { Context } from 'effect';
4
4
  import { DataStore } from '@voltro/database';
5
- import { DurableClock as durableClock } from '@effect/workflow';
6
- import { DurableQueue as durableQueueModule } from '@effect/workflow';
7
- import { DurableRateLimiter as durableRateLimiterModule } from '@effect/workflow';
5
+ import { DurableClock as durableClock } from 'effect/workflow';
6
+ import { DurableQueue as durableQueueModule } from 'effect/workflow';
8
7
  import { Duration } from 'effect';
9
8
  import { Effect } from 'effect';
10
- import { FiberRef } from 'effect';
11
9
  import { FieldBinding } from '@voltro/database';
12
10
  import { FieldCipher } from '@voltro/database';
13
11
  import { FieldDefinitions } from '@voltro/database';
14
12
  import { Layer } from 'effect';
15
- import { ParseResult } from 'effect';
16
13
  import { QueryDescriptor } from '@voltro/database';
14
+ import { RateLimiter } from 'effect/persistence';
17
15
  import { Row } from '@voltro/database';
18
16
  import { Schema } from 'effect';
19
17
  import { SchemaTable } from '@voltro/database';
20
- import { Activity as stepModule } from '@effect/workflow';
18
+ import { Activity as stepModule } from 'effect/workflow';
21
19
  import { Subject } from '@voltro/protocol';
22
20
  import { Table } from '@voltro/database';
23
21
  import { TableLike } from '@voltro/database';
24
22
  import { WorkflowAccessOptions } from '@voltro/protocol';
25
- import { WorkflowEngine } from '@effect/workflow';
26
- import { Workflow as workflowModule } from '@effect/workflow';
23
+ import { WorkflowEngine } from 'effect/workflow';
24
+ import { Workflow as workflowModule } from 'effect/workflow';
27
25
  import { WorkflowParentClosePolicy } from '@voltro/protocol';
28
26
  import { WorkflowQueuedCancellationResult } from '@voltro/protocol';
29
27
  import { WorkflowRestartObservation } from '@voltro/protocol';
@@ -384,7 +382,7 @@ export declare const attachPreparedWorkflowExecution: (definition: object, execu
384
382
  * Journaled like every other activity: once it has matched, a replay returns the
385
383
  * matched event from the journal without re-reading anything.
386
384
  */
387
- export declare const awaitEvent: <A>(ctx: AwaitEventCtx, options: AwaitEventOptions<A>) => Effect.Effect<A, Cause.UnknownException | ParseResult.ParseError>;
385
+ export declare const awaitEvent: <A>(ctx: AwaitEventCtx, options: AwaitEventOptions<A>) => Effect.Effect<A, Cause.UnknownError | Schema.SchemaError>;
388
386
 
389
387
  /** The slice of `ctx.store` this needs — the same shape `awaitSignal` takes, so
390
388
  * a full `AppContext` store is assignable without a cast. */
@@ -406,7 +404,7 @@ export declare interface AwaitEventOptions<A> {
406
404
  /** Parsed against the event's payload. A parse failure fails the activity
407
405
  * rather than matching — a correlated event whose SHAPE is wrong is a bug in
408
406
  * the publisher, and silently skipping it would hide that. */
409
- readonly schema: Schema.Schema<A, any>;
407
+ readonly schema: Schema.Codec<A, any>;
410
408
  /**
411
409
  * Does this event belong to this run?
412
410
  *
@@ -463,7 +461,7 @@ export declare interface AwaitEventOptions<A> {
463
461
  * From the dashboard, click "Send signal" on the run row and pick
464
462
  * `approval` with a JSON body matching the schema.
465
463
  */
466
- export declare const awaitSignal: <A>(ctx: AwaitSignalCtx, options: AwaitSignalOptions<A>) => Effect.Effect<A, Cause.UnknownException | ParseResult.ParseError>;
464
+ export declare const awaitSignal: <A>(ctx: AwaitSignalCtx, options: AwaitSignalOptions<A>) => Effect.Effect<A, Cause.UnknownError | Schema.SchemaError>;
467
465
 
468
466
  /** The slice of `ctx.store` awaitSignal needs — just `query`, typed against
469
467
  * the real `QueryDescriptor` so a full `AppContext` store (`DataStore`) is
@@ -484,7 +482,7 @@ export declare interface AwaitSignalOptions<A> {
484
482
  /** Schema the incoming payload is parsed against. Parse failures
485
483
  * fail the activity with a typed error (the schema's ParseError);
486
484
  * fix the sender's payload shape and re-send. */
487
- readonly schema: Schema.Schema<A, any>;
485
+ readonly schema: Schema.Codec<A, any>;
488
486
  /** Initial poll interval in milliseconds. Default 200 ms — gives
489
487
  * sub-second wake for fresh signals. Subsequent polls back off
490
488
  * exponentially up to `maxPollIntervalMs`. */
@@ -518,7 +516,7 @@ export declare interface AwaitSignalOptions<A> {
518
516
  * interchangeable in a body); the suspending variant reads the durable
519
517
  * deferred, not `ctx.store`.
520
518
  */
521
- export declare const awaitSignalSuspending: <A>(ctx: AwaitSignalCtx, options: AwaitSignalSuspendingOptions<A>) => Effect.Effect<A, ParseResult.ParseError>;
519
+ export declare const awaitSignalSuspending: <A>(ctx: AwaitSignalCtx, options: AwaitSignalSuspendingOptions<A>) => Effect.Effect<A, Schema.SchemaError>;
522
520
 
523
521
  export declare interface AwaitSignalSuspendingOptions<A> {
524
522
  /** Caller-chosen signal name. The external completer targets this exact
@@ -526,7 +524,7 @@ export declare interface AwaitSignalSuspendingOptions<A> {
526
524
  readonly name: string;
527
525
  /** Schema the incoming payload is decoded against. A decode failure fails
528
526
  * the workflow with the schema's `ParseError`. */
529
- readonly schema: Schema.Schema<A, any>;
527
+ readonly schema: Schema.Codec<A, any>;
530
528
  /** Max time to wait before failing the workflow. Default 24 h. The timeout
531
529
  * is itself durable (a raced `DurableClock`), so a long wait frees the
532
530
  * runner too. Pass `Number.POSITIVE_INFINITY` for an unbounded wait. */
@@ -547,8 +545,8 @@ export declare interface AwaitUpdateCtx {
547
545
 
548
546
  export declare interface AwaitUpdateOptions<A, B = A> {
549
547
  readonly name: string;
550
- readonly schema: Schema.Schema<A, any>;
551
- readonly success?: Schema.Schema<B, any>;
548
+ readonly schema: Schema.Codec<A, any>;
549
+ readonly success?: Schema.Codec<B, any>;
552
550
  readonly handle?: (payload: A) => Effect.Effect<B, unknown, never>;
553
551
  readonly pollIntervalMs?: number;
554
552
  readonly maxPollIntervalMs?: number;
@@ -570,31 +568,25 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
570
568
  kind: "settled";
571
569
  request: {
572
570
  readonly id: string;
573
- readonly cause?: {
574
- readonly detail?: {
575
- readonly [x: string]: unknown;
576
- } | undefined;
577
- readonly reason: string;
578
- } | null | undefined;
579
571
  readonly result: {
580
- readonly status: "failed" | "cancelled" | "succeeded";
581
572
  readonly kind: "confirmed" | "already-terminal";
573
+ readonly status: "failed" | "cancelled" | "succeeded";
574
+ readonly completedAt: number;
582
575
  readonly output: unknown;
583
- readonly errorMessage: string | null;
584
576
  readonly errorTag: string | null;
585
- readonly completedAt: number;
577
+ readonly errorMessage: string | null;
586
578
  } | {
587
- readonly status: "running";
588
579
  readonly kind: "confirmed";
589
- readonly generation: string;
580
+ readonly status: "running";
590
581
  readonly enteredAt: number;
582
+ readonly generation: string;
591
583
  } | null;
584
+ readonly operation: "resume" | "cancel" | "terminate";
592
585
  readonly generation: string;
593
586
  readonly runId: string;
594
587
  readonly requestedAt: number;
595
588
  readonly executionId: string;
596
589
  readonly workflowName: string;
597
- readonly operation: "resume" | "cancel" | "terminate";
598
590
  readonly dispatchAttempts: number;
599
591
  readonly owner: {
600
592
  readonly tenantId: string | null;
@@ -604,37 +596,37 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
604
596
  readonly replyId: string;
605
597
  readonly restartToken: string | null;
606
598
  } | null;
599
+ readonly cause?: {
600
+ readonly reason: string;
601
+ readonly detail?: {
602
+ readonly [x: string]: unknown;
603
+ } | undefined;
604
+ } | null | undefined;
607
605
  };
608
606
  run?: never;
609
607
  } | {
610
608
  kind: "unknown";
611
609
  request: {
612
610
  readonly id: string;
613
- readonly cause?: {
614
- readonly detail?: {
615
- readonly [x: string]: unknown;
616
- } | undefined;
617
- readonly reason: string;
618
- } | null | undefined;
619
611
  readonly result: {
620
- readonly status: "failed" | "cancelled" | "succeeded";
621
612
  readonly kind: "confirmed" | "already-terminal";
613
+ readonly status: "failed" | "cancelled" | "succeeded";
614
+ readonly completedAt: number;
622
615
  readonly output: unknown;
623
- readonly errorMessage: string | null;
624
616
  readonly errorTag: string | null;
625
- readonly completedAt: number;
617
+ readonly errorMessage: string | null;
626
618
  } | {
627
- readonly status: "running";
628
619
  readonly kind: "confirmed";
629
- readonly generation: string;
620
+ readonly status: "running";
630
621
  readonly enteredAt: number;
622
+ readonly generation: string;
631
623
  } | null;
624
+ readonly operation: "resume" | "cancel" | "terminate";
632
625
  readonly generation: string;
633
626
  readonly runId: string;
634
627
  readonly requestedAt: number;
635
628
  readonly executionId: string;
636
629
  readonly workflowName: string;
637
- readonly operation: "resume" | "cancel" | "terminate";
638
630
  readonly dispatchAttempts: number;
639
631
  readonly owner: {
640
632
  readonly tenantId: string | null;
@@ -644,37 +636,37 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
644
636
  readonly replyId: string;
645
637
  readonly restartToken: string | null;
646
638
  } | null;
639
+ readonly cause?: {
640
+ readonly reason: string;
641
+ readonly detail?: {
642
+ readonly [x: string]: unknown;
643
+ } | undefined;
644
+ } | null | undefined;
647
645
  };
648
646
  run?: never;
649
647
  } | {
650
648
  kind: "superseded";
651
649
  request: {
652
650
  readonly id: string;
653
- readonly cause?: {
654
- readonly detail?: {
655
- readonly [x: string]: unknown;
656
- } | undefined;
657
- readonly reason: string;
658
- } | null | undefined;
659
651
  readonly result: {
660
- readonly status: "failed" | "cancelled" | "succeeded";
661
652
  readonly kind: "confirmed" | "already-terminal";
653
+ readonly status: "failed" | "cancelled" | "succeeded";
654
+ readonly completedAt: number;
662
655
  readonly output: unknown;
663
- readonly errorMessage: string | null;
664
656
  readonly errorTag: string | null;
665
- readonly completedAt: number;
657
+ readonly errorMessage: string | null;
666
658
  } | {
667
- readonly status: "running";
668
659
  readonly kind: "confirmed";
669
- readonly generation: string;
660
+ readonly status: "running";
670
661
  readonly enteredAt: number;
662
+ readonly generation: string;
671
663
  } | null;
664
+ readonly operation: "resume" | "cancel" | "terminate";
672
665
  readonly generation: string;
673
666
  readonly runId: string;
674
667
  readonly requestedAt: number;
675
668
  readonly executionId: string;
676
669
  readonly workflowName: string;
677
- readonly operation: "resume" | "cancel" | "terminate";
678
670
  readonly dispatchAttempts: number;
679
671
  readonly owner: {
680
672
  readonly tenantId: string | null;
@@ -684,37 +676,37 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
684
676
  readonly replyId: string;
685
677
  readonly restartToken: string | null;
686
678
  } | null;
679
+ readonly cause?: {
680
+ readonly reason: string;
681
+ readonly detail?: {
682
+ readonly [x: string]: unknown;
683
+ } | undefined;
684
+ } | null | undefined;
687
685
  };
688
686
  run?: never;
689
687
  } | {
690
688
  kind: "already-terminal";
691
689
  request: {
692
690
  readonly id: string;
693
- readonly cause?: {
694
- readonly detail?: {
695
- readonly [x: string]: unknown;
696
- } | undefined;
697
- readonly reason: string;
698
- } | null | undefined;
699
691
  readonly result: {
700
- readonly status: "failed" | "cancelled" | "succeeded";
701
692
  readonly kind: "confirmed" | "already-terminal";
693
+ readonly status: "failed" | "cancelled" | "succeeded";
694
+ readonly completedAt: number;
702
695
  readonly output: unknown;
703
- readonly errorMessage: string | null;
704
696
  readonly errorTag: string | null;
705
- readonly completedAt: number;
697
+ readonly errorMessage: string | null;
706
698
  } | {
707
- readonly status: "running";
708
699
  readonly kind: "confirmed";
709
- readonly generation: string;
700
+ readonly status: "running";
710
701
  readonly enteredAt: number;
702
+ readonly generation: string;
711
703
  } | null;
704
+ readonly operation: "resume" | "cancel" | "terminate";
712
705
  readonly generation: string;
713
706
  readonly runId: string;
714
707
  readonly requestedAt: number;
715
708
  readonly executionId: string;
716
709
  readonly workflowName: string;
717
- readonly operation: "resume" | "cancel" | "terminate";
718
710
  readonly dispatchAttempts: number;
719
711
  readonly owner: {
720
712
  readonly tenantId: string | null;
@@ -724,6 +716,12 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
724
716
  readonly replyId: string;
725
717
  readonly restartToken: string | null;
726
718
  } | null;
719
+ readonly cause?: {
720
+ readonly reason: string;
721
+ readonly detail?: {
722
+ readonly [x: string]: unknown;
723
+ } | undefined;
724
+ } | null | undefined;
727
725
  };
728
726
  run: Readonly<Record<string, unknown>>;
729
727
  } | {
@@ -731,31 +729,25 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
731
729
  request: {
732
730
  dispatchAttempts: number;
733
731
  id: string;
734
- cause?: {
735
- readonly detail?: {
736
- readonly [x: string]: unknown;
737
- } | undefined;
738
- readonly reason: string;
739
- } | null | undefined;
740
732
  result: {
741
- readonly status: "failed" | "cancelled" | "succeeded";
742
733
  readonly kind: "confirmed" | "already-terminal";
734
+ readonly status: "failed" | "cancelled" | "succeeded";
735
+ readonly completedAt: number;
743
736
  readonly output: unknown;
744
- readonly errorMessage: string | null;
745
737
  readonly errorTag: string | null;
746
- readonly completedAt: number;
738
+ readonly errorMessage: string | null;
747
739
  } | {
748
- readonly status: "running";
749
740
  readonly kind: "confirmed";
750
- readonly generation: string;
741
+ readonly status: "running";
751
742
  readonly enteredAt: number;
743
+ readonly generation: string;
752
744
  } | null;
745
+ operation: "resume" | "cancel" | "terminate";
753
746
  generation: string;
754
747
  runId: string;
755
748
  requestedAt: number;
756
749
  executionId: string;
757
750
  workflowName: string;
758
- operation: "resume" | "cancel" | "terminate";
759
751
  owner: {
760
752
  readonly tenantId: string | null;
761
753
  } | null;
@@ -764,6 +756,12 @@ export declare const beginWorkflowControlDispatchInTransaction: (tx: Store, id:
764
756
  readonly replyId: string;
765
757
  readonly restartToken: string | null;
766
758
  } | null;
759
+ cause?: {
760
+ readonly reason: string;
761
+ readonly detail?: {
762
+ readonly [x: string]: unknown;
763
+ } | undefined;
764
+ } | null | undefined;
767
765
  };
768
766
  run?: never;
769
767
  }>;
@@ -781,31 +779,25 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
781
779
  kind: "settled";
782
780
  request: {
783
781
  readonly id: string;
784
- readonly cause?: {
785
- readonly detail?: {
786
- readonly [x: string]: unknown;
787
- } | undefined;
788
- readonly reason: string;
789
- } | null | undefined;
790
782
  readonly result: {
791
- readonly status: "failed" | "cancelled" | "succeeded";
792
783
  readonly kind: "confirmed" | "already-terminal";
784
+ readonly status: "failed" | "cancelled" | "succeeded";
785
+ readonly completedAt: number;
793
786
  readonly output: unknown;
794
- readonly errorMessage: string | null;
795
787
  readonly errorTag: string | null;
796
- readonly completedAt: number;
788
+ readonly errorMessage: string | null;
797
789
  } | {
798
- readonly status: "running";
799
790
  readonly kind: "confirmed";
800
- readonly generation: string;
791
+ readonly status: "running";
801
792
  readonly enteredAt: number;
793
+ readonly generation: string;
802
794
  } | null;
795
+ readonly operation: "resume" | "cancel" | "terminate";
803
796
  readonly generation: string;
804
797
  readonly runId: string;
805
798
  readonly requestedAt: number;
806
799
  readonly executionId: string;
807
800
  readonly workflowName: string;
808
- readonly operation: "resume" | "cancel" | "terminate";
809
801
  readonly dispatchAttempts: number;
810
802
  readonly owner: {
811
803
  readonly tenantId: string | null;
@@ -815,36 +807,36 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
815
807
  readonly replyId: string;
816
808
  readonly restartToken: string | null;
817
809
  } | null;
818
- };
819
- } | {
820
- kind: "unknown";
821
- request: {
822
- readonly id: string;
823
810
  readonly cause?: {
811
+ readonly reason: string;
824
812
  readonly detail?: {
825
813
  readonly [x: string]: unknown;
826
814
  } | undefined;
827
- readonly reason: string;
828
815
  } | null | undefined;
816
+ };
817
+ } | {
818
+ kind: "unknown";
819
+ request: {
820
+ readonly id: string;
829
821
  readonly result: {
830
- readonly status: "failed" | "cancelled" | "succeeded";
831
822
  readonly kind: "confirmed" | "already-terminal";
823
+ readonly status: "failed" | "cancelled" | "succeeded";
824
+ readonly completedAt: number;
832
825
  readonly output: unknown;
833
- readonly errorMessage: string | null;
834
826
  readonly errorTag: string | null;
835
- readonly completedAt: number;
827
+ readonly errorMessage: string | null;
836
828
  } | {
837
- readonly status: "running";
838
829
  readonly kind: "confirmed";
839
- readonly generation: string;
830
+ readonly status: "running";
840
831
  readonly enteredAt: number;
832
+ readonly generation: string;
841
833
  } | null;
834
+ readonly operation: "resume" | "cancel" | "terminate";
842
835
  readonly generation: string;
843
836
  readonly runId: string;
844
837
  readonly requestedAt: number;
845
838
  readonly executionId: string;
846
839
  readonly workflowName: string;
847
- readonly operation: "resume" | "cancel" | "terminate";
848
840
  readonly dispatchAttempts: number;
849
841
  readonly owner: {
850
842
  readonly tenantId: string | null;
@@ -854,36 +846,36 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
854
846
  readonly replyId: string;
855
847
  readonly restartToken: string | null;
856
848
  } | null;
857
- };
858
- } | {
859
- kind: "superseded";
860
- request: {
861
- readonly id: string;
862
849
  readonly cause?: {
850
+ readonly reason: string;
863
851
  readonly detail?: {
864
852
  readonly [x: string]: unknown;
865
853
  } | undefined;
866
- readonly reason: string;
867
854
  } | null | undefined;
855
+ };
856
+ } | {
857
+ kind: "superseded";
858
+ request: {
859
+ readonly id: string;
868
860
  readonly result: {
869
- readonly status: "failed" | "cancelled" | "succeeded";
870
861
  readonly kind: "confirmed" | "already-terminal";
862
+ readonly status: "failed" | "cancelled" | "succeeded";
863
+ readonly completedAt: number;
871
864
  readonly output: unknown;
872
- readonly errorMessage: string | null;
873
865
  readonly errorTag: string | null;
874
- readonly completedAt: number;
866
+ readonly errorMessage: string | null;
875
867
  } | {
876
- readonly status: "running";
877
868
  readonly kind: "confirmed";
878
- readonly generation: string;
869
+ readonly status: "running";
879
870
  readonly enteredAt: number;
871
+ readonly generation: string;
880
872
  } | null;
873
+ readonly operation: "resume" | "cancel" | "terminate";
881
874
  readonly generation: string;
882
875
  readonly runId: string;
883
876
  readonly requestedAt: number;
884
877
  readonly executionId: string;
885
878
  readonly workflowName: string;
886
- readonly operation: "resume" | "cancel" | "terminate";
887
879
  readonly dispatchAttempts: number;
888
880
  readonly owner: {
889
881
  readonly tenantId: string | null;
@@ -893,36 +885,36 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
893
885
  readonly replyId: string;
894
886
  readonly restartToken: string | null;
895
887
  } | null;
896
- };
897
- } | {
898
- kind: "not-suspended";
899
- request: {
900
- readonly id: string;
901
888
  readonly cause?: {
889
+ readonly reason: string;
902
890
  readonly detail?: {
903
891
  readonly [x: string]: unknown;
904
892
  } | undefined;
905
- readonly reason: string;
906
893
  } | null | undefined;
894
+ };
895
+ } | {
896
+ kind: "not-suspended";
897
+ request: {
898
+ readonly id: string;
907
899
  readonly result: {
908
- readonly status: "failed" | "cancelled" | "succeeded";
909
900
  readonly kind: "confirmed" | "already-terminal";
901
+ readonly status: "failed" | "cancelled" | "succeeded";
902
+ readonly completedAt: number;
910
903
  readonly output: unknown;
911
- readonly errorMessage: string | null;
912
904
  readonly errorTag: string | null;
913
- readonly completedAt: number;
905
+ readonly errorMessage: string | null;
914
906
  } | {
915
- readonly status: "running";
916
907
  readonly kind: "confirmed";
917
- readonly generation: string;
908
+ readonly status: "running";
918
909
  readonly enteredAt: number;
910
+ readonly generation: string;
919
911
  } | null;
912
+ readonly operation: "resume" | "cancel" | "terminate";
920
913
  readonly generation: string;
921
914
  readonly runId: string;
922
915
  readonly requestedAt: number;
923
916
  readonly executionId: string;
924
917
  readonly workflowName: string;
925
- readonly operation: "resume" | "cancel" | "terminate";
926
918
  readonly dispatchAttempts: number;
927
919
  readonly owner: {
928
920
  readonly tenantId: string | null;
@@ -932,36 +924,36 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
932
924
  readonly replyId: string;
933
925
  readonly restartToken: string | null;
934
926
  } | null;
935
- };
936
- } | {
937
- kind: "bound";
938
- request: {
939
- readonly id: string;
940
927
  readonly cause?: {
928
+ readonly reason: string;
941
929
  readonly detail?: {
942
930
  readonly [x: string]: unknown;
943
931
  } | undefined;
944
- readonly reason: string;
945
932
  } | null | undefined;
933
+ };
934
+ } | {
935
+ kind: "bound";
936
+ request: {
937
+ readonly id: string;
946
938
  readonly result: {
947
- readonly status: "failed" | "cancelled" | "succeeded";
948
939
  readonly kind: "confirmed" | "already-terminal";
940
+ readonly status: "failed" | "cancelled" | "succeeded";
941
+ readonly completedAt: number;
949
942
  readonly output: unknown;
950
- readonly errorMessage: string | null;
951
943
  readonly errorTag: string | null;
952
- readonly completedAt: number;
944
+ readonly errorMessage: string | null;
953
945
  } | {
954
- readonly status: "running";
955
946
  readonly kind: "confirmed";
956
- readonly generation: string;
947
+ readonly status: "running";
957
948
  readonly enteredAt: number;
949
+ readonly generation: string;
958
950
  } | null;
951
+ readonly operation: "resume" | "cancel" | "terminate";
959
952
  readonly generation: string;
960
953
  readonly runId: string;
961
954
  readonly requestedAt: number;
962
955
  readonly executionId: string;
963
956
  readonly workflowName: string;
964
- readonly operation: "resume" | "cancel" | "terminate";
965
957
  readonly dispatchAttempts: number;
966
958
  readonly owner: {
967
959
  readonly tenantId: string | null;
@@ -971,36 +963,36 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
971
963
  readonly replyId: string;
972
964
  readonly restartToken: string | null;
973
965
  } | null;
974
- };
975
- } | {
976
- kind: "waiting-journal";
977
- request: {
978
- readonly id: string;
979
966
  readonly cause?: {
967
+ readonly reason: string;
980
968
  readonly detail?: {
981
969
  readonly [x: string]: unknown;
982
970
  } | undefined;
983
- readonly reason: string;
984
971
  } | null | undefined;
972
+ };
973
+ } | {
974
+ kind: "waiting-journal";
975
+ request: {
976
+ readonly id: string;
985
977
  readonly result: {
986
- readonly status: "failed" | "cancelled" | "succeeded";
987
978
  readonly kind: "confirmed" | "already-terminal";
979
+ readonly status: "failed" | "cancelled" | "succeeded";
980
+ readonly completedAt: number;
988
981
  readonly output: unknown;
989
- readonly errorMessage: string | null;
990
982
  readonly errorTag: string | null;
991
- readonly completedAt: number;
983
+ readonly errorMessage: string | null;
992
984
  } | {
993
- readonly status: "running";
994
985
  readonly kind: "confirmed";
995
- readonly generation: string;
986
+ readonly status: "running";
996
987
  readonly enteredAt: number;
988
+ readonly generation: string;
997
989
  } | null;
990
+ readonly operation: "resume" | "cancel" | "terminate";
998
991
  readonly generation: string;
999
992
  readonly runId: string;
1000
993
  readonly requestedAt: number;
1001
994
  readonly executionId: string;
1002
995
  readonly workflowName: string;
1003
- readonly operation: "resume" | "cancel" | "terminate";
1004
996
  readonly dispatchAttempts: number;
1005
997
  readonly owner: {
1006
998
  readonly tenantId: string | null;
@@ -1010,6 +1002,12 @@ export declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: str
1010
1002
  readonly replyId: string;
1011
1003
  readonly restartToken: string | null;
1012
1004
  } | null;
1005
+ readonly cause?: {
1006
+ readonly reason: string;
1007
+ readonly detail?: {
1008
+ readonly [x: string]: unknown;
1009
+ } | undefined;
1010
+ } | null | undefined;
1013
1011
  };
1014
1012
  }>;
1015
1013
 
@@ -1115,7 +1113,7 @@ export declare interface CancelOnPlanInput {
1115
1113
  /** The workflow's own payload schema. When absent the stored payload is
1116
1114
  * handed to `match` as-is — correct for JSON-shaped payloads and the honest
1117
1115
  * fallback when a definition cannot be resolved. */
1118
- readonly payloadSchema?: Schema.Schema.Any | undefined;
1116
+ readonly payloadSchema?: Schema.Top | undefined;
1119
1117
  readonly events: ReadonlyArray<DomainEventRow>;
1120
1118
  readonly runs: ReadonlyArray<CancellableRun>;
1121
1119
  readonly intents: ReadonlyArray<CancellableIntent>;
@@ -1178,7 +1176,7 @@ export declare interface CancelOnSweepResult {
1178
1176
  export declare interface CancelOnWorkflow {
1179
1177
  readonly workflowName: string;
1180
1178
  readonly entries: ReadonlyArray<ResolvedCancelOn>;
1181
- readonly payloadSchema?: Schema.Schema.Any | undefined;
1179
+ readonly payloadSchema?: Schema.Top | undefined;
1182
1180
  }
1183
1181
 
1184
1182
  /**
@@ -1218,7 +1216,7 @@ export declare const CLUSTER_REREAD_WINDOW_MS: number;
1218
1216
  export declare class ClusterDiagnostics extends ClusterDiagnostics_base {
1219
1217
  }
1220
1218
 
1221
- declare const ClusterDiagnostics_base: Context.TagClass<ClusterDiagnostics, "@voltro/workflow/ClusterDiagnostics", ClusterDiagnosticsOps>;
1219
+ declare const ClusterDiagnostics_base: Context.ServiceClass<ClusterDiagnostics, "@voltro/workflow/ClusterDiagnostics", ClusterDiagnosticsOps>;
1222
1220
 
1223
1221
  export declare interface ClusterDiagnosticsOps {
1224
1222
  /** This runner's advertised address — what keys its locks and its runner row. */
@@ -1307,7 +1305,7 @@ export declare const comparePendingOrder: (a: {
1307
1305
  */
1308
1306
  export declare const completeSuspendingSignal: (input: CompleteSuspendingSignalInput) => Effect.Effect<{
1309
1307
  readonly completed: boolean;
1310
- }, Cause.UnknownException, WorkflowEngine.WorkflowEngine>;
1308
+ }, Cause.UnknownError, WorkflowEngine.WorkflowEngine>;
1311
1309
 
1312
1310
  /** Input to {@link completeSuspendingSignal}. */
1313
1311
  export declare interface CompleteSuspendingSignalInput {
@@ -1342,7 +1340,7 @@ export declare const completeWorkflowRunGenerationInTransaction: (tx: AdmissionD
1342
1340
  * from `CurrentWorkflowRunId` (which is the runs-row primary key)
1343
1341
  * because the natural durable id used by other workflows is the
1344
1342
  * engine-assigned executionId, not our row id. */
1345
- export declare const CurrentWorkflowExecutionId: FiberRef.FiberRef<string | undefined>;
1343
+ export declare const CurrentWorkflowExecutionId: Context.Reference<string | undefined>;
1346
1344
 
1347
1345
  /**
1348
1346
  * FiberRef carrying the patch markers that were declared on the workflow at the
@@ -1355,7 +1353,7 @@ export declare const CurrentWorkflowExecutionId: FiberRef.FiberRef<string | unde
1355
1353
  * Empty outside a recorded workflow body, so `patch()` is `false` there — the
1356
1354
  * safe direction: an un-recorded context gets the PRE-patch branch.
1357
1355
  */
1358
- export declare const CurrentWorkflowPatches: FiberRef.FiberRef<readonly string[]>;
1356
+ export declare const CurrentWorkflowPatches: Context.Reference<readonly string[]>;
1359
1357
 
1360
1358
  /**
1361
1359
  * The tracker for the CURRENT body entry, or `undefined` when there is nothing
@@ -1365,12 +1363,12 @@ export declare const CurrentWorkflowPatches: FiberRef.FiberRef<readonly string[]
1365
1363
  * whose row already exists). A first entry has no prior shape, so the whole
1366
1364
  * mechanism costs one `FiberRef` read per step and nothing else.
1367
1365
  */
1368
- export declare const CurrentWorkflowReplayShape: FiberRef.FiberRef<ReplayShapeTracker | undefined>;
1366
+ export declare const CurrentWorkflowReplayShape: Context.Reference<ReplayShapeTracker | undefined>;
1369
1367
 
1370
1368
  /** FiberRef carrying the active workflow run's id. The outer
1371
1369
  * `wrapWithRunRecording` in dev.ts sets it via
1372
- * `Effect.locally(CurrentWorkflowRunId, runId)`. */
1373
- export declare const CurrentWorkflowRunId: FiberRef.FiberRef<string | undefined>;
1370
+ * `Effect.provideService(CurrentWorkflowRunId, runId)`. */
1371
+ export declare const CurrentWorkflowRunId: Context.Reference<string | undefined>;
1374
1372
 
1375
1373
  /**
1376
1374
  * FiberRef carrying the name of the `step()` whose body is running — set by
@@ -1382,7 +1380,7 @@ export declare const CurrentWorkflowRunId: FiberRef.FiberRef<string | undefined>
1382
1380
  * and `(executionId, step, call)` is the identity that makes the second send a
1383
1381
  * replay. Read through `currentWorkflowStep`, never directly.
1384
1382
  */
1385
- export declare const CurrentWorkflowStep: FiberRef.FiberRef<string | undefined>;
1383
+ export declare const CurrentWorkflowStep: Context.Reference<string | undefined>;
1386
1384
 
1387
1385
  /**
1388
1386
  * The step this fiber is running inside, with its durable execution — or
@@ -1536,8 +1534,8 @@ export declare const deferringControlsOf: (control: ResolvedFlowControl | undefi
1536
1534
  export declare const deleteIntent: (store: AdmissionDataStore, id: string) => Promise<boolean>;
1537
1535
 
1538
1536
  declare const Delivery: Schema.Struct<{
1539
- requestId: typeof Schema.NonEmptyString;
1540
- restartToken: Schema.NullOr<typeof Schema.NonEmptyString>;
1537
+ readonly requestId: Schema.NonEmptyString;
1538
+ readonly restartToken: Schema.NullOr<Schema.NonEmptyString>;
1541
1539
  }>;
1542
1540
 
1543
1541
  /**
@@ -1661,14 +1659,12 @@ export declare const dueIntents: (store: AdmissionDataStore, now: number, limit:
1661
1659
  export { durableClock }
1662
1660
 
1663
1661
  /** Define a durable queue for concurrency-controlled side work. */
1664
- export declare const durableQueue: typeof durableQueueModule.make & (<Options extends Parameters<typeof durableQueueModule.make>[0] & {
1662
+ export declare const durableQueue: <Payload extends Schema.Top | Schema.Struct.Fields, Success extends Schema.Top = typeof Schema.Void, Error extends Schema.Top = typeof Schema.Never>(options: Parameters<typeof durableQueueModule.make<Payload, Success, Error>>[0] & {
1665
1663
  readonly encrypted?: boolean;
1666
- }>(options: Options) => ReturnType<typeof durableQueueModule.make>);
1664
+ }) => ReturnType<typeof durableQueueModule.make<Payload, Success, Error>>;
1667
1665
 
1668
1666
  export { durableQueueModule }
1669
1667
 
1670
- export { durableRateLimiterModule }
1671
-
1672
1668
  /** Establish the body-entry owner before running application code. Existing
1673
1669
  * execution identity retains its run ID and original input; return the previous
1674
1670
  * snapshot so crash/version guards decide from the state they actually replaced.
@@ -1723,31 +1719,33 @@ declare type Execute = (payload: unknown, executionId: string, discard: boolean)
1723
1719
  * the typed body result under that same ID and preserves its failure channel.
1724
1720
  * Record acceptance before joining; body completion is a separate event.
1725
1721
  * Ordinary starts do not opt into this capability automatically. */
1726
- export declare const executePreparedWorkflow: <Payload extends Schema.Schema.Any, Success extends Schema.Schema.Any, Error extends Schema.Schema.All, Discard extends boolean = true>(definition: {
1722
+ export declare const executePreparedWorkflow: <Payload extends Schema.Top, Success extends Schema.Top, Error extends Schema.Top, Discard extends boolean = true>(definition: {
1727
1723
  readonly payloadSchema: Payload;
1728
1724
  readonly successSchema: Success;
1729
1725
  readonly errorSchema: Error;
1730
1726
  }, payload: Payload["Type"], executionId: string, options?: {
1731
1727
  readonly discard: Discard;
1732
- }) => Effect.Effect<Discard extends true ? string : Success["Type"], Error["Type"], WorkflowEngine.WorkflowEngine | Payload["Context"] | Success["Context"] | Error["Context"]>;
1728
+ }) => Effect.Effect<Discard extends true ? string : Success["Type"], Error["Type"], WorkflowEngine.WorkflowEngine | Payload["DecodingServices"] | Success["DecodingServices"] | Error["DecodingServices"]>;
1729
+
1730
+ export declare const failureMessage: (error: unknown) => string;
1733
1731
 
1734
1732
  declare const FailureRecordSchema: Schema.Struct<{
1735
- id: typeof Schema.String;
1736
- workflowName: typeof Schema.String;
1737
- tenantId: Schema.NullOr<typeof Schema.String>;
1738
- sourceId: typeof Schema.String;
1739
- sourceKind: Schema.Literal<["submission", "intent", "run"]>;
1740
- handler: Schema.NullOr<typeof Schema.String>;
1741
- callerContext: typeof Schema.Unknown;
1742
- report: Schema.Struct<{
1743
- workflow: typeof Schema.String;
1744
- payload: typeof Schema.Unknown;
1745
- errorTag: Schema.NullOr<typeof Schema.String>;
1746
- errorMessage: Schema.NullOr<typeof Schema.String>;
1747
- runId: Schema.NullOr<typeof Schema.String>;
1748
- executionId: Schema.NullOr<typeof Schema.String>;
1749
- reason: typeof Schema.String;
1750
- failedAt: typeof Schema.Number;
1733
+ readonly id: Schema.String;
1734
+ readonly workflowName: Schema.String;
1735
+ readonly tenantId: Schema.NullOr<Schema.String>;
1736
+ readonly sourceId: Schema.String;
1737
+ readonly sourceKind: Schema.Literals<readonly ["submission", "intent", "run"]>;
1738
+ readonly handler: Schema.NullOr<Schema.String>;
1739
+ readonly callerContext: Schema.Unknown;
1740
+ readonly report: Schema.Struct<{
1741
+ readonly workflow: Schema.String;
1742
+ readonly payload: Schema.Unknown;
1743
+ readonly errorTag: Schema.NullOr<Schema.String>;
1744
+ readonly errorMessage: Schema.NullOr<Schema.String>;
1745
+ readonly runId: Schema.NullOr<Schema.String>;
1746
+ readonly executionId: Schema.NullOr<Schema.String>;
1747
+ readonly reason: Schema.String;
1748
+ readonly failedAt: Schema.Number;
1751
1749
  }>;
1752
1750
  }>;
1753
1751
 
@@ -1763,7 +1761,7 @@ export declare class FlowControlKeyError extends Error {
1763
1761
  /** A duration in any shape Effect accepts: `'15 minutes'`, `900_000`,
1764
1762
  * `Duration.minutes(15)`. Same input type `sleep({ duration })` takes, so
1765
1763
  * there is one duration vocabulary in the whole workflow surface. */
1766
- export declare type FlowDuration = Duration.DurationInput;
1764
+ export declare type FlowDuration = Duration.Input;
1767
1765
 
1768
1766
  /** Try to read the current workflow execution id. Returns undefined
1769
1767
  * when called outside a recorded workflow body. */
@@ -1824,7 +1822,8 @@ export declare interface InMemoryRecorder {
1824
1822
  readonly readEvents: () => ReadonlyArray<RecordedEvent>;
1825
1823
  }
1826
1824
 
1827
- export declare const inMemoryWorkflowEngineLayer: Layer.Layer<WorkflowEngine.WorkflowEngine>;
1825
+ /** `rateLimit()` counts on the `RateLimiter` service; in memory it is per process. */
1826
+ export declare const inMemoryWorkflowEngineLayer: Layer.Layer<WorkflowEngine.WorkflowEngine | RateLimiter.RateLimiter>;
1828
1827
 
1829
1828
  export declare interface InspectedStep {
1830
1829
  readonly name: string;
@@ -1879,6 +1878,10 @@ export declare interface InspectStore {
1879
1878
  */
1880
1879
  export declare const inspectWorkflow: (idOrExecutionId: string, store: InspectStore) => Promise<InspectedWorkflow | null>;
1881
1880
 
1881
+ /** A value that can carry definition metadata: a workflow definition is a
1882
+ * callable in v4 (`Workflow.make` returns a function), a queue is an object. */
1883
+ export declare const isCarrier: (value: unknown) => value is object;
1884
+
1882
1885
  /**
1883
1886
  * Has an admitted run outlived `timeouts.finish`?
1884
1887
  *
@@ -2007,7 +2010,7 @@ export declare type NondeterminismKind = 'unreached-step' | 'extra-step-occurren
2007
2010
  declare type NormaliseWorkflowMessages<M extends WorkflowMessageSchemas | undefined> = {
2008
2011
  readonly signals: M extends {
2009
2012
  readonly signals: infer Signals;
2010
- } ? NonNullable<Signals> & Readonly<Record<string, Schema.Schema.Any>> : {};
2013
+ } ? NonNullable<Signals> & Readonly<Record<string, Schema.Top>> : {};
2011
2014
  readonly updates: M extends {
2012
2015
  readonly updates: infer Updates;
2013
2016
  } ? NonNullable<Updates> & Readonly<Record<string, WorkflowMessagePairSchemas>> : {};
@@ -2126,7 +2129,7 @@ export declare interface ParkDelayedStartInput {
2126
2129
  * however many times it replays and whatever the deployed code says — which is
2127
2130
  * the property that makes the branch deterministic across a redeploy.
2128
2131
  *
2129
- * Under `@effect/workflow` the naive implementation does the opposite: an
2132
+ * Under `effect/workflow` the naive implementation does the opposite: an
2130
2133
  * activity that is ABSENT from an old run's journal EXECUTES on replay (the
2131
2134
  * journal is keyed name/attempt), so a marker journaled by an activity would
2132
2135
  * answer `true` for exactly the old runs it must answer `false` for. Reading
@@ -2328,8 +2331,26 @@ export declare const queuedCancellationRequestsTable: SchemaTable;
2328
2331
  * inferred type) is what emits in the `.d.ts`, so it stays portable. */
2329
2332
  export declare const queueWorker: typeof durableQueueModule.worker;
2330
2333
 
2331
- /** Durable rate limiter activity. Delays through the workflow clock. */
2332
- export declare const rateLimit: typeof durableRateLimiterModule.rateLimit;
2334
+ /**
2335
+ * Durable rate limit. Consumes from the shared limiter; when the window is
2336
+ * exhausted the wait is a durable clock sleep under `name`, so a deploy or a
2337
+ * worker crash does not lose the delay and a replay does not consume twice.
2338
+ */
2339
+ export declare const rateLimit: (options: RateLimitOptions) => Effect.Effect<void, RateLimiter.RateLimiterError, RateLimiter.RateLimiter | WorkflowEngine.WorkflowEngine | WorkflowEngine.WorkflowInstance>;
2340
+
2341
+ /** What `rateLimit` admits: one unit of work under `limit` per `window` for
2342
+ * `key`, counted by the `RateLimiter` service the boot provides. */
2343
+ export declare interface RateLimitOptions {
2344
+ /** Names this ADMISSION within the run: the decision is journaled under it, so a
2345
+ * replay reads it back instead of consuming again. Two calls with the same name
2346
+ * in one run share one decision — give each call its own (`send/${i}` in a loop). */
2347
+ readonly name: string;
2348
+ readonly window: Duration.Input;
2349
+ readonly limit: number;
2350
+ readonly key: string;
2351
+ readonly algorithm?: 'fixed-window' | 'token-bucket' | undefined;
2352
+ readonly tokens?: number | undefined;
2353
+ }
2333
2354
 
2334
2355
  /**
2335
2356
  * Read exactly the state the declared controls need — no more.
@@ -2389,26 +2410,13 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
2389
2410
  readonly selection: WorkflowRestartSelection;
2390
2411
  }) => Promise<{
2391
2412
  readonly id: string;
2392
- readonly tenantId: string | null;
2393
- readonly token: string;
2394
- readonly generation: string;
2395
2413
  readonly runId: string;
2396
- readonly requestedAt: Date;
2397
- readonly executionId: string;
2398
2414
  readonly workflowName: string;
2399
- readonly selection: {
2400
- readonly kind: "failed-steps";
2401
- } | {
2402
- readonly kind: "from-step";
2403
- readonly stepName: string;
2404
- };
2405
- readonly dispatchAttempts: number;
2406
- readonly enteredGeneration: string | null;
2415
+ readonly executionId: string;
2416
+ readonly generation: string;
2417
+ readonly token: string;
2407
2418
  readonly ledgerId: string;
2408
- readonly eviction: {
2409
- readonly runId: string;
2410
- readonly executionId: string;
2411
- } | null;
2419
+ readonly tenantId: string | null;
2412
2420
  readonly delivery: {
2413
2421
  readonly requestId: string;
2414
2422
  readonly restartToken: string | null;
@@ -2417,6 +2425,19 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
2417
2425
  readonly requestId: string;
2418
2426
  readonly replyId: string;
2419
2427
  }[];
2428
+ readonly selection: {
2429
+ readonly kind: "failed-steps";
2430
+ } | {
2431
+ readonly kind: "from-step";
2432
+ readonly stepName: string;
2433
+ };
2434
+ readonly eviction: {
2435
+ readonly executionId: string;
2436
+ readonly runId: string;
2437
+ } | null;
2438
+ readonly requestedAt: Date;
2439
+ readonly dispatchAttempts: number;
2440
+ readonly enteredGeneration: string | null;
2420
2441
  } | undefined>;
2421
2442
 
2422
2443
  /** Read-only reconciliation. No observation of engine replies, admission,
@@ -2436,34 +2457,34 @@ export declare const readWorkflowStartRequest: (store: Pick<DataStore, "query">,
2436
2457
  readonly requestFingerprint: string;
2437
2458
  }) => Promise<WorkflowStartReceipt | undefined>;
2438
2459
 
2439
- declare const ReceiptSchema: Schema.filter<Schema.Struct<{
2440
- id: typeof Schema.String;
2441
- workflowName: typeof Schema.String;
2442
- tenantId: Schema.NullOr<typeof Schema.String>;
2443
- pendingId: typeof Schema.String;
2444
- submissionId: Schema.NullOr<typeof Schema.String>;
2445
- terminal: Schema.NullOr<Schema.Union<[Schema.Struct<{
2446
- kind: Schema.Literal<["dropped"]>;
2447
- at: typeof Schema.Number;
2448
- retryAfterMs: typeof Schema.Number;
2460
+ declare const ReceiptSchema: Schema.Struct<{
2461
+ readonly id: Schema.String;
2462
+ readonly workflowName: Schema.String;
2463
+ readonly tenantId: Schema.NullOr<Schema.String>;
2464
+ readonly pendingId: Schema.String;
2465
+ readonly submissionId: Schema.NullOr<Schema.String>;
2466
+ readonly terminal: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
2467
+ readonly kind: Schema.Literal<"dropped">;
2468
+ readonly at: Schema.Number;
2469
+ readonly retryAfterMs: Schema.Number;
2449
2470
  }>, Schema.Struct<{
2450
- kind: Schema.Literal<["skipped"]>;
2451
- at: typeof Schema.Number;
2452
- executionId: typeof Schema.String;
2453
- runId: typeof Schema.String;
2471
+ readonly kind: Schema.Literal<"skipped">;
2472
+ readonly at: Schema.Number;
2473
+ readonly executionId: Schema.String;
2474
+ readonly runId: Schema.String;
2454
2475
  }>, Schema.Struct<{
2455
- kind: Schema.Literal<["superseded"]>;
2456
- at: typeof Schema.Number;
2476
+ readonly kind: Schema.Literal<"superseded">;
2477
+ readonly at: Schema.Number;
2457
2478
  }>, Schema.Struct<{
2458
- kind: Schema.Literal<["cancelled"]>;
2459
- at: typeof Schema.Number;
2479
+ readonly kind: Schema.Literal<"cancelled">;
2480
+ readonly at: Schema.Number;
2460
2481
  }>, Schema.Struct<{
2461
- kind: Schema.Literal<["abandoned"]>;
2462
- at: typeof Schema.Number;
2463
- failureId: typeof Schema.NonEmptyString;
2482
+ readonly kind: Schema.Literal<"abandoned">;
2483
+ readonly at: Schema.Number;
2484
+ readonly failureId: Schema.NonEmptyString;
2464
2485
  }>]>>;
2465
- requestFingerprint: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.String>>>;
2466
- }>>;
2486
+ readonly requestFingerprint: Schema.optional<Schema.NullOr<Schema.String>>;
2487
+ }>;
2467
2488
 
2468
2489
  /** Reconcile under the resident admission lock. Only a terminal pre-admission
2469
2490
  * drop/skip/supersession or proven pre-engine rejection permits a new arrival. Preserve every previous receipt and
@@ -2618,8 +2639,8 @@ export declare interface ReplayShapeTracker {
2618
2639
  }
2619
2640
 
2620
2641
  declare const Reply: Schema.Struct<{
2621
- requestId: typeof Schema.NonEmptyString;
2622
- replyId: typeof Schema.NonEmptyString;
2642
+ readonly requestId: Schema.NonEmptyString;
2643
+ readonly replyId: Schema.NonEmptyString;
2623
2644
  }>;
2624
2645
 
2625
2646
  /**
@@ -2633,39 +2654,39 @@ declare const Reply: Schema.Struct<{
2633
2654
  export declare const reportNondeterminism: (findings: ReadonlyArray<NondeterminismFinding>) => Effect.Effect<void>;
2634
2655
 
2635
2656
  declare const RequestSchema: Schema.Struct<{
2636
- id: Schema.filter<typeof Schema.String>;
2637
- runId: Schema.filter<typeof Schema.String>;
2638
- workflowName: Schema.filter<typeof Schema.String>;
2639
- executionId: Schema.filter<typeof Schema.String>;
2640
- generation: Schema.filter<typeof Schema.String>;
2641
- operation: Schema.Literal<["cancel", "terminate", "resume"]>;
2642
- requestedAt: Schema.filter<typeof Schema.Number>;
2657
+ readonly id: Schema.String;
2658
+ readonly runId: Schema.String;
2659
+ readonly workflowName: Schema.String;
2660
+ readonly executionId: Schema.String;
2661
+ readonly generation: Schema.String;
2662
+ readonly operation: Schema.Literals<readonly ["cancel", "terminate", "resume"]>;
2663
+ readonly requestedAt: Schema.Number;
2643
2664
  /** Null means no proven owner, not a null-tenant owner. */
2644
- owner: Schema.NullOr<Schema.Struct<{
2645
- tenantId: Schema.NullOr<typeof Schema.String>;
2665
+ readonly owner: Schema.NullOr<Schema.Struct<{
2666
+ readonly tenantId: Schema.NullOr<Schema.String>;
2646
2667
  }>>;
2647
- cause: Schema.optional<Schema.NullOr<Schema.Struct<{
2648
- reason: typeof Schema.NonEmptyString;
2649
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
2668
+ readonly cause: Schema.optional<Schema.NullOr<Schema.Struct<{
2669
+ readonly reason: Schema.NonEmptyString;
2670
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
2650
2671
  }>>>;
2651
- dispatchAttempts: Schema.filter<Schema.filter<typeof Schema.Number>>;
2652
- resumeJournal: Schema.NullOr<Schema.Struct<{
2653
- requestId: Schema.filter<typeof Schema.String>;
2654
- replyId: Schema.filter<typeof Schema.String>;
2655
- restartToken: Schema.NullOr<typeof Schema.NonEmptyString>;
2672
+ readonly dispatchAttempts: Schema.Number;
2673
+ readonly resumeJournal: Schema.NullOr<Schema.Struct<{
2674
+ readonly requestId: Schema.String;
2675
+ readonly replyId: Schema.String;
2676
+ readonly restartToken: Schema.NullOr<Schema.NonEmptyString>;
2656
2677
  }>>;
2657
- result: Schema.NullOr<Schema.Union<[Schema.Struct<{
2658
- kind: Schema.Literal<["confirmed", "already-terminal"]>;
2659
- status: Schema.Literal<["succeeded", "failed", "cancelled"]>;
2660
- completedAt: Schema.filter<typeof Schema.Number>;
2661
- output: typeof Schema.Unknown;
2662
- errorTag: Schema.NullOr<typeof Schema.String>;
2663
- errorMessage: Schema.NullOr<typeof Schema.String>;
2678
+ readonly result: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
2679
+ readonly kind: Schema.Literals<readonly ["confirmed", "already-terminal"]>;
2680
+ readonly status: Schema.Literals<readonly ["succeeded", "failed", "cancelled"]>;
2681
+ readonly completedAt: Schema.Number;
2682
+ readonly output: Schema.Unknown;
2683
+ readonly errorTag: Schema.NullOr<Schema.String>;
2684
+ readonly errorMessage: Schema.NullOr<Schema.String>;
2664
2685
  }>, Schema.Struct<{
2665
- kind: Schema.Literal<["confirmed"]>;
2666
- status: Schema.Literal<["running"]>;
2667
- enteredAt: Schema.filter<typeof Schema.Number>;
2668
- generation: Schema.filter<typeof Schema.String>;
2686
+ readonly kind: Schema.Literal<"confirmed">;
2687
+ readonly status: Schema.Literal<"running">;
2688
+ readonly enteredAt: Schema.Number;
2689
+ readonly generation: Schema.String;
2669
2690
  }>]>>;
2670
2691
  }>;
2671
2692
 
@@ -2727,26 +2748,13 @@ export declare const reserveWorkflowRestartInTransaction: (tx: AdmissionDataStor
2727
2748
  kind: "reserved";
2728
2749
  request: {
2729
2750
  readonly id: string;
2730
- readonly tenantId: string | null;
2731
- readonly token: string;
2732
- readonly generation: string;
2733
2751
  readonly runId: string;
2734
- readonly requestedAt: Date;
2735
- readonly executionId: string;
2736
2752
  readonly workflowName: string;
2737
- readonly selection: {
2738
- readonly kind: "failed-steps";
2739
- } | {
2740
- readonly kind: "from-step";
2741
- readonly stepName: string;
2742
- };
2743
- readonly dispatchAttempts: number;
2744
- readonly enteredGeneration: string | null;
2753
+ readonly executionId: string;
2754
+ readonly generation: string;
2755
+ readonly token: string;
2745
2756
  readonly ledgerId: string;
2746
- readonly eviction: {
2747
- readonly runId: string;
2748
- readonly executionId: string;
2749
- } | null;
2757
+ readonly tenantId: string | null;
2750
2758
  readonly delivery: {
2751
2759
  readonly requestId: string;
2752
2760
  readonly restartToken: string | null;
@@ -2755,6 +2763,19 @@ export declare const reserveWorkflowRestartInTransaction: (tx: AdmissionDataStor
2755
2763
  readonly requestId: string;
2756
2764
  readonly replyId: string;
2757
2765
  }[];
2766
+ readonly selection: {
2767
+ readonly kind: "failed-steps";
2768
+ } | {
2769
+ readonly kind: "from-step";
2770
+ readonly stepName: string;
2771
+ };
2772
+ readonly eviction: {
2773
+ readonly executionId: string;
2774
+ readonly runId: string;
2775
+ } | null;
2776
+ readonly requestedAt: Date;
2777
+ readonly dispatchAttempts: number;
2778
+ readonly enteredGeneration: string | null;
2758
2779
  };
2759
2780
  reused: boolean;
2760
2781
  decision?: never;
@@ -2801,7 +2822,7 @@ export declare const resolveAdmissionKeys: (control: ResolvedFlowControl, payloa
2801
2822
  * event at all". */
2802
2823
  export declare interface ResolvedCancelOn {
2803
2824
  readonly event: string;
2804
- readonly schema: Schema.Schema.Any;
2825
+ readonly schema: Schema.Top;
2805
2826
  readonly match: (event: unknown, payload: unknown) => boolean;
2806
2827
  readonly withinMs?: number;
2807
2828
  readonly reason: string;
@@ -2917,11 +2938,11 @@ export declare const retryDeadLetterIntent: (store: AdmissionDataStore, intentId
2917
2938
  */
2918
2939
  export declare const sealJournalValue: (value: unknown, what: string, binding?: FieldBinding) => unknown;
2919
2940
 
2920
- declare const Selection: Schema.Union<[Schema.Struct<{
2921
- kind: Schema.Literal<["failed-steps"]>;
2941
+ declare const Selection: Schema.Union<readonly [Schema.Struct<{
2942
+ readonly kind: Schema.Literal<"failed-steps">;
2922
2943
  }>, Schema.Struct<{
2923
- kind: Schema.Literal<["from-step"]>;
2924
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
2944
+ readonly kind: Schema.Literal<"from-step">;
2945
+ readonly stepName: Schema.NonEmptyString;
2925
2946
  }>]>;
2926
2947
 
2927
2948
  export declare const sendWorkflowSignal: (input: {
@@ -3141,7 +3162,7 @@ export declare type StallReason =
3141
3162
  * returns, or a runner that vanished without the reclaim path noticing. */
3142
3163
  | 'no-progress';
3143
3164
 
3144
- export declare const step: <R, Success extends Schema.Schema.Any = typeof Schema.Void, Error extends Schema.Schema.All = typeof Schema.Never>(options: StepOptions<R, Success, Error>) => ReturnType<typeof stepModule.make<R, Success, Error>>;
3165
+ export declare const step: <R, Success extends Schema.Top = typeof Schema.Void, Error extends Schema.Top = typeof Schema.Never>(options: StepOptions<R, Success, Error>) => ReturnType<typeof stepModule.make<R, Success, Error>>;
3145
3166
 
3146
3167
  /** The address the step journal's values are sealed to (`encrypted` via the
3147
3168
  * recorder's `encryptStepPayload`). ONE definition, shared with the CLI. */
@@ -3164,7 +3185,7 @@ export { stepModule }
3164
3185
  /**
3165
3186
  * Define a checkpointed step (activity) inside a workflow body.
3166
3187
  *
3167
- * Wraps `@effect/workflow`'s `Activity.make` to record every
3188
+ * Wraps `effect/workflow`'s `Activity.make` to record every
3168
3189
  * invocation in `_voltro_workflow_run_steps`. The wrapping is
3169
3190
  * transparent — accepts everything `Activity.make` accepts, plus an
3170
3191
  * optional `input` field whose value is persisted to the step row
@@ -3183,7 +3204,7 @@ export { stepModule }
3183
3204
  * Without the recorder service in scope (unit tests, etc.) the input
3184
3205
  * is dropped and the wrap is a no-op.
3185
3206
  */
3186
- declare type StepOptions<R, Success extends Schema.Schema.Any, Error extends Schema.Schema.All> = {
3207
+ declare type StepOptions<R, Success extends Schema.Top, Error extends Schema.Top> = {
3187
3208
  readonly name: string;
3188
3209
  readonly success?: Success | undefined;
3189
3210
  readonly error?: Error | undefined;
@@ -3250,28 +3271,28 @@ export declare interface StepRetryPolicy {
3250
3271
  declare type Store = Pick<DataStore, 'query' | 'insert' | 'update'>;
3251
3272
 
3252
3273
  declare const SubmissionSchema: Schema.Struct<{
3253
- id: typeof Schema.String;
3254
- workflowName: typeof Schema.String;
3255
- tenantId: Schema.NullOr<typeof Schema.String>;
3256
- ledgerId: typeof Schema.String;
3257
- preparedExecutionId: Schema.NullOr<typeof Schema.String>;
3258
- executionId: Schema.NullOr<typeof Schema.String>;
3259
- runId: Schema.NullOr<typeof Schema.String>;
3260
- receiptsBound: typeof Schema.Boolean;
3261
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
3262
- failureId: Schema.NullOr<typeof Schema.String>;
3263
- retry: Schema.Struct<{
3264
- attempts: typeof Schema.Int;
3265
- after: typeof Schema.Number;
3266
- lastError: Schema.NullOr<typeof Schema.String>;
3267
- stoppedAt: Schema.NullOr<typeof Schema.Number>;
3274
+ readonly id: Schema.String;
3275
+ readonly workflowName: Schema.String;
3276
+ readonly tenantId: Schema.NullOr<Schema.String>;
3277
+ readonly ledgerId: Schema.String;
3278
+ readonly preparedExecutionId: Schema.NullOr<Schema.String>;
3279
+ readonly executionId: Schema.NullOr<Schema.String>;
3280
+ readonly runId: Schema.NullOr<Schema.String>;
3281
+ readonly receiptsBound: Schema.Boolean;
3282
+ readonly dispatchAttempts: Schema.Number;
3283
+ readonly failureId: Schema.NullOr<Schema.String>;
3284
+ readonly retry: Schema.Struct<{
3285
+ readonly attempts: Schema.Int;
3286
+ readonly after: Schema.Number;
3287
+ readonly lastError: Schema.NullOr<Schema.String>;
3288
+ readonly stoppedAt: Schema.NullOr<Schema.Number>;
3268
3289
  }>;
3269
- payload: typeof Schema.Unknown;
3270
- callerContext: typeof Schema.Unknown;
3271
- intentIds: Schema.Array$<typeof Schema.String>;
3272
- eviction: Schema.NullOr<Schema.Struct<{
3273
- executionId: typeof Schema.String;
3274
- runId: typeof Schema.String;
3290
+ readonly payload: Schema.Unknown;
3291
+ readonly callerContext: Schema.Unknown;
3292
+ readonly intentIds: Schema.$Array<Schema.String>;
3293
+ readonly eviction: Schema.NullOr<Schema.Struct<{
3294
+ readonly executionId: Schema.String;
3295
+ readonly runId: Schema.String;
3275
3296
  }>>;
3276
3297
  }>;
3277
3298
 
@@ -3349,10 +3370,7 @@ export declare interface SuspendHintInput {
3349
3370
  */
3350
3371
  export declare const suspendingSignalDeferredName: (workflowName: string, signalName: string) => string;
3351
3372
 
3352
- export declare class SuspensionUnavailable extends SuspensionUnavailable_base {
3353
- }
3354
-
3355
- declare const SuspensionUnavailable_base: Context.ReferenceClass<SuspensionUnavailable, "@voltro/workflow/SuspensionUnavailable", string | undefined>;
3373
+ export declare const SuspensionUnavailable: Context.Reference<string | undefined>;
3356
3374
 
3357
3375
  /**
3358
3376
  * One cancellation tick. Never throws.
@@ -3379,27 +3397,27 @@ export declare const sweepStalledRuns: (deps: StalenessSweepDeps, options?: Stal
3379
3397
  * The caller supplies the encoded payload derived under this same lock. */
3380
3398
  export declare const takeAdmittedSubmissionInTransaction: (tx: AdmissionDataStore, input: Parameters<typeof persistReservedSubmission>[1]) => Promise<{
3381
3399
  readonly id: string;
3400
+ readonly workflowName: string;
3382
3401
  readonly tenantId: string | null;
3402
+ readonly ledgerId: string;
3403
+ readonly preparedExecutionId: string | null;
3404
+ readonly executionId: string | null;
3405
+ readonly runId: string | null;
3406
+ readonly receiptsBound: boolean;
3407
+ readonly dispatchAttempts: number;
3408
+ readonly failureId: string | null;
3383
3409
  readonly retry: {
3384
- readonly lastError: string | null;
3385
3410
  readonly attempts: number;
3386
3411
  readonly after: number;
3412
+ readonly lastError: string | null;
3387
3413
  readonly stoppedAt: number | null;
3388
3414
  };
3389
3415
  readonly payload: unknown;
3390
- readonly runId: string | null;
3391
- readonly executionId: string | null;
3392
- readonly failureId: string | null;
3393
- readonly workflowName: string;
3394
- readonly dispatchAttempts: number;
3395
3416
  readonly callerContext: unknown;
3396
3417
  readonly intentIds: readonly string[];
3397
- readonly ledgerId: string;
3398
- readonly receiptsBound: boolean;
3399
- readonly preparedExecutionId: string | null;
3400
3418
  readonly eviction: {
3401
- readonly runId: string;
3402
3419
  readonly executionId: string;
3420
+ readonly runId: string;
3403
3421
  } | null;
3404
3422
  }>;
3405
3423
 
@@ -3412,10 +3430,10 @@ export declare const takePendingAdmissionSubmission: (store: Pick<DataStore, "in
3412
3430
  }>;
3413
3431
 
3414
3432
  declare const Target: Schema.Struct<{
3415
- requestId: typeof Schema.NonEmptyString;
3416
- receiptId: typeof Schema.NonEmptyString;
3417
- workflowName: typeof Schema.NonEmptyString;
3418
- tenantId: Schema.NullOr<typeof Schema.String>;
3433
+ readonly requestId: Schema.NonEmptyString;
3434
+ readonly receiptId: Schema.NonEmptyString;
3435
+ readonly workflowName: Schema.NonEmptyString;
3436
+ readonly tenantId: Schema.NullOr<Schema.String>;
3419
3437
  }>;
3420
3438
 
3421
3439
  export declare const truncateWorkflowValue: (value: unknown, bytes?: number) => unknown;
@@ -3569,9 +3587,9 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
3569
3587
  kind: "withdrawn";
3570
3588
  withdrawal: {
3571
3589
  readonly id: string;
3572
- readonly tenantId: string | null;
3573
3590
  readonly runId: string;
3574
3591
  readonly workflowName: string;
3592
+ readonly tenantId: string | null;
3575
3593
  readonly selection: {
3576
3594
  readonly kind: "failed-steps";
3577
3595
  } | {
@@ -3586,26 +3604,13 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
3586
3604
  kind: "reserved";
3587
3605
  request: {
3588
3606
  readonly id: string;
3589
- readonly tenantId: string | null;
3590
- readonly token: string;
3591
- readonly generation: string;
3592
3607
  readonly runId: string;
3593
- readonly requestedAt: Date;
3594
- readonly executionId: string;
3595
3608
  readonly workflowName: string;
3596
- readonly selection: {
3597
- readonly kind: "failed-steps";
3598
- } | {
3599
- readonly kind: "from-step";
3600
- readonly stepName: string;
3601
- };
3602
- readonly dispatchAttempts: number;
3603
- readonly enteredGeneration: string | null;
3609
+ readonly executionId: string;
3610
+ readonly generation: string;
3611
+ readonly token: string;
3604
3612
  readonly ledgerId: string;
3605
- readonly eviction: {
3606
- readonly runId: string;
3607
- readonly executionId: string;
3608
- } | null;
3613
+ readonly tenantId: string | null;
3609
3614
  readonly delivery: {
3610
3615
  readonly requestId: string;
3611
3616
  readonly restartToken: string | null;
@@ -3614,6 +3619,19 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
3614
3619
  readonly requestId: string;
3615
3620
  readonly replyId: string;
3616
3621
  }[];
3622
+ readonly selection: {
3623
+ readonly kind: "failed-steps";
3624
+ } | {
3625
+ readonly kind: "from-step";
3626
+ readonly stepName: string;
3627
+ };
3628
+ readonly eviction: {
3629
+ readonly executionId: string;
3630
+ readonly runId: string;
3631
+ } | null;
3632
+ readonly requestedAt: Date;
3633
+ readonly dispatchAttempts: number;
3634
+ readonly enteredGeneration: string | null;
3617
3635
  };
3618
3636
  withdrawal?: never;
3619
3637
  reused?: never;
@@ -3631,7 +3649,9 @@ export declare const workflow: WorkflowFn;
3631
3649
  */
3632
3650
  export declare const WORKFLOW_JOURNAL_BINDING: FieldBinding;
3633
3651
 
3634
- declare type WorkflowBaseOptions = Parameters<WorkflowMake>[0];
3652
+ declare type WorkflowBaseOptions = Parameters<WorkflowMake>[1] & {
3653
+ readonly name: Parameters<WorkflowMake>[0];
3654
+ };
3635
3655
 
3636
3656
  /**
3637
3657
  * Collect many starts into ONE run over an array of items.
@@ -3690,7 +3710,7 @@ export declare interface WorkflowBatch<Item> {
3690
3710
  * }],
3691
3711
  * ```
3692
3712
  */
3693
- export declare interface WorkflowCancelOn<EventSchema extends Schema.Schema.Any, Payload> {
3713
+ export declare interface WorkflowCancelOn<EventSchema extends Schema.Top, Payload> {
3694
3714
  /** The event NAME, exactly as `ctx.events.publish` writes it. */
3695
3715
  readonly event: string;
3696
3716
  /** Decoded before `match` sees it, so the predicate reads the domain type
@@ -3724,7 +3744,7 @@ export declare interface WorkflowCancelOn<EventSchema extends Schema.Schema.Any,
3724
3744
  * the per-entry-inferred {@link WorkflowCancelOnList}; this is what survives
3725
3745
  * erasure, and it is deliberately not the public spelling. */
3726
3746
  export declare interface WorkflowCancelOnDeclared {
3727
- readonly cancelOn?: ReadonlyArray<WorkflowCancelOn<Schema.Schema.Any, never>>;
3747
+ readonly cancelOn?: ReadonlyArray<WorkflowCancelOn<Schema.Top, never>>;
3728
3748
  }
3729
3749
 
3730
3750
  /** The `cancelOn` array as declared, with each entry's event type inferred
@@ -3732,7 +3752,7 @@ export declare interface WorkflowCancelOnDeclared {
3732
3752
  * per-entry inference work — a plain `ReadonlyArray<WorkflowCancelOn<…>>`
3733
3753
  * collapses every entry's event to the constraint (`any`), which is how the
3734
3754
  * predicate silently stops being checked. */
3735
- export declare type WorkflowCancelOnList<Cancels extends ReadonlyArray<Schema.Schema.Any>, Payload> = {
3755
+ export declare type WorkflowCancelOnList<Cancels extends ReadonlyArray<Schema.Top>, Payload> = {
3736
3756
  readonly [I in keyof Cancels]: WorkflowCancelOn<Cancels[I], Payload>;
3737
3757
  };
3738
3758
 
@@ -4043,7 +4063,7 @@ export declare const WorkflowFlowControlProperty = "__voltroWorkflowFlowControl"
4043
4063
  * meaning anything if this ever regresses to `any` — which is precisely what
4044
4064
  * all three failed attempts did.
4045
4065
  */
4046
- declare type WorkflowFn = <const Name extends string, Payload extends WorkflowPayloadInput, Success extends Schema.Schema.Any = typeof Schema.Void, Error extends Schema.Schema.All = typeof Schema.Never, const Messages extends WorkflowMessageSchemas | undefined = undefined, Cancels extends ReadonlyArray<Schema.Schema.Any> = readonly []>(options: {
4066
+ declare type WorkflowFn = <const Name extends string, Payload extends WorkflowPayloadInput, Success extends Schema.Top = typeof Schema.Void, Error extends Schema.Top = typeof Schema.Never, const Messages extends WorkflowMessageSchemas | undefined = undefined, Cancels extends ReadonlyArray<Schema.Top> = readonly []>(options: {
4047
4067
  readonly name: Name;
4048
4068
  readonly payload: Payload;
4049
4069
  readonly idempotencyKey: (payload: DecodedPayload<Payload>) => string;
@@ -4061,13 +4081,15 @@ declare type WorkflowFn = <const Name extends string, Payload extends WorkflowPa
4061
4081
  readonly schedule?: WorkflowScheduleDeclaration<DecodedPayload<Payload>>;
4062
4082
  } & Omit<WorkflowBaseOptions, 'name' | 'payload' | 'idempotencyKey' | 'success' | 'error'> & WorkflowVersionOptions & {
4063
4083
  readonly messages?: Messages;
4064
- } & WorkflowFlowControl<DecodedPayload<Payload>> & WorkflowAccessOptions<DecodedPayload<Payload>>) => workflowModule.Workflow<Name, PayloadSchemaOf<Payload>, Success, Error> & WorkflowMessagesCarrier<NormaliseWorkflowMessages<Messages>>;
4084
+ } & WorkflowFlowControl<DecodedPayload<Payload>> & WorkflowAccessOptions<DecodedPayload<Payload>>) => workflowModule.Workflow<Name, PayloadSchemaOf<Payload>, Success, Error> & {
4085
+ readonly name: Name;
4086
+ } & WorkflowMessagesCarrier<NormaliseWorkflowMessages<Messages>>;
4065
4087
 
4066
4088
  declare type WorkflowMake = typeof workflowModule.make;
4067
4089
 
4068
4090
  export declare interface WorkflowMessagePairSchemas {
4069
- readonly payload: Schema.Schema.Any;
4070
- readonly success: Schema.Schema.Any;
4091
+ readonly payload: Schema.Top;
4092
+ readonly success: Schema.Top;
4071
4093
  }
4072
4094
 
4073
4095
  export declare interface WorkflowMessagesCarrier<M extends WorkflowMessagesMetadata = WorkflowMessagesMetadata> {
@@ -4085,12 +4107,12 @@ export declare interface WorkflowMessagesCarrier<M extends WorkflowMessagesMetad
4085
4107
  * and updates (synchronous, with a result) are the channels that exist.
4086
4108
  */
4087
4109
  export declare interface WorkflowMessageSchemas {
4088
- readonly signals?: Readonly<Record<string, Schema.Schema.Any>>;
4110
+ readonly signals?: Readonly<Record<string, Schema.Top>>;
4089
4111
  readonly updates?: Readonly<Record<string, WorkflowMessagePairSchemas>>;
4090
4112
  }
4091
4113
 
4092
4114
  export declare interface WorkflowMessagesMetadata {
4093
- readonly signals: Readonly<Record<string, Schema.Schema.Any>>;
4115
+ readonly signals: Readonly<Record<string, Schema.Top>>;
4094
4116
  readonly updates: Readonly<Record<string, WorkflowMessagePairSchemas>>;
4095
4117
  }
4096
4118
 
@@ -4308,7 +4330,7 @@ declare interface WorkflowRunOutcome {
4308
4330
  export declare class WorkflowRunRecorder extends WorkflowRunRecorder_base {
4309
4331
  }
4310
4332
 
4311
- declare const WorkflowRunRecorder_base: Context.TagClass<WorkflowRunRecorder, "@voltro/WorkflowRunRecorder", WorkflowRunRecorderService>;
4333
+ declare const WorkflowRunRecorder_base: Context.ServiceClass<WorkflowRunRecorder, "@voltro/WorkflowRunRecorder", WorkflowRunRecorderService>;
4312
4334
 
4313
4335
  export declare interface WorkflowRunRecorderOptions {
4314
4336
  readonly store: WorkflowRecordingStore;
@@ -4541,7 +4563,7 @@ export declare type WorkflowStartResolution = {
4541
4563
  * Receives the user's `execute` Effect + a `WorkflowStepContext`
4542
4564
  * carrying `{ runId, stepName, attempt }`. Returns a wrapped Effect.
4543
4565
  * A FAIL inside the interceptor abort the step the same way a fail
4544
- * in the user effect would — including triggering @effect/workflow's
4566
+ * in the user effect would — including triggering effect/workflow's
4545
4567
  * retry policy.
4546
4568
  */
4547
4569
  export declare interface WorkflowStepContext {
@@ -4567,7 +4589,7 @@ export declare interface WorkflowStepInterceptorService {
4567
4589
  export declare class WorkflowStepInterceptorTag extends WorkflowStepInterceptorTag_base {
4568
4590
  }
4569
4591
 
4570
- declare const WorkflowStepInterceptorTag_base: Context.TagClass<WorkflowStepInterceptorTag, "@voltro/WorkflowStepInterceptor", WorkflowStepInterceptorService>;
4592
+ declare const WorkflowStepInterceptorTag_base: Context.ServiceClass<WorkflowStepInterceptorTag, "@voltro/WorkflowStepInterceptor", WorkflowStepInterceptorService>;
4571
4593
 
4572
4594
  /**
4573
4595
  * Smooth throughput: excess starts QUEUE and are admitted as capacity frees up.
@@ -4650,7 +4672,7 @@ export declare interface WorkflowVersionOptions {
4650
4672
  * suspended-on-failure run shows up under `--status suspended`, NOT in the
4651
4673
  * dead-letter view — it is recoverable, not dead.
4652
4674
  *
4653
- * Maps to `@effect/workflow`'s `SuspendOnFailure` annotation.
4675
+ * Maps to `effect/workflow`'s `SuspendOnFailure` annotation.
4654
4676
  */
4655
4677
  readonly suspendOnFailure?: boolean;
4656
4678
  }