/**
 * Required-environment-variable check.
 *
 * Skillsets that bundle MCP servers (or any other env-dependent feature)
 * may declare a `requiredEnv` array in nori.json. At install time the
 * CLI surfaces missing vars so the user can export them before launching
 * the target agent.
 *
 * Entries can be plain strings or objects with `name`/`description`/`url`.
 */
const entryName = (entry) => {
    return typeof entry === "string" ? entry : entry.name;
};
export const checkRequiredEnv = (args) => {
    const { skillset, env } = args;
    const required = skillset.metadata.requiredEnv;
    if (!Array.isArray(required)) {
        return [];
    }
    const missing = [];
    for (const raw of required) {
        if (typeof raw !== "string" && (typeof raw !== "object" || raw == null)) {
            continue;
        }
        const name = entryName(raw);
        const value = env[name];
        if (value == null || value === "") {
            missing.push(name);
        }
    }
    return missing;
};
//# sourceMappingURL=envCheck.js.map