/** * Publish manifest — `skaile.manifest.yaml` * * What a repo PUBLISHES: the `publisher` / `version` / `assets[]` that used to * live in the publication half of `skaile.yaml`, plus a per-asset dependency * graph, store-listing metadata, and an optional curator `source:` pointer. * * ── Two files, two codecs ────────────────────────────────────────────────── * * skaile.yaml → SkWorkspaceConfig (workspace + consumption) * skaile.manifest.yaml → SkPublishManifest (publication) ← this module * * A repo can have either file, both, or neither: a pure workspace has only * `skaile.yaml`; a pure asset repo (e.g. `ai-assets`) has only * `skaile.manifest.yaml`; a repo that is both has both. * * ── One format, three roles ──────────────────────────────────────────────── * * First-party `source:` absent → bytes live in this repo (`root`/`files`). * Curator/sidecar `source:` present → bytes come from the referenced upstream, * verified by `sha256`. * * `decodeSkaileManifest` mirrors `decodeSkaileYaml`: total (never throws), * returns {@link Diagnostic}s. Dep-ref strings are validated with `parseAssetRef`. */ import type { Diagnostic } from "./workspace-config.js"; /** One file inside a curated asset, pinned to an exact upstream blob hash. */ export interface ManifestFileEntry { path: string; /** 64-hex sha256 of the upstream blob. */ sha256: string; } /** * One entry in a manifest's `assets:` list. Either `root:` (recursive walk) or * `files:` (explicit list, supports globs for first-party; the granular * `{path, sha256}` form for curated upstream verification) declares which paths * constitute the asset. `version:` overrides the manifest-level version. * * @docLink packages/core/publish-manifest#asset-entry */ export interface AssetEntry { kind: string; name: string; root?: string; /** * Explicit file listing. First-party manifests use bare `string[]` (globs, * fast-glob). Curated entries may use the granular `{path, sha256}` form so * the resolver fetches + verifies exact upstream blobs without a full clone. */ files?: string[] | ManifestFileEntry[]; version?: string; /** Per-asset publisher override (e.g. for curator/mirror repos). */ publisher?: string; /** * Canonical dep refs (`kind:@/name[#version]`) — same grammar as * `SkWorkspaceConfig.dependencies`. Authoritative for this asset's resolved * deps. (Was `requires` in `.skaile-source.yaml`.) */ dependencies?: string[]; /** * Author-pinned composite sha256 over the asset's `files`/`root` (same * deterministic algorithm as the walker + discovery). Optional locally; * REQUIRED on store publish. (Was `.skaile-source.yaml` `assets[].sha256`.) */ sha256?: string; /** * Curator override: this single asset's bytes come from a different upstream * than the manifest-level `source`. Absent → inherit manifest `source` (or * first-party when that is also absent). */ source?: ManifestSource; description?: string; keywords?: string[]; category?: string; license?: string; homepage?: string; } /** * Upstream the bytes come from when a manifest curates a repo it does not own. * Absent → first-party (bytes live in the manifest's own repo). * * @docLink packages/core/publish-manifest#manifest-source */ export interface ManifestSource { url: string; /** 40-char commit the curated bytes are pinned to. */ commit?: string; } /** * Signing/attribution recorded when a manifest is published on behalf of others. * * @docLink packages/core/publish-manifest#manifest-provenance */ export interface ManifestProvenance { curator: string; signed_by?: string; } /** * Parsed `skaile.manifest.yaml` — what a repo publishes. * * @docLink packages/core/publish-manifest#sk-publish-manifest */ export interface SkPublishManifest { publisher?: string; version?: string; /** Repo-level store defaults inherited by assets unless overridden per-entry. */ license?: string; homepage?: string; /** * Repo-relative path prefixes holding dev-only assets — excluded from * discovery/publish unless `--dev`. (Was `.skaile-source.yaml` `dev_paths`.) */ dev_paths?: string[]; /** * Curator mode: the single upstream all assets in this file come from. A * per-asset `source` overrides it. Absent → first-party (own repo). */ source?: ManifestSource; /** Present when this manifest is curated/published on behalf of another author. */ provenance?: ManifestProvenance; assets?: AssetEntry[]; } /** Result of {@link decodeSkaileManifest}: the manifest plus any notes. */ export interface ManifestDecodeResult { manifest: SkPublishManifest; diagnostics: Diagnostic[]; } /** The single fixed filename for a publish manifest. */ export declare const SKAILE_MANIFEST_FILENAME = "skaile.manifest.yaml"; /** * Decode `skaile.manifest.yaml` text into a {@link SkPublishManifest} plus * {@link Diagnostic}s. Total — never throws: a YAML syntax error or non-object * root is reported as an `error`-severity diagnostic with an empty manifest. * Malformed `assets[].dependencies` refs are reported as `warning`s (validated * via `parseAssetRef`) rather than silently dropped. * * Pair with {@link encodeSkaileManifest} for round-tripping. * @docLink packages/core/publish-manifest#decode-skaile-manifest */ export declare function decodeSkaileManifest(text: string): ManifestDecodeResult; /** * Encode a {@link SkPublishManifest} to canonical `skaile.manifest.yaml` text: * deterministic key order, only defined fields, `lineWidth: 120` (mirrors * `encodeSkaileYaml`). * @docLink packages/core/publish-manifest#encode-skaile-manifest */ export declare function encodeSkaileManifest(manifest: SkPublishManifest): string; /** * Load and decode `/skaile.manifest.yaml`. Returns `null` when the file is * absent or unparseable (mirrors `loadSkWorkspaceConfig`'s tolerant contract). * @docLink packages/core/publish-manifest#load-sk-publish-manifest */ export declare function loadSkPublishManifest(dir: string): SkPublishManifest | null; /** * Encode and write a manifest to `/skaile.manifest.yaml`, creating the * directory if needed. Returns the absolute path written. * @docLink packages/core/publish-manifest#save-sk-publish-manifest */ export declare function saveSkPublishManifest(dir: string, manifest: SkPublishManifest): string; //# sourceMappingURL=publish-manifest.d.ts.map