/** * Manifest write-back — on `skaile library add`, when the upstream repo has * no `skaile.manifest.yaml`, run discovery and write a CLI-generated manifest. * * Behaviour by ownership: * - owner: write file, leave to commit upstream (CLI nudges) * - contributor: write file, register in .git/info/exclude (silent) * - reader: same as contributor * * @docLink packages/library/concepts#manifest-writeback */ import type { DiscoveredAsset } from "@skaile/workspaces/discovery"; import type { LibraryOwnership, LibraryStructure } from "../user-library.js"; export interface WriteManifestInput { libraryPath: string; ownership: LibraryOwnership; structure: LibraryStructure; } export interface WriteManifestResult { wrote: boolean; manifestPath: string; } export declare function writeManifestIfMissing(input: WriteManifestInput): Promise; export interface WriteCuratedManifestInput { /** Absolute path to the target manifest file (e.g. `/manifests/.yaml`). */ manifestFile: string; /** Repo-level publisher (bare, no leading `@`) inherited by every asset. */ publisher: string; /** Assets to inventory, as returned by `discoverAssetsInTree`. */ assets: DiscoveredAsset[]; /** Overwrite an existing file. Default `false` (idempotent — never clobbers). */ force?: boolean; /** * When `true`, EVERY asset inherits the top-level `publisher` — no per-asset * `publisher:` is stamped. Set by `source manifest init`: on the glob path each * `DiscoveredAsset.publisher` is the bare first path segment (`scripts`/`skills`), * so the default divergence-stamp would clobber the intended org/`--publisher` * with junk per-asset overrides. Default `false` (stamp on divergence). */ inheritPublisher?: boolean; } export interface WriteCuratedManifestResult { wrote: boolean; manifestPath: string; /** Number of assets written (0 when `wrote` is false). */ assetCount: number; } /** * Serialize a curated `skaile.manifest.yaml` (`SkPublishManifest` with an * `assets:` inventory) from a discovery run to an explicit file path. Used by * `skaile source manifest init` to author a manifest OVER a source the user * does not own — the file is stored outside that source, under the local store * catalog (`~/.skaile/store/manifests/.yaml`). * * Idempotent: when the target file already exists it is left untouched * (`wrote: false`) unless `force` is set — a rebuild is a future phase. */ export declare function writeCuratedManifest(input: WriteCuratedManifestInput): WriteCuratedManifestResult; //# sourceMappingURL=manifest-writeback.d.ts.map