// A PAGE OF A SCROLLING LIST, AS THE CORE ANSWERS IT (`shell.list`; the// shell boundary, 5 Nov 2026: the core answers what to show, a platform shell// only draws). Its sections in order under their headings with their counts// in words, each row's slip words, check, stamp, acts and tap; the list's// title, menu, links, groups, index rail, filter row, empty words, clear and// Select. The list draws this and decides none of it. Plain JSON, the same// answer a Kotlin shell reads.importCottonKitimportCottonValuesimportFoundation/// Select's Delete over the records picked (`shell.list {deleting}`): those/// it takes, whether it asks, its question, its word, the receipt's words/// over them all and once undone, and what is said after.structListDeleting: Decodable, Equatable, Sendable {let ids: [String]let asks: Boollet word: Stringlet question: ListAnswer.Questionlet done: Stringlet undone: Stringlet outcome: StringstructEnvelope: Decodable { let deleting: ListDeleting }}structListAnswer: Decodable, Equatable, Sendable {let table: Stringlet title: Stringlet head: Head?let sections: [Section]let acts: [String: Act]let menu: [MenuItem]let links: [Link]/// The table's groups as its row of stacks; nil where the list draws none.let groups: [Group]?let offers_new_group: Bool/// The index rail's landings; nil on a list with no rail.let index: [Landing]?let filter: FilterRow?let empty: Empty?let clear: Clear?let select: Select/// What the search field says before anything is typed.let search: String?/// The words of the rows under this table's section on another's page.let section_words: SectionWords?/// A long press drags: the list is the whole of a hand-written order.let reorders: Bool/// Seconds between asks while the list is open; nil, never.let polls: Int?/// A grid's columns; nil, a column of slips.let across: Int?/// The "Recent" rows above the list: its latest, on the whole table unnarrowed.let recent: [Recent]/// The notes of the group sections the list holds none of, said under it.let notes: [String]/// How many rows the whole read holds.let count: Int/// The cursor of the page after this one; nil at the list's end.let next: Int?structSectionWords: Decodable, Equatable, Sendable {let new: Stringlet create: Stringlet select: Stringlet reorder: Stringlet all: String }structRecent: Decodable, Equatable, Sendable {let id: Stringlet title: String?/// When, as the core says it ("2 min ago").let when: String? }structHead: Decodable, Equatable, Sendable {let lines: [HeadLine]? }structHeadLine: Decodable, Equatable, Sendable {let line: String? }structSection: Decodable, Equatable, Sendable {let id: Stringlet heading: String?/// Drawn open; a section that folds opens shut.letopen: Boollet folds: Bool/// The whole section's count in words, on a section that folds.let count: String?let note: String?/// The core's head lines over the whole group ("₹1,200 in").let lines: [String]?let rows: [Row] }structRow: Decodable, Equatable, Sendable {let id: Stringlet slip: Slip/// Whether the slip's check is on; nil on a table with no check.let toggled: Bool?/// What a tap on the check writes, `{column: value}`; nil, nothing.let toggle: [String: RecordValue]?let dimmed: Bool/// The stamp the record wears, by its word (done, dropped, a choice's stamp).let stamp: String?/// On a pick: whether the record is already held.let held: Bool?/// Whether Select's Delete may take it.let deletes: Bool/// The long press's acts, by id (`acts`).let acts: [String]/// What the long press runs, each act whole as `shell.opened` answers/// it, a command that asks first with its question.let press: [Press]/// What a tap does: `open.<opening>`, or `pick`.let tap: String/// Its place on a numbered list, counted from 1.let place: Int?var record: TableRecord { slip.record.record }/// The row as the record's one answer.var said: RecordSaid {let held = record.saidreturnRecordSaid(slip: slip.words, toggled: toggled, toggle: toggle, dimmed: dimmed, stamp: stamp, deletes: deletes, readOnly: held?.readOnly ?? false, typesInto: held?.typesInto ?? false, archived: held?.archived ?? false, listed: held?.listed ?? true, project: held?.project, layout: held?.layout, red: held?.red ?? [], unitWords: held?.unitWords ?? [:]) } }/// The words a slip draws (`SlipWords`, the core's one slip answer) and/// the record they say. @dynamicMemberLookupstructSlip: Decodable, Equatable, Sendable {let words: SlipWordslet record: CoreRecords.WireRecordsubscript<Value>(dynamicMember path: KeyPath<SlipWords, Value>) -> Value { words[keyPath: path] }privateenumKeys: String, CodingKey { case record }init(from decoder: Decoder) throws {guardcase .object(let said) = tryRecordValue(from: decoder) else {throwDecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "a slip is an object")) } words = SlipWords(said) record = try decoder.container(keyedBy: Keys.self).decode(CoreRecords.WireRecord.self, forKey: .record) } }structAct: Decodable, Equatable, Sendable {let label: String?let kind: String?let red: Boollet primary: Bool?let icon: String? }/// One act of a row's long press: the act as the held card's, and the/// question it asks first, in the core's words.structPress: Decodable, Equatable, Sendable, Identifiable {let act: CardActionlet question: Question?/// What Archive and Bring back write, `{column: value}`.let write: [String: RecordValue]?var id: String { act.id }privateenumKeys: String, CodingKey { case question, write }init(from decoder: Decoder) throws { act = tryCardAction(from: decoder)let keys = try decoder.container(keyedBy: Keys.self) question = try keys.decodeIfPresent(Question.self, forKey: .question) write = try keys.decodeIfPresent([String: RecordValue].self, forKey: .write) } }/// A question asked before an act, whole: its title, its sentence, its button.structQuestion: Decodable, Equatable, Sendable {let title: Stringlet message: Stringlet confirm: Stringlet cancel: String? }structMenuItem: Decodable, Equatable, Sendable, Identifiable {let id: Stringlet label: Stringlet red: Bool/// The item asks first: `true`, or `{words: {hint}}` for a short text.let asks: JSONValue?/// Where it goes: `{path}` or a list `{table, where, …}`.let opens: Opens?let object: String?/// What it does, which its card is coloured by (`moves`, …).let does: CommandDoes?/// A group page's own act, as `tool_acts::list_acts` said it.let act: CardAction?/// A group page's pick: `add` (the table's records put in) or `remove`.let picks: String?/// What it asks first, in the list's words (Remove list).let question: Question? }structLink: Decodable, Equatable, Sendable {let id: Stringlet label: String/// The label with its count said ("Senders 12", "3 recordings failed").let words: Stringlet count: Int?let lead: Boollet above: Boollet opens: Opens }/// A list another list opens: its table, narrowing and title.structOpens: Decodable, Equatable, Sendable {let table: String?let `where`: [String: RecordValue]?let title: String?let section: String?let query: String?let archived: Bool?/// A record it opens (a group kept as another table's record).let id: String?let path: String? }structGroup: Decodable, Equatable, Sendable {let id: Stringlet name: Stringlet count: Int?let picture: String?/// The word the group's record wears in red under its name ("suggested").let byline: String?let top: [Top]let opens: OpensstructTop: Decodable, Equatable, Sendable {let id: Stringlet title: String?let picture: String?/// The member itself, which its pile's face draws.let record: CoreRecords.WireRecord? } }structLanding: Decodable, Equatable, Sendable {let letter: Stringlet row: String/// The cursor that reaches it.let at: Int }structFilterRow: Decodable, Equatable, Sendable {let column: String?let all: String?let tabs: Boollet values: [Value]let reviews: Bool?/// What waits on the owner ("3 to review"); nil while nothing does.let review: String?structValue: Decodable, Equatable, Sendable {let value: Stringlet word: String } }structEmpty: Decodable, Equatable, Sendable {let title: Stringlet message: Stringlet picture: String? }structClear: Decodable, Equatable, Sendable {let label: Stringlet note: String?let question: Stringlet message: Stringlet confirm: String/// What the receipt says once every record went; nil, the shell's words.let done: String? }structSelect: Decodable, Equatable, Sendable {let deletes: Boollet adds_to_group: Bool/// Its Delete's word: the table's ("Remove"), else Delete.let word: String }}extensionListAnswer.Slip {/// Two slips are one where their words and their record's columns are.staticfunc == (a: Self, b: Self) -> Bool { a.title == b.title && a.subtitle == b.subtitle && a.caption == b.caption && a.caption_late == b.caption_late && a.figure == b.figure && a.foot == b.foot && a.foot_late == b.foot_late && a.day_foot == b.day_foot && a.stub == b.stub && a.byline == b.byline && a.badge == b.badge && a.unread == b.unread && a.record.id == b.record.id && a.record.data == b.record.data }}extensionListAnswer.Group.Top {staticfunc == (a: Self, b: Self) -> Bool { a.id == b.id && a.title == b.title && a.picture == b.picture && a.record?.data == b.record?.data }}extensionListAnswer {/// Every row the answer holds, in its order.var rows: [Row] { sections.flatMap(\.rows) }}