π 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.23.0 β cards, a grouped nav, asks that stay on their page, ADR-422
ruv5908d7fc4f87
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex 2cb6cffc0d..a779baae7b 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.22.0",+ "version": "0.23.0","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/hooks/gfx/boot.ts b/plugins/ruflo-console/hooks/gfx/boot.tsindex 8fd9514530..8324da5ecd 100644--- a/plugins/ruflo-console/hooks/gfx/boot.ts+++ b/plugins/ruflo-console/hooks/gfx/boot.ts@@ -41,6 +41,7 @@ export const BOOT_MODULES: readonly { name: string; note: string }[] = [{ name: 'x.ruv.io', note: 'swarm board, AgentBBS rooms' },{ name: 'Plugins & Mods', note: 'every ruflo plugin mapped' },{ name: 'Skills', note: 'find, add, manage' },+ { name: 'Plugin Catalog', note: 'every plugin, mod and skill' },{ name: 'Dev Tools', note: 'ADRs, SPARC, tests, git, docs' },{ name: 'Cost & Budget', note: 'spend, burn, limits' },{ name: 'Timeline', note: 'who was busy, and when' },diff --git a/plugins/ruflo-console/hooks/runner.ts b/plugins/ruflo-console/hooks/runner.tsindex fd0de7ff93..e1784327ed 100644--- a/plugins/ruflo-console/hooks/runner.ts+++ b/plugins/ruflo-console/hooks/runner.ts@@ -133,7 +133,7 @@ export function createRunner(state: State, host: Host, deps: RunnerDeps): Runner}pendingSpec = spec- state.pending = { ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }) }+ state.pending = { view: state.view, ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }) }host.invalidate()}diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.tsindex b041469037..92ce22b727 100644--- a/plugins/ruflo-console/hooks/state.ts+++ b/plugins/ruflo-console/hooks/state.ts@@ -131,7 +131,7 @@ export function optionsOf(raw: PluginOptions | undefined): Options {}/** A mutating action waiting for the person's second press; `shows` is the command line when it is not a ruflo one. */-export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string }+export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string; /** The page that raised it: the ask shows in full there, and as a pointer on every other page. */ view?: string }/** The MetaHarness lab's last run: what it was, how it exited, its cost note, and its output as lines to scroll. */export type LabResult = { id: string; label: string; ok: boolean; exitCode: number | null; note?: string; lines: string[]; atMs: number }diff --git a/plugins/ruflo-console/hooks/views/card.ts b/plugins/ruflo-console/hooks/views/card.tsnew file mode 100644index 0000000000..e9e1e2aa94--- /dev/null+++ b/plugins/ruflo-console/hooks/views/card.ts@@ -0,0 +1,64 @@+/**+ * Cards: every section of a page (a header from `rule` or `section`, and the rows after it) drawn inside its own bordered box, so+ * the groups of a page are obvious and each one reads as a unit. Done by wrapping the kit's Box: a column that holds section headers+ * is regrouped, the rows before the first header stay as they are, and each header starts a card. The kit it wraps is the attention+ * kit, so a confirm or an answer is still placed inside the card that holds the clicked row, right under it.+ *+ * A card spends two columns on its border and two on its padding: the page is drawn with `columns` narrowed by `CARD_COLUMNS`, so+ * nothing a view clips to its width overflows the frame.+ */+import type { Ctx } from './common'+import { THEME } from './common'+import { HEADS, SPACERS } from './marks'++/** Columns a card takes from the page width: border and padding, both sides. */+export const CARD_COLUMNS = 4++const flat = (children: unknown): unknown[] => (Array.isArray(children) ? children.flatMap(flat) : children === null || children === undefined || typeof children === 'boolean' ? [] : [children])++function holdsHead(children: unknown): boolean {+ if (Array.isArray(children)) return children.some(holdsHead)++ return typeof children === 'object' && children !== null && HEADS.has(children)+}++/** Whether a page of this width and pane is drawn in cards: not in the narrow layout, and not in a compact inline pane (its rows are few). */+export const hasCards = (columns: number, isCompact: boolean): boolean => columns >= 60 && !isCompact++export function withCards(kit: Ctx['kit']): Ctx['kit'] {+ let made = 0++ const Box: Ctx['kit']['Box'] = props => {+ const children = (props as { children?: unknown }).children++ // Most Boxes hold no section header: found without flattening anything.+ if ((props as { flexDirection?: string }).flexDirection !== 'column' || !holdsHead(children)) return kit.Box(props)++ const kids = flat(children)+ const out: unknown[] = []+ let card: unknown[] | null = null+ const close = () => {+ if (card !== null) out.push(kit.Box({ key: `card-${made++}`, flexDirection: 'column', borderStyle: 'round', borderColor: THEME.info, paddingX: 1, children: card as never }))+ card = null+ }++ for (const kid of kids) {+ const isObject = typeof kid === 'object' && kid !== null++ // The blank row a header carries above it is the gap between cards now.+ if (isObject && SPACERS.has(kid)) continue++ if (isObject && HEADS.has(kid)) {+ close()+ card = [kid]+ } else if (card !== null) card.push(kid)+ else out.push(kid)+ }++ close()++ return kit.Box({ ...props, children: out as never })+ }++ return { ...kit, Box }+}diff --git a/plugins/ruflo-console/hooks/views/common.ts b/plugins/ruflo-console/hooks/views/common.tsindex cb8f1a061a..6550f969f5 100644--- a/plugins/ruflo-console/hooks/views/common.ts+++ b/plugins/ruflo-console/hooks/views/common.ts@@ -7,6 +7,7 @@ import type { AskActions } from '../ask-claude'import type { OptimizerActions } from '../optimizer'import type { WatchActions } from '../watch'import type { Attention } from './attention'+import { HEADS, mark as marked } from './marks'import type { LoopActions } from '../loops'import type { Elements, RenderChildren, RenderElement } from 'claude-code'@@ -21,7 +22,7 @@ import type { MemoryActions } from '../memory-lab'import type { SkillActions } from '../skills'import { START_LABEL, type StartId } from '../starts'import type { MoreSkillActions } from '../skills-lab'-import type { HarnessId, NavStyle, State, ViewId } from '../state'+import { VIEWS, type HarnessId, type NavStyle, type State, type ViewId } from '../state'import type { VectorActions } from '../vector'export type Kit = Pick<Elements['terminal'], 'Box' | 'Text' | 'Button'> & { Raster?: Elements['terminal']['Raster']; Input?: Elements['terminal']['Input'] }@@ -107,6 +108,8 @@ export type Ctx = {/** Every picture of this view, by Raster key, already drawn for this frame. */pictures: Map<string, Grid>act: Actions+ /** True while the page is drawn in cards (views/card.ts): a section header then needs no blank row above it. */+ cards?: boolean/** The page's attention panel (views/attention.ts): lab views hand their result rows to it with `slot`. */attention?: Attention}@@ -180,15 +183,18 @@ export function section(ctx: Ctx, id: string, title: string, right: string, chilconst fill = Math.max(1, ctx.columns - head.length - right.length - 2)return [- ...(look === 'bbs' ? [ctx.kit.Text({ children: ' ' })] : []),- row(- ctx,- [- ctx.kit.Button({ key: `sec-${id}`, label: head, plain: true, onPress: () => ctx.act.toggle(key) }),- ctx.kit.Text({ color: THEME.info, dimColor: true, children: `${(look === 'bbs' ? 'β' : 'β').repeat(fill)} ` }),- ctx.kit.Text({ color: THEME.info, children: right }),- ],- `sec-row-${id}`,+ ...(look === 'bbs' && ctx.cards !== true ? [ctx.kit.Text({ children: ' ' })] : []),+ marked(+ HEADS,+ row(+ ctx,+ [+ ctx.kit.Button({ key: `sec-${id}`, label: head, plain: true, onPress: () => ctx.act.toggle(key) }),+ ctx.kit.Text({ color: THEME.info, dimColor: true, children: `${(look === 'bbs' ? 'β' : 'β').repeat(fill)} ` }),+ ctx.kit.Text({ color: THEME.info, children: right }),+ ],+ `sec-row-${id}`,+ ),),...(isOpen ? children : []),]@@ -201,16 +207,15 @@ export function rule(ctx: Ctx, title: string, right = ''): RenderElement {const head = `βββ ${title.toUpperCase()} βββ`const fill = Math.max(1, ctx.columns - head.length - right.length - 2)- // A blank line above each section, so the board breathes instead of packing every block together.- return col(ctx, [- ctx.kit.Text({ children: ' ' }),- row(ctx, [ctx.kit.Text({ bold: true, color: THEME.head, children: head }), ctx.kit.Text({ color: THEME.info, dimColor: true, children: `${'β'.repeat(fill)} ` }), ctx.kit.Text({ color: THEME.info, children: right })]),- ])+ const line = row(ctx, [ctx.kit.Text({ bold: true, color: THEME.head, children: head }), ctx.kit.Text({ color: THEME.info, dimColor: true, children: `${'β'.repeat(fill)} ` }), ctx.kit.Text({ color: THEME.info, children: right })])++ // In a card the header is the card's first row; otherwise a blank line above each section, so the board breathes instead of packing every block together.+ return ctx.cards === true ? marked(HEADS, line) : marked(HEADS, col(ctx, [ctx.kit.Text({ children: ' ' }), line]))}const fill = Math.max(1, ctx.columns - title.length - right.length - 3)- return row(ctx, [ctx.kit.Text({ bold: true, color: THEME.head, children: title }), ctx.kit.Text({ dimColor: true, children: ` ${'β'.repeat(fill)} ` }), ctx.kit.Text({ dimColor: true, children: right })])+ return marked(HEADS, row(ctx, [ctx.kit.Text({ bold: true, color: THEME.head, children: title }), ctx.kit.Text({ dimColor: true, children: ` ${'β'.repeat(fill)} ` }), ctx.kit.Text({ dimColor: true, children: right })]))}/** A label and its value; the value dims when it is n/a. */@@ -291,6 +296,21 @@ export function confirmRow(ctx: Ctx): RenderElement | null {if (pending === null) return null+ // An ask belongs to the page that raised it: anywhere else it is one line, with a way there and a way to drop it.+ if (pending.view !== undefined && pending.view !== ctx.state.view) {+ const where = VIEWS.find(entry => entry.id === pending.view)++ return row(+ ctx,+ [+ text(ctx, `β An ask is waiting on ${where?.label ?? pending.view}: ${clip(pending.label, Math.max(16, ctx.columns - 64))} `, { bold: true, color: THEME.warn }),+ button(ctx, 'confirm-go', 'Go there', () => ctx.act.view(pending.view as ViewId)),+ button(ctx, 'cancel', 'Cancel (n)', ctx.act.cancel, { hotkey: 'n' }),+ ],+ 'confirm',+ )+ }+return col(ctx,[diff --git a/plugins/ruflo-console/hooks/views/frames.ts b/plugins/ruflo-console/hooks/views/frames.tsindex fd7c9b5b4b..d400e8d2ba 100644--- a/plugins/ruflo-console/hooks/views/frames.ts+++ b/plugins/ruflo-console/hooks/views/frames.ts@@ -17,6 +17,7 @@ import type { Grid } from '../gfx/raster'import { PROBES, severityOf } from '../data/cli'import { EXPECTED_IN_MARKET, RUFLO_MARKET } from '../data/snapshot'import { isBooting, isCompactPane, VIEWS, type State } from '../state'+import { CARD_COLUMNS, hasCards } from './card'import { live } from './common'import { hivePictures } from './hive'import { openTasks } from './select'@@ -117,7 +118,8 @@ const scoreShown = new WeakMap<object, number>()export function picturesOf(state: State, columns: number, nowMs: number, t: number): Map<string, Grid> {const pictures = new Map<string, Grid>()- const width = Math.max(20, Math.min(200, columns))+ // A page in cards (views/card.ts) is narrower by the border and padding: its pictures are drawn to that width, by the render and by the frame loop alike.+ const width = Math.max(20, Math.min(200, hasCards(columns, isCompactPane(state)) ? columns - CARD_COLUMNS : columns))const snapshot = state.snapshot// The BBS boot screen owns the pane for its first seconds; nothing else is drawn under it.diff --git a/plugins/ruflo-console/hooks/views/marks.ts b/plugins/ruflo-console/hooks/views/marks.tsnew file mode 100644index 0000000000..b9b59b35bf--- /dev/null+++ b/plugins/ruflo-console/hooks/views/marks.ts@@ -0,0 +1,13 @@+/**+ * Elements the page builders mark as they build them, by identity: a section's header (`rule`, `section`) and the blank spacer drawn+ * above it. The card wrapper (views/card.ts) reads the marks to regroup a column's rows into bordered cards, one per header, without+ * reading anything of the engine's element shapes.+ */+export const HEADS = new WeakSet<object>()+export const SPACERS = new WeakSet<object>()++export function mark<T>(set: WeakSet<object>, element: T): T {+ if (typeof element === 'object' && element !== null) set.add(element)++ return element+}diff --git a/plugins/ruflo-console/hooks/views/nav.ts b/plugins/ruflo-console/hooks/views/nav.tsnew file mode 100644index 0000000000..f9044a2376--- /dev/null+++ b/plugins/ruflo-console/hooks/views/nav.ts@@ -0,0 +1,76 @@+/**+ * 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.+ */+import type { RenderElement } from 'claude-code'++import { NAV_STYLES, VIEWS, type ViewId } from '../state'+import { CARD_COLUMNS } from './card'+import { isBbs, row, 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']] },+]++const LABEL_WIDTH = 9++export function groupedTabs(ctx: Ctx, hasHotkey: (view: (typeof VIEWS)[number]) => boolean): RenderElement {+ const inner = ctx.columns - CARD_COLUMNS+ const style = ctx.state.nav+ const open = ctx.state.view === 'agent' ? ctx.state.back : ctx.state.view+ const 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)++ // The open view names itself whatever the style, as the flat tab bar did: [3: π CLAIMS], [0: π MAIN MENU].+ const prefix = view.key === '' ? '' : `${view.key}: `++ 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)]+ }),+ ],+ }),+ ),+ )++ return ctx.kit.Box({ key: 'tabs', flexDirection: 'column', borderStyle: 'round', borderColor: THEME.info, paddingX: 1, children: [titleRow, ...groups] })+}diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.tsindex 49a027af15..fbce64675b 100644--- a/plugins/ruflo-console/hooks/views/pane.ts+++ b/plugins/ruflo-console/hooks/views/pane.ts@@ -9,6 +9,8 @@ import { HELP } from '../commands'import { slashFor } from '../ask-claude'import { launchRows } from './launch'import { donated, newAttention, panelOf, wrapKit } from './attention'+import { CARD_COLUMNS, hasCards, withCards } from './card'+import { groupedTabs } from './nav'import { optimizerResult } from './optimizer'import { isBooting, isCompactPane, NAV_STYLES, VIEWS, type ViewId } from '../state'import { agentView } from './agent'@@ -115,6 +117,9 @@ function tabs(ctx: Ctx): RenderElement {// The tab bar keeps the keyed views and the core keyless ones; the many other views (labs, tools) are tabs only while// open, and are reached from the main menu (0), where each is listed with its group.const isTab = (view: (typeof VIEWS)[number]) => /^[0-9]$/.test(view.key) || CORE_TABS.has(view.id) || view.id === ctx.state.view || (ctx.state.view === 'agent' && view.id === ctx.state.back)+ // A page in cards leads with the grouped nav card (views/nav.ts) instead of the flat tab rows.+ if (hasCards(ctx.columns, isCompactPane(ctx.state))) return groupedTabs(ctx, isTab)+const line = (views: readonly (typeof VIEWS)[number][], key: string) => ctx.kit.Box({ flexDirection: 'row', gap: 1, key, children: views.filter(isTab).map(tab) })// The first row runs to the last digit-keyed view, so a keyless view sits where VIEWS puts it (Hive-Mind after Swarm).const split = VIEWS.reduce((last, view, i) => (/^[0-9]$/.test(view.key) ? i + 1 : last), 0)@@ -176,7 +181,7 @@ function footer(ctx: Ctx, isPlaced = false): RenderElement {const parts: RenderElement[] = []// Something is waiting for a yes or no: said here, where the keys are, wherever the confirm itself sits.- if (state.pending !== null) parts.push(text(ctx, `β confirm needed: ${clip(state.pending.label, Math.max(20, ctx.columns - 40))} β y yes Β· n cancel${isPlaced ? ' (under what you clicked)' : ''}`, { bold: true, color: THEME.warn }))+ if (state.pending !== null && (state.pending.view === undefined || state.pending.view === state.view)) parts.push(text(ctx, `β confirm needed: ${clip(state.pending.label, Math.max(20, ctx.columns - 40))} β y yes Β· n cancel${isPlaced ? ' (under what you clicked)' : ''}`, { bold: true, color: THEME.warn }))if (outcome !== null && nowMs - outcome.atMs < 90_000) {parts.push(@@ -273,18 +278,21 @@ export function paneView(base: Ctx): RenderElement {? col(ctx, [ctx.kit.Raster(boot.toRaster('boot'))], 'boot'): col(ctx, [text(ctx, 'CONNECT 115200 Β· RUFLO AGENT SWARM CONSOLE Β· loadingβ¦', { bold: true, color: THEME.head })], 'boot')}- const drawBody = () => (ctx.state.palette.isOpen ? paletteView(ctx) : ctx.state.isHelp ? help(ctx) : BODIES[ctx.state.view](ctx))+ // A section of a page is a bordered card (views/card.ts): the body is drawn narrower by the border and padding, through a kit that groups its rows.+ const cardsOn = hasCards(base.columns, isCompactPane(base.state)) && !ctx.state.palette.isOpen && !ctx.state.isHelp+ const bodyCtx: Ctx = cardsOn ? { ...ctx, columns: ctx.columns - CARD_COLUMNS, cards: true, kit: withCards(ctx.kit) } : ctx+ const drawBody = () => (ctx.state.palette.isOpen ? paletteView(ctx) : ctx.state.isHelp ? help(ctx) : BODIES[ctx.state.view](bodyCtx))// A lab's result block is drawn first into the panel (pass one), then the page is drawn with the panel placed under the clicked row.if (ctx.state.origin !== null && (ctx.state.lab.result !== null || ctx.state.lab.running !== null)) {attention.donated = donated(ctx, () => {attention.mode = 'collect'- RESULT_OF[ctx.state.view]?.(ctx)+ RESULT_OF[ctx.state.view]?.(bodyCtx)return [...attention.donated]})}- if (ctx.state.origin !== null) attention.panel = panelOf(base, attention.donated)+ if (ctx.state.origin !== null) attention.panel = panelOf(cardsOn ? { ...base, columns: base.columns - CARD_COLUMNS } : base, attention.donated)attention.mode = attention.donated.length > 0 ? 'hide' : 'draw'let body = drawBody()@@ -300,7 +308,7 @@ export function paneView(base: Ctx): RenderElement {// Every section ends with its Launch section: the commands of the plugins it owns, run in the Claude UI. Drawn through the same kit, so// a launch ask is placed under its own row when nothing above held the origin.- const launch = ctx.state.palette.isOpen || ctx.state.isHelp ? [] : launchRows(ctx)+ const launch = ctx.state.palette.isOpen || ctx.state.isHelp ? [] : launchRows(bodyCtx)if (launch.length > 0) body = col(ctx, [body, ...launch], 'body')@@ -322,7 +330,7 @@ export function paneView(base: Ctx): RenderElement {? [tabs(ctx), ...bbs.art, ...(about !== null ? [about] : []), ...(confirm !== null && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), footer(ctx, attention.placed), body]: !isMenu && isBbs()? // Every page but the main menu leads with its own title and purpose line; the welcome line and network links follow, with a blank row between the blocks.- [...bbs.art, ...(about !== null ? [about] : []), ...gap, ...bbs.strip, ...gap, tabs(ctx), ...gap, footer(ctx, attention.placed), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : [])]+ [...bbs.art, ...(about !== null ? [about] : []), ...(cardsOn ? [] : [...gap, ...bbs.strip, ...gap]), tabs(ctx), ...(cardsOn ? [] : gap), footer(ctx, attention.placed), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : [])]: [...title, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...bbs.strip, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...gap, tabs(ctx), ...gap, ...(isMenu && isBbs() ? [] : [...bbs.art, ...(about !== null ? [about] : [])]), ...gap, ...(isMenu ? [] : [footer(ctx, attention.placed)]), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : []), ...gap, ...(isMenu ? [footer(ctx, attention.placed)] : [])]return ctx.kit.Box({ flexDirection: 'column', children: parts })diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex 67134155d0..eed7bbfa46 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.22.0"+step "1. plugin.json declares ruflo-console 0.23.0"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.22.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.23.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.tsnew file mode 100644index 0000000000..1610a8f7f8--- /dev/null+++ b/plugins/ruflo-console/tests/card.spec.ts@@ -0,0 +1,70 @@+/**+ * Cards and the grouped nav, pure: a column that holds section headers is regrouped into one bordered card per header, the blank+ * spacer above a header is dropped, a column with no header is left alone, and every view but the menu is in exactly one nav group.+ * Run with+ * npx vitest run plugins/ruflo-console/tests/card.spec.ts+ */+import { describe, expect, it } from 'vitest'++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'++type Made = { type: string; props: { key?: string; flexDirection?: string; borderStyle?: string; children?: unknown[] } }++const kit = { Box: (props: Made['props']) => ({ type: 'Box', props }) as unknown as never, Text: (props: { children: string }) => ({ type: 'Text', props }) as never, Button: (props: object) => ({ type: 'Button', props }) as never }+const cards = withCards(kit as never)+const made = (element: unknown) => element as Made+const text = (children: string) => kit.Text({ children })++describe('cards', () => {+ it('groups the rows of a column into one bordered card per section header', () => {+ const intro = text('intro')+ const headA = mark(HEADS, text('A'))+ const rowA = text('row a')+ const spacer = mark(SPACERS, text(' '))+ const headB = mark(HEADS, text('B'))+ const rowB = text('row b')+ const page = made(cards.Box({ flexDirection: 'column', key: 'page', children: [intro, headA, rowA, spacer, headB, [rowB]] } as never))+ const [first, second, third] = page.props.children as Made[]++ expect(page.props.key).toBe('page')+ expect(page.props.children).toHaveLength(3)+ expect(first).toBe(intro)+ expect(second?.props).toMatchObject({ flexDirection: 'column', borderStyle: 'round' })+ expect(second?.props.children).toEqual([headA, rowA])+ expect(third?.props.children).toEqual([headB, rowB])+ expect(second?.props.key).not.toBe(third?.props.key)+ })++ it('leaves a column with no header, and a row, exactly as it was', () => {+ const plain = { flexDirection: 'column', children: [text('a'), text('b')] }+ const row = { flexDirection: 'row', children: [mark(HEADS, text('A')), text('x')] }++ expect(made(cards.Box(plain as never)).props).toEqual(plain)+ expect(made(cards.Box(row as never)).props).toEqual(row)+ })++ it('draws cards only in a page wide enough, and not in a compact pane', () => {+ expect(hasCards(100, false)).toBe(true)+ expect(hasCards(59, false)).toBe(false)+ expect(hasCards(100, true)).toBe(false)+ expect(CARD_COLUMNS).toBe(4)+ })+})++describe('the grouped nav', () => {+ it('has every view but the menu in exactly one group', () => {+ const grouped = NAV_GROUPS.flatMap(group => group.rows.flat())+ const expected = VIEWS.filter(view => view.id !== 'menu').map(view => view.id)++ expect([...grouped].sort()).toEqual([...expected].sort())+ expect(new Set(grouped).size).toBe(grouped.length)+ })++ it('has one boot-log line for every view but the menu, so the boot never leaves an area out', () => {+ expect(BOOT_MODULES).toHaveLength(VIEWS.filter(view => view.id !== 'menu').length)+ })+})diff --git a/plugins/ruflo-console/tests/learning.test.ts b/plugins/ruflo-console/tests/learning.test.tsindex db07e7032c..842f45a9e4 100644--- a/plugins/ruflo-console/tests/learning.test.ts+++ b/plugins/ruflo-console/tests/learning.test.ts@@ -38,7 +38,7 @@ describe('learning page', () => {const seen = new Set<string>()const mark = (text: string) => /β ([A-Z]+)/.exec(text)?.[1]- for (let i = 0; i < 4; i++) {+ for (let i = 0; i < 6 && seen.size < 2; i++) {await new Promise(resolve => setTimeout(resolve, 400))await pane.press({ key: 'sec-learn-config' })diff --git a/plugins/ruflo-console/tests/missions.test.ts b/plugins/ruflo-console/tests/missions.test.tsindex 76f65802e1..cd84a9db5d 100644--- a/plugins/ruflo-console/tests/missions.test.ts+++ b/plugins/ruflo-console/tests/missions.test.ts@@ -159,6 +159,30 @@ describe('mission control', () => {await pane.unmount()})+ test('an ask stays on the page that raised it: elsewhere it is one line with a way back, and the full confirm returns with the page', { options: { boot: false } }, async ($, on) => {+ const { pane } = await opened($, on)++ await pane.input({ key: 'mc-goal', text: 'add a dark mode toggle to settings', kind: 'submit' })+ await pane.press({ key: 'mc-create' })+ expect(textOf(await pane.drawn())).toContain('CONFIRM NEEDED')++ // On another page: one line naming the page, a way there, and cancel; no Yes button to press by mistake.+ await pane.press({ key: 'tab-swarm' })++ const away = await pane.drawn()++ expect(textOf(away)).toContain('An ask is waiting on Missions')+ expect(textOf(away)).not.toContain('CONFIRM NEEDED')+ expect(elementsOf(away, 'Button').map(keyOf)).toEqual(expect.arrayContaining(['confirm-go', 'cancel']))+ expect(elementsOf(away, 'Button').map(keyOf)).not.toContain('confirm')++ // The nav is grouped, one row per group of the main menu, and every page is a click away.+ expect(textOf(away)).toMatch(/SWARM[\s\S]*MIND[\s\S]*SAFETY[\s\S]*NETWORK[\s\S]*TOOLS/)+ await pane.press({ key: 'confirm-go' })+ expect(textOf(await pane.drawn())).toContain('CONFIRM NEEDED')+ await pane.unmount()+ })+test('guide Claude asks under its own field, keeps what was sent so β edit can reload it, and ruflo-goals skills show as mission options with the unavailable ones marked', { options: { boot: false } }, async ($, on) => {const { world, pane, clock } = await opened($, on, RUFLO_FILES, { commands: ['ruflo-goals:goal-plan'] })diff --git a/plugins/ruflo-console/tests/skills-secure.test.ts b/plugins/ruflo-console/tests/skills-secure.test.tsindex 25eb5412fd..53a04182d5 100644--- a/plugins/ruflo-console/tests/skills-secure.test.ts+++ b/plugins/ruflo-console/tests/skills-secure.test.ts@@ -31,7 +31,7 @@ describe('skills, security and performance', () => {mock.clock(on)await $.session.start(SESSION)- const { text, tree } = await drawn($, 'skills')+ const { text, tree } = await drawn($, 'skills', 120)expect(text).toContain('INSTALLED')expect(text).toContain('SEARCH')diff --git a/v3/docs/adr/ADR-422-console-cards-grouped-nav-and-page-scoped-asks.md b/v3/docs/adr/ADR-422-console-cards-grouped-nav-and-page-scoped-asks.mdnew file mode 100644index 0000000000..31252f5671--- /dev/null+++ b/v3/docs/adr/ADR-422-console-cards-grouped-nav-and-page-scoped-asks.md@@ -0,0 +1,47 @@+# ADR 422: Cards, a grouped nav, and asks that stay on their page++Status: Accepted (ships in ruflo-console 0.23.0)++Date: 2026 10 03++Decision owner: Ruflo maintainers++Scope: `plugins/ruflo-console`: `hooks/views/card.ts`, `hooks/views/marks.ts`, `hooks/views/nav.ts`, `hooks/views/common.ts` (`rule`, `section`, `confirmRow`), `hooks/views/pane.ts`, `hooks/views/frames.ts`, `hooks/runner.ts`, `hooks/state.ts` (`Pending.view`), `tests/card.spec.ts`, `tests/missions.test.ts`.++Extends: ADR 407, ADR 412 (answers open where they were asked). Companion to ADR 421 (the boot screen).++## 1. Context++A page was a long column of rows with a ruled heading between its sections. Where one section ended and the next began was a thin line; the flat tab bar listed some views by icon and hid the rest behind the main menu; and an ask raised on one page (for example Mission Control's "ask claude -p for guidance") was drawn in full on every page you moved to, above the content, with a Yes button that answered a question you were no longer looking at.++## 2. Decision++**Cards.** Every section of a page, its header and the rows after it, is drawn in its own rounded, bordered box, so the groups of a page are obvious and a page reads as a short stack of units.+- Views are unchanged: `rule` and `section` mark the header elements they build (by identity, in `views/marks.ts`), and a wrapper around the kit's Box (`withCards`, `views/card.ts`) regroups any column that holds headers into one card per header. The wrapper sits inside the attention kit (ADR 412), so a confirm or an answer is still placed inside the card that holds the clicked row, right under it.+- A card spends two columns on its border and two on its padding. The page is drawn with `columns` narrowed by `CARD_COLUMNS` (4), and pictures are drawn to that width (`picturesOf`), by the render and by the frame loop alike, so nothing a view clips to its width overflows the frame.+- Cards are drawn when the page is at least 60 columns wide and the pane is not a compact inline one (its few rows go to content), and not in the plain-text dump (`/ruflo dump`).+- The welcome strip and the gaps above the nav are dropped from pages in cards (they stay on the main menu); the rows go to the nav.++**A grouped nav.** In cards the flat tab bar is one bordered NAV card with a row per group of the main menu (Swarm, Mind, Safety, Network, Tools), every view a button with its hotkey and the open one marked.+- Every view is a click from every page. A hotkey is given only to the views that had one in the flat bar, so no new key can collide with a page's own.+- Big groups are split into rows of at most six, so names stay readable: `auto` spells the richest form (full names, then short names, then icons) whose widest row fits the page; `icons`, `brief` and `full` still force a form.++**Asks stay on their page.** A pending ask records the page that raised it (`Pending.view`). There it is drawn in full as before. On any other page it is one line, "An ask is waiting on Missions: β¦", with **Go there** and **Cancel (n)**, and no Yes button; the footer says nothing twice. Headless `/ruflo yes` and `/ruflo no` are unchanged.++**Boot log completeness.** The boot log (ADR 421) has one line for every view but the menu (it was missing the Plugin Catalog); a spec keeps it so.++## 3. Alternatives considered++- **Converting each view's `rule` calls to a `card()` call.** Rejected: 112 call sites in 30 files and every one a chance to break a confirm's placement; marking the headers changes two functions.+- **Wrapping the finished body after it is built.** Rejected: it would read the engine's element shapes and run after the attention kit placed its panel, so a confirm could land outside its card.+- **Giving every view a hotkey in the nav.** Rejected: letters like `d`, `s` and `f` are already a page's own keys.++## 4. Consequences++Pages are taller by two rows per card; a docked cockpit (the full terminal height) absorbs that, and a compact inline pane keeps its plain layout. The nav is five to seven rows instead of three, paid for by the dropped welcome strip. An ask raised on one page and forgotten is a one-line reminder everywhere else, not a question that follows you.++## 5. Tests++- `tests/card.spec.ts` (pure): a column of headers is regrouped into one bordered card per header, the spacer above a header is dropped, a column with none is left as it was, cards only where the width and pane allow, every view but the menu is in exactly one nav group, and the boot log has a line for every view but the menu.+- `tests/missions.test.ts` (kit): an ask raised on Missions shows in full there, as a one-line pointer with Go there and Cancel on Swarm, and in full again after Go there; the nav groups are on the page.+- The existing kit and live-smoke suites pass with cards on (every view draws, every button sweep runs), including the animation frame loop, which caught a width mismatch while this was built.