For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/node/config/functions/resolveRuntimeRoot.md.
  • English
  • Function: resolveRuntimeRoot()

    function resolveRuntimeRoot(fallbackRoot: string): string;

    Defined in: node/config/index.ts:298

    解析运行时根目录(SFMC_ROOT)。

    解析优先级:

    1. 环境变量 process.env.SFMC_ROOT(由 spawnService 等编排进程注入)
    2. 从 fallbackRoot 向上检索 monorepo 根(package.json#name === "sfmc-monorepo")
    3. fallbackRoot 目录自身(独立 npm 安装环境)

    所有仓顶服务(db-server / qq-bridge / bds-tools / cli)统一调用本函数定位工作根,严禁硬编码相对层级路径。

    Parameters

    ParameterTypeDescription
    fallbackRootstring回退起始目录路径。

    Returns

    string

    解析得到的运行时绝对路径。