Member Junction
    Preparing search index...
    • Partition messages into a byte-stable prefix and a volatile tail.

      The prefix is the maximal contiguous leading run for which isStable returns true. The moment isStable returns false, that message and everything after it are volatile — even a later message that would itself be "stable", because once the leading run is broken the provider's cached prefix is already lost from that point.

      Pure and side-effect-free: the input array is not mutated; the returned arrays are shallow slices of it.

      Type Parameters

      • TMessage

      Parameters

      • messages: readonly TMessage[]

        The ordered conversation messages (front = oldest).

      • isStable: (message: TMessage, index: number) => boolean

        Predicate identifying a prefix-eligible (cache-stable) message.

      Returns StablePrefixPartition<TMessage>