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(console): adapt Orbital motion to narrow and short pane allocations

rUv1e25990f8f9c
diff --git a/plugins/ruflo-console/README.md b/plugins/ruflo-console/README.md
index a5240d4683..596b50dbbe 100644
--- a/plugins/ruflo-console/README.md
+++ b/plugins/ruflo-console/README.md
@@ -97,3 +97,5 @@ printf '%s\n' '{"look":"orbital"}' | claude plugin configure ruflo-console@ruflo
Reload plugins after changing the option. Select `bbs` or `plain` to restore those looks. A dark terminal background gives the closest match; terminal graphics and host controls keep their existing renderer. Narrow panes retain the existing responsive layout.
Orbital includes a four-row animated ASCII telemetry header with a red scan line, green decorative pulse and orbit marker. The optional boot intro uses a rotating ASCII Earth (one turn per 12 seconds), with actual self-check counts below it. It runs for 1.5 seconds when data is ready, at most 6 seconds while data is pending. Set `fps` to `0` for still headers and no boot intro. Existing frame scheduling stops motion in hidden panes. The pulse and globe are decoration, not measured activity or a progress percentage.
+
+Orbital adapts to the pane allocation. Below 48 drawing columns or 30 available rows, boot uses a compact check summary of at most nine rows. Failure totals remain near the top, with the first failing area shown when a third row fits. The swarm header uses its full graph at 56 drawing columns and 16 available header rows; smaller allocations use a compact animated strip. Header width reserves the existing toolbar icon space and is capped at 120 columns. Extremely small allocations clip text to the available cells. The existing live topology remains in the page body.
diff --git a/plugins/ruflo-console/hooks/gfx/orbital.ts b/plugins/ruflo-console/hooks/gfx/orbital.ts
index 6623645f6c..71ccaf8b1b 100644
--- a/plugins/ruflo-console/hooks/gfx/orbital.ts
+++ b/plugins/ruflo-console/hooks/gfx/orbital.ts
@@ -37,7 +37,7 @@ function onLand(lon: number, lat: number): boolean {
}
function blank(columns: number, rows: number): Grid {
- const grid = new Grid(Math.max(12, Math.min(200, Math.floor(columns) || 12)), rows)
+ const grid = new Grid(Math.max(1, Math.min(200, Math.floor(columns) || 1)), rows)
for (let y = 0; y < rows; y++) for (let x = 0; x < grid.columns; x++) grid.set(x, y, ' ', INK, BLACK)
return grid
}
@@ -109,11 +109,13 @@ export function orbitalGlobe(columns: number, rows: number, timeMs: number): Gri
}
/** Fixed-height header: red scan line, travelling ASCII pulse and an orbit marker. */
-export function orbitalHeader(label: string, columns: number, timeMs: number): Grid {
+export function orbitalHeader(label: string, columns: number, timeMs: number, maxRows = 16): Grid {
const swarm = /swarm/i.test(label)
- const grid = blank(columns, swarm ? 16 : 4)
+ const expanded = swarm && columns >= 56 && maxRows >= 16
+ const grid = blank(columns, expanded ? 16 : Math.max(1, Math.min(4, maxRows)))
const tick = Math.floor((Number.isFinite(timeMs) ? timeMs : 0) / 160)
- const title = ` RUFLO / ${label.toUpperCase()} `
+ const fullTitle = ` RUFLO / ${label.toUpperCase()} `
+ const title = columns >= fullTitle.length ? fullTitle : columns >= 12 ? ` RUFLO / ${swarm ? 'SWARM' : label.toUpperCase()}` : ' RUFLO'
grid.text(0, 0, title.slice(0, grid.columns), RED)
grid.text(0, 1, '-'.repeat(grid.columns), DIM)
for (let tail = 4; tail >= 0; tail--) {
@@ -125,7 +127,7 @@ export function orbitalHeader(label: string, columns: number, timeMs: number): G
grid.set(x, 2, phase === 9 ? '|' : phase === 8 || phase === 10 ? '/' : phase === 7 || phase === 11 ? '.' : '_', phase >= 7 && phase <= 11 ? GREEN : DIM)
}
grid.text(Math.max(0, grid.columns - 10), 2, `[${'|/-\\'[Math.abs(tick) % 4]}] ORBIT`, RED)
- if (swarm) {
+ if (expanded) {
// A decorative routing motif, separate from the page's measured swarm topology.
for (let y = 1; y < grid.rows; y++) grid.text(0, y, ' '.repeat(grid.columns), DIM)
const center = { x: Math.floor(grid.columns / 2), y: 5 }
@@ -201,6 +203,10 @@ export function orbitalHeader(label: string, columns: number, timeMs: number): G
}
})
grid.text(1, 15, ' Illustrative orchestration / live graph below', DIM)
+ } else if (swarm) {
+ const stages = ['DISPATCH', 'PARALLEL', 'SYNC', 'RETURN']
+ const stage = Math.floor(Math.max(0, Number.isFinite(timeMs) ? timeMs : 0) / 1200) % 4
+ grid.text(0, 3, ` ${stages[stage]} / motif`, DIM)
} else if (grid.columns >= 30) grid.text(0, 3, ' ruvnet / agent swarm console', DIM)
return grid
}
@@ -218,7 +224,26 @@ function orbitalBrandColor(color: number): number {
}
/** Checks are actual self-check results; the globe and sweep are explicitly decorative. */
-export function orbitalBoot(project: string, columns: number, timeMs: number, checks?: readonly BootCheck[]): Grid {
+export function orbitalBoot(project: string, columns: number, timeMs: number, checks?: readonly BootCheck[], maxRows = 30): Grid {
+ const available = Math.max(1, Math.min(30, Math.floor(maxRows) || 1))
+ if (columns < 48 || available < 30) {
+ const grid = blank(columns, Math.min(9, available))
+ const failed = checks?.filter(check => !check.ok) ?? []
+ const passed = checks?.filter(check => check.ok).length ?? 0
+ grid.text(0, 0, 'RUFLO / BOOT', RED)
+ grid.text(0, 1, checks === undefined ? 'Pending checks' : `${passed} OK ${failed.length} FAIL`, failed.length ? RED : GREEN)
+ // Reserve the first detail row for a real failure even in very short panes.
+ if (grid.rows > 2) grid.text(0, 2, failed.length ? `FAIL ${failed[0]!.area}` : project, failed.length ? RED : DIM)
+ if (grid.rows > 3) {
+ const tick = Math.floor(Math.max(0, Number.isFinite(timeMs) ? timeMs : 0) / 100)
+ grid.text(0, 3, '.'.repeat(grid.columns), DIM)
+ grid.set(tick % grid.columns, 3, '>', GREEN)
+ }
+ const shown = [...failed, ...(checks?.filter(check => check.ok) ?? [])]
+ shown.slice(0, Math.max(0, grid.rows - 5)).forEach((check, i) => grid.text(0, 4 + i, `${check.ok ? 'OK' : 'FAIL'} ${check.area}`, check.ok ? GREEN : RED))
+ if (grid.rows >= 6) grid.text(0, grid.rows - 1, 'Local checks', DIM)
+ return grid
+ }
const grid = blank(columns, 30)
// Reuse the original console banner, including its half-block font and sweep, recolored for Orbital.
const banner = bannerPicture(project, grid.columns, timeMs, Math.max(0, Number.isFinite(timeMs) ? timeMs : 0))
@@ -272,9 +297,9 @@ export function orbitalBoot(project: string, columns: number, timeMs: number, ch
const name = check.ok ? check.area.toUpperCase().slice(0, reveal) : check.area.toUpperCase()
const status = check.ok ? '[PASS]' : '[FAIL]'
const detail = !check.ok && check.problems.length > 0 ? ` / ${check.problems[0]}` : ''
- grid.text(0, 23 + i, ` ${status} ${name}${detail}`, check.ok ? GREEN : RED)
+ grid.text(0, 23 + i, ` ${status} ${name}${detail}`.slice(0, check.ok && grid.columns >= 55 ? grid.columns - 14 : grid.columns), check.ok ? GREEN : RED)
const cursor = 8 + name.length
- if (check.ok && reveal < check.area.length && cursor < grid.columns) grid.set(cursor, 23 + i, '_', INK)
+ if (check.ok && reveal < check.area.length && cursor < (grid.columns >= 55 ? grid.columns - 14 : grid.columns)) grid.set(cursor, 23 + i, '_', INK)
if (grid.columns >= 55 && check.ok) {
const phase = ((age % 2200) - i * 80) / 350
const light = phase >= 0 && phase < 1 ? INK : DIM
diff --git a/plugins/ruflo-console/hooks/views/frames.ts b/plugins/ruflo-console/hooks/views/frames.ts
index ca47fa6882..7117ce4ec0 100644
--- a/plugins/ruflo-console/hooks/views/frames.ts
+++ b/plugins/ruflo-console/hooks/views/frames.ts
@@ -184,7 +184,7 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numb
// The selected boot screen owns the pane for its first seconds; nothing else is drawn under it.
if (isBooting(state, nowMs)) {
- pictures.set('boot', state.options.look === 'orbital' ? orbitalBoot(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.min(width, 90), state.options.fps > 0 ? nowMs - state.pane.bootAtMs : 0, getBootChecks()) : bootPicture(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.min(width, 90), nowMs - state.pane.bootAtMs, state.probes.size, PROBES.length, state.pane.rows, getBootChecks(), bootFacts(state, CONSOLE_VERSION, getBuild())))
+ pictures.set('boot', state.options.look === 'orbital' ? orbitalBoot(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.max(1, Math.min(columns, width, 90)), state.options.fps > 0 ? nowMs - state.pane.bootAtMs : 0, getBootChecks(), state.pane.rows > 0 ? state.pane.rows : 30) : bootPicture(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.min(width, 90), nowMs - state.pane.bootAtMs, state.probes.size, PROBES.length, state.pane.rows, getBootChecks(), bootFacts(state, CONSOLE_VERSION, getBuild())))
return pictures
}
@@ -216,7 +216,7 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numb
if (state.options.look === 'orbital') {
const page = state.isHelp ? 'help' : state.palette.isOpen ? 'commands' : (VIEWS.find(view => view.id === state.view)?.label ?? state.view)
- pictures.set(state.view === 'menu' ? 'header' : 'title', fitHeader(columns, size => orbitalHeader(page, size, state.options.fps > 0 ? t : 0), 72))
+ pictures.set(state.view === 'menu' ? 'header' : 'title', orbitalHeader(page, Math.max(1, Math.min(120, columns - iconCells(false) - ICON_SLACK)), state.options.fps > 0 ? t : 0, state.pane.rows > 0 ? Math.max(1, state.pane.rows - 12) : 16))
}
switch (state.view) {
diff --git a/plugins/ruflo-console/tests/orbital.spec.ts b/plugins/ruflo-console/tests/orbital.spec.ts
index 1a731bc72e..9741a6531c 100644
--- a/plugins/ruflo-console/tests/orbital.spec.ts
+++ b/plugins/ruflo-console/tests/orbital.spec.ts
@@ -116,9 +116,9 @@ it('gives swarm control its own bounded routing animation', () => {
for (const width of [20, 44, 72]) {
const first = orbitalHeader('swarm control', width, 0)
const later = orbitalHeader('swarm control', width, 500)
- expect([first.columns, first.rows]).toEqual([width, 16])
+ expect([first.columns, first.rows]).toEqual([width, width >= 56 ? 16 : 4])
expect(first.cells).not.toEqual(later.cells)
- expect(gridText(first)).toContain('â—ˆ')
+ if (width >= 56) expect(gridText(first)).toContain('â—ˆ')
expect(gridText(first)).not.toContain('agents online')
}
})
@@ -137,3 +137,32 @@ it('preserves real topology labels and statuses in the depth view', () => {
expect(first.cells).not.toEqual(next.cells)
expect(JSON.stringify(model)).toBe(before)
})
+
+it('fits narrow and short allocations without hiding failure totals', () => {
+ const checks = [{ area: 'Security', ok: false, problems: ['broken registry'] }]
+ for (const columns of [1, 8, 12, 20, 32, 44, 48, 55, 56, 72, 120, 200]) {
+ for (const rows of [1, 2, 4, 8, 16, 24, 30, 60]) {
+ const boot = orbitalBoot('very long project name', columns, 1000, checks, rows)
+ const header = orbitalHeader('swarm control', columns, 1000, rows)
+ for (const grid of [boot, header]) {
+ expect(grid.columns).toBeLessThanOrEqual(columns)
+ expect(grid.rows).toBeLessThanOrEqual(rows)
+ expect(grid.cells.length).toBe(grid.columns * grid.rows * 3)
+ }
+ if (columns >= 12 && rows >= 2) expect(gridText(boot)).toMatch(/1 FAIL|1 failed/)
+ }
+ }
+})
+
+it('reserves icon room and switches layouts as the pane is resized', () => {
+ const state = newState({})
+ state.options.look = 'orbital'
+ state.options.boot = false
+ state.view = 'swarm'
+ for (const [columns, rows] of [[160, 50], [44, 24], [72, 20], [200, 60], [20, 10]]) {
+ state.pane.rows = rows!
+ const header = picturesOf(state, columns!, 1000, 1000).get('title')!
+ expect(header.columns).toBeLessThanOrEqual(Math.max(1, columns! - 16))
+ expect(header.rows).toBeLessThanOrEqual(Math.max(1, rows! - 12))
+ }
+})