import { type ClawHubSkillDetail, type ClawHubSkillSearchResult } from "../infra/clawhub.js";
import { type SkillMarketplacePermissionSummary } from "./skills-marketplace-policy.js";
import { type SkillMarketplaceArchiveScan } from "./skills-marketplace-scan.js";
export type ClawHubSkillOrigin = {
    version: 1;
    registry: string;
    slug: string;
    installedVersion: string;
    installedAt: number;
    permissions?: SkillMarketplacePermissionSummary;
    installScan?: SkillMarketplaceArchiveScan;
    lastUpdateReview?: SkillMarketplaceUpdateReview;
};
export type ClawHubRegistryTrust = {
    registry: string;
    trusted: true;
    mode: "allowlist" | "tracked-legacy";
    allowlist: string[];
};
export type ClawHubSkillsLockfile = {
    version: 1;
    skills: Record<string, {
        version: string;
        installedAt: number;
    }>;
};
export type InstallClawHubSkillResult = {
    ok: true;
    slug: string;
    version: string;
    targetDir: string;
    sourceTrust: ClawHubRegistryTrust;
    detail: ClawHubSkillDetail;
    permissions: SkillMarketplacePermissionSummary;
    installScan: SkillMarketplaceArchiveScan;
    updateReview: SkillMarketplaceUpdateReview;
} | {
    ok: false;
    error: string;
};
export type UpdateClawHubSkillResult = {
    ok: true;
    slug: string;
    previousVersion: string | null;
    version: string;
    changed: boolean;
    targetDir: string;
    sourceTrust: ClawHubRegistryTrust;
    permissions: SkillMarketplacePermissionSummary;
    installScan: SkillMarketplaceArchiveScan;
    updateReview: SkillMarketplaceUpdateReview;
} | {
    ok: false;
    error: string;
};
export type PreviewClawHubSkillUpdateResult = {
    ok: true;
    slug: string;
    previousVersion: string | null;
    version: string;
    changed: boolean;
    targetDir: string;
    sourceTrust: ClawHubRegistryTrust;
    permissions: SkillMarketplacePermissionSummary;
    installScan: SkillMarketplaceArchiveScan;
    updateReview: SkillMarketplaceUpdateReview;
} | {
    ok: false;
    error: string;
};
export type PreviewClawHubSkillInstallResult = {
    ok: true;
    slug: string;
    version: string;
    targetDir: string;
    sourceTrust: ClawHubRegistryTrust;
    detail: ClawHubSkillDetail;
    permissions: SkillMarketplacePermissionSummary;
    installScan: SkillMarketplaceArchiveScan;
    updateReview: SkillMarketplaceUpdateReview;
} | {
    ok: false;
    error: string;
};
export type SkillMarketplaceUpdateReview = {
    version: 1;
    approvalRequired: boolean;
    reasons: string[];
    permissionDigestChanged: boolean;
    previousPermissionDigest?: string;
    nextPermissionDigest: string;
    permissionDiff: {
        added: string[];
        removed: string[];
    };
    addedScanFindings: Array<{
        severity: "warn";
        code: string;
        path: string;
        message: string;
    }>;
};
type Logger = {
    info?: (message: string) => void;
};
export declare function readClawHubSkillsLockfile(workspaceDir: string): Promise<ClawHubSkillsLockfile>;
export declare function writeClawHubSkillsLockfile(workspaceDir: string, lockfile: ClawHubSkillsLockfile): Promise<void>;
export declare function readClawHubSkillOrigin(skillDir: string): Promise<ClawHubSkillOrigin | null>;
export declare function writeClawHubSkillOrigin(skillDir: string, origin: ClawHubSkillOrigin): Promise<void>;
export declare function searchSkillsFromClawHub(params: {
    query?: string;
    limit?: number;
    baseUrl?: string;
}): Promise<ClawHubSkillSearchResult[]>;
export declare function previewSkillInstallFromClawHub(params: {
    workspaceDir: string;
    slug: string;
    version?: string;
    baseUrl?: string;
    allowRegistries?: string[];
    logger?: Logger;
}): Promise<PreviewClawHubSkillInstallResult>;
export declare function installSkillFromClawHub(params: {
    workspaceDir: string;
    slug: string;
    version?: string;
    baseUrl?: string;
    allowRegistries?: string[];
    allowPermissionChanges?: boolean;
    force?: boolean;
    logger?: Logger;
}): Promise<InstallClawHubSkillResult>;
export declare function updateSkillsFromClawHub(params: {
    workspaceDir: string;
    slug?: string;
    baseUrl?: string;
    allowRegistries?: string[];
    allowPermissionChanges?: boolean;
    logger?: Logger;
}): Promise<UpdateClawHubSkillResult[]>;
export declare function previewSkillsUpdateFromClawHub(params: {
    workspaceDir: string;
    slug?: string;
    baseUrl?: string;
    allowRegistries?: string[];
    logger?: Logger;
}): Promise<PreviewClawHubSkillUpdateResult[]>;
export declare function readTrackedClawHubSkillSlugs(workspaceDir: string): Promise<string[]>;
export declare function computeSkillFingerprint(skillDir: string): Promise<string>;
export {};
