import Foundation // The person API as a device bearer reads it: the conversation engine's // routes (internal/equipo/chat/http.go) and the shapes in internal/wire. // The web's Roster conversation is drawn from the same engine. Fixtures // under Tests/.../Fixtures/thin are this server's own answers, captured and // strictly checked by internal/thintest TestNativeFixtures. public struct ThinMe: Codable, Sendable, Equatable { public var id: String public var address: String public var role: String public var teamId: String public var teamName: String public var revision: Int64 } public struct ThinMessage: Codable, Sendable, Identifiable, Equatable { public var attachments: [MessageAttachment]? = nil public var projectId: String? = nil public var id: String public var revision: Int64 public var role: String public var text: String public var turnId: String public var createdAt: Date public var isOwn: Bool { role == "person" } } public struct ThinTurn: Codable, Sendable, Identifiable, Equatable { public var replyId: String? = nil public var attempt: Int64? = nil public var id: String public var revision: Int64 public var kind: String public var state: String public var reason: String public var createdAt: Date public var updatedAt: Date /// Queued or running: the coordinator is still on it. public var isLive: Bool { !["replied", "failed", "cancelled"].contains(state) } } public struct ThinCard: Codable, Sendable, Identifiable, Equatable { public var rememberName: String? = nil public var placementByName: Bool? = nil public var placementQuestion: Bool? = nil public var isPlacementQuestion: Bool { placementQuestion == true || placementByName == true } public var isTypedProjectChoice: Bool { placementByName == true } public var answerFieldKey: String { isTypedProjectChoice ? "projects.other" : "chat.card.answer" } public var id: String public var revision: Int64 public var kind: String public var state: String public var turnId: String public var projectId: String public var name: String public var question: String public var options: [String]? public var choice: String public var taskId: String public var createdAt: Date public var updatedAt: Date public var previewUrl: String? /// Set aside by this person (POST /cards/{id}/visibility); absent when not. public var aside: Bool? /// The person can still act on it (wire.CardOpen and the setup states). public var isOpen: Bool { ["open", "ask"].contains(state) } /// Set aside, and still waiting: shown as a one-line stub with Undo, and /// still in Needs you (chat_roster.go SetAside). public var isAside: Bool { aside == true && isOpen } } public struct ThreadEntry: Codable, Sendable, Identifiable, Equatable { public var id: String public var author: String public var text: String public var at: Date } public struct ThinStepHosted: Codable, Sendable, Equatable { public var failed: [String]? } /// A data-defined specialist that makes a task's work (wire.Maker). public struct ThinMaker: Codable, Sendable, Equatable { public var id: String public var profile: String /// The specialist it is, as Specialist(category:) names one: its /// profile without the version (design for design-v1). public var category: String { guard let range = profile.range(of: "-v", options: .backwards), range.lowerBound > profile.startIndex else { return profile } return String(profile[..: Codable, Sendable { public var items: [Item]? } public struct MessagePage: Codable, Sendable { public var items: [ThinMessage]?; public var before: String } public struct Sent: Codable, Sendable { public var message: ThinMessage; public var turn: ThinTurn } public struct Answered: Codable, Sendable { public var card: ThinCard } public struct CardConflict: Codable, Sendable { public var code: String; public var card: ThinCard } /// One event from `GET /events`. `data` holds the resource it names. public struct ThinEvent: Codable, Sendable { public var cursor: Int64? public var type: String public var resource: String public var id: String public var revision: Int64 public var turnId: String? } /// What the coordinator is doing now (an `activity` event's data). public struct ThinActivity: Codable, Sendable, Equatable { public var turnId: String public var kind: String public var tool: String public var repo: String public var label: String } /// Run now's body and answer (wire.RunNow, wire.RunNowAccepted). struct RunNowInput: Codable, Sendable { var step: String; var stepRevision: Int64; var offer: String } public struct RunNowAccepted: Codable, Sendable, Equatable { public var release: String } /// The person's time zone (wire.TimeZone). public struct TimeZoneValue: Codable, Sendable, Equatable { public var timeZone: String } public struct ThinPriority: Codable, Sendable, Equatable { public var priority: String? = nil public var setBy: String? = nil public var by: Date? } public struct ThinTriage: Codable, Sendable, Equatable { public var since: Date? = nil public var said: String? = nil public var failed: [String]? = nil public var recommend: String? = nil public var why: String? = nil public var kind: String; public var reason: String? }