makeDaemon = async (
  powers,
  daemonLabel,
  cancel,
  cancelled,
  specials = {},
) => {
  const { promise: gracePeriodCancelled, reject: cancelGracePeriod } =
    /** @type {PromiseKit<never>} */ (makePromiseKit());

  // TODO thread through command arguments.
  const gracePeriodMs = 100;

  /** @type {Promise<never>} */
  const gracePeriodElapsed = cancelled.catch(async error => {
    await delay(gracePeriodMs, gracePeriodCancelled);
    console.log(
      `Endo daemon grace period ${gracePeriodMs}ms elapsed for ${daemonLabel}`,
    );
    throw error;
  });

  const endoBootstrap = await provideEndoBootstrap(powers, {
    cancel,
    gracePeriodMs,
    gracePeriodElapsed,
    specials,
  });

  await Promise.allSettled([
    E(endoBootstrap).reviveNetworks(),
    E(endoBootstrap).revivePins(),
  ]);

  return { endoBootstrap, cancelGracePeriod };
}
@param {DaemonicPowers} powers
@param {string} daemonLabel
@param {(error: Error) => void} cancel
@param {Promise<never>} cancelled
@param {Specials} [specials]