import { IPolicyData } from "../../../../base/common/defaultAccount.js";
/**
 * Response shape from the Copilot `/copilot_internal/managed_settings` endpoint.
 * The endpoint returns `.github/copilot/settings.json` content from the
 * enterprise's source org. An empty response (`{}`) is success and means
 * "no policy file present".
 *
 * Unknown keys are silently ignored via the index signature so the client is
 * forward-compatible with future additions to the registry schema.
 *
 * Exported for unit-testing the {@link adaptManagedSettings} shape transformation.
 */
export interface IManagedSettingsResponse {
    readonly enabledPlugins?: Record<string, boolean>;
    readonly extraKnownMarketplaces?: Record<string, {
        readonly source: {
            readonly source: "github";
            readonly repo: string;
            readonly ref?: string;
        } | {
            readonly source: "git";
            readonly url: string;
            readonly ref?: string;
        };
    }>;
    readonly strictKnownMarketplaces?: boolean;
    /** Any unknown keys in the response are silently ignored for forward compatibility. */
    readonly [key: string]: unknown;
}
/**
 * Adapt the `managed_settings` API response into the slice of {@link IPolicyData}
 * that the policy framework consumes. `extraKnownMarketplaces` is converted from
 * the API's `Record<id, { source }>` map shape to a flat array of
 * {@link IExtraKnownMarketplaceEntry} objects, preserving the marketplace `name`
 * (used downstream as `displayLabel` so that `enabledPlugins["plugin@<name>"]`
 * keys resolve correctly), the source discriminator, and any `ref`.
 *
 * Each field is validated independently at runtime — malformed or off-spec
 * shapes are dropped (with an optional warning via {@link onWarn}) rather than
 * throwing, so a bad enterprise settings file degrades gracefully instead of
 * blocking startup.
 *
 * Exported for unit-testing the shape transformation independently of network I/O.
 */
export declare function adaptManagedSettings(response: IManagedSettingsResponse, onWarn?: (msg: string) => void): Partial<IPolicyData>;
