/** * Session bootstrap logic extracted from index.ts. * * Handles lazy session initialization, SDK session lookup, * and forked child copying. Reduces index.ts LOC count. * * @module session-tracker/bootstrap */ import type { OpenCodeClient } from "../../shared/session-api.js"; import type { SessionWriter } from "./persistence/session-writer.js"; import type { ProjectIndexWriter } from "./persistence/project-index-writer.js"; import type { SessionIndexWriter } from "./persistence/session-index-writer.js"; /** * Manages session bootstrap operations: lazy directory creation, * SDK session lookup, and forked child inheritance. */ export declare class SessionBootstrap { private client; private projectRoot; private sessionWriter; private projectIndexWriter; private sessionIndexWriter; /** * @param deps - Injected dependencies. */ constructor(deps: { client: OpenCodeClient; projectRoot: string; sessionWriter: SessionWriter; projectIndexWriter: ProjectIndexWriter; sessionIndexWriter: SessionIndexWriter; }); /** * Lazy-bootstraps a session that was created before the harness loaded. * * Creates the session directory, initializes the `.md` file, and registers * the session in the project index. Idempotent — skips if already bootstrapped. * * @param sessionID - The session identifier to bootstrap. * @param bootstrappedSessions - Set tracking already-bootstrapped sessions. * @returns Promise that resolves when bootstrap is complete. */ ensureSessionReady(sessionID: string, bootstrappedSessions: Set): Promise; /** * Safely retrieves a session via the SDK client without throwing. * * @param sessionID - The session identifier to look up. * @returns The session object, or `undefined` if not found. */ getSessionSafely(sessionID: string): Promise; /** * Reference-copies child delegation records from a parent session to * a newly-forked session. Both sessions share the same child .json files * (reference-copy, not deep-copy) to prevent split-brain data divergence. * * @param newSessionID - The newly created forked session ID. * @param parentID - The parent session ID to inherit children from. */ copyForkedChildren(newSessionID: string, parentID: string): Promise; } //# sourceMappingURL=bootstrap.d.ts.map