/**
 * PathBuilder — canonical filesystem layout generator for the session
 * hierarchy.
 *
 * Replaces the hardcoded `.namzu/threads/{threadId}/runs` path at
 * `runtime/query/context.ts:60-64`. Phase 3 ships the abstraction; wiring
 * into the factory happens in Phase 6 (sub-session spawn refactor) so the
 * cutover is atomic with the new `projectId` / `sessionId` requirements
 * (Convention #0: no dual paths).
 *
 * Layout matches session-hierarchy.md §13.4 (on-disk layout after migration):
 *
 *   {rootDir}/projects/{projectId}/
 *     project.json
 *     sessions/{sessionId}/
 *       session.json
 *       messages.jsonl
 *       subsessions/{subSessionId}/
 *         subsession.json
 *       runs/{runId}/
 *         ...  (Run-pattern owned; unchanged internally)
 */
import { join } from 'node:path';
/**
 * Default implementation over `node:path.join`. The `root` constructor
 * argument is injected by the consumer (e.g. `join(cwd, '.namzu')`); no
 * process-global fallback — the kernel refuses to guess paths.
 */
export class DefaultPathBuilder {
    root;
    constructor(root) {
        this.root = root;
    }
    rootDir() {
        return this.root;
    }
    projectDir(projectId) {
        return join(this.root, 'projects', projectId);
    }
    sessionDir(projectId, sessionId) {
        return join(this.projectDir(projectId), 'sessions', sessionId);
    }
    subSessionDir(projectId, sessionId, subSessionId) {
        return join(this.sessionDir(projectId, sessionId), 'subsessions', subSessionId);
    }
    runDir(projectId, sessionId, runId) {
        return join(this.sessionDir(projectId, sessionId), 'runs', runId);
    }
}
//# sourceMappingURL=path-builder.js.map