🌊 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): fewer menu sub-sections; scroll the pane to the top when a page, help or the palette opens (ADR-430)
ruv3cd6cb78821b
diff --git a/plugins/ruflo-console/hooks/bindings.ts b/plugins/ruflo-console/hooks/bindings.tsindex 7439687eeb..2c3a6bb5f1 100644--- a/plugins/ruflo-console/hooks/bindings.ts+++ b/plugins/ruflo-console/hooks/bindings.ts@@ -135,6 +135,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Stepsstate.isHelp = !state.isHelp// Help opens on the guide for the page you were on (the index from the menu), with a clean question.if (state.isHelp) {+ host.scrollTop()state.help.query = ''state.help.topic = VIEW_TOPIC[state.view === 'agent' ? state.back : state.view] ?? null}@@ -181,6 +182,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Stepspalette: context => {state.palette = { isOpen: !state.palette.isOpen || state.palette.context !== context, query: '', index: 0, context }state.isHelp = false+ if (state.palette.isOpen) host.scrollTop()host.invalidate()},paletteQuery: text => {diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.tsindex e47d8ee9be..9c5f93c697 100644--- a/plugins/ruflo-console/hooks/controller.ts+++ b/plugins/ruflo-console/hooks/controller.ts@@ -421,6 +421,7 @@ export function createController(state: State, host: Host): Controller {// A new view asks for its own height inline; the dock ignores it.if (state.pane.isOpen) void host.openPane({ id: PANE_ID, title: 'ruflo', rows: rowsOf(view), ...(state.dockColumns > 0 && { columns: state.dockColumns }) }).catch(() => undefined)void probe(true)+ host.scrollTop()}host.invalidate()diff --git a/plugins/ruflo-console/hooks/host.ts b/plugins/ruflo-console/hooks/host.tsindex 0771452ae2..dcde03087d 100644--- a/plugins/ruflo-console/hooks/host.ts+++ b/plugins/ruflo-console/hooks/host.ts@@ -24,6 +24,8 @@ export type Host = {/** A short note over the transcript's corner; it leaves the transcript and the model untouched. */toast: (text: string, timeoutMs?: number) => voidinvalidate: () => void+ /** Scrolls the pane back to its first row: a page that was switched to (or opened over this one) starts at its top, not where the last one was left. */+ scrollTop: () => void/** Moves a pane's focus ring onto an element it drew (a field), while the pane holds the keys. */focus: (paneId: string, key: string) => Promise<unknown>/** Fire and forget: a blit resolves only once painted, and blits between frames fold anyway. */diff --git a/plugins/ruflo-console/hooks/register.ts b/plugins/ruflo-console/hooks/register.tsindex e20e5ae5a8..924b3df7bf 100644--- a/plugins/ruflo-console/hooks/register.ts+++ b/plugins/ruflo-console/hooks/register.ts@@ -26,6 +26,9 @@ const RUFLO_TOOL = /^mcp__(claude-flow|ruflo|plugin_ruflo[\w-]*)__/* Binds a Host from `$`, every member spelled `$.noun.method(...)` here and nowhere else, so the engine reads what* the module calls off this one place. Calls that answer nothing are wrapped: a refused draw is not a crashed hook.*/+/** True while the console itself scrolls the pane to its top, so the terminal's own wheel handling does not take that for the person's wheel. */+let isResettingScroll = false+function hostOf($: EngineInterface, cwd: string): Host {const rooted = (path: string) => (path.startsWith('/') ? path : `${cwd.replace(/\/+$/, '')}/${path}`)const quietly = (fn: () => unknown) => {@@ -52,6 +55,20 @@ function hostOf($: EngineInterface, cwd: string): Host {askChoice: async (question, options) => $.ui.ask(question, options),toast: (text, timeoutMs) => quietly(() => $.ui.toast(text, timeoutMs === undefined ? undefined : { timeoutMs })),invalidate: () => quietly(() => $.ui.invalidate('ui.render')),+ // Once now and once after the new page has drawn: a page taller than the one before keeps the old offset until it is moved.+ scrollTop: () => {+ const go = () =>+ quietly(() => {+ isResettingScroll = true++ return Promise.resolve($.ui.scroll({ to: 'start', in: PANE_ID })).finally(() => {+ isResettingScroll = false+ })+ })++ go()+ $.clock.after(80, go)+ },focus: async (paneId, key) => $.ui.focus({ requestId: paneId, key }),blit: args => quietly(() => $.ui.blit(args)),openPane: async pane => $.ui.open(pane),@@ -255,7 +272,7 @@ export const register: Register = (on, raw: PluginOptions) => {// The AI terminal's conversation is its own window: the wheel and the page keys over the pane move it, so the header,// tabs and the field below stay where they are (the engine would scroll the whole pane).on('ui.scroll', { component: 'Pane', requestId: PANE_ID }, ($, e, next) => {- if (control === null || state.view !== 'terminal' || e.by === 0) return next(e)+ if (control === null || state.view !== 'terminal' || e.by === 0 || isResettingScroll) return next(e)const lines = Math.abs(e.by) >= e.bodyRows ? Math.max(1, Math.round(e.bodyRows / 2)) : Math.abs(e.by) * 3diff --git a/plugins/ruflo-console/hooks/views/menu.ts b/plugins/ruflo-console/hooks/views/menu.tsindex de610a603f..152254496f 100644--- a/plugins/ruflo-console/hooks/views/menu.ts+++ b/plugins/ruflo-console/hooks/views/menu.ts@@ -16,48 +16,40 @@ const COMMAND_KEYS: Record<string, string> = { palette: 'p', help: 'h', close: 'const keyOf = (item: Item): string => COMMAND_KEYS[item.go] ?? VIEWS.find(view => view.id === item.go)?.key ?? '·'/**- * The board's menus: four groups, each split into short sub-sections, the way the old BBS main menus grouped their- * commands. Keys are the pane's own hotkeys; an area without one (`·`) is reached by its name at the prompt. An+ * The board's menus: five groups, each split into a few sub-sections where the split says something (SWARM: start here, coordinate,+ * observe), the way the old BBS main menus grouped their commands. A group with one section draws no rule: its name would only repeat the group's. Keys are the pane's own hotkeys; an area without one (`·`) is reached by its name at the prompt. An* entry for a view this build does not have is left out.*/export const GROUPS: readonly { title: string; sections: readonly { name: string; items: readonly Item[] }[] }[] = [{title: 'SWARM',sections: [- { name: 'mission', items: [{ label: 'Missions', go: 'missions' }] },- { name: 'live', items: [{ label: 'Overview', go: 'overview' }, { label: 'Swarm Topology', go: 'swarm' }, { label: 'Hive-Mind', go: 'hive' }] },- { name: 'work', items: [{ label: 'Claims Board', go: 'claims' }, { label: 'Approvals', go: 'approvals' }, { label: 'Automation', go: 'automate' }] },- { name: 'watch', items: [{ label: 'Agent Timeline', go: 'timeline' }, { label: 'Event Stream', go: 'events' }] },+ { name: 'start here', items: [{ label: 'Missions', go: 'missions' }, { label: 'Overview', go: 'overview' }, { label: 'Swarm Topology', go: 'swarm' }] },+ { name: 'coordinate', items: [{ label: 'Hive-Mind', go: 'hive' }, { label: 'Claims Board', go: 'claims' }, { label: 'Approvals', go: 'approvals' }, { label: 'Automation', go: 'automate' }] },+ { name: 'observe', items: [{ label: 'Agent Timeline', go: 'timeline' }, { label: 'Event Stream', go: 'events' }] },],},{title: 'INTELLIGENCE',sections: [{ name: 'learn', items: [{ label: 'Learning', go: 'learning' }, { label: 'Neural', go: 'neural' }, { label: 'MetaHarness', go: 'metaharness' }, { label: 'Self-Evolution', go: 'evolve' }] },- { name: 'remember', items: [{ label: 'Memory Lab', go: 'memory' }, { label: 'Vector Lab', go: 'vector' }] },- { name: 'spend', items: [{ label: 'Cost & Budget', go: 'cost' }, { label: 'Performance', go: 'perf' }] },+ { name: 'data & spend', items: [{ label: 'Memory Lab', go: 'memory' }, { label: 'Vector Lab', go: 'vector' }, { label: 'Cost & Budget', go: 'cost' }, { label: 'Performance', go: 'perf' }] },],},{title: 'SAFETY & OPS',- sections: [- { name: 'protect', items: [{ label: 'Security & Doctor', go: 'secure' }] },- { name: 'build', items: [{ label: 'Dev Tools', go: 'devtools' }] },- ],+ sections: [{ name: 'safety & ops', items: [{ label: 'Security & Doctor', go: 'secure' }, { label: 'Dev Tools', go: 'devtools' }] }],},{title: 'NETWORK & EXTEND',sections: [- { name: 'federate', items: [{ label: 'Federation', go: 'federation' }, { label: 'x.ruv.io Board', go: 'xruv' }] },- { name: 'extend', items: [{ label: 'Plugins & Mods', go: 'plugins' }, { label: 'Skills', go: 'skills' }, { label: 'Plugin Catalog', go: 'market' }] },+ { name: 'network', items: [{ label: 'Federation', go: 'federation' }, { label: 'x.ruv.io Board', go: 'xruv' }] },+ { name: 'plugins', items: [{ label: 'Plugins & Mods', go: 'plugins' }, { label: 'Skills', go: 'skills' }, { label: 'Plugin Catalog', go: 'market' }] },],},{title: 'TOOLS',- sections: [- { name: 'run', items: [{ label: 'AI Terminal', go: 'terminal' }, { label: 'Settings', go: 'settings' }, { label: 'Command Palette', go: 'palette' }] },- { name: 'session', items: [{ label: 'Help', go: 'help' }, { label: 'Log Off', go: 'close' }] },- ],+ sections: [{ name: 'tools', items: [{ label: 'AI Terminal', go: 'terminal' }, { label: 'Settings', go: 'settings' }, { label: 'Command Palette', go: 'palette' }, { label: 'Help', go: 'help' }, { label: 'Log Off', go: 'close' }] }],},]@@ -133,12 +125,12 @@ export function menuView(ctx: Ctx): RenderElement {: group.sections.flatMap(section => {const items = section.items.filter(isShown)- if (entry !== null && !started) return items.length === 0 ? [] : [ctx.kit.Text({ children: ' ' }), ...items.map(item => ctx.kit.Box({ key: `mi-${item.go}`, children: [ctx.kit.Text({ children: ' ' })] }))]+ if (entry !== null && !started) return items.length === 0 ? [] : [...(group.sections.length === 1 ? [] : [ctx.kit.Text({ children: ' ' })]), ...items.map(item => ctx.kit.Box({ key: `mi-${item.go}`, children: [ctx.kit.Text({ children: ' ' })] }))]return items.length === 0? []: [- ctx.kit.Text({ color: THEME.info, dimColor: true, wrap: 'truncate-end', children: clip(`── ${section.name} ${'─'.repeat(Math.max(0, width - section.name.length - 8))}`, width - 4) }),+ ...(group.sections.length === 1 ? [] : [ctx.kit.Text({ color: THEME.info, dimColor: true, wrap: 'truncate-end', children: clip(`── ${section.name} ${'─'.repeat(Math.max(0, width - section.name.length - 8))}`, width - 4) })]),...items.map(item => {const badge = badges[item.go as ViewId]const key = keyOf(item)diff --git a/plugins/ruflo-console/tests/menu-wrap.spec.ts b/plugins/ruflo-console/tests/menu-wrap.spec.tsindex 43e55fc5e1..c9533c0783 100644--- a/plugins/ruflo-console/tests/menu-wrap.spec.ts+++ b/plugins/ruflo-console/tests/menu-wrap.spec.ts@@ -218,3 +218,40 @@ describe('the menu folds, and narrow panes keep their styling', () => {expect(chip?.props.color).toMatch(/^#/)})})++describe('the menu\'s sub-sections', () => {+ const pages = GROUPS.flatMap(group => group.sections.flatMap(section => section.items.map(item => item.go)))++ const flat = (el: unknown): El[] => {+ const node = el as El++ if (typeof node !== 'object' || node === null) return []++ const kids = node.props.children++ return [node, ...(Array.isArray(kids) ? kids.flatMap(flat) : typeof kids === 'object' ? flat(kids) : [])]+ }++ it('list every page once: nothing repeats across the cards', () => {+ expect(new Set(pages).size).toBe(pages.length)+ for (const key of ['overview', 'missions', 'swarm', 'settings']) expect(pages, key).toContain(key)+ })++ it('earn their rule: a card with one section has no rule of its own, and a card with several has at least two entries in each', () => {+ for (const group of GROUPS) {+ if (group.sections.length > 1) for (const section of group.sections) expect(section.items.length, `${group.title}/${section.name}`).toBeGreaterThanOrEqual(2)+ }++ const state = newState({})++ state.options.look = 'bbs'+ state.view = 'menu'+ setLook('bbs')++ const tree = menuView({ kit, state, nowMs: 5_000, columns: 100, pictures: new Map(), act, cards: false } as unknown as Ctx) as unknown as El+ const rules = flat(tree).filter(node => typeof node.props.children === 'string' && node.props.children.startsWith('── '))+ const wanted = GROUPS.filter(group => group.sections.length > 1).reduce((sum, group) => sum + group.sections.length, 0)++ expect(rules.length).toBe(wanted)+ })+})diff --git a/plugins/ruflo-console/tests/scroll-top.spec.ts b/plugins/ruflo-console/tests/scroll-top.spec.tsnew file mode 100644index 0000000000..2d3341414a--- /dev/null+++ b/plugins/ruflo-console/tests/scroll-top.spec.ts@@ -0,0 +1,74 @@+/**+ * Scroll to the top after a page change: switching to another page, and opening help over a page, move the pane back to its first row+ * (the host's `scrollTop`); re-pressing the page you are on does not. Run with+ * npx vitest run plugins/ruflo-console/tests/scroll-top.spec.ts+ */+import { describe, expect, it } from 'vitest'++import { createController } from '../hooks/controller'+import type { Host } from '../hooks/host'+import { newState } from '../hooks/state'++/** A host that answers every call with an empty promise, and counts the scrolls. */+function fakeHost(): { host: Host; scrolls: { count: number } } {+ const scrolls = { count: 0 }+ const host = new Proxy(+ {},+ {+ get: (_target, key) => {+ if (key === 'scrollTop') return () => void (scrolls.count += 1)+ if (key === 'after' || key === 'every') return () => ({ cancel: () => undefined })+ if (key === 'pluginRoot') return '/plugin'+ if (key === 'fs') return { read: async () => Promise.reject(new Error('ENOENT')), stat: async () => Promise.reject(new Error('ENOENT')), list: async () => Promise.reject(new Error('ENOENT')) }++ return () => Promise.resolve(undefined)+ },+ },+ ) as unknown as Host++ return { host, scrolls }+}++describe('scroll to the top', () => {+ it('scrolls the pane to its top when another page is switched to, and not when the same page is pressed again', () => {+ const state = newState({})+ const { host, scrolls } = fakeHost()+ const control = createController(state, host)++ state.view = 'overview'+ control.setView('swarm')+ expect(scrolls.count).toBe(1)+ expect(state.view).toBe('swarm')++ control.setView('swarm')+ expect(scrolls.count).toBe(1)++ control.setView('claims')+ expect(scrolls.count).toBe(2)+ })++ it('scrolls to the top when the palette opens, and not when it closes', () => {+ const state = newState({})+ const { host, scrolls } = fakeHost()+ const control = createController(state, host)++ control.actions.palette('all')+ expect(scrolls.count).toBe(1)+ control.actions.palette('all')+ expect(scrolls.count).toBe(1)+ })++ it('scrolls to the top when help opens over a page, and not when it closes', () => {+ const state = newState({})+ const { host, scrolls } = fakeHost()+ const control = createController(state, host)++ control.actions.help()+ expect(state.isHelp).toBe(true)+ expect(scrolls.count).toBe(1)++ control.actions.help()+ expect(state.isHelp).toBe(false)+ expect(scrolls.count).toBe(1)+ })+})diff --git a/v3/docs/adr/ADR-430-console-menu-design.md b/v3/docs/adr/ADR-430-console-menu-design.mdindex 65b6551b0a..2b5a2ca2af 100644--- a/v3/docs/adr/ADR-430-console-menu-design.md+++ b/v3/docs/adr/ADR-430-console-menu-design.md@@ -4,3 +4,8 @@- **Cards and the nav card down to 44 columns, in a short pane too.** They were drawn only from 60 columns and never in a compact (short inline) pane, so a smaller pane fell back to the flat tab rows with the style buttons and lost the accents. They now draw from 44 columns (`MIN_CARD_COLUMNS`), compact or not. Under 44 the one-line nav is a solid chip in the page's group accent. The palette strip stays in a short pane.- **Compact lays out like wide.** The title leads and the tabs follow (they were first). The menu wraps its mission-stage line into lines instead of cutting it at `SOP…`, and its status bar drops the modem text, then clips, before it would pass the edge.- **The menu's groups fold.** Each group's bar has a ▾ / ▸ that hides or shows its entries (a folded group is its bar and an "N entries · ▸ opens" line); a row above the groups opens or closes them all. On a wide pane every group starts open; on a narrow one (a single tall column) only the first does. Specs: no text or row wider than the pane at any width from 30 to 120; every stage readable at every width; the fold defaults and toggles; the nav fits at every width from 44.++## Amendment (2026 10 03): fewer, meaningful sub-sections, and scroll to top++- **Sub-sections that earn their rule.** The five cards had 13 sub-sections, several of one entry that only restated it (`mission` → Missions, `protect` → Security, `build` → Dev Tools). They are now 9: SWARM *start here* (Missions, Overview, Swarm Topology) · *coordinate* · *observe*; INTELLIGENCE *learn* · *data & spend*; NETWORK & EXTEND *network* · *plugins*; and SAFETY & OPS and TOOLS (Settings, the AI terminal, the palette, help, log off) each a single section, which draws no rule at all. Every page is listed once. Specs: each page appears once (and Overview, Missions, Swarm and Settings are there); a card with several sections has two or more entries in each; the rules drawn equal the multi-section cards' sections; a card keeps its height while the entry animation plays.+- **Scroll to top.** Switching pages, opening help and opening the palette scroll the pane back to its first row (`$.ui.scroll({ to: 'start' })`, once at once and once more 80 ms later, so a page taller than the last still lands at its top). The terminal page's own wheel handling ignores that scroll. Pressing the page you are on does not scroll.