run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
65 lines • 3.6 kB
TypeScript
/**
* `git clone --no-checkout <remoteUrl> <targetDir>` — protocol-permitting
* (this is the one vault 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 cloneVaultRemote(remoteUrl: string, targetDir: string): Promise<void>;
export interface VaultHandoffRestoreOptions {
/** 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;
/**
* `<stash_oid>`'s first parent (design D1's `base_head_oid`). When
* omitted it is read directly off the commit (`git rev-parse
* <stash_oid>^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 VaultHandoffRestoreResult {
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 <stash_oid>` — 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: VaultHandoffRestoreOptions): Promise<VaultHandoffRestoreResult>;
/**
* `--to <dir>` wins; otherwise the vault's address-form name (`org/name` →
* `name`) when the redeem response carried one, otherwise the vault id.
* Always absolute — `cloneVaultRemote` 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<string | null>;
/**
* 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 `vault-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<void>;
/**
* 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<boolean>;
//# sourceMappingURL=vault-restore.d.ts.map