feat(locks): show a lock indicator on the lane card (D)

This commit is contained in:
2026-08-04 11:32:34 +07:00
parent 4a8725f136
commit 1f3a5ff51d
6 changed files with 186 additions and 91 deletions
+11
View File
@@ -2014,6 +2014,17 @@ export const api = {
body: JSON.stringify(body),
}),
},
// ──────────────────────────────── Locks API ────────────────────────────────
/** Named locks across all lanes: used for serialization and gating.
* Maps to `server/routes/locks.js`. */
locks: {
/**
* GET /api/locks — list all active named locks and their holders.
* @returns `{ locks }` — all {@link NamedLock} records.
*/
list: (): Promise<{ locks: NamedLock[] }> => request<{ locks: NamedLock[] }>("/locks"),
},
};
// ─────────────────────────────────────────────────────────────────────────────
+8
View File
@@ -2370,6 +2370,14 @@ export interface LaneRuntimeService {
alive: boolean;
}
/** A named lock held by a lane. */
export interface NamedLock {
name: string;
holder: string;
since: number;
ageSec: number;
}
/**
* What is actually running for a lane, recomputed by the server on every read
* rather than cached — a process can die without telling anyone.