Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

510 B
Raw Blame
/** Decide whether an absolute `__clients` snapshot represents a commander that needs live-state replay. */
export function shouldReplayCommander(
  previousCount: number,
  nextCount: number,
  replayedGeneration: number | undefined,
  incomingGeneration: number | undefined,
  replayOnNextSnapshot: boolean,
): boolean {
  if (nextCount <= 0) return false
  if (replayOnNextSnapshot || nextCount > previousCount) return true
  return incomingGeneration != null && incomingGeneration !== replayedGeneration
}