feat: v2.12.0 - UI/UX Refinement (Model Sync & Premium Tooltips)

This commit is contained in:
Wonseok Jung
2026-04-30 00:19:06 +09:00
parent f8a57cfbb0
commit 326672cb93
25 changed files with 5606 additions and 363 deletions
+38
View File
@@ -0,0 +1,38 @@
import { logInfo } from '../utils';
/**
* AsyncLockManager: Prevents race conditions by ensuring only one task
* can access a specific resource (e.g., a file path) at a time.
*/
export class AsyncLockManager {
private locks: Map<string, Promise<void>> = new Map();
/**
* Acquires a lock for a specific resource.
* If the resource is already locked, it waits until the previous task finishes.
*/
public async acquire(resourceId: string): Promise<() => void> {
const previousLock = this.locks.get(resourceId) || Promise.resolve();
let release: () => void;
const newLock = new Promise<void>((resolve) => {
release = resolve;
});
this.locks.set(resourceId, previousLock.then(() => newLock));
await previousLock;
logInfo(`Lock acquired for: ${resourceId}`);
return () => {
logInfo(`Lock released for: ${resourceId}`);
release();
if (this.locks.get(resourceId) === newLock) {
this.locks.delete(resourceId);
}
};
}
}
// Export as a singleton for the entire agent process
export const lockManager = new AsyncLockManager();