import { SessionManager } from "@earendil-works/pi-coding-agent"; export type { ResolvedSessionScope, ThreadRootMessage } from "./types.js"; /** * Returns the shared session directory for a conversation. * Channel sessions use a current pointer within this directory. * Thread sessions are stored as fixed files within the same directory. */ export declare function getChannelSessionDir(channelDir: string): string; /** * Resolves the current active session file for a session directory. * Reads the "current" pointer file; creates a new session if none exists * or the pointed-to file is missing. */ export declare function resolveSessionFile(sessionDir: string): string; /** * Resolve the current active session file for a session directory. * Creates a fully initialized persistent session with the provided cwd when none exists. */ export declare function resolveManagedSessionFile(sessionDir: string, cwd: string): string; /** * Extracts the short UUID from a session file path. * e.g. "2026-04-05T00-00_7b54cf90.jsonl" → "7b54cf90" */ export declare function extractSessionUuid(sessionFile: string): string; /** * Extracts the thread/suffix part of a session key. * "channelId:threadId" → "threadId", "channelId" → "channelId" */ export declare function extractSessionSuffix(sessionKey: string): string; /** * Creates an empty timestamped file and updates the "current" pointer. * Used only by tests for placeholder-file scenarios. * * Order matters: write the session file first, then atomic-rename the pointer * last so a crash mid-create never leaves "current" pointing at a missing file. */ export declare function createNewSessionFile(sessionDir: string): string; /** * Creates a new persistent session file with a proper SessionManager header and cwd. * Also updates the "current" pointer. Header is written before the pointer flips so a * partial create cannot leave "current" pointing at a missing file. */ export declare function createManagedSessionFile(sessionDir: string, cwd: string): string; /** * Open a session file with an explicit cwd, even if the file does not exist yet. * This avoids SessionManager.open() falling back to process.cwd() for fresh sessions. */ export declare function openManagedSession(sessionFile: string, sessionDir: string, cwd: string): SessionManager; /** * Creates or overwrites a fixed-path session file with a valid session header. */ export declare function createManagedSessionFileAtPath(sessionFile: string, cwd: string): string; /** * Returns the fixed session file path for a Slack thread. */ export declare function getThreadSessionFile(channelDir: string, sessionKey: string): string; /** * Try to resolve an existing current session file. * Returns null if no current pointer exists or the pointed file has no valid session header. */ export declare function tryResolveCurrentSession(sessionDir: string): string | null; /** * Try to resolve an existing thread session file. * Returns the file path if found, or null if no valid thread session exists yet. */ export declare function tryResolveThreadSession(sessionFile: string): string | null; /** * Resolve the channel's current session file path. * Returns null if no channel session exists. */ export declare function resolveChannelSessionFile(channelDir: string): string | null; //# sourceMappingURL=store.d.ts.map