Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
feat(tui): launch pad uses the MERCURY block wordmark instead of the ☿ art
Salman Qureshic43869de9353
diff --git a/src/ui/launch-pad.test.tsx b/src/ui/launch-pad.test.tsxindex 1c4a66d9..abc7845d 100644--- a/src/ui/launch-pad.test.tsx+++ b/src/ui/launch-pad.test.tsx@@ -10,8 +10,8 @@ import { EventEmitter } from 'node:events';import stringWidth from 'string-width';import { TuiApp } from './App.js';import { CLIChannel, type TuiState } from '../channels/cli.js';-import { MERCURY_MARK, MERCURY_MARK_SMALL, MERCURY_MARK_WIDTH, MERCURY_MARK_SMALL_WIDTH } from './mercury-mark.js';-import { launchPadChecks, tildify, isLaunchPadReady } from './launch-pad.js';+import { launchPadChecks, tildify, isLaunchPadReady, LAUNCH_WORDMARK, LAUNCH_WORDMARK_WIDTH } from './launch-pad.js';+import { renderMercuryCodeParts } from './pixel-logo.js';const ESC = String.fromCharCode(27);const stripAnsi = (s: string) => s.replace(new RegExp(`${ESC}\\[[0-9;?]*[A-Za-z]`, 'g'), '');@@ -86,17 +86,15 @@ async function renderPad(s: TuiState, cols: number, onInput: (t: string) => voidreturn { stdout, stdin, unmount };}-describe('Mercury mark', () => {- it.each([- ['hero', MERCURY_MARK, MERCURY_MARK_WIDTH],- ['small', MERCURY_MARK_SMALL, MERCURY_MARK_SMALL_WIDTH],- ] as const)('%s mark is single-width block art, within its width, and left/right symmetric', (_name, mark, width) => {- for (const row of mark) {- expect(row).toMatch(/^[ █▀▄]*$/);- expect(stringWidth(row)).toBeLessThanOrEqual(width);- const padded = row.padEnd(width, ' ');- expect([...padded].reverse().join('')).toBe(padded);+describe('launch wordmark', () => {+ it('is single-width block art sharing the Mercury Code header font', () => {+ expect(LAUNCH_WORDMARK).toHaveLength(5);+ for (const row of LAUNCH_WORDMARK) {+ expect(row).toMatch(/^[ █]*$/);+ expect(stringWidth(row)).toBeLessThanOrEqual(LAUNCH_WORDMARK_WIDTH);}+ // Same glyphs as the "MERCURY" half of the Mercury Code header.+ expect(LAUNCH_WORDMARK).toEqual(renderMercuryCodeParts().map((p) => p.left.replace(/\s+$/, '')));});});@@ -122,18 +120,17 @@ describe('launch pad checks', () => {});describe('launch pad rendering', () => {- it.each([100, 70, 50])('fits %i columns with no wrapped rows', async (cols) => {+ it.each([100, 50, 30])('fits %i columns with no wrapped rows', async (cols) => {const { stdout, unmount } = await renderPad(state(), cols);const rows = lastFrame(stdout, 'Workspace');for (const row of rows) expect(stringWidth(row)).toBeLessThanOrEqual(cols);const text = rows.join('\n');- expect(text).toContain('MERCURY');- expect(text).toContain('anthropic · claude-opus-5-5');+ expect(text).toMatch(/MERCURY|█ █/);+ expect(text).toContain(cols >= 50 ? 'anthropic · claude-opus-5-5' : 'anthropic');expect(text).toContain('Type to start chatting');- // Hero mark at ≥ 80, compact at 60–79, none in narrow terminals.- if (cols >= 80) expect(text).toContain(MERCURY_MARK[10]);- else if (cols >= 60) expect(text).toContain(MERCURY_MARK_SMALL[1]);- else expect(text).not.toContain('███');+ // Wordmark when it fits (with padding); a one-line header otherwise.+ if (cols >= LAUNCH_WORDMARK_WIDTH + 4) expect(text).toContain(LAUNCH_WORDMARK[0]);+ else { expect(text).not.toContain('███'); expect(text).toContain('☿ MERCURY'); }unmount();});diff --git a/src/ui/launch-pad.tsx b/src/ui/launch-pad.tsxindex ffecd22f..7b1d74bc 100644--- a/src/ui/launch-pad.tsx+++ b/src/ui/launch-pad.tsx@@ -6,7 +6,7 @@* discovered, web server, budget, workspace). Nothing ticks on a timer.* - The layout never jumps: every row is present from the first frame, and* pending rows show a spinner in place of the check.- * - The mark draws in top-down over ~300 ms once, then stays still.+ * - The wordmark draws in top-down once (~120 ms), then stays still.* - Typing anywhere starts chat (handled by the app's input layer); Enter on* an empty pad does the same; Tab toggles the skills list.*/@@ -16,15 +16,19 @@ import { homedir } from 'node:os';import type { TuiState } from '../channels/cli.js';import { IS_LIGHT_TERMINAL } from '../utils/terminal-theme.js';import { isDevBuild } from '../utils/dev-build.js';-import { fitText, fitTail, isNarrow } from './layout.js';+import { fitText, fitTail } from './layout.js';import { useTick, spinnerFrame } from './tick-store.js';-import { MERCURY_MARK, MERCURY_MARK_SMALL, MERCURY_MARK_WIDTH, MERCURY_MARK_SMALL_WIDTH } from './mercury-mark.js';+import { renderPixelWord } from './pixel-logo.js';++/** MERCURY in the pixel font the Mercury Code header uses: one brand, two screens. */+export const LAUNCH_WORDMARK: readonly string[] = renderPixelWord('MERCURY', '█').map((row) => row.replace(/\s+$/, ''));+export const LAUNCH_WORDMARK_WIDTH = Math.max(...LAUNCH_WORDMARK.map((row) => row.length));const COLORS = IS_LIGHT_TERMINAL? { mark: 'blue', title: 'blue', muted: 'gray', key: 'blue', accent: 'magenta' }: { mark: 'cyan', title: 'cyan', muted: 'gray', key: 'cyan', accent: 'magenta' };-/** Milliseconds between mark rows during the draw-in. */+/** Milliseconds between wordmark rows during the draw-in. */export const MARK_REVEAL_STEP_MS = 24;export interface LaunchPadCheck {@@ -97,31 +101,48 @@ export interface LaunchPadProps {}export function LaunchPad({ state, cols, showDetails, tip }: LaunchPadProps) {- const narrow = isNarrow(cols);- // Hero mark from 80 cols, compact from 60, none below (Termux portrait).- const mark = narrow ? [] : cols >= 80 ? MERCURY_MARK : MERCURY_MARK_SMALL;- const markWidth = narrow ? 0 : cols >= 80 ? MERCURY_MARK_WIDTH : MERCURY_MARK_SMALL_WIDTH;- const revealed = useMarkReveal(mark.length);+ // The wordmark needs its width plus the side padding; below that the+ // header is a single text line (Termux portrait, split panes).+ const showWordmark = cols >= LAUNCH_WORDMARK_WIDTH + 4;+ const revealed = useMarkReveal(showWordmark ? LAUNCH_WORDMARK.length : 0);const ready = isLaunchPadReady(state);const now = useTick(!ready);const frame = spinnerFrame(now);- const gutter = narrow ? 0 : 5;- const panelWidth = Math.max(10, cols - 2 - markWidth - gutter);+ const width = Math.max(10, cols - 2);const checks = launchPadChecks(state);const labelWidth = Math.max(...checks.map((c) => c.label.length));- const valueWidth = Math.max(4, panelWidth - labelWidth - 4);+ const valueWidth = Math.max(4, width - labelWidth - 4);const versionLabel = `v${state.version}`;+ const tagline = 'Your soul-driven AI agent';+ // Version sits flush right under the wordmark when there is room.+ const versionGap = showWordmark ? Math.max(2, LAUNCH_WORDMARK_WIDTH - tagline.length - versionLabel.length) : 2;- const panel = (- <Box flexDirection="column" width={narrow ? undefined : panelWidth}>- <Text wrap="truncate-end">- {narrow && <Text color={COLORS.mark}>☿ </Text>}- <Text bold color={COLORS.title}>MERCURY</Text>- <Text color={COLORS.muted}> {versionLabel}</Text>- {isDevBuild(state.version) && <Text color="yellow"> ⚠ development build</Text>}- </Text>- <Text color={COLORS.muted} wrap="truncate-end">Your soul-driven AI agent</Text>+ return (+ <Box flexDirection="column" flexGrow={1} paddingX={1} paddingTop={showWordmark ? 1 : 0}>+ {showWordmark ? (+ <>+ {LAUNCH_WORDMARK.map((line, i) => (+ // Unrevealed rows render blank so the layout never jumps.+ <Text key={i} color={COLORS.mark}>{i < revealed ? line : ' '}</Text>+ ))}+ <Text wrap="truncate-end">+ <Text color={COLORS.muted}>{tagline}</Text>+ <Text color={COLORS.muted}>{' '.repeat(versionGap)}{versionLabel}</Text>+ {isDevBuild(state.version) && <Text color="yellow"> ⚠ development build</Text>}+ </Text>+ </>+ ) : (+ <>+ <Text wrap="truncate-end">+ <Text color={COLORS.mark}>☿ </Text>+ <Text bold color={COLORS.title}>MERCURY</Text>+ <Text color={COLORS.muted}> {versionLabel}</Text>+ {isDevBuild(state.version) && <Text color="yellow"> ⚠ dev</Text>}+ </Text>+ <Text color={COLORS.muted} wrap="truncate-end">{tagline}</Text>+ </>+ )}<Text> </Text>{checks.map((check) => (<CheckRow key={check.label} check={check} labelWidth={labelWidth} valueWidth={valueWidth} frame={frame} />@@ -139,25 +160,9 @@ export function LaunchPad({ state, cols, showDetails, tip }: LaunchPadProps) {{tip ? (<><Text> </Text>- <Text color={COLORS.muted} wrap="truncate-end">tip: {fitText(tip, Math.max(4, panelWidth - 5))}</Text>+ <Text color={COLORS.muted} wrap="truncate-end">tip: {fitText(tip, Math.max(4, width - 5))}</Text></>) : null}- </Box>- );-- return (- <Box flexDirection="column" flexGrow={1} paddingX={1} paddingTop={narrow ? 0 : 1}>- {narrow ? panel : (- <Box flexDirection="row">- <Box flexDirection="column" width={markWidth} marginRight={gutter} flexShrink={0}>- {mark.map((line, i) => (- // Unrevealed rows render as blank lines so the layout never jumps.- <Text key={i} color={COLORS.mark}>{i < revealed ? line : ' '}</Text>- ))}- </Box>- {panel}- </Box>- )}{showDetails && (<Box flexDirection="column" marginTop={1}><Text color={COLORS.muted}>Skills</Text>diff --git a/src/ui/mercury-mark.ts b/src/ui/mercury-mark.tsdeleted file mode 100644index 6745a2b2..00000000--- a/src/ui/mercury-mark.ts+++ /dev/null@@ -1,46 +0,0 @@-/**- * The Mercury mark: the planetary symbol ☿ (crescent, ring, cross) drawn as- * half-block pixel art. Every filled cell is a single-codepoint block- * character (█ ▀ ▄), which terminals render exactly one cell wide, so the- * mark is pixel-aligned everywhere — the earlier box-drawing outline had- * corners and sides in different columns and broke apart on screen.- *- * Both sizes are generated from the same geometry (crescent arc above a- * ring, a stem with a crossbar below) and are left/right symmetric around- * their centre column. Keep them as literals: generating at runtime would- * make the art depend on floating-point rounding.- */--/** Hero mark: 19 cols × 13 rows. Used on the launch pad at ≥ 60 columns. */-export const MERCURY_MARK = [- '██ ██',- '▀██▄ ▄██▀',- ' ▀▀███▄▄▄▄▄███▀▀',- ' ▄▄▄▄▄▄▄▄▄',- ' ▄▄██▀▀ ▀▀██▄▄',- '███ ███',- '███ ███',- ' ▀▀██▄▄ ▄▄██▀▀',- ' ▀▀▀███▀▀▀',- ' ███',- ' █████████████',- ' ███',- ' ███',-] as const;--/** Compact mark: 15 cols × 10 rows, for medium-width terminals. */-export const MERCURY_MARK_SMALL = [- '██ ██',- ' ▀██▄▄▄▄▄▄▄██▀',- ' ▄█████▄',- ' ▄█▀▀ ▀▀█▄',- '███ ███',- ' ▀█▄▄ ▄▄█▀',- ' ▀▀███▀▀',- ' ▄▄▄███▄▄▄',- ' ▀▀▀███▀▀▀',- ' ███',-] as const;--export const MERCURY_MARK_WIDTH = 19;-export const MERCURY_MARK_SMALL_WIDTH = 15;diff --git a/src/ui/narrow-terminal.test.tsx b/src/ui/narrow-terminal.test.tsxindex a2499b65..c6d62ddd 100644--- a/src/ui/narrow-terminal.test.tsx+++ b/src/ui/narrow-terminal.test.tsx@@ -107,28 +107,28 @@ describe('layout rules', () => {});describe(`TUI at ${COLS} columns`, () => {- it('splash collapses to one column with no logo art', async () => {+ it('splash fits 50 columns: wordmark, live checklist, no wrapped rows', async () => {const { rows, unmount } = await renderApp(state({ mode: 'splash', web: null, skills: [] }), 'Workspace');expectFits(rows);- expect(rows.join('\n')).not.toContain('███'); // the ☿ block mark needs >= 60 cols- // snapshot-ish: the whole collapsed launch pad, row by row (tip and the- // workspace path vary by machine, so they are checked by prefix only)const trimmed = rows.map((r) => r.trimStart());- expect(trimmed.slice(0, 7)).toEqual([- '☿ MERCURY v1.3.1',- 'Your soul-driven AI agent',+ const at = trimmed.findIndex((r) => r.startsWith('Your soul-driven AI agent'));+ expect(at).toBeGreaterThan(0);+ expect(trimmed[at]).toMatch(/v1\.3\.1$/);+ expect(trimmed.slice(at + 1, at + 7)).toEqual(['','✓ Provider deepseek · deepseek-chat','· Skills none installed','· Web off','· Budget ' + (1200).toLocaleString() + ' / ' + (100000).toLocaleString() + ' today',+ trimmed[at + 6],]);- expect(trimmed[7]).toMatch(/^· Workspace /);- expect(trimmed.slice(8, 11)).toEqual(['', 'Type to start chatting', '/code Mercury Code here Tab skills']);+ expect(trimmed[at + 6]).toMatch(/^· Workspace /);+ expect(trimmed.slice(at + 7, at + 10)).toEqual(['', 'Type to start chatting', '/code Mercury Code here Tab skills']);unmount();});+it('chat: input chrome is exactly four rows and the sidebar collapses', async () => {const { rows, unmount } = await renderApp(state({mode: 'chat',