@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
36 lines (35 loc) • 1.58 kB
TypeScript
export interface GitResult {
ok: boolean;
output: string;
error?: string;
}
export type RunStoreGit = (cwd: string, args: string[]) => Promise<GitResult>;
export type StoreMergeStatus = "unchanged" | "updated" | "conflict" | "busy" | "error";
export interface StoreMergeResult {
status: StoreMergeStatus;
detail: string;
conflicts?: string[];
committedLocalWrites?: boolean;
/** Where the pre-merge HEAD was kept when local and remote had both moved. */
backupRef?: string;
}
/** Pre-merge HEADs, one ref per diverged merge, named by the time it was taken (store-cleanup.ts prunes them). */
export declare const BACKUP_REF_PREFIX = "refs/phren/backup/";
export interface StoreMergeOptions {
git: RunStoreGit;
/** A head advertised by ls-remote. Lets polling avoid an unnecessary fetch. */
advertisedHead?: string;
/** Callers that just made their own commit can skip the auto-save commit. */
commitLocalWrites?: boolean;
commitMessage?: string;
}
/** The staged diff, added lines only, for `storeAutoCommitBlocker`. */
export declare const STAGED_DIFF: string[];
/**
* Fetch and integrate a store's configured upstream without rebasing local
* commits. Conflicts in tasks.md (per task id against the merge base), the
* generated summary and topic blocks, findings and the task archive resolve
* automatically (see conflict-resolve.ts). Any other conflict aborts the
* merge and names its files.
*/
export declare function mergeStoreUpstream(cwd: string, options: StoreMergeOptions): Promise<StoreMergeResult>;