async function bundleZipBase64(
  startFilename,
  options = {},
  grantedPowers = {},
) {
  const {
    dev = false,
    cacheSourceMaps = false,
    noTransforms = false,
    elideComments = false,
    conditions = [],
    commonDependencies,
    importHook,
  } = options;
  const powers = { ...readPowers, ...grantedPowers };
  const {
    computeSha512,
    pathResolve = path.resolve,
    userInfo = os.userInfo,
    env = process.env,
    platform = process.platform,
  } = powers;

  const entry = url.pathToFileURL(pathResolve(startFilename));

  const {
    sourceMapHook,
    sourceMapJobs,
    moduleTransforms,
    parserForLanguage,
    workspaceLanguageForExtension,
    workspaceCommonjsLanguageForExtension,
    workspaceModuleLanguageForExtension,
  } = makeBundlingKit(
    {
      pathResolve,
      userInfo,
      platform,
      env,
      computeSha512,
    },
    {
      cacheSourceMaps,
      noTransforms,
      elideComments,
      commonDependencies,
    },
  );

  const compartmentMap = await mapNodeModules(powers, entry, {
    dev,
    conditions,
    commonDependencies,
    workspaceLanguageForExtension,
    workspaceCommonjsLanguageForExtension,
    workspaceModuleLanguageForExtension,
  });

  const { bytes, sha512 } = await makeAndHashArchiveFromMap(
    powers,
    compartmentMap,
    {
      parserForLanguage,
      moduleTransforms,
      sourceMapHook,
      importHook,
    },
  );
  assert(sha512);
  await Promise.all(sourceMapJobs);
  const endoZipBase64 = encodeBase64(bytes);
  return harden({
    moduleFormat: /** @type {const} */ ('endoZipBase64'),
    endoZipBase64,
    endoZipBase64Sha512: sha512,
  });
}
@param {string} startFilename
@param {object} [options]
@param {boolean} [options.dev]
@param {boolean} [options.cacheSourceMaps]
@param {boolean} [options.noTransforms]
@param {boolean} [options.elideComments]
@param {string[]} [options.conditions]
@param {Record<string, string>} [options.commonDependencies]
@param {(specifier: string, packageLocation: string) => Promise<import('@endo/compartment-mapper/src/types').ThirdPartyStaticModuleInterface | undefined>} [options.importHook]

@param {object} [grantedPowers]
@param {(bytes: string | Uint8Array) => string} [grantedPowers.computeSha512]
@param {typeof import('path)['resolve']} [grantedPowers.pathResolve]
@param {typeof import('os')['userInfo']} [grantedPowers.userInfo]
@param {typeof process['env']} [grantedPowers.env]
@param {typeof process['platform']} [grantedPowers.platform]