import type { HostLocation } from "../opencode/shared.js"; /** * Pi's `ExtensionContext` has no built-in equivalent of OpenCode's * `context.location.project` (see `src/hosts/opencode/v2.ts` `hostLocation()` * and `src/hosts/opencode/v1.ts` `locationFor()`). This derives the same * three `HostLocation` fields for Pi: * * - `directory`: the current working directory Pi reports (`ctx.cwd`), * i.e. the specific worktree the session is running in. * - `worktree`: the git worktree root for `cwd` (`git rev-parse * --show-toplevel`), or `cwd` itself when not inside a git repository. * This can differ from `directory` when `cwd` is a subdirectory of the * worktree. * - `projectId`: a stable hash of the *shared* git directory (`git * rev-parse --git-common-dir`, resolved to an absolute path), not the * worktree root. Using the common git dir means every linked worktree of * the same repository resolves to the same `projectId`, matching how * `MemoryScope: "project"` is expected to behave across worktrees/sessions * (see `src/types.ts` `MemoryScope`). Outside a git repository, `cwd` is * hashed instead so behavior degrades gracefully rather than throwing. * * This scheme is documented for operators in `docs/pi-integration.md`. */ export declare function deriveHostLocation(cwd: string): Promise;