/** * LocalCatalogSource — ICatalogSource backed by local filesystem discovery. * * Walks local repos via `discoverAssetsInTree`, computes SHA256 * over the deterministic file filter, and caches AssetDefinition rows in * the LocalIndex SQLite. * * Used by the CLI for local-only workflows. The platform uses the remote * catalog source (Phase 2). * * @docLink packages/library/concepts#local-catalog-source */ import type { CatalogAsset, CatalogAssetFilter, CatalogSourceInfo, IAssetKindRegistry, ICatalogSource } from "@skaile/workspaces/plugins"; import type { LocalIndex } from "./library.js"; /** * Render an error plus its `cause` chain into one human-readable line. * * Driver errors (e.g. libsql) stringify to just the failing SQL — the actual * SQLITE reason (`no such table`, a CHECK / NOT NULL violation, …) lives on * `err.cause`. Surfacing the chain turns an opaque `Failed query: ` into an * actionable diagnostic. Repeated messages are deduped and cycles are guarded. * * @param err - The thrown value (any type). * @returns The message with each distinct cause message appended after `: `. */ export declare function describeSyncError(err: unknown): string; /** * Optional constructor opts for {@link LocalCatalogSource}. * * @docLink packages/library/concepts#local-catalog-source */ export interface LocalCatalogSourceOptions { /** * Absolute path to a sidecar directory carrying a local-overlay manifest * (`~/.skaile/sidecars//`). When set, discovery merges the sidecar's * `skaile.manifest.yaml` on top of the in-repo config before dispatch. * * Typically populated by `openLibrary()`-based callers reading * `source.sidecarPath` from the registered source row. */ sidecarPath?: string; /** * Absolute path to a curated overlay manifest FILE — the local store's flat * `~/.skaile/store/manifests/.yaml`. When set, discovery merges this * file's `skaile.manifest.yaml`-shaped config on top of the in-repo config * (the store keeps a flat `.yaml`, not a `/skaile.manifest.yaml`, * so it can't go through `sidecarPath`). Takes precedence over `sidecarPath`. */ sidecarManifestFile?: string; } /** * Local-filesystem implementation of `ICatalogSource` (from `@skaile/plugins`). * * Backed by `discoverAssetsInTree` from `@skaile/discovery`. Upserts discovered * assets into the `LocalIndex` cache via `upsertAssetDef()`. Preset-kind assets * are skipped (handled by the Preset subsystem, not stored as AssetDefinitions). * * @docLink packages/library/concepts#local-catalog-source */ export declare class LocalCatalogSource implements ICatalogSource { private readonly library; private readonly sourceId; private readonly rootPath; private readonly registry?; readonly id: string; private readonly sidecarPath?; private readonly sidecarManifestFile?; constructor(library: LocalIndex, sourceId: string, rootPath: string, registry?: IAssetKindRegistry | undefined, options?: LocalCatalogSourceOptions); resolve(ref: string): Promise; listAssets(filter?: CatalogAssetFilter): Promise; listVersions(ref: string): Promise; fetchTarball(_ref: string, _sha256: string): Promise; listSources(): Promise; /** * Sync: discover assets in the source directory and cache them in the library. * * Runs the discovery pipeline (glob -> parse -> filter -> hash -> requires) * and upserts each discovered asset into the LocalIndex cache. * * @param syncOpts - When `includeDev` is set, assets under the source * config's `dev_paths` (e.g. `ai-assets-dev/`) are discovered and cached * too. Defaults to excluding them (a normal run). * @returns Discovery statistics, fatal `errors`, and non-fatal `advisories` * (missing sha256, unknown kind) — the latter never signal a failed index. */ sync(syncOpts?: { includeDev?: boolean; }): Promise<{ assetsFound: number; assetsUpdated: number; errors: string[]; advisories: string[]; }>; /** * When the loaded source config declares no publisher (no manifest, or a * manifest without `publisher`), substitute the canonical publisher derived * the same way the provenance walker derives it (`resolveSourcePublisher`). * Leaves manifest-mode (`assets:` inventory) and explicitly-published configs * untouched, and is a no-op outside a git checkout (`resolveSourcePublisher` * returns `undefined`) — preserving the legacy first-path-segment fallback. */ private alignPublisher; } //# sourceMappingURL=local-catalog-source.d.ts.map