Extract the duplicated file lock mechanism from auth-storage.ts and session-manager.ts into a shared lock-utils.ts module. - acquireLockSyncWithRetry(): throwing variant (used by auth-storage) - tryAcquireLockSync(): non-throwing variant (used by session-manager) - acquireLockAsync(): async lock with retries and staleness detection Removes ~55 lines of duplicated retry-loop logic. The shared module also provides a foundation for deduplicating identical patterns in settings-manager.ts and models-json-writer.ts. |
||
|---|---|---|
| .. | ||
| native | ||
| pi-agent-core | ||
| pi-ai | ||
| pi-coding-agent | ||
| pi-tui | ||