// YOUR CLAUDE (the owner, 20 Nov 2026: connecting Claude is// the grant), a card on Account after Open access (Android's// `AssistantsPart.kt`): the promise, each connection of your Claude, and// every sealed table with how it stands (On, Ask each time, Off). Its fan// holds each table (a tap deals its three settings), Remove, and Connect// Claude. Connect Claude and turning on a table left off on the card go// behind the phone's lock; the rest do not.//// Every word is the core's (`assistant.screen`); this file decides nothing// about what the grant is.importCottonFacesimportCottonKitimportCottonValuesimportFoundation/// Account's Your Claude card, as `assistant.screen` answers it.structYourClaude: Equatable, Sendable {structChoice: Equatable, Sendable {let access: Stringlet label: Stringlet on: Bool }structTable: Equatable, Sendable {let table: Stringlet label: Stringlet needsLock: Boollet choices: [Choice]/// How it stands now, in the core's words.var said: String { choices.first(where: \.on)?.label ?? "" } }/// One group a person knows (Comms' Chats, Mail, Photos, Calls, Contacts,/// Files: the kit's `reads`), its tables set together; `mixed` where they/// stand apart, with no choice on.structGroup: Equatable, Sendable {let id: Stringlet label: Stringlet line: Stringlet access: Stringlet needsLock: Boollet choices: [Choice] }/// How your Claude may read now: `standing`, `timed`, `asks`, `nothing`,/// `waiting` or `none`, said for the page and for You's row.structReading: Equatable, Sendable {structAct: Equatable, Sendable {/// `ask_all` (Ask each time instead) or `stop` (Stop now).let id: Stringlet label: String }let state: Stringlet row: Stringlet connected: String?let title: String?let line: String?let act: Act?let note: String?let disconnect: String? }let heading: Stringlet promise: Stringlet connections: [String]let none: String?let mayRead: Stringlet tables: [Table]/// Connect Claude, offered only while no Claude is connected (the core leaves it out once one is).let connect: String?let remove: String?/// The kit's groups (none for an app whose kit names none: it keeps `tables`).let groups: [Group]let reading: Reading?/// The card, or nil while the core answers none (signed out, no personal copy).init?(_ answer: JSONValue?) {guardlet answer, let heading = answer.text("heading") else { returnnil }self.heading = heading promise = answer.text("promise") ?? "" connections = answer.list("connections").compactMap { $0.text("said") } none = answer.text("none") mayRead = answer.text("mayRead") ?? "" tables = answer.list("tables").compactMap { t inguardlet table = t.text("table") else { returnnil }let choices = t.list("choices").compactMap { c in c.text("access").map { Choice(access: $0, label: c.text("label") ?? $0, on: c.flag("on")) } }returnTable(table: table, label: t.text("label") ?? table, needsLock: t.flag("needsLock"), choices: choices) } connect = answer.text("connect") remove = answer.text("remove") groups = answer.list("groups").compactMap { g inguardlet id = g.text("id") else { returnnil }let choices = g.list("choices").compactMap { c in c.text("access").map { Choice(access: $0, label: c.text("label") ?? $0, on: c.flag("on")) } }returnGroup(id: id, label: g.text("label") ?? id, line: g.text("line") ?? "", access: g.text("access") ?? "", needsLock: g.flag("needsLock"), choices: choices) } reading = answer["reading"].flatMap { r in r.text("state").map { state inReading(state: state, row: r.text("row") ?? "", connected: r.text("connected"), title: r.text("title"), line: r.text("line"), act: r["act"].flatMap { a in a.text("id").map { Reading.Act(id: $0, label: a.text("label") ?? "") } }, note: r.text("note"), disconnect: r.text("disconnect")) } } }/// The card on the plain face: the heading and the promise, each/// connection, then each table with how it stands.var drawn: DeckCard {var facts: [RecordValue] = connections.map { .object(["label": .text(""), "said": .text($0)]) }iflet none { facts.append(.object(["label": .text(""), "said": .text(none)])) } facts += tables.map { .object(["label": .text($0.label), "said": .text($0.said)]) }returnDeckCard(face: "plain", corner: nil, pressing: false, pace: nil, plate: nil, fields: ["title": .text(heading),"subtitle": .text(promise),"facts": .list(facts), ]) }structScope: Encodable, Sendable {let table: Stringlet access: String }structSignedScope: Encodable, Sendable {let table: Stringlet access: Stringlet privateKey: String }structSigned: Encodable, Sendable {let privateKey: String }/// A group's tables set together (`assistant.scope {group, access}`).structGroupScope: Encodable, Sendable {let group: Stringlet access: String }/// Widening a group, behind the phone's lock.structSignedGroupScope: Encodable, Sendable {let group: Stringlet access: Stringlet privateKey: String }}