import { LicenseManager, type SeatInfo, type ActiveDevice } from "@enterprise-skills/core"; export interface BundleSkillEntry { skill_id: string; display_name: string; version: string; category: string; source: string; content: string; } export interface SkillsBundle { schema: number; tier: string; expires_at?: string; entitlements?: Record; skills: BundleSkillEntry[]; skills_failed: string[]; total: number; generated_at?: string; } export type BundleFetchResult = { ok: true; bundle: SkillsBundle; } | { ok: false; status?: number; error: string; error_code?: string; seats?: SeatInfo; active_devices?: ActiveDevice[]; retry_after_s?: number; }; export interface BundleInstallResult { rootDir: string; skillsDir: string; manifestPath: string; installed: { skill_id: string; version: string; }[]; skipped: string[]; } export interface BundleDiff { added: { skill_id: string; version: string; }[]; updated: { skill_id: string; from: string; to: string; }[]; removed: string[]; unchanged: number; } /** The global install root — same dir core/license.ts uses for license.json. */ export declare function getGlobalInstallRoot(): string; /** Device payload — same shape the validate-key flow sends (buildValidatePayload). */ export declare function buildDevicePayload(manager: LicenseManager): { id: string; hostname: string; platform: string; }; /** Validate an UNTRUSTED bundle response body before writing anything to disk. */ export declare function sanitizeBundle(raw: unknown): SkillsBundle | null; /** * POST the license key (+ device, for seat enforcement) to the skills-bundle * endpoint. Never throws — network and HTTP failures come back as { ok: false }. */ export declare function fetchSkillsBundle(opts: { key: string; device?: { id: string; hostname: string; platform: string; }; apiUrl?: string; fetchImpl?: typeof fetch; }): Promise; /** * Write the bundle to the global install root in the layout getRepoRoot() and * SkillLoader already resolve. Idempotent — re-running replaces skill files and * rewrites the manifest. */ export declare function installBundle(bundle: SkillsBundle, rootDir?: string): BundleInstallResult; /** skill_id -> version from a previously installed bundle manifest ({} if none). */ export declare function readInstalledVersions(rootDir?: string): Record; /** Per-skill version changes between the previous install and a fresh bundle. */ export declare function diffBundle(previous: Record, installed: { skill_id: string; version: string; }[]): BundleDiff; /** * Refresh license.json with the server-returned tier/expiry/entitlements from a * bundle response (extends the stored record; never restructures it). */ export declare function refreshLicenseFromBundle(manager: LicenseManager, bundle: SkillsBundle): void; //# sourceMappingURL=content.d.ts.map