/** * `gsk sb-git clone-url --execute` — client-side post-processing for the * backend `clone-url` action so the user gets an actually-cloned repo, * not a snippet they have to paste. * * Why client-side: the backend `clone-url` adaptor in * `backend/tool_call/sb_git_tool_call.py` deliberately returns * placeholders (`$GSK_API_KEY`, `$GSK_HOST`) — it never embeds secrets * in stdout because the response can be logged / pasted / screenshotted. * The substitution + `git clone` subprocess therefore lives in the CLI, * which already has the API key in process memory from `gsk login` and * runs on the user's machine where `git` is. * * Behavior: * - Substitutes `$GSK_API_KEY` and `$GSK_HOST` in the response URL with * the in-process auth + base-url, never echoing the substituted URL * to stdout (token would leak to logs / shell history). * - Spawns `git clone ` with `--quiet` so the * URL doesn't appear in progress output. Git still uses stderr for * real errors; modern git redacts URL passwords in those, but pass * `GIT_TERMINAL_PROMPT=0` so a bad token fails fast instead of * prompting for credentials. * - Returns the exit code so the caller can propagate it. */ /** Shape of the `data` field returned by the backend `clone-url` action. */ export interface CloneUrlData { repo: string; url: string; commands?: string[]; hint?: string; } /** * Interpolate the `$GSK_API_KEY` / `$GSK_HOST` placeholders in the * backend's URL template. Throws on missing inputs or unexpected * template shapes — never returns a half-substituted URL that would * fail with a confusing 403. */ export declare function interpolateCloneUrl(template: string, apiKey: string, host: string): string; /** Normalize stale server templates before execute mode spawns git. */ export declare function normalizeCloneUrlForGit(cloneUrl: string): string; /** Strip protocol + trailing slash from a base URL to get a bare host. */ export declare function deriveHost(baseUrl: string): string; /** * Resolve the destination path. Default: the repo name in the current * directory. If the user passed an explicit dest, use that. Reject when * the destination already exists + non-empty so we don't surprise the * user by silently merging into an existing tree. */ export declare function resolveCloneDest(repo: string, explicit: string | undefined): string; /** * Run `git clone ` as a subprocess. Returns the * promise of the exit code. stdin is ignored; stdout/stderr are * inherited so the user sees real-time progress. */ export declare function spawnGitClone(cloneUrl: string, dest: string): Promise; /** * End-to-end: take a `clone-url` JSON response + the in-process auth, * run `git clone` to `explicitDest` (or default), and surface the * outcome. * * Returns 0 on success, non-zero on any failure path (matches the * `git clone` exit-code contract the caller wants to propagate via * `process.exit`). */ export declare function executeCloneUrl(opts: { data: CloneUrlData; apiKey: string; baseUrl: string; explicitDest: string | undefined; }): Promise; //# sourceMappingURL=sb-git-clone.d.ts.map