Member Junction
    Preparing search index...

    Function ResolveStartupMode

    • Single source of truth for startup-mode precedence, shared by every entry point (MJAPI, MJCLI, mj-sync, CodeGen). Highest wins:

      1. MJ_STARTUP_MODE env var (per-invocation override)
      2. option — programmatic option passed by the entry point
      3. configValue — the process's loaded config (e.g. mj.config.cjs startup.mode)
      4. defaultMode — the entry point's default ('full' when omitted)

      Invalid env/config values warn and fall through to the next level — an env typo must never crash a process. The resolved mode + source is logged (non-verbose when an env/config override won, so a server silently switched to task mode by a shared mj.config.cjs is visible at boot).

      Parameters

      Returns ResolvedStartupMode