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): typing reaches the terminal field after a tab click or a /switch; 0.7.0; ADR-407 final

ruv5b5adeb188c1
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index 728b154030..2160de11af 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.2",
+ "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.7.0",
"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 092153f3c4..a52ccfc673 100644
--- a/plugins/ruflo-console/hooks/bindings.ts
+++ b/plugins/ruflo-console/hooks/bindings.ts
@@ -25,6 +25,15 @@ export type Steps = {
export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps): Actions {
const { freshRead, probe, setView, drill, close } = steps
+ /**
+ * After a command typed in the terminal field (/ruflo, /new, /up…) the rows above the field change, and the engine
+ * does not keep the focus ring on it: the next keys would fire hotkeys or leave the pane. Put the ring back.
+ */
+ const keepField = () => {
+ // After the redraw: from inside the submit's own dispatch the ring is moved before the new rows land.
+ host.after(80, () => void host.focus(PANE_ID, 'term-input').catch(() => undefined))
+ }
+
/** j/k: what moves depends on the view in front. */
function select(by: number): void {
const view = state.view
@@ -149,6 +158,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps
if (text.trim() === '/new') {
state.terminal.draft = ''
newSession(state, host)
+ keepField()
return
}
@@ -159,6 +169,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps
if (move !== undefined) {
state.terminal.draft = ''
actions.term.scroll(move)
+ keepField()
return
}
@@ -173,6 +184,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps
if (state.terminal.asked !== null && state.pending?.label === state.terminal.asked.label) runner.cancel()
state.terminal.asked = null
host.invalidate()
+ keepField()
return
}
diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.ts
index 379a3fb118..3a53a91496 100644
--- a/plugins/ruflo-console/hooks/controller.ts
+++ b/plugins/ruflo-console/hooks/controller.ts
@@ -325,9 +325,10 @@ export function createController(state: State, host: Host): Controller {
state.timers.clear()
}
- async function open(focus = true): Promise<{ isPlaced: boolean; reason: string }> {
+ /** `closeOnEscape` false: take the keys but leave Esc handing them back, as an auto-opened pane does. */
+ async function open(focus = true, closeOnEscape = focus): Promise<{ isPlaced: boolean; reason: string }> {
try {
- const result = await host.openPane({ id: PANE_ID, title: 'ruflo', rows: rowsOf(state.view), ...(focus && { focus: true, closeOnEscape: true, holdToasts: true }) })
+ const result = await host.openPane({ id: PANE_ID, title: 'ruflo', rows: rowsOf(state.view), ...(focus && { focus: true, holdToasts: true }), ...(closeOnEscape && { closeOnEscape: true }) })
const isPlaced = result === undefined || result.isPlaced !== false
if (isPlaced && !state.pane.isOpen) state.pane.bootAtMs = Date.now()
@@ -401,9 +402,18 @@ export function createController(state: State, host: Host): Controller {
}
}
- /** Moves the pane's focus ring onto one of its fields; refused (the pane does not hold the keys), nothing happens. */
+ /**
+ * Puts the keys in one of the pane's fields. A pane that opened by itself (panel=auto) does not hold the keys, and a
+ * mouse click on a tab does not give them, so a person who clicked their way to the terminal would type into
+ * Claude's prompt instead. Here the pane takes the keys first (an open with focus), then the ring moves to the field.
+ */
function focusField(key: string): void {
- if (state.pane.isOpen && state.pane.isFocused) void host.focus(PANE_ID, key).catch(() => undefined)
+ if (!state.pane.isOpen) return
+
+ const toField = () => void host.focus(PANE_ID, key).catch(() => undefined)
+
+ if (state.pane.isFocused) toField()
+ else void open(true, false).then(result => result.isPlaced && toField())
}
function drill(agentId: string): void {
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index 22adf23712..5dae65d642 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.2"
+step "1. plugin.json declares ruflo-console 0.7.0"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.6.2"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.7.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/v3/docs/adr/ADR-407-ruflo-console-cockpit.md b/v3/docs/adr/ADR-407-ruflo-console-cockpit.md
index 89dd1a5e04..b8a197ed0b 100644
--- a/v3/docs/adr/ADR-407-ruflo-console-cockpit.md
+++ b/v3/docs/adr/ADR-407-ruflo-console-cockpit.md
@@ -1,6 +1,6 @@
# ADR 407: The ruflo-console cockpit: interface, AI terminal and safety contract
-Status: Accepted (sections 9–11 in progress)
+Status: Accepted
Date: 2026 10 02
@@ -71,6 +71,8 @@ The band says what is happening now, most urgent first, so a narrow band truncat
Totals (patterns learned, router picks) live in their own views, not on the band.
+Every part is a link: a click opens the console on the view it is about, with the keys. The same holds for the main menu's status-bar facts and the Wildcat strip's network names.
+
## 6. AI terminal
The terminal view is a conversation with **codex**, **claude**, a **swarm** of both at once, or one **ruflo** CLI command.
@@ -92,6 +94,10 @@ The terminal view is a conversation with **codex**, **claude**, a **swarm** of b
**Keys.** The field takes the keys when the view opens and after a harness pick (`$.ui.focus`). `/codex`, `/claude`, `/swarm`, `/ruflo` and `/new` work from inside the field.
+**Scrolling.** The conversation is a window that scrolls: ▲ older, ▼ newer and ⤓ end, or `/up`, `/down` and `/end` from the field. While the window is scrolled up, new output waits below and is counted; it never pulls the view down.
+
+**Framing.** Each turn is framed: `╭─ you → agent`, then `├─ agent`, then a gutter in that agent's colour, closed by `╰─ ✓ 3 s · $0.012`. Answers get a light reading of markdown (headings, bullets, framed code) and wrap at word boundaries. A past question can be clicked to put it back in the field.
+
## 7. x.ruv.io board
A BBS main menu of what the open federation offers: join, roster, sync, work claims, channels, registry, and the admin-only invites, admit and publish. `▸ open` puts the matching `ruflo federation …` command into the terminal; it does not run it.
@@ -104,34 +110,77 @@ Every change goes through the runner as one fixed argv and is confirmed first. T
The console never promotes, publishes or expands its own authority. MetaHarness promotion is shown as a command for the person to run, never offered as a one-key action from the pane.
-## 9. Skills (in progress)
+## 9. Skills
+
+A Skills view on the `npx skills` CLI (`views/skills.ts`, `data/skills.ts`, `skills.ts`). It has no hotkey and is reached from the menu (NETWORK & EXTEND → extend) or by typing `skills`.
+
+**Installed.** `skills ls --json` for the project and `ls -g --json` for global. Both run when the view opens.
+
+**Search.** `skills find <query>` prints text, not JSON. The console strips its ANSI and parses `owner/repo@skill N installs` with its skills.sh URL.
+
+**Changes.** Each of these goes through the runner, is confirmed first, and re-lists installed skills afterwards:
+- `add <id> [-g] -y`
+- `remove <name> [-g] -y`
+- `update [name] -y`
+- `init <name>`
+
+**Edit.** "Edit" hands the skill's name and path to the AI terminal. The console never writes skill files itself.
+
+**Input rules.** Input is validated before it reaches any argv: no leading `-`, only `[A-Za-z0-9@/._ -]`, and a length cap.
+
+**Network.** The reads reach the network (the npx package download, and skills.sh for search), so they run only when the person acts.
+
+## 10. Hive-Mind
+
+A dedicated Hive-Mind view (`views/hive.ts`, `hive.ts`, `data/hive.ts`, `gfx/hive.ts`), keyless, after Swarm. Its data comes from `.claude-flow/hive-mind/state.json`, with worker roles and liveness from `.claude-flow/agents.json`, where `hive-mind spawn` writes.
+
+**What it shows:**
+- the queen's id, term and election time
+- the consensus strategy
+- members with roles and liveness
+- fault tolerance from the CLI's own formulas (byzantine f < n/3, raft f < n/2)
+- open proposals: per-voter ballots, votes against the required count, the raft timeout and the quorum preset
+- decided proposals as history
+- broadcasts and shared-memory keys
+
+Gossip and crdt state no tolerance bound and read n/a.
+
+**Actions.** Each is confirmed first:
+- vote, cast through `hive-mind consensus`, which carries the capability token the console never reads
+- propose, broadcast and spawn, through `mcp exec`
+
+**Votes.** A vote is cast **as the next registered worker that has not voted**. The CLI counts only registered workers, and it exits 0 when it refuses a vote. Earlier palette and Approvals votes, cast as `console-operator`, were therefore dropped silently. All three paths now share this rule. With no worker left, they say why and run nothing.
+
+**Picture.** A honeycomb Raster with the queen at the centre. A cell pulses for 2 s after that member's vote, join or leave. The Swarm view keeps a summary with `â–¸ open hive`.
-A Skills view on the `npx skills` CLI:
-- installed skills (`skills ls --json`, project and global)
-- search (`skills find`, text output parsed)
-- add, remove, update and init, each confirmed first
-- "edit", which hands the skill to the AI terminal
+## 11. MetaHarness lab
-It has no hotkey and is reached from the menu or by name.
+The MetaHarness view (`views/metaharness.ts`, `views/mh-lab.ts`, `mh-lab.ts`) keeps Readiness, Flywheel and the audit trend. It adds a lab of every verb, each checked against `commands/metaharness.ts` and the MCP schemas. Each lab entry is also a palette id (`/ruflo run mh-genome`), so it works headless.
-## 10. Hive-Mind (in progress)
+**Inspect: runs at once, $0.**
+- score, genome, mcp-scan (findings by severity), threat-model, `doctor --component metaharness`
+- audit-trend and similarity, comparing the newest audit-list key with an older one
+- drift-from-history `--dry-run`, flywheel receipts
+- gepa genome and render; gepa analyze is typed into the terminal, since it needs a transcript path
+- bench verify, evolve without `--confirm` (it only plans), learn without `--run`
+- redblue attack, redblue `--mock-judge`
-A dedicated Hive-Mind view. Functionally:
-- queen and members
-- consensus strategy, quorum and fault tolerance (byzantine f < n/3, raft f < n/2)
-- proposals with tallies against the required votes, and their history
-- confirmed vote, propose and broadcast actions through the hive-mind MCP tools
+**Writes: confirmed first.**
+- oia-audit (to memory)
+- bench create, redblue init
+- evolve `--confirm` (local compute, no model calls)
+- flywheel run `--proposer local`
-Visually, a honeycomb Raster in which a cell pulses only after that member's vote. The Swarm view keeps a one-line summary.
+**Spends: confirmed first, and the confirm row says so.**
+- redblue with a real judge, capped at `--max-cost-usd 3`
+- security-bench, which may call models (MCP only)
+- `learn --run`, which is typed into the terminal, so it is asked twice
-## 11. MetaHarness lab (in progress)
+**Never from the pane.** `flywheel promote <receipt> --public-key <pem> --confirm` is shown as a command for the person to run themselves (§8), and the same goes for evidence-reset. `mint` is not surfaced.
-Full coverage of the `metaharness` surface, in three tiers:
-- **Inspect ($0, read-only, runs at once):** genome, mcp-scan, threat-model, gepa, bench verify, drift and audit-trend.
-- **Audit and compare (confirmed):** oia-audit and similarity.
-- **Evolve and test (confirmed, cost labelled):** redblue (mock judge by default), learn (dry-run by default), evolve, security-bench and flywheel run.
+**Result panel.** Shows the label, the exit, the cost note and the output lines. j/k scrolls it.
-Promotion stays out of the pane (§8). Each capability also has a palette id, so it works headless.
+The audit-list probe now reads the fields the CLI emits (`key`, `startedAt`, `finishedAt`); before, the trend never had real points.
## 12. Release gates
@@ -152,4 +201,4 @@ The recording driver aborts rather than type into Claude's own prompt. It never
## 14. Sources
- `plugins/ruflo-console/hooks/{state,harness,stream,bindings,controller}.ts`, `hooks/views/{pane,frames,menu,bar,terminal,xruv}.ts`, `hooks/gfx/{neon,boot,pictures}.ts`
-- PRs #3625–#3632 (band, BBS look, Wildcat round, neon boot, AI terminal, compact and focus fixes)
+- PRs #3625–#3632 (band, BBS look, Wildcat round, neon boot, AI terminal, compact and focus fixes) and the 0.7.0 release (Skills, Hive-Mind, MetaHarness lab, scrollable framed terminal, clickable band and strip, now-first band, grouped menu)