@dudousxd/nestjs-durable-core 0.65.0 → 0.66.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.cjs +251 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +258 -4
- package/dist/index.d.ts +258 -4
- package/dist/index.js +245 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1552,6 +1552,21 @@ interface Transport {
|
|
|
1552
1552
|
* caller could not have enumerated.
|
|
1553
1553
|
*/
|
|
1554
1554
|
readAllWorkerDescriptors?(): Promise<WorkerDescriptor[]>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Every live worker heartbeat in the deployment, across all groups — the LIVENESS floor under
|
|
1557
|
+
* {@link WorkflowEngine.workflowDirectory}. Optional, same as {@link readAllWorkerDescriptors}.
|
|
1558
|
+
*
|
|
1559
|
+
* It exists because a descriptor is the richer advertisement but not the universal one: an SDK
|
|
1560
|
+
* that predates the handshake beats a liveness key and publishes no descriptor at all, and reading
|
|
1561
|
+
* only descriptors reports such a fleet as EMPTY while it is serving work. Convention routing
|
|
1562
|
+
* already resolves those workers off exactly these keys, so a directory built without them
|
|
1563
|
+
* contradicts the dispatcher standing next to it.
|
|
1564
|
+
*
|
|
1565
|
+
* Distinct from {@link listWorkerGroups}, which answers with tokens alone: this carries the
|
|
1566
|
+
* instance behind each one, so the directory can say how many workers back a name and a partition
|
|
1567
|
+
* sighting can name who is beating there.
|
|
1568
|
+
*/
|
|
1569
|
+
readAllWorkerHeartbeats?(): Promise<WorkerHeartbeat[]>;
|
|
1555
1570
|
/**
|
|
1556
1571
|
* DB-less tenant worker → control plane: publish a {@link StartRunMessage} requesting a new run.
|
|
1557
1572
|
* Optional — only transports that carry the hosted-control-plane protocol (P4) implement this.
|
|
@@ -2442,6 +2457,25 @@ declare class EventAccumulators {
|
|
|
2442
2457
|
* picker offering steps would be offering an operation that does not exist. Step HANDLER names are
|
|
2443
2458
|
* still advertised (`WorkerDescriptor.steps`) — that is a routing/capability fact used to decide
|
|
2444
2459
|
* whether a dispatched step can be run, not an invocable catalog.
|
|
2460
|
+
*
|
|
2461
|
+
* ## The floor: a live worker that announces nothing
|
|
2462
|
+
*
|
|
2463
|
+
* An SDK old enough to predate the descriptor advertisement publishes only its TTL'd liveness
|
|
2464
|
+
* heartbeat — one key per routing token it consumes. Read strictly, such a fleet announces nothing
|
|
2465
|
+
* and this registry would be empty while work is being served. That answer is not merely unhelpful,
|
|
2466
|
+
* it CONTRADICTS the engine beside it: `resolveRemoteByConvention` routes a call to `X` the moment a
|
|
2467
|
+
* token named `X` heartbeats, so the deployment already treats liveness as sufficient to CALL a
|
|
2468
|
+
* workflow while claiming to know nothing when asked to LIST one. Both answers come out of the same
|
|
2469
|
+
* Redis.
|
|
2470
|
+
*
|
|
2471
|
+
* So the heartbeat is folded in as a second, weaker tier of evidence ({@link AnnouncedWorkflow.evidence}
|
|
2472
|
+
* `'observed'`): the entry exists because a live token of that name exists, which is exactly — no more
|
|
2473
|
+
* and no less — the condition under which convention routing would resolve it. Listing it therefore
|
|
2474
|
+
* cannot introduce a failure the dispatcher did not already have. What it CANNOT do is state a
|
|
2475
|
+
* version, an origin, a runtime, or even that the token serves a workflow rather than a step handler
|
|
2476
|
+
* of the same name: none of that is in a heartbeat, and every one of those stays un-stated rather than
|
|
2477
|
+
* being guessed. A descriptor always wins — a token an announcement already covers is never re-added
|
|
2478
|
+
* as an observation.
|
|
2445
2479
|
*/
|
|
2446
2480
|
|
|
2447
2481
|
/** One live worker's claim about one workflow: the registration plus who announced it. */
|
|
@@ -2457,25 +2491,46 @@ interface Disagreement {
|
|
|
2457
2491
|
axis: 'group' | 'origin' | 'requires';
|
|
2458
2492
|
values: string[];
|
|
2459
2493
|
}
|
|
2494
|
+
/**
|
|
2495
|
+
* How strong the fleet's claim about a workflow is. The two tiers are NOT interchangeable and a
|
|
2496
|
+
* caller must not read them as the same fact:
|
|
2497
|
+
*
|
|
2498
|
+
* - `'declared'` — at least one live worker published a descriptor naming this workflow. Everything
|
|
2499
|
+
* populated on the entry was STATED by that worker; everything absent it declined to state.
|
|
2500
|
+
* - `'observed'` — nobody described it. What exists is a live routing token of this name, which is
|
|
2501
|
+
* precisely the condition `resolveRemoteByConvention` uses to route a call, so the name IS
|
|
2502
|
+
* reachable. Nothing else is known: no version, no origin, no runtime, and no assurance that the
|
|
2503
|
+
* worker consuming that token serves a WORKFLOW there rather than a step handler of the same name.
|
|
2504
|
+
* An entry like this is a live queue, not a promise.
|
|
2505
|
+
*/
|
|
2506
|
+
type AnnouncementEvidence = 'declared' | 'observed';
|
|
2460
2507
|
/** One workflow the live fleet announces, folded across every worker that announced it. */
|
|
2461
2508
|
interface AnnouncedWorkflow {
|
|
2509
|
+
/** What kind of claim this entry rests on — see {@link AnnouncementEvidence}. A caller that shows
|
|
2510
|
+
* a version, an origin or a runtime must check this first: an `'observed'` entry has none of
|
|
2511
|
+
* them, and the emptiness is a fact about the fleet, not a rendering gap. */
|
|
2512
|
+
evidence: AnnouncementEvidence;
|
|
2462
2513
|
/** `name@version`, or the bare `name` when no announcer stated a version. Stable sort key. */
|
|
2463
2514
|
key: string;
|
|
2464
2515
|
name: string;
|
|
2465
2516
|
/** Absent when no announcer stated one — never inferred from another announcer's version. */
|
|
2466
2517
|
version?: string;
|
|
2467
|
-
/** Every distinct routing group announced (sorted). Empty = nobody stated one.
|
|
2518
|
+
/** Every distinct routing group announced (sorted). Empty = nobody stated one. On an `'observed'`
|
|
2519
|
+
* entry this is the token the heartbeat was published UNDER — not a claim by anybody, but the
|
|
2520
|
+
* queue a call would actually land on, which is the one thing an observation does establish. */
|
|
2468
2521
|
groups: string[];
|
|
2469
2522
|
/** Every distinct declaring package announced (sorted). Empty = nobody stated one. */
|
|
2470
2523
|
origins: string[];
|
|
2471
2524
|
/** Every distinct capability demand announced, each de-duplicated + sorted. Empty = nobody stated
|
|
2472
2525
|
* one. Two entries here means two workers demand different capabilities for the same version. */
|
|
2473
2526
|
requires: string[][];
|
|
2474
|
-
/** Runtimes of the live announcers (sorted, de-duplicated).
|
|
2527
|
+
/** Runtimes of the live announcers (sorted, de-duplicated). EMPTY on an `'observed'` entry: a
|
|
2528
|
+
* heartbeat does not say what runtime wrote it, and the instance id's shape is a convention, not
|
|
2529
|
+
* a statement, so it is not read as one. */
|
|
2475
2530
|
runtimes: ('node' | 'python')[];
|
|
2476
2531
|
/** Instance ids of the live workers announcing it (sorted, de-duplicated). Its length is how many
|
|
2477
2532
|
* workers can currently run this workflow — `1` is a single point of failure, and it is never 0
|
|
2478
|
-
* (an entry exists only because somebody announced it). */
|
|
2533
|
+
* (an entry exists only because somebody announced it, or because somebody is beating on it). */
|
|
2479
2534
|
instances: string[];
|
|
2480
2535
|
/** The axes the announcers differ on, empty when they speak with one voice. A caller that must
|
|
2481
2536
|
* pick a single target has to resolve these itself — the registry refuses to guess. */
|
|
@@ -2502,6 +2557,151 @@ declare function announcementsOf(raw: RawWorkerDescriptor | WorkerDescriptor): W
|
|
|
2502
2557
|
* `instances` is a set, so it counts workers, not keys.
|
|
2503
2558
|
*/
|
|
2504
2559
|
declare function aggregateAnnouncements(descriptors: readonly (RawWorkerDescriptor | WorkerDescriptor)[]): AnnouncedWorkflow[];
|
|
2560
|
+
/**
|
|
2561
|
+
* The part of one live worker heartbeat this registry can read: the routing token the beat was
|
|
2562
|
+
* published under, and which process published it. That is genuinely all a heartbeat holds — it is
|
|
2563
|
+
* the cheap tier of the two-tier advertisement, and its job is liveness, not description.
|
|
2564
|
+
*
|
|
2565
|
+
* Structurally satisfied by `WorkerHeartbeat` (the transport-facing shape, which also carries a beat
|
|
2566
|
+
* time and an execution snapshot). Declared here rather than imported so this module keeps its "pure
|
|
2567
|
+
* data, no transport" footing and `interfaces.ts` can keep importing FROM it.
|
|
2568
|
+
*/
|
|
2569
|
+
interface HeartbeatSighting {
|
|
2570
|
+
/** The routing token the beat was published under (already partition-suffixed when partitioned). */
|
|
2571
|
+
group: string;
|
|
2572
|
+
/** The beating process's instance id. */
|
|
2573
|
+
instanceId: string;
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* The weaker tier: one entry per live routing token that NO descriptor accounts for.
|
|
2577
|
+
*
|
|
2578
|
+
* `covered` holds every token the declared announcements already explain — both the sanitized form of
|
|
2579
|
+
* each announced NAME and every group any announcer stated. A token in that set is dropped, so a
|
|
2580
|
+
* fleet that describes itself properly gets exactly the same registry it got before this tier
|
|
2581
|
+
* existed, and a worker is never counted twice under two kinds of evidence.
|
|
2582
|
+
*
|
|
2583
|
+
* Everything an observation cannot know stays empty rather than being filled with a plausible guess:
|
|
2584
|
+
* no version (so nothing can be pinned against it), no origin, no requires, no runtime. The `name` is
|
|
2585
|
+
* the token itself, which equals the workflow's name for every name a queue token can round-trip —
|
|
2586
|
+
* `sanitizeQueueToken` rewrites `:` to `-` and that rewrite is not invertible, so a workflow named
|
|
2587
|
+
* `orders:fulfill` is observed as `orders-fulfill`. Stated here because a picker showing that string
|
|
2588
|
+
* should show what the queue is really called, not a reconstruction that might be wrong.
|
|
2589
|
+
*/
|
|
2590
|
+
declare function observedAnnouncements(heartbeats: readonly HeartbeatSighting[], covered: ReadonlySet<string>): AnnouncedWorkflow[];
|
|
2591
|
+
/**
|
|
2592
|
+
* Every routing token a live descriptor already ACCOUNTS FOR, and which therefore needs no
|
|
2593
|
+
* observation — for either of the two opposite reasons.
|
|
2594
|
+
*
|
|
2595
|
+
* - A token some worker announced as a WORKFLOW: already in the registry, richer than an
|
|
2596
|
+
* observation could ever be, and re-adding it would count one worker twice.
|
|
2597
|
+
* - A token some worker declared as a STEP HANDLER (`WorkerDescriptor.steps`): it must be left OUT,
|
|
2598
|
+
* because a step is not addressable from outside a run and offering one as callable would be
|
|
2599
|
+
* offering an operation the engine does not have. Route-by-handler gives every step its own queue,
|
|
2600
|
+
* so without this the liveness floor turns a fleet's entire step surface into fake workflows.
|
|
2601
|
+
*
|
|
2602
|
+
* That second exclusion is a DECLARED negative — the worker said "this name is a step" — which is
|
|
2603
|
+
* exactly the sort of fact an observation cannot supply for itself, and the clearest illustration of
|
|
2604
|
+
* what the two tiers are each worth. A worker on an SDK too old to describe itself declares neither
|
|
2605
|
+
* its workflows nor its steps, so every one of its tokens stays observed and indistinguishable: its
|
|
2606
|
+
* step queues are listed alongside its workflow queues because nothing published says which is
|
|
2607
|
+
* which. That is a fair report of the fleet, not a defect in the read.
|
|
2608
|
+
*
|
|
2609
|
+
* `sanitize` is injected so this module keeps no dependency on the queue layer; a declared name is
|
|
2610
|
+
* covered in its bare token form and, for a partitioned worker, in the suffixed form its queues
|
|
2611
|
+
* actually carry.
|
|
2612
|
+
*/
|
|
2613
|
+
declare function coveredTokens(announced: readonly AnnouncedWorkflow[], descriptors: readonly (RawWorkerDescriptor | WorkerDescriptor)[], sanitize: (name: string) => string): Set<string>;
|
|
2614
|
+
|
|
2615
|
+
/**
|
|
2616
|
+
* The workflow directory — {@link ./announced}'s registry plus the thing an empty registry could
|
|
2617
|
+
* never say: WHY it is empty.
|
|
2618
|
+
*
|
|
2619
|
+
* ## The three states an empty list used to collapse
|
|
2620
|
+
*
|
|
2621
|
+
* "What workflows can I call?" has three honest answers, and returning `[]` for all of them is the
|
|
2622
|
+
* bug this module exists to fix. They are not shades of the same answer; they call for three
|
|
2623
|
+
* different actions from whoever asked.
|
|
2624
|
+
*
|
|
2625
|
+
* 1. **This process cannot ask.** No transport here can introspect the advertisement or liveness
|
|
2626
|
+
* keyspace — a pure in-process pool advertises nothing and scans nothing. Workers may well be
|
|
2627
|
+
* running; nobody looked. ({@link WorkflowDirectory.supported} is `false`.) The action is to
|
|
2628
|
+
* configure a transport, or to stop treating this pod's answer as the deployment's answer.
|
|
2629
|
+
* 2. **Nothing is live.** The fleet WAS asked and the fleet is empty. ({@link WorkflowDirectory.supported}
|
|
2630
|
+
* is `true`, `workflows` is `[]`.) The action is to start a worker.
|
|
2631
|
+
* 3. **Here it is.** ({@link WorkflowDirectory.supported} is `true`, `workflows` is populated.)
|
|
2632
|
+
*
|
|
2633
|
+
* There is a fourth that hides inside the second and is the most expensive to debug, because it
|
|
2634
|
+
* looks exactly like "nobody is running" from the caller's side: **a worker is live on a partition
|
|
2635
|
+
* this engine does not serve.** A worker started with a partition consumes `<token>@<partition>`,
|
|
2636
|
+
* convention resolution computes the token for THIS engine's namespace, misses, and reports absence.
|
|
2637
|
+
* The heartbeat keyspace is shared, so the evidence is right there — and
|
|
2638
|
+
* {@link WorkflowDirectory.otherPartitions} reports it instead of letting the caller conclude that
|
|
2639
|
+
* nothing exists.
|
|
2640
|
+
*
|
|
2641
|
+
* ## Why a sentence rides along
|
|
2642
|
+
*
|
|
2643
|
+
* Every field here is structured and a caller can branch on all of it. {@link WorkflowDirectory.detail}
|
|
2644
|
+
* exists anyway because the three states are only useful if the human reading the picker learns which
|
|
2645
|
+
* one they are in, and a UI that has to re-derive that prose from booleans will re-derive it
|
|
2646
|
+
* differently in each place it is shown. The sentence is written once, next to the logic that decides
|
|
2647
|
+
* which state it is.
|
|
2648
|
+
*/
|
|
2649
|
+
|
|
2650
|
+
/** The namespace a descriptor or a bare routing token belongs to when it states none. Mirrors
|
|
2651
|
+
* `tenantGroup`'s default-is-bare rule, so a single-tenant deployment reads as `'default'`
|
|
2652
|
+
* everywhere rather than as a special case. */
|
|
2653
|
+
declare const DEFAULT_PARTITION = "default";
|
|
2654
|
+
/** Live workers seen on a partition the asking engine does not serve — the case that otherwise reads
|
|
2655
|
+
* identically to "nothing is running". */
|
|
2656
|
+
interface PartitionSighting {
|
|
2657
|
+
/** The partition suffix carried by the tokens (never this engine's own). */
|
|
2658
|
+
partition: string;
|
|
2659
|
+
/** The routing tokens live on it, as published (sorted). */
|
|
2660
|
+
groups: string[];
|
|
2661
|
+
/** The instance ids beating there (sorted). */
|
|
2662
|
+
instances: string[];
|
|
2663
|
+
}
|
|
2664
|
+
/** What the live fleet can be asked, and what it answered. See the module docblock for the states. */
|
|
2665
|
+
interface WorkflowDirectory {
|
|
2666
|
+
/**
|
|
2667
|
+
* Could this process ask the fleet at all?
|
|
2668
|
+
*
|
|
2669
|
+
* `false` means no transport here can read the advertisement or liveness keyspace, so `workflows`
|
|
2670
|
+
* is empty because nothing was asked — NOT because nothing is running. `true` means the read
|
|
2671
|
+
* happened and `workflows` is the answer, including when it is empty.
|
|
2672
|
+
*/
|
|
2673
|
+
supported: boolean;
|
|
2674
|
+
/** Everything callable in this engine's partition, declared and observed alike. */
|
|
2675
|
+
workflows: AnnouncedWorkflow[];
|
|
2676
|
+
/** Live workers on OTHER partitions (empty for an operator engine, which serves them all). */
|
|
2677
|
+
otherPartitions: PartitionSighting[];
|
|
2678
|
+
/** One sentence saying which state this is and what it implies. Written for a human. */
|
|
2679
|
+
detail: string;
|
|
2680
|
+
}
|
|
2681
|
+
/** The partition a routing token belongs to: the suffix after the LAST `@`, or {@link DEFAULT_PARTITION}
|
|
2682
|
+
* for a bare token. Matches how `tenantGroup` builds the token and how `workerHealth` takes it apart. */
|
|
2683
|
+
declare function partitionOfToken(token: string): string;
|
|
2684
|
+
/**
|
|
2685
|
+
* Fold live descriptors and live heartbeats into the directory for one engine.
|
|
2686
|
+
*
|
|
2687
|
+
* `namespace` is the asking engine's, and `undefined` means an operator that serves every partition
|
|
2688
|
+
* ("ver tudo = ausência de namespace"): it filters nothing and reports no foreign partitions, because
|
|
2689
|
+
* none of them are foreign to it. A namespaced engine sees only its own partition's workers, and
|
|
2690
|
+
* everything else it can see is reported as a sighting rather than silently dropped — dropping is
|
|
2691
|
+
* what made a misconfigured partition indistinguishable from an empty fleet.
|
|
2692
|
+
*
|
|
2693
|
+
* Pure and holds nothing: the caller does the two live reads it already knows how to do, folds them
|
|
2694
|
+
* here, and drops the result.
|
|
2695
|
+
*/
|
|
2696
|
+
declare function buildWorkflowDirectory(input: {
|
|
2697
|
+
descriptors: readonly (RawWorkerDescriptor | WorkerDescriptor)[];
|
|
2698
|
+
heartbeats: readonly HeartbeatSighting[];
|
|
2699
|
+
namespace: string | undefined;
|
|
2700
|
+
/** Whether ANY transport in the pool could perform the reads above. */
|
|
2701
|
+
supported: boolean;
|
|
2702
|
+
/** The queue-token form of a workflow name — injected so this module needs no queue dependency. */
|
|
2703
|
+
sanitize: (name: string) => string;
|
|
2704
|
+
}): WorkflowDirectory;
|
|
2505
2705
|
|
|
2506
2706
|
/**
|
|
2507
2707
|
* Bilateral compatibility negotiation between two handshake descriptors (design §7.3/§7.4). Pure
|
|
@@ -2702,6 +2902,30 @@ interface SingletonConfig {
|
|
|
2702
2902
|
*/
|
|
2703
2903
|
maxQueueDepth?: number;
|
|
2704
2904
|
}
|
|
2905
|
+
/**
|
|
2906
|
+
* Stamped on a run whose workflow version NOBODY declared: a remote resolved by convention, served
|
|
2907
|
+
* by a worker that announces no version for it (an SDK too old to publish a descriptor, or a body
|
|
2908
|
+
* whose author simply never stated one).
|
|
2909
|
+
*
|
|
2910
|
+
* ## Why a run has to carry this
|
|
2911
|
+
*
|
|
2912
|
+
* Such a run's `workflowVersion` is `'1'`, the engine's convention default. That value is a routing
|
|
2913
|
+
* placeholder, not an observation — and read back later it is indistinguishable from a worker that
|
|
2914
|
+
* genuinely declared version `'1'`. Any check comparing an authored pin against it therefore passes
|
|
2915
|
+
* whenever the pin is `'1'` and fails whenever it is not, regardless of what the callee actually is.
|
|
2916
|
+
* A check that cannot fail is worse than no check, because it reads as a guarantee.
|
|
2917
|
+
*
|
|
2918
|
+
* The tag is the difference, carried ON the run so a retrospective check needs no second read: a
|
|
2919
|
+
* caller that pinned a version can see that the version it is comparing against was never stated,
|
|
2920
|
+
* and say so, instead of reporting a match it did not really make. It is deliberately a tag rather
|
|
2921
|
+
* than a new column — every store already persists and queries tags, so this needs no migration and
|
|
2922
|
+
* shows up in run listings and dashboards for free. Follows the `singleton:<key>` precedent for an
|
|
2923
|
+
* engine-stamped reserved tag.
|
|
2924
|
+
*
|
|
2925
|
+
* A run whose callee DOES declare a version never carries it; that run's version is the declared one
|
|
2926
|
+
* and a pin against it is genuinely checked.
|
|
2927
|
+
*/
|
|
2928
|
+
declare const VERSION_UNDECLARED_TAG = "version:undeclared";
|
|
2705
2929
|
interface WorkflowEngineDeps {
|
|
2706
2930
|
store: StateStore;
|
|
2707
2931
|
/** A single task transport. Shorthand for a one-entry `transports` pool (id `default`). */
|
|
@@ -3143,6 +3367,21 @@ declare class WorkflowEngine {
|
|
|
3143
3367
|
* liveness changes between calls, exactly as {@link synthesizeRemoteChild} does.
|
|
3144
3368
|
*/
|
|
3145
3369
|
private resolveRemoteByConvention;
|
|
3370
|
+
/**
|
|
3371
|
+
* The version the LIVE fleet declares for `workflow` on `group`, or `undefined` when it declares
|
|
3372
|
+
* none — which is a fact about the fleet, not a failure to read it.
|
|
3373
|
+
*
|
|
3374
|
+
* The read is the descriptor advertisement, scoped to the one group being resolved: the workers on
|
|
3375
|
+
* that queue, their `registrations`, the entry whose `name` matches. That is where a version can
|
|
3376
|
+
* come from at all — a heartbeat has no room for one, so a worker on an SDK too old to publish a
|
|
3377
|
+
* descriptor declares nothing and the caller is told so rather than handed a default.
|
|
3378
|
+
*
|
|
3379
|
+
* `undefined` when the announcers DISAGREE, and deliberately: two live workers claiming different
|
|
3380
|
+
* versions of one name is a deployment in the middle of something, and picking either would stamp
|
|
3381
|
+
* a run with a version half the fleet does not serve. Undeclared is the honest reading of a
|
|
3382
|
+
* contradiction, and it is the reading that refuses to let a pin pass on a coin flip.
|
|
3383
|
+
*/
|
|
3384
|
+
private declaredVersion;
|
|
3146
3385
|
/**
|
|
3147
3386
|
* Walk the parent chain of `childRunId` to the nearest ancestor registered as REMOTE, returning its
|
|
3148
3387
|
* registration (or `undefined` if there is none). The parent of an awaited child is found via its
|
|
@@ -3511,6 +3750,21 @@ declare class WorkflowEngine {
|
|
|
3511
3750
|
* Workflows only, and deliberately: see the "steps are out of scope" note in `handshake/announced`.
|
|
3512
3751
|
*/
|
|
3513
3752
|
announcedWorkflows(): Promise<AnnouncedWorkflow[]>;
|
|
3753
|
+
/**
|
|
3754
|
+
* {@link announcedWorkflows}, plus the thing a list of workflows can never say: why it is the
|
|
3755
|
+
* length it is. See {@link WorkflowDirectory} for the three states an empty array used to collapse
|
|
3756
|
+
* into one — "nobody asked", "nothing is live", and the partition mismatch that reads exactly like
|
|
3757
|
+
* the second from the caller's side.
|
|
3758
|
+
*
|
|
3759
|
+
* Two live reads, both on demand and neither retained: the descriptor advertisement (what workers
|
|
3760
|
+
* SAY they serve) and the heartbeat keyspace (what is demonstrably consuming a queue right now).
|
|
3761
|
+
* The second is why a worker on an SDK too old to publish a descriptor appears here at all — it
|
|
3762
|
+
* beats and never describes itself, and reading only descriptors reported such a fleet as empty
|
|
3763
|
+
* while `resolveRemoteByConvention`, a few lines away in this same class, was routing calls to it
|
|
3764
|
+
* off those very keys. Two answers out of one Redis, disagreeing. Now they agree, and the entry
|
|
3765
|
+
* says which of the two kinds of evidence it rests on rather than flattening them together.
|
|
3766
|
+
*/
|
|
3767
|
+
workflowDirectory(): Promise<WorkflowDirectory>;
|
|
3514
3768
|
/**
|
|
3515
3769
|
* The routing groups of every in-flight run's still-`pending` remote step — the queues where work is
|
|
3516
3770
|
* dispatched and awaiting a worker. Folded into {@link workerHealth} so a step waiting on a group
|
|
@@ -4710,4 +4964,4 @@ declare class InMemoryTransport implements Transport, ControlPlane {
|
|
|
4710
4964
|
onControl(handler: (msg: ControlMessage) => void): void;
|
|
4711
4965
|
}
|
|
4712
4966
|
|
|
4713
|
-
export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AnnouncedWorkflow, type AttributeFilter, type AttributeOp, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, CodecStateStore, ContinueAsNew, type ControlMessage, type ControlPlane, DURABLE_OPTIONS, DURABLE_OPTIONS_CANONICAL, DURABLE_STEP_CONFIG, DURABLE_STEP_NAME, type Disagreement, type DispatchDiagnostics, type DispatchPlan, type DurableExecution, type DurableExecutionWrapper, type DurableTopology, type DurableWebhook, DurableWorkflow, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NonDeterminismError, type PayloadCodec, type QueueConfig, QueueController, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, RunGateway, type RunListItem, type RunQuery, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunStatus, type RunWaiting, STATE_STORE, STATE_STORE_CANONICAL, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, StandardSchemaV1, type StartOptions, type StartRunMessage, type StateStore, type StepCheckpoint, type StepConfig, type StepDef, type StepDispatchOpts, type StepError, type StepEvent, type StepHandler, type StepInterceptor, type StepInvocation, type StepKind, type StepLogger, type StepOptions, type StepRef, type StepResult, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, WORKFLOW_NAME_KEY, type WireDates, type WorkerAdjust, type WorkerConcurrencyStatus, type WorkerDescriptor, type WorkerHeartbeat, type WorkerLifecycle, type WorkerStatus, type WorkflowAnnouncement, WorkflowBlocked, type WorkflowClass, type WorkflowCommand, type WorkflowCtx, type WorkflowDecision, WorkflowEngine, type WorkflowEngineDeps, type WorkflowExecutor, type WorkflowHandler, type WorkflowInputOf, type WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, attributeColumnFor, attributeOperand, bindWorkflowClass, breakpointToken, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, collectMetrics, controlPlaneDescriptor, createStepLogger, currentStep, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEventToken, isLegacyDescriptor, isWorkflowControlFlowSignal, log, matchesAttributes, missingCapabilities, negotiate, normalizeAttributeRows, normalizeDescriptor, parseDuration, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInWorkflowCtx, runSchedules, runStepHandler, sanitizeQueueToken, scheduledRunId, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };
|
|
4967
|
+
export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, CodecStateStore, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_PARTITION, DURABLE_OPTIONS, DURABLE_OPTIONS_CANONICAL, DURABLE_STEP_CONFIG, DURABLE_STEP_NAME, type Disagreement, type DispatchDiagnostics, type DispatchPlan, type DurableExecution, type DurableExecutionWrapper, type DurableTopology, type DurableWebhook, DurableWorkflow, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NonDeterminismError, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, RunGateway, type RunListItem, type RunQuery, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunStatus, type RunWaiting, STATE_STORE, STATE_STORE_CANONICAL, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, StandardSchemaV1, type StartOptions, type StartRunMessage, type StateStore, type StepCheckpoint, type StepConfig, type StepDef, type StepDispatchOpts, type StepError, type StepEvent, type StepHandler, type StepInterceptor, type StepInvocation, type StepKind, type StepLogger, type StepOptions, type StepRef, type StepResult, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, WORKFLOW_NAME_KEY, type WireDates, type WorkerAdjust, type WorkerConcurrencyStatus, type WorkerDescriptor, type WorkerHeartbeat, type WorkerLifecycle, type WorkerStatus, type WorkflowAnnouncement, WorkflowBlocked, type WorkflowClass, type WorkflowCommand, type WorkflowCtx, type WorkflowDecision, type WorkflowDirectory, WorkflowEngine, type WorkflowEngineDeps, type WorkflowExecutor, type WorkflowHandler, type WorkflowInputOf, type WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, attributeColumnFor, attributeOperand, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, collectMetrics, controlPlaneDescriptor, coveredTokens, createStepLogger, currentStep, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEventToken, isLegacyDescriptor, isWorkflowControlFlowSignal, log, matchesAttributes, missingCapabilities, negotiate, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, parseDuration, partitionOfToken, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInWorkflowCtx, runSchedules, runStepHandler, sanitizeQueueToken, scheduledRunId, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };
|