import type { JaitDB } from "../db/connection.js";
import { projects } from "../db/schema.js";
export interface CreateProjectParams {
    userId?: string;
    title?: string;
    rootPath?: string | null;
    nodeId?: string | null;
    metadata?: Record<string, unknown>;
}
type ProjectRow = typeof projects.$inferSelect;
export declare function parseProjectMetadata(project: Pick<ProjectRow, "metadata"> | null | undefined): Record<string, unknown>;
export declare function getProjectRepositoryId(project: Pick<ProjectRow, "metadata"> | null | undefined): string | null;
export declare class ProjectService {
    private db;
    constructor(db: JaitDB);
    create(params?: CreateProjectParams): {
        id: string;
        userId: string | null;
        title: string | null;
        rootPath: string | null;
        nodeId: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    };
    list(status?: string, userId?: string, limit?: number): {
        id: string;
        userId: string | null;
        title: string | null;
        rootPath: string | null;
        nodeId: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    }[];
    listWithSessions(userId?: string, status?: string, limit?: number): {
        projects: {
            sessions: {
                id: string;
                userId: string | null;
                projectId: string | null;
                name: string | null;
                projectPath: string | null;
                createdAt: string;
                lastActiveAt: string;
                status: string | null;
                metadata: string | null;
            }[];
            id: string;
            userId: string | null;
            title: string | null;
            rootPath: string | null;
            nodeId: string | null;
            createdAt: string;
            lastActiveAt: string;
            status: string | null;
            metadata: string | null;
        }[];
        hasMore: boolean;
    };
    getById(id: string, userId?: string): {
        id: string;
        userId: string | null;
        title: string | null;
        rootPath: string | null;
        nodeId: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    } | undefined;
    getOrCreateForRoot(params: CreateProjectParams): {
        id: string;
        userId: string | null;
        title: string | null;
        rootPath: string | null;
        nodeId: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    };
    touch(id: string): void;
    update(id: string, data: {
        title?: string;
        rootPath?: string | null;
        nodeId?: string | null;
        metadata?: Record<string, unknown>;
    }, userId?: string): void;
    assignRepository(id: string, repositoryId: string, userId?: string): {
        id: string;
        userId: string | null;
        title: string | null;
        rootPath: string | null;
        nodeId: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    } | undefined;
    archive(id: string, userId?: string): void;
    restore(id: string, userId?: string): void;
    delete(id: string, userId?: string): void;
    /** Delete (soft) all archived projects for a user. Returns count of affected rows. */
    deleteArchived(userId: string): number;
    getActiveSessionCounts(userId: string): Map<string, number>;
}
export {};
//# sourceMappingURL=projects.d.ts.map