mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 15:30:06 +08:00
`crypto.getRandomValues` is not gated on a secure context — only `randomUUID` is — so it is the right fallback on a plain-HTTP deployment, and the `Math.random` tail is left only for a runtime with no Web Crypto. The bare `globalThis.crypto.randomUUID()` this fixes had a twin at `contracts/parse/turn-command.ts`, which throws in exactly the same deployment. Both now call one exported `newCommandId`, living beside the `command_id` field it fills rather than in the transport that happened to notice first. (cherry picked from commit 70333c900034d383500ca92e294b23445394068f)
Generated frontend contracts
The backend owns the wire contract. Do not edit files under schema/ or
generated/ by hand.
From the repository root, refresh both layers after a backend contract change:
python scripts/export_frontend_contracts.py
cd web && npm run contracts:generate
CI runs python scripts/export_frontend_contracts.py --check in backend contract
tests and npm run contracts:check before frontend typechecking. A drift failure
means the committed artifacts must be regenerated with the commands above.