/** * Asset management commands — search, add, remove, list, info, create, doctor. * All delegate to @skaile/workspaces/asset-manager's AssetManager class. */ import { AssetManager } from "@skaile/workspaces/asset-manager"; import { type CatalogEntry } from "@skaile/workspaces/core"; import type { CatalogAsset } from "@skaile/workspaces/plugins"; import { Command } from "commander"; /** * Copyable install ref for a store catalog asset — `kind:@/#`, * the exact shape `skaile add` accepts. */ export declare function catalogAssetRef(a: CatalogAsset): string; /** * Copyable ref for a local index entry. Uses `kind:@/` when a * publisher is known; local assets without one fall back to the bare name. */ export declare function localEntryRef(e: Pick): string; /** * Client-side text filter over catalog assets — the store's `listAssets` has no * server-side query. Case-insensitive match across name, description, publisher; * an empty query returns every asset. */ export declare function filterCatalogAssets(assets: CatalogAsset[], query: string | undefined): CatalogAsset[]; /** * Create the `skaile search` command. * * Searches across all locally indexed repos (via {@link AssetManager}) and * optionally the remote store. Results are grouped by asset kind and printed in * a compact table. Pass `--store` to limit to the remote store, `--local` to * limit to local repos, or omit both to query both sources. Accepts an optional * `kind` positional to filter by asset type and a `query` positional for * keyword matching. * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-search-command */ export declare function makeSearchCommand(): Command; /** * Soft-dep opt-in pull for `skaile add`, symmetric with the remove-orphan prompt. * For each absent body-link soft dep with a parseable ref, prompt (default No) to * also add it; on yes, add the target via `am.add`. Report-only otherwise — never * auto-adds. A non-interactive run (no TTY) prints the report-only hint instead of * prompting, so a piped `skaile add` never blocks. The clack prompt / TTY check / * loggers are injected so the decision is unit-testable without a real terminal. */ export declare function promptSoftDepAdds(am: Pick, ref: string, io: { isTTY: boolean; link?: boolean; /** `--with-soft-deps`: pull every referenced soft dep without prompting. */ withSoftDeps?: boolean; /** `--no-soft-deps`: skip the soft-dep step entirely (no prompt, no hint). */ noSoftDeps?: boolean; confirm: (message: string) => Promise; isCancel: (value: unknown) => boolean; onAdded: (line: string) => void; onError: (line: string) => void; onHint: (line: string) => void; }): Promise; /** * The `remove` counterpart to {@link promptSoftDepAdds}: after removing `ref`, * offer to also remove each soft-dep target of `ref` that is now orphaned (no * installed asset still references it). Default No — never auto-removed (removing * on a heuristic is the dangerous direction). A non-interactive run (no TTY) * prints the report-only hint instead of prompting; `--no-soft-deps` skips it. */ export declare function promptSoftDepRemovals(am: Pick, ref: string, io: { isTTY: boolean; /** `--no-soft-deps`: skip the orphan step entirely (no prompt, no hint). */ noSoftDeps?: boolean; confirm: (message: string) => Promise; isCancel: (value: unknown) => boolean; onRemoved: (line: string) => void; onHint: (line: string) => void; }): Promise; /** * Create the `skaile add` command. * * Installs a skill, agent, flow, or bundle from the catalog into the current * workspace. Resolves transitive dependencies declared in the asset's manifest * and deploys all files to the driver target directory (default: `claude-code`). * Accepts `--global` to deploy to `~/.claude` instead of the project directory. * The asset reference format is `kind:@/name#` (e.g. * `skill:@skaile/use-exa#1.0.0`). * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-add-command */ export declare function makeAddCommand(): Command; /** * Create the `skaile remove` command. * * Removes a deployed asset from the workspace by reference (`kind:name`). Cleans * up all files tracked in `.skaile/deployed.yaml` for that asset. Accepts * `--global` to target the global deployment in `~/.claude` and `--target` to * specify the driver target directory. * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-remove-command */ export declare function makeRemoveCommand(): Command; /** * Create the `skaile list` command. * * Lists the **declared** top-level dependencies from `skaile.yaml` (not the * deployed tree), each annotated with a reconciliation state — `declared`, * `installed`, or `drift`. Transitive (lock-only) deps are excluded. The * available-assets view lives in `skaile search`. Delegates to * {@link AssetManager.listDeclared}. * * `--target` selects which driver-target dir is inspected for the on-disk * install/drift check. `--global` switches to the global SSOT * (`~/.skaile/skaile.yaml`) and reports state **per backend**; `--backend ` * narrows the global view to a subset. * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-list-command */ export declare function makeListCommand(): Command; /** Store leg of the `skaile info` lookup; injected in tests to stay network-free. */ export type InfoStoreLookup = (filter: { kind?: string; }) => Promise; /** The slice of `AssetManager` the info lookup needs (kept narrow for tests). */ interface InfoManagerLike { info(ref: string): Promise; listDeployed(kind?: string): CatalogEntry[]; } export interface InfoLookupResult { entry: CatalogEntry | null; /** Why the store leg produced nothing — folded into the not-found hint. */ storeNote?: string; /** * The store leg was off by configuration (`catalog.url: local`), not down. * Keeps the hint from telling the user to retry something that will never * succeed until they change their config. */ storeDisabled?: boolean; } /** * Resolve `skaile info ` across every place the asset can live, cheapest * leg first: * * 1. **Local sources** — `AssetManager.info` (source clones + the bundled * factory tree). * 2. **Deployed assets** — this project's deploy dirs, re-scanned from disk so * an installed store asset resolves with real metadata and no network. * 3. **Catalog source** — the configured store, mapped through * {@link catalogAssetToEntry}. * * A failing store leg (unreachable host, `catalog.url: local` with no local * library, auth failure) never throws — it comes back as `storeNote` so the * caller can print an accurate hint. * * @docLink cli/commands/catalog#make-info-command */ export declare function resolveInfoEntry(am: InfoManagerLike, ref: string, opts: { projectDir: string; storeLookup?: InfoStoreLookup; }): Promise; /** * Not-found hint for `skaile info`, naming the legs that were actually searched. * A `local`-sentinel catalog is a choice, not an outage, so it gets a config * hint rather than "retry when the store is reachable". */ export declare function infoNotFoundHint(ref: string, lookup: Pick): string; /** * Create the `skaile info` command. * * Shows metadata for a catalog entry identified by `kind:name`: description, * version, source repository, required platform resources, and transitive skill * dependencies. The ref is resolved via {@link resolveInfoEntry} — local * sources, then this project's deployed assets, then the configured store — and * exits with an error (and a leg-accurate hint) when nothing matches. * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-info-command */ export declare function makeInfoCommand(): Command; /** * Create the `skaile create` command. * * Scaffolds a new skill, agent, flow, or bundle in the target directory using * the AI skill builder via {@link AssetManager.create}. Accepts `-k`/`--kind` * to specify the asset type (default: `skill`) and `-d`/`--dir` to set the * destination directory (default: current working directory). * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-create-command */ export declare function makeCreateCommand(): Command; /** * Create the `skaile doctor` command. * * Scans all deployed assets for missing transitive dependency chains. For each * gap it reports the affected asset, the missing dependency, and whether the dep * is available in a known repo (fixable) or completely absent. Delegates to * {@link AssetManager.doctor}. * * @returns Configured {@link Command} ready for `program.addCommand()`. * @docLink cli/commands/catalog#make-doctor-command */ export declare function makeDoctorCommand(): Command; export {}; //# sourceMappingURL=catalog.d.ts.map