"""Capability tokens and path rules for the ``/videos`` and ``/thumbnails`` bytes. Both paths used to be ``StaticFiles`` mounts, i.e. the whole working directory served to the internet with a UUID for a lock. That handed out more than the clips: the ``.resume.json`` manifest (which carries the customer's own ``webhook_secret``), the ``.owner`` sidecar (a user uuid), the ``.instance`` deploy marker, the face crops under ``thumbnails/`` and every actor photo a user had uploaded. ``app.py`` now serves those two prefixes through real handlers that ask who is calling; this module is the part of that with no FastAPI in it, so the URL-signing call sites in ``app.py`` need no FastAPI import. Two token shapes, because there are two kinds of consumer: * **path capability** (``?exp=…&sig=…``) — an HMAC over one relative path and an expiry. This is what goes to a consumer that cannot send a header at all: the webhook payload and the absolute URLs the MCP tools return. Same idea as the R2 ``presigned_get`` links the history endpoint already hands out, and as ``/api/source-url``. * **user token** (``?mt=..``) — a short-lived bearer for one user, minted at ``/api/media-token``. A ``