import { WorkspaceRegistrationStore, type WorkspaceCoverageStatus, type RegisterWorkspaceResult } from '../workspace/index.js'; /** The slice of ShellPathService this manager needs. */ export interface WorkspaceRegistrationShellPaths { readonly workingDirectory: string; readonly homeDirectory: string; resolveUserPath(...segments: string[]): string; } /** Filename of the shared control-plane registry document (matches the daemon composition). */ export interface WorkspaceRegistrationEvaluation { /** Normalized absolute working directory the prompt would ask about. */ readonly root: string; /** Coverage verdict from the shared store: covered / declined / unknown. */ readonly status: WorkspaceCoverageStatus; /** The nearest registered root covering the path, or null. */ readonly coveredBy: string | null; /** True when coverage was inherited through the git worktree→main-repo link. */ readonly viaWorktreeLink: boolean; /** True when the root is one the store would refuse ($HOME, filesystem root, ~/.goodvibes). */ readonly broad: boolean; /** * Whether to OFFER the register half of the first-open prompt: only when the * store says UNKNOWN and the root is registrable. Broad roots are never * offered, the store refuses them, so we do not prompt for what would be * refused. Covered / declined roots never re-ask. */ readonly offerRegister: boolean; /** Human-readable justification from the resolver. */ readonly reason: string; } export interface WorkspaceRegistrationManagerOptions { readonly shellPaths: WorkspaceRegistrationShellPaths; /** * Inject a pre-built store (e.g. a `:memory:` store for tests). Defaults to an * in-process store at the shared control-plane path, configured identically to * the daemon's. */ readonly store?: WorkspaceRegistrationStore; } export declare class WorkspaceRegistrationManager { private readonly store; private readonly workingDirectory; private readonly homeDir; private readonly daemonStateDir; constructor(options: WorkspaceRegistrationManagerOptions); /** * isBroadRoot, mirrors the SDK store's broad-root refusal SET (filesystem * root, home directory, daemon state dir) so the register half is never * offered for a root the store would refuse. This is a UI-suppression predicate * only; the store's `add` remains the enforcement authority (see register()), * which is why register() also catches WorkspaceRegistrationError. */ private isBroadRoot; /** * Resolve the current working directory against the shared registry and decide * whether the register half of the first-open prompt should appear. Read-only, * never writes, so it is safe to call from `status`/`doctor`. */ evaluate(): Promise; /** * Register the current working directory at its resolved project root. The * store refuses broad roots (WorkspaceRegistrationError), we surface that * honestly rather than record a phantom registration. * * `origin` stamps which surface wrote the record (honest provenance). This * NEVER passes `checkpointEligible`: absent means false, so a self-record * can never widen the checkpoint-owning consumer's boundary, only that * consumer stamps its own roots eligible on boot. */ register(label?: string, origin?: string): Promise<{ readonly registered: true; readonly result: RegisterWorkspaceResult; } | { readonly registered: false; readonly refusedReason: string; }>; /** Remember a subtree-scoped decline at the current working directory. Idempotent. */ decline(): Promise<{ readonly root: string; readonly alreadyDeclined: boolean; }>; /** The normalized working directory this manager asks about. */ getWorkingRoot(): string; /** * A one-liner registration posture for `status`/`doctor`. Read-only. */ describe(): Promise; } //# sourceMappingURL=workspace-registration.d.ts.map