mlx-bun library API
    Preparing search index...

    The Hub side a host may supply: what downloads a repo and what pushes a directory. Without them the catalog does neither.

    interface CatalogHub {
        transfers?: {
            snapshot(): readonly DownloadRow[];
            start(id: string): void;
        };
        canPublish?(): boolean;
        download?(
            id: string,
            options: {
                onProgress?: DownloadProgress;
                revision?: string;
                signal?: AbortSignal;
            },
        ): Promise<string>;
        pickDefault?(
            signal?: AbortSignal,
        ): Promise<{ directory: string; id: string }>;
        publish?(
            directory: string,
            request: PublishRequest,
        ): Promise<{ url: string }>;
    }
    Index
    transfers?: { snapshot(): readonly DownloadRow[]; start(id: string): void }

    Transfers that outlive their caller (the web's): start admits one at once and throws a CatalogFailure coded duplicate-download for a repo already running; snapshot is the rows to show. A host without them lists the hub library's own tracker.

    • Fetches id into the hub cache; resolves to its snapshot directory.

      Parameters

      • id: string
      • options: { onProgress?: DownloadProgress; revision?: string; signal?: AbortSignal }

      Returns Promise<string>

    • The host's automatic model choice (CatalogEntry's directory and id); without it the catalog makes none.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<{ directory: string; id: string }>