AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 08:51:51 +00:00
|
|
|
|
// Colours. Light values come from the original's stylesheet
|
|
|
|
|
|
// (index CSS, ":root,.sand-1vbcnu7" block). Dark values come from the renderer's appearance primitives.
|
|
|
|
|
|
|
|
|
|
|
|
use eframe::egui::Color32;
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Copy)]
|
|
|
|
|
|
pub struct Palette {
|
|
|
|
|
|
pub pane: Color32,
|
|
|
|
|
|
pub sidebar: Color32,
|
|
|
|
|
|
pub elevated: Color32,
|
|
|
|
|
|
pub hover: Color32,
|
|
|
|
|
|
pub active: Color32,
|
|
|
|
|
|
pub primary: Color32,
|
|
|
|
|
|
pub text: Color32,
|
|
|
|
|
|
pub text2: Color32,
|
|
|
|
|
|
pub text3: Color32,
|
|
|
|
|
|
pub on_primary: Color32,
|
|
|
|
|
|
pub bubble_user: Color32,
|
|
|
|
|
|
pub border: Color32,
|
|
|
|
|
|
pub focus: Color32,
|
|
|
|
|
|
pub accent: Color32,
|
|
|
|
|
|
pub danger: Color32,
|
外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 13:44:59 +00:00
|
|
|
|
/// 需要你: the one colour for what waits for the person (a request, a newer build).
|
|
|
|
|
|
pub attention: Color32,
|
|
|
|
|
|
/// Behind a request's card.
|
|
|
|
|
|
pub attention_bg: Color32,
|
2026-11-12 17:08:52 +00:00
|
|
|
|
/// The quiet fill behind secondary blocks: filled inputs, list trays, segmented tracks
|
|
|
|
|
|
/// (the shadcn 'muted' layer — it is what makes groups read as groups).
|
|
|
|
|
|
pub muted: Color32,
|
AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 08:51:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const fn hexa(r: u8, g: u8, b: u8, a: u8) -> Color32 {
|
|
|
|
|
|
Color32::from_rgba_unmultiplied_const(r, g, b, a)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub const LIGHT: Palette = Palette {
|
|
|
|
|
|
pane: hexa(0xff, 0xff, 0xff, 0xff),
|
外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 13:44:59 +00:00
|
|
|
|
sidebar: hexa(0xf5, 0xf5, 0xf3, 0xff),
|
AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 08:51:51 +00:00
|
|
|
|
elevated: hexa(0xff, 0xff, 0xff, 0xff),
|
|
|
|
|
|
hover: hexa(0x1c, 0x1c, 0x1c, 0x0f),
|
|
|
|
|
|
active: hexa(0x1c, 0x1c, 0x1c, 0x14),
|
|
|
|
|
|
primary: hexa(0x1c, 0x1c, 0x1c, 0xff),
|
|
|
|
|
|
text: hexa(0x1c, 0x1c, 0x1c, 0xff),
|
|
|
|
|
|
text2: hexa(0x1c, 0x1c, 0x1c, 0xad),
|
|
|
|
|
|
text3: hexa(0x1c, 0x1c, 0x1c, 0x8f),
|
|
|
|
|
|
on_primary: hexa(0xff, 0xff, 0xff, 0xff),
|
|
|
|
|
|
bubble_user: hexa(0x1c, 0x1c, 0x1c, 0xff),
|
|
|
|
|
|
border: hexa(0x1c, 0x1c, 0x1c, 0x1f),
|
|
|
|
|
|
focus: hexa(0x1e, 0x86, 0xfc, 0xff),
|
|
|
|
|
|
accent: hexa(0x16, 0x80, 0xf3, 0xff),
|
|
|
|
|
|
danger: hexa(0xcd, 0x28, 0x34, 0xff),
|
外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 13:44:59 +00:00
|
|
|
|
attention: hexa(0xff, 0xc8, 0x3d, 0xff),
|
|
|
|
|
|
attention_bg: hexa(0xff, 0xf6, 0xd6, 0xff),
|
2026-11-12 17:08:52 +00:00
|
|
|
|
muted: hexa(0xf1, 0xf1, 0xee, 0xff),
|
AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 08:51:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// From the original's renderer (index.eager-common: appearance primitives dark neutral/0..6 and the
|
|
|
|
|
|
// g_ alpha table): pane #1f1f1f, elevated #161616, chrome #121212, sidebar #0e0e0e, ink #f5f5f5,
|
|
|
|
|
|
// primary hover #dbdbdb; translucent tokens are the ink at hover 6%, active 8%, agent bubble 4%,
|
|
|
|
|
|
// user bubble 18%, text 66/54%, border 10%. Accent blue/0 #1884fc, danger red/0 #fc2c3e.
|
|
|
|
|
|
// Measured from the original's dark window: chat rgb 19, sidebar 16, bubbles/cards 31–33.
|
|
|
|
|
|
pub const DARK: Palette = Palette {
|
|
|
|
|
|
pane: hexa(0x13, 0x13, 0x13, 0xff),
|
|
|
|
|
|
sidebar: hexa(0x10, 0x10, 0x10, 0xff),
|
|
|
|
|
|
elevated: hexa(0x1f, 0x1f, 0x1f, 0xff),
|
|
|
|
|
|
hover: hexa(0xf5, 0xf5, 0xf5, 0x0f),
|
|
|
|
|
|
active: hexa(0xf5, 0xf5, 0xf5, 0x14),
|
|
|
|
|
|
primary: hexa(0xf5, 0xf5, 0xf5, 0xff),
|
|
|
|
|
|
text: hexa(0xf5, 0xf5, 0xf5, 0xff),
|
|
|
|
|
|
text2: hexa(0xf5, 0xf5, 0xf5, 0xa8),
|
|
|
|
|
|
text3: hexa(0xf5, 0xf5, 0xf5, 0x8a),
|
|
|
|
|
|
on_primary: hexa(0x1f, 0x1f, 0x1f, 0xff),
|
|
|
|
|
|
bubble_user: hexa(0xf5, 0xf5, 0xf5, 0x2e),
|
|
|
|
|
|
border: hexa(0xf5, 0xf5, 0xf5, 0x1a),
|
|
|
|
|
|
focus: hexa(0x18, 0x84, 0xfc, 0xff),
|
|
|
|
|
|
accent: hexa(0x18, 0x84, 0xfc, 0xff),
|
|
|
|
|
|
danger: hexa(0xfc, 0x2c, 0x3e, 0xff),
|
外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 13:44:59 +00:00
|
|
|
|
attention: hexa(0xff, 0xc8, 0x3d, 0xff),
|
|
|
|
|
|
attention_bg: hexa(0x3a, 0x32, 0x12, 0xff),
|
2026-11-12 17:08:52 +00:00
|
|
|
|
muted: hexa(0x1d, 0x1d, 0x1d, 0xff),
|
AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 08:51:51 +00:00
|
|
|
|
};
|
外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 13:44:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// A bot's colour as a quiet background (its selected tile, its cards): a little of it over the
|
|
|
|
|
|
/// page — more on a dark page, where a tenth would not show.
|
|
|
|
|
|
pub fn mist(col: Color32, p: Palette) -> Color32 {
|
|
|
|
|
|
let k = if p.pane.r() < 128 { 0.24 } else { 0.10 };
|
|
|
|
|
|
let mix = |a: u8, b: u8| (a as f32 + (b as f32 - a as f32) * k).round() as u8;
|
|
|
|
|
|
Color32::from_rgb(mix(p.pane.r(), col.r()), mix(p.pane.g(), col.g()), mix(p.pane.b(), col.b()))
|
|
|
|
|
|
}
|