// `capture.avatar` — a person's photograph, from this app into the store.//// | method | takes | answers |// |---|---|---|// | `capture.avatar` | a person, a PATH this app staged, its mime | the object key, and whose it is |//// **A method, not a tool.** No assistant may point a person at bytes: an// avatar is a file on the owner's own device, and `update_person` can only// ever REMOVE one (`avatarKey: null`). That asymmetry is the whole design —// setting a face means bytes, and bytes are the app's.//// **Not `capture.media` with a `kind`.** That method's own refusal says why:// an avatar "belongs to a record something else writes first, and this method// mints its own". A person is that record, so the photograph is a second// method the way a chat attachment is.importFoundationextensionCottonMethod {/// `capture.avatar` — a square JPEG this app staged, into the media store,/// with the person's row updated to point at it.publicstaticlet captureAvatar = "capture.avatar"}/// `capture.avatar`'s request.publicstructCaptureAvatarRequest: Encodable, Sendable {/// Whose face this is. Proved to exist in this workspace before a byte/// moves.publicvar personId: String/// An ABSOLUTE path inside this app's own container — the square the/// picker's photo was reduced to, never the original the picker handed/// over. Nothing below the boundary can read a file anywhere else.publicvar path: Stringpublicvar mime: Stringpublicvar filename: String?publicinit(personId: String, path: String, mime: String, filename: String? = nil) {self.personId = personIdself.path = pathself.mime = mimeself.filename = filename }}/// What `capture.avatar` answers: the key the person's row now carries.publicstructCaptureAvatarAnswer: Decodable, Sendable {publiclet key: Stringpubliclet personId: String}