export interface ProjectInstance { pid: number; registeredAt: string; } export interface ProjectRegistryEntry { projectId: string; projectPath: string; workflowRootPath: string; projectName: string; instances: ProjectInstance[]; } export interface RegisterProjectOptions { workflowRootPath?: string; projectName?: string; } /** * Generate a stable projectId from an absolute path * Uses SHA-1 hash encoded as base64url */ export declare function generateProjectId(absolutePath: string): string; /** * Build display name for a workspace. * - Main repo: "repo" * - Worktree: "repo ยท worktree" */ export declare function generateProjectDisplayName(workspacePath: string, workflowRootPath: string): string; export declare class ProjectRegistry { private registryPath; private registryDir; private needsInitialization; constructor(); /** * Ensure the registry directory exists */ private ensureRegistryDir; /** * Read the registry file with atomic operations * Returns a map keyed by projectId */ private readRegistry; /** * Write the registry file atomically */ private writeRegistry; /** * Check if a process is still running * Note: When running in Docker with path translation, we can't check host PIDs, * so we assume processes are alive if path translation is enabled. */ private isProcessAlive; /** * Register a project in the global registry * Self-healing: If a project exists with dead PIDs, cleans them up and adds new PID * Multi-instance: Allows unlimited MCP server instances per project */ registerProject(projectPath: string, pid: number, options?: RegisterProjectOptions): Promise; /** * Unregister a project from the global registry by path * If pid is provided, only removes that specific instance * If no pid provided, removes the entire project (backwards compat) */ unregisterProject(projectPath: string, pid?: number): Promise; /** * Unregister a project by projectId */ unregisterProjectById(projectId: string): Promise; /** * Get all active projects from the registry */ getAllProjects(): Promise; /** * Get a specific project by path */ getProject(projectPath: string): Promise; /** * Get a specific project by projectId */ getProjectById(projectId: string): Promise; /** * Clean up stale instances (where the process is no longer running) * Projects with no live instances are removed entirely * Returns the count of removed instances */ cleanupStaleProjects(): Promise; /** * Check if a project is registered by path */ isProjectRegistered(projectPath: string): Promise; /** * Get the registry file path for watching */ getRegistryPath(): string; } //# sourceMappingURL=project-registry.d.ts.map