/** * Asset deployment — copies assets into framework dirs by default (self-contained, * cache-safe, portable); `--link` opts into a symlink for the local-path dev loop. */ import type { CatalogEntry, DriverTarget, SourceDeclaration } from "@skaile/workspaces/core"; import type { Log } from "./renderers.js"; export type { Log } from "./renderers.js"; /** * Options controlling where and how assets are deployed. * * @docLink packages/asset-manager/api-reference#installer */ export interface DeployOptions { /** Agent framework to target (determines framework-specific directory layout). Defaults to `"claude-code"`. */ driverTarget?: DriverTarget; /** When `true`, deploy into the global Skaile cache rather than a project workspace. */ global?: boolean; /** Absolute path to the workspace root. Defaults to `process.cwd()`. */ cwd?: string; /** * Opt into a symlink (the author dev-loop) instead of a copy — honoured only * when the source has a real local path. Machine-local / not for committing; * for store/factory sources (no stable local path) it is a no-op (still copy). */ link?: boolean; } /** * Deploy a single asset to the framework-specific directory. * * Copies by default — self-contained, cache-safe, and portable, so a deployed * asset survives a `cache clean` of its source and a committed `.claude/` stays * machine-independent. `opts.link` opts into a symlink (the live dev-loop), but * only when the source has a real local path; store/factory sources (no stable * local path) ignore it and still copy. Agents are rendered via the enriched * `installAgent` path which resolves abilities, contracts, and framework * fragments before writing the native agent file. * * @param entry - Catalog entry describing the asset to deploy. * @param repositories - Repository declarations from `skaile.yaml` (used to * determine whether the source is a local path or a remote clone). * @param opts - Deployment target options. * @param log - Optional logger callback for progress messages. * @returns `true` when the asset was deployed successfully. * @docLink packages/asset-manager/api-reference#installer */ export declare function deployAsset(entry: CatalogEntry, repositories: Record, opts?: DeployOptions, log?: Log): boolean; /** * Deploy all resolved assets, applying patches where configured. * * Already-deployed assets are skipped unless their deployed manifest content differs * from the source. This handles copies that have gone stale after a source update. * In copy mode (the default, `!opts.link`) an existing **symlink** dest is healed: * it is removed and re-deployed as a real copy, so an old/legacy symlink deploy is * silently upgraded. With `opts.link` an existing symlink is left alone. * * @param resolved - Catalog entries to deploy (output of `resolveAll`). * @param repositories - Repository declarations from `skaile.yaml`. * @param patches - Map of `kind:name` → patch file path for patch application. * @param opts - Deployment target options. * @param log - Optional logger callback for progress messages. * @returns Array of asset refs (`kind:name`) that were newly deployed in this call. * @docLink packages/asset-manager/api-reference#installer */ export declare function deployAll(resolved: CatalogEntry[], repositories: Record, patches: Record, opts?: DeployOptions, log?: Log): string[]; /** * Remove a deployed asset from the framework directory. * * Removes symlinks with `unlink`; removes copied directories with `rm -rf`. * * @param kind - Asset kind (`skill`, `agent`, `prompt`, `flow`, `contract`). * @param name - Asset name as registered in the catalog. * @param opts - Deployment target options (must match the options used at install time). * @returns `true` if the asset existed and was removed; `false` if it was not deployed. * @docLink packages/asset-manager/api-reference#installer */ export declare function removeAsset(kind: string, name: string, opts?: DeployOptions): boolean; /** * Create a minimal scaffold directory for a new asset. * * Writes the appropriate manifest file (`SKILL.md`, `AGENT.md`, `CONTRACT.md`, * `.bundle.yaml`, `.flow.yaml`, or `.prompt.md`) inside a * new `//` directory. * * @param name - Asset name (also used as the directory name). * @param kind - Asset kind: `skill` | `agent` | `bundle` | `flow` | `prompt` | `contract`. * @param destDir - Parent directory to create the asset in. * @returns `{ ok: true, path }` on success, `{ ok: false, path: errorMessage }` if the * directory already exists. * @docLink packages/asset-manager/api-reference#installer */ export declare function createScaffold(name: string, kind: string, destDir: string): { ok: boolean; path: string; }; //# sourceMappingURL=installer.d.ts.map