importFoundation// MARK: - Shake to report: `feedback.send` (owner, 13 Nov 2026)//// A shaken report goes to Cotton's own database (the `cotton-product` object's// `app_report`), never into the reporter's Personal. The phone hands the core// one sentence, the PATH of the PNG it wrote of the screen (never the bytes),// where the person stood, this device and its system, the shell's log tail and// the open host the flavour signs in at. The core stamps the app, the build// and the platform itself, keeps the report in its outbox before it posts, and// answers `sent` (Cotton has it) or `kept` (sent by a later `feedback.flush`);// a refusal is the Worker's words (`crates/cotton-ffi/src/phone/feedback_send.rs`).extensionCottonMethod {publicstaticlet feedbackSend = "feedback.send"/// Every kept report tried again: once after the core opens, and each time/// the app comes to the front. Only logged.publicstaticlet feedbackFlush = "feedback.flush"}/// The pixel size of a screenshot the shake took.publicstructFeedbackImageSize: Codable, Sendable, Equatable {publicvar width: Intpublicvar height: Intpublicinit(width: Int, height: Int) {self.width = widthself.height = height }}/// `feedback.send`'s request, every key the core reads and nothing else.publicstructFeedbackSendRequest: Encodable, Sendable, Equatable {publicvar sentence: String/// A PNG this app wrote to its temp directory, deleted once the call/// returns (the core copied it); nil for a report with no picture.publicvar screenshotPath: String?publicvar route: String/// `utsname.machine` (`iPhone16,2`), `hw.model` on a Mac.publicvar device: String/// `iOS 26.1`, `macOS 26.1`.publicvar os: String/// The newest lines of the shell's log ring, oldest first.publicvar log: [String]/// The open host the flavour hands `personal.code`; a signed-out report/// goes there with no bearer.publicvar server: String?publicinit(sentence: String, screenshotPath: String? = nil, route: String, device: String, os: String, log: [String], server: String?) {self.sentence = sentenceself.screenshotPath = screenshotPathself.route = routeself.device = deviceself.os = osself.log = logself.server = server }}/// What `feedback.send` answered when it did not refuse.publicstructFeedbackSent: Decodable, Sendable, Equatable {publicvar id: String/// `sent`: Cotton has it. `kept`: on this phone until there is a connection.publicvar state: String/// Who the Worker filed it as, `signed_in` or `anonymous`, when it was sent.publicvar sender: String?publicinit(id: String, state: String, sender: String? = nil) {self.id = idself.state = stateself.sender = sender }publicvar kept: Bool { state == "kept" }}