import { Workspace } from '../core/workspace.js';
import type { AuthService, AuthUser } from './auth-service.js';
/**
 * Register the user's personal "My Folder" folder and grant them admin
 * folder_access. Idempotent — safe to call repeatedly and on existing
 * workspaces where the folder was provisioned before this helper existed
 * (repairs the missing folder_access row).
 *
 * Consolidated from four earlier call sites that each did half the work:
 * setup endpoint, /api/auth/users POST, server startup sweep, and
 * `studiograph user add` CLI. Skipping the grant left the user's own
 * personal folder invisible in the sidebar because `getAccessibleRepos()`
 * filters by folder_access.
 */
export declare function ensurePersonalFolder(workspace: Workspace, authService: AuthService, user: AuthUser): Promise<void>;
/**
 * Convert a departed user's personal folder into a normal (non-personal)
 * archive folder owned by the actor who deleted them. Matches Google
 * Drive's inherit-on-delete model: the content survives, the owner is
 * reassigned, and the "personal" semantics fall away so the folder
 * doesn't clash with the one-personal-folder-per-user invariant.
 *
 * Mutations applied (in order, best-effort non-atomic):
 *  1. Pick a collision-free new name: `archive-{slug}-{YYYY-MM-DD}`,
 *     escalating to `-2`, `-3`, … if needed.
 *  2. Rename the folder directory on disk.
 *  3. Update workspace.json: new name/path, display_name, clear the
 *     personal/owner_id flags, and write the new `.studiograph` marker.
 *  4. Update folder_access rows to the new name so the actor's inherited
 *     admin row keeps working.
 *  5. Push the updated workspace.json to the config remote (non-fatal).
 *
 * Returns the new folder name and display name so the caller can report
 * them to the UI. The caller should `workspaceManager.reloadConfig()`
 * after this completes to surface the change to in-memory graph state.
 */
export declare function archivePersonalFolder(workspace: Workspace, oldName: string, targetDisplayName: string, authService: AuthService): Promise<{
    newName: string;
    newDisplayName: string;
}>;
