import type { RequestOptions } from "../base-client";
import { RequestBuilder } from "../request-builder";
/**
 * One bundle entry returned by the capability catalog endpoints.
 *
 * After the C1 bundle collapse (2026-05-11), bundles are the user-facing unit
 * ISVs opt into. Each bundle aggregates one or more leaf capabilities (see
 * `members`) and belongs to a tier (`standard` or `premium`).
 */
export interface Bundle {
    /** Bundle atom key as a string (e.g., `"crm"`, `"integrations_crm"`). */
    key: string;
    /** Human-readable name suitable for marketing surfaces. */
    name: string;
    /** Short description of what the bundle includes. */
    description: string;
    /** `"standard"` or `"premium"`. */
    tier: string;
    /**
     * Premium gate bucket (`"scale" | "compliance_governance" | "premium_ai" |
     * "premium_connectors" | "niche"`). `null` for standard-tier bundles.
     */
    gate_bucket: string | null;
    /** Leaf capability atom keys that compose this bundle. */
    members: string[];
    /** Free-form descriptive tags (e.g., `["forms", "ai"]`). */
    tags: string[];
}
/**
 * Bundle entry annotated for a specific application (ISV view).
 *
 * Extends `Bundle` with per-application enablement state returned by
 * `GET /isv/capabilities`.
 */
export interface AnnotatedBundle extends Bundle {
    /** Whether the authenticated application currently has this bundle enabled. */
    enabled: boolean;
    /**
     * Whether this bundle can be enabled on the application's current plan.
     * `true` when the tier is `"standard"` OR the plan grants `:premium` tier.
     */
    can_enable: boolean;
    /**
     * `true` when the bundle is premium-tier AND the application's plan does
     * NOT grant `:premium`. Surfaced as a hint to drive plan upgrade flows.
     */
    missing_premium_plan: boolean;
}
/**
 * One opt-in capability entry. Opt-in capabilities are app-wide toggles that
 * are NOT part of a bundle (e.g., `ai_workload_routing`).
 */
export interface OptInCapability {
    key: string;
    name: string;
    description: string;
    /** Present on the ISV view, omitted on the admin view. */
    enabled?: boolean;
}
/**
 * Raw leaf capability entry from the internal taxonomy. Returned only when
 * the caller passes `?include=catalog`. Most callers should prefer
 * `Bundle.members` for the canonical bundle → leaf mapping.
 */
export interface Capability {
    key: string;
    name: string;
    description: string;
    category: string;
    domain: string;
    /** Bundle assignment — bundle key, `"implicit_core"`, or `"opt_in_standalone"`. */
    bundle: string;
    /** `"ga" | "beta" | "preview" | "planned"`. */
    status: string;
    tags: string[];
    docs_url: string | null;
}
/** Default response shape for `GET /sys/capabilities` (admin view). */
export interface AdminBundleCatalog {
    bundles: Bundle[];
    opt_in_capabilities: OptInCapability[];
    /** Present only when `?include=catalog` was passed. */
    capabilities?: Capability[];
}
/** Default response shape for `GET /isv/capabilities` (ISV view). */
export interface AnnotatedBundleCatalog {
    bundles: AnnotatedBundle[];
    opt_in_capabilities: OptInCapability[];
    /** Present only when `?include=catalog` was passed. */
    capabilities?: Capability[];
}
/** Options accepted by the capability list methods. */
export interface ListCapabilitiesOptions extends RequestOptions {
    /**
     * When `true`, requests `?include=catalog` and the server appends the raw
     * leaf-capability catalog (`capabilities`) alongside the bundle list.
     */
    includeCatalog?: boolean;
}
export declare function createCapabilitiesNamespace(rb: RequestBuilder): {
    /**
     * List the bundle catalog (platform admin view — no per-application
     * annotations).
     *
     * Returns every bundle defined in the registry. Pass `includeCatalog: true`
     * to also receive the raw leaf-capability catalog under `capabilities`.
     *
     * Requires a platform admin key (`sk_sys_`).
     *
     * @param options - Optional request options + `includeCatalog`.
     * @returns The bundle catalog plus opt-in capabilities, plus the raw leaf
     *   catalog when `includeCatalog: true`.
     *
     * @example
     * ```typescript
     * const admin = new GptAdmin({ apiKey: "sk_sys_..." });
     * const { bundles, opt_in_capabilities } = await admin.capabilities.list();
     * const premium = bundles.filter((b) => b.tier === "premium");
     * ```
     */
    list: (options?: ListCapabilitiesOptions) => Promise<AdminBundleCatalog>;
    /**
     * List the bundle catalog annotated for the authenticated application
     * (ISV view).
     *
     * Returns every bundle with `enabled`, `can_enable`, and
     * `missing_premium_plan` annotations reflecting the application's
     * `enabled_capabilities` set and its plan's `capability_tiers`. Pass
     * `includeCatalog: true` to also receive the raw leaf catalog.
     *
     * Requires an ISV application key (`sk_app_`, `sk_srv_`).
     *
     * @param options - Optional request options + `includeCatalog`.
     * @returns The annotated bundle catalog plus opt-in capabilities.
     *
     * @example
     * ```typescript
     * const admin = new GptAdmin({ apiKey: "sk_srv_..." });
     * const { bundles } = await admin.capabilities.listForApplication();
     * const upgradeNeeded = bundles.filter((b) => b.missing_premium_plan);
     * ```
     */
    listForApplication: (options?: ListCapabilitiesOptions) => Promise<AnnotatedBundleCatalog>;
    /**
     * Get a single bundle by key from the platform admin catalog.
     *
     * Convenience method that fetches the full catalog and returns the bundle
     * matching `key`, or `null` if not found.
     *
     * Requires a platform admin key (`sk_sys_`).
     *
     * @param key - The bundle atom key as a string (e.g., `"integrations_crm"`).
     * @param options - Optional request options.
     * @returns The matching `Bundle`, or `null`.
     *
     * @example
     * ```typescript
     * const bundle = await admin.capabilities.get("integrations_crm");
     * if (bundle) console.log(bundle.tier); // "premium"
     * ```
     */
    get: (key: string, options?: RequestOptions) => Promise<Bundle | null>;
};
//# sourceMappingURL=capabilities.d.ts.map