code: func (site *installationSite) installedPackages(ctx context.Context) (map[string][]pinInfo, error) {
  	d := deployer.New(site.siteRoot)
  
  	allPins, err := d.FindDeployed(ctx)
  	if err != nil {
  		return nil, err
  	}
  	output := make(map[string][]pinInfo, len(allPins))
  	for subdir, pins := range allPins {
  		output[subdir] = make([]pinInfo, len(pins))
  		for i, pin := range pins {
  			cpy := pin
  			output[subdir][i] = pinInfo{
  				Pkg:      pin.PackageName,
  				Pin:      &cpy,
  				Tracking: site.cfg.TrackedVersions[pin.PackageName],
  			}
  		}
  	}
  	return output, nil
  }
docs: // installedPackages discovers versions of packages installed in the site.
  //
  // If pkgs is empty array, it returns list of all installed packages.