Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 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

fix(ruflo-console): every page keeps its banner and title; the terminal field takes the keys (0.6.2)

ruv02d995102b70
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index c7703c9a25..728b154030 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, an x.ruv.io federation board, a second terminal for codex, claude and the ruflo CLI (each run confirmed), 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.6.1",
+ "version": "0.6.2",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/hooks/bindings.ts b/plugins/ruflo-console/hooks/bindings.ts
index d6f7fe0c5b..72b50b5253 100644
--- a/plugins/ruflo-console/hooks/bindings.ts
+++ b/plugins/ruflo-console/hooks/bindings.ts
@@ -9,7 +9,7 @@ import { plain } from './data/parse'
import type { Host } from './host'
import { filterPalette, paletteEntries } from './palette'
import type { Runner } from './runner'
-import { viewOf, type State } from './state'
+import { PANE_ID, viewOf, type State } from './state'
import type { Actions } from './views/common'
import { openTasks, selection } from './views/select'
@@ -128,6 +128,8 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps
harness: id => {
state.terminal.harness = id
host.invalidate()
+ // Pressing the pick moved the focus ring onto its button: give the field the keys back.
+ if (state.pane.isFocused) void host.focus(PANE_ID, 'term-input').catch(() => undefined)
},
draft: text => {
state.terminal.draft = text
diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.ts
index a89b3d4d60..a1f6408ed8 100644
--- a/plugins/ruflo-console/hooks/controller.ts
+++ b/plugins/ruflo-console/hooks/controller.ts
@@ -391,6 +391,13 @@ export function createController(state: State, host: Host): Controller {
}
host.invalidate()
+ // The terminal is for typing: its field takes the keys as it opens, so letters reach it, not the pane's hotkeys.
+ if (view === 'terminal') focusField('term-input')
+ }
+
+ /** Moves the pane's focus ring onto one of its fields; refused (the pane does not hold the keys), nothing happens. */
+ function focusField(key: string): void {
+ if (state.pane.isOpen && state.pane.isFocused) void host.focus(PANE_ID, key).catch(() => undefined)
}
function drill(agentId: string): void {
diff --git a/plugins/ruflo-console/hooks/host.ts b/plugins/ruflo-console/hooks/host.ts
index 471074cd92..493fa6441c 100644
--- a/plugins/ruflo-console/hooks/host.ts
+++ b/plugins/ruflo-console/hooks/host.ts
@@ -18,6 +18,8 @@ export type Host = {
storeGet: (key: string) => Promise<unknown>
storeSet: (key: string, value: unknown) => Promise<void>
invalidate: () => 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. */
blit: (args: UiBlitArgs) => void
openPane: (pane: PaneOpenArgs) => Promise<OpenResult>
diff --git a/plugins/ruflo-console/hooks/register.ts b/plugins/ruflo-console/hooks/register.ts
index b3bf027e82..2965dfce06 100644
--- a/plugins/ruflo-console/hooks/register.ts
+++ b/plugins/ruflo-console/hooks/register.ts
@@ -37,6 +37,7 @@ function hostOf($: EngineInterface, cwd: string): Host {
storeGet: async key => $.store.get(key),
storeSet: async (key, value) => $.store.set(key, value as never),
invalidate: () => quietly(() => $.ui.invalidate('ui.render')),
+ focus: async (paneId, key) => $.ui.focus({ requestId: paneId, key }),
blit: args => quietly(() => $.ui.blit(args)),
openPane: async pane => $.ui.open(pane),
closePane: async id => $.ui.close({ id }),
diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.ts
index d8a0a951ee..b938cc908c 100644
--- a/plugins/ruflo-console/hooks/state.ts
+++ b/plugins/ruflo-console/hooks/state.ts
@@ -21,7 +21,7 @@ export type ViewId = 'menu' | 'overview' | 'swarm' | 'claims' | 'federation' | '
* current tab adds its label, and `blurb` is the one line under the bar that says what the view is for.
*/
export const VIEWS: readonly { id: ViewId; key: string; label: string; short: string; icon: string; blurb: string; rows: number }[] = [
- { id: 'menu', key: '0', label: 'Main Menu', short: 'Mnu', icon: '📟', blurb: 'the board: every area by its key, the line status, and a prompt that takes a key or a name', rows: 40 },
+ { id: 'menu', key: '0', label: 'Main Menu', short: 'Mnu', icon: '📟', blurb: 'the board: every area by its key, the line status, and a prompt that takes a key or a name', rows: 32 },
{ id: 'overview', key: '1', label: 'Overview', short: 'Ovr', icon: '🏠', blurb: 'what ruflo is doing here: subsystems, mods, health alerts and live activity', rows: 26 },
{ id: 'swarm', key: '2', label: 'Swarm', short: 'Swm', icon: '🐝', blurb: 'the swarm as ruflo wrote it: topology, agents at work, and the hive-mind votes', rows: 30 },
{ id: 'claims', key: '3', label: 'Claims', short: 'Clm', icon: '📌', blurb: 'who holds which task: claim, release, hand off or steal, each after a y/n confirm', rows: 30 },
@@ -296,3 +296,9 @@ export function isBooting(state: State, nowMs: number): boolean {
return age >= 0 && age < BOOT_MAX_MS && (age < BOOT_MIN_MS || state.snapshot === null)
}
+
+/**
+ * Compact: an inline pane the layout could not make as tall as the view asks. It drops the banner and moves the
+ * controls up so they stay on screen. A docked pane scrolls, so it always gets the full frame, banner and title.
+ */
+export const isCompactPane = (state: State): boolean => state.pane.placement === 'inline' && state.pane.rows > 0 && state.pane.rows < rowsOf(state.view)
diff --git a/plugins/ruflo-console/hooks/views/frames.ts b/plugins/ruflo-console/hooks/views/frames.ts
index 400ac50b6c..93d26951f9 100644
--- a/plugins/ruflo-console/hooks/views/frames.ts
+++ b/plugins/ruflo-console/hooks/views/frames.ts
@@ -12,11 +12,10 @@ import { pipelinePicture, radarPicture, samplesPicture, trendPicture, gaugePictu
import { flowModelOf, flowPicture, flowRows } from '../gfx/flow'
import { federationPicture, ganttPicture, heatmapPicture, type FedNode, type HealthRow, type Lane } from '../gfx/maps'
import { activityPicture, bannerPicture, bootPicture, titlePicture, curvePicture, headerPicture, PULSE_MS, topologyPicture, type TopoModel } from '../gfx/pictures'
-import { neonPicture } from '../gfx/neon'
import type { Grid } from '../gfx/raster'
import { PROBES, severityOf } from '../data/cli'
import { EXPECTED_IN_MARKET, RUFLO_MARKET } from '../data/snapshot'
-import { isBooting, rowsOf, VIEWS, type State } from '../state'
+import { isBooting, isCompactPane, VIEWS, type State } from '../state'
import { live } from './common'
import { openTasks } from './select'
@@ -126,19 +125,17 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numb
return pictures
}
- if (!(state.pane.rows > 0 && state.pane.rows < rowsOf(state.view))) {
+ if (!isCompactPane(state)) {
const project = state.cwd.split('/').filter(Boolean).at(-1) ?? ''
- // The main menu's neon sign stands in for the banner there.
- if (!(state.options.look === 'bbs' && state.view === 'menu')) pictures.set('header', state.options.look === 'bbs' ? bannerPicture(project, Math.min(width, 72), t) : headerPicture(`◆ ruflo · ${project}`, Math.min(width, 40), t))
- // BBS: each view's name as ANSI-style block art under the tabs.
- if (state.options.look === 'bbs') {
- const name = state.isHelp ? 'help' : state.palette.isOpen ? 'palette' : state.view === 'agent' ? 'agent' : (VIEWS.find(view => view.id === state.view)?.label ?? state.view)
- const isMenu = state.view === 'menu' && !state.isHelp && !state.palette.isOpen
+ pictures.set('header', state.options.look === 'bbs' ? bannerPicture(project, Math.min(width, 72), t) : headerPicture(`◆ ruflo · ${project}`, Math.min(width, 40), t))
+ }
- // The main menu hangs the RuFlo neon sign, lit and still; every other view its name in block art.
- pictures.set('title', isMenu ? neonPicture(width, 0, false) : titlePicture(name, Math.min(width, 80), t))
- }
+ // BBS: every view's name as ANSI-style block art under the tabs, compact or not (the neon sign is the boot's alone).
+ if (state.options.look === 'bbs') {
+ const name = state.isHelp ? 'help' : state.palette.isOpen ? 'palette' : state.view === 'agent' ? 'agent' : state.view === 'menu' ? 'ruflo bbs' : (VIEWS.find(view => view.id === state.view)?.label ?? state.view)
+
+ pictures.set('title', titlePicture(name, Math.min(width, 80), t))
}
switch (state.view) {
diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.ts
index 39e07142e6..c6f33fdf4e 100644
--- a/plugins/ruflo-console/hooks/views/pane.ts
+++ b/plugins/ruflo-console/hooks/views/pane.ts
@@ -6,7 +6,7 @@
import type { RenderElement } from 'claude-code'
import { HELP } from '../commands'
-import { isBooting, rowsOf, VIEWS, type ViewId } from '../state'
+import { isBooting, isCompactPane, VIEWS, type ViewId } from '../state'
import { agentView } from './agent'
import { claimsView } from './claims'
import { ago, button, clip, col, isBbs, row, setLook, text, THEME, type Ctx } from './common'
@@ -209,13 +209,14 @@ export function paneView(ctx: Ctx): RenderElement {
const body = ctx.state.palette.isOpen ? paletteView(ctx) : ctx.state.isHelp ? help(ctx) : BODIES[ctx.state.view](ctx)
const confirm = confirmRow(ctx)
const header = ctx.pictures.get('header')
- const isCompact = ctx.state.pane.rows > 0 && ctx.state.pane.rows < rowsOf(ctx.state.view)
+ const isCompact = isCompactPane(ctx.state)
const title = !isCompact && header !== undefined && ctx.kit.Raster !== undefined ? [ctx.kit.Raster(header.toRaster('header'))] : []
const about = blurb(ctx)
- const bbs = isBbs() && !isCompact ? wildcat(ctx) : { strip: [], art: [] }
+ const bbs = isBbs() ? wildcat(ctx) : { strip: [], art: [] }
const gap = isBbs() && !isCompact ? [text(ctx, ' ')] : []
+ // Compact keeps every page's title and its line of purpose; only the banner and the spacing go.
const parts = isCompact
- ? [tabs(ctx), ...(confirm !== null ? [confirm] : []), footer(ctx), body]
+ ? [tabs(ctx), ...bbs.art, ...(about !== null ? [about] : []), ...(confirm !== null ? [confirm] : []), footer(ctx), body]
: [...title, ...bbs.strip, ...gap, tabs(ctx), ...gap, ...bbs.art, ...(about !== null ? [about] : []), ...gap, body, ...(confirm !== null ? [confirm] : []), ...gap, footer(ctx)]
return ctx.kit.Box({ flexDirection: 'column', children: parts })
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index 8dd0ed1de1..e7e0d9ffb5 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.6.1"
+step "1. plugin.json declares ruflo-console 0.6.2"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.6.1"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.6.2"' "$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/behaviour.test.ts b/plugins/ruflo-console/tests/behaviour.test.ts
index cce9a53203..1dc294cd03 100644
--- a/plugins/ruflo-console/tests/behaviour.test.ts
+++ b/plugins/ruflo-console/tests/behaviour.test.ts
@@ -269,12 +269,27 @@ describe('behaviour', () => {
await $.session.start(SESSION)
await $.command.run(command('claims'))
- const pane = await $.ui.mount({ ...paneAt(98, 12), plugin: PLUGIN })
+ const inline = paneAt(98, 12)
+ const pane = await $.ui.mount({ ...inline, props: { ...inline.props, placement: 'inline' }, plugin: PLUGIN })
const tree = await pane.drawn()
const keys = elementsOf(tree, 'Button').map(keyOf)
expect(keys.indexOf('close')).toBeLessThan(keys.indexOf('claim'))
+ // The banner goes; the page's own title stays.
expect(elementsOf(tree, 'Raster').map(keyOf)).not.toContain('header')
+ expect(elementsOf(tree, 'Raster').map(keyOf)).toContain('title')
+ await pane.unmount()
+ })
+
+ test('a docked pane shorter than the view still draws the banner and the title: it scrolls', { options: { boot: false } }, async ($, on) => {
+ worldOf(on, RUFLO_FILES)
+ mock.clock(on)
+ await $.session.start(SESSION)
+ await $.command.run(command('claims'))
+
+ const pane = await $.ui.mount({ ...paneAt(98, 12), plugin: PLUGIN })
+
+ expect(elementsOf(await pane.drawn(), 'Raster').map(keyOf).slice(0, 2)).toEqual(['header', 'title'])
await pane.unmount()
})
})
diff --git a/plugins/ruflo-console/tests/views.test.ts b/plugins/ruflo-console/tests/views.test.ts
index 03ce4e6967..baa060ff2b 100644
--- a/plugins/ruflo-console/tests/views.test.ts
+++ b/plugins/ruflo-console/tests/views.test.ts
@@ -241,7 +241,7 @@ describe('views', () => {
const pane = await $.ui.mount({ ...paneAt(110), surface: 'terminal' as const, plugin: PLUGIN })
const menu = await pane.drawn()
- expect(elementsOf(menu, 'Raster').map(keyOf)).toEqual(['title'])
+ expect(elementsOf(menu, 'Raster').map(keyOf)).toEqual(['header', 'title'])
expect(textOf(menu)).toContain('■Swarm Commands■')
expect(textOf(menu)).toContain('Swarm Topology')
expect(textOf(menu)).toContain('ANSI-BBS')