The best way to control Claude Code, Codex and more from any computer or phone

main
ts 16 lines 746 Bytes
Raw
1 import * as Effect from "effect/Effect";
2 import * as Semaphore from "effect/Semaphore";
3
4 // IAM rejects uploading the same signing certificate body anywhere else in
5 // the account, even when the certificates belong to different users. The two
6 // live tests intentionally share one checked-in deterministic certificate, so
7 // serialize only their certificate lifecycles while leaving unrelated IAM and
8 // AWS tests concurrent.
9 const signingCertificateFixtureLock = Semaphore.makeUnsafe(1);
10
11 export const withSigningCertificateFixture = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
12 Effect.acquireUseRelease(
13 signingCertificateFixtureLock.take(1),
14 () => effect,
15 () => signingCertificateFixtureLock.release(1).pipe(Effect.asVoid),
16 );