import type { FastifyReply, FastifyRequest } from 'fastify';
import type { WorkspaceManager } from '../../core/workspace-manager.js';
import type { AuthService, AuthUser } from '../../services/auth-service.js';
import type { GitUser } from '../../services/git.js';
import { type WorkspaceAccessService } from '../../services/workspace-access.js';
/** Convert an AuthUser from the request to a GitUser for commit attribution. */
export declare function reqGitUser(req: FastifyRequest): GitUser | undefined;
export declare function reqUser(req: FastifyRequest): AuthUser | undefined;
export declare function getAccessibleRepos(req: FastifyRequest, workspaceManager: WorkspaceManager, authService: AuthService): {
    name: string;
    path: string;
    display_name?: string | undefined;
    type?: string | undefined;
    description?: string | undefined;
    personal?: boolean | undefined;
    owner_id?: number | undefined;
    system?: boolean | undefined;
    workspace_wide?: boolean | undefined;
    sync?: {
        source: string;
        entity_type?: string | undefined;
        filter?: Record<string, any> | undefined;
    }[] | undefined;
}[];
/** Accessible repos MINUS `system` folders (the reserved asset store). Use for
 *  knowledge/content surfaces (entity summaries, graph topology, search,
 *  graph-health) so the asset store's wrapper entities don't pollute them. The
 *  asset manager + authz still use getAccessibleRepos (system included). */
export declare function getContentRepos(req: FastifyRequest, workspaceManager: WorkspaceManager, authService: AuthService): {
    name: string;
    path: string;
    display_name?: string | undefined;
    type?: string | undefined;
    description?: string | undefined;
    personal?: boolean | undefined;
    owner_id?: number | undefined;
    system?: boolean | undefined;
    workspace_wide?: boolean | undefined;
    sync?: {
        source: string;
        entity_type?: string | undefined;
        filter?: Record<string, any> | undefined;
    }[] | undefined;
}[];
export declare function hasRepoAccess(req: FastifyRequest, repoName: string, workspaceManager: WorkspaceManager, authService: AuthService): boolean;
export declare function canWriteRepo(req: FastifyRequest, repoName: string, workspaceManager: WorkspaceManager, authService: AuthService): boolean;
export declare function isFolderAdminOrOwner(req: FastifyRequest, repoName: string, workspaceManager: WorkspaceManager, authService: AuthService): boolean;
export declare function getAccessibleEntityIds(req: FastifyRequest, workspaceManager: WorkspaceManager, authService: AuthService): Set<string> | null;
export declare function filterWikilinks(wikilinks: string[], accessibleIds: Set<string> | null): string[];
/**
 * Guard against non-admin members creating eager skills in shared folders:
 * eager skills inline into prompts for everyone with folder access.
 */
export declare function checkEagerSkillPermission(req: FastifyRequest, entityType: string, data: Record<string, any> | undefined, repoName: string, workspaceManager: WorkspaceManager, authService: AuthService): string | null;
export declare function graphForRead(accessService: WorkspaceAccessService, req: FastifyRequest, reply: FastifyReply, repoName: string): import("../../core/graph.js").BaseGraphManager | null;
export declare function graphForWrite(accessService: WorkspaceAccessService, req: FastifyRequest, reply: FastifyReply, repoName: string): import("../../core/graph.js").BaseGraphManager | null;
export declare function graphForAdmin(accessService: WorkspaceAccessService, req: FastifyRequest, reply: FastifyReply, repoName: string): import("../../core/graph.js").BaseGraphManager | null;
