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.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
Dotted bots and a quieter, monochrome look
leepokaid88fadeeefda
diff --git a/Codync-iOS/Views/BotListView.swift b/Codync-iOS/Views/BotListView.swiftindex e619d58f..85b156e4 100644--- a/Codync-iOS/Views/BotListView.swift+++ b/Codync-iOS/Views/BotListView.swift@@ -89,7 +89,7 @@ private struct EmptyRoster: View {var body: some View {VStack(spacing: 14) {CharacterAvatar(shape: "cloud", color: "green", size: 72)- Text("No bots yet").font(.title3.bold()).foregroundStyle(Palette.text)+ Text("No bots yet").font(.title3.weight(.semibold)).foregroundStyle(Palette.text)Text("Create a bot for each kind of work — a reviewer, a fixer, a docs writer — and point it at a project.").font(.subheadline).foregroundStyle(Palette.secondary)diff --git a/Codync-iOS/Views/PairingView.swift b/Codync-iOS/Views/PairingView.swiftindex b1f366e0..4f40f583 100644--- a/Codync-iOS/Views/PairingView.swift+++ b/Codync-iOS/Views/PairingView.swift@@ -22,7 +22,8 @@ struct PairingView: View {VStack(alignment: .leading, spacing: 10) {Text("Your coding agents,\nas teammates.")- .font(.system(size: 34, weight: .bold))+ .font(.system(size: 34, weight: .semibold))+ .tracking(-0.6).foregroundStyle(Palette.text)Text("Give each agent a name, a job and a project. Then just message the right one — it works on your computer while your phone is in your pocket.").font(.body)@@ -103,11 +104,11 @@ private struct Step: View {var body: some View {HStack(alignment: .top, spacing: 12) {- Text(n.map(String.init) ?? "")- .font(.footnote.bold())- .frame(width: 24, height: 24)- .background(n == nil ? .clear : Palette.accentDim, in: Circle())- .foregroundStyle(Palette.text)+ Text(n.map { String(format: "%02d", $0) } ?? "")+ .font(.system(size: 12, weight: .medium, design: .monospaced))+ .frame(width: 24, alignment: .leading)+ .padding(.top, 2)+ .foregroundStyle(Palette.tertiary)VStack(alignment: .leading, spacing: 6) {if !title.isEmpty {Text(title).font(.headline).foregroundStyle(Palette.text)diff --git a/CodyncKit/Sources/CodyncKit/CharacterAvatar.swift b/CodyncKit/Sources/CodyncKit/CharacterAvatar.swiftindex a6382760..53421376 100644--- a/CodyncKit/Sources/CodyncKit/CharacterAvatar.swift+++ b/CodyncKit/Sources/CodyncKit/CharacterAvatar.swift@@ -1,6 +1,6 @@import SwiftUI-/// Grok-Bot-style character: a colored shape with eyes. The eyes look around+/// Grok-Bot-style character: a colored shape with slit eyes. The eyes drift/// while the bot works; a badge shows when it needs you.public struct CharacterAvatar: View {public enum Mood: Sendable { case idle, working, needsInput }@@ -28,8 +28,12 @@ public struct CharacterAvatar: View {public var body: some View {ZStack {- CharacterShape(kind: shape)- .fill(color.gradient)+ // too few dots below ~24pt to read as a character — stay solid+ if size < 24 {+ CharacterShape(kind: shape).fill(color.gradient)+ } else {+ DottedBody(shape: shape, color: color, size: size, mood: mood)+ }Eyes(size: size, working: mood == .working).offset(y: -size * 0.03)}@@ -38,25 +42,94 @@ public struct CharacterAvatar: View {}}+/// The body as a halftone of dots (after thinking-orbs): each dot is shaded as+/// if the silhouette were a sphere, so size and ink carry the depth. The body+/// is grey ink; the bot's color only lands on the brightest dots. Working+/// swings the light around the body; needing you sends a ripple out from the+/// center. Idle is a still frame lit from the upper left.+private struct DottedBody: View {+ let shape: String+ let color: Color+ let size: CGFloat+ let mood: CharacterAvatar.Mood+ @Environment(\.accessibilityReduceMotion) private var reduceMotion++ var body: some View {+ let step = size / 16+ let dots = Self.grid(shape: shape, size: size, step: step)+ let still = mood == .idle || reduceMotion+ TimelineView(.animation(paused: still)) { timeline in+ let t = still ? 0 : timeline.date.timeIntervalSinceReferenceDate.truncatingRemainder(dividingBy: 3600)+ Canvas { ctx, _ in+ let half = size / 2+ let yaw = mood == .working ? t * 1.4 : -0.7+ let lx = sin(yaw) * 0.8, ly = 0.55, lz = cos(yaw) * 0.5 + 0.6 // never fully behind+ let ll = (lx * lx + ly * ly + lz * lz).squareRoot()+ for p in dots {+ let u = (p.x - half) / half, v = (half - p.y) / half+ let z = max(0.2, 1 - u * u - v * v).squareRoot()+ let nl = (u * u + v * v + z * z).squareRoot()+ var shade = 0.3 + 0.7 * max(0, (u * lx + v * ly + z * lz) / (nl * ll))+ if mood == .needsInput {+ let ripple = 0.5 + 0.5 * sin((u * u + v * v).squareRoot() * 9 - t * 5)+ shade *= 0.6 + 0.4 * ripple+ }+ let r = step * 0.38 * (0.3 + 0.7 * shade)+ let dot = Path(ellipseIn: CGRect(x: p.x - r, y: p.y - r, width: r * 2, height: r * 2))+ ctx.fill(dot, with: .color(Palette.text.opacity(0.12 + 0.33 * min(1, shade / 0.7))))+ if shade > 0.7 {+ ctx.fill(dot, with: .color(color.opacity((shade - 0.7) / 0.3)))+ }+ }+ }+ }+ }++ /// Hex-packed dot centers that fall inside the silhouette.+ static func grid(shape: String, size: CGFloat, step: CGFloat) -> [CGPoint] {+ let path = CharacterShape(kind: shape).path(in: CGRect(x: 0, y: 0, width: size, height: size))+ let rowH = step * 0.866+ var out: [CGPoint] = []+ var row = 0+ var y = rowH / 2+ while y < size {+ var x = row.isMultiple(of: 2) ? step / 2 : step+ while x < size {+ let p = CGPoint(x: x, y: y)+ if path.contains(p) { out.append(p) }+ x += step+ }+ y += rowH+ row += 1+ }+ return out+ }+}++/// Two thin lit slits that blink now and then and drift slowly while working.private struct Eyes: View {let size: CGFloatlet working: Bool+ @Environment(\.accessibilityReduceMotion) private var reduceMotionvar body: some View {- let eye = size * 0.17- HStack(spacing: size * 0.12) {+ HStack(spacing: size * 0.2 - max(1.4, size * 0.038)) {ForEach(0..<2, id: \.self) { _ inCapsule()- .fill(.white)- .frame(width: eye * 0.8, height: eye * 1.15)- .overlay(- Circle().fill(Color(hex: 0x141712)).frame(width: eye * 0.45)- )+ .fill(Palette.text)+ .frame(width: max(1.4, size * 0.038), height: size * 0.12)}}- .phaseAnimator(working ? [-1.0, 1.0] : [0.0]) { view, phase in- view.offset(x: phase * size * 0.06)- } animation: { _ in .easeInOut(duration: 0.9) }+ .keyframeAnimator(initialValue: 1.0, repeating: !reduceMotion) { view, open in+ view.scaleEffect(y: open)+ } keyframes: { _ in+ LinearKeyframe(1.0, duration: 4.5)+ LinearKeyframe(0.12, duration: 0.08)+ LinearKeyframe(1.0, duration: 0.1)+ }+ .phaseAnimator(working && !reduceMotion ? [-1.0, 1.0] : [0.0]) { view, phase in+ view.offset(x: phase * size * 0.04)+ } animation: { _ in .easeInOut(duration: 1.6) }}}diff --git a/CodyncKit/Sources/CodyncKit/Theme.swift b/CodyncKit/Sources/CodyncKit/Theme.swiftindex 97255a07..0dbbe935 100644--- a/CodyncKit/Sources/CodyncKit/Theme.swift+++ b/CodyncKit/Sources/CodyncKit/Theme.swift@@ -36,28 +36,40 @@ public extension Color {}}-/// Palette lifted from Grok Bot's shipped renderer: green-tinted graphite with a lime accent.+/// Ink on paper: neutral graphite, and the text color doubles as the accent.+/// Color comes from the bots themselves; the chrome stays monochrome, with+/// amber kept for "needs you" and red for errors.public enum Palette {- public static let background = Color(light: 0xF6F7F3, dark: 0x121411)- public static let surface = Color(light: 0xFFFFFF, dark: 0x1A1D19)- public static let bubbleAgent = Color(light: 0xECEFE7, dark: 0x20231F)- public static let border = Color(light: 0xDCE0D6, dark: 0x343832)- public static let text = Color(light: 0x1A1D19, dark: 0xEEF3E7)- public static let secondary = Color(light: 0x5B6256, dark: 0xA9AFA3)- public static let tertiary = Color(light: 0x8A9184, dark: 0x747B70)- /// Lime used for fills (user bubbles, primary buttons).- public static let accentFill = Color(hex: 0xC7EC6B)- /// Lime/olive readable as text on the background.- public static let accent = Color(light: 0x557212, dark: 0xC7EC6B)- public static let onAccent = Color(hex: 0x141712)- public static let accentDim = Color(light: 0xC9D9A0, dark: 0x53632F)+ public static let background = Color(light: 0xF7F7F5, dark: 0x0E0F0E)+ public static let surface = Color(light: 0xFFFFFF, dark: 0x171817)+ public static let bubbleAgent = Color(light: 0xEFEFEC, dark: 0x1E1F1E)+ public static let border = Color(light: 0xE4E4E0, dark: 0x2A2B2A)+ public static let text = Color(light: 0x161716, dark: 0xEDEDEA)+ public static let secondary = Color(light: 0x5E5F5C, dark: 0xA3A4A0)+ public static let tertiary = Color(light: 0x94958F, dark: 0x6C6D69)+ /// Ink used for fills (user bubbles, primary buttons).+ public static let accentFill = Color(light: 0x161716, dark: 0xEDEDEA)+ /// Ink readable as text and tint on the background.+ public static let accent = Color(light: 0x161716, dark: 0xEDEDEA)+ public static let onAccent = Color(light: 0xF7F7F5, dark: 0x0E0F0E)+ public static let accentDim = Color(light: 0xDADAD6, dark: 0x3A3B39)public static let danger = Color(light: 0xC23A2B, dark: 0xF0A7A7)- public static let warning = Color(hex: 0xFF9800)- public static let codeBackground = Color(light: 0xF0F2EC, dark: 0x1A1D19)+ public static let warning = Color(hex: 0xF0A030)+ public static let codeBackground = Color(light: 0xF1F1EE, dark: 0x141514)public static let added = Color(light: 0x2E7D32, dark: 0x8FD18B)public static let removed = Color(light: 0xC62828, dark: 0xF0A7A7)}+public extension View {+ /// Small tracked monospaced caps for metadata: times, states, section labels.+ func metaStyle(_ color: Color = Palette.tertiary) -> some View {+ font(.system(size: 10.5, weight: .medium, design: .monospaced))+ .tracking(0.6)+ .textCase(.uppercase)+ .foregroundStyle(color)+ }+}+public enum AvatarPalette {public struct Swatch: Identifiable, Hashable, Sendable {public let id: Stringdiff --git a/CodyncKit/Sources/CodyncKit/ThinkingOrb.swift b/CodyncKit/Sources/CodyncKit/ThinkingOrb.swiftnew file mode 100644index 00000000..bb76e448--- /dev/null+++ b/CodyncKit/Sources/CodyncKit/ThinkingOrb.swift@@ -0,0 +1,48 @@+import SwiftUI++/// The app's busy indicator: a small dotted sphere turning in place, after+/// thinking-orbs' "working" orb. Depth is carried by dot size and opacity.+public struct ThinkingOrb: View {+ let size: CGFloat+ let color: Color+ @Environment(\.accessibilityReduceMotion) private var reduceMotion++ public init(size: CGFloat = 16, color: Color = Palette.text) {+ self.size = size+ self.color = color+ }++ public var body: some View {+ let lattice = Self.lattice(size < 20 ? 60 : 140)+ TimelineView(.animation(paused: reduceMotion)) { timeline in+ let t = reduceMotion ? 0.6 : timeline.date.timeIntervalSinceReferenceDate.truncatingRemainder(dividingBy: 3600)+ Canvas { ctx, canvas in+ let c = canvas.width / 2, r = c * 0.84+ let (sy, cy) = (sin(t * 0.9), cos(t * 0.9))+ let (st, ct) = (sin(0.35), cos(0.35))+ let dots = lattice.map { p -> (CGFloat, CGFloat, Double) in+ let x1 = p.x * cy + p.z * sy, z1 = -p.x * sy + p.z * cy+ let y1 = p.y * ct - z1 * st, z2 = p.y * st + z1 * ct+ return (c + x1 * r, c - y1 * r, z2)+ }.sorted { $0.2 < $1.2 }+ for (x, y, z) in dots {+ let depth = (z + 1) / 2+ let d = canvas.width * (0.035 + 0.075 * depth)+ ctx.fill(Path(ellipseIn: CGRect(x: x - d / 2, y: y - d / 2, width: d, height: d)),+ with: .color(color.opacity(0.12 + 0.88 * depth)))+ }+ }+ }+ .frame(width: size, height: size)+ .accessibilityHidden(true)+ }++ /// Evenly spread directions on a unit sphere (Fibonacci lattice).+ private static func lattice(_ n: Int) -> [(x: Double, y: Double, z: Double)] {+ let golden = Double.pi * (3 - 5.0.squareRoot())+ return (0..<n).map { i in+ let y = 1 - 2 * (Double(i) + 0.5) / Double(n), rad = (1 - y * y).squareRoot(), a = Double(i) * golden+ return (rad * cos(a), y, rad * sin(a))+ }+ }+}diff --git a/CodyncKit/Sources/CodyncKit/UsageStyle.swift b/CodyncKit/Sources/CodyncKit/UsageStyle.swiftindex d195da1b..e61d61a1 100644--- a/CodyncKit/Sources/CodyncKit/UsageStyle.swift+++ b/CodyncKit/Sources/CodyncKit/UsageStyle.swift@@ -2,12 +2,12 @@ import SwiftUI/// One place for "how full is this limit" colors, shared by the apps, the menu bar and widgets.public extension Palette {- /// Fill for bars: lime, orange from 70%, red from 90%.+ /// Fill for bars: ink, amber from 70%, red from 90%.static func usageFill(_ percent: Double) -> Color {percent >= 90 ? danger : percent >= 70 ? warning : accentFill}- /// Tint for gauges and progress views (readable lime on light backgrounds).+ /// Tint for gauges and progress views .static func usageTint(_ percent: Double) -> Color {percent >= 90 ? danger : percent >= 70 ? warning : accent}diff --git a/CodyncKit/Sources/CodyncUI/ChatRows.swift b/CodyncKit/Sources/CodyncUI/ChatRows.swiftindex b06a97f5..f4289412 100644--- a/CodyncKit/Sources/CodyncUI/ChatRows.swift+++ b/CodyncKit/Sources/CodyncUI/ChatRows.swift@@ -54,7 +54,8 @@ struct AgentBubble: View {let openTrace: () -> Voidvar body: some View {- HStack(alignment: .bottom, spacing: 8) {+ // Replies sit on the page like text in a document; only your own messages get a bubble.+ HStack(alignment: .top, spacing: 10) {Group {if showAvatar, let bot {CharacterAvatar(bot: bot, size: 28, animated: false)@@ -64,9 +65,8 @@ struct AgentBubble: View {}.frame(width: 28, height: 28)MarkdownText(entry.data.text ?? "")- .padding(.horizontal, 13)- .padding(.vertical, 9)- .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 18, style: .continuous))+ .padding(.top, 4)+ .contentShape(Rectangle()).contextMenu {Button("Copy", systemImage: "doc.on.doc") { Pasteboard.copy(entry.data.text) }Button("Show what it did", systemImage: "list.bullet.rectangle", action: openTrace)@@ -113,49 +113,31 @@ struct NoticeRow: View {}}-/// Grok Bot's typing bubble, plus the live activity line and elapsed time.+/// The bot's live activity line: a turning orb, what it's doing and for how long.struct WorkingIndicator: View {let bot: Botlet openTrace: () -> Voidvar body: some View {- HStack(alignment: .center, spacing: 8) {+ HStack(alignment: .center, spacing: 10) {CharacterAvatar(bot: bot, size: 28)- VStack(alignment: .leading, spacing: 4) {- TypingDots()- .padding(.horizontal, 12)- .padding(.vertical, 11)- .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 14, style: .continuous))- Button(action: openTrace) {- HStack(spacing: 4) {- Text(bot.activity.isEmpty ? "Working…" : bot.activity).lineLimit(1)- if let started = bot.startedAt {- Text("·")- Text(Date(milliseconds: started), style: .timer).monospacedDigit()- }- Image(systemName: "chevron.right").font(.caption2)+ Button(action: openTrace) {+ HStack(spacing: 8) {+ ThinkingOrb(size: 16, color: bot.needsInput ? Palette.warning : Palette.secondary)+ Text(bot.activity.isEmpty ? "Working…" : bot.activity)+ .font(.subheadline)+ .foregroundStyle(bot.needsInput ? Palette.warning : Palette.secondary)+ .lineLimit(1)+ if let started = bot.startedAt {+ Text(Date(milliseconds: started), style: .timer)+ .font(.system(size: 11, weight: .medium, design: .monospaced))+ .foregroundStyle(Palette.tertiary)}- .font(.caption)- .foregroundStyle(bot.needsInput ? Palette.warning : Palette.secondary)+ Image(systemName: "chevron.right").font(.caption2).foregroundStyle(Palette.tertiary)}- .buttonStyle(.plain)}+ .buttonStyle(.plain)Spacer()}}}--struct TypingDots: View {- var body: some View {- HStack(spacing: 4) {- ForEach(0..<3, id: \.self) { i in- Circle()- .fill(Palette.secondary)- .frame(width: 6, height: 6)- .phaseAnimator([0.3, 1.0]) { view, phase in- view.opacity(phase)- } animation: { _ in .easeInOut(duration: 0.5).delay(Double(i) * 0.15) }- }- }- }-}diff --git a/CodyncKit/Sources/CodyncUI/Roster.swift b/CodyncKit/Sources/CodyncUI/Roster.swiftindex e797da3b..0433e374 100644--- a/CodyncKit/Sources/CodyncUI/Roster.swift+++ b/CodyncKit/Sources/CodyncUI/Roster.swift@@ -21,16 +21,14 @@ public struct BotRow: View {.lineLimit(1)Spacer(minLength: 8)Text(RelativeTime.short(Date(milliseconds: bot.lastAt)))- .font(.caption)- .foregroundStyle(bot.unread > 0 ? Palette.accent : Palette.tertiary)- .monospacedDigit()+ .metaStyle(bot.unread > 0 ? Palette.text : Palette.tertiary)}HStack(alignment: .firstTextBaseline, spacing: 6) {previewSpacer(minLength: 4)if bot.unread > 0 {Text("\(bot.unread)")- .font(.caption2.bold())+ .font(.system(size: 11, weight: .semibold, design: .monospaced)).foregroundStyle(Palette.onAccent).padding(.horizontal, 6).frame(minWidth: 18, minHeight: 18)@@ -52,12 +50,12 @@ public struct BotRow: View {.lineLimit(1)} else if bot.isWorking {HStack(spacing: 6) {- ProgressView().controlSize(.mini)+ ThinkingOrb(size: 13, color: Palette.secondary)Text(bot.activity.isEmpty ? "Working…" : bot.activity).lineLimit(1)}.font(.subheadline)- .foregroundStyle(Palette.accent)+ .foregroundStyle(Palette.secondary)} else if bot.status == "error" {Text(bot.lastMessage ?? "Something went wrong").font(.subheadline)diff --git a/CodyncKit/Sources/CodyncUI/ThreadView.swift b/CodyncKit/Sources/CodyncUI/ThreadView.swiftindex 6cc5160a..67050b71 100644--- a/CodyncKit/Sources/CodyncUI/ThreadView.swift+++ b/CodyncKit/Sources/CodyncUI/ThreadView.swift@@ -86,11 +86,10 @@ public struct ThreadView: View {@ViewBuilder private func row(_ item: ChatItem) -> some View {switch item.kind {case let .separator(date):- Text(date.formatted(.relative(presentation: .named)).capitalized + " · " + date.formatted(date: .omitted, time: .shortened))- .font(.caption2)- .foregroundStyle(Palette.tertiary)+ Text(date.formatted(.relative(presentation: .named)) + " · " + date.formatted(date: .omitted, time: .shortened))+ .metaStyle().frame(maxWidth: .infinity)- .padding(.vertical, 14)+ .padding(.vertical, 16)case let .entry(e, groupStart):switch e.kind {case "user":@@ -119,14 +118,13 @@ public struct ThreadView: View {Text(bot?.name ?? "").font(.subheadline.weight(.semibold)).foregroundStyle(Palette.text)Group {if let bot, bot.needsInput {- Text("Needs you").foregroundStyle(Palette.warning)+ Text("Needs you").metaStyle(Palette.warning)} else if let bot, bot.isWorking {- Text("Working").foregroundStyle(Palette.accent)+ Text("Working").metaStyle(Palette.secondary)} else if let bot {- Text("\(model.backendName(bot.backend)) · \(bot.folderName)").foregroundStyle(Palette.tertiary)+ Text("\(model.backendName(bot.backend)) · \(bot.folderName)").metaStyle()}}- .font(.caption2).lineLimit(1)}}@@ -230,7 +228,7 @@ private struct IntroCard: View {var body: some View {VStack(spacing: 12) {CharacterAvatar(bot: bot, size: 72)- Text(bot.name).font(.title2.bold()).foregroundStyle(Palette.text)+ Text(bot.name).font(.title2.weight(.semibold)).foregroundStyle(Palette.text)Text("\(model.backendName(bot.backend)) in \(bot.cwd)").font(.footnote.monospaced()).foregroundStyle(Palette.tertiary)diff --git a/CodyncKit/Sources/CodyncUI/TraceView.swift b/CodyncKit/Sources/CodyncUI/TraceView.swiftindex 6b224f6e..7770abc2 100644--- a/CodyncKit/Sources/CodyncUI/TraceView.swift+++ b/CodyncKit/Sources/CodyncUI/TraceView.swift@@ -128,7 +128,7 @@ struct ToolRow: View {switch data.status {case "completed": Image(systemName: "checkmark").foregroundStyle(Palette.accent)case "failed": Image(systemName: "xmark").foregroundStyle(Palette.danger)- default: ProgressView().controlSize(.mini)+ default: ThinkingOrb(size: 12, color: Palette.secondary)}}.font(.caption)diff --git a/CodyncKit/Sources/CodyncUI/UsageViews.swift b/CodyncKit/Sources/CodyncUI/UsageViews.swiftindex f3060636..87d2dfaf 100644--- a/CodyncKit/Sources/CodyncUI/UsageViews.swift+++ b/CodyncKit/Sources/CodyncUI/UsageViews.swift@@ -51,7 +51,7 @@ public struct UsageStrip: View {.frame(width: 22, height: 22).tint(Palette.usageTint(w.percent))VStack(alignment: .leading, spacing: 0) {- Text("\(p.name) \(w.label)").font(.caption2).foregroundStyle(Palette.tertiary)+ Text("\(p.name) \(w.label)").metaStyle()Text("\(Int(w.percent.rounded()))%").font(.caption.bold().monospacedDigit()).foregroundStyle(Palette.text)}}diff --git a/linux/src/avatar.rs b/linux/src/avatar.rsindex 3ed979e8..79950aed 100644--- a/linux/src/avatar.rs+++ b/linux/src/avatar.rs@@ -89,23 +89,73 @@ fn silhouette(cr: &Context, shape: &str) {}}-pub fn draw(cr: &Context, size: f64, shape: &str, color: &str, look: f64) {+#[derive(Clone, Copy, PartialEq)]+pub enum Mood {+ Idle,+ Working,+ Needs,+}++/// Same look as `CharacterAvatar` on Apple platforms: a halftone of dots shaded+/// as if the silhouette were a sphere (grey ink, the bot's color only on the+/// brightest dots) and two slit eyes. Working swings the light and drifts the+/// eyes; needing you sends a ripple out from the center. Below 24px the body+/// stays solid because the dots stop reading.+pub fn draw(cr: &Context, size: f64, shape: &str, color: &str, ink: (f64, f64, f64), mood: Mood, t: f64) {cr.save().ok();cr.scale(size / 100.0, size / 100.0);- silhouette(cr, shape);let (r, g, b) = rgb(color_of(color));- cr.set_source_rgb(r, g, b);- cr.fill().ok();- // Eyes (they look side to side while the bot works).- let dx = look * 5.0;- for x in [31.0, 55.4] {- rounded_rect(cr, x + dx, 36.0, 13.6, 19.5, 6.8);- cr.set_source_rgb(1.0, 1.0, 1.0);- cr.fill().ok();- cr.arc(x + 6.8 + dx * 1.3, 45.7, 3.8, 0.0, 2.0 * PI);- cr.set_source_rgb(0.08, 0.09, 0.07);+ silhouette(cr, shape);+ if size < 24.0 {+ cr.set_source_rgb(r, g, b);cr.fill().ok();+ } else {+ let step = 100.0 / 16.0;+ let row_h = step * 0.866;+ let mut dots = Vec::new();+ let (mut y, mut row) = (row_h / 2.0, 0);+ while y < 100.0 {+ let mut x = if row % 2 == 0 { step / 2.0 } else { step };+ while x < 100.0 {+ if cr.in_fill(x, y).unwrap_or(false) {+ dots.push((x, y));+ }+ x += step;+ }+ y += row_h;+ row += 1;+ }+ cr.new_path();+ let yaw = if mood == Mood::Working { t * 1.4 } else { -0.7 };+ let (lx, ly, lz) = (yaw.sin() * 0.8, 0.55, yaw.cos() * 0.5 + 0.6); // never fully behind+ let ll = (lx * lx + ly * ly + lz * lz).sqrt();+ for (x, y) in dots {+ let (u, v) = ((x - 50.0) / 50.0, (50.0 - y) / 50.0);+ let z = (1.0 - u * u - v * v).max(0.2).sqrt();+ let nl = (u * u + v * v + z * z).sqrt();+ let mut shade = 0.3 + 0.7 * ((u * lx + v * ly + z * lz) / (nl * ll)).max(0.0);+ if mood == Mood::Needs {+ shade *= 0.6 + 0.4 * (0.5 + 0.5 * ((u * u + v * v).sqrt() * 9.0 - t * 5.0).sin());+ }+ cr.arc(x, y, step * 0.38 * (0.3 + 0.7 * shade), 0.0, 2.0 * PI);+ cr.set_source_rgba(ink.0, ink.1, ink.2, 0.12 + 0.33 * (shade / 0.7).min(1.0));+ cr.fill_preserve().ok();+ if shade > 0.7 {+ cr.set_source_rgba(r, g, b, (shade - 0.7) / 0.3);+ cr.fill_preserve().ok();+ }+ cr.new_path();+ }+ }+ let dx = if mood == Mood::Working { (t * 2.0 * PI / 3.2).sin() * 4.0 } else { 0.0 };+ let phase = (t / 4.7).fract();+ let blink = if mood != Mood::Idle && phase < 0.04 { ((phase - 0.02).abs() / 0.02).max(0.12) } else { 1.0 };+ let (w, h) = ((1.4 * 100.0 / size).max(3.8), 12.0 * blink);+ for side in [-1.0, 1.0] {+ rounded_rect(cr, 50.0 + side * 10.0 + dx - w / 2.0, 47.0 - h / 2.0, w, h, w.min(h) / 2.0);}+ cr.set_source_rgb(ink.0, ink.1, ink.2);+ cr.fill().ok();cr.restore().ok();}@@ -113,15 +163,17 @@ pub fn draw(cr: &Context, size: f64, shape: &str, color: &str, look: f64) {pub fn widget(shape: &str, color: &str, size: i32, working: bool, status: &str) -> gtk::DrawingArea {let area = gtk::DrawingArea::builder().content_width(size).content_height(size).valign(gtk::Align::Center).build();let (shape, color, status) = (shape.to_owned(), color.to_owned(), status.to_owned());+ let mood = if status == "needs" { Mood::Needs } else if working { Mood::Working } else { Mood::Idle };let start = std::time::Instant::now();- area.set_draw_func(move |_, cr, w, _| {+ area.set_draw_func(move |area, cr, w, _| {let s = w as f64;- let look = if working { (start.elapsed().as_secs_f64() * 3.5).sin() } else { 0.0 };- draw(cr, s, &shape, &color, look);+ let fg = area.color();+ let ink = (fg.red() as f64, fg.green() as f64, fg.blue() as f64);+ draw(cr, s, &shape, &color, ink, mood, start.elapsed().as_secs_f64());if !status.is_empty() {let d = s * if status == "needs" { 0.36 } else { 0.28 };let (cx, cy) = (s - d / 2.0, s - d / 2.0);- let (r, g, b) = if status == "needs" { rgb(0xFF9800) } else { rgb(0xC7EC6B) };+ let (r, g, b) = if status == "needs" { rgb(0xF0A030) } else { ink };cr.arc(cx, cy, d / 2.0, 0.0, 2.0 * PI);cr.set_source_rgb(r, g, b);cr.fill().ok();diff --git a/linux/src/main.rs b/linux/src/main.rsindex 5e1520dd..7844a0a5 100644--- a/linux/src/main.rs+++ b/linux/src/main.rs@@ -11,17 +11,17 @@ use adw::prelude::*;const CSS: &str = r#".bubble { border-radius: 18px; padding: 8px 13px; }-.bubble-user { background: #c7ec6b; color: #141712; }-.bubble-agent { background: alpha(currentColor, 0.08); }+.bubble-user { background: @window_fg_color; color: @window_bg_color; }+.bubble-agent { padding-left: 0; padding-right: 0; }.card { border-radius: 16px; padding: 14px; border: 1px solid alpha(currentColor, 0.15); background: alpha(currentColor, 0.03); }.card.pending { border-color: alpha(#ff9800, 0.7); }-.accent-fill { background: #c7ec6b; color: #141712; }-.accent-fill:hover { background: shade(#c7ec6b, 0.95); }-.accent-text { color: #6f8f1a; }+.accent-fill { background: @window_fg_color; color: @window_bg_color; }+.accent-fill:hover { background: alpha(@window_fg_color, 0.85); }+.accent-text { color: @window_fg_color; }.needs-text { color: #e08600; }.muted { opacity: 0.6; }.small { font-size: 0.85em; }-.badge { background: #c7ec6b; color: #141712; border-radius: 999px; padding: 0 6px; font-weight: bold; font-size: 0.8em; min-width: 12px; }+.badge { background: @window_fg_color; color: @window_bg_color; border-radius: 999px; padding: 0 6px; font-weight: bold; font-size: 0.8em; min-width: 12px; }.chip { border-radius: 999px; padding: 3px 10px; border: 1px solid alpha(currentColor, 0.15); }.codebox { font-family: monospace; font-size: 0.9em; background: alpha(currentColor, 0.06); border-radius: 8px; padding: 8px; }.composer { border-radius: 20px; padding: 8px 12px; border: 1px solid alpha(currentColor, 0.18); }