import { ProviderId } from './providers'; /** Returns the .autodev directory path, creating it if needed. */ export declare function autodevDir(root: string): string; /** .autodev/session-state.json — session IDs keyed by provider */ export declare const SESSION_STATE_FILE = ".autodev/session-state.json"; /** .autodev/TEMP_SESSION_OUT.txt — CLI stdout tee for session ID extraction */ export declare const SESSION_OUT_FILE = ".autodev/TEMP_SESSION_OUT.txt"; /** .autodev/TEMP_PROMPT.md — prompt written for CLI providers (legacy) */ export declare const PROMPT_FILE = ".autodev/TEMP_PROMPT.md"; /** .autodev/PROGRAM.md — the master profile index, (re)written per task run. * MUST match messageBuilder.AGENT_PROFILE_FILE — dispatcher reads THIS constant to * load the profile into the prompt; if they diverge it reads a deleted file (ENOENT). */ export declare const AGENT_PROFILE_FILE = ".autodev/PROGRAM.md"; /** Read the messageId currently pointed at, or null if none yet. */ export declare function latestMessageId(root: string, providerId: string): string | null; /** Path of the latest message's stdout file. Falls back to legacy path if * no message has been rotated yet (so first-time installs keep working). */ export declare function stdoutFilePath(root: string, providerId: string): string; /** Path of the latest message's exit file. */ export declare function exitFilePath(root: string, providerId: string): string; /** Rotate to a fresh messageId and return the empty stdout/exit file paths * the dispatcher should write to and tee into. Updates the pointer file so * every subsequent call to stdoutFilePath/exitFilePath returns these paths. */ export declare function newMessageOutput(root: string, providerId: string): { messageId: string; stdoutFile: string; exitFile: string; }; export declare function getSessionId(root: string, providerId: ProviderId): string | undefined; export declare function saveSessionId(root: string, providerId: ProviderId, sessionId: string): void; export declare function clearSessionId(root: string, providerId: ProviderId): void; /** * Returns the epoch-ms timestamp of the last clearSessionId() call for this * provider, or 0 if clearSessionId() has never been called. */ export declare function getSessionClearedAt(root: string, providerId: ProviderId): number; /** Save a human-readable display name for a session ID. */ export declare function saveSessionName(root: string, sessionId: string, name: string): void; /** Get the saved display name for a session ID, or undefined if none. */ export declare function getSessionName(root: string, sessionId: string): string | undefined; /** Claude: "session_id":"" in --output-format stream-json events */ export declare function extractClaudeSessionId(stdout: string): string | undefined; /** Copilot: "sessionId":"" in JSON stream */ export declare function extractCopilotSessionId(stdout: string): string | undefined; /** OpenCode: "sessionID":"ses_xxx" in --format json event stream */ export declare function extractOpenCodeSessionId(stdout: string): string | undefined; /** * After a CLI task finishes, try to capture and persist the session ID. * - claude-cli: reads from .autodev/output/claude-cli.txt (stdout tee) * - opencode-cli: reads from .autodev/output/opencode-cli.txt (--format json tee) * - copilot-cli: reads from .autodev/TEMP_SESSION_OUT.txt * Falls back silently — never throws. */ export declare function captureAndSaveSessionId(root: string, providerId: ProviderId, /** Fallback session ID (e.g. from findLatestClaudeSession for claude-cli) */ fallbackSessionId?: string): void;