@voltro/workflow 0.83.1 → 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/CHANGELOG.md +1191 -0
- package/THIRD-PARTY-NOTICES.md +1 -119
- package/dist/cluster-F_bhqVP7.js +679 -0
- package/dist/cluster.d.ts +304 -280
- package/dist/cluster.js +2 -2
- package/dist/clusterTestSuite.d.ts +11 -11
- package/dist/clusterTestSuite.js +256 -256
- package/dist/index.d.ts +443 -333
- package/dist/index.js +5 -5
- package/dist/journalEncryption-DTyhUzaS.js +154 -0
- package/dist/{primitives-Btjhjm8P.js → primitives-DX04WTWh.js} +223 -199
- package/dist/primitives.d.ts +56 -31
- package/dist/primitives.js +2 -2
- package/dist/{src-DP-lKqaG.js → src-C2NEyUM8.js} +1111 -1053
- package/dist/{clusterDiagnostics-CGUtnJkX.js → workflowReadSelections-CZAUjP7f.js} +58 -46
- package/package.json +6 -9
- package/dist/cluster--WvQZFwk.js +0 -637
- package/dist/journalEncryption--n5VDdYO.js +0 -148
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 '
|
|
6
|
-
import { DurableQueue as durableQueueModule } from '
|
|
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 '
|
|
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 '
|
|
26
|
-
import { Workflow as workflowModule } from '
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
551
|
-
readonly success?: Schema.
|
|
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";
|
|
582
|
-
readonly
|
|
573
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
574
|
+
readonly completedAt: number;
|
|
583
575
|
readonly output: unknown;
|
|
584
576
|
readonly errorTag: string | null;
|
|
585
|
-
readonly
|
|
577
|
+
readonly errorMessage: string | null;
|
|
586
578
|
} | {
|
|
587
|
-
readonly status: "running";
|
|
588
579
|
readonly kind: "confirmed";
|
|
589
|
-
readonly
|
|
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";
|
|
622
|
-
readonly
|
|
613
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
614
|
+
readonly completedAt: number;
|
|
623
615
|
readonly output: unknown;
|
|
624
616
|
readonly errorTag: string | null;
|
|
625
|
-
readonly
|
|
617
|
+
readonly errorMessage: string | null;
|
|
626
618
|
} | {
|
|
627
|
-
readonly status: "running";
|
|
628
619
|
readonly kind: "confirmed";
|
|
629
|
-
readonly
|
|
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";
|
|
662
|
-
readonly
|
|
653
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
654
|
+
readonly completedAt: number;
|
|
663
655
|
readonly output: unknown;
|
|
664
656
|
readonly errorTag: string | null;
|
|
665
|
-
readonly
|
|
657
|
+
readonly errorMessage: string | null;
|
|
666
658
|
} | {
|
|
667
|
-
readonly status: "running";
|
|
668
659
|
readonly kind: "confirmed";
|
|
669
|
-
readonly
|
|
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";
|
|
702
|
-
readonly
|
|
693
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
694
|
+
readonly completedAt: number;
|
|
703
695
|
readonly output: unknown;
|
|
704
696
|
readonly errorTag: string | null;
|
|
705
|
-
readonly
|
|
697
|
+
readonly errorMessage: string | null;
|
|
706
698
|
} | {
|
|
707
|
-
readonly status: "running";
|
|
708
699
|
readonly kind: "confirmed";
|
|
709
|
-
readonly
|
|
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";
|
|
743
|
-
readonly
|
|
734
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
735
|
+
readonly completedAt: number;
|
|
744
736
|
readonly output: unknown;
|
|
745
737
|
readonly errorTag: string | null;
|
|
746
|
-
readonly
|
|
738
|
+
readonly errorMessage: string | null;
|
|
747
739
|
} | {
|
|
748
|
-
readonly status: "running";
|
|
749
740
|
readonly kind: "confirmed";
|
|
750
|
-
readonly
|
|
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";
|
|
793
|
-
readonly
|
|
784
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
785
|
+
readonly completedAt: number;
|
|
794
786
|
readonly output: unknown;
|
|
795
787
|
readonly errorTag: string | null;
|
|
796
|
-
readonly
|
|
788
|
+
readonly errorMessage: string | null;
|
|
797
789
|
} | {
|
|
798
|
-
readonly status: "running";
|
|
799
790
|
readonly kind: "confirmed";
|
|
800
|
-
readonly
|
|
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";
|
|
832
|
-
readonly
|
|
823
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
824
|
+
readonly completedAt: number;
|
|
833
825
|
readonly output: unknown;
|
|
834
826
|
readonly errorTag: string | null;
|
|
835
|
-
readonly
|
|
827
|
+
readonly errorMessage: string | null;
|
|
836
828
|
} | {
|
|
837
|
-
readonly status: "running";
|
|
838
829
|
readonly kind: "confirmed";
|
|
839
|
-
readonly
|
|
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";
|
|
871
|
-
readonly
|
|
862
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
863
|
+
readonly completedAt: number;
|
|
872
864
|
readonly output: unknown;
|
|
873
865
|
readonly errorTag: string | null;
|
|
874
|
-
readonly
|
|
866
|
+
readonly errorMessage: string | null;
|
|
875
867
|
} | {
|
|
876
|
-
readonly status: "running";
|
|
877
868
|
readonly kind: "confirmed";
|
|
878
|
-
readonly
|
|
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";
|
|
910
|
-
readonly
|
|
901
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
902
|
+
readonly completedAt: number;
|
|
911
903
|
readonly output: unknown;
|
|
912
904
|
readonly errorTag: string | null;
|
|
913
|
-
readonly
|
|
905
|
+
readonly errorMessage: string | null;
|
|
914
906
|
} | {
|
|
915
|
-
readonly status: "running";
|
|
916
907
|
readonly kind: "confirmed";
|
|
917
|
-
readonly
|
|
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";
|
|
949
|
-
readonly
|
|
940
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
941
|
+
readonly completedAt: number;
|
|
950
942
|
readonly output: unknown;
|
|
951
943
|
readonly errorTag: string | null;
|
|
952
|
-
readonly
|
|
944
|
+
readonly errorMessage: string | null;
|
|
953
945
|
} | {
|
|
954
|
-
readonly status: "running";
|
|
955
946
|
readonly kind: "confirmed";
|
|
956
|
-
readonly
|
|
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";
|
|
988
|
-
readonly
|
|
979
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
980
|
+
readonly completedAt: number;
|
|
989
981
|
readonly output: unknown;
|
|
990
982
|
readonly errorTag: string | null;
|
|
991
|
-
readonly
|
|
983
|
+
readonly errorMessage: string | null;
|
|
992
984
|
} | {
|
|
993
|
-
readonly status: "running";
|
|
994
985
|
readonly kind: "confirmed";
|
|
995
|
-
readonly
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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:
|
|
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:
|
|
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:
|
|
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.
|
|
1373
|
-
export declare const CurrentWorkflowRunId:
|
|
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:
|
|
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
|
|
@@ -1535,6 +1533,11 @@ export declare const deferringControlsOf: (control: ResolvedFlowControl | undefi
|
|
|
1535
1533
|
* own. Use {@link discardIntent} for a start that is being dropped. */
|
|
1536
1534
|
export declare const deleteIntent: (store: AdmissionDataStore, id: string) => Promise<boolean>;
|
|
1537
1535
|
|
|
1536
|
+
declare const Delivery: Schema.Struct<{
|
|
1537
|
+
readonly requestId: Schema.NonEmptyString;
|
|
1538
|
+
readonly restartToken: Schema.NullOr<Schema.NonEmptyString>;
|
|
1539
|
+
}>;
|
|
1540
|
+
|
|
1538
1541
|
/**
|
|
1539
1542
|
* The cluster half of a stalled run's report, built from the diagnostics: the
|
|
1540
1543
|
* run's messages and, for the unprocessed ones, who holds their shards. Pure
|
|
@@ -1656,14 +1659,12 @@ export declare const dueIntents: (store: AdmissionDataStore, now: number, limit:
|
|
|
1656
1659
|
export { durableClock }
|
|
1657
1660
|
|
|
1658
1661
|
/** Define a durable queue for concurrency-controlled side work. */
|
|
1659
|
-
export declare const durableQueue: typeof
|
|
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] & {
|
|
1660
1663
|
readonly encrypted?: boolean;
|
|
1661
|
-
}
|
|
1664
|
+
}) => ReturnType<typeof durableQueueModule.make<Payload, Success, Error>>;
|
|
1662
1665
|
|
|
1663
1666
|
export { durableQueueModule }
|
|
1664
1667
|
|
|
1665
|
-
export { durableRateLimiterModule }
|
|
1666
|
-
|
|
1667
1668
|
/** Establish the body-entry owner before running application code. Existing
|
|
1668
1669
|
* execution identity retains its run ID and original input; return the previous
|
|
1669
1670
|
* snapshot so crash/version guards decide from the state they actually replaced.
|
|
@@ -1718,31 +1719,33 @@ declare type Execute = (payload: unknown, executionId: string, discard: boolean)
|
|
|
1718
1719
|
* the typed body result under that same ID and preserves its failure channel.
|
|
1719
1720
|
* Record acceptance before joining; body completion is a separate event.
|
|
1720
1721
|
* Ordinary starts do not opt into this capability automatically. */
|
|
1721
|
-
export declare const executePreparedWorkflow: <Payload extends Schema.
|
|
1722
|
+
export declare const executePreparedWorkflow: <Payload extends Schema.Top, Success extends Schema.Top, Error extends Schema.Top, Discard extends boolean = true>(definition: {
|
|
1722
1723
|
readonly payloadSchema: Payload;
|
|
1723
1724
|
readonly successSchema: Success;
|
|
1724
1725
|
readonly errorSchema: Error;
|
|
1725
1726
|
}, payload: Payload["Type"], executionId: string, options?: {
|
|
1726
1727
|
readonly discard: Discard;
|
|
1727
|
-
}) => Effect.Effect<Discard extends true ? string : Success["Type"], Error["Type"], WorkflowEngine.WorkflowEngine | Payload["
|
|
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;
|
|
1728
1731
|
|
|
1729
1732
|
declare const FailureRecordSchema: Schema.Struct<{
|
|
1730
|
-
id:
|
|
1731
|
-
workflowName:
|
|
1732
|
-
tenantId: Schema.NullOr<
|
|
1733
|
-
sourceId:
|
|
1734
|
-
sourceKind: Schema.
|
|
1735
|
-
handler: Schema.NullOr<
|
|
1736
|
-
callerContext:
|
|
1737
|
-
report: Schema.Struct<{
|
|
1738
|
-
workflow:
|
|
1739
|
-
payload:
|
|
1740
|
-
errorTag: Schema.NullOr<
|
|
1741
|
-
errorMessage: Schema.NullOr<
|
|
1742
|
-
runId: Schema.NullOr<
|
|
1743
|
-
executionId: Schema.NullOr<
|
|
1744
|
-
reason:
|
|
1745
|
-
failedAt:
|
|
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;
|
|
1746
1749
|
}>;
|
|
1747
1750
|
}>;
|
|
1748
1751
|
|
|
@@ -1758,7 +1761,7 @@ export declare class FlowControlKeyError extends Error {
|
|
|
1758
1761
|
/** A duration in any shape Effect accepts: `'15 minutes'`, `900_000`,
|
|
1759
1762
|
* `Duration.minutes(15)`. Same input type `sleep({ duration })` takes, so
|
|
1760
1763
|
* there is one duration vocabulary in the whole workflow surface. */
|
|
1761
|
-
export declare type FlowDuration = Duration.
|
|
1764
|
+
export declare type FlowDuration = Duration.Input;
|
|
1762
1765
|
|
|
1763
1766
|
/** Try to read the current workflow execution id. Returns undefined
|
|
1764
1767
|
* when called outside a recorded workflow body. */
|
|
@@ -1819,7 +1822,8 @@ export declare interface InMemoryRecorder {
|
|
|
1819
1822
|
readonly readEvents: () => ReadonlyArray<RecordedEvent>;
|
|
1820
1823
|
}
|
|
1821
1824
|
|
|
1822
|
-
|
|
1825
|
+
/** `rateLimit()` counts on the `RateLimiter` service; in memory it is per process. */
|
|
1826
|
+
export declare const inMemoryWorkflowEngineLayer: Layer.Layer<WorkflowEngine.WorkflowEngine | RateLimiter.RateLimiter>;
|
|
1823
1827
|
|
|
1824
1828
|
export declare interface InspectedStep {
|
|
1825
1829
|
readonly name: string;
|
|
@@ -1874,6 +1878,10 @@ export declare interface InspectStore {
|
|
|
1874
1878
|
*/
|
|
1875
1879
|
export declare const inspectWorkflow: (idOrExecutionId: string, store: InspectStore) => Promise<InspectedWorkflow | null>;
|
|
1876
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
|
+
|
|
1877
1885
|
/**
|
|
1878
1886
|
* Has an admitted run outlived `timeouts.finish`?
|
|
1879
1887
|
*
|
|
@@ -2002,7 +2010,7 @@ export declare type NondeterminismKind = 'unreached-step' | 'extra-step-occurren
|
|
|
2002
2010
|
declare type NormaliseWorkflowMessages<M extends WorkflowMessageSchemas | undefined> = {
|
|
2003
2011
|
readonly signals: M extends {
|
|
2004
2012
|
readonly signals: infer Signals;
|
|
2005
|
-
} ? NonNullable<Signals> & Readonly<Record<string, Schema.
|
|
2013
|
+
} ? NonNullable<Signals> & Readonly<Record<string, Schema.Top>> : {};
|
|
2006
2014
|
readonly updates: M extends {
|
|
2007
2015
|
readonly updates: infer Updates;
|
|
2008
2016
|
} ? NonNullable<Updates> & Readonly<Record<string, WorkflowMessagePairSchemas>> : {};
|
|
@@ -2121,7 +2129,7 @@ export declare interface ParkDelayedStartInput {
|
|
|
2121
2129
|
* however many times it replays and whatever the deployed code says — which is
|
|
2122
2130
|
* the property that makes the branch deterministic across a redeploy.
|
|
2123
2131
|
*
|
|
2124
|
-
* Under
|
|
2132
|
+
* Under `effect/workflow` the naive implementation does the opposite: an
|
|
2125
2133
|
* activity that is ABSENT from an old run's journal EXECUTES on replay (the
|
|
2126
2134
|
* journal is keyed name/attempt), so a marker journaled by an activity would
|
|
2127
2135
|
* answer `true` for exactly the old runs it must answer `false` for. Reading
|
|
@@ -2323,8 +2331,26 @@ export declare const queuedCancellationRequestsTable: SchemaTable;
|
|
|
2323
2331
|
* inferred type) is what emits in the `.d.ts`, so it stays portable. */
|
|
2324
2332
|
export declare const queueWorker: typeof durableQueueModule.worker;
|
|
2325
2333
|
|
|
2326
|
-
/**
|
|
2327
|
-
|
|
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
|
+
}
|
|
2328
2354
|
|
|
2329
2355
|
/**
|
|
2330
2356
|
* Read exactly the state the declared controls need — no more.
|
|
@@ -2384,26 +2410,13 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
|
|
|
2384
2410
|
readonly selection: WorkflowRestartSelection;
|
|
2385
2411
|
}) => Promise<{
|
|
2386
2412
|
readonly id: string;
|
|
2387
|
-
readonly tenantId: string | null;
|
|
2388
|
-
readonly token: string;
|
|
2389
|
-
readonly generation: string;
|
|
2390
2413
|
readonly runId: string;
|
|
2391
|
-
readonly requestedAt: Date;
|
|
2392
|
-
readonly executionId: string;
|
|
2393
2414
|
readonly workflowName: string;
|
|
2394
|
-
readonly
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
readonly kind: "from-step";
|
|
2398
|
-
readonly stepName: string;
|
|
2399
|
-
};
|
|
2400
|
-
readonly dispatchAttempts: number;
|
|
2401
|
-
readonly enteredGeneration: string | null;
|
|
2415
|
+
readonly executionId: string;
|
|
2416
|
+
readonly generation: string;
|
|
2417
|
+
readonly token: string;
|
|
2402
2418
|
readonly ledgerId: string;
|
|
2403
|
-
readonly
|
|
2404
|
-
readonly runId: string;
|
|
2405
|
-
readonly executionId: string;
|
|
2406
|
-
} | null;
|
|
2419
|
+
readonly tenantId: string | null;
|
|
2407
2420
|
readonly delivery: {
|
|
2408
2421
|
readonly requestId: string;
|
|
2409
2422
|
readonly restartToken: string | null;
|
|
@@ -2412,6 +2425,19 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
|
|
|
2412
2425
|
readonly requestId: string;
|
|
2413
2426
|
readonly replyId: string;
|
|
2414
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;
|
|
2415
2441
|
} | undefined>;
|
|
2416
2442
|
|
|
2417
2443
|
/** Read-only reconciliation. No observation of engine replies, admission,
|
|
@@ -2431,34 +2457,34 @@ export declare const readWorkflowStartRequest: (store: Pick<DataStore, "query">,
|
|
|
2431
2457
|
readonly requestFingerprint: string;
|
|
2432
2458
|
}) => Promise<WorkflowStartReceipt | undefined>;
|
|
2433
2459
|
|
|
2434
|
-
declare const ReceiptSchema: Schema.
|
|
2435
|
-
id:
|
|
2436
|
-
workflowName:
|
|
2437
|
-
tenantId: Schema.NullOr<
|
|
2438
|
-
pendingId:
|
|
2439
|
-
submissionId: Schema.NullOr<
|
|
2440
|
-
terminal: Schema.NullOr<Schema.Union<[Schema.Struct<{
|
|
2441
|
-
kind: Schema.Literal<
|
|
2442
|
-
at:
|
|
2443
|
-
retryAfterMs:
|
|
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;
|
|
2444
2470
|
}>, Schema.Struct<{
|
|
2445
|
-
kind: Schema.Literal<
|
|
2446
|
-
at:
|
|
2447
|
-
executionId:
|
|
2448
|
-
runId:
|
|
2471
|
+
readonly kind: Schema.Literal<"skipped">;
|
|
2472
|
+
readonly at: Schema.Number;
|
|
2473
|
+
readonly executionId: Schema.String;
|
|
2474
|
+
readonly runId: Schema.String;
|
|
2449
2475
|
}>, Schema.Struct<{
|
|
2450
|
-
kind: Schema.Literal<
|
|
2451
|
-
at:
|
|
2476
|
+
readonly kind: Schema.Literal<"superseded">;
|
|
2477
|
+
readonly at: Schema.Number;
|
|
2452
2478
|
}>, Schema.Struct<{
|
|
2453
|
-
kind: Schema.Literal<
|
|
2454
|
-
at:
|
|
2479
|
+
readonly kind: Schema.Literal<"cancelled">;
|
|
2480
|
+
readonly at: Schema.Number;
|
|
2455
2481
|
}>, Schema.Struct<{
|
|
2456
|
-
kind: Schema.Literal<
|
|
2457
|
-
at:
|
|
2458
|
-
failureId:
|
|
2482
|
+
readonly kind: Schema.Literal<"abandoned">;
|
|
2483
|
+
readonly at: Schema.Number;
|
|
2484
|
+
readonly failureId: Schema.NonEmptyString;
|
|
2459
2485
|
}>]>>;
|
|
2460
|
-
requestFingerprint: Schema.optional<Schema.NullOr<Schema.
|
|
2461
|
-
}
|
|
2486
|
+
readonly requestFingerprint: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
2487
|
+
}>;
|
|
2462
2488
|
|
|
2463
2489
|
/** Reconcile under the resident admission lock. Only a terminal pre-admission
|
|
2464
2490
|
* drop/skip/supersession or proven pre-engine rejection permits a new arrival. Preserve every previous receipt and
|
|
@@ -2612,6 +2638,11 @@ export declare interface ReplayShapeTracker {
|
|
|
2612
2638
|
readonly settle: () => ReadonlyArray<NondeterminismFinding>;
|
|
2613
2639
|
}
|
|
2614
2640
|
|
|
2641
|
+
declare const Reply: Schema.Struct<{
|
|
2642
|
+
readonly requestId: Schema.NonEmptyString;
|
|
2643
|
+
readonly replyId: Schema.NonEmptyString;
|
|
2644
|
+
}>;
|
|
2645
|
+
|
|
2615
2646
|
/**
|
|
2616
2647
|
* Emit findings from INSIDE the workflow body, where the run id and the
|
|
2617
2648
|
* recorder are only reachable through the fiber context.
|
|
@@ -2623,39 +2654,39 @@ export declare interface ReplayShapeTracker {
|
|
|
2623
2654
|
export declare const reportNondeterminism: (findings: ReadonlyArray<NondeterminismFinding>) => Effect.Effect<void>;
|
|
2624
2655
|
|
|
2625
2656
|
declare const RequestSchema: Schema.Struct<{
|
|
2626
|
-
id: Schema.
|
|
2627
|
-
runId: Schema.
|
|
2628
|
-
workflowName: Schema.
|
|
2629
|
-
executionId: Schema.
|
|
2630
|
-
generation: Schema.
|
|
2631
|
-
operation: Schema.
|
|
2632
|
-
requestedAt: Schema.
|
|
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;
|
|
2633
2664
|
/** Null means no proven owner, not a null-tenant owner. */
|
|
2634
|
-
owner: Schema.NullOr<Schema.Struct<{
|
|
2635
|
-
tenantId: Schema.NullOr<
|
|
2665
|
+
readonly owner: Schema.NullOr<Schema.Struct<{
|
|
2666
|
+
readonly tenantId: Schema.NullOr<Schema.String>;
|
|
2636
2667
|
}>>;
|
|
2637
|
-
cause: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
2638
|
-
reason:
|
|
2639
|
-
detail: Schema.optional<Schema
|
|
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>>;
|
|
2640
2671
|
}>>>;
|
|
2641
|
-
dispatchAttempts: Schema.
|
|
2642
|
-
resumeJournal: Schema.NullOr<Schema.Struct<{
|
|
2643
|
-
requestId: Schema.
|
|
2644
|
-
replyId: Schema.
|
|
2645
|
-
restartToken: Schema.NullOr<
|
|
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>;
|
|
2646
2677
|
}>>;
|
|
2647
|
-
result: Schema.NullOr<Schema.Union<[Schema.Struct<{
|
|
2648
|
-
kind: Schema.
|
|
2649
|
-
status: Schema.
|
|
2650
|
-
completedAt: Schema.
|
|
2651
|
-
output:
|
|
2652
|
-
errorTag: Schema.NullOr<
|
|
2653
|
-
errorMessage: Schema.NullOr<
|
|
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>;
|
|
2654
2685
|
}>, Schema.Struct<{
|
|
2655
|
-
kind: Schema.Literal<
|
|
2656
|
-
status: Schema.Literal<
|
|
2657
|
-
enteredAt: Schema.
|
|
2658
|
-
generation: Schema.
|
|
2686
|
+
readonly kind: Schema.Literal<"confirmed">;
|
|
2687
|
+
readonly status: Schema.Literal<"running">;
|
|
2688
|
+
readonly enteredAt: Schema.Number;
|
|
2689
|
+
readonly generation: Schema.String;
|
|
2659
2690
|
}>]>>;
|
|
2660
2691
|
}>;
|
|
2661
2692
|
|
|
@@ -2698,6 +2729,84 @@ export declare type ReserveAdmissionSubmissionResult = {
|
|
|
2698
2729
|
}>;
|
|
2699
2730
|
};
|
|
2700
2731
|
|
|
2732
|
+
/** Caller already holds the physical resident admission transaction. Selection
|
|
2733
|
+
* and identities are captured before journal I/O; retries cannot retarget them.
|
|
2734
|
+
* Capacity rejection writes neither a request nor a reservation. */
|
|
2735
|
+
export declare const reserveWorkflowRestartInTransaction: (tx: AdmissionDataStore, input: {
|
|
2736
|
+
readonly id: string;
|
|
2737
|
+
readonly runId: string;
|
|
2738
|
+
readonly generation: string;
|
|
2739
|
+
readonly token: string;
|
|
2740
|
+
readonly delivery: typeof Delivery.Type;
|
|
2741
|
+
readonly replies: ReadonlyArray<typeof Reply.Type>;
|
|
2742
|
+
readonly selection: WorkflowRestartSelection;
|
|
2743
|
+
readonly control: ResolvedFlowControl;
|
|
2744
|
+
readonly tenantId: string | null;
|
|
2745
|
+
readonly paused: boolean;
|
|
2746
|
+
readonly now: number;
|
|
2747
|
+
}) => Promise<{
|
|
2748
|
+
kind: "reserved";
|
|
2749
|
+
request: {
|
|
2750
|
+
readonly id: string;
|
|
2751
|
+
readonly runId: string;
|
|
2752
|
+
readonly workflowName: string;
|
|
2753
|
+
readonly executionId: string;
|
|
2754
|
+
readonly generation: string;
|
|
2755
|
+
readonly token: string;
|
|
2756
|
+
readonly ledgerId: string;
|
|
2757
|
+
readonly tenantId: string | null;
|
|
2758
|
+
readonly delivery: {
|
|
2759
|
+
readonly requestId: string;
|
|
2760
|
+
readonly restartToken: string | null;
|
|
2761
|
+
};
|
|
2762
|
+
readonly replies: readonly {
|
|
2763
|
+
readonly requestId: string;
|
|
2764
|
+
readonly replyId: string;
|
|
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;
|
|
2779
|
+
};
|
|
2780
|
+
reused: boolean;
|
|
2781
|
+
decision?: never;
|
|
2782
|
+
} | {
|
|
2783
|
+
kind: "already-requested";
|
|
2784
|
+
request?: never;
|
|
2785
|
+
reused?: never;
|
|
2786
|
+
decision?: never;
|
|
2787
|
+
} | {
|
|
2788
|
+
kind: "not-admitted";
|
|
2789
|
+
decision: {
|
|
2790
|
+
readonly kind: "defer";
|
|
2791
|
+
readonly mode: DeferMode;
|
|
2792
|
+
readonly dueAt: number;
|
|
2793
|
+
readonly deadlineAt?: number;
|
|
2794
|
+
readonly collapse: "replace" | "append" | "hold";
|
|
2795
|
+
readonly keys: AdmissionKeys;
|
|
2796
|
+
} | {
|
|
2797
|
+
readonly kind: "drop";
|
|
2798
|
+
readonly reason: "rate-limit";
|
|
2799
|
+
readonly retryAfterMs: number;
|
|
2800
|
+
readonly keys: AdmissionKeys;
|
|
2801
|
+
} | {
|
|
2802
|
+
readonly kind: "skip";
|
|
2803
|
+
readonly incumbent: AdmissionIncumbent;
|
|
2804
|
+
readonly keys: AdmissionKeys;
|
|
2805
|
+
};
|
|
2806
|
+
request?: never;
|
|
2807
|
+
reused?: never;
|
|
2808
|
+
}>;
|
|
2809
|
+
|
|
2701
2810
|
/** Test seam: forget which (workflow, signal) pairs have been hinted. */
|
|
2702
2811
|
export declare const resetSuspendHintsForTest: () => void;
|
|
2703
2812
|
|
|
@@ -2713,7 +2822,7 @@ export declare const resolveAdmissionKeys: (control: ResolvedFlowControl, payloa
|
|
|
2713
2822
|
* event at all". */
|
|
2714
2823
|
export declare interface ResolvedCancelOn {
|
|
2715
2824
|
readonly event: string;
|
|
2716
|
-
readonly schema: Schema.
|
|
2825
|
+
readonly schema: Schema.Top;
|
|
2717
2826
|
readonly match: (event: unknown, payload: unknown) => boolean;
|
|
2718
2827
|
readonly withinMs?: number;
|
|
2719
2828
|
readonly reason: string;
|
|
@@ -2829,11 +2938,11 @@ export declare const retryDeadLetterIntent: (store: AdmissionDataStore, intentId
|
|
|
2829
2938
|
*/
|
|
2830
2939
|
export declare const sealJournalValue: (value: unknown, what: string, binding?: FieldBinding) => unknown;
|
|
2831
2940
|
|
|
2832
|
-
declare const Selection: Schema.Union<[Schema.Struct<{
|
|
2833
|
-
kind: Schema.Literal<
|
|
2941
|
+
declare const Selection: Schema.Union<readonly [Schema.Struct<{
|
|
2942
|
+
readonly kind: Schema.Literal<"failed-steps">;
|
|
2834
2943
|
}>, Schema.Struct<{
|
|
2835
|
-
kind: Schema.Literal<
|
|
2836
|
-
stepName: Schema.
|
|
2944
|
+
readonly kind: Schema.Literal<"from-step">;
|
|
2945
|
+
readonly stepName: Schema.NonEmptyString;
|
|
2837
2946
|
}>]>;
|
|
2838
2947
|
|
|
2839
2948
|
export declare const sendWorkflowSignal: (input: {
|
|
@@ -3053,7 +3162,7 @@ export declare type StallReason =
|
|
|
3053
3162
|
* returns, or a runner that vanished without the reclaim path noticing. */
|
|
3054
3163
|
| 'no-progress';
|
|
3055
3164
|
|
|
3056
|
-
export declare const step: <R, Success extends Schema.
|
|
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>>;
|
|
3057
3166
|
|
|
3058
3167
|
/** The address the step journal's values are sealed to (`encrypted` via the
|
|
3059
3168
|
* recorder's `encryptStepPayload`). ONE definition, shared with the CLI. */
|
|
@@ -3076,7 +3185,7 @@ export { stepModule }
|
|
|
3076
3185
|
/**
|
|
3077
3186
|
* Define a checkpointed step (activity) inside a workflow body.
|
|
3078
3187
|
*
|
|
3079
|
-
* Wraps
|
|
3188
|
+
* Wraps `effect/workflow`'s `Activity.make` to record every
|
|
3080
3189
|
* invocation in `_voltro_workflow_run_steps`. The wrapping is
|
|
3081
3190
|
* transparent — accepts everything `Activity.make` accepts, plus an
|
|
3082
3191
|
* optional `input` field whose value is persisted to the step row
|
|
@@ -3095,7 +3204,7 @@ export { stepModule }
|
|
|
3095
3204
|
* Without the recorder service in scope (unit tests, etc.) the input
|
|
3096
3205
|
* is dropped and the wrap is a no-op.
|
|
3097
3206
|
*/
|
|
3098
|
-
declare type StepOptions<R, Success extends Schema.
|
|
3207
|
+
declare type StepOptions<R, Success extends Schema.Top, Error extends Schema.Top> = {
|
|
3099
3208
|
readonly name: string;
|
|
3100
3209
|
readonly success?: Success | undefined;
|
|
3101
3210
|
readonly error?: Error | undefined;
|
|
@@ -3162,28 +3271,28 @@ export declare interface StepRetryPolicy {
|
|
|
3162
3271
|
declare type Store = Pick<DataStore, 'query' | 'insert' | 'update'>;
|
|
3163
3272
|
|
|
3164
3273
|
declare const SubmissionSchema: Schema.Struct<{
|
|
3165
|
-
id:
|
|
3166
|
-
workflowName:
|
|
3167
|
-
tenantId: Schema.NullOr<
|
|
3168
|
-
ledgerId:
|
|
3169
|
-
preparedExecutionId: Schema.NullOr<
|
|
3170
|
-
executionId: Schema.NullOr<
|
|
3171
|
-
runId: Schema.NullOr<
|
|
3172
|
-
receiptsBound:
|
|
3173
|
-
dispatchAttempts: Schema.
|
|
3174
|
-
failureId: Schema.NullOr<
|
|
3175
|
-
retry: Schema.Struct<{
|
|
3176
|
-
attempts:
|
|
3177
|
-
after:
|
|
3178
|
-
lastError: Schema.NullOr<
|
|
3179
|
-
stoppedAt: Schema.NullOr<
|
|
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>;
|
|
3180
3289
|
}>;
|
|
3181
|
-
payload:
|
|
3182
|
-
callerContext:
|
|
3183
|
-
intentIds: Schema
|
|
3184
|
-
eviction: Schema.NullOr<Schema.Struct<{
|
|
3185
|
-
executionId:
|
|
3186
|
-
runId:
|
|
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;
|
|
3187
3296
|
}>>;
|
|
3188
3297
|
}>;
|
|
3189
3298
|
|
|
@@ -3261,10 +3370,7 @@ export declare interface SuspendHintInput {
|
|
|
3261
3370
|
*/
|
|
3262
3371
|
export declare const suspendingSignalDeferredName: (workflowName: string, signalName: string) => string;
|
|
3263
3372
|
|
|
3264
|
-
export declare
|
|
3265
|
-
}
|
|
3266
|
-
|
|
3267
|
-
declare const SuspensionUnavailable_base: Context.ReferenceClass<SuspensionUnavailable, "@voltro/workflow/SuspensionUnavailable", string | undefined>;
|
|
3373
|
+
export declare const SuspensionUnavailable: Context.Reference<string | undefined>;
|
|
3268
3374
|
|
|
3269
3375
|
/**
|
|
3270
3376
|
* One cancellation tick. Never throws.
|
|
@@ -3291,27 +3397,27 @@ export declare const sweepStalledRuns: (deps: StalenessSweepDeps, options?: Stal
|
|
|
3291
3397
|
* The caller supplies the encoded payload derived under this same lock. */
|
|
3292
3398
|
export declare const takeAdmittedSubmissionInTransaction: (tx: AdmissionDataStore, input: Parameters<typeof persistReservedSubmission>[1]) => Promise<{
|
|
3293
3399
|
readonly id: string;
|
|
3400
|
+
readonly workflowName: string;
|
|
3294
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;
|
|
3295
3409
|
readonly retry: {
|
|
3296
|
-
readonly lastError: string | null;
|
|
3297
3410
|
readonly attempts: number;
|
|
3298
3411
|
readonly after: number;
|
|
3412
|
+
readonly lastError: string | null;
|
|
3299
3413
|
readonly stoppedAt: number | null;
|
|
3300
3414
|
};
|
|
3301
3415
|
readonly payload: unknown;
|
|
3302
|
-
readonly runId: string | null;
|
|
3303
|
-
readonly executionId: string | null;
|
|
3304
|
-
readonly failureId: string | null;
|
|
3305
|
-
readonly workflowName: string;
|
|
3306
|
-
readonly dispatchAttempts: number;
|
|
3307
3416
|
readonly callerContext: unknown;
|
|
3308
3417
|
readonly intentIds: readonly string[];
|
|
3309
|
-
readonly ledgerId: string;
|
|
3310
|
-
readonly receiptsBound: boolean;
|
|
3311
|
-
readonly preparedExecutionId: string | null;
|
|
3312
3418
|
readonly eviction: {
|
|
3313
|
-
readonly runId: string;
|
|
3314
3419
|
readonly executionId: string;
|
|
3420
|
+
readonly runId: string;
|
|
3315
3421
|
} | null;
|
|
3316
3422
|
}>;
|
|
3317
3423
|
|
|
@@ -3324,10 +3430,10 @@ export declare const takePendingAdmissionSubmission: (store: Pick<DataStore, "in
|
|
|
3324
3430
|
}>;
|
|
3325
3431
|
|
|
3326
3432
|
declare const Target: Schema.Struct<{
|
|
3327
|
-
requestId:
|
|
3328
|
-
receiptId:
|
|
3329
|
-
workflowName:
|
|
3330
|
-
tenantId: Schema.NullOr<
|
|
3433
|
+
readonly requestId: Schema.NonEmptyString;
|
|
3434
|
+
readonly receiptId: Schema.NonEmptyString;
|
|
3435
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
3436
|
+
readonly tenantId: Schema.NullOr<Schema.String>;
|
|
3331
3437
|
}>;
|
|
3332
3438
|
|
|
3333
3439
|
export declare const truncateWorkflowValue: (value: unknown, bytes?: number) => unknown;
|
|
@@ -3481,9 +3587,9 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
|
|
|
3481
3587
|
kind: "withdrawn";
|
|
3482
3588
|
withdrawal: {
|
|
3483
3589
|
readonly id: string;
|
|
3484
|
-
readonly tenantId: string | null;
|
|
3485
3590
|
readonly runId: string;
|
|
3486
3591
|
readonly workflowName: string;
|
|
3592
|
+
readonly tenantId: string | null;
|
|
3487
3593
|
readonly selection: {
|
|
3488
3594
|
readonly kind: "failed-steps";
|
|
3489
3595
|
} | {
|
|
@@ -3498,26 +3604,13 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
|
|
|
3498
3604
|
kind: "reserved";
|
|
3499
3605
|
request: {
|
|
3500
3606
|
readonly id: string;
|
|
3501
|
-
readonly tenantId: string | null;
|
|
3502
|
-
readonly token: string;
|
|
3503
|
-
readonly generation: string;
|
|
3504
3607
|
readonly runId: string;
|
|
3505
|
-
readonly requestedAt: Date;
|
|
3506
|
-
readonly executionId: string;
|
|
3507
3608
|
readonly workflowName: string;
|
|
3508
|
-
readonly
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
readonly kind: "from-step";
|
|
3512
|
-
readonly stepName: string;
|
|
3513
|
-
};
|
|
3514
|
-
readonly dispatchAttempts: number;
|
|
3515
|
-
readonly enteredGeneration: string | null;
|
|
3609
|
+
readonly executionId: string;
|
|
3610
|
+
readonly generation: string;
|
|
3611
|
+
readonly token: string;
|
|
3516
3612
|
readonly ledgerId: string;
|
|
3517
|
-
readonly
|
|
3518
|
-
readonly runId: string;
|
|
3519
|
-
readonly executionId: string;
|
|
3520
|
-
} | null;
|
|
3613
|
+
readonly tenantId: string | null;
|
|
3521
3614
|
readonly delivery: {
|
|
3522
3615
|
readonly requestId: string;
|
|
3523
3616
|
readonly restartToken: string | null;
|
|
@@ -3526,6 +3619,19 @@ export declare const withdrawWorkflowRestartInTransaction: (tx: AdmissionDataSto
|
|
|
3526
3619
|
readonly requestId: string;
|
|
3527
3620
|
readonly replyId: string;
|
|
3528
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;
|
|
3529
3635
|
};
|
|
3530
3636
|
withdrawal?: never;
|
|
3531
3637
|
reused?: never;
|
|
@@ -3543,7 +3649,9 @@ export declare const workflow: WorkflowFn;
|
|
|
3543
3649
|
*/
|
|
3544
3650
|
export declare const WORKFLOW_JOURNAL_BINDING: FieldBinding;
|
|
3545
3651
|
|
|
3546
|
-
declare type WorkflowBaseOptions = Parameters<WorkflowMake>[
|
|
3652
|
+
declare type WorkflowBaseOptions = Parameters<WorkflowMake>[1] & {
|
|
3653
|
+
readonly name: Parameters<WorkflowMake>[0];
|
|
3654
|
+
};
|
|
3547
3655
|
|
|
3548
3656
|
/**
|
|
3549
3657
|
* Collect many starts into ONE run over an array of items.
|
|
@@ -3602,7 +3710,7 @@ export declare interface WorkflowBatch<Item> {
|
|
|
3602
3710
|
* }],
|
|
3603
3711
|
* ```
|
|
3604
3712
|
*/
|
|
3605
|
-
export declare interface WorkflowCancelOn<EventSchema extends Schema.
|
|
3713
|
+
export declare interface WorkflowCancelOn<EventSchema extends Schema.Top, Payload> {
|
|
3606
3714
|
/** The event NAME, exactly as `ctx.events.publish` writes it. */
|
|
3607
3715
|
readonly event: string;
|
|
3608
3716
|
/** Decoded before `match` sees it, so the predicate reads the domain type
|
|
@@ -3636,7 +3744,7 @@ export declare interface WorkflowCancelOn<EventSchema extends Schema.Schema.Any,
|
|
|
3636
3744
|
* the per-entry-inferred {@link WorkflowCancelOnList}; this is what survives
|
|
3637
3745
|
* erasure, and it is deliberately not the public spelling. */
|
|
3638
3746
|
export declare interface WorkflowCancelOnDeclared {
|
|
3639
|
-
readonly cancelOn?: ReadonlyArray<WorkflowCancelOn<Schema.
|
|
3747
|
+
readonly cancelOn?: ReadonlyArray<WorkflowCancelOn<Schema.Top, never>>;
|
|
3640
3748
|
}
|
|
3641
3749
|
|
|
3642
3750
|
/** The `cancelOn` array as declared, with each entry's event type inferred
|
|
@@ -3644,7 +3752,7 @@ export declare interface WorkflowCancelOnDeclared {
|
|
|
3644
3752
|
* per-entry inference work — a plain `ReadonlyArray<WorkflowCancelOn<…>>`
|
|
3645
3753
|
* collapses every entry's event to the constraint (`any`), which is how the
|
|
3646
3754
|
* predicate silently stops being checked. */
|
|
3647
|
-
export declare type WorkflowCancelOnList<Cancels extends ReadonlyArray<Schema.
|
|
3755
|
+
export declare type WorkflowCancelOnList<Cancels extends ReadonlyArray<Schema.Top>, Payload> = {
|
|
3648
3756
|
readonly [I in keyof Cancels]: WorkflowCancelOn<Cancels[I], Payload>;
|
|
3649
3757
|
};
|
|
3650
3758
|
|
|
@@ -3955,7 +4063,7 @@ export declare const WorkflowFlowControlProperty = "__voltroWorkflowFlowControl"
|
|
|
3955
4063
|
* meaning anything if this ever regresses to `any` — which is precisely what
|
|
3956
4064
|
* all three failed attempts did.
|
|
3957
4065
|
*/
|
|
3958
|
-
declare type WorkflowFn = <const Name extends string, Payload extends WorkflowPayloadInput, Success extends Schema.
|
|
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: {
|
|
3959
4067
|
readonly name: Name;
|
|
3960
4068
|
readonly payload: Payload;
|
|
3961
4069
|
readonly idempotencyKey: (payload: DecodedPayload<Payload>) => string;
|
|
@@ -3973,13 +4081,15 @@ declare type WorkflowFn = <const Name extends string, Payload extends WorkflowPa
|
|
|
3973
4081
|
readonly schedule?: WorkflowScheduleDeclaration<DecodedPayload<Payload>>;
|
|
3974
4082
|
} & Omit<WorkflowBaseOptions, 'name' | 'payload' | 'idempotencyKey' | 'success' | 'error'> & WorkflowVersionOptions & {
|
|
3975
4083
|
readonly messages?: Messages;
|
|
3976
|
-
} & WorkflowFlowControl<DecodedPayload<Payload>> & WorkflowAccessOptions<DecodedPayload<Payload>>) => workflowModule.Workflow<Name, PayloadSchemaOf<Payload>, Success, Error> &
|
|
4084
|
+
} & WorkflowFlowControl<DecodedPayload<Payload>> & WorkflowAccessOptions<DecodedPayload<Payload>>) => workflowModule.Workflow<Name, PayloadSchemaOf<Payload>, Success, Error> & {
|
|
4085
|
+
readonly name: Name;
|
|
4086
|
+
} & WorkflowMessagesCarrier<NormaliseWorkflowMessages<Messages>>;
|
|
3977
4087
|
|
|
3978
4088
|
declare type WorkflowMake = typeof workflowModule.make;
|
|
3979
4089
|
|
|
3980
4090
|
export declare interface WorkflowMessagePairSchemas {
|
|
3981
|
-
readonly payload: Schema.
|
|
3982
|
-
readonly success: Schema.
|
|
4091
|
+
readonly payload: Schema.Top;
|
|
4092
|
+
readonly success: Schema.Top;
|
|
3983
4093
|
}
|
|
3984
4094
|
|
|
3985
4095
|
export declare interface WorkflowMessagesCarrier<M extends WorkflowMessagesMetadata = WorkflowMessagesMetadata> {
|
|
@@ -3997,12 +4107,12 @@ export declare interface WorkflowMessagesCarrier<M extends WorkflowMessagesMetad
|
|
|
3997
4107
|
* and updates (synchronous, with a result) are the channels that exist.
|
|
3998
4108
|
*/
|
|
3999
4109
|
export declare interface WorkflowMessageSchemas {
|
|
4000
|
-
readonly signals?: Readonly<Record<string, Schema.
|
|
4110
|
+
readonly signals?: Readonly<Record<string, Schema.Top>>;
|
|
4001
4111
|
readonly updates?: Readonly<Record<string, WorkflowMessagePairSchemas>>;
|
|
4002
4112
|
}
|
|
4003
4113
|
|
|
4004
4114
|
export declare interface WorkflowMessagesMetadata {
|
|
4005
|
-
readonly signals: Readonly<Record<string, Schema.
|
|
4115
|
+
readonly signals: Readonly<Record<string, Schema.Top>>;
|
|
4006
4116
|
readonly updates: Readonly<Record<string, WorkflowMessagePairSchemas>>;
|
|
4007
4117
|
}
|
|
4008
4118
|
|
|
@@ -4220,7 +4330,7 @@ declare interface WorkflowRunOutcome {
|
|
|
4220
4330
|
export declare class WorkflowRunRecorder extends WorkflowRunRecorder_base {
|
|
4221
4331
|
}
|
|
4222
4332
|
|
|
4223
|
-
declare const WorkflowRunRecorder_base: Context.
|
|
4333
|
+
declare const WorkflowRunRecorder_base: Context.ServiceClass<WorkflowRunRecorder, "@voltro/WorkflowRunRecorder", WorkflowRunRecorderService>;
|
|
4224
4334
|
|
|
4225
4335
|
export declare interface WorkflowRunRecorderOptions {
|
|
4226
4336
|
readonly store: WorkflowRecordingStore;
|
|
@@ -4453,7 +4563,7 @@ export declare type WorkflowStartResolution = {
|
|
|
4453
4563
|
* Receives the user's `execute` Effect + a `WorkflowStepContext`
|
|
4454
4564
|
* carrying `{ runId, stepName, attempt }`. Returns a wrapped Effect.
|
|
4455
4565
|
* A FAIL inside the interceptor abort the step the same way a fail
|
|
4456
|
-
* in the user effect would — including triggering
|
|
4566
|
+
* in the user effect would — including triggering effect/workflow's
|
|
4457
4567
|
* retry policy.
|
|
4458
4568
|
*/
|
|
4459
4569
|
export declare interface WorkflowStepContext {
|
|
@@ -4479,7 +4589,7 @@ export declare interface WorkflowStepInterceptorService {
|
|
|
4479
4589
|
export declare class WorkflowStepInterceptorTag extends WorkflowStepInterceptorTag_base {
|
|
4480
4590
|
}
|
|
4481
4591
|
|
|
4482
|
-
declare const WorkflowStepInterceptorTag_base: Context.
|
|
4592
|
+
declare const WorkflowStepInterceptorTag_base: Context.ServiceClass<WorkflowStepInterceptorTag, "@voltro/WorkflowStepInterceptor", WorkflowStepInterceptorService>;
|
|
4483
4593
|
|
|
4484
4594
|
/**
|
|
4485
4595
|
* Smooth throughput: excess starts QUEUE and are admitted as capacity frees up.
|
|
@@ -4562,7 +4672,7 @@ export declare interface WorkflowVersionOptions {
|
|
|
4562
4672
|
* suspended-on-failure run shows up under `--status suspended`, NOT in the
|
|
4563
4673
|
* dead-letter view — it is recoverable, not dead.
|
|
4564
4674
|
*
|
|
4565
|
-
* Maps to
|
|
4675
|
+
* Maps to `effect/workflow`'s `SuspendOnFailure` annotation.
|
|
4566
4676
|
*/
|
|
4567
4677
|
readonly suspendOnFailure?: boolean;
|
|
4568
4678
|
}
|