def METHOD_NAME(cfg: Config) -> set[str]:
    """
    Discover configuration packages included through the applications array.
    All config package inclusions must be prefixed with `pkg.`. This function drops any
    component includes. To parse components from the applications array, use
    `_discover_components()`.
    """
    kapitan_applications = kapitan_inventory(
        cfg, key="applications", ignore_class_notfound=True
    )
    packages = set()
    for app in kapitan_applications:
        if not app.startswith(PACKAGE_PREFIX):
            continue
        pkgname = app.replace(PACKAGE_PREFIX, "", 1)
        if RESERVED_PACKAGE_PATTERN.match(pkgname):
            raise click.ClickException(
                f"Can't use reserved name '{pkgname}' as package name."
            )
        if TENANT_PREFIX_PATTERN.match(pkgname):
            raise click.ClickException(
                "Package names can't be prefixed with 't-'."
                + " This prefix is reserved for tenant configurations."
            )
        packages.add(pkgname)
    return packages