import type { JaitDB } from "../db/connection.js";
export interface CreateSessionParams {
    userId?: string;
    projectId?: string | null;
    name?: string;
    projectPath?: string;
    metadata?: Record<string, unknown>;
}
export declare class SessionService {
    private db;
    constructor(db: JaitDB);
    /** Create a new session. Returns the created session record. */
    create(params?: CreateSessionParams): {
        id: string;
        userId: string | null;
        projectId: string | null;
        name: string | null;
        projectPath: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    };
    /** List all sessions, newest first. Optionally filter by status. */
    list(status?: string, userId?: string, limit?: number): {
        id: string;
        userId: string | null;
        projectId: string | null;
        name: string | null;
        projectPath: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    }[];
    listByProject(projectId: string, status?: string, userId?: string, limit?: number): {
        id: string;
        userId: string | null;
        projectId: string | null;
        name: string | null;
        projectPath: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    }[];
    /** Get a single session by ID. */
    getById(id: string, userId?: string): {
        id: string;
        userId: string | null;
        projectId: string | null;
        name: string | null;
        projectPath: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    } | undefined;
    /** Touch the session (update last_active_at). */
    touch(id: string): void;
    /** Archive a session. */
    archive(id: string, userId?: string): void;
    /** Get the most recently active session. */
    lastActive(userId?: string): {
        id: string;
        userId: string | null;
        projectId: string | null;
        name: string | null;
        projectPath: string | null;
        createdAt: string;
        lastActiveAt: string;
        status: string | null;
        metadata: string | null;
    } | null;
    /** Delete (soft) a session. */
    delete(id: string, userId?: string): void;
    /** Archive all active sessions in a project. */
    archiveByProject(projectId: string, userId?: string): void;
    /** Restore all archived sessions in a project back to active. */
    restoreByProject(projectId: string, userId?: string): void;
    /** Delete (soft) all non-deleted sessions in a project. */
    deleteByProject(projectId: string, userId?: string): void;
    /** Update session name, metadata, or projectPath. */
    update(id: string, data: {
        name?: string;
        metadata?: Record<string, unknown>;
        projectPath?: string | null;
        projectId?: string | null;
    }, userId?: string): void;
}
//# sourceMappingURL=sessions.d.ts.map