/** * Patch operations — extract, generate, apply patches for skill improvement. * * Patches allow editing deployed assets from remote repos and contributing * changes back upstream via PR. */ import type { CatalogEntry } from "./models.js"; /** * Copy an asset's source directory into a patch working directory for editing. * * @param entry - The catalog entry to extract * @param patchDir - Base directory where extracted copies are placed * @returns Absolute path to the extracted copy (`/-`) * @docLink packages/core/api-reference#extract-for-patch */ export declare function extractForPatch(entry: CatalogEntry, patchDir: string): string; /** * Generate a unified diff between an original and patched directory using `diff -ruN`. * * @param originalDir - Unmodified copy of the asset directory * @param patchedDir - Modified copy of the asset directory * @returns Patch content string, or `null` if there are no differences (or on error) * @docLink packages/core/api-reference#generate-patch */ export declare function generatePatch(originalDir: string, patchedDir: string): string | null; /** * Apply a unified diff patch file to a directory using `patch -p1`. * * @param targetDir - Directory to apply the patch to * @param patchFile - Path to the `.patch` file * @returns `true` on success, `false` if the patch file is missing or the command fails * @docLink packages/core/api-reference#apply-patch */ export declare function applyPatch(targetDir: string, patchFile: string): boolean; /** * Return the paths of all `.patch` files in a directory. * * @param patchDir - Directory to scan for `.patch` files * @returns Array of absolute paths; empty array when `patchDir` does not exist * @docLink packages/core/api-reference#list-patches */ export declare function listPatches(patchDir: string): string[]; /** * Write patch content to a file, creating parent directories as needed. * * @param patchPath - Destination file path (including `.patch` extension) * @param content - Unified diff content to write * @docLink packages/core/api-reference#save-patch */ export declare function savePatch(patchPath: string, content: string): void; /** * Read the content of a patch file. * * @param patchPath - Path to the `.patch` file * @returns File content as a string, or `null` if the file does not exist * @docLink packages/core/api-reference#read-patch */ export declare function readPatch(patchPath: string): string | null; //# sourceMappingURL=patch.d.ts.map