@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
26 lines • 2.01 kB
TypeScript
import { type TypedPath } from "./hand-run-grammar.ts";
/** The hand's git is at least 2.29 (every subcommand in the allowlist is then a builtin, never an alias or a PATH lookup). */
export declare function gitIsSupported(env: Record<string, string>): Promise<boolean>;
/** The run's working directory: resolved against the scope root, canonical, and an existing directory. */
export declare function runDirectory(root: string, cwd: string): Promise<string>;
/**
* `GIT_INDEX_FILE` must name a file inside the repository's own git directory (or the common one of a linked worktree).
* The hand asks git for both itself, canonicalizes the given file's PARENT (the file and its `.lock` may not exist yet),
* and hands the child the canonical path; anything else is refused.
*/
export declare function confinedIndexFile(value: string, cwd: string, env: Record<string, string>): Promise<string>;
/** Any `url.*` key (insteadOf, pushInsteadOf) in the run's effective config: git could rewrite a judged url (V5). */
export declare function hasUrlRewrites(cwd: string, env: Record<string, string>): Promise<boolean>;
/** A filesystem location a planned git call reads or writes outside the confinement rules, for the hand's policy. */
export interface PolicyTarget {
readonly operation: "read" | "write";
readonly canonicalPath: string;
}
/**
* Confines the typed path arguments of a planned git call (v2.6/v2.7). A `path` must lie inside the worktree or the git
* directory. A `worktree` (add/remove) must lie outside the git directories, where a worktree would install hooks, and is a
* policy WRITE. A local url (`source` read, `target` written) may live anywhere (a memory mirror does), so it must name a
* git dir in strict canonical shape, and that dir is handed to the policy instead of being confined.
*/
export declare function confinePaths(paths: readonly TypedPath[], cwd: string, env: Record<string, string>): Promise<readonly PolicyTarget[]>;
//# sourceMappingURL=hand-run-checks.d.ts.map