/**
* Web-Crypto based UUID v4 generator. We use `globalThis.crypto.randomUUID`
* rather than Node's `node:crypto` because `@tasks/shared` is meant to be
* importable from both browser and server bundles (see `AGENTS.md` §4 and
* `.cursor/rules/repo-overview.mdc`). The Web Crypto API is available in
* Node >= 20 and every modern browser, so this works in both worlds.
*/
export function generateId(): string {
return globalThis.crypto.randomUUID();
}