/** * Configuration management for Mirra CC Bridge */ import { BridgeConfig, LocalSession, PendingPermissionRequest } from './types'; /** * Load configuration from file */ export declare function loadConfig(): BridgeConfig | null; /** * Save configuration to file */ export declare function saveConfig(config: BridgeConfig): void; /** * Get a specific config value */ export declare function getConfigValue(key: K): BridgeConfig[K] | undefined; /** * Set a specific config value */ export declare function setConfigValue(key: K, value: BridgeConfig[K]): void; /** * Check if the bridge is configured */ export declare function isConfigured(): boolean; /** * Get or create the bridge auth token * This token is used to authenticate inbound requests from the Mirra server */ export declare function getOrCreateBridgeAuthToken(): string; /** * Validate a bearer token against the stored bridge auth token */ export declare function validateBridgeAuthToken(token: string): boolean; /** * Check if Claude Code hooks are configured */ export declare function hooksConfigured(): boolean; /** * Get the config file path */ export declare function getConfigPath(): string; /** * Get the config directory path */ export declare function getConfigDir(): string; /** * Generate a unique session name based on working directory * Handles duplicates by appending #2, #3, etc. */ export declare function generateSessionName(workingDir: string): string; /** * Add a new active session * Returns the generated session name */ export declare function addActiveSession(sessionId: string, workingDir: string): string; /** * Remove an active session by its ID */ export declare function removeActiveSession(sessionId: string): void; /** * Get all active session IDs */ export declare function getActiveSessionIds(): string[]; /** * Get session name by session ID */ export declare function getSessionName(sessionId: string): string | undefined; /** * Get or create a stable local session ID for a specific terminal * Uses process-level identifier to track individual terminals */ export declare function getOrCreateLocalSessionId(groupId: string): string; /** * Get current local session info */ export declare function getLocalSession(): LocalSession | undefined; /** * Set the Flow ID for the local session */ export declare function setLocalSessionFlowId(flowId: string): void; /** * Clear local session state (for cleanup on shutdown) */ export declare function clearLocalSession(): void; /** * Store a pending permission request * Returns the request ID for polling */ export declare function storePendingPermissionRequest(sessionId: string): string; /** * Get a pending permission request by ID */ export declare function getPendingPermissionRequest(requestId: string): PendingPermissionRequest | undefined; /** * Store response for a pending permission request */ export declare function storePermissionResponse(requestId: string, action: 'allow' | 'allow_always' | 'deny'): boolean; /** * Remove a pending permission request (after it's been handled) */ export declare function removePendingPermissionRequest(requestId: string): void; /** * Session progress state */ export interface SessionProgressState { sessionId: string; transcriptPath?: string; lastStepCount: number; lastProgressSentAt?: string; createdAt: string; } /** * Store the transcript path for a session (called by hooks) */ export declare function setSessionTranscriptPath(sessionId: string, transcriptPath: string): void; /** * Get the session progress state */ export declare function getSessionProgress(sessionId: string): SessionProgressState | null; /** * Update session progress state (called after sending progress) */ export declare function updateSessionProgress(sessionId: string, stepCount: number): void; /** * Progress update interval in milliseconds (30 seconds) */ export declare const PROGRESS_UPDATE_INTERVAL_MS: number; /** * Check if a progress update should be sent based on elapsed time * Returns true if no progress has been sent yet or if more than 30 seconds have passed */ export declare function shouldSendProgressUpdate(sessionId: string): boolean; /** * Clean up session progress file (called when session ends) */ export declare function cleanupSessionProgress(sessionId: string): void; /** * Active session marker stored in file */ export interface ActiveSessionMarker { sessionId: string; groupId: string; apiKey: string; messageId?: string; workingDir: string; createdAt: string; } /** * Register an active remote session (called when spawning) * This allows hooks to identify Mirra-spawned sessions without env vars */ export declare function registerActiveRemoteSession(marker: ActiveSessionMarker): void; /** * Update an active session marker (e.g., to update messageId) */ export declare function updateActiveRemoteSession(workingDir: string, updates: Partial): void; /** * Get the active session marker for a working directory * Returns null if no active session exists for this directory */ export declare function getActiveRemoteSession(workingDir: string): ActiveSessionMarker | null; /** * Clean up active session marker (called when session ends) */ export declare function cleanupActiveRemoteSession(workingDir: string): void; //# sourceMappingURL=config.d.ts.map