UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

24 lines (23 loc) • 1.28 kB
import { z } from "zod"; /** A branch name the phone may ask for: plain characters, no leading dash or * dot, and `git check-ref-format --branch` has the final say. */ export declare const worktreeBranch: z.ZodString; export declare const launchWorktreeSchema: z.ZodObject<{ branch: z.ZodString; }, z.core.$strict>; export type LaunchWorktreeRequest = z.infer<typeof launchWorktreeSchema>; /** The worktree folder's name for a branch: `phren/fix-login` is `phren-fix-login`. */ export declare function worktreeFolderName(branch: string): string; export interface LaunchWorktree { /** Where the agent starts: the same folder inside the new worktree as the project folder in its repository. */ cwd: string; /** The new worktree's root. */ path: string; branch: string; /** Removes the worktree and its branch when the launch fails before anything ran there. */ discard(): Promise<void>; } /** Git's empty tree: an attribute source that cannot name a repository .gitattributes. */ export declare const EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; /** Creates the worktree, or refuses with a message the phone shows as is. */ export declare function createLaunchWorktree(cwd: string, request: LaunchWorktreeRequest): Promise<LaunchWorktree>;