/** * Host capability profile hints for boot policy / initd (BARE_OS_HOST_PROFILE). */ const VALID = new Set(['desktop', 'mobile', 'embedded', 'server', 'iot', 'unknown']) /** * @param {Record | null | undefined} env */ export function bareOsReadHostProfile(env) { const raw = String(env?.BARE_OS_HOST_PROFILE || '').trim().toLowerCase() const profile = VALID.has(raw) ? raw : 'unknown' const flags = String(env?.BARE_OS_HOST_FEATURE_FLAGS || '') .split(/[\s,]+/) .map((s) => s.trim()) .filter(Boolean) .slice(0, 64) return { schema: 1, profile, featureFlags: flags, atMs: Date.now() } }