···2233/// Helper to decode arbitrary JSON values into `Any` for pass-through storage.
44/// Used by XRPC outputs that carry opaque record values through to callers.
55+///
66+/// Known precision caveats — fine for DID docs and typical atproto records,
77+/// worth auditing if records with extreme integer or signature-sensitive
88+/// numeric values show up:
99+/// - Integers > Int64.max fall through to Double and lose precision past 2^53.
1010+/// - Whole-number Doubles (e.g. `1.0`) decode as Int64(1) because Int64 is
1111+/// tried first, so `1.0` round-trips as `1` via JSONSerialization.
512struct AnyDecodable: Decodable {
613 let value: Any
714
···39394040 /// Installs a request handler and returns a configured `URLSession`.
4141 /// Pass the returned session to `reset(session:)` in a `defer` block.
4242- @discardableResult
4342 static func install(handler: @escaping (URLRequest) -> Response) -> URLSession {
4443 let id = UUID().uuidString
4544 let config = URLSessionConfiguration.ephemeral