/**
 * API client for the Nori registrar
 *
 * The registrar is a package registry for Nori skillsets.
 * Read operations (search, packument, download) are public.
 * Write operations (upload) require authentication.
 *
 * Uses /api/skillsets/ as the primary endpoint path, with silent
 * fallback to /api/profiles/ for older registrar instances.
 */
export { NetworkError, ApiError, SkillCollisionError, isSkillCollisionError, SubagentCollisionError, isSubagentCollisionError, } from "../utils/fetch.js";
/**
 * Resolution actions for skill collisions
 */
export type SkillResolutionAction = "cancel" | "namespace" | "updateVersion" | "link";
/**
 * One entry in a conflict's per-file change list. See FileChange in fetch.ts.
 */
export type FileChange = {
    path: string;
    status: "added" | "modified" | "removed";
    isBinary: boolean;
    existingContent?: string;
    existingTruncated?: boolean;
};
/**
 * Conflict information for a single skill
 */
export type SkillConflict = {
    skillId: string;
    exists: boolean;
    canPublish: boolean;
    latestVersion?: string | null;
    owner?: string | null;
    availableActions: Array<SkillResolutionAction>;
    contentUnchanged?: boolean | null;
    existingSkillMd?: string | null;
    /**
     * Per-file change list (added/modified/removed) between upload and existing
     * latest version. Optional for backwards compatibility with older registrars.
     */
    fileChanges?: ReadonlyArray<FileChange> | null;
};
/**
 * Resolution decision for a single skill
 */
export type SkillResolution = {
    action: SkillResolutionAction;
    version?: string | null;
};
/**
 * Map of skill IDs to resolution decisions
 */
export type SkillResolutionStrategy = Record<string, SkillResolution>;
/**
 * Resolution actions for subagent collisions
 */
export type SubagentResolutionAction = "cancel" | "namespace" | "updateVersion" | "link";
/**
 * Conflict information for a single subagent
 */
export type SubagentConflict = {
    subagentId: string;
    exists: boolean;
    canPublish: boolean;
    latestVersion?: string | null;
    owner?: string | null;
    availableActions: Array<SubagentResolutionAction>;
    contentUnchanged?: boolean | null;
    existingSubagentMd?: string | null;
    /**
     * Per-file change list (added/modified/removed) between upload and existing
     * latest version. Optional for backwards compatibility with older registrars.
     */
    fileChanges?: ReadonlyArray<FileChange> | null;
};
/**
 * Resolution decision for a single subagent
 */
export type SubagentResolution = {
    action: SubagentResolutionAction;
    version?: string | null;
};
/**
 * Map of subagent IDs to resolution decisions
 */
export type SubagentResolutionStrategy = Record<string, SubagentResolution>;
export declare const REGISTRAR_URL = "https://noriskillsets.dev";
/**
 * Package metadata from the registrar
 */
export type Package = {
    id: string;
    name: string;
    description: string;
    authorEmail: string;
    createdAt: string;
    updatedAt: string;
};
/**
 * npm-compatible packument format
 */
export type Packument = {
    name: string;
    description?: string | null;
    "dist-tags": Record<string, string>;
    versions: Record<string, {
        name: string;
        version: string;
        dist?: {
            tarball?: string | null;
            shasum?: string | null;
        } | null;
    }>;
    time?: Record<string, string> | null;
    readme?: string | null;
};
export type SearchPackagesRequest = {
    query: string;
    limit?: number | null;
    offset?: number | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type SearchPackagesOnRegistryRequest = {
    query: string;
    registryUrl: string;
    authToken?: string | null;
    limit?: number | null;
    offset?: number | null;
};
export type GetPackumentRequest = {
    packageName: string;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type DownloadTarballRequest = {
    packageName: string;
    version?: string | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type UploadSkillsetRequest = {
    packageName: string;
    version: string;
    archiveData: ArrayBuffer;
    description?: string | null;
    authToken: string;
    registryUrl?: string | null;
    resolutionStrategy?: SkillResolutionStrategy | null;
    subagentResolutionStrategy?: SubagentResolutionStrategy | null;
    inlineSkills?: Array<string> | null;
    inlineSubagents?: Array<string> | null;
};
/**
 * Information about an extracted skill from a profile upload
 */
export type ExtractedSkillInfo = {
    name: string;
    version: string;
};
/**
 * Summary of skills extracted during profile upload
 */
export type ExtractedSkillsSummary = {
    succeeded: Array<ExtractedSkillInfo>;
    failed: Array<{
        name: string;
        error: string;
    }>;
};
/**
 * Information about an extracted subagent from a profile upload
 */
export type ExtractedSubagentInfo = {
    name: string;
    version: string;
};
/**
 * Summary of subagents extracted during profile upload
 */
export type ExtractedSubagentsSummary = {
    succeeded: Array<ExtractedSubagentInfo>;
    failed: Array<{
        name: string;
        reason: string;
    }>;
};
export type UploadSkillsetResponse = {
    name: string;
    version: string;
    description?: string | null;
    tarballSha: string;
    createdAt: string;
    extractedSkills?: ExtractedSkillsSummary | null;
    extractedSubagents?: ExtractedSubagentsSummary | null;
};
export type SearchSkillsRequest = {
    query: string;
    limit?: number | null;
    offset?: number | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type GetSkillPackumentRequest = {
    skillName: string;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type DownloadSkillTarballRequest = {
    skillName: string;
    version?: string | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type SearchSubagentsRequest = {
    query: string;
    limit?: number | null;
    offset?: number | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type GetSubagentPackumentRequest = {
    subagentName: string;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type DownloadSubagentTarballRequest = {
    subagentName: string;
    version?: string | null;
    registryUrl?: string | null;
    authToken?: string | null;
};
export type UploadSkillRequest = {
    skillName: string;
    version: string;
    archiveData: ArrayBuffer;
    description?: string | null;
    authToken: string;
    registryUrl?: string | null;
};
export type UploadSkillResponse = {
    name: string;
    version: string;
    description?: string | null;
    tarballSha: string;
    createdAt: string;
};
export declare const registrarApi: {
    /**
     * Search for packages in the registrar
     * @param args - The search parameters
     *
     * @returns Array of matching packages
     */
    searchPackages: (args: SearchPackagesRequest) => Promise<Array<Package>>;
    /**
     * Search for packages on a specific registry
     * @param args - The search parameters including registry URL
     *
     * @returns Array of matching packages
     */
    searchPackagesOnRegistry: (args: SearchPackagesOnRegistryRequest) => Promise<Array<Package>>;
    /**
     * Get the packument (package metadata) for a package
     * @param args - The request parameters
     *
     * @returns The package packument
     */
    getPackument: (args: GetPackumentRequest) => Promise<Packument>;
    /**
     * Download a tarball for a package
     *
     * If no version is specified, the latest version is downloaded.
     * @param args - The download parameters
     *
     * @returns The tarball data as ArrayBuffer
     */
    downloadTarball: (args: DownloadTarballRequest) => Promise<ArrayBuffer>;
    /**
     * Upload a skillset to the registrar
     * @param args - The upload parameters
     *
     * @returns The upload response with package metadata
     */
    uploadSkillset: (args: UploadSkillsetRequest) => Promise<UploadSkillsetResponse>;
    /**
     * Search for skills in the registrar
     * @param args - The search parameters
     *
     * @returns Array of matching skills
     */
    searchSkills: (args: SearchSkillsRequest) => Promise<Array<Package>>;
    /**
     * Get the packument (package metadata) for a skill
     * @param args - The request parameters
     *
     * @returns The skill packument
     */
    getSkillPackument: (args: GetSkillPackumentRequest) => Promise<Packument>;
    /**
     * Download a tarball for a skill
     *
     * If no version is specified, the latest version is downloaded.
     * @param args - The download parameters
     *
     * @returns The tarball data as ArrayBuffer
     */
    downloadSkillTarball: (args: DownloadSkillTarballRequest) => Promise<ArrayBuffer>;
    /**
     * Upload a skill to the registrar
     * @param args - The upload parameters
     *
     * @returns The upload response with skill metadata
     */
    uploadSkill: (args: UploadSkillRequest) => Promise<UploadSkillResponse>;
    /**
     * Search for subagents in a registry
     * @param args - The request parameters
     *
     * @returns Array of matching subagents
     */
    searchSubagents: (args: SearchSubagentsRequest) => Promise<Array<Package>>;
    /**
     * Get the packument (package metadata) for a subagent
     * @param args - The request parameters
     *
     * @returns The subagent packument
     */
    getSubagentPackument: (args: GetSubagentPackumentRequest) => Promise<Packument>;
    /**
     * Download a tarball for a subagent
     *
     * If no version is specified, the latest version is downloaded.
     * @param args - The download parameters
     *
     * @returns The tarball data as ArrayBuffer
     */
    downloadSubagentTarball: (args: DownloadSubagentTarballRequest) => Promise<ArrayBuffer>;
};
//# sourceMappingURL=registrar.d.ts.map