/**
 * Visibility gating for the `/docs` route.
 *
 * Docs declare `visibility: public | internal` in frontmatter (or inherit it
 * from `FOLDER_DEFAULTS`). At request time, internal docs 404 unless the
 * environment opts in via `NEOTOMA_DOCS_SHOW_INTERNAL=true`.
 *
 * Default: internal docs are hidden unless the operator explicitly opts in.
 * This fails closed for staging, previews, sandboxes, and any deployment that
 * forgets to set `NODE_ENV=production`.
 */
/** True when internal-visibility docs should be exposed for the given env. */
export function shouldShowInternal(env) {
    const flag = env.NEOTOMA_DOCS_SHOW_INTERNAL;
    if (flag === "true")
        return true;
    if (flag === "false")
        return false;
    return false;
}
/** True when the doc should be visible to the requester. */
export function isVisible(fm, env) {
    if (fm.visibility === "public")
        return true;
    return shouldShowInternal(env);
}
//# sourceMappingURL=visibility.js.map