/** User messages are inserted atomically — never stream-append like assistant deltas. */
export function applyMessageDelta(
  role: 'user' | 'assistant' | 'system' | 'tool',
  existingContent: string,
  chunk: string,
): string {
  if (role === 'user') {
    return chunk || existingContent;
  }
  return existingContent + chunk;
}
