π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
feat(console): add six persistent bundled color presets
rUvad5a2ef65d15
diff --git a/plugins/ruflo-console/README.md b/plugins/ruflo-console/README.mdindex c34398026b..2a943cac9d 100644--- a/plugins/ruflo-console/README.md+++ b/plugins/ruflo-console/README.md@@ -104,6 +104,19 @@ Orbital adapts to the pane allocation. Below 48 drawing columns or 30 availableOpen **Main Menu β Tools β Theme Studio**, the **Tools** navigation group, or `/ruflo themes`. Settings also links to the studio. Choose Classic BBS, Terminal plain or Orbital. Studio selections persist and override the plugin's configured look until **Use configured look** is selected.+Six bundled **Color presets** load with one click and persist across sessions. They retain the animated Ruflo header, globe, stars and topology at standard speed. Bundled presets do not consume the twelve custom theme slots. Every primary foreground role meets at least 4.5:1 contrast against its background; decorative shading may be dimmer.++| Preset | Palette |+| --- | --- |+| Arctic | Ice cyan, seafoam and deep navy |+| Synthwave | Orchid, mint and dark violet |+| Amber CRT | Warm amber, parchment and dark bronze |+| Emerald | Jade, pale green and forest black |+| Solar Flare | Peach, gold and dark terracotta |+| Moonlight | Periwinkle, silver and midnight blue |++Select a preset to load it immediately. Edit colors or motion and choose **Save and apply** to create a custom copy; bundled originals remain available. Portable version 1 JSON presets also load through **AI β Import theme JSON**, followed by **Save and apply**. **Use configured look** restores the plugin setting.+The terminal color picker provides swatches and exact `#RRGGBB` entry for headings, success, failure, warning, information and background. Preview the globe and swarm motion, adjust speed and decorative layers, then **Save preview and apply**. Up to twelve named custom presets are stored locally through the host; reusing a name replaces that preset. Failed saves leave the active theme unchanged. Settings `fps: 0` still disables animation. Layouts retain the compact/narrow fallbacks.**Generate with Claude** or **Generate with Codex** runs the bundled `generate-console-theme` skill through AI Terminal with its existing confirmation and model controls. Enter the design brief first, generate a preset, then paste the returned JSON into **Import theme JSON** and review before saving. The generator produces palette and motion variations of the existing Orbital renderer, not executable animation code. No additional API credentials are requested. Installed Claude plugins discover the bundled skill; Codex can read `plugins/ruflo-console/skills/generate-console-theme/SKILL.md` directly in this checkout.diff --git a/plugins/ruflo-console/hooks/themes.ts b/plugins/ruflo-console/hooks/themes.tsindex a90b1b3df4..cf97b88138 100644--- a/plugins/ruflo-console/hooks/themes.ts+++ b/plugins/ruflo-console/hooks/themes.ts@@ -16,6 +16,16 @@ export const ORBITAL_THEME: ConsoleTheme = {motion: { speed: 1, stars: true, globe: true, topology: true },}const clone = (theme: ConsoleTheme): ConsoleTheme => ({ ...theme, palette: { ...theme.palette }, motion: { ...theme.motion } })+/** Bundled palettes have stable IDs and do not consume the twelve custom preset slots. */+export const THEME_PRESETS: readonly { id: string; theme: ConsoleTheme }[] = [+ { id: 'arctic', theme: { ...clone(ORBITAL_THEME), name: 'Arctic', palette: { head: '#79dfff', ok: '#8ee6be', bad: '#ff929d', warn: '#ffd486', info: '#d6e9f2', background: '#08131f' } } },+ { id: 'synthwave', theme: { ...clone(ORBITAL_THEME), name: 'Synthwave', palette: { head: '#ed99ff', ok: '#6fe7c5', bad: '#ff899e', warn: '#ffe08a', info: '#e4d9f5', background: '#170d26' } } },+ { id: 'amber-crt', theme: { ...clone(ORBITAL_THEME), name: 'Amber CRT', palette: { head: '#ffcf73', ok: '#c6e58b', bad: '#ff9580', warn: '#ffe3a3', info: '#ead8b7', background: '#171108' } } },+ { id: 'emerald', theme: { ...clone(ORBITAL_THEME), name: 'Emerald', palette: { head: '#69e6af', ok: '#a1edb4', bad: '#ff9191', warn: '#efcf87', info: '#cde5da', background: '#081710' } } },+ { id: 'solar-flare', theme: { ...clone(ORBITAL_THEME), name: 'Solar Flare', palette: { head: '#ffab79', ok: '#b8dc91', bad: '#ff929d', warn: '#ffdf83', info: '#f1ddce', background: '#21100c' } } },+ { id: 'moonlight', theme: { ...clone(ORBITAL_THEME), name: 'Moonlight', palette: { head: '#b6c5ff', ok: '#a2d9c8', bad: '#ffa0b6', warn: '#e8d5a3', info: '#e0e4f2', background: '#101420' } } },+]+const presetOf = (id: string | null) => THEME_PRESETS.find(preset => `preset:${preset.id}` === id)?.themeexport const THEME_STORE_KEY = 'console-themes-v1'const HEX = /^#[0-9a-f]{6}$/iconst record = (value: unknown): Record<string, unknown> | null => typeof value === 'object' && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : null@@ -69,7 +79,7 @@ export async function loadThemes(state: State, host: Host): Promise<void> {if (!data || studio.revision !== revision) returnstudio.saved = Array.isArray(data.saved) ? data.saved.slice(0, 12).map(parseTheme).filter((t): t is ConsoleTheme => t !== null) : []const selected = typeof data.selected === 'string' ? data.selected : null- const theme = studio.saved.find(t => `custom:${t.name}` === selected)+ const theme = presetOf(selected) ?? studio.saved.find(t => `custom:${t.name}` === selected)if (theme) { studio.active = clone(theme); studio.draft = clone(theme); studio.selected = selected; state.options.look = 'orbital' }else if (selected === 'bbs' || selected === 'plain' || selected === 'orbital') { studio.selected = selected; state.options.look = selected }host.invalidate()@@ -99,7 +109,7 @@ export function themeActions(state: State, host: Host, ask: (agent: 'claude' | 'try {await host.storeSet(THEME_STORE_KEY, { selected, saved })studio.selected = selected; studio.saved = saved; studio.active = active; state.options.look = look- if (active) studio.draft = clone(active)+ studio.draft = clone(active ?? ORBITAL_THEME)tell('Theme saved and applied.')} catch { tell('Could not save the theme. The active theme is unchanged.') }finally { studio.saving = false; host.invalidate() }@@ -110,7 +120,7 @@ export function themeActions(state: State, host: Host, ask: (agent: 'claude' | 'discard: () => { studio.draft = clone(studio.active ?? ORBITAL_THEME); tell('Draft restored to the active palette.') },select: id => {if (id === 'bbs' || id === 'plain' || id === 'orbital') { void persist(id, studio.saved, null, id); return }- const theme = studio.saved.find(t => `custom:${t.name}` === id)+ const theme = presetOf(id) ?? studio.saved.find(t => `custom:${t.name}` === id)if (theme) void persist(id, studio.saved, clone(theme), 'orbital')},color: (key, value) => {@@ -141,7 +151,7 @@ export function themeActions(state: State, host: Host, ask: (agent: 'claude' | 'if (saved.length >= 12) return tell('Twelve custom themes are saved. Reuse an existing name to replace it.')void persist(`custom:${theme.name}`, [...saved, clone(theme)], clone(theme), 'orbital')},- reset: () => { studio.draft = clone(ORBITAL_THEME); void persist(null, studio.saved, null, studio.initialLook) },+ reset: () => { void persist(null, studio.saved, null, studio.initialLook) },brief: value => { studio.brief = value.replace(/[\x00-\x1f\x7f]/g, ' ').slice(0, 1200); tell('Design brief ready.') },generate: agent => {void Promise.all([host.fs.read(`${host.pluginRoot}/skills/generate-console-theme/SKILL.md`), host.fs.read(`${host.pluginRoot}/skills/generate-console-theme/references/preset.md`)]).then(parts => {diff --git a/plugins/ruflo-console/hooks/views/themes.ts b/plugins/ruflo-console/hooks/views/themes.tsindex 924729808b..30a3ad59b3 100644--- a/plugins/ruflo-console/hooks/views/themes.ts+++ b/plugins/ruflo-console/hooks/views/themes.ts@@ -1,5 +1,5 @@import type { RenderElement } from 'claude-code'-import { activeTheme, COLOR_KEYS, contrast, lowContrast, themeLayout, themesOf } from '../themes'+import { activeTheme, COLOR_KEYS, contrast, lowContrast, themeLayout, themesOf, THEME_PRESETS } from '../themes'import { button, clip, col, picture, row, text, THEME, type Ctx } from './common'/** One focused editor beside its live preview. Narrow panes stack without shrinking text. */@@ -15,6 +15,11 @@ export function themesView(ctx: Ctx): RenderElement {const selected = studio.selected ?? ctx.state.options.lookconst choices: RenderElement[] = [text(edit, '01 LOOK', { bold: true, color: THEME.head })]for (const id of ['bbs', 'plain', 'orbital'] as const) choices.push(pick(`theme-${id}`, `${selected === id ? 'β' : 'β'} ${id === 'bbs' ? 'Classic BBS' : id === 'plain' ? 'Terminal plain' : 'Orbital'}`, () => act.select(id)))+ choices.push(text(edit, 'COLOR PRESETS', { color: THEME.info }))+ for (const { id, theme } of THEME_PRESETS) choices.push(row(edit, [+ ctx.kit.Text({ color: theme.palette.head, backgroundColor: theme.palette.background, children: ' ββ ' }),+ pick(`theme-preset-${id}`, clip(`${selected === `preset:${id}` ? 'β' : 'β'} ${theme.name}`, Math.max(1, edit.columns - 7)), () => act.select(`preset:${id}`)),+ ]))for (const theme of studio.saved) choices.push(pick(`theme-custom-${theme.name}`, `${selected === `custom:${theme.name}` ? 'β' : 'β'} ${theme.name}`, () => act.select(`custom:${theme.name}`)))choices.push(text(edit, '02 CUSTOMIZE', { bold: true, color: THEME.head }))const tabs = (['colors', 'motion', 'generate'] as const).map(tab => pick(`theme-tab-${tab}`, `${studio.tab === tab ? 'βΈ' : 'Β·'} ${tab === 'generate' ? 'AI' : tab}`, () => act.tab(tab)))diff --git a/plugins/ruflo-console/tests/themes.spec.ts b/plugins/ruflo-console/tests/themes.spec.tsindex 53977bb6ae..eb637c33c2 100644--- a/plugins/ruflo-console/tests/themes.spec.ts+++ b/plugins/ruflo-console/tests/themes.spec.ts@@ -1,5 +1,5 @@import { describe, expect, it, vi } from 'vitest'-import { activeTheme, COLOR_KEYS, loadThemes, lowContrast, ORBITAL_THEME, parseTheme, themeActions, themeFromText, themesOf, themeLayout } from '../hooks/themes'+import { activeTheme, COLOR_KEYS, contrast, loadThemes, lowContrast, ORBITAL_THEME, parseTheme, themeActions, themeFromText, themesOf, themeLayout, THEME_PRESETS } from '../hooks/themes'import { newState } from '../hooks/state'import type { Host } from '../hooks/host'import { orbitalBoot, orbitalGlobe, orbitalHeader } from '../hooks/gfx/orbital'@@ -12,6 +12,42 @@ const copy = () => JSON.parse(JSON.stringify(ORBITAL_THEME))const hostOf = (store = new Map<string, unknown>()) => ({ storeGet: vi.fn(async (key: string) => store.get(key)), storeSet: vi.fn(async (key: string, value: unknown) => { store.set(key, value) }), invalidate: vi.fn(), fs: { read: vi.fn(async (path: string) => path.endsWith('SKILL.md') ? 'Generate one preset.' : 'version: 1; six hex colors; motion') }, pluginRoot: '/plugin' }) as unknown as Hostdescribe('Theme Studio', () => {+ it('loads each bundled palette, restores its selection and leaves custom slots free', async () => {+ expect(new Set(THEME_PRESETS.map(p => p.id)).size).toBe(THEME_PRESETS.length)+ for (const { id, theme } of THEME_PRESETS) {+ expect(parseTheme(theme)).toEqual(theme)+ for (const key of COLOR_KEYS.filter(k => k !== 'background')) expect(contrast(theme.palette[key], theme.palette.background)).toBeGreaterThanOrEqual(4.5)+ const store = new Map(), host = hostOf(store), state = newState({ look: 'bbs' })+ const act = themeActions(state, host, vi.fn())+ act.select(`preset:${id}`); await flush()+ expect(state.options.look).toBe('orbital')+ expect(activeTheme(state)).toEqual(theme)+ expect(themesOf(state).saved).toHaveLength(0)+ const restored = newState({ look: 'plain' }); await loadThemes(restored, host)+ expect(activeTheme(restored)).toEqual(theme)+ expect(themesOf(restored).selected).toBe(`preset:${id}`)+ act.color('head', '#ffffff')+ expect(activeTheme(state).palette.head).toBe(theme.palette.head)+ act.save(); await flush()+ expect(themesOf(state).selected).toBe(`custom:${theme.name}`)+ expect(theme.palette.head).not.toBe('#ffffff')+ act.select('orbital'); await flush()+ expect(themesOf(state).draft).toEqual(ORBITAL_THEME)+ }+ })+ it('leaves selection and draft intact when a bundled selection cannot persist', async () => {+ const state = newState({ look: 'orbital' }), host = hostOf(), act = themeActions(state, host, vi.fn())+ act.select('preset:arctic'); await flush()+ host.storeSet = vi.fn(async () => { throw Error('denied') })+ act.select('preset:synthwave'); await flush()+ expect(activeTheme(state).name).toBe('Arctic')+ expect(themesOf(state).draft.name).toBe('Arctic')+ act.select('preset:unknown'); await flush()+ expect(themesOf(state).selected).toBe('preset:arctic')+ act.reset(); await flush()+ expect(themesOf(state).draft.name).toBe('Arctic')+ expect(themesOf(state).selected).toBe('preset:arctic')+ })it('is available in main menu and Tools navigation/search', () => {expect(groupOf('themes')).toBe('TOOLS')expect(findPages('color')).toContain('themes')@@ -29,6 +65,7 @@ describe('Theme Studio', () => {expect(state.view).toBe('themes')const keys = flat(draw()).map(node => node.props?.key)for (const key of ['tabs', 'pane-icons', 'footer', 'theme-layout', 'tab-menu', 'theme-editor', 'theme-stage']) expect(keys).toContain(key)+ for (const { id } of THEME_PRESETS) expect(keys).toContain(`theme-preset-${id}`)flat(draw()).find(node => node.props?.key === 'tab-menu').props.onPress()expect(state.view).toBe('menu')})