/**
 * Resolves the effective `runtimeEnv` for one execution by merging
 * composer-collected env with host-provided env from a
 * {@link RuntimeEnvProvider}.
 *
 * Host values win on key collisions (see {@link RuntimeEnvProvider}).
 * Returns `undefined` when neither source contributes any variables,
 * so callers can pass the result straight to execution creation.
 *
 * Provider errors are intentionally not caught here: callers must
 * treat a failure as fatal for the submission. Callers without a
 * provider should pass the composer env through directly rather than
 * paying this function's await.
 */
export async function resolveExecutionRuntimeEnv(getRuntimeEnv, composerEnv) {
    const hostEnv = await getRuntimeEnv();
    const merged = { ...composerEnv, ...hostEnv };
    return Object.keys(merged).length > 0 ? merged : undefined;
}
//# sourceMappingURL=runtime-env.js.map