/**
 * DiskSessionStore — filesystem-backed implementation of
 * {@link SessionStore}.
 *
 * Every mutation is write-tmp-rename (Convention #8). Directory layout
 * matches session-hierarchy.md §7 / §13.4:
 *
 *   {rootDir}/projects/{projectId}/
 *     project.json
 *     sessions/{sessionId}/
 *       session.json
 *       messages.jsonl
 *       subsessions/{subSessionId}/
 *         subsession.json
 *
 * Tenant scoping is enforced through the JSON payload (`tenantId` field on
 * every record) rather than the path layout; cross-tenant reads reject with
 * {@link TenantIsolationError} (Convention #17, session-hierarchy.md §12.2).
 *
 * Constructor takes `rootDir`; migration to the canonical `.namzu/projects/`
 * path lives in Phase 7 of the overall roadmap.
 */
import type { MessageId, SessionId, TenantId } from '../../types/ids/index.js';
import type { Message } from '../../types/message/index.js';
import type { Project } from '../../types/project/entity.js';
import type { Session } from '../../types/session/entity.js';
import type { ProjectId, SubSessionId, ThreadId } from '../../types/session/ids.js';
import type { SessionMessage } from '../../types/session/messages.js';
import type { CreateProjectParams, CreateSessionParams, CreateSubSessionParams, SessionStore, SessionView } from '../../types/session/store.js';
import type { SubSession } from '../../types/session/sub-session.js';
import type { SessionSummaryRef } from '../../types/summary/ref.js';
/**
 * Config for {@link DiskSessionStore}. `rootDir` is absolute; all files live
 * under it per the layout documented in the module header.
 */
export interface DiskSessionStoreConfig {
    rootDir: string;
}
export declare class DiskSessionStore implements SessionStore {
    private readonly rootDir;
    private readonly projectIndex;
    private readonly sessionIndex;
    private readonly subSessionIndex;
    constructor(config: DiskSessionStoreConfig);
    createProject(params: CreateProjectParams, tenantId: TenantId): Promise<Project>;
    getProject(projectId: ProjectId, tenantId: TenantId): Promise<Project | null>;
    createSession(params: CreateSessionParams, tenantId: TenantId): Promise<Session>;
    getSession(sessionId: SessionId, tenantId: TenantId): Promise<Session | null>;
    listSessions(threadId: ThreadId, tenantId: TenantId): Promise<readonly Session[]>;
    updateSession(session: Session, tenantId: TenantId): Promise<void>;
    deleteSession(sessionId: SessionId, tenantId: TenantId): Promise<void>;
    createSubSession(params: CreateSubSessionParams, tenantId: TenantId): Promise<SubSession>;
    getSubSession(subSessionId: SubSessionId, tenantId: TenantId): Promise<SubSession | null>;
    updateSubSession(subSession: SubSession, tenantId: TenantId): Promise<void>;
    deleteSubSession(subSessionId: SubSessionId, tenantId: TenantId): Promise<void>;
    appendMessage(sessionId: SessionId, message: Message, tenantId: TenantId): Promise<MessageId>;
    loadMessages(sessionId: SessionId, tenantId: TenantId): Promise<readonly Message[]>;
    loadSessionMessages(sessionId: SessionId, tenantId: TenantId): Promise<readonly SessionMessage[]>;
    getChildren(sessionId: SessionId, tenantId: TenantId): Promise<readonly SubSession[]>;
    getAncestry(sessionId: SessionId, tenantId: TenantId): Promise<readonly SessionId[]>;
    drill(sessionId: SessionId, tenantId: TenantId): Promise<SessionView | null>;
    /**
     * Atomic materialize-with-terminal-transition (§8.1). Two write-tmp-renames:
     *
     *   1. Persist `summary.json` under the session directory.
     *   2. Flip `session.json#status` to `'idle'` if it's in a non-terminal
     *      state (`'active' | 'locked' | 'awaiting_merge'`).
     *
     * Each rename is atomic individually. A crash between step 1 and step 2
     * leaves summary present + session still non-terminal — recovery replays
     * the flip via {@link SessionSummaryMaterializer.recover}. Idempotent when
     * the same summary is re-presented (recovery path); rejects a *different*
     * summary for the same session as {@link SessionAlreadySummarizedError}.
     */
    recordSummary(summary: SessionSummaryRef & {
        materializedBy: 'kernel';
    }, tenantId: TenantId): Promise<void>;
    getSummary(sessionId: SessionId, tenantId: TenantId): Promise<SessionSummaryRef | null>;
    private assertTenant;
    private projectDir;
    private locateSession;
    private locateSubSession;
    private buildLinkageView;
}
export type { SessionMessage } from '../../types/session/messages.js';
//# sourceMappingURL=disk.d.ts.map