• Folds a batch declaration into the escalation's storage shape: queryable facets in metadata (batch_pending, batch_count, batch_keys) and the payload accumulator in envelope (batch_items: {}). partialOnTimeout is stored beside the items so the expiry statement delivers the filled items instead of false. Pure and deterministic — safe on the replayed condition() path. Throws synchronously on an invalid declaration so a bad batch never reaches a durable write.

    Type Parameters

    • T extends {
          accumulate?: AccumulateConfig;
          batch?: string[];
          envelope?: Record<string, unknown>;
          metadata?: Record<string, unknown>;
          partialOnTimeout?: boolean;
      }

    Parameters

    • config: T

    Returns Omit<T, "batch" | "partialOnTimeout">