trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
44 lines • 1.91 kB
TypeScript
/**
* Per-lane git worktree provisioning (ADR 0014 Phase 2 / W5).
*/
export declare function laneShortId(laneId: string): string;
export declare function laneGitBranch(laneId: string): string;
export declare function defaultWorktreePath(trellisDir: string, laneId: string): string;
export declare function isGitRepo(rootPath: string): boolean;
export declare function resolveBaseRef(rootPath: string, baseBranch: string): string;
export declare function provisionWorktree(opts: {
rootPath: string;
worktreePath: string;
branch: string;
baseRef: string;
}): void;
export declare function removeWorktree(opts: {
rootPath: string;
worktreePath: string;
branch?: string;
deleteBranch?: boolean;
}): void;
/**
* Commit whatever the agent left in the worktree (ADR 0038).
*
* The working tree is the source of truth for file bytes: auto-saving it
* ensures the lane branch captures the agent's edits even when the agent
* never ran an explicit `git commit`. No-ops when the worktree is clean.
*/
export declare function commitWorktree(worktreePath: string, message: string): {
committed: boolean;
commitHash?: string;
};
/**
* Merge a lane branch into the current HEAD of the main worktree (ADR 0038).
*
* The lane branch holds the agent's actual bytes; the merge (not the op-log)
* is what moves those bytes to the integration head. `up-to-date` means no
* new commit was needed; `failed` means a merge conflict — the caller should
* abort the promote (git is the authority, so a conflicted merge cannot be
* papered over with a synthesized file state).
*/
export declare function mergeLaneWorktree(rootPath: string, branch: string, message: string): 'merged' | 'up-to-date' | 'failed';
/** Resolve the current HEAD commit of a worktree/repo. */
export declare function revParseHead(rootPath: string): string;
//# sourceMappingURL=lane-worktree.d.ts.map