export type FromRef = { owner: string; repo: string; /** Repo-relative folder to scaffold ("" = the whole repo). */ subPath: string; /** Branch or tag ("" = the repo's default branch). */ gitRef: string; }; /** Reject absolute paths, `..`, `.`, and empty segments in repo-relative paths. */ export declare function assertSafeRepoRelativePath(repoRelativePath: string, label: string): void; /** Join `relativePath` under `baseDir` and ensure the result cannot escape it. */ export declare function resolveWithin(baseDir: string, relativePath: string): string; /** * Parse a scaffold source. Accepts `owner/repo[/sub/path][@ref]`, the same * with a `github.com` / `git@github.com:` prefix, and GitHub tree URLs * (`github.com/owner/repo/tree//`). Returns `undefined` when * the source doesn't name a GitHub repo. */ export declare function parseFromRef(raw: string): FromRef | undefined; /** * Shallow-clone the repo into a temp dir. Returns the dir and its cleanup. * `remoteUrl` overrides the GitHub URL (tests clone from a local repo). * * A named folder (`subPath`) on GitHub is fetched with a sparse checkout so * installing one cookbook does not clone every other skill in the repo. Local * remotes (tests) and whole-repo scaffolds stay a normal clone: a file:// * remote cannot serve `--filter=blob:none`, and the base project wants every * file. If this git is too old for a partial clone, we take the whole repo * rather than fail an install over a speed optimisation. */ export declare function cloneGitHubRepo(ref: FromRef, remoteUrl?: string): Promise<{ dir: string; cleanup: () => Promise; }>; /** * Why a clone failed, as the user should read it. A missing `git` is a * different problem from a repo that will not fetch, and burying ENOENT * under "is the repo accessible?" hid the one they can actually fix. * * Exported for tests. */ export declare function formatCloneFailure(input: { url: string; gitRef: string; error: unknown; }): string; /** * Fetch the source and copy the folder's contents (or the whole repo) flat into * `targetDir`, substituting `__APP_NAME__`. Returns the source folder, when * one was named, for the CLI's success line. */ export declare function scaffoldFromGitHub(payload: { ref: FromRef; targetDir: string; appName: string; /** Test-only override — clone from this URL/path instead of github.com. */ remoteUrl?: string; }): Promise; //# sourceMappingURL=from.d.ts.map