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): ruflo tui counts emoji and CJK as two cells, forwards CLAUDE_CONFIG_DIR, and tests stderr and the bundle's inputs (ADR-489)

rd9cda60ba803
diff --git a/plugins/ruflo-console/tests/tui-boundary.spec.ts b/plugins/ruflo-console/tests/tui-boundary.spec.ts
index 66a61c5039..eb5c021880 100644
--- a/plugins/ruflo-console/tests/tui-boundary.spec.ts
+++ b/plugins/ruflo-console/tests/tui-boundary.spec.ts
@@ -7,6 +7,7 @@
import { readdirSync, readFileSync, statSync } from 'node:fs'
import { dirname, join, relative } from 'node:path'
import { fileURLToPath } from 'node:url'
+import { createRequire } from 'node:module'
import { describe, expect, it } from 'vitest'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
@@ -53,6 +54,24 @@ describe('tui/ is the second adapter', () => {
expect(offenders).toEqual([])
})
+ it('keeps register.ts (the one file that binds $) out of the bundle, even through hooks/; model-tools.ts is in it only for the helpers the controller shares', () => {
+ let esbuild: typeof import('esbuild')
+
+ try {
+ esbuild = createRequire(import.meta.url)('esbuild')
+ } catch {
+ return // esbuild is a build-time tool; without it the build script itself says so
+ }
+
+ const built = esbuild.buildSync({ entryPoints: [join(root, 'tui', 'main.ts')], bundle: true, write: false, metafile: true, platform: 'node', format: 'esm', logLevel: 'silent' })
+ const inputs = Object.keys(built.metafile.inputs)
+
+ expect(inputs.some(input => /hooks\/views\/pane\.ts$/.test(input))).toBe(true)
+ expect(inputs.filter(input => /hooks\/register\.ts$/.test(input))).toEqual([])
+ // The console_* tool server inside model-tools.ts is started only by register.ts; the standalone shell never calls it.
+ expect(readdirSync(join(root, 'tui')).map(name => readFileSync(join(root, 'tui', name), 'utf8')).some(text => /serveModelTools|announceModelTools/.test(text))).toBe(false)
+ })
+
it('implements every member of Host the controller can call, and nothing in hooks/ changed shape', async () => {
const { createNodeHost } = await import('../tui/node-host')
const host = createNodeHost({ cwd: root })
diff --git a/plugins/ruflo-console/tests/tui-render.spec.ts b/plugins/ruflo-console/tests/tui-render.spec.ts
index 3ff6b10028..c4477a55b5 100644
--- a/plugins/ruflo-console/tests/tui-render.spec.ts
+++ b/plugins/ruflo-console/tests/tui-render.spec.ts
@@ -5,7 +5,7 @@
*/
import { describe, expect, it } from 'vitest'
-import { clean, render, terminalKit, widthOf } from '../tui/ansi'
+import { cells, clean, render, terminalKit, widthOf } from '../tui/ansi'
const kit = terminalKit()
const text = (children: unknown, props: Record<string, unknown> = {}) => kit.Text({ children, ...props } as never)
@@ -77,6 +77,17 @@ describe('render', () => {
expect(out[1]).toContain(' hi')
})
+ it('counts emoji and CJK as two cells, so a border stays straight on a row that has them', () => {
+ expect([cells('abc'), cells('🏠'), cells('✅'), cells('日本'), cells('é'), cells('e\u0301')]).toEqual([3, 2, 2, 4, 1, 1])
+
+ const rows = ['plain row', '🏠 Overview', '🎯 📌 👑 🐝 four', '日本語のテキスト', 'x'.repeat(60)]
+ const out = render(box(rows.map(row => box([text(row)], { flexDirection: 'row' })), { borderStyle: 'round', paddingX: 1 }), 30, 'none')
+
+ expect(out.length).toBeGreaterThan(rows.length)
+ expect(new Set(out.map(widthOf))).toEqual(new Set([30]))
+ expect(widthOf(render(text('🏠'.repeat(20), { wrap: 'truncate-end' }), 11, 'none')[0] as string)).toBeLessThanOrEqual(11)
+ })
+
it('draws a button as an inert bracketed label and skips hidden boxes', () => {
expect(render(kit.Button({ key: 'k', label: 'Refresh' } as never), 30, 'none')).toEqual(['[Refresh]'])
expect(render(box([text('gone')], { hidden: true }), 30, 'none')).toEqual([])
diff --git a/plugins/ruflo-console/tests/tui-session.spec.ts b/plugins/ruflo-console/tests/tui-session.spec.ts
index 0b29fc456b..64848189af 100644
--- a/plugins/ruflo-console/tests/tui-session.spec.ts
+++ b/plugins/ruflo-console/tests/tui-session.spec.ts
@@ -99,6 +99,27 @@ describe('the same views over real ruflo files', () => {
session.stop()
})
+ it.each([
+ ['escapes only: the words stay, the sequences go', 'boom \u001b]0;pwned\u0007\u001b[2J\u009b31m end', /exit 1: .*boom.* end/],
+ ['an escape and a token: the whole line is withheld', 'boom \u001b]0;pwned\u0007 ghp_abcdefghijklmnopqrstuvwxyz0123456789 end', /line withheld/],
+ ])('what a failing child prints reaches the frame as clean text (stderr is not JSON, so no data layer in front): %s', async (_name, stderr, expected) => {
+ const base = openSession({ cwd: project, home: join(root, 'home') }).host
+ const hostileRun = async () => ({ exitCode: 1, stdout: '', stderr, isStdoutTruncated: false, isStderrTruncated: false })
+ const session = openSession({ cwd: project }, { ...base, run: hostileRun })
+
+ await session.refresh()
+ await session.refresh()
+ for (const depth of ['none', '256'] as const) {
+ const text = session.frame(110, depth).join('\n')
+
+ expect(text).toMatch(expected)
+ expect(text).not.toContain('pwned')
+ expect(text).not.toContain('ghp_abcdefghij')
+ expect(text.match(/\u001b/g)?.length ?? 0).toBe(text.match(/\u001b\[[0-9;]*m/g)?.length ?? 0)
+ }
+ session.stop()
+ })
+
it('never calls the engine: every host call the controller made was a read or a refusal', async () => {
const ran: string[][] = []
const calls: string[] = []
diff --git a/plugins/ruflo-console/tui/ansi.ts b/plugins/ruflo-console/tui/ansi.ts
index 61a63a83ca..190c1595c2 100644
--- a/plugins/ruflo-console/tui/ansi.ts
+++ b/plugins/ruflo-console/tui/ansi.ts
@@ -59,25 +59,57 @@ function sgr(style: Style, depth: Depth): string {
}
const RESET = '\u001b[0m'
-/** Visible length of a line: SGR sequences cost nothing (only ours are ever in it), every code point is one cell. */
-export const widthOf = (line: string): number => [...line.replace(/\u001b\[[0-9;]*m/g, '')].length
+/** Wide (two-cell) ranges: CJK, fullwidth forms, and the emoji blocks terminals draw two cells wide. A table, not a library; unlisted ambiguous symbols count one. */
+const WIDE: readonly (readonly [number, number])[] = [
+ [0x1100, 0x115f], [0x231a, 0x231b], [0x23e9, 0x23ec], [0x23f0, 0x23f0], [0x23f3, 0x23f3], [0x25fd, 0x25fe], [0x2614, 0x2615], [0x2648, 0x2653], [0x267f, 0x267f], [0x2693, 0x2693], [0x26a1, 0x26a1], [0x26aa, 0x26ab], [0x26bd, 0x26be], [0x26c4, 0x26c5], [0x26ce, 0x26ce], [0x26d4, 0x26d4], [0x26ea, 0x26ea], [0x26f2, 0x26f3], [0x26f5, 0x26f5], [0x26fa, 0x26fa], [0x26fd, 0x26fd],
+ [0x2705, 0x2705], [0x270a, 0x270b], [0x2728, 0x2728], [0x274c, 0x274c], [0x274e, 0x274e], [0x2753, 0x2755], [0x2757, 0x2757], [0x2795, 0x2797], [0x27b0, 0x27b0], [0x27bf, 0x27bf], [0x2b1b, 0x2b1c], [0x2b50, 0x2b50], [0x2b55, 0x2b55],
+ [0x2e80, 0xa4cf], [0xac00, 0xd7a3], [0xf900, 0xfaff], [0xfe30, 0xfe6f], [0xff00, 0xff60], [0xffe0, 0xffe6], [0x1f300, 0x1faff], [0x20000, 0x3fffd],
+]
+
+/** Terminal cells one code point takes: 0 for a combining mark, 2 for a wide one, else 1. */
+export function cellsOf(code: number): number {
+ if (code >= 0x300 && code <= 0x36f) return 0
+
+ return WIDE.some(([from, to]) => code >= from && code <= to) ? 2 : 1
+}
+
+/** Cells a string takes (no escape sequences in it). */
+export const cells = (text: string): number => [...text].reduce((sum, ch) => sum + cellsOf(ch.codePointAt(0) as number), 0)
+
+/** The longest head of `text` that fits `room` cells, and the rest. */
+function split(text: string, room: number): [string, string] {
+ let used = 0
+ let head = ''
+
+ for (const ch of text) {
+ const w = cellsOf(ch.codePointAt(0) as number)
+
+ if (used + w > room) break
+ used += w
+ head += ch
+ }
+
+ return [head, text.slice(head.length)]
+}
+
+/** Visible width of a line in cells: SGR sequences cost nothing (only ours are ever in it). */
+export const widthOf = (line: string): number => cells(line.replace(/\u001b\[[0-9;]*m/g, ''))
/** Cuts a styled line to `width` cells, keeping the sequences, and closes any style left open. */
function cut(line: string, width: number, mark = ''): string {
if (widthOf(line) <= width) return line
let out = ''
- let seen = 0
- const keep = Math.max(0, width - [...mark].length)
+ let left = Math.max(0, width - cells(mark))
for (const part of line.split(/(\u001b\[[0-9;]*m)/)) {
if (part.startsWith('\u001b[')) out += part
- else
- for (const ch of part) {
- if (seen >= keep) break
- out += ch
- seen++
- }
+ else {
+ const [head] = split(part, left)
+
+ out += head
+ left -= cells(head)
+ }
}
return `${out}${mark}${out.includes('\u001b') ? RESET : ''}`
@@ -90,13 +122,16 @@ function wordWrap(text: string, width: number): string[] {
for (const word of text.split(' ')) {
let rest = word
- while ([...rest].length > width) {
+ while (cells(rest) > width) {
if (current !== '') lines.push(current), (current = '')
- lines.push([...rest].slice(0, width).join(''))
- rest = [...rest].slice(width).join('')
+ const [head, tail] = split(rest, width)
+
+ if (head === '') break
+ lines.push(head)
+ rest = tail
}
- if (current !== '' && [...current].length + [...rest].length + 1 > width) {
+ if (current !== '' && cells(current) + cells(rest) + 1 > width) {
lines.push(current)
current = rest
} else current = current === '' ? rest : `${current} ${rest}`
diff --git a/plugins/ruflo-console/tui/node-host.ts b/plugins/ruflo-console/tui/node-host.ts
index f338ae90c9..5c1ced76a3 100644
--- a/plugins/ruflo-console/tui/node-host.ts
+++ b/plugins/ruflo-console/tui/node-host.ts
@@ -30,7 +30,7 @@ export type NodeHostOptions = {
const MAX_OUT = 1_000_000
/** Variables a child may see: enough to run node and find the project, none of the API keys in the parent's environment. */
-const CHILD_ENV = /^(PATH|HOME|USERPROFILE|SystemRoot|TMPDIR|TEMP|TMP|LANG|LC_[A-Z]+|TERM|NO_COLOR|CLAUDE_FLOW_[A-Z_]+|RUFLO_[A-Z_]+)$/
+const CHILD_ENV = /^(PATH|HOME|USERPROFILE|SystemRoot|TMPDIR|TEMP|TMP|LANG|LC_[A-Z]+|TERM|NO_COLOR|CLAUDE_CONFIG_DIR|CLAUDE_FLOW_[A-Z_]+|RUFLO_[A-Z_]+)$/
const refuse = (what: string): Promise<never> => Promise.reject(new Error(`${what}: not available in the standalone terminal`))
diff --git a/v3/docs/adr/ADR-489-ruflo-tui-standalone-console.md b/v3/docs/adr/ADR-489-ruflo-tui-standalone-console.md
index d438dea071..647b8df7db 100644
--- a/v3/docs/adr/ADR-489-ruflo-tui-standalone-console.md
+++ b/v3/docs/adr/ADR-489-ruflo-tui-standalone-console.md
@@ -32,7 +32,75 @@ Static check over all 343 `.ts` files under `hooks/` (comments stripped; the rul
|---|---|---|---|
| host-neutral | no engine call, no Node module, no package; reads files through `Host.fs`, runs the ruflo CLI through `Host.run` | **315** | top level 97, `data/` 103, `views/` 98, `gfx/` 17 |
| host-engine-dependent | calls a `Host` member only the Claude Code host can answer (panes, `blit`, prompt box, `toolCall`, `rufloSnapshot`, dialogs, toasts) | **26** | top level 23, `views/` 3 (`wf-control`, `wf-guide`, `wf-templates`) |
-| Claude-Code-only | touches `$` or `on(...)` directly | **2** | `register.ts`, `model-tools.ts` (the model-facing `console_*` tools) |
+| Claude-Code-only | touches `# ADR 489: `ruflo tui`: the console in a terminal of its own, over the same views
+
+Status: Proposed (phase 1, a read-only Overview and Cost, is implemented in the draft PR that adds this file; phases 2 to 4 are a roadmap)
+
+Date: 2026-10-11
+
+Builds on: ADR-407 (the cockpit), ADR-446 (plugin mods), ADR-448 (the Room), ADR-481 (one sanitiser for drawn text), ADR-486 (session workspace), ADR-150 (plugin skills dispatched by the CLI, with graceful degradation), ADR-437 (multi-provider cost ledger). Security inputs: #3983 (every confirm route bound to the card the person saw), #3981 (no transcript text or path in a model-facing answer).
+
+Numbering: 488 is the highest on `main` and no open pull request names 489 (checked 2026-10-11 before committing). ADR-487 exists twice, so check again at merge.
+
+## 1. Context
+
+rUv's goal: a TUI for ruflo, part of `npx ruflo`, that reuses the ruflo-console components and works both on its own and as the mod inside Claude Code
+(ruflo-mods). A standalone host should eventually drive Codex and OpenRouter. The agreed starting point was a **thin shell first**: a `ruflo tui` entry
+that embeds the existing views, Codex and OpenRouter through their own CLI or API, Claude Code staying a supported host, and not a new agent harness.
+
+This ADR records what the code showed, the decision, and the first slice. Every number below was measured on `main` at 72255a2f4 unless it says otherwise.
+
+## 2. Findings (evidence)
+
+### 2.1 The host boundary already exists
+
+`plugins/ruflo-console/hooks/host.ts` defines `Host`, "the engine as `session.start` bound it": 31 required members and 3 optional ones (`fs`, `run`, `spawn`,
+`every`, `after`, `storeGet/Set`, `openPane`, `blit`, `toolCall`, `rufloSnapshot`, `httpSend` …). Its contract says any member may be refused and a refusal is
+a missing fact, never a crash. `register.ts` `hostOf($, …)` is the one place that spells `$.noun.method(...)`: the Claude Code adapter. The controller
+(`createController(state, host)`), every view (`(ctx) => RenderElement`, built only from `ctx.kit.Box|Text|Button`, optional `Raster|Input`) and the page
+(`paneView`) are plain functions over that interface.
+
+Static check over all 343 `.ts` files under `hooks/` (comments stripped; the rules are asserted by `tests/tui-boundary.spec.ts`):
+
+| class | meaning | files | where |
+|---|---|---|---|
+| host-neutral | no engine call, no Node module, no package; reads files through `Host.fs`, runs the ruflo CLI through `Host.run` | **315** | top level 97, `data/` 103, `views/` 98, `gfx/` 17 |
+| host-engine-dependent | calls a `Host` member only the Claude Code host can answer (panes, `blit`, prompt box, `toolCall`, `rufloSnapshot`, dialogs, toasts) | **26** | top level 23, `views/` 3 (`wf-control`, `wf-guide`, `wf-templates`) |
+ or `on(...)` directly | **2** | `register.ts` (the one file that binds `# ADR 489: `ruflo tui`: the console in a terminal of its own, over the same views
+
+Status: Proposed (phase 1, a read-only Overview and Cost, is implemented in the draft PR that adds this file; phases 2 to 4 are a roadmap)
+
+Date: 2026-10-11
+
+Builds on: ADR-407 (the cockpit), ADR-446 (plugin mods), ADR-448 (the Room), ADR-481 (one sanitiser for drawn text), ADR-486 (session workspace), ADR-150 (plugin skills dispatched by the CLI, with graceful degradation), ADR-437 (multi-provider cost ledger). Security inputs: #3983 (every confirm route bound to the card the person saw), #3981 (no transcript text or path in a model-facing answer).
+
+Numbering: 488 is the highest on `main` and no open pull request names 489 (checked 2026-10-11 before committing). ADR-487 exists twice, so check again at merge.
+
+## 1. Context
+
+rUv's goal: a TUI for ruflo, part of `npx ruflo`, that reuses the ruflo-console components and works both on its own and as the mod inside Claude Code
+(ruflo-mods). A standalone host should eventually drive Codex and OpenRouter. The agreed starting point was a **thin shell first**: a `ruflo tui` entry
+that embeds the existing views, Codex and OpenRouter through their own CLI or API, Claude Code staying a supported host, and not a new agent harness.
+
+This ADR records what the code showed, the decision, and the first slice. Every number below was measured on `main` at 72255a2f4 unless it says otherwise.
+
+## 2. Findings (evidence)
+
+### 2.1 The host boundary already exists
+
+`plugins/ruflo-console/hooks/host.ts` defines `Host`, "the engine as `session.start` bound it": 31 required members and 3 optional ones (`fs`, `run`, `spawn`,
+`every`, `after`, `storeGet/Set`, `openPane`, `blit`, `toolCall`, `rufloSnapshot`, `httpSend` …). Its contract says any member may be refused and a refusal is
+a missing fact, never a crash. `register.ts` `hostOf($, …)` is the one place that spells `$.noun.method(...)`: the Claude Code adapter. The controller
+(`createController(state, host)`), every view (`(ctx) => RenderElement`, built only from `ctx.kit.Box|Text|Button`, optional `Raster|Input`) and the page
+(`paneView`) are plain functions over that interface.
+
+Static check over all 343 `.ts` files under `hooks/` (comments stripped; the rules are asserted by `tests/tui-boundary.spec.ts`):
+
+| class | meaning | files | where |
+|---|---|---|---|
+| host-neutral | no engine call, no Node module, no package; reads files through `Host.fs`, runs the ruflo CLI through `Host.run` | **315** | top level 97, `data/` 103, `views/` 98, `gfx/` 17 |
+| host-engine-dependent | calls a `Host` member only the Claude Code host can answer (panes, `blit`, prompt box, `toolCall`, `rufloSnapshot`, dialogs, toasts) | **26** | top level 23, `views/` 3 (`wf-control`, `wf-guide`, `wf-templates`) |
+), `model-tools.ts` (the model-facing `console_*` tool server over `on`; it also exports helpers such as `modelLine` that the controller imports, so it is in the standalone bundle but its server is never started: only `register.ts` calls it, asserted by the boundary test) |
95 files import `claude-code`, all as types; no file imports a Node module or a package. The "about 113 files" in the question is the
top level of `hooks/` (122 `.ts` files: 97 host-neutral, 23 engine-dependent, 2 engine-only); the whole folder has 343. "Host-neutral" is a statement about imports, not about usefulness: many neutral views
@@ -121,7 +189,7 @@ add one as an **optional, lazily imported** dependency, per the published-train
| Constraint | How it holds on the standalone host |
|---|---|
| Confirm gate bound to the card the person saw (#3983) | Phase 1 has **no write path**: buttons are inert, no key maps to an action, `askChoice` rejects, and `run` only accepts the ruflo CLI. The controller's `confirm(seen)` binding is unchanged and unexercised. A write phase must port the #3983 tests to this host before it lifts any refusal. |
-| One sanitiser for drawn text (ADR-481, `modelLine`) | `modelLine` guards what a **model** reads and lives in `model-tools.ts` (engine-only), so it is not imported. The terminal needs the same guarantee for what a **person's terminal** executes: `ansi.ts` `clean` is the chokepoint (OSC/CSI/C1/invisible removed, a line holding a secret or invite withheld whole, using the same `ESCAPES`, `INVISIBLE`, `hasSecret`, `hasInvite`). The mod gets this from the engine; here it is ours. `tui-render.spec.ts` feeds OSC title injection, `\u001b[2J`, `\u001b[?1049h`, a GitHub token and an Anthropic key through every colour depth. |
+| One sanitiser for drawn text (ADR-481, `modelLine`) | `modelLine` guards what a **model** reads (one line, whitespace collapsed and trimmed). The terminal needs the same guarantee for what a **person's terminal** executes, and must keep indentation, so `ansi.ts` `clean` is the chokepoint, built from the same primitives (OSC/CSI/C1/invisible removed, a line holding a secret or invite withheld whole, using the same `ESCAPES`, `INVISIBLE`, `hasSecret`, `hasInvite`). The mod gets this from the engine; here it is ours. `tui-render.spec.ts` feeds OSC title injection, `\u001b[2J`, `\u001b[?1049h`, a GitHub token and an Anthropic key through every colour depth. |
| Path and transcript leaks (#3981) | Reads are confined to the project, `~/.claude` (or `CLAUDE_CONFIG_DIR`) and `~/.claude-flow`, symlinks resolved before the check (tests: `../`, a link out of the project, `~/.ssh`). The page is drawn for a person (`ctx.text` false), so session previews follow ADR-486; the model-facing path (`viewText`, `console_state`) is untouched. **Not a model channel:** non-TTY output is one plain frame; if someone pipes it to a model that is their choice, and it still passes `clean`. |
| No credentials in output or child processes | `run` starts only `process.execPath <this cli.js> …` (no shell, fixed argv) with an environment allowlist (`PATH`, `HOME`, `LANG`, `TERM`, `CLAUDE_FLOW_*`, `RUFLO_*` …): `OPENROUTER_API_KEY` and friends do not reach the child (test). `fetchText`, `httpSend`, `spawn` are refused. Nothing is written to disk (the store is in memory). |
| A repository cannot supply code that ruflo runs | The bundle is loaded from the CLI's own install only (`ownPluginDirs`); a `plugins/ruflo-console/dist/tui.mjs` inside the opened project is ignored (test). |
@@ -141,7 +209,7 @@ not a replacement and not a second implementation.
## 4. Phases
-1. **Phase 1 (this PR, draft): the vertical slice.** `ruflo tui [--view overview|cost]`; alternate screen, keys `o c Tab r j k PgUp PgDn g G q`, auto-refresh every 3 s; headless prints one plain frame; read-only; the boundary and security tests; ADR.
+1. **Phase 1 (this PR, draft): the vertical slice.** `ruflo tui [--view overview|cost]`; alternate screen, keys `o c Tab r j k PgUp PgDn g G q`, auto-refresh every 3 s; headless prints one plain frame after the CLI's own startup lines; read-only; the boundary and security tests; ADR.
1b. **Publish wiring.** `prepare-publish.mjs` builds and stages the bundle; a CI job runs `ruflo tui` headless from the packed tarball; decide on `esbuild` as a declared devDependency.
2. **Host capabilities and more pages.** `Host.capabilities` so chrome and rows that need Claude Code are hidden, not drawn inert; Swarm, Room, Events, Missions read-only; Raster to half-block cells; Windows and tmux verification; `NO_COLOR` and width (CJK, emoji) handling.
3. **Drive Codex and OpenRouter** (3.5) behind the confirm gate, with #3983's tests ported; the AI terminal page; per-provider spend read from the CLIs' own reports and the ledger.
@@ -149,6 +217,7 @@ not a replacement and not a second implementation.
## 5. Risks
+- **Cell width.** Width is counted in terminal cells with a small table (CJK, fullwidth, the emoji blocks, combining marks); a symbol the table does not list, or a terminal that draws an emoji at another width, can still shift a border. Tested for the emoji the pane header uses.
- **Chrome that lies.** Inert Claude-only controls are visible until phase 2. They are dimmed and the footer says read-only; still a rough edge.
- **Drift.** A new view may import something engine-specific. Mitigation: `tui-boundary.spec.ts` (imports) and a headless smoke over the pages the TUI opens.
- **Bundle size.** 437 KiB gzip for a feature many will not use. It loads lazily, only for `tui`. Dropping the unused pages from the bundle (tree-shaking by an explicit page list) is a phase 2 option.
@@ -163,13 +232,12 @@ a web or desktop front end; publishing, version bumps, and the Slack or dashboar
## 7. Verification
-Run on this machine (Linux 6.17, Node 22.23.2, a pty from `script`): 36 new vitest tests in `plugins/ruflo-console/tests/tui-{host,render,session,boundary}.spec.ts` and 6 in `v3/@claude-flow/cli/__tests__/tui-command.test.ts`,
+Run on this machine (Linux 6.17, Node 22.23.2, a pty from `script`): 40 new vitest tests in `plugins/ruflo-console/tests/tui-{host,render,session,boundary}.spec.ts` and 6 in `v3/@claude-flow/cli/__tests__/tui-command.test.ts`,
all passing; `tsc -p plugins/ruflo-console` reports no error in `tui/` or the new tests (7 errors exist in other files already on `main`); `node …/cli.js tui` against this repository printed the
real CLI version (`v3.56.5`), the real swarm id, daemon state and helpers manifest; the pty run entered the alternate screen once, switched to Cost on `c`, scrolled on `j`, quit on `q`, left raw mode and the
alternate screen, exit 0.
-**Unverified:** Node 20 (the declared floor; the bundle targets it but only 22 was run), macOS Terminal, iTerm2, kitty, Windows Terminal and conhost (raw mode and SGR), tmux/screen colour depth, a terminal narrower than 40 columns, wide
-characters, `npx ruflo tui` from a registry install (the bundle is not staged by `prepare-publish.mjs` yet), and every page other than Overview and Cost.
+**Unverified:** Node 20 (the declared floor; the bundle targets it but only 22 was run), macOS Terminal, iTerm2, kitty, Windows Terminal and conhost (raw mode and SGR), tmux/screen colour depth, a terminal narrower than 40 columns, `npx ruflo tui` from a registry install (the bundle is not staged by `prepare-publish.mjs` yet), and every page other than Overview and Cost.
## 8. Decisions for the owner