// Package devices manages user devices (uuid, name, platform, last_seen) and // owns subscription resolution for the rest of the API. // // Devices are registered implicitly on first connect (RegisterIfAbsent) and // removed via DELETE /v1/me/devices/{id}. Removal hard-deletes the row, writes // an audit_log entry, and triggers per-user data-plane credential recall // through the CredentialRevoker interface (satisfied by nodes.Hub in module #5). // Because the credential model is per-user (users.dp_uuid; the node side has no // device dimension, doc/02 §3.2), "revoke a device" is realised as recalling // the owning user's credential. // // SubscriptionMiddleware resolves the caller's highest-tier non-expired // subscription (falling back to the free plan) and injects the plan // {plan_code, expires_at, max_devices, daily_minutes, ad_gate} into the request // context, where nodes (catalogue filtering / connect) and usage (daily caps) // read it via PlanFromCtx. Plan numbers follow design/CLAUDE.md §7: // free 1 / pro 5 / team 10 devices. package devices