import Foundation // Roster's words for who works on a task and where it is (chat_roster.go: // rosterAuthor, rosterTone, rosterTrack). They live here, beside the Live // Activity, so the app and its widget extension draw a task the same way; // EquipoKit re-exports them. public enum Specialist: String, CaseIterable, Sendable { case coordinator, engineering, copy, research, checks, review, design public init(category: String) { self = Specialist(rawValue: category.lowercased()) ?? .coordinator } public var name: String { switch self { case .coordinator: return String(localized: "specialist.coordinator", bundle: .module) case .engineering: return String(localized: "specialist.engineering", bundle: .module) case .copy: return String(localized: "specialist.copy", bundle: .module) case .research: return String(localized: "specialist.research", bundle: .module) case .checks: return String(localized: "specialist.checks", bundle: .module) case .review: return String(localized: "specialist.review", bundle: .module) case .design: return String(localized: "specialist.design", bundle: .module) } } /// SF Symbols, matching the web's icons (wrench, type, search). public var symbol: String { switch self { case .coordinator: return "sparkle" case .engineering: return "wrench.adjustable" case .copy: return "textformat" case .research: return "magnifyingglass" case .checks: return "checklist.checked" case .review: return "checkmark.shield" case .design: return "paintbrush.pointed" } } } /// Amber waits on you, red only for a failure; indigo (paused) carries on /// by itself (paused work, 2026-11-24). public enum StageTone: String, Sendable { case positive, warning, negative, paused } public enum Stage: String, CaseIterable, Sendable { case noted, inProgress = "in_progress", inReview = "in_review", readyToMerge = "ready_to_merge", done public init?(wire: String) { switch wire { case "merging": self = .readyToMerge case "investigated": self = .noted default: self.init(rawValue: wire) } } public var label: String { switch self { case .noted: return String(localized: "stage.noted", bundle: .module) case .inProgress: return String(localized: "stage.in_progress", bundle: .module) case .inReview: return String(localized: "stage.in_review", bundle: .module) case .readyToMerge: return String(localized: "stage.ready_to_merge", bundle: .module) case .done: return String(localized: "stage.done", bundle: .module) } } /// chat_roster.go rosterTrack: the five stops, those before `current` /// done, `current` in its tone. An unknown stage sits on the first. public static func track(at current: Stage?, tone: StageTone) -> [TrackStop] { let index = allCases.firstIndex(of: current ?? .noted) ?? 0 return allCases.enumerated().map { i, s in TrackStop(stage: s, state: i < index ? .done : i == index ? .current : .todo, tone: i == index ? tone : nil) } } } public enum StopState: Sendable { case done, current, todo } public struct TrackStop: Identifiable, Sendable, Equatable { public var stage: Stage public var state: StopState public var tone: StageTone? /// The current stop's words when it is paused, stopped or needs you /// (paused work); nil: the stage's own. public var label: String? = nil public var id: String { stage.rawValue } }