Package-level declarations

Types

Link copied to clipboard

Locale-invariant, deterministic human-readable byte-count formatter. Port of the Swift DeterministicByteCount. Uses Long arithmetic because Kotlin Int is 32-bit and bytes * 10 overflows at GB scale. Decimal (1000-based) units; unit chosen by magnitude, then rounded half-up within it (never re-promoted), so 999_999 -> "1000 KB". Pinned by the wire spec.

Link copied to clipboard
@Serializable
data class DeviceInfo(val appName: String, val appVersion: String, val buildNumber: String, val model: String, val osName: String, val osVersion: String)

Per-submission device/app metadata. current() (via android.os.Build) is added in P1b.

Link copied to clipboard
class FeedbackClient(transport: FeedbackTransport, deviceInfoProvider: () -> DeviceInfo)

Entry point: holds a transport and a DeviceInfo provider, and submits reports. The Android-specific provider (via android.os.Build) is added in the Android library module; here the provider is supplied explicitly.

Link copied to clipboard
data class FeedbackReport(val type: FeedbackType, val title: String, val description: String, val contactEmail: String? = null, val extraFields: Map<String, String> = emptyMap())

A single user-supplied feedback submission. Attachments (raw files) and the device-info collector are platform concerns handled in later phases.

Link copied to clipboard
class FeedbackSubmissionError(message: String, val status: Int? = null) : Exception

Thrown by transports when a submission fails. status is the HTTP status when applicable.

Link copied to clipboard

Where a report gets delivered. Concrete implementations (GitHub direct, relay) are added in P1b. Returns the backend-assigned identifier (the GitHub issue number for the GitHub transport).

Link copied to clipboard

Bug report or feature request. The raw value is also the GitHub label string.

Link copied to clipboard
class GitHubDirectTransport(owner: String, repo: String, token: String, httpClient: HttpClient = defaultClient()) : FeedbackTransport

Posts a report directly to the GitHub Issues REST API. The token is held by the caller (acceptable for a native app's secure storage).

Link copied to clipboard

Renders a report + device info (+ uploaded attachments) into the exact issue body the parser understands. Port of the Swift IssueBodyFormatter.

Link copied to clipboard

Inverse of IssueBodyFormatter: pulls structured fields out of an issue body. Tolerant of hand-written / legacy bodies. Port of the Swift IssueBodyParser.

Link copied to clipboard
data class ParsedAttachment(val filename: String, val mimeType: String, val url: String, val sizeBytes: Long?)
Link copied to clipboard
data class ParsedFeedbackBody(val description: String = "", val appName: String? = null, val appVersion: String? = null, val device: String? = null, val osVersion: String? = null, val email: String? = null, val attachments: List<ParsedAttachment> = emptyList())
Link copied to clipboard
class RelayTransport(endpoint: String, httpClient: HttpClient = defaultClient(), captchaTokenProvider: suspend () -> String?? = null) : FeedbackTransport

Posts a report to an adopter-operated relay (per the relay contract). The GitHub credential lives on the relay, never in the app.

Link copied to clipboard
data class UploadedAttachment(val filename: String, val mimeType: String, val sizeBytes: Long, val url: String)

An attachment already uploaded; drives the body's attachment block.