/** * `git clone --no-checkout ` — protocol-permitting * (this is the one gitvault git invocation allowed to touch the network), * hooks and terminal prompts still neutralized. `targetDir` must not * already exist (git's own clone precondition). */ export declare function cloneGitvaultRemote(remoteUrl: string, targetDir: string): Promise; export interface GitvaultHandoffRestoreOptions { /** The freshly cloned repository. */ dir: string; /** The stash-shaped commit oid (design D1) — must already be reachable in `dir`'s object database (a retention root, materialized by clone). */ stash_oid: string; /** * ``'s first parent (design D1's `base_head_oid`). When * omitted it is read directly off the commit (`git rev-parse * ^1`) — the object already carries it, so a caller resuming * from the sealed envelope's `checkpoint.commit_oid` alone needs no * second value to agree with it. */ base_head_oid?: string; /** The vault's default branch name (e.g. from the head symref, stripped of `refs/heads/`). Read from the fresh clone's `HEAD` symref when omitted; falls back to `main`. */ branch_hint?: string | null; } export interface GitvaultHandoffRestoreResult { branch: string; base_head_oid: string; stash_oid: string; } /** * Check out the base, land on a real branch (never left detached), then * `git stash apply --index ` — staged, unstaged, deleted, and * untracked changes come back distinctly (verified against real git 2.43 * plumbing during design). Every step here is LOCAL — no network — so it * runs fully hardened. */ export declare function applyHandoffCheckpoint(options: GitvaultHandoffRestoreOptions): Promise; /** * `--to ` wins; otherwise the vault's address-form name (`org/name` → * `name`) when the claim response carried one, otherwise the vault id. * Always absolute — `cloneGitvaultRemote` runs in `tmpdir()`, so a * relative destination must be resolved against the CALLER's cwd first. */ export declare function resolveResumeTargetDir(to: string | undefined, address: string | null | undefined, vaultId: string): string; /** The commit message (the Handoff Note, verbatim) — `null` when `oid` cannot be read (e.g. not yet present). */ export declare function readGitCommitMessage(dir: string, oid: string): Promise; /** * Add `.run402/` to `dir`'s LOCAL `.git/info/exclude` — never `.gitignore` * (kygit-invite design D5): the ignore file is part of the captured tree * and touching it would break exact-state on the first `git status` after * `join`/`resume`. `.git/info/exclude` is local-only, per-clone git state, * exactly like the id-pins in `gitvault-address.ts`. Idempotent — a second * call on an already-excluding checkout is a no-op. Used by BOTH `join` and * `resume` (restore is kind-agnostic, kygit-invite design D5). */ export declare function excludeMessagingCacheFromGit(dir: string): Promise; /** * Read-only counterpart to {@link excludeMessagingCacheFromGit} — whether * `dir`'s LOCAL `.git/info/exclude` already carries `.run402/` (kygit-invite * design D9's risk list: "`.git/info/exclude` is per-clone and silent" → * `repos view` reports `messaging_cache_excluded` so the state is visible). * `false` on any read failure (not a repository, no exclude file yet) — * never throws. */ export declare function isMessagingCacheExcludedFromGit(dir: string): Promise; //# sourceMappingURL=gitvault-restore.d.ts.map