(sessionId: string)
| 252 | |
| 253 | /** Get compartment count via RPC. */ |
| 254 | export async function getCompartmentCount(sessionId: string): Promise<number> { |
| 255 | if (!rpcClient) return 0; |
| 256 | try { |
| 257 | const result = await rpcClient.call<{ count: number }>("compartment-count", { sessionId }); |
| 258 | return result.count ?? 0; |
| 259 | } catch { |
| 260 | return 0; |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /** Send recomp request to server via RPC. */ |
| 265 | export async function requestRecomp(sessionId: string): Promise<boolean> { |