/** * `skaile source manifest publish` / `yank` — the curator-publish flow. Takes a * locally-curated sidecar manifest (over a foreign public GitHub repo) and: * * 1. Pushes the curated `skaile.manifest.yaml` to the curator's OWN public * "sidecar" repo (bytes stay in the foreign source; the sidecar holds only * the manifest pointing at it). * 2. Registers the foreign source + the sidecar (url + pinned commit) with the * store, syncs it, and publishes each curated asset. * * `yank` is the inverse: unpublish each currently-published asset of the source. * * The store REST surface is reached through the injectable {@link PublisherClient} * (default HTTP client); git side-effects go through an injectable `spawn`. Both * seams keep the pure helpers + orchestration unit/integration-testable without a * live store or a real remote. * * @docLink cli/commands/source#manifest-publish */ import { spawnSync } from "node:child_process"; import { type SkPublishManifest } from "@skaile/workspaces/core"; import { type PublisherClient } from "../store-publisher.ts"; /** Injectable spawn contract — the subset of `spawnSync` these helpers use. */ type SpawnLike = typeof spawnSync; /** * Return a copy of `manifest` normalized for publication under `namespace`: * the top-level `publisher` is set to `namespace` and every per-asset * `publisher` override is removed so all assets inherit the top-level one. * Pure — the input is not mutated. */ export declare function normalizePublishedManifest(manifest: SkPublishManifest, namespace: string): SkPublishManifest; /** * The sidecar repo URL previously associated with a source `slug`, if any. * Reads `settings.sidecarRepos?.[slug]?.repo`. */ export declare function getSidecarRepo(slug: string): string | undefined; /** * Persist the sidecar repo URL for a source `slug`, preserving every other * settings key. Stored as an object (`{ repo }`) so a `path` (or other fields) * can be added later without a schema migration. */ export declare function saveSidecarRepo(slug: string, repo: string): void; /** * Clone the curator's sidecar repo, write the curated manifest at its root, and * commit + push. Returns the pushed commit sha (used to pin the store source). * * Idempotent re-publish: when the manifest is unchanged `git commit` fails with * "nothing to commit" — we swallow that and return the current HEAD so a no-op * re-run still yields a valid pin. Any push/auth failure surfaces as a thrown * Error carrying git's stderr. */ export declare function pushSidecarManifest(opts: { sidecarRepoUrl: string; manifestText: string; spawn?: SpawnLike; }): { commitSha: string; }; /** * `source manifest publish ` — publish a curated sidecar manifest to the * store. See the module header for the full flow. Store calls go through * `client` (default HTTP); git side-effects through `spawn` (default * `spawnSync`). The auth gate is enforced only for the default HTTP client so * injected fakes bypass it. */ export declare function runPublish(arg: string, opts: { projectDir: string; as?: string; sidecarRepo?: string; ref?: string; dryRun?: boolean; }, client?: PublisherClient, spawn?: SpawnLike): Promise; /** * `source manifest yank ` — unpublish the source's published assets (all, * or the single asset matching `opts.asset`'s name). Auth-gated like publish. */ export declare function runYank(arg: string, opts: { projectDir: string; asset?: string; }, client?: PublisherClient): Promise; export {}; //# sourceMappingURL=source-manifest-publish.d.ts.map