UNPKG

@phren/cli

Version:

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

36 lines (35 loc) • 1.75 kB
import { type Json } from "./protocol.js"; export declare const worktreeIdPattern: RegExp; /** Someone known to be working in a worktree: a fan-out job from its * manifest, or a sub-agent whose own transcript runs there. */ export interface WorktreeWorker { /** The worker's working directory; a worktree is matched when this is it or inside it. */ cwd: string; label: string; provider: string; /** This conversation's public child id, when the worker is one of its agents. */ child?: string; state?: string; } export declare function worktreeId(abs: string): string; /** Relative to the repository when the worktree lives inside it (the usual * `.claude/worktrees/agent-*`), otherwise with the home folder shortened. */ export declare function displayPath(abs: string, roots: string[]): string; /** The pane repository's other worktrees with branch, HEAD, commits ahead of * and behind this pane's HEAD, uncommitted file count and, when known, the * worker editing there. */ export declare function gitWorktrees(cwd: string, workers?: WorktreeWorker[]): Promise<Json>; /** The checkout for one listed worktree id of the pane's repository, or a * 404; never a path the phone supplied. */ export declare function resolveWorktree(cwd: string, id: unknown): Promise<string>; /** One listed worktree id resolved against the pane's repository: its checkout, * branch, the primary checkout, the repository root the id was listed from and * whether Git has it locked. */ export interface ResolvedWorktree { abs: string; branch: string | null; main: string | undefined; root: string; locked: boolean; } export declare function resolveWorktreeEntry(cwd: string, id: unknown): Promise<ResolvedWorktree>;