@dudousxd/nestjs-durable-core 0.85.4 → 0.85.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1161,6 +1161,13 @@ interface OwnedLeaseReclaim {
1161
1161
  /** Only leases expiring strictly before this epoch ms (the caller's boot time + `leaseMs`). */
1162
1162
  lockedBefore: number;
1163
1163
  }
1164
+ /** One buffered signal, as {@link StateStore.listBufferedSignals} returns it. */
1165
+ interface BufferedSignalRow {
1166
+ /** The store's row id (an auto-increment), as a string. Orders rows by insertion. */
1167
+ id: string;
1168
+ token: string;
1169
+ payload: unknown;
1170
+ }
1164
1171
  interface StateStore {
1165
1172
  /**
1166
1173
  * Provision the tables/collections this store needs, idempotently. Called on boot when the
@@ -1374,6 +1381,16 @@ interface StateStore {
1374
1381
  takeBufferedSignal(token: string): Promise<{
1375
1382
  payload: unknown;
1376
1383
  } | null>;
1384
+ /**
1385
+ * A page of buffered signals whose token starts with `tokenPrefix`, in insertion (`id`) order,
1386
+ * starting after `afterId` (exclusive; `undefined` = from the start), at most `limit` rows. The
1387
+ * read behind the engine's sweep of buffered child completions nothing will consume
1388
+ * ({@link WorkflowEngine.sweepBufferedSignals}); pages by primary key, so it stays cheap on a large
1389
+ * table. Optional: without it (or {@link deleteBufferedSignals}) the sweep does nothing.
1390
+ */
1391
+ listBufferedSignals?(tokenPrefix: string, afterId: string | undefined, limit: number): Promise<BufferedSignalRow[]>;
1392
+ /** Delete the buffered signals with these {@link BufferedSignalRow.id}s; unknown ids are ignored. */
1393
+ deleteBufferedSignals?(ids: string[]): Promise<void>;
1377
1394
  /**
1378
1395
  * Buffer a published event that matched NO live waiter, so a LATER `ctx.waitForEvent(name, { match })`
1379
1396
  * still consumes it instead of it being silently dropped — the events analog of {@link bufferSignal}'s
@@ -3301,7 +3318,9 @@ interface EntityConfig<S = unknown> {
3301
3318
  }
3302
3319
  /** The slice of the engine the entity subsystem needs (so it stays a standalone module). */
3303
3320
  interface EntityHost {
3304
- register(name: string, version: string, fn: (ctx: InternalWorkflowCtx, input: unknown) => Promise<unknown>): void;
3321
+ register(name: string, version: string, fn: (ctx: InternalWorkflowCtx, input: unknown) => Promise<unknown>, opts?: {
3322
+ origin?: string | undefined;
3323
+ }): void;
3305
3324
  signalWithStart(workflow: string, input: unknown, runId: string, signal: {
3306
3325
  token: string;
3307
3326
  payload?: unknown;
@@ -3379,7 +3398,9 @@ type EventBatchConfig = {
3379
3398
  };
3380
3399
  /** The slice of the engine the accumulators need (so they stay a standalone module). */
3381
3400
  interface AccumulatorHost {
3382
- register(name: string, version: string, fn: (ctx: WorkflowCtx, input: unknown) => Promise<unknown>): void;
3401
+ register(name: string, version: string, fn: (ctx: WorkflowCtx, input: unknown) => Promise<unknown>, opts?: {
3402
+ origin?: string | undefined;
3403
+ }): void;
3383
3404
  signalWithStart(workflow: string, input: unknown, runId: string, signal: {
3384
3405
  token: string;
3385
3406
  payload?: unknown;
@@ -4685,6 +4706,10 @@ declare class WorkflowEngine {
4685
4706
  /** Runs already paged about, by id → the `updatedAt` of the paged episode (see {@link sweepStalled}). */
4686
4707
  private readonly notifiedStalled;
4687
4708
  private lastStalledSweepAt;
4709
+ /** {@link sweepBufferedSignals}: the id the pass in progress resumes after, `undefined` between passes. */
4710
+ private bufferedSweepCursor;
4711
+ private bufferedSweepActive;
4712
+ private lastBufferedSweepEndedAt;
4688
4713
  private readonly stalledAfterMs;
4689
4714
  private draining;
4690
4715
  /** Wait already spent on this shutdown before `drain()` (see `beginDrain`). */
@@ -4913,6 +4938,21 @@ declare class WorkflowEngine {
4913
4938
  * Returns an unsubscribe function.
4914
4939
  */
4915
4940
  onDead(listener: (run: WorkflowRun) => void): () => void;
4941
+ /**
4942
+ * Delete buffered child completions no parent will ever consume (see
4943
+ * `childCompletionNeedsBuffer`): those of root runs, of children whose parent already settled them
4944
+ * or is gone, or terminal for good. Such rows were written by earlier versions, which buffered every
4945
+ * completion that found no waiter, and nothing else ever removes them.
4946
+ *
4947
+ * Walks `durable_buffered_signals` by primary key, {@link BUFFERED_SWEEP_PAGE} rows at a time and
4948
+ * at most {@link BUFFERED_SWEEP_PAGES_PER_CALL} pages per call, so a large backlog drains over a
4949
+ * few timer ticks without a long query or a big delete. A pass that reaches the end of the table
4950
+ * rests {@link BUFFERED_SWEEP_REST_MS} before the next one. Call it every tick (the NestJS timer
4951
+ * poller does). Skipped while draining, on a namespaced engine (a buffered signal carries no
4952
+ * namespace, and a scoped read would report another tenant's parent as gone), and on a store
4953
+ * without `listBufferedSignals`/`deleteBufferedSignals`. Returns how many rows it deleted.
4954
+ */
4955
+ sweepBufferedSignals(now?: number): Promise<number>;
4916
4956
  /**
4917
4957
  * Register a pager hook for STRANDED runs: an in-flight run untouched past `stalledAfterMs` that is
4918
4958
  * either suspended with NO wake timer (wake-forever: nothing will ever re-drive it) or parked on an
@@ -5498,14 +5538,6 @@ declare class WorkflowEngine {
5498
5538
  * not buffered for a waiter that no longer exists.
5499
5539
  */
5500
5540
  private deliverToParent;
5501
- /**
5502
- * Whether the parent of the child behind `token` (`child:<id>`) already holds `completion` as that
5503
- * child's settled `signal:child:<id>` checkpoint: its own turn settled the child from the child's
5504
- * row, so this notification is a duplicate. A different completion (a fix-and-replay run's success
5505
- * for a child the parent saw fail) is not, and is buffered for the parent's retry. Only for a child
5506
- * whose id the engine minted (its parent is derivable from it).
5507
- */
5508
- private parentHoldsCompletion;
5509
5541
  /**
5510
5542
  * Deferred child start shared by the in-process ctx host and the remote `startChild` command.
5511
5543
  * Deferred (microtask) so a fast child can't reentrantly resume a still-suspending parent. A start
@@ -5519,6 +5551,8 @@ declare class WorkflowEngine {
5519
5551
  * correctly observes the failed start.
5520
5552
  */
5521
5553
  private startChildDeferred;
5554
+ /** {@link startChildDeferred}: re-deliver the completion of a child `start` found finished. */
5555
+ private redeliverFinishedChild;
5522
5556
  /**
5523
5557
  * Cancel a run (e.g. from the dashboard). Returns null if the run does not exist. Pass
5524
5558
  * `{ compensate: true }` to undo the saga first: the suspended run is resumed so its completed
@@ -6881,6 +6915,10 @@ declare class CodecStateStore implements StateStore {
6881
6915
  readonly compactCheckpoints?: (runId: string, fromSeq: number, toSeq: number, into: StepCheckpoint) => Promise<void>;
6882
6916
  /** Decodes each run like {@link getRun}. Bound only when the inner store has it. */
6883
6917
  readonly getRuns?: (runIds: string[]) => Promise<WorkflowRun[]>;
6918
+ /** Decodes each payload like {@link takeBufferedSignal}. Bound only when the inner store has it. */
6919
+ readonly listBufferedSignals?: (tokenPrefix: string, afterId: string | undefined, limit: number) => Promise<BufferedSignalRow[]>;
6920
+ /** Forwarded verbatim — deletes by row id. */
6921
+ readonly deleteBufferedSignals?: (ids: string[]) => Promise<void>;
6884
6922
  /** Forwarded verbatim — a waiter carries no payload. */
6885
6923
  readonly listSignalWaitersByRun?: (runIds: string[]) => Promise<SignalWaiter[]>;
6886
6924
  /** Forwarded verbatim — a waiter carries no payload. */
@@ -7020,6 +7058,15 @@ type Subscribable = {
7020
7058
  */
7021
7059
  declare function collectMetrics(engine: Subscribable): MetricsCollector;
7022
7060
 
7061
+ /**
7062
+ * The origin (see {@link import('./interfaces').WorkflowRun.origin}) stamped onto runs of the
7063
+ * workflows this package registers ITSELF — the built-in `__entity` runner behind durable entities
7064
+ * and the `__evt_debounce` / `__evt_batch` `onEvent` accumulators. It is this package's npm `name`,
7065
+ * so a console's origin facet files that engine plumbing under the engine instead of mixing it into
7066
+ * the app's own runs (or leaving it unattributed). Pinned against `package.json` by a test.
7067
+ */
7068
+ declare const CORE_ORIGIN = "@dudousxd/nestjs-durable-core";
7069
+
7023
7070
  /**
7024
7071
  * A recurring start of `workflow`, fired on a fixed interval or a cron.
7025
7072
  *
@@ -7414,10 +7461,13 @@ declare class InMemoryStateStore implements StateStore {
7414
7461
  saveCheckpoint: (cp: StepCheckpoint) => Promise<void>;
7415
7462
  }) => Promise<T>): Promise<T>;
7416
7463
  private readonly bufferedSignals;
7464
+ private bufferedSignalSeq;
7417
7465
  bufferSignal(token: string, payload: unknown): Promise<void>;
7418
7466
  takeBufferedSignal(token: string): Promise<{
7419
7467
  payload: unknown;
7420
7468
  } | null>;
7469
+ listBufferedSignals(tokenPrefix: string, afterId: string | undefined, limit: number): Promise<BufferedSignalRow[]>;
7470
+ deleteBufferedSignals(ids: string[]): Promise<void>;
7421
7471
  /** `id -> row`, so {@link removeBufferedEvent} can delete an exact row regardless of iteration
7422
7472
  * order — mirrors the SQL stores' PK-by-id delete. */
7423
7473
  private readonly bufferedEvents;
@@ -7561,4 +7611,4 @@ declare function singletonAdmissionDenialPatch(runs: WorkflowRun[], runId: strin
7561
7611
  updatedAt: Date;
7562
7612
  } | undefined;
7563
7613
 
7564
- export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllSettledOptions, type AllStepsOptions, type AllStepsSettledOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CHILD_EDGE_PREFIXES, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type CheckpointAggregatingStore, type CheckpointNameKind, type CheckpointQuery, type CheckpointStat, type ChildCallOptions, type ChildWait, CodecStateStore, type CodecStateStoreOptions, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, DEFAULT_STALLED_AFTER_MS, 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, type DynamicWorkflowCtx, ENGINE_MINTED_TAG_PREFIXES, ENTITY_WORKFLOW, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, type EntityWorkflowHost, EventAccumulators, type EventBatchConfig, FAN_SUMMARY_FAILURES, type FanJoin, type FanPage, type FanPageQuery, type FanSummary, type FanWait, FatalError, type FindStalledRunsOptions, GatherError, type GatherItemFailure, type GroupHealth, HANDOFF_SEQ_BASE, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryRunQueue, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type ListStalledRunsOptions, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type OnErrorInput, type OnErrorRoute, type OwnedLeaseReclaim, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_HISTORY_FIXTURE_VERSION, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunConsumerOptions, type RunDetail, type RunDetailOptions, type RunDispatch, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, type RunQueueOptions, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunScope, type RunStatus, type RunValueAxis, type RunValueFacetOptions, type RunValueFacetOrder, type RunValueFacetRow, type RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, SINGLETON_RESERVED_TAGS, SINGLETON_TRACKED_TAG, STATE_STORE, STATE_STORE_CANONICAL, SUMMARY_CHILD_LIMIT, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SchemaIssue, type SchemaValidationCode, SchemaValidationError, type SearchAttributes, type SearchAttributesSchema, type Settled, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, type StalePendingStep, type StalledRunInfo, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type TenantTokenSource, type TenantVerifier, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, type VerifiedTenant, 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, aggregatesCheckpoints, announcementsOf, applyAttributeQuery, assertConcurrency, assertRoutes, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, checkpointNameKind, checkpointStatsOf, childIdsOf, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, codeAndDetails, codeOf, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, detailsOf, error, etagMatches, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, fanPageBounds, fanPageEtag, findStalledRuns, foldedCount, getRunsByIds, handoffHandlerId, handoffName, hasDurableExecutionWrappers, heartbeatStatus, hmacTenantVerifier, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isFailedMember, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, legacySingletonHolders, listSignalWaitersOfRuns, liveHandoff, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, onErrorRunId, pageFan, pageFanFromStore, parentRunIdOf, parseDuration, parseWebhookToken, partitionOfToken, planDispatch, poolNamespace, prevCronFireMs, queryCheckpointsOf, readRunsByIds, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, resolveTenantToken, resolveWireTenant, retiredHandoffName, routeFor, runDetailEtag, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduleRunIdAt, scheduledRunId, signTenantToken, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, summarizeFan, summarizeRunFromStore, summarizeTimeline, tenantGroup, useDurableExecution, warn, withSingletonTracked, withoutSingletonMarkers, workflowName };
7614
+ export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllSettledOptions, type AllStepsOptions, type AllStepsSettledOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, type BufferedSignalRow, CHILD_EDGE_PREFIXES, CONTROL_FLOW_SIGNAL, CORE_ORIGIN, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type CheckpointAggregatingStore, type CheckpointNameKind, type CheckpointQuery, type CheckpointStat, type ChildCallOptions, type ChildWait, CodecStateStore, type CodecStateStoreOptions, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, DEFAULT_STALLED_AFTER_MS, 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, type DynamicWorkflowCtx, ENGINE_MINTED_TAG_PREFIXES, ENTITY_WORKFLOW, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, type EntityWorkflowHost, EventAccumulators, type EventBatchConfig, FAN_SUMMARY_FAILURES, type FanJoin, type FanPage, type FanPageQuery, type FanSummary, type FanWait, FatalError, type FindStalledRunsOptions, GatherError, type GatherItemFailure, type GroupHealth, HANDOFF_SEQ_BASE, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryRunQueue, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type ListStalledRunsOptions, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type OnErrorInput, type OnErrorRoute, type OwnedLeaseReclaim, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_HISTORY_FIXTURE_VERSION, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunConsumerOptions, type RunDetail, type RunDetailOptions, type RunDispatch, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, type RunQueueOptions, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunScope, type RunStatus, type RunValueAxis, type RunValueFacetOptions, type RunValueFacetOrder, type RunValueFacetRow, type RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, SINGLETON_RESERVED_TAGS, SINGLETON_TRACKED_TAG, STATE_STORE, STATE_STORE_CANONICAL, SUMMARY_CHILD_LIMIT, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SchemaIssue, type SchemaValidationCode, SchemaValidationError, type SearchAttributes, type SearchAttributesSchema, type Settled, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, type StalePendingStep, type StalledRunInfo, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type TenantTokenSource, type TenantVerifier, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, type VerifiedTenant, 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, aggregatesCheckpoints, announcementsOf, applyAttributeQuery, assertConcurrency, assertRoutes, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, checkpointNameKind, checkpointStatsOf, childIdsOf, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, codeAndDetails, codeOf, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, detailsOf, error, etagMatches, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, fanPageBounds, fanPageEtag, findStalledRuns, foldedCount, getRunsByIds, handoffHandlerId, handoffName, hasDurableExecutionWrappers, heartbeatStatus, hmacTenantVerifier, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isFailedMember, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, legacySingletonHolders, listSignalWaitersOfRuns, liveHandoff, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, onErrorRunId, pageFan, pageFanFromStore, parentRunIdOf, parseDuration, parseWebhookToken, partitionOfToken, planDispatch, poolNamespace, prevCronFireMs, queryCheckpointsOf, readRunsByIds, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, resolveTenantToken, resolveWireTenant, retiredHandoffName, routeFor, runDetailEtag, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduleRunIdAt, scheduledRunId, signTenantToken, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, summarizeFan, summarizeRunFromStore, summarizeTimeline, tenantGroup, useDurableExecution, warn, withSingletonTracked, withoutSingletonMarkers, workflowName };
package/dist/index.d.ts CHANGED
@@ -1161,6 +1161,13 @@ interface OwnedLeaseReclaim {
1161
1161
  /** Only leases expiring strictly before this epoch ms (the caller's boot time + `leaseMs`). */
1162
1162
  lockedBefore: number;
1163
1163
  }
1164
+ /** One buffered signal, as {@link StateStore.listBufferedSignals} returns it. */
1165
+ interface BufferedSignalRow {
1166
+ /** The store's row id (an auto-increment), as a string. Orders rows by insertion. */
1167
+ id: string;
1168
+ token: string;
1169
+ payload: unknown;
1170
+ }
1164
1171
  interface StateStore {
1165
1172
  /**
1166
1173
  * Provision the tables/collections this store needs, idempotently. Called on boot when the
@@ -1374,6 +1381,16 @@ interface StateStore {
1374
1381
  takeBufferedSignal(token: string): Promise<{
1375
1382
  payload: unknown;
1376
1383
  } | null>;
1384
+ /**
1385
+ * A page of buffered signals whose token starts with `tokenPrefix`, in insertion (`id`) order,
1386
+ * starting after `afterId` (exclusive; `undefined` = from the start), at most `limit` rows. The
1387
+ * read behind the engine's sweep of buffered child completions nothing will consume
1388
+ * ({@link WorkflowEngine.sweepBufferedSignals}); pages by primary key, so it stays cheap on a large
1389
+ * table. Optional: without it (or {@link deleteBufferedSignals}) the sweep does nothing.
1390
+ */
1391
+ listBufferedSignals?(tokenPrefix: string, afterId: string | undefined, limit: number): Promise<BufferedSignalRow[]>;
1392
+ /** Delete the buffered signals with these {@link BufferedSignalRow.id}s; unknown ids are ignored. */
1393
+ deleteBufferedSignals?(ids: string[]): Promise<void>;
1377
1394
  /**
1378
1395
  * Buffer a published event that matched NO live waiter, so a LATER `ctx.waitForEvent(name, { match })`
1379
1396
  * still consumes it instead of it being silently dropped — the events analog of {@link bufferSignal}'s
@@ -3301,7 +3318,9 @@ interface EntityConfig<S = unknown> {
3301
3318
  }
3302
3319
  /** The slice of the engine the entity subsystem needs (so it stays a standalone module). */
3303
3320
  interface EntityHost {
3304
- register(name: string, version: string, fn: (ctx: InternalWorkflowCtx, input: unknown) => Promise<unknown>): void;
3321
+ register(name: string, version: string, fn: (ctx: InternalWorkflowCtx, input: unknown) => Promise<unknown>, opts?: {
3322
+ origin?: string | undefined;
3323
+ }): void;
3305
3324
  signalWithStart(workflow: string, input: unknown, runId: string, signal: {
3306
3325
  token: string;
3307
3326
  payload?: unknown;
@@ -3379,7 +3398,9 @@ type EventBatchConfig = {
3379
3398
  };
3380
3399
  /** The slice of the engine the accumulators need (so they stay a standalone module). */
3381
3400
  interface AccumulatorHost {
3382
- register(name: string, version: string, fn: (ctx: WorkflowCtx, input: unknown) => Promise<unknown>): void;
3401
+ register(name: string, version: string, fn: (ctx: WorkflowCtx, input: unknown) => Promise<unknown>, opts?: {
3402
+ origin?: string | undefined;
3403
+ }): void;
3383
3404
  signalWithStart(workflow: string, input: unknown, runId: string, signal: {
3384
3405
  token: string;
3385
3406
  payload?: unknown;
@@ -4685,6 +4706,10 @@ declare class WorkflowEngine {
4685
4706
  /** Runs already paged about, by id → the `updatedAt` of the paged episode (see {@link sweepStalled}). */
4686
4707
  private readonly notifiedStalled;
4687
4708
  private lastStalledSweepAt;
4709
+ /** {@link sweepBufferedSignals}: the id the pass in progress resumes after, `undefined` between passes. */
4710
+ private bufferedSweepCursor;
4711
+ private bufferedSweepActive;
4712
+ private lastBufferedSweepEndedAt;
4688
4713
  private readonly stalledAfterMs;
4689
4714
  private draining;
4690
4715
  /** Wait already spent on this shutdown before `drain()` (see `beginDrain`). */
@@ -4913,6 +4938,21 @@ declare class WorkflowEngine {
4913
4938
  * Returns an unsubscribe function.
4914
4939
  */
4915
4940
  onDead(listener: (run: WorkflowRun) => void): () => void;
4941
+ /**
4942
+ * Delete buffered child completions no parent will ever consume (see
4943
+ * `childCompletionNeedsBuffer`): those of root runs, of children whose parent already settled them
4944
+ * or is gone, or terminal for good. Such rows were written by earlier versions, which buffered every
4945
+ * completion that found no waiter, and nothing else ever removes them.
4946
+ *
4947
+ * Walks `durable_buffered_signals` by primary key, {@link BUFFERED_SWEEP_PAGE} rows at a time and
4948
+ * at most {@link BUFFERED_SWEEP_PAGES_PER_CALL} pages per call, so a large backlog drains over a
4949
+ * few timer ticks without a long query or a big delete. A pass that reaches the end of the table
4950
+ * rests {@link BUFFERED_SWEEP_REST_MS} before the next one. Call it every tick (the NestJS timer
4951
+ * poller does). Skipped while draining, on a namespaced engine (a buffered signal carries no
4952
+ * namespace, and a scoped read would report another tenant's parent as gone), and on a store
4953
+ * without `listBufferedSignals`/`deleteBufferedSignals`. Returns how many rows it deleted.
4954
+ */
4955
+ sweepBufferedSignals(now?: number): Promise<number>;
4916
4956
  /**
4917
4957
  * Register a pager hook for STRANDED runs: an in-flight run untouched past `stalledAfterMs` that is
4918
4958
  * either suspended with NO wake timer (wake-forever: nothing will ever re-drive it) or parked on an
@@ -5498,14 +5538,6 @@ declare class WorkflowEngine {
5498
5538
  * not buffered for a waiter that no longer exists.
5499
5539
  */
5500
5540
  private deliverToParent;
5501
- /**
5502
- * Whether the parent of the child behind `token` (`child:<id>`) already holds `completion` as that
5503
- * child's settled `signal:child:<id>` checkpoint: its own turn settled the child from the child's
5504
- * row, so this notification is a duplicate. A different completion (a fix-and-replay run's success
5505
- * for a child the parent saw fail) is not, and is buffered for the parent's retry. Only for a child
5506
- * whose id the engine minted (its parent is derivable from it).
5507
- */
5508
- private parentHoldsCompletion;
5509
5541
  /**
5510
5542
  * Deferred child start shared by the in-process ctx host and the remote `startChild` command.
5511
5543
  * Deferred (microtask) so a fast child can't reentrantly resume a still-suspending parent. A start
@@ -5519,6 +5551,8 @@ declare class WorkflowEngine {
5519
5551
  * correctly observes the failed start.
5520
5552
  */
5521
5553
  private startChildDeferred;
5554
+ /** {@link startChildDeferred}: re-deliver the completion of a child `start` found finished. */
5555
+ private redeliverFinishedChild;
5522
5556
  /**
5523
5557
  * Cancel a run (e.g. from the dashboard). Returns null if the run does not exist. Pass
5524
5558
  * `{ compensate: true }` to undo the saga first: the suspended run is resumed so its completed
@@ -6881,6 +6915,10 @@ declare class CodecStateStore implements StateStore {
6881
6915
  readonly compactCheckpoints?: (runId: string, fromSeq: number, toSeq: number, into: StepCheckpoint) => Promise<void>;
6882
6916
  /** Decodes each run like {@link getRun}. Bound only when the inner store has it. */
6883
6917
  readonly getRuns?: (runIds: string[]) => Promise<WorkflowRun[]>;
6918
+ /** Decodes each payload like {@link takeBufferedSignal}. Bound only when the inner store has it. */
6919
+ readonly listBufferedSignals?: (tokenPrefix: string, afterId: string | undefined, limit: number) => Promise<BufferedSignalRow[]>;
6920
+ /** Forwarded verbatim — deletes by row id. */
6921
+ readonly deleteBufferedSignals?: (ids: string[]) => Promise<void>;
6884
6922
  /** Forwarded verbatim — a waiter carries no payload. */
6885
6923
  readonly listSignalWaitersByRun?: (runIds: string[]) => Promise<SignalWaiter[]>;
6886
6924
  /** Forwarded verbatim — a waiter carries no payload. */
@@ -7020,6 +7058,15 @@ type Subscribable = {
7020
7058
  */
7021
7059
  declare function collectMetrics(engine: Subscribable): MetricsCollector;
7022
7060
 
7061
+ /**
7062
+ * The origin (see {@link import('./interfaces').WorkflowRun.origin}) stamped onto runs of the
7063
+ * workflows this package registers ITSELF — the built-in `__entity` runner behind durable entities
7064
+ * and the `__evt_debounce` / `__evt_batch` `onEvent` accumulators. It is this package's npm `name`,
7065
+ * so a console's origin facet files that engine plumbing under the engine instead of mixing it into
7066
+ * the app's own runs (or leaving it unattributed). Pinned against `package.json` by a test.
7067
+ */
7068
+ declare const CORE_ORIGIN = "@dudousxd/nestjs-durable-core";
7069
+
7023
7070
  /**
7024
7071
  * A recurring start of `workflow`, fired on a fixed interval or a cron.
7025
7072
  *
@@ -7414,10 +7461,13 @@ declare class InMemoryStateStore implements StateStore {
7414
7461
  saveCheckpoint: (cp: StepCheckpoint) => Promise<void>;
7415
7462
  }) => Promise<T>): Promise<T>;
7416
7463
  private readonly bufferedSignals;
7464
+ private bufferedSignalSeq;
7417
7465
  bufferSignal(token: string, payload: unknown): Promise<void>;
7418
7466
  takeBufferedSignal(token: string): Promise<{
7419
7467
  payload: unknown;
7420
7468
  } | null>;
7469
+ listBufferedSignals(tokenPrefix: string, afterId: string | undefined, limit: number): Promise<BufferedSignalRow[]>;
7470
+ deleteBufferedSignals(ids: string[]): Promise<void>;
7421
7471
  /** `id -> row`, so {@link removeBufferedEvent} can delete an exact row regardless of iteration
7422
7472
  * order — mirrors the SQL stores' PK-by-id delete. */
7423
7473
  private readonly bufferedEvents;
@@ -7561,4 +7611,4 @@ declare function singletonAdmissionDenialPatch(runs: WorkflowRun[], runId: strin
7561
7611
  updatedAt: Date;
7562
7612
  } | undefined;
7563
7613
 
7564
- export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllSettledOptions, type AllStepsOptions, type AllStepsSettledOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CHILD_EDGE_PREFIXES, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type CheckpointAggregatingStore, type CheckpointNameKind, type CheckpointQuery, type CheckpointStat, type ChildCallOptions, type ChildWait, CodecStateStore, type CodecStateStoreOptions, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, DEFAULT_STALLED_AFTER_MS, 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, type DynamicWorkflowCtx, ENGINE_MINTED_TAG_PREFIXES, ENTITY_WORKFLOW, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, type EntityWorkflowHost, EventAccumulators, type EventBatchConfig, FAN_SUMMARY_FAILURES, type FanJoin, type FanPage, type FanPageQuery, type FanSummary, type FanWait, FatalError, type FindStalledRunsOptions, GatherError, type GatherItemFailure, type GroupHealth, HANDOFF_SEQ_BASE, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryRunQueue, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type ListStalledRunsOptions, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type OnErrorInput, type OnErrorRoute, type OwnedLeaseReclaim, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_HISTORY_FIXTURE_VERSION, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunConsumerOptions, type RunDetail, type RunDetailOptions, type RunDispatch, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, type RunQueueOptions, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunScope, type RunStatus, type RunValueAxis, type RunValueFacetOptions, type RunValueFacetOrder, type RunValueFacetRow, type RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, SINGLETON_RESERVED_TAGS, SINGLETON_TRACKED_TAG, STATE_STORE, STATE_STORE_CANONICAL, SUMMARY_CHILD_LIMIT, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SchemaIssue, type SchemaValidationCode, SchemaValidationError, type SearchAttributes, type SearchAttributesSchema, type Settled, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, type StalePendingStep, type StalledRunInfo, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type TenantTokenSource, type TenantVerifier, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, type VerifiedTenant, 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, aggregatesCheckpoints, announcementsOf, applyAttributeQuery, assertConcurrency, assertRoutes, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, checkpointNameKind, checkpointStatsOf, childIdsOf, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, codeAndDetails, codeOf, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, detailsOf, error, etagMatches, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, fanPageBounds, fanPageEtag, findStalledRuns, foldedCount, getRunsByIds, handoffHandlerId, handoffName, hasDurableExecutionWrappers, heartbeatStatus, hmacTenantVerifier, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isFailedMember, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, legacySingletonHolders, listSignalWaitersOfRuns, liveHandoff, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, onErrorRunId, pageFan, pageFanFromStore, parentRunIdOf, parseDuration, parseWebhookToken, partitionOfToken, planDispatch, poolNamespace, prevCronFireMs, queryCheckpointsOf, readRunsByIds, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, resolveTenantToken, resolveWireTenant, retiredHandoffName, routeFor, runDetailEtag, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduleRunIdAt, scheduledRunId, signTenantToken, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, summarizeFan, summarizeRunFromStore, summarizeTimeline, tenantGroup, useDurableExecution, warn, withSingletonTracked, withoutSingletonMarkers, workflowName };
7614
+ export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllSettledOptions, type AllStepsOptions, type AllStepsSettledOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, type BufferedSignalRow, CHILD_EDGE_PREFIXES, CONTROL_FLOW_SIGNAL, CORE_ORIGIN, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type CheckpointAggregatingStore, type CheckpointNameKind, type CheckpointQuery, type CheckpointStat, type ChildCallOptions, type ChildWait, CodecStateStore, type CodecStateStoreOptions, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, DEFAULT_STALLED_AFTER_MS, 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, type DynamicWorkflowCtx, ENGINE_MINTED_TAG_PREFIXES, ENTITY_WORKFLOW, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, type EntityWorkflowHost, EventAccumulators, type EventBatchConfig, FAN_SUMMARY_FAILURES, type FanJoin, type FanPage, type FanPageQuery, type FanSummary, type FanWait, FatalError, type FindStalledRunsOptions, GatherError, type GatherItemFailure, type GroupHealth, HANDOFF_SEQ_BASE, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryRunQueue, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type ListStalledRunsOptions, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type OnErrorInput, type OnErrorRoute, type OwnedLeaseReclaim, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_HISTORY_FIXTURE_VERSION, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunConsumerOptions, type RunDetail, type RunDetailOptions, type RunDispatch, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, type RunQueueOptions, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunScope, type RunStatus, type RunValueAxis, type RunValueFacetOptions, type RunValueFacetOrder, type RunValueFacetRow, type RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, SINGLETON_RESERVED_TAGS, SINGLETON_TRACKED_TAG, STATE_STORE, STATE_STORE_CANONICAL, SUMMARY_CHILD_LIMIT, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SchemaIssue, type SchemaValidationCode, SchemaValidationError, type SearchAttributes, type SearchAttributesSchema, type Settled, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, type StalePendingStep, type StalledRunInfo, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type TenantTokenSource, type TenantVerifier, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, type VerifiedTenant, 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, aggregatesCheckpoints, announcementsOf, applyAttributeQuery, assertConcurrency, assertRoutes, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, checkpointNameKind, checkpointStatsOf, childIdsOf, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, codeAndDetails, codeOf, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, detailsOf, error, etagMatches, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, fanPageBounds, fanPageEtag, findStalledRuns, foldedCount, getRunsByIds, handoffHandlerId, handoffName, hasDurableExecutionWrappers, heartbeatStatus, hmacTenantVerifier, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isFailedMember, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, legacySingletonHolders, listSignalWaitersOfRuns, liveHandoff, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, onErrorRunId, pageFan, pageFanFromStore, parentRunIdOf, parseDuration, parseWebhookToken, partitionOfToken, planDispatch, poolNamespace, prevCronFireMs, queryCheckpointsOf, readRunsByIds, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, resolveTenantToken, resolveWireTenant, retiredHandoffName, routeFor, runDetailEtag, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduleRunIdAt, scheduledRunId, signTenantToken, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, summarizeFan, summarizeRunFromStore, summarizeTimeline, tenantGroup, useDurableExecution, warn, withSingletonTracked, withoutSingletonMarkers, workflowName };