Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

Computers show what they are: laptop, Mac mini, penguin for Linux, in a color you pick

leepokai4c577c1bd03b
diff --git a/apps/ios/Views/BotListView.swift b/apps/ios/Views/BotListView.swift
index 02f8ca3a..e63221cb 100644
--- a/apps/ios/Views/BotListView.swift
+++ b/apps/ios/Views/BotListView.swift
@@ -63,7 +63,7 @@ struct BotListView: View {
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button { model.showProfile = true } label: {
- ComputerBadge(name: model.pairing?.name ?? model.hostName, size: 36)
+ ComputerBadge(model.pairing, size: 36)
}
.accessibilityLabel("Profile and computers")
}
diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swift
index 6f073ce3..e37f6807 100644
--- a/apps/ios/Views/SettingsView.swift
+++ b/apps/ios/Views/SettingsView.swift
@@ -23,6 +23,19 @@ struct SettingsView: View {
Button("Remove", systemImage: "trash", role: .destructive) { confirmForget = computer }
}
.contextMenu {
+ Menu("Color", systemImage: "paintpalette") {
+ ForEach(AvatarPalette.colors) { swatch in
+ Button { model.setColor(computer, swatch.id) } label: {
+ // Menus drop SwiftUI tints; an original-mode UIImage keeps the swatch colored.
+ Label {
+ Text(swatch.label)
+ } icon: {
+ Image(uiImage: UIImage(systemName: computer.color == swatch.id ? "checkmark.circle.fill" : "circle.fill")!
+ .withTintColor(UIColor(swatch.color), renderingMode: .alwaysOriginal))
+ }
+ }
+ }
+ }
Button("Remove", systemImage: "trash", role: .destructive) { confirmForget = computer }
}
}
@@ -136,7 +149,7 @@ private struct ComputerRow: View {
var body: some View {
HStack(spacing: 12) {
- ComputerBadge(name: computer.name, size: 40)
+ ComputerBadge(computer, size: 40)
VStack(alignment: .leading, spacing: 2) {
Text(computer.name).font(.body.weight(.semibold)).foregroundStyle(Palette.text)
Text(status).font(.subheadline).foregroundStyle(Palette.secondary).lineLimit(1)
diff --git a/apps/macos/Views/ChatWindow.swift b/apps/macos/Views/ChatWindow.swift
index c8af739c..b2f9054b 100644
--- a/apps/macos/Views/ChatWindow.swift
+++ b/apps/macos/Views/ChatWindow.swift
@@ -77,7 +77,10 @@ private struct ChatSplitView: View {
}
} detail: {
if composing {
+ // The To: row takes the title bar's place instead of sitting under an empty one.
NewChatView { composing = false }
+ .ignoresSafeArea(.container, edges: .top)
+ .toolbarBackground(.hidden, for: .windowToolbar)
} else if let id = model.selection, model.bots[id] != nil {
NavigationStack { ThreadView(botId: id) }
.id(id)
diff --git a/host/src/api.rs b/host/src/api.rs
index 407caca6..b01294af 100644
--- a/host/src/api.rs
+++ b/host/src/api.rs
@@ -102,6 +102,7 @@ pub async fn dispatch(hub: &Arc<Hub>, method: &str, b: Value) -> Result<Value> {
"name": crate::service::host_name(),
"version": env!("CARGO_PKG_VERSION"),
"os": std::env::consts::OS,
+ "device": tokio::task::spawn_blocking(crate::service::device).await?,
"home": dirs::home_dir().map(|p| p.to_string_lossy().into_owned()),
"backends": backends::list(),
"rev": hub.store.current_rev(),
diff --git a/host/src/service.rs b/host/src/service.rs
index 479f3f00..7361d761 100644
--- a/host/src/service.rs
+++ b/host/src/service.rs
@@ -203,6 +203,43 @@ pub fn host_name() -> String {
n.trim_end_matches(".local").to_owned()
}
+/// What the computer is, so phones can draw the right icon (Linux gets its penguin).
+#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize)]
+#[serde(rename_all = "lowercase")]
+pub enum Device {
+ Laptop,
+ MacMini,
+ MacStudio,
+ IMac,
+ MacPro,
+ Desktop,
+ Linux,
+}
+
+/// Detected once; on macOS from `system_profiler`'s model name.
+pub fn device() -> Device {
+ static DEVICE: std::sync::OnceLock<Device> = std::sync::OnceLock::new();
+ *DEVICE.get_or_init(|| {
+ if !cfg!(target_os = "macos") {
+ return Device::Linux;
+ }
+ let out = Command::new("system_profiler").args(["SPHardwareDataType", "-json"]).output();
+ let json: Value = out.ok().and_then(|o| serde_json::from_slice(&o.stdout).ok()).unwrap_or_default();
+ mac_device(json["SPHardwareDataType"][0]["machine_name"].as_str().unwrap_or_default())
+ })
+}
+
+fn mac_device(machine_name: &str) -> Device {
+ match machine_name {
+ n if n.starts_with("MacBook") => Device::Laptop,
+ "Mac mini" => Device::MacMini,
+ "Mac Studio" => Device::MacStudio,
+ "iMac" | "iMac Pro" => Device::IMac,
+ "Mac Pro" => Device::MacPro,
+ _ => Device::Desktop,
+ }
+}
+
/// RFC 3986 percent-encoding of everything but unreserved characters.
fn pct(s: &str) -> String {
use std::fmt::Write as _;
@@ -293,6 +330,17 @@ mod tests {
serde_json::from_str(&std::fs::read_to_string(f).unwrap()).unwrap()
}
+ #[test]
+ fn mac_models_map_to_devices() {
+ assert_eq!(mac_device("MacBook Pro"), Device::Laptop);
+ assert_eq!(mac_device("MacBook Air"), Device::Laptop);
+ assert_eq!(mac_device("Mac mini"), Device::MacMini);
+ assert_eq!(mac_device("Mac Studio"), Device::MacStudio);
+ assert_eq!(mac_device("iMac"), Device::IMac);
+ assert_eq!(mac_device(""), Device::Desktop);
+ assert_eq!(serde_json::to_value(Device::MacMini).unwrap(), "macmini");
+ }
+
#[test]
fn pairing_url_is_escaped() {
let u = pairing_url("Kevin's Mac", "t0k", &["http://100.1.2.3:19222".into(), "http://a:1".into()]);
diff --git a/kit/Sources/CodyncKit/Client/HostClient.swift b/kit/Sources/CodyncKit/Client/HostClient.swift
index becc7864..2ca0e485 100644
--- a/kit/Sources/CodyncKit/Client/HostClient.swift
+++ b/kit/Sources/CodyncKit/Client/HostClient.swift
@@ -5,6 +5,10 @@ public struct Pairing: Codable, Hashable, Sendable {
public var name: String
public var token: String
public var urls: [String]
+ /// What the computer is (`Device` on the host), learned from `hello`; picks its icon.
+ public var device: String?
+ /// The badge color the user picked on this phone (an `AvatarPalette` id).
+ public var color: String?
public init(name: String, token: String, urls: [String]) {
self.name = name
diff --git a/kit/Sources/CodyncKit/Design/CharacterAvatar.swift b/kit/Sources/CodyncKit/Design/CharacterAvatar.swift
index ea99201b..c3c907d8 100644
--- a/kit/Sources/CodyncKit/Design/CharacterAvatar.swift
+++ b/kit/Sources/CodyncKit/Design/CharacterAvatar.swift
@@ -208,26 +208,3 @@ public struct AvatarWithStatus: View {
}
}
}
-
-/// A computer's round monogram: the profile button and the rows that switch computers.
-public struct ComputerBadge: View {
- let name: String
- let size: CGFloat
-
- public init(name: String, size: CGFloat = 36) {
- self.name = name
- self.size = size
- }
-
- public var body: some View {
- Circle()
- .fill(LinearGradient(colors: [Color(hex: 0x5A5A5A), Color(hex: 0x2E2E2E)], startPoint: .top, endPoint: .bottom))
- .overlay(
- Text(name.first.map { String($0).uppercased() } ?? "?")
- .font(.system(size: size * 0.42, weight: .semibold, design: .rounded))
- .foregroundStyle(.white)
- )
- .frame(width: size, height: size)
- .accessibilityHidden(true)
- }
-}
diff --git a/kit/Sources/CodyncKit/Models/Models.swift b/kit/Sources/CodyncKit/Models/Models.swift
index 2c8e225f..79a651ec 100644
--- a/kit/Sources/CodyncKit/Models/Models.swift
+++ b/kit/Sources/CodyncKit/Models/Models.swift
@@ -182,6 +182,8 @@ public struct Hello: Codable, Sendable {
public var name: String
public var version: String
public var os: String
+ /// laptop · macmini · macstudio · imac · macpro · desktop · linux (missing from older hosts).
+ public var device: String?
public var home: String?
public var backends: [Backend]
public var rev: Int64
diff --git a/kit/Sources/CodyncUI/ComputerBadge.swift b/kit/Sources/CodyncUI/ComputerBadge.swift
new file mode 100644
index 00000000..5ec68eb2
--- /dev/null
+++ b/kit/Sources/CodyncUI/ComputerBadge.swift
@@ -0,0 +1,43 @@
+import CodyncKit
+import SwiftUI
+
+/// A computer's round badge showing what it is (laptop, Mac mini, Linux…), in the color picked for it:
+/// the profile button and the rows that switch computers.
+public struct ComputerBadge: View {
+ let computer: Pairing?
+ let size: CGFloat
+
+ public init(_ computer: Pairing?, size: CGFloat = 36) {
+ self.computer = computer
+ self.size = size
+ }
+
+ public var body: some View {
+ let top = computer?.color.map(AvatarPalette.color) ?? Color(hex: 0x5A5A5A)
+ Circle()
+ .fill(top)
+ .overlay(Circle().fill(LinearGradient(colors: [.clear, .black.opacity(0.45)], startPoint: .top, endPoint: .bottom)))
+ .overlay { icon.foregroundStyle(.white) }
+ .frame(width: size, height: size)
+ .accessibilityHidden(true)
+ }
+
+ @ViewBuilder private var icon: some View {
+ switch computer?.device {
+ // SF Symbols has no penguin.
+ case "linux": Image("computer-linux", bundle: .module).resizable().scaledToFit().frame(width: size * 0.5)
+ case let device: Image(systemName: Self.symbol(device)).font(.system(size: size * 0.4, weight: .medium))
+ }
+ }
+
+ private static func symbol(_ device: String?) -> String {
+ switch device {
+ case "laptop": "laptopcomputer"
+ case "macmini": "macmini"
+ case "macstudio": "macstudio"
+ case "imac": "desktopcomputer"
+ case "macpro": "macpro.gen3"
+ default: "desktopcomputer"
+ }
+ }
+}
diff --git a/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/Contents.json b/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/Contents.json
new file mode 100644
index 00000000..8a3634a0
--- /dev/null
+++ b/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/Contents.json
@@ -0,0 +1,5 @@
+{
+ "images" : [ { "filename" : "linux.svg", "idiom" : "universal" } ],
+ "info" : { "author" : "xcode", "version" : 1 },
+ "properties" : { "template-rendering-intent" : "template", "preserves-vector-representation" : true }
+}
diff --git a/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/linux.svg b/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/linux.svg
new file mode 100644
index 00000000..56a1c22c
--- /dev/null
+++ b/kit/Sources/CodyncUI/Resources/AgentIcons.xcassets/computer-linux.imageset/linux.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M12 1.8C9 1.8 7.6 4.2 7.6 7c0 1.6-.6 2.8-1.6 4.2C4.8 12.9 4 14.8 4 16.8c0 1.2.4 2.2 1 3l-1 1.7c-.2.5.2.9.7.8l3.8-.7c1.1.4 2.3.6 3.5.6s2.4-.2 3.5-.6l3.8.7c.5.1.9-.3.7-.8l-1-1.7c.6-.8 1-1.8 1-3 0-2-.8-3.9-2-5.6-1-1.4-1.6-2.6-1.6-4.2 0-2.8-1.4-5.2-4.4-5.2ZM12 10.6c-2.4 0-4 2.7-4 5.6 0 2.4 1.7 3.8 4 3.8s4-1.4 4-3.8c0-2.9-1.6-5.6-4-5.6ZM10.4 5.3a.9.9 0 1 0 0 1.8.9.9 0 0 0 0-1.8Zm3.2 0a.9.9 0 1 0 0 1.8.9.9 0 0 0 0-1.8ZM10.9 8.1h2.2L12 9.5Z"/></svg>
diff --git a/kit/Sources/CodyncUI/Store/BotStore.swift b/kit/Sources/CodyncUI/Store/BotStore.swift
index bc5f03e0..3bdb302c 100644
--- a/kit/Sources/CodyncUI/Store/BotStore.swift
+++ b/kit/Sources/CodyncUI/Store/BotStore.swift
@@ -122,6 +122,18 @@ public final class BotStore {
if let next = computers.first { pair(next) } else { unpair() }
}
+ public func setColor(_ p: Pairing, _ color: String) {
+ updateComputer(p.token) { $0.color = color }
+ }
+
+ private func updateComputer(_ token: String, _ change: (inout Pairing) -> Void) {
+ computers = computers.map { var c = $0; if c.token == token { change(&c) }; return c }
+ if pairing?.token == token { change(&pairing!) }
+ guard persistsPairing else { return }
+ SharedStore.computers = computers
+ if SharedStore.pairing?.token == token, var p = SharedStore.pairing { change(&p); SharedStore.pairing = p }
+ }
+
public func unpair() {
streamTask?.cancel()
pairing = nil
@@ -178,6 +190,9 @@ public final class BotStore {
if hello == nil || hello?.hostId != hostId {
let h = try await client.hello()
hello = h
+ if let device = h.device, self.pairing?.device != device, let token = self.pairing?.token {
+ updateComputer(token) { $0.device = device }
+ }
// Host upgraded since the cache was written: its data may carry new fields.
if let stamp = cacheStamp, stamp != "\(Self.appBuild)/\(h.version)" {
rev = 0