How to use external dependencies in pluginManagement block of settings.gradle.kts file for calculating plugin version?

I would like to read plugin version from external file and parse this value with kotlin-semver.

I tried:

pluginManagement {
    plugins {
        id("precompiled-script-plugin") // plugin with "io.github.z4kn4fein:semver:2.0.0" in dependencies block
    }
    buildscript {
        dependencies {
            classpath("io.github.z4kn4fein:semver:2.0.0")
        }
        repositories {
            maven {
                url = uri("***")
                credentials {
                    username = ***
                    password = ***
                }
            }
        }
    }
    repositories {

        maven {
            url = uri("***")
            credentials {
                username = ***
                password = ***
            }
        }
        io.github.z4kn4fein.semver.Version.parse("....") // compilation error
    }
}

What do I need to do to make io.github.z4kn4fein.semver.Version accessible in pluginManagement block?

I don’t think you can.
The buildscript within pluginManagement is not working either way, it belongs to top-level to work properly but even then you cannot use things from it in the pluginManagement block.
Having the dependency in pluginManagement { plugins { ... } } is quite irrelevant, as that block is not adding anything to any classpath, it only defines default versions to be used if the plugin is actually uses somewhere else without version.

Instead, you should probably use a version catalog built through the settings API, there you use your dependency and calculate the versions.