@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
29 lines • 1.67 kB
TypeScript
export type Kind = "rev" | "range" | "revish" | "object" | "blobref" | "ref" | "refpat" | "branch" | "refspec" | "msg" | "count" | "mode" | "oid" | "filter" | "fmt" | "iso" | "relpath" | "gitpath" | "path" | "worktree" | "source" | "target";
/** A path-kind argument the hand still has to confine on the device before git runs. */
export interface TypedPath {
/** path: inside the repo; worktree: outside the git dirs (write); source: a local url read; target: a local url written. */
readonly kind: "path" | "worktree" | "source" | "target";
readonly value: string;
}
export type Item = string | {
readonly kind: Kind;
} | {
readonly prefix: string;
readonly kind: Kind;
} | {
readonly optional: readonly Item[];
} | {
readonly repeat: readonly Item[];
readonly min: number;
};
/**
* The filesystem path a local url names (v2.10): ONLY an absolute `file:///` url whose decoded path is already normal
* (no `.`, `..` or empty segment, no trailing slash), which is all the memory component sends. A bare or relative path or
* a leading `~` is left to git's own resolution, so it is refused, never resolved here.
*/
export declare function localUrlPath(value: string): string | undefined;
/** Every admitted shape, per subcommand: the memory component's call sites, nothing wider. */
export declare const SHAPES: Readonly<Record<string, readonly (readonly Item[])[]>>;
/** The path arguments of the first shape `args` matches exactly, or undefined when no shape admits them. */
export declare function matchShape(sub: string, args: readonly string[]): readonly TypedPath[] | undefined;
//# sourceMappingURL=hand-run-grammar.d.ts.map