// HOME, SIGN-IN, BACKUP AND SYNC, AS THE CORE ANSWERS THEM (`shell.home`;// boundary review move 5, 5 Nov 2026): the gate's stage, its words, its ways// out and where a refusal stands; where this device stands with its personal// object; the backup's count; the sync line; this device's copy; its acts in// order; Home's notices. The shell draws this and decides none of it. Plain// JSON, the same answer a Kotlin shell reads.//// Asked on launch, on every `{phase: home}` frame the core raises (the open// ending, and once a second while the gate waits: the clock's cadence), on a// data event, and after a sign-in, a sign-out or an erase. Never per frame.importFoundationextensionCottonMethod {/// `shell.home {retry?, refusal?, device_name?}` — the gate, the stand,/// the backup, the sync line, this device, its acts and Home's notices,/// answered whole. `retry: true` begins a new wait and a new open;/// `refusal` is a code the app holds before the core can (the Keychain's);/// `device_name` files this phone in the database the core starts on a/// device holding none — there is no first-open choice.publicstaticlet shellHome = "shell.home"}publicstructHomeAnswer: Decodable, Equatable, Sendable {publiclet gate: Gate/// `local`, `connecting`, `connected`, `backing_up` or `failed`.publiclet stand: Stringpubliclet backup: Backuppubliclet sync: Syncpubliclet device: Device?publiclet acts: [Act]publiclet notices: [Notice]/// While a signed-in copy's first pull runs, the core's words saying the/// person's things are on their way: an app with nothing to show yet/// draws these, never its empty screen (launch-fast, 20 Nov 2026).publiclet bringing: Bringing?/// `{ words, line, percent, done, total, then }`: the one progress line/// every app draws (WORDS-PROGRESS-STORAGE.md §2): `words` whole/// ("Loading your data… 42%, then your photos"), `percent` filling its/// thin bar, or the bar moving on its own while `percent` is nil.publicstructBringing: Decodable, Equatable, Sendable {publiclet words: Stringpublicvar line: String?publicvar percent: Int?publicvar done: Int?publicvar total: Int?publicvar then: String?publicinit(words: String, line: String? = nil, percent: Int? = nil, done: Int? = nil, total: Int? = nil, then: String? = nil) {self.words = wordsself.line = lineself.percent = percentself.done = doneself.total = totalself.then = then } }publicstructGate: Decodable, Equatable, Sendable {/// `wait`, `opening`, `stalled`, `door` (a business app's device/// holding no database), `refused`, `moving`, `move_failed`, `failed`/// or `open`.publiclet stage: Stringpubliclet code: String?/// `wall`, `banner` or `none`.publiclet refusal: Stringpubliclet erase: Boolpubliclet beat: Intpubliclet words: Wordspubliclet progress: Progress?publiclet ways_out: [WayOut] }publicstructWords: Decodable, Equatable, Sendable {publiclet reason: String?publiclet title: String?publiclet body: String?publiclet detail: String?publiclet usually: String?publiclet note: String?publiclet clock: String?publiclet progress: String? }publicstructProgress: Decodable, Equatable, Sendable {publiclet done: Intpubliclet total: Int }publicstructWayOut: Decodable, Equatable, Sendable {publiclet id: Stringpubliclet label: String/// `ink`, `line` or `red`.publiclet weight: String }publicstructBackup: Decodable, Equatable, Sendable {publiclet sent: Intpubliclet of: Intpubliclet line: String }publicstructSync: Decodable, Equatable, Sendable {/// `alone`, `idle`, `syncing`, `waiting`, `failed` or `offline`.publiclet state: Stringpubliclet line: String/// The line's typed state (`up_to_date`, `not_reached`, …).publiclet line_state: String?/// Changes waiting to go up.publiclet counter: Intpubliclet failures: Int }publicstructDevice: Decodable, Equatable, Sendable {publiclet id: String?publiclet copy_bytes: Int?publiclet rows: Int?publiclet caught_up_at: String? }publicstructAct: Decodable, Equatable, Sendable {publiclet id: Stringpubliclet label: String/// `main`, `more` or `away`.publiclet rank: Stringpubliclet red: Bool }publicstructNotice: Decodable, Equatable, Sendable {publiclet id: Stringpubliclet words: String/// `quiet`, `amber`, `refusal` or `done`.publiclet kind: String }}