Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(ide): make the Agentic IDE readable in light mode
rubenluetke10-beepa96447c48733
diff --git a/docs/BRAND.md b/docs/BRAND.mdindex 9f2c0aa8a0..c757ab028a 100644--- a/docs/BRAND.md+++ b/docs/BRAND.md@@ -23,12 +23,12 @@ states, progress bars and informational status. Green, amber and red are status| Popover (`--popover`) | `#1C1C1C`  | `#FFFFFF`  || Hover / input (`--secondary`, `--muted`, `--input`) | `#1F1F1F`  | `#F5F5F5`  || Raised (`--surface-raised`) | `#262626`  | `#EDEDED`  |-| Hairline (`--border`) | `#262626`  | `#E5E5E5`  |-| Strong rim (`--border-strong`) | `#383838`  | `#D1D1D1`  |+| Hairline (`--border`) | `#262626`  | `#DBDBDB`  |+| Strong rim (`--border-strong`) | `#383838`  | `#BDBDBD`  || Foreground (`--foreground`) | `#FAFAFA`  | `#171717`  |-| Secondary ink (`--foreground-secondary`) | `#B8B8B8`  | `#525252`  |-| Muted ink (`--muted-foreground`) | `#A1A1A1`  | `#666666`  |-| Faint ink (`--foreground-faint`) | `#7A7A7A`  | `#757575`  |+| Secondary ink (`--foreground-secondary`) | `#B8B8B8`  | `#424242`  |+| Muted ink (`--muted-foreground`) | `#A1A1A1`  | `#545454`  |+| Faint ink (`--foreground-faint`) | `#7A7A7A`  | `#6B6B6B`  || Primary fill (`--primary`) | `#FAFAFA`  | `#171717`  || Accent (`--accent`) | `#3D8BFF`  | `#096CDC`  || Success (`--success`) | `#22C35E`  | `#15803D`  |diff --git a/jarvis/ui/theme.py b/jarvis/ui/theme.pyindex 23936e1caf..41f593a6ac 100644--- a/jarvis/ui/theme.py+++ b/jarvis/ui/theme.py@@ -51,7 +51,7 @@ HOLDING_PAGE_FOREGROUND: dict[str, str] = {#: ``--muted-foreground``: the holding page's secondary line.HOLDING_PAGE_MUTED: dict[str, str] = {"dark": "#a1a1a1",- "light": "#666666",+ "light": "#545454",}_DEFAULT_THEME: Theme = "dark"diff --git a/jarvis/ui/web/frontend/index.html b/jarvis/ui/web/frontend/index.htmlindex 91e33ac494..f29fa1dd60 100644--- a/jarvis/ui/web/frontend/index.html+++ b/jarvis/ui/web/frontend/index.html@@ -84,7 +84,7 @@--jbs-rim: rgba(0, 0, 0, 0.08);--jbs-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 28px -6px rgba(0, 0, 0, 0.22);--jbs-name: #171717;- --jbs-sub: #757575;+ --jbs-sub: #6b6b6b;--jbs-ease: cubic-bezier(.16, 1, .3, 1);}:root.dark {diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsxindex 3c70c402bf..fcc00752fa 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx@@ -89,6 +89,7 @@ import {type TerminalAppearance,} from "./terminalThemes";import { clearTuiCanvasFill } from "./terminalGlass";+import { inkForLightPane } from "./terminalLightInk";import {extractPaneDrop,extractPasteFiles,@@ -1239,8 +1240,10 @@ export function AgenticTerminal({parsing += 1;// A TUI that paints its theme ground on every cell would hide the// glass this pane sits on. Default-background those fills here, on- // the way into xterm — see ./terminalGlass.- term.write(clearTuiCanvasFill(text), () => {+ // the way into xterm — see ./terminalGlass. A light pane also re-inks+ // the dark-theme truecolor most CLIs paint — see ./terminalLightInk.+ const glass = clearTuiCanvasFill(text);+ term.write(appearanceRef.current === "light" ? inkForLightPane(glass) : glass, () => {parsing = Math.max(0, parsing - 1);afterWrite?.();// The parser is between chunks — the one safe moment to reflow.diff --git a/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.test.ts b/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.test.tsnew file mode 100644index 0000000000..0cae4211a2--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.test.ts@@ -0,0 +1,95 @@+import { describe, expect, it } from "vitest";++import { inkForLightPane, lightGroundFor, lightInkFor, rewriteLightInkSgr } from "./terminalLightInk";++function lum([r, g, b]: readonly number[]): number {+ const ch = (v: number) => {+ const c = v / 255;+ return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;+ };+ return 0.2126 * ch(r) + 0.7152 * ch(g) + 0.0722 * ch(b);+}++function contrastOnPaper(rgb: readonly number[]): number {+ const paper = lum([252, 251, 248]);+ return (paper + 0.05) / (lum(rgb) + 0.05);+}++describe("lightInkFor", () => {+ it("turns dark-theme white body text into near-black ink", () => {+ const ink = lightInkFor([255, 255, 255]);+ expect(contrastOnPaper(ink)).toBeGreaterThan(12);+ });++ it("keeps the CLI's hierarchy: a dim hint stays lighter than body text", () => {+ const body = lightInkFor([255, 255, 255]);+ const hint = lightInkFor([153, 153, 153]);+ expect(lum(hint)).toBeGreaterThan(lum(body));+ expect(contrastOnPaper(hint)).toBeGreaterThanOrEqual(4.5);+ });++ it("keeps a pale link's hue but makes it readable", () => {+ const link = lightInkFor([177, 185, 249]);+ expect(link[2]).toBeGreaterThan(link[0]);+ expect(contrastOnPaper(link)).toBeGreaterThanOrEqual(4.5);+ });++ it("leaves ink that already reads on paper alone", () => {+ expect(lightInkFor([43, 43, 51])).toEqual([43, 43, 51]);+ });+});++describe("lightGroundFor", () => {+ it("turns Claude Code's dark prompt bar into a pale grey bar", () => {+ const bar = lightGroundFor([55, 55, 55]);+ expect(lum(bar)).toBeGreaterThan(0.75);+ expect(bar[0]).toBe(bar[2]);+ });++ it("keeps a dark diff row's hue as a pale tint", () => {+ const [r, g, b] = lightGroundFor([34, 92, 43]);+ expect(g).toBeGreaterThan(r);+ expect(g).toBeGreaterThan(b);+ expect(lum([r, g, b])).toBeGreaterThan(0.6);+ });++ it("leaves a pale ground alone", () => {+ expect(lightGroundFor([240, 240, 240])).toEqual([240, 240, 240]);+ });+});++describe("rewriteLightInkSgr", () => {+ it("rewrites truecolor foreground and background in one list", () => {+ const out = rewriteLightInkSgr("1;38;2;255;255;255;48;2;55;55;55");+ expect(out.startsWith("1;38;2;")).toBe(true);+ expect(out).not.toContain("255;255;255");+ expect(out).not.toContain("55;55;55");+ });++ it("maps 256-colour greys but leaves the 16 palette slots to the theme", () => {+ expect(rewriteLightInkSgr("38;5;255")).toMatch(/^38;2;\d+;\d+;\d+$/);+ expect(rewriteLightInkSgr("38;5;7")).toBe("38;5;7");+ expect(rewriteLightInkSgr("31")).toBe("31");+ });++ it("handles the colon form", () => {+ expect(rewriteLightInkSgr("48:2::30:30:30")).toMatch(/^48;2;\d+;\d+;\d+$/);+ });++ it("never reads an underline colour's channels as a setter", () => {+ expect(rewriteLightInkSgr("58;2;48;2;1")).toBe("58;2;48;2;1");+ });+});++describe("inkForLightPane", () => {+ it("passes text without colour setters through untouched", () => {+ const text = "plain \x1b[1mbold\x1b[0m \x1b[31mred\x1b[0m";+ expect(inkForLightPane(text)).toBe(text);+ });++ it("rewrites only complete SGR sequences", () => {+ const out = inkForLightPane("\x1b[38;2;255;255;255mhi\x1b[0m");+ expect(out).toMatch(/^\x1b\[38;2;\d+;\d+;\d+mhi\x1b\[0m$/);+ expect(out).not.toContain("255;255;255");+ });+});diff --git a/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.ts b/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.tsnew file mode 100644index 0000000000..ef7fcdf986--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/terminalLightInk.ts@@ -0,0 +1,238 @@+/**+ * Re-ink a dark-themed CLI for a light pane.+ *+ * A coding agent paints most of its interface in 24-bit truecolor chosen for+ * the theme IT is set to, and nearly every one ships set to dark. In a light+ * pane that leaves two defects the 16-slot palette in ./terminalThemes cannot+ * reach:+ *+ * * dark cell BACKGROUNDS — Claude Code's prompt bar (`48;2;55;55;55`), diff+ * rows, selection rows — land as near-black slabs on paper;+ * * light FOREGROUNDS — white body text, pale blue links, mid-grey hints — are+ * rescued by xterm's minimum-contrast nudge only as far as the 4.5:1 floor,+ * which leaves washed-out grey and lavender where the CLI meant ink.+ *+ * So on a light pane every truecolor (and 256-colour) setter is mirrored in+ * lightness the way the CLI's own light theme would have drawn it: a dark+ * ground becomes a pale tint of the same hue, a light ink becomes a dark ink+ * of the same hue. Colours that already work on paper — dark ink, pale grounds+ * — pass through untouched, so a CLI already set to its light theme is left+ * exactly as it is. The 16 ANSI slots are the palette's job and are never+ * touched here.+ *+ * Like ./terminalGlass, this rewrites only the bytes handed to xterm, never+ * the PTY stream the recap and activity detectors read. Output written while+ * the pane was dark keeps its colours after a switch; the contrast floor still+ * keeps it readable until the agent redraws.+ */++type Rgb = readonly [number, number, number];++/** The light pane's paper, `LIGHT_TERMINAL_THEME.background` in RGB. */+const PAPER: Rgb = [252, 251, 248];++/** Ink that already clears WCAG AA on paper is left as the CLI chose it. */+const INK_FLOOR = 4.5;++/** A ground darker than this relative luminance is a dark-theme slab. */+const DARK_GROUND = 0.2;++function channel(v: number): number {+ const c = v / 255;+ return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;+}++function luminance([r, g, b]: Rgb): number {+ return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);+}++function contrast(a: Rgb, b: Rgb): number {+ const la = luminance(a);+ const lb = luminance(b);+ return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);+}++function toHsl([r, g, b]: Rgb): [number, number, number] {+ const rn = r / 255;+ const gn = g / 255;+ const bn = b / 255;+ const max = Math.max(rn, gn, bn);+ const min = Math.min(rn, gn, bn);+ const l = (max + min) / 2;+ if (max === min) return [0, 0, l];+ const d = max - min;+ const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);+ let h: number;+ if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);+ else if (max === gn) h = (bn - rn) / d + 2;+ else h = (rn - gn) / d + 4;+ return [h / 6, s, l];+}++function toRgb(h: number, s: number, l: number): Rgb {+ if (s === 0) {+ const v = Math.round(l * 255);+ return [v, v, v];+ }+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;+ const p = 2 * l - q;+ const hue = (t: number) => {+ let x = t;+ if (x < 0) x += 1;+ if (x > 1) x -= 1;+ if (x < 1 / 6) return p + (q - p) * 6 * x;+ if (x < 1 / 2) return q;+ if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;+ return p;+ };+ return [+ Math.round(hue(h + 1 / 3) * 255),+ Math.round(hue(h) * 255),+ Math.round(hue(h - 1 / 3) * 255),+ ];+}++function clamp(v: number, lo: number, hi: number): number {+ return Math.min(hi, Math.max(lo, v));+}++/** A greyish colour keeps the neutral ink ladder; a hue keeps its hue. */+const NEUTRAL_SATURATION = 0.12;++/**+ * The ink a light theme would have used for `rgb`, or `rgb` itself when it+ * already reads on paper.+ *+ * Lightness is mirrored (L → 1 − L), so the CLI's own hierarchy survives the+ * flip: its brightest text becomes the darkest ink and its dim hints stay a+ * step lighter. The clamp keeps a neutral off pure black (the pane's own+ * foreground is a soft near-black) and keeps a hue dark enough to read+ * without collapsing into black.+ */+export function lightInkFor(rgb: Rgb): Rgb {+ if (contrast(rgb, PAPER) >= INK_FLOOR) return rgb;+ const [h, s, l] = toHsl(rgb);+ const mirrored = 1 - l;+ const next =+ s < NEUTRAL_SATURATION+ ? clamp(mirrored, 0.13, 0.4)+ : clamp(mirrored, 0.24, 0.38);+ return toRgb(h, s, next);+}++/**+ * The ground a light theme would have used for `rgb`, or `rgb` itself when it+ * is not a dark slab.+ */+export function lightGroundFor(rgb: Rgb): Rgb {+ if (luminance(rgb) >= DARK_GROUND) return rgb;+ const [h, s, l] = toHsl(rgb);+ const mirrored = 1 - l;+ const next =+ s < NEUTRAL_SATURATION+ ? clamp(mirrored, 0.91, 0.95)+ : clamp(mirrored, 0.86, 0.93);+ return toRgb(h, s, next);+}++/** xterm's 256-colour cube and grey ramp; 0-15 are the palette's, not ours. */+function xterm256(index: number): Rgb | null {+ if (!Number.isInteger(index) || index < 16 || index > 255) return null;+ if (index >= 232) {+ const v = 8 + (index - 232) * 10;+ return [v, v, v];+ }+ const n = index - 16;+ const step = (c: number) => (c === 0 ? 0 : 55 + c * 40);+ return [step(Math.floor(n / 36)), step(Math.floor(n / 6) % 6), step(n % 6)];+}++function validRgb(r: number, g: number, b: number): Rgb | null {+ const ok = [r, g, b].every((v) => Number.isInteger(v) && v >= 0 && v <= 255);+ return ok ? [r, g, b] : null;+}++const cache = new Map<number, Rgb>();++function adapt(kind: "38" | "48", rgb: Rgb): Rgb {+ const key = (kind === "48" ? 1 << 24 : 0) | (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];+ let hit = cache.get(key);+ if (!hit) {+ hit = kind === "48" ? lightGroundFor(rgb) : lightInkFor(rgb);+ cache.set(key, hit);+ }+ return hit;+}++function emit(kind: "38" | "48", rgb: Rgb): string {+ return `${kind};2;${rgb[0]};${rgb[1]};${rgb[2]}`;+}++/** `38:2::r:g:b`, `38:2:r:g:b` or `38:5:n` (and the `48` forms), else null. */+function rewriteColon(token: string): string | null {+ const parts = token.split(":");+ const kind = parts[0];+ if (kind !== "38" && kind !== "48") return null;+ let rgb: Rgb | null = null;+ if (parts[1] === "2" && (parts.length === 5 || parts.length === 6)) {+ const [r, g, b] = parts.slice(-3).map(Number);+ rgb = validRgb(r, g, b);+ } else if (parts[1] === "5" && parts.length === 3) {+ rgb = xterm256(Number(parts[2]));+ }+ return rgb ? emit(kind, adapt(kind, rgb)) : null;+}++/**+ * Walk one SGR parameter list and re-ink every truecolor / 256-colour+ * foreground and background. Underline colour (`58`) is consumed so its+ * channel values are never read as setters, and otherwise left alone.+ */+export function rewriteLightInkSgr(params: string): string {+ const tokens = params.split(";");+ const out: string[] = [];+ for (let i = 0; i < tokens.length; i += 1) {+ const token = tokens[i];+ if (token.includes(":")) {+ out.push(rewriteColon(token) ?? token);+ continue;+ }+ if (token !== "38" && token !== "48" && token !== "58") {+ out.push(token);+ continue;+ }+ const mode = tokens[i + 1];+ if (mode === "2" && i + 4 < tokens.length) {+ const payload = tokens.slice(i + 1, i + 5);+ const rgb = validRgb(Number(payload[1]), Number(payload[2]), Number(payload[3]));+ out.push(token === "58" || !rgb ? [token, ...payload].join(";") : emit(token, adapt(token, rgb)));+ i += 4;+ continue;+ }+ if (mode === "5" && i + 2 < tokens.length) {+ const rgb = xterm256(Number(tokens[i + 2]));+ out.push(token === "58" || !rgb ? `${token};5;${tokens[i + 2]}` : emit(token, adapt(token, rgb)));+ i += 2;+ continue;+ }+ out.push(token);+ }+ return out.join(";");+}++const SGR = /\x1b\[([0-9;:]*)m/g;++/**+ * Re-ink complete SGR sequences in `text` for a light pane.+ *+ * A CSI split across two PTY reads is left for xterm, the same as+ * ./terminalGlass does; the contrast floor covers that rare chunk.+ */+export function inkForLightPane(text: string): string {+ if (!text.includes("\x1b[")) return text;+ return text.replace(SGR, (full, params: string) => {+ if (!params.includes("38") && !params.includes("48")) return full;+ const next = rewriteLightInkSgr(params);+ return next === params ? full : `\x1b[${next}m`;+ });+}diff --git a/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts b/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.tsindex c2389b5c6e..ad013ab227 100644--- a/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts@@ -283,11 +283,11 @@ export const PANE_BRAND: Record<TerminalAppearance, PaneBrand> = {light: {accent: "#26251e",onAccent: "#f7f7f4",- accentSoft: "rgba(38,37,30,0.24)",+ accentSoft: "rgba(38,37,30,0.32)",ink: "#26251e",- inkMuted: "#66635a",- inkFaint: "#8b877c",- chip: "rgba(38,37,30,0.08)",+ inkMuted: "#4a4840",+ inkFaint: "#6e6a60",+ chip: "rgba(38,37,30,0.09)",},dark: {accent: "#ffffff",@@ -311,13 +311,13 @@ export const PANE_SOLID: Record<TerminalAppearance, string> = {export const PANE_CHROME: Record<TerminalAppearance, PaneChrome> = {light: {- shell: "rgba(252, 251, 248, 0.68)",- border: "rgba(38,37,30,0.14)",+ shell: "rgba(252, 251, 248, 0.86)",+ border: "rgba(38,37,30,0.2)",float: "#ffffff",edge: {- connecting: "rgba(38,37,30,0.14)",- live: "rgba(38,37,30,0.14)",- exited: "rgba(38,37,30,0.07)",+ connecting: "rgba(38,37,30,0.2)",+ live: "rgba(38,37,30,0.2)",+ exited: "rgba(38,37,30,0.1)",error: "rgba(190,23,68,0.45)",},},@@ -360,9 +360,9 @@ export interface PaneTileChrome {export const PANE_TILE: Record<TerminalAppearance, PaneTileChrome> = {light: {edge: {- connecting: "rgba(38,37,30,0.30)",- live: "rgba(38,37,30,0.30)",- exited: "rgba(38,37,30,0.14)",+ connecting: "rgba(38,37,30,0.36)",+ live: "rgba(38,37,30,0.36)",+ exited: "rgba(38,37,30,0.18)",error: "rgba(190,23,68,0.65)",},focus: "#096cdc",diff --git a/jarvis/ui/web/frontend/src/index.css b/jarvis/ui/web/frontend/src/index.cssindex f4184b8234..4b96ecac42 100644--- a/jarvis/ui/web/frontend/src/index.css+++ b/jarvis/ui/web/frontend/src/index.css@@ -562,8 +562,8 @@ label,--user-bubble: 0 0% 96%; /* #F5F5F5 — the speaker: quiet lift, strong ink */--user-bubble-foreground: 0 0% 9%;--surface-raised: 0 0% 93%; /* #EDEDED — pressed/selected rows, code blocks */- --border: 0 0% 90%; /* #E5E5E5 — hairline */- --border-strong: 0 0% 82%; /* #D1D1D1 — input borders, focused card, float rim */+ --border: 0 0% 86%; /* #DBDBDB — hairline */+ --border-strong: 0 0% 74%; /* #BDBDBD — input borders, focused card, float rim *//* --- Ink. Four steps, one job each ------------------------------------The split is what stops a single ink slab from reading as harsh: with@@ -571,10 +571,10 @@ label,has nothing to justify its weight. */--foreground-strong: 0 0% 4%; /* #0A0A0A — headings, headline numbers */--foreground: 0 0% 9%; /* #171717 — body, labels, running text */- --muted-foreground: 0 0% 40%; /* #666666 — labels, meta, table heads (5.7:1) */- --faint-foreground: 0 0% 46%; /* #757575 — placeholder + disabled ONLY (4.6:1) */- --foreground-faint: 0 0% 46%; /* = --faint-foreground; the Tailwind name */- --foreground-secondary: 0 0% 32%; /* #525252 — body on cards, descriptions */+ --muted-foreground: 0 0% 33%; /* #545454 — labels, meta, table heads (7.5:1, the dark twin's 7.9:1) */+ --faint-foreground: 0 0% 42%; /* #6B6B6B — placeholder + disabled ONLY (5.3:1) */+ --foreground-faint: 0 0% 42%; /* = --faint-foreground; the Tailwind name */+ --foreground-secondary: 0 0% 26%; /* #424242 — body on cards, descriptions *//* --primary is a FILL, not an ink: buttons, marks, active indicators,focus rings. It never paints running text, a byline or a decorative