π 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(ruflo-console): 0.25.0 β a compact nav: groups, one group's pages and a search, ADR-424
ruv1156cb6b8228
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex fbe12c232a..0e850cc3ae 100644--- a/plugins/ruflo-console/.claude-plugin/plugin.json+++ b/plugins/ruflo-console/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ruflo-console","description": "ruflo's cockpit inside Claude Code and the one /ruflo command for every ruflo mod (function hooks, early access). Views: overview with health alerts, swarm topology graph, claims flow with TTL rings, federation map, plugin health matrix, learning curve and pipeline, MetaHarness radar and audit trend, memory, cost gauge, agent timeline, approvals queue, event stream, a main menu, an x.ruv.io federation board, an AI terminal (codex, claude or both in remembered sessions, streamed), Skills (npx skills), a Hive-Mind view, a MetaHarness lab, agent drill-down; a command palette for confirm-gated actions through the ruflo CLI; a band above the prompt. Reads ruflo's files and the CLI's local JSON; anything not measured reads n/a; no network by default.",- "version": "0.24.0",+ "version": "0.25.0","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/hooks/bindings.ts b/plugins/ruflo-console/hooks/bindings.tsindex de46b57582..699e37a4d0 100644--- a/plugins/ruflo-console/hooks/bindings.ts+++ b/plugins/ruflo-console/hooks/bindings.ts@@ -8,6 +8,7 @@ import { evolveActions } from './evolve'import { askActions } from './ask-claude'import { loopActions } from './loops'import { optimizerActions } from './optimizer'+import { navActions } from './nav-state'import { watchActions } from './watch'import { missionActions } from './mission-control'import { catalogActions } from './plugin-catalog'@@ -332,6 +333,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Stepsloops: loopActions(state, host, runner),optimizer: optimizerActions(state, () => host.invalidate(), id => void runner.runById(id, ''), question => actions.ask.ask(question, 'overview')),watch: watchActions(state, () => host.invalidate(), (question, view) => actions.ask.ask(question, view)),+ navigator: navActions(state, () => host.invalidate(), view => actions.view(view)),catalog: catalogActions(state, host, runner, text => actions.term.load('claude', text)),devtools: devtoolsActions(state, host, runner.runById, why => runner.ask(null, why)),}diff --git a/plugins/ruflo-console/hooks/nav-state.ts b/plugins/ruflo-console/hooks/nav-state.tsnew file mode 100644index 0000000000..481013e3ab--- /dev/null+++ b/plugins/ruflo-console/hooks/nav-state.ts@@ -0,0 +1,80 @@+/**+ * The nav's groups and its search: which pages belong together, which group is showing its pages, and which pages a few typed words+ * find. Pure and view-free (the nav card that draws it is views/nav.ts), so the page list, the grouping and the matching are tested+ * without a screen.+ */+import { VIEWS, type State, type ViewId } from './state'++/** The nav's groups, the main menu's own, each in rows short enough to spell their names: every view but the menu is in exactly one. */+export const NAV_GROUPS: readonly { title: string; icon: string; rows: readonly (readonly ViewId[])[] }[] = [+ { title: 'SWARM', icon: 'π', rows: [['missions', 'overview', 'swarm', 'hive', 'claims', 'approvals'], ['automate', 'timeline', 'events']] },+ { title: 'MIND', icon: 'π§ ', rows: [['learning', 'neural', 'metaharness', 'evolve'], ['memory', 'vector', 'cost', 'perf']] },+ { title: 'SAFETY', icon: 'π‘οΈ', rows: [['secure', 'devtools']] },+ { title: 'NETWORK', icon: 'π', rows: [['federation', 'xruv', 'plugins', 'skills', 'market']] },+ { title: 'TOOLS', icon: 'π οΈ', rows: [['terminal', 'settings']] },+]++export const groupOf = (view: ViewId): string | null => NAV_GROUPS.find(group => group.rows.some(row => row.includes(view)))?.title ?? null++/** The group whose pages the nav shows: the one the person picked while on this page, else the open page's own. */+export function shownGroup(state: State): string {+ const open = state.view === 'agent' ? state.back : state.view++ if (state.navPick !== null && state.navPick.view === state.view) return state.navPick.group++ return groupOf(open) ?? (NAV_GROUPS[0] as (typeof NAV_GROUPS)[number]).title+}++const MAX_FOUND = 12++/** The pages a search finds: every word must appear in the page's name, its group, or its description; names rank first. */+export function findPages(query: string): ViewId[] {+ const words = query.toLowerCase().split(/\s+/).filter(word => word !== '')++ if (words.length === 0) return []++ const scored = VIEWS.filter(view => view.id !== 'menu').flatMap(view => {+ const name = `${view.label} ${view.short} ${view.id} ${view.key}`.toLowerCase()+ const rest = `${groupOf(view.id) ?? ''} ${view.blurb}`.toLowerCase()++ if (!words.every(word => name.includes(word) || rest.includes(word))) return []++ return [{ id: view.id, rank: words.every(word => name.includes(word)) ? 0 : 1 }]+ })++ return scored.sort((a, b) => a.rank - b.rank).slice(0, MAX_FOUND).map(entry => entry.id)+}++export type NavActions = {+ /** Shows a group's pages (while this page stays open). */+ group: (title: string) => void+ /** Applies the search words: one match opens it, several are listed, none says so. */+ find: (text: string) => void+ clear: () => void+}++export function navActions(state: State, invalidate: () => void, open: (view: ViewId) => void): NavActions {+ return {+ group: title => {+ state.navPick = { group: title, view: state.view }+ state.navQuery = ''+ invalidate()+ },+ find: text => {+ const query = text.trim()+ const found = findPages(query)++ state.navQuery = query+ if (found.length === 1) {+ state.navQuery = ''+ open(found[0] as ViewId)+ }++ invalidate()+ },+ clear: () => {+ state.navQuery = ''+ invalidate()+ },+ }+}diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.tsindex 92ce22b727..3b4dce16c2 100644--- a/plugins/ruflo-console/hooks/state.ts+++ b/plugins/ruflo-console/hooks/state.ts@@ -206,6 +206,10 @@ export type State = {allowed: Map<string, string>/** The main nav's style, saved across sessions. */nav: NavStyle+ /** The nav group whose pages are showing, picked on this page (it follows the open page again once the page changes). */+ navPick: { group: string; view: ViewId } | null+ /** The nav search words (empty: no search). */+ navQuery: string/** The slash command names the session offered when last asked (for the mission skills). */commandNames: string[]/** True while the primary Claude session is running a turn (the band reports it each draw). */@@ -306,6 +310,8 @@ export function newState(raw: PluginOptions | undefined): State {curveGrewAtMs: 0,dockColumns: 0,nav: 'auto',+ navPick: null,+ navQuery: '',turnActive: false,commandNames: [],allowed: new Map(),diff --git a/plugins/ruflo-console/hooks/views/common.ts b/plugins/ruflo-console/hooks/views/common.tsindex 6550f969f5..730b463bf4 100644--- a/plugins/ruflo-console/hooks/views/common.ts+++ b/plugins/ruflo-console/hooks/views/common.ts@@ -19,6 +19,7 @@ import type { SettingsActions } from '../settings'import type { DevtoolsActions } from '../devtools'import type { Grid } from '../gfx/raster'import type { MemoryActions } from '../memory-lab'+import type { NavActions } from '../nav-state'import type { SkillActions } from '../skills'import { START_LABEL, type StartId } from '../starts'import type { MoreSkillActions } from '../skills-lab'@@ -92,6 +93,8 @@ export type Actions = {remember: () => void/** Forgets one remembered kind of action, or all of them (an empty key). */forget: (key: string) => void+ /** The nav card: show a group's pages, search the pages, clear the search. */+ navigator: NavActions/** Sets how the main nav spells its tabs (saved). */nav: (style: NavStyle) => void/** Opens or closes a collapsible section (`<view>/<id>`). */diff --git a/plugins/ruflo-console/hooks/views/nav.ts b/plugins/ruflo-console/hooks/views/nav.tsindex f9044a2376..966326a432 100644--- a/plugins/ruflo-console/hooks/views/nav.ts+++ b/plugins/ruflo-console/hooks/views/nav.ts@@ -1,76 +1,81 @@/**- * The grouped nav, drawn when the page is in cards: one bordered NAV card, a row per group of the main menu (Swarm, Mind, Safety,- * Network, Tools), each view a button with its hotkey, the open one marked. Every view is a click away from every page; a hotkey is- * given only to the views that had one in the flat tab bar, so no new key can collide with a page's own.+ * The nav, drawn when the page is in cards: a short, bordered card of two or three rows instead of every page at once.+ * row 1 [0: MAIN] the five groups (the open one marked) a search field+ * row 2+ the pages of the open group (or what the search found), each `[k: icon NAME]`+ * Picking another group shows its pages while the page stays open; searching lists the pages whose name, group or description holds+ * the words (one match opens it). A page's hotkey is the one it had in the flat tab bar, and it keeps working wherever it is+ * drawn: the pages that are not showing are in the card as hidden buttons, so a number or letter reaches any page from any page.*/import type { RenderElement } from 'claude-code'-import { NAV_STYLES, VIEWS, type ViewId } from '../state'+import { findPages, NAV_GROUPS, shownGroup } from '../nav-state'+import { VIEWS, type ViewId } from '../state'import { CARD_COLUMNS } from './card'-import { isBbs, row, THEME, type Ctx } from './common'+import { isBbs, THEME, type Ctx } from './common'-/** The nav's groups, the main menu's own, each in rows short enough to spell their names: every view but the menu is in exactly one. */-export const NAV_GROUPS: readonly { title: string; rows: readonly (readonly ViewId[])[] }[] = [- { title: 'SWARM', rows: [['missions', 'overview', 'swarm', 'hive', 'claims', 'approvals'], ['automate', 'timeline', 'events']] },- { title: 'MIND', rows: [['learning', 'neural', 'metaharness', 'evolve'], ['memory', 'vector', 'cost', 'perf']] },- { title: 'SAFETY', rows: [['secure', 'devtools']] },- { title: 'NETWORK', rows: [['federation', 'xruv', 'plugins', 'skills', 'market']] },- { title: 'TOOLS', rows: [['terminal', 'settings']] },-]+type View = (typeof VIEWS)[number]-const LABEL_WIDTH = 9+const PER_ROW = 6-export function groupedTabs(ctx: Ctx, hasHotkey: (view: (typeof VIEWS)[number]) => boolean): RenderElement {+export function groupedTabs(ctx: Ctx, hasHotkey: (view: View) => boolean): RenderElement {+ const { state } = ctxconst inner = ctx.columns - CARD_COLUMNS- const style = ctx.state.nav- const open = ctx.state.view === 'agent' ? ctx.state.back : ctx.state.view+ const open = state.view === 'agent' ? state.back : state.view+ const shown = shownGroup(state)+ const query = state.navQueryconst find = (id: ViewId) => VIEWS.find(entry => entry.id === id)- // What a tab spells: its icon, and from `brief` a short name, from `full` the whole name. The engine puts a button's hotkey in front ("3: ").- const spell = (view: (typeof VIEWS)[number], form: string) => (form === 'icons' ? view.icon : form === 'brief' ? `${view.icon} ${view.short}` : `${view.icon} ${view.label}`)- const cells = (view: (typeof VIEWS)[number], form: string) => (hasHotkey(view) && view.key !== '' ? 3 : 0) + spell(view, form).length + 3- const widest = (form: string) => Math.max(...NAV_GROUPS.flatMap(group => group.rows.map(ids => LABEL_WIDTH + ids.reduce((sum, id) => sum + (find(id) === undefined ? 0 : cells(find(id) as (typeof VIEWS)[number], form)), 0))))- // auto: the richest form whose widest group row fits the page; the others are the person's choice.- const form = style === 'auto' ? (['full', 'brief'].find(candidate => widest(candidate) <= inner) ?? 'icons') : style- const tab = (view: (typeof VIEWS)[number]): RenderElement => {- const words = spell(view, form)+ const found = query === '' ? null : findPages(query)+ const pages: ViewId[][] = found !== null ? Array.from({ length: Math.ceil(found.length / PER_ROW) }, (_, i) => found.slice(i * PER_ROW, (i + 1) * PER_ROW)) : (NAV_GROUPS.find(group => group.title === shown)?.rows ?? []).map(ids => [...ids])++ // What a page spells: its icon, and from `brief` a short name, from `full` the whole name. The engine puts a hotkey in front ("3: ").+ const spell = (view: View, form: string) => (form === 'icons' ? view.icon : form === 'brief' ? `${view.icon} ${view.short}` : `${view.icon} ${view.label}`)+ const cells = (view: View, form: string) => (hasHotkey(view) && view.key !== '' ? 3 : 0) + spell(view, form).length + 3+ const widest = (form: string) => Math.max(0, ...pages.map(ids => ids.reduce((sum, id) => sum + (find(id) === undefined ? 0 : cells(find(id) as View, form)), 0)))+ // auto: the richest form whose widest row fits the page; the others are the person's choice (Settings).+ const form = state.nav === 'auto' ? (['full', 'brief'].find(candidate => widest(candidate) <= inner) ?? 'icons') : state.nav- // The open view names itself whatever the style, as the flat tab bar did: [3: π CLAIMS], [0: π MAIN MENU].+ const tab = (view: View): RenderElement => {+ const words = spell(view, form)const prefix = view.key === '' ? '' : `${view.key}: `+ // The open page names itself whatever the style, as the flat tab bar did: [3: π CLAIMS], [0: π MAIN MENU].if (view.id === open) return ctx.kit.Box({ key: `tab-${view.id}`, children: [ctx.kit.Text({ bold: true, color: THEME.head, wrap: 'truncate-end', children: isBbs() ? `[${prefix}${view.icon} ${view.label.toUpperCase()}]` : `${prefix}${view.icon} ${view.label}` })] })return ctx.kit.Button({ key: `tab-${view.id}`, label: ` ${words} `, ...(hasHotkey(view) && view.key !== '' && { hotkey: view.key }), plain: true, dimColor: true, onPress: () => ctx.act.view(view.id) })}- const menu = VIEWS.find(view => view.id === 'menu')- const titleRow = row(- ctx,- [- ctx.kit.Text({ bold: true, color: THEME.head, children: isBbs() ? 'βββ NAV βββ ' : 'NAV ' }),- ...(menu === undefined ? [] : [open === 'menu' ? tab(menu) : ctx.kit.Button({ key: 'tab-menu', label: ' π Menu ', plain: true, hotkey: '0', onPress: () => ctx.act.view('menu') })]),- ctx.kit.Text({ dimColor: true, children: ' style ' }),- ...NAV_STYLES.map(option =>- ctx.kit.Button({ key: `nav-style-${option}`, label: ` ${option === style ? 'β' : 'β'} ${option} `, plain: true, ...(option === style ? { variant: 'primary' as const } : { dimColor: true }), onPress: () => ctx.act.nav(option) }),- ),- ],- 'tabs-title',- )- const groups = NAV_GROUPS.flatMap(group =>- group.rows.map((ids, i) =>- ctx.kit.Box({- flexDirection: 'row',- gap: 1,- key: `tabs-${group.title.toLowerCase()}-${i}`,- children: [- ctx.kit.Text({ bold: true, color: THEME.info, children: (i === 0 ? group.title : '').padEnd(LABEL_WIDTH) }),- ...ids.flatMap(id => {- const view = find(id)- return view === undefined ? [] : [tab(view)]- }),- ],- }),- ),+ const menu = find('menu')+ // The group chips spell their icon only where the row has room; the search field shares their row only where it fits, else it has its own.+ const icons = inner >= 130+ const chipCells = NAV_GROUPS.reduce((sum, group) => sum + group.title.length + (icons ? 5 : 3), 12)+ const isSearchInline = inner - chipCells >= 28+ const chips = NAV_GROUPS.map(group =>+ group.title === shown && found === null+ ? ctx.kit.Box({ key: `nav-group-${group.title}`, children: [ctx.kit.Text({ bold: true, color: THEME.head, children: `[${icons ? `${group.icon} ` : ''}${group.title} βΎ]` })] })+ : ctx.kit.Button({ key: `nav-group-${group.title}`, label: ` ${icons ? `${group.icon} ` : ''}${group.title} `, plain: true, dimColor: true, onPress: () => ctx.act.navigator.group(group.title) }),)+ const Input = ctx.kit.Input+ const search = Input === undefined ? [] : [Input({ key: 'nav-find', label: 'π', placeholder: 'find a page', submitLabel: 'go', onSubmit: (value: string) => ctx.act.navigator.find(value) })]+ const clear = query === '' ? [] : [ctx.kit.Button({ key: 'nav-find-clear', label: ' β ', plain: true, dimColor: true, onPress: () => ctx.act.navigator.clear() })]+ const head = ctx.kit.Box({+ flexDirection: 'row',+ gap: 1,+ key: 'tabs-groups',+ children: [menu === undefined ? ctx.kit.Text({ children: '' }) : open === 'menu' ? tab(menu) : ctx.kit.Button({ key: 'tab-menu', label: ' π MAIN ', plain: true, hotkey: '0', onPress: () => ctx.act.view('menu') }), ...chips, ...(isSearchInline ? [...search, ...clear] : [])],+ })+ const findRow = isSearchInline ? [] : [ctx.kit.Box({ flexDirection: 'row', gap: 1, key: 'tabs-find', children: [...search, ...clear] })]+ const lines =+ found !== null && found.length === 0+ ? [ctx.kit.Text({ dimColor: true, children: ` no page matches β${query}β β try a name, a group or what it does` })]+ : pages.map((ids, i) =>+ ctx.kit.Box({ flexDirection: 'row', gap: 1, key: `tabs-row-${i}`, children: ids.flatMap(id => (find(id) === undefined ? [] : [tab(find(id) as View)])) }),+ )+ const note = found === null ? [] : [ctx.kit.Text({ dimColor: true, children: ` ${found.length} found for β${query}β${found.length === 1 ? '' : ' β Enter again on one name opens it'}` })]++ // Every other page with a hotkey stays in the card, hidden: its number or letter works from this page too.+ const visible = new Set<ViewId>(pages.flat())+ const hidden = VIEWS.filter(view => view.id !== 'menu' && view.id !== open && !visible.has(view.id) && hasHotkey(view) && view.key !== '')+ const keys = hidden.length === 0 ? [] : [ctx.kit.Box({ key: 'tabs-keys', display: 'none', children: hidden.map(view => ctx.kit.Button({ key: `tab-${view.id}`, label: view.short, hotkey: view.key, plain: true, onPress: () => ctx.act.view(view.id) })) } as never)]- return ctx.kit.Box({ key: 'tabs', flexDirection: 'column', borderStyle: 'round', borderColor: THEME.info, paddingX: 1, children: [titleRow, ...groups] })+ return ctx.kit.Box({ key: 'tabs', flexDirection: 'column', borderStyle: 'round', borderColor: THEME.info, paddingX: 1, children: [head, ...findRow, ...lines, ...note, ...keys] })}diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex 16def4b759..5cc490abbd 100755--- a/plugins/ruflo-console/scripts/smoke.sh+++ b/plugins/ruflo-console/scripts/smoke.sh@@ -11,9 +11,9 @@ step() { printf "β %s ... " "$1"; }ok() { printf "PASS\n"; PASS=$((PASS+1)); }bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }-step "1. plugin.json declares ruflo-console 0.24.0"+step "1. plugin.json declares ruflo-console 0.25.0"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.24.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.25.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"step "2. hooks.json names exactly one module and no classic hook commands"grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \diff --git a/plugins/ruflo-console/tests/card.spec.ts b/plugins/ruflo-console/tests/card.spec.tsindex 1610a8f7f8..7001ac65b7 100644--- a/plugins/ruflo-console/tests/card.spec.ts+++ b/plugins/ruflo-console/tests/card.spec.ts@@ -10,7 +10,7 @@ import { BOOT_MODULES } from '../hooks/gfx/boot'import { VIEWS } from '../hooks/state'import { CARD_COLUMNS, hasCards, withCards } from '../hooks/views/card'import { HEADS, mark, SPACERS } from '../hooks/views/marks'-import { NAV_GROUPS } from '../hooks/views/nav'+import { NAV_GROUPS } from '../hooks/nav-state'type Made = { type: string; props: { key?: string; flexDirection?: string; borderStyle?: string; children?: unknown[] } }diff --git a/plugins/ruflo-console/tests/devtools.test.ts b/plugins/ruflo-console/tests/devtools.test.tsindex d97c4f1ae2..3385401b62 100644--- a/plugins/ruflo-console/tests/devtools.test.ts+++ b/plugins/ruflo-console/tests/devtools.test.ts@@ -9,7 +9,7 @@ import { MISSION_OBSERVATION } from './fixtures/missions'import { HIVE_TOKEN, RUFLO_FILES } from './fixtures/ruflo-run'import { FIND_OUT, LIST_OUT, LS_GLOBAL, USE_OUT } from './fixtures/skills'import { VEC_OUT } from './fixtures/vector'-import { cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const HOME_FILES = {'.claude/plugins/installed_plugins.json': JSON.stringify({@@ -37,7 +37,7 @@ describe('dev tools', () => {expect(text).toMatch(/ net \n PULL REQUESTS \.+/)expect(text).toContain(' n/a ')expect(text).toContain('nothing run yet')- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(expect.arrayContaining(['dt-field-brain-task', 'dt-field-analyze-ref', 'dt-field-browser-url', 'dt-field-terminal-cmd']))+ expect(inputKeys(tree)).toEqual(expect.arrayContaining(['dt-field-brain-task', 'dt-field-analyze-ref', 'dt-field-browser-url', 'dt-field-terminal-cmd']))expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['dt-diff-stats', 'dt-gh-prs', 'dt-term-exec', 'dt-cleanup-force']))expect(world.runs.some(argv => /analyze_|github_|browser_|terminal_|guidance_|agenticow_|wasm_|managed_|daa_|ruvllm_|transfer_|providers|cleanup|update|migrate|appliance/.test(argv.join(' ')))).toBe(false)})diff --git a/plugins/ruflo-console/tests/fixtures/world.ts b/plugins/ruflo-console/tests/fixtures/world.tsindex 18cbe5c341..4db024bdef 100644--- a/plugins/ruflo-console/tests/fixtures/world.ts+++ b/plugins/ruflo-console/tests/fixtures/world.ts@@ -228,4 +228,7 @@ export function elementsOf(node: RenderNode | RenderElement | null | undefined,return [...(node.type === type ? [node as RenderElement] : []), ...children.flatMap(child => elementsOf(child, type))]}+/** The keys of a page's own text fields: the nav's search field is on every page, so it is left out. */+export const inputKeys = (tree: Parameters<typeof elementsOf>[0]): string[] => elementsOf(tree, 'Input').map(keyOf).filter(key => key !== 'nav-find')+export const keyOf = (element: RenderElement): string => String((element as { key?: unknown }).key ?? (element as { props?: { key?: unknown } }).props?.key ?? '')diff --git a/plugins/ruflo-console/tests/labs.test.ts b/plugins/ruflo-console/tests/labs.test.tsindex 8819745c41..e617593eaa 100644--- a/plugins/ruflo-console/tests/labs.test.ts+++ b/plugins/ruflo-console/tests/labs.test.ts@@ -3,7 +3,7 @@ import { describe, expect, mock, test } from 'claude-code/testing'import { MEM_OUT } from './fixtures/memory'import { RUFLO_FILES } from './fixtures/ruflo-run'import { drawn, memoryWorld } from './fixtures/views'-import { cliAnswer, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'describe('labs and starts', () => {test('cost: a preset asks first, names the exact change, and sends one fixed argv with JSON stdin on yes', { options: { boot: false } }, async ($, on) => {@@ -96,7 +96,7 @@ describe('labs and starts', () => {expect(text).toContain('2 more rows in .swarm/agentdb-memory.db')expect(text).toMatch(/ β beta \.+/)expect(text).toMatch(/del \n DELETE \.+/)- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['mem-query', 'mem-namespace', 'mem-key', 'mem-value', 'mem-text'])+ expect(inputKeys(tree)).toEqual(['mem-query', 'mem-namespace', 'mem-key', 'mem-value', 'mem-text'])expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['mem-ns-0', 'mem-open-0', 'mem-del-0', 'mem-lab-mem-stats', 'mem-lab-mem-cleanup', 'mem-lab-mem-rabitq-build']))// Opening it runs only its two local probes.expect(world.runs.filter(argv => /memory (retrieve|search|store|delete|export)|mcp exec -t (memory_|agentdb_|embeddings_)/.test(argv.join(' ')))).toEqual([])diff --git a/plugins/ruflo-console/tests/learning.test.ts b/plugins/ruflo-console/tests/learning.test.tsindex 842f45a9e4..de4f0a2315 100644--- a/plugins/ruflo-console/tests/learning.test.ts+++ b/plugins/ruflo-console/tests/learning.test.ts@@ -6,7 +6,7 @@ import type { TestBody } from 'claude-code/testing'import { describe, expect, mock, test } from 'claude-code/testing'import { RUFLO_FILES } from './fixtures/ruflo-run'-import { command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const keys = (tree: Parameters<typeof elementsOf>[0]) => elementsOf(tree, 'Button').map(keyOf)@@ -80,7 +80,7 @@ describe('learning page', () => {const order = keys(open)expect(order).toEqual(expect.arrayContaining(['run-nn-pretrain-shallow', 'run-nn-pretrain-medium', 'run-nn-pretrain-deep', 'run-nn-consolidate']))- expect(elementsOf(open, 'Input').map(keyOf)).toEqual(expect.arrayContaining(['in-nn-pattern-search', 'in-nn-pattern-store']))+ expect(inputKeys(open)).toEqual(expect.arrayContaining(['in-nn-pattern-search', 'in-nn-pattern-store']))await pane.press({ key: 'run-nn-pretrain-medium' })const asked = await pane.drawn()diff --git a/plugins/ruflo-console/tests/nav-state.spec.ts b/plugins/ruflo-console/tests/nav-state.spec.tsnew file mode 100644index 0000000000..4ba71a451d--- /dev/null+++ b/plugins/ruflo-console/tests/nav-state.spec.ts@@ -0,0 +1,93 @@+/**+ * The nav's grouping and search, pure: which group is showing its pages, which pages a few words find (every word must match, names+ * rank before descriptions), and what the nav actions do to the state. Run with+ * npx vitest run plugins/ruflo-console/tests/nav-state.spec.ts+ */+import { describe, expect, it } from 'vitest'++import { findPages, groupOf, NAV_GROUPS, navActions, shownGroup } from '../hooks/nav-state'+import { newState, VIEWS, type ViewId } from '../hooks/state'++describe('nav groups', () => {+ it('names the group of a page, and shows the open page group unless another was picked on this page', () => {+ expect(groupOf('learning')).toBe('MIND')+ expect(groupOf('swarm')).toBe('SWARM')+ expect(groupOf('menu')).toBeNull()++ const state = newState({})++ state.view = 'learning'+ expect(shownGroup(state)).toBe('MIND')+ state.navPick = { group: 'NETWORK', view: 'learning' }+ expect(shownGroup(state)).toBe('NETWORK')+ // A pick belongs to the page it was made on: once the page changes, the nav follows the page again.+ state.view = 'swarm'+ expect(shownGroup(state)).toBe('SWARM')+ // A drill-down into an agent keeps the group of the page it came from.+ state.view = 'agent'+ state.back = 'learning'+ expect(shownGroup(state)).toBe('MIND')+ })++ it('has at most six pages a row, so a row can spell their names', () => {+ for (const group of NAV_GROUPS) for (const row of group.rows) expect(row.length).toBeLessThanOrEqual(6)+ })+})++describe('finding a page', () => {+ it('finds by name, group or what the page does; every word must match', () => {+ expect(findPages('memory')[0]).toBe('memory')+ expect(findPages('hive')).toContain('hive')+ expect(findPages('MIND')).toEqual(expect.arrayContaining(['learning', 'metaharness']))+ expect(findPages('cost budget')).toContain('cost')+ expect(findPages('zzzz-no-such-page')).toEqual([])+ expect(findPages(' ')).toEqual([])+ expect(findPages('memory zzzz-no-such-word')).toEqual([])+ })++ it('ranks a page whose name holds the words before one whose description does, and never lists the menu', () => {+ const found = findPages('lab')+ const names = found.map(id => VIEWS.find(view => view.id === id)?.label ?? '')++ expect(found).not.toContain('menu' as ViewId)+ expect(found.length).toBeLessThanOrEqual(12)+ expect(names.findIndex(name => /lab/i.test(name))).toBe(0)+ })+})++describe('the nav actions', () => {+ const setup = () => {+ const state = newState({})+ const calls = { invalidated: 0, opened: [] as ViewId[] }+ const act = navActions(state, () => void calls.invalidated++, view => void calls.opened.push(view))++ return { state, calls, act }+ }++ it('picking a group shows its pages on this page and clears a search', () => {+ const { state, act, calls } = setup()++ state.view = 'swarm'+ state.navQuery = 'old'+ act.group('MIND')+ expect(state.navPick).toEqual({ group: 'MIND', view: 'swarm' })+ expect(state.navQuery).toBe('')+ expect(calls.invalidated).toBe(1)+ })++ it('a search with one match opens it, with several lists them, and clear drops it', () => {+ const { state, act, calls } = setup()+ const unique = VIEWS.filter(view => view.id !== 'menu').map(view => view.label).find(label => findPages(label).length === 1)++ expect(unique, 'some page name finds exactly one page').toBeDefined()+ act.find(unique as string)+ expect(calls.opened).toHaveLength(1)+ expect(state.navQuery).toBe('')++ act.find('lab')+ expect(calls.opened).toHaveLength(1)+ expect(state.navQuery).toBe('lab')+ act.clear()+ expect(state.navQuery).toBe('')+ })+})diff --git a/plugins/ruflo-console/tests/nav.test.ts b/plugins/ruflo-console/tests/nav.test.tsnew file mode 100644index 0000000000..4d43e5ff52--- /dev/null+++ b/plugins/ruflo-console/tests/nav.test.ts@@ -0,0 +1,66 @@+/**+ * The compact nav on a real page: the groups and only the open group's pages, a group chip that shows another group's pages, a+ * search that lists matches (or says none matched), and the pages of the other groups still reached by their hotkey buttons.+ */+import type { TestBody } from 'claude-code/testing'+import { describe, expect, mock, test } from 'claude-code/testing'++import { RUFLO_FILES } from './fixtures/ruflo-run'+import { command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'++const keys = (tree: Parameters<typeof elementsOf>[0]) => elementsOf(tree, 'Button').map(keyOf)++type Body = Parameters<TestBody>++async function opened($: Body[0], on: Body[1], view: string) {+ worldOf(on, RUFLO_FILES)+ mock.clock(on)+ await $.session.start(SESSION)+ await $.command.run(command(view))++ const pane = await $.ui.mount({ ...paneAt(120), surface: 'terminal' as const, plugin: PLUGIN })++ await pane.drawn()++ return pane+}++describe('the compact nav', () => {+ test('shows the five groups and the open group pages only; a chip shows another group; every page is still a button', { options: { boot: false } }, async ($, on) => {+ const pane = await opened($, on, 'swarm')+ const first = await pane.drawn()++ expect(keys(first)).toEqual(expect.arrayContaining(['nav-group-MIND', 'nav-group-SAFETY', 'nav-group-NETWORK', 'nav-group-TOOLS', 'tab-menu']))+ // The open group's pages are in the card; another group's pages are there too but hidden, so their hotkeys still work.+ expect(textOf(first)).toContain('[SWARM βΎ]')+ expect(keys(first)).toEqual(expect.arrayContaining(['tab-missions', 'tab-hive', 'tab-learning', 'tab-memory']))++ await pane.press({ key: 'nav-group-MIND' })++ const mind = await pane.drawn()++ expect(textOf(mind)).toContain('[MIND βΎ]')+ expect(textOf(mind)).toContain('Learning Lab')+ expect(textOf(mind)).not.toContain('Approvals')+ await pane.press({ key: 'tab-learning' })+ expect(textOf(await pane.drawn())).toContain('[7: ')+ await pane.unmount()+ })++ test('the search lists the pages it finds, says when none match, and clears', { options: { boot: false } }, async ($, on) => {+ const pane = await opened($, on, 'overview')++ await pane.input({ key: 'nav-find', text: 'lab', kind: 'submit' })++ const found = await pane.drawn()++ expect(textOf(found)).toMatch(/\d+ found for βlabβ/)+ expect(keys(found)).toContain('nav-find-clear')+ expect(keys(found)).toEqual(expect.arrayContaining(['tab-memory', 'tab-vector']))+ await pane.input({ key: 'nav-find', text: 'zzzz-no-such-page', kind: 'submit' })+ expect(textOf(await pane.drawn())).toContain('no page matches βzzzz-no-such-pageβ')+ await pane.press({ key: 'nav-find-clear' })+ expect(keys(await pane.drawn())).not.toContain('nav-find-clear')+ await pane.unmount()+ })+})diff --git a/plugins/ruflo-console/tests/palette.test.ts b/plugins/ruflo-console/tests/palette.test.tsindex ab428884eb..1bbdc30560 100644--- a/plugins/ruflo-console/tests/palette.test.ts+++ b/plugins/ruflo-console/tests/palette.test.ts@@ -3,7 +3,7 @@ import { describe, expect, mock, test } from 'claude-code/testing'import { HIVE_FILES, WORKERS } from './fixtures/hive'import { RUFLO_FILES } from './fixtures/ruflo-run'import { FIND_OUT } from './fixtures/skills'-import { cliAnswer, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { cliAnswer, command, elementsOf, inputKeys, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const runsOf = (runs: readonly string[][], word: string) => runs.filter(argv => argv.includes(word))@@ -36,7 +36,7 @@ describe('palette and /ruflo', () => {const pane = await $.ui.mount({ ...paneAt(110), surface: 'terminal' as const, plugin: PLUGIN })await pane.press({ key: 'palette' })- expect(elementsOf(await pane.drawn(), 'Input').map(keyOf)).toEqual(['palette-input'])+ expect(inputKeys(await pane.drawn())).toEqual(['palette-input'])await pane.input({ key: 'palette-input', text: 'spawn cod', kind: 'change' })diff --git a/plugins/ruflo-console/tests/settings.test.ts b/plugins/ruflo-console/tests/settings.test.tsindex 9d3c4111ff..9c866a9d14 100644--- a/plugins/ruflo-console/tests/settings.test.ts+++ b/plugins/ruflo-console/tests/settings.test.ts@@ -3,7 +3,7 @@ import { describe, expect, mock, test } from 'claude-code/testing'import { settingsAnswer } from './fixtures/settings'import { RUFLO_FILES } from './fixtures/ruflo-run'-import { command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'type Body = Parameters<TestBody>@@ -112,7 +112,7 @@ describe('settings', () => {expect(text).toContain('Relay token')expect(text).toContain('hidden: set it in /plugin configure')expect(text).not.toContain('sk-must-never-show')- expect(elementsOf(tree, 'Input').map(keyOf)).not.toContain('st-in-ruflo-mods-relayApiToken')+ expect(inputKeys(tree)).not.toContain('st-in-ruflo-mods-relayApiToken')expect(elementsOf(tree, 'Button').map(keyOf).some(key => key.startsWith('st-ask-claude-ruflo-mods-relayApiToken'))).toBe(false)await pane.unmount()})@@ -228,22 +228,23 @@ describe('settings', () => {})- test('the main nav has a title and three styles: icons only, icon and brief title, icon and full title', { options: { boot: false } }, async ($, on) => {- const { pane } = await opened($, on, 'swarm')- const text = async () => textOf(await pane.drawn())+ test('the nav style is a Settings choice: icons only, icon and brief title, icon and full title; the nav page row follows it', { options: { boot: false } }, async ($, on) => {+ const { pane } = await opened($, on, 'settings')+ const keysNow = async () => elementsOf(await pane.drawn(), 'Button').map(keyOf)- expect(await text()).toContain('NAV')- expect(elementsOf(await pane.drawn(), 'Button').map(keyOf)).toEqual(expect.arrayContaining(['nav-style-auto', 'nav-style-icons', 'nav-style-brief', 'nav-style-full']))-- await pane.press({ key: 'nav-style-icons' })- expect(await text()).not.toContain('Hive')-- await pane.press({ key: 'nav-style-brief' })- expect(await text()).toContain('Hiv')- expect(await text()).not.toContain('Hive-Mind')-- await pane.press({ key: 'nav-style-full' })- expect(await text()).toContain('Hive-Mind')+ expect(await keysNow()).toEqual(expect.arrayContaining(['st-opt-ui-nav-auto', 'st-opt-ui-nav-icons', 'st-opt-ui-nav-brief', 'st-opt-ui-nav-full']))+ await pane.press({ key: 'st-opt-ui-nav-icons' })+ await $.command.run(command('swarm'))+ expect(textOf(await pane.drawn())).not.toContain('Hive')+ await $.command.run(command('settings'))+ await pane.press({ key: 'st-opt-ui-nav-brief' })+ await $.command.run(command('swarm'))+ expect(textOf(await pane.drawn())).toContain('Hiv')+ expect(textOf(await pane.drawn())).not.toContain('Hive-Mind')+ await $.command.run(command('settings'))+ await pane.press({ key: 'st-opt-ui-nav-full' })+ await $.command.run(command('swarm'))+ expect(textOf(await pane.drawn())).toContain('Hive-Mind')await pane.unmount()})diff --git a/plugins/ruflo-console/tests/skills-secure.test.ts b/plugins/ruflo-console/tests/skills-secure.test.tsindex 53a04182d5..60fb121811 100644--- a/plugins/ruflo-console/tests/skills-secure.test.ts+++ b/plugins/ruflo-console/tests/skills-secure.test.ts@@ -6,7 +6,7 @@ import { MEM_OUT } from './fixtures/memory'import { MISSION_OBSERVATION } from './fixtures/missions'import { HIVE_TOKEN, RUFLO_FILES } from './fixtures/ruflo-run'import { FIND_OUT, LIST_OUT, LS_GLOBAL, USE_OUT } from './fixtures/skills'-import { cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const HOME_FILES = {'.claude/plugins/installed_plugins.json': JSON.stringify({@@ -39,7 +39,7 @@ describe('skills, security and performance', () => {expect(text).toContain('0 project Β· 2 global')expect(text).toMatch(/ faceless-explainer \.+/)expect(text).toContain('Claude Code, Codex')- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['skills-search', 'skills-create'])+ expect(inputKeys(tree)).toEqual(['skills-search', 'skills-create'])expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['sk-update-0', 'sk-remove-0', 'sk-edit-0']))// The tab has no hotkey, and the current one reads without a key.expect(text).toContain('[z: π§° SKILLS]')@@ -82,7 +82,7 @@ describe('skills, security and performance', () => {for (const section of ['FINDINGS', 'CHECK TEXT', 'SCAN & INSPECT', 'DOCTOR', 'RESULT']) expect(text).toContain(section)expect(text).toContain('nothing run yet')expect(text).toMatch(/n\/a {2}VALIDATE/)- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['sec-text'])+ expect(inputKeys(tree)).toEqual(['sec-text'])expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['run-sec-scan-quick', 'run-sec-threats', 'run-doc-all', 'run-doc-fix', 'run-doc-node', 'run-aid-pii', 'run-policy-status']))expect(ours()).toEqual([])diff --git a/plugins/ruflo-console/tests/vector.test.ts b/plugins/ruflo-console/tests/vector.test.tsindex 4f69e7e887..80c283323c 100644--- a/plugins/ruflo-console/tests/vector.test.ts+++ b/plugins/ruflo-console/tests/vector.test.ts@@ -8,7 +8,7 @@ import { MISSION_OBSERVATION } from './fixtures/missions'import { HIVE_TOKEN, RUFLO_FILES } from './fixtures/ruflo-run'import { FIND_OUT, LIST_OUT, LS_GLOBAL, USE_OUT } from './fixtures/skills'import { VEC_OUT } from './fixtures/vector'-import { cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const HOME_FILES = {'.claude/plugins/installed_plugins.json': JSON.stringify({@@ -40,7 +40,7 @@ describe('vector lab', () => {expect(text).toMatch(/pub \n SHARE \.+/)expect(text).toMatch(/del \n DELETE \.+/)expect(text).toContain('rvf_delete is an MCP tool of the ruvector server with no CLI verb')- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['vec-in-brain', 'vec-in-rvfPath', 'vec-in-rvfArg', 'vec-in-sql', 'vec-in-target', 'vec-in-worker', 'vec-in-task'])+ expect(inputKeys(tree)).toEqual(['vec-in-brain', 'vec-in-rvfPath', 'vec-in-rvfArg', 'vec-in-sql', 'vec-in-target', 'vec-in-worker', 'vec-in-task'])expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['vec-brain-status', 'vec-brain-share', 'vec-rvf-query', 'vec-sql', 'vec-hooks-stats', 'vec-identity-generate']))expect(elementsOf(tree, 'Button').map(keyOf)).not.toContain('vec-rvf-delete')expect(vecRuns()).toHaveLength(0)diff --git a/plugins/ruflo-console/tests/views.test.ts b/plugins/ruflo-console/tests/views.test.tsindex 8300c8ae40..20e2af7c39 100644--- a/plugins/ruflo-console/tests/views.test.ts+++ b/plugins/ruflo-console/tests/views.test.ts@@ -9,7 +9,7 @@ import { MISSION_OBSERVATION } from './fixtures/missions'import { HIVE_TOKEN, RUFLO_FILES } from './fixtures/ruflo-run'import { FIND_OUT, LIST_OUT, LS_GLOBAL, USE_OUT } from './fixtures/skills'import { VEC_OUT } from './fixtures/vector'-import { cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, fakeRuflo, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'const HOME_FILES = {'.claude/plugins/installed_plugins.json': JSON.stringify({@@ -93,7 +93,7 @@ describe('views', () => {expect(text).toContain('[high] system: freeze the main branch')expect(text).toContain('propose: n/a β raft term 2 already has design')expect(text).not.toContain(HIVE_TOKEN)- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['hive-propose', 'hive-broadcast'])+ expect(inputKeys(tree)).toEqual(['hive-propose', 'hive-broadcast'])expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['hive-vote-yes', 'hive-vote-no', 'hive-spawn-worker']))})@@ -243,7 +243,7 @@ describe('views', () => {expect(cost.text).toContain('$1.100 Β· ruflo-mods budget')expect(cost.text).toContain('50% Β· $2.50')expect(elementsOf(cost.tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['cost-budget-1', 'cost-budget-5', 'cost-budget-10', 'cost-budget-25', 'cost-budget-apply', 'cost-model-stats']))- expect(elementsOf(cost.tree, 'Input').map(keyOf)).toEqual(['cost-budget'])+ expect(inputKeys(cost.tree)).toEqual(['cost-budget'])})test('timeline, approvals and events draw from what was seen; the drill-down opens an agent', { options: { boot: false } }, async ($, on) => {@@ -300,7 +300,7 @@ describe('views', () => {expect(text).toContain('[l: CLAUDE]')expect(text).toContain('claude -p in plan mode, a per-turn budget cap (Settings), one session per project')expect(text).toContain('claude: new session')- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(['term-input'])+ expect(inputKeys(tree)).toEqual(['term-input'])expect(world.runs.some(argv => argv[0] === 'codex' || argv[0] === 'claude')).toBe(false)})@@ -318,7 +318,7 @@ describe('views', () => {expect(textOf(menu)).toContain('ββ live')expect(textOf(menu)).toContain('Swarm Topology')expect(textOf(menu)).toContain('ANSI-BBS')- expect(elementsOf(menu, 'Input').map(keyOf)).toEqual(['menu-goal', 'menu-prompt'])+ expect(inputKeys(menu)).toEqual(['menu-goal', 'menu-prompt'])await pane.input({ key: 'menu-prompt', text: 'w', kind: 'submit' })expect(textOf(await pane.drawn())).toContain('MAIN MENU')diff --git a/plugins/ruflo-console/tests/watch.test.ts b/plugins/ruflo-console/tests/watch.test.tsindex 3c221d8906..f103df02a6 100644--- a/plugins/ruflo-console/tests/watch.test.ts+++ b/plugins/ruflo-console/tests/watch.test.ts@@ -6,7 +6,7 @@ import type { TestBody } from 'claude-code/testing'import { describe, expect, mock, test } from 'claude-code/testing'import { RUFLO_FILES } from './fixtures/ruflo-run'-import { command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'+import { inputKeys, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf } from './fixtures/world'type Body = Parameters<TestBody>@@ -44,7 +44,7 @@ describe('timeline and events pages', () => {const first = await pane.drawn()expect(keys(first)).toEqual(expect.arrayContaining(['ev-kind-all', 'ev-pause']))- expect(elementsOf(first, 'Input').map(keyOf)).toContain('ev-query')+ expect(inputKeys(first)).toContain('ev-query')expect(textOf(first)).toContain('live')await pane.press({ key: 'ev-pause' })expect(textOf(await pane.drawn())).toContain('paused')diff --git a/plugins/ruflo-console/tests/xruv.test.ts b/plugins/ruflo-console/tests/xruv.test.tsindex 35cd41d926..183d4c5f6f 100644--- a/plugins/ruflo-console/tests/xruv.test.ts+++ b/plugins/ruflo-console/tests/xruv.test.ts@@ -1,7 +1,7 @@import { describe, expect, mock, test } from 'claude-code/testing'import { RUFLO_FILES } from './fixtures/ruflo-run'-import { cliAnswer, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf, type Answer } from './fixtures/world'+import { inputKeys, cliAnswer, command, elementsOf, keyOf, paneAt, PLUGIN, SESSION, textOf, worldOf, type Answer } from './fixtures/world'const PUBKEY = 'ab'.repeat(32)const TOKEN = 'xr-admin-token-do-not-print-0123456789'@@ -40,8 +40,8 @@ describe('x.ruv.io board', () => {const text = textOf(tree)expect(elementsOf(tree, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['xr-x-join', 'xr-x-bbs-identity', 'xr-x-registry', 'xr-x-roster', 'xr-x-claims', 'xr-x-sync', 'xr-x-channels', 'xr-x-accept', 'xr-x-bbs-peers', 'xr-x-bbs-serve']))- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(expect.arrayContaining(['xr-in-x-bbs-register', 'xr-in-x-bbs-publish', 'xr-in-x-bbs-watch', 'xr-in-x-bbs-peer-add', 'xr-in-x-bbs-sync']))- expect(elementsOf(tree, 'Input').map(keyOf)).toEqual(expect.arrayContaining(['xr-in-x-join', 'xr-in-x-read', 'xr-in-x-publish', 'xr-in-x-create', 'xr-in-x-grant']))+ expect(inputKeys(tree)).toEqual(expect.arrayContaining(['xr-in-x-bbs-register', 'xr-in-x-bbs-publish', 'xr-in-x-bbs-watch', 'xr-in-x-bbs-peer-add', 'xr-in-x-bbs-sync']))+ expect(inputKeys(tree)).toEqual(expect.arrayContaining(['xr-in-x-join', 'xr-in-x-read', 'xr-in-x-publish', 'xr-in-x-create', 'xr-in-x-grant']))expect(text).toContain(' JOIN ....')expect(text).toContain('present: ~/.ruflo/nostr.key (never read here)')expect(text).toContain('unregister: not offered by the x.ruv.io gateway yet')diff --git a/scripts/ci-test-baseline.txt b/scripts/ci-test-baseline.txtindex 9e5322a7cb..37480b9b6c 100644--- a/scripts/ci-test-baseline.txt+++ b/scripts/ci-test-baseline.txt@@ -180,3 +180,4 @@ plugins/ruflo-console/tests/vector.test.tsplugins/ruflo-console/tests/skills-secure.test.tsplugins/ruflo-console/tests/xruv.test.tsplugins/ruflo-console/tests/steps.test.ts+plugins/ruflo-console/tests/nav.test.tsdiff --git a/v3/docs/adr/ADR-424-console-compact-nav-with-search.md b/v3/docs/adr/ADR-424-console-compact-nav-with-search.mdnew file mode 100644index 0000000000..01acec7165--- /dev/null+++ b/v3/docs/adr/ADR-424-console-compact-nav-with-search.md@@ -0,0 +1,43 @@+# ADR 424: A compact nav: groups, one group's pages, and a search++Status: Accepted (ships in ruflo-console 0.25.0)++Date: 2026 10 03++Decision owner: Ruflo maintainers++Scope: `plugins/ruflo-console`: `hooks/nav-state.ts`, `hooks/views/nav.ts`, `hooks/state.ts` (`navPick`, `navQuery`), `hooks/bindings.ts`, `tests/nav-state.spec.ts`, `tests/nav.test.ts`.++Extends: ADR 422 (cards and the grouped nav), which this replaces for the nav card.++## 1. Context++The grouped nav of ADR 422 listed every page at once: a title row with the style chooser, then a row per group, nine rows in a bordered card at 100 columns. It was complete but long, and finding a page meant reading all of it.++## 2. Decision++The nav card is two or three rows.++- **Row 1:** `[0: π MAIN]`, the five groups (SWARM, MIND, SAFETY, NETWORK, TOOLS) with the open page's group marked `[MIND βΎ]`, and a π search field. Group icons appear only on a wide dock. Where the search field does not fit on the row (below about 100 columns) it takes its own row.+- **Row 2 (and 3):** only the pages of the open group, as `[k: π NAME]` with the open page marked; a group of nine is two rows. Names are spelled as wide as the row allows (full, then short, then icons), or as the person's Settings choice.+- **Groups.** Clicking a group chip shows that group's pages while the page stays open (`navPick`, tied to the page it was made on: once the page changes the nav follows the page's own group again).+- **Search.** Words typed in the field list the pages whose name, group or description holds every word, names first, at most twelve, with a count ("3 found for βlabβ") and a β to clear; one match opens that page; no match says so.+- **Hotkeys are unchanged and global.** A page's number or letter is the one it had in the flat tab bar and works from every page: the pages that are not showing are in the card as hidden buttons (`display: none`), which the engine still arms.+- **Nav style** (auto, icons, brief, full) moved off the card to Settings, where it already was a choice, so the card has no chooser row. `auto` picks the richest form that fits the rows it is showing.+- The flat tab bar stays for compact inline panes and the narrow layout.++## 3. Alternatives considered++- **Hiding the hidden pages' hotkeys with their buttons.** Rejected: number keys that stop working from another group's page would be a regression for people who navigate by key.+- **One flat row of 26 icons.** Rejected: that is the old bar, which hid most pages behind the menu.+- **Search that filters live as you type.** Deferred: the field submits on Enter; live filtering needs a change event the pane's Input does not give.++## 4. Consequences++The nav went from nine rows to three at 100 columns (four at 80), so a page starts higher on screen. Every page is at most a group click, a search, or a key away. The search is also how someone who does not know the group names finds a page.++## 5. Tests++- `tests/nav-state.spec.ts` (pure): the group of a page and the group shown (a pick holds only on its page; an agent drill-down keeps its source page's group); at most six pages a row; the search finds by name, group or description, needs every word, ranks names first, never lists the menu; the actions (a group pick, a one-match search opening its page, clear).+- `tests/nav.test.ts` (kit): the five group chips and the Main button are there, the open group is marked, every page including the other groups' is a button, a chip shows another group's pages, the search lists matches with a clear button and says when none match.+- Live: from Swarm, `7` opened Learning and `b` opened Hive-Mind though neither was showing, in the real Claude Code UI; the live smoke draws all 27 pages.