/** * Typed REST client for the AI Asset Store **publisher** surface — the * curator-publish flow (`skaile source manifest publish` / `yank`). Thin * wrappers over {@link storeFetch}; every method maps 1:1 to an `/api/v1/…` * endpoint. The {@link PublisherClient} interface is injectable so the * orchestration in `commands/source-manifest-publish.ts` can be unit-tested * against a fake without a live store. * * @docLink cli/dev-guide#store-publisher */ import { type StoreConfig } from "./store-client.ts"; /** * The publisher REST surface used by the curator-publish flow. Kept minimal — * only the endpoints `runPublish` / `runYank` actually call. Response shapes * are narrowed to the fields the orchestration reads (the server returns more). */ export interface PublisherClient { /** * Identity of the caller. `username` is the Keycloak login (personal-tier * namespace); `githubLogin` is the verified GitHub handle when connected — * the namespace to publish under when it differs from the login. */ me(): Promise<{ username: string; githubLogin?: string | null; }>; /** Register (or re-register) a source; returns the created/existing row id. */ sourcesAdd(body: { url: string; ref: string; sidecarUrl?: string; sidecarRef?: string; /** * Target publisher namespace (the manifest's `publisher`). When it differs * from the caller's login username, the store resolves the CLAIMED Publisher * for it (the store must already have the claim). Omitted → the store * defaults to `@` (personal). */ namespace?: string; }): Promise<{ id: string; }>; /** List sources — used to recover an id when `sourcesAdd` rejects a dup url. */ sourcesList(): Promise>; /** Kick off a source sync; returns the async job id to poll. */ sourceSync(id: string): Promise<{ jobId: string; }>; /** Poll a job's terminal status + per-item results. */ jobGet(jobId: string): Promise<{ status: string; items?: Array<{ label: string; status: string; error?: string; }>; }>; /** Discovered publishable candidates for a synced source. */ sourceCandidates(id: string): Promise>; /** Per-asset preview — the discovered file set + resolved candidate metadata. */ assetPreview(id: string): Promise<{ discoveredFiles: string[]; candidate: { name: string; version: string; kind: string; publisherNamespace: string; }; }>; /** * Publish one asset. `dryRun` returns the would-be `{ manifest }` without * launching a job; the normal path returns `{ jobId }`. */ assetPublish(id: string, body: { ref: string; files: string[]; }, dryRun?: boolean): Promise<{ jobId?: string; manifest?: unknown; }>; /** Retract a published asset. Response body is ignored. */ assetUnpublish(id: string): Promise; /** * Read-only "can I publish under `@` right now, and if not, what's the * path?" probe. Backs the `publish --dry-run` namespace status line; its * `message` is store-authored and meant to be surfaced verbatim. */ namespaceAvailability(ns: string): Promise<{ namespace: string; status: "owned-by-you" | "claimable-by-you" | "reserved" | "available"; claimMethod?: string; message: string; }>; } /** * Construct the real HTTP-backed {@link PublisherClient}. Every call carries a * longer timeout than the default store client because publish/sync trigger * server-side clone work. * * @param config - Store connection config; defaults to {@link getStoreConfig}. * @param timeoutMs - Per-request abort timeout (default 20s). */ export declare function makeHttpPublisherClient(config?: StoreConfig, timeoutMs?: number): PublisherClient; //# sourceMappingURL=store-publisher.d.ts.map