/** * Copyright 2025 Vybestack LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Handle returned by a successful lock acquisition. * Callers use `release()` to free the lock. */ export interface LockHandle { lockPath: string; release(): Promise; } /** @pseudocode concurrency-lifecycle.md lines 10-134 */ export declare class SessionLockManager { /** @pseudocode concurrency-lifecycle.md lines 12-14 */ static getLockPath(chatsDir: string, sessionId: string): string; /** @pseudocode concurrency-lifecycle.md lines 16-22 */ static getLockPathFromFilePath(sessionFilePath: string): string; /** @pseudocode concurrency-lifecycle.md lines 24-75 */ static acquire(chatsDir: string, sessionId: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 77-96 */ static checkStale(lockPath: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 104-114 */ static isLocked(chatsDir: string, sessionId: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 116-124 */ static isStale(chatsDir: string, sessionId: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 126-133 */ static removeStaleLock(chatsDir: string, sessionId: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 257-282 */ static cleanupOrphanedLocks(chatsDir: string): Promise; /** @pseudocode concurrency-lifecycle.md lines 290-346 */ static checkStaleWithPidReuse(lockPath: string): Promise; }