/** * Durable, path/machine-independent workspace id derived from git history. * * DESIGN: * - The pure function `computeDurableWorkspaceId` is I/O-free and unit-testable * with no filesystem dependency. * - The I/O function `durableWorkspaceId` runs git commands (execFileSync) and * returns undefined on any error (git absent / not a repo / command failure). * - The core package (@sentropic/h2a) stays pure — no git/fs is added there. * * DERIVATION (pinned with track): * workspaceId = "ws:" + sha256hex( rootCommitSHA + "\n" + worktreeRelPath ) * * rootCommitSHA : all root commits from `git rev-list --max-parents=0 HEAD`, * sorted ascending, joined with ",". Invariant across * clones / paths / machines. * * worktreeRelPath: "" for the main worktree; the worktree NAME (basename of * the .git/worktrees/ dir) for a linked worktree. * Contains no absolute path. */ /** * Compute the durable workspace id from pre-fetched git values. * * @param rootCommitSHA All root commit SHAs, sorted ascending, joined with "," * (single root is the single SHA). * @param worktreeRelPath "" for the main worktree; the worktree name for a * linked worktree. * @returns "ws:" + sha256hex(rootCommitSHA + "\n" + worktreeRelPath) */ export declare function computeDurableWorkspaceId(rootCommitSHA: string, worktreeRelPath: string): string; /** * Run git commands to derive the durable workspace id for `cwd`. * * Returns `undefined` if: * - git is unavailable (git not installed, PATH issue, Windows no-git) * - `cwd` is not inside a git repository * - any git command fails for any reason * * On success returns `computeDurableWorkspaceId(rootCommitSHA, worktreeRelPath)`. */ export declare function durableWorkspaceId(cwd: string): string | undefined; //# sourceMappingURL=workspace-id.d.ts.map