π 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): 0.13.1 β Memory Lab answers open under the area that was clicked; lab groups fold
ruv794fd527b7d6
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex 47e5a6b9c6..58e9393887 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, 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.13.0",+ "version": "0.13.1","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/hooks/memory-lab.ts b/plugins/ruflo-console/hooks/memory-lab.tsindex d6aa256f50..9511bd9d42 100644--- a/plugins/ruflo-console/hooks/memory-lab.ts+++ b/plugins/ruflo-console/hooks/memory-lab.ts@@ -189,6 +189,7 @@ export function memSpec(entry: MemEntry, input: MemInput, state: State): ActionSargs,expect: entry.cost === 'read' ? 'its output in the lab' : `its result in the lab${entry.note !== undefined ? `; ${entry.note}` : ''}`,lab: entry.id,+ scope: `mem:${state.memoryLab.origin}`,lines: (stdout, stderr) => memLines(entry.id, stdout, stderr),...(entry.cost === 'read' && { isReadOnly: true }),...(entry.note !== undefined && { note: entry.note }),@@ -215,9 +216,11 @@ export type MemoryLabState = {text: stringfilter: string | nullpage: number+ /** The area the last action was raised in (search, entry, browse, or a lab group): its confirm and its result are drawn there. */+ origin: string}-export const emptyMemoryLab = (): MemoryLabState => ({ query: '', scope: 'memory', key: '', value: '', namespace: 'default', text: '', filter: null, page: 0 })+export const emptyMemoryLab = (): MemoryLabState => ({ query: '', scope: 'memory', key: '', value: '', namespace: 'default', text: '', filter: null, page: 0, origin: 'entry' })export type MemField = 'query' | 'key' | 'value' | 'namespace' | 'text'@@ -250,11 +253,13 @@ export type MemoryActions = {export function memoryActions(state: State, runner: Runner, invalidate: () => void): MemoryActions {const lab = state.memoryLab- const go = (id: string, text: string) => {+ const go = (id: string, text: string, origin: string) => {const entry = memEntry(id)if (entry === undefined) return+ lab.origin = origin+// A fresh result reads from its top.state.select.item = 0runner.ask(memSpecOf(entry, text, state), memWhy(entry))@@ -266,7 +271,7 @@ export function memoryActions(state: State, runner: Runner, invalidate: () => vo},search: text => {lab.query = text- go(lab.scope === 'unified' ? 'mem-unified' : 'mem-search', text)+ go(lab.scope === 'unified' ? 'mem-unified' : 'mem-search', text, 'search')},scope: () => {lab.scope = lab.scope === 'memory' ? 'unified' : 'memory'@@ -275,10 +280,11 @@ export function memoryActions(state: State, runner: Runner, invalidate: () => vorun: id => {const entry = memEntry(id)- if (entry !== undefined) go(id, textOfFields(entry, lab))+ // The entry fields' own buttons answer under the entry fields; a lab row answers under its group.+ if (entry !== undefined) go(id, textOfFields(entry, lab), id === 'mem-store' || id === 'mem-retrieve' || id === 'mem-delete' ? 'entry' : entry.group)},- open: entry => go('mem-retrieve', `${entry.namespace} ${entry.key}`),- remove: entry => go('mem-delete', `${entry.namespace} ${entry.key}`),+ open: entry => go('mem-retrieve', `${entry.namespace} ${entry.key}`, 'browse'),+ remove: entry => go('mem-delete', `${entry.namespace} ${entry.key}`, 'browse'),filter: namespace => {lab.filter = lab.filter === namespace ? null : namespacelab.page = 0diff --git a/plugins/ruflo-console/hooks/views/common.ts b/plugins/ruflo-console/hooks/views/common.tsindex ecb543faf9..a35cda3768 100644--- a/plugins/ruflo-console/hooks/views/common.ts+++ b/plugins/ruflo-console/hooks/views/common.ts@@ -302,6 +302,9 @@ export function confirmRow(ctx: Ctx): RenderElement | null {/** Views that draw the confirm themselves, under the field it came from (the pane then does not draw it above the body). */export const INLINE_CONFIRM: ReadonlySet<string> = new Set(['missions', 'hive'])+/** True when the view draws this ask itself (under what raised it), so the pane does not also draw it at the top. */+export const confirmInline = (view: string, scope: string | undefined): boolean => (scope === 'ask' ? false : view === 'memory' ? scope?.startsWith('mem:') === true : INLINE_CONFIRM.has(view))+/** The confirm row when the pending ask came from this scope (or has none, and this is the view's default place for it). */export function confirmHere(ctx: Ctx, scope: string, isDefault = false): RenderElement[] {const pending = ctx.state.pendingdiff --git a/plugins/ruflo-console/hooks/views/memory-lab.ts b/plugins/ruflo-console/hooks/views/memory-lab.tsindex f5b507489a..53a9cd02df 100644--- a/plugins/ruflo-console/hooks/views/memory-lab.ts+++ b/plugins/ruflo-console/hooks/views/memory-lab.ts@@ -1,7 +1,7 @@import type { RenderElement } from 'claude-code'import { MEM_GROUPS, MEM_LAB, memSpecOf, textOfFields, type MemCost, type MemEntry, type MemField } from '../memory-lab'-import { ago, button, clip, row, rule, text, THEME, type Ctx } from './common'+import { ago, button, clip, confirmHere, row, rule, section, text, THEME, type Ctx } from './common'/** Result lines in view at once; j/k scroll the rest. */export const MEM_ROWS = 16@@ -80,6 +80,24 @@ function entryRow(ctx: Ctx, entry: MemEntry, lead: number): RenderElement {)}+/**+ * What the last action in this area asked and answered, drawn right under the area that raised it: its confirm, then the running+ * line or the result. Nothing is drawn for an area the last action did not come from.+ */+export function areaPanel(ctx: Ctx, area: string): RenderElement[] {+ if (ctx.state.memoryLab.origin !== area) return []++ const confirm = confirmHere(ctx, `mem:${area}`)+ const hasOutput = ctx.state.lab.result?.id.startsWith('mem-') === true || ctx.state.lab.running?.id.startsWith('mem-') === true++ // Nothing asked and nothing answered: no empty box.+ if (confirm.length === 0 && !hasOutput) return []++ const result = hasOutput ? resultRows(ctx) : []++ return [ctx.kit.Box({ key: `mem-panel-${area}`, flexDirection: 'column', borderStyle: 'round', borderColor: THEME.ok, paddingX: 1, children: [...confirm, ...result] })]+}+/** The last Memory Lab run: what it was, how it exited, its note, and a window of its lines. */function resultRows(ctx: Ctx): RenderElement[] {const { state, nowMs } = ctx@@ -123,15 +141,16 @@ function resultRows(ctx: Ctx): RenderElement[] {*/export function memoryLabRows(ctx: Ctx): RenderElement[] {const lead = Math.max(15, Math.min(18, ctx.columns - 40))- const rows: RenderElement[] = [...searchRows(ctx), ...entryRows(ctx), ...resultRows(ctx)]+ const rows: RenderElement[] = [...searchRows(ctx), ...areaPanel(ctx, 'search'), ...entryRows(ctx), ...areaPanel(ctx, 'entry')]rows.push(rule(ctx, 'Lab text', 'the input for the rows below that take text'))rows.push(field(ctx, 'text', 'text', 'a query or pattern Β· a node id Β· a | b to compare Β· source relation target', 'keep', value => ctx.act.memory.draft('text', value)))+ // Each group is a section that folds away; the one the last action came from is open, with its answer under its rows.for (const group of MEM_GROUPS) {- rows.push(rule(ctx, group.title, group.right))+ const body = [...MEM_LAB.filter(candidate => candidate.group === group.id).map(entry => entryRow(ctx, entry, lead)), ...areaPanel(ctx, group.id)]- for (const entry of MEM_LAB.filter(candidate => candidate.group === group.id)) rows.push(entryRow(ctx, entry, lead))+ rows.push(...section(ctx, `mem-g-${group.id}`, group.title, group.right, body, true))}rows.push(text(ctx, ' $0 read, runs at once Β· wr writes Β· del deletes for good Β· net may fetch the model: each of these asks, its cost on the confirm row', { dimColor: true }))diff --git a/plugins/ruflo-console/hooks/views/memory.ts b/plugins/ruflo-console/hooks/views/memory.tsindex 711fbb6db2..e90e282520 100644--- a/plugins/ruflo-console/hooks/views/memory.ts+++ b/plugins/ruflo-console/hooks/views/memory.ts@@ -3,7 +3,7 @@ import type { RenderElement } from 'claude-code'import type { MemoryEntry, MemoryStats, Namespaces } from '../data/cli'import { gauge, recency, sparkline } from '../memory-lines'import { ago, button, clip, col, count, kv, live, row, rule, sourceLine, text, THEME, type Ctx } from './common'-import { memoryLabRows } from './memory-lab'+import { areaPanel, memoryLabRows } from './memory-lab'/** Entries in the browse list at once; β βΈ page the rest. */export const BROWSE = 8@@ -140,5 +140,5 @@ export function memoryView(ctx: Ctx): RenderElement {const spaces = live<Namespaces>(ctx.state.probes.get('namespaces'))const entries = spaces?.entries ?? []- return col(ctx, [...storeRows(ctx, memory, spaces), ...namespaceRows(ctx, spaces), ...timelineRows(ctx, entries), ...browseRows(ctx, entries), ...memoryLabRows(ctx), text(ctx, 'spend, budget gauge and burn: Cost (9)', { dimColor: true })], 'memory')+ return col(ctx, [...storeRows(ctx, memory, spaces), ...namespaceRows(ctx, spaces), ...timelineRows(ctx, entries), ...browseRows(ctx, entries), ...areaPanel(ctx, 'browse'), ...memoryLabRows(ctx), text(ctx, 'spend, budget gauge and burn: Cost (9)', { dimColor: true })], 'memory')}diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.tsindex 4188ff121d..75acdd978f 100644--- a/plugins/ruflo-console/hooks/views/pane.ts+++ b/plugins/ruflo-console/hooks/views/pane.ts@@ -11,7 +11,7 @@ import { isBooting, isCompactPane, NAV_STYLES, VIEWS, type ViewId } from '../staimport { agentView } from './agent'import { automateView } from './automate'import { claimsView } from './claims'-import { ago, button, clip, col, confirmRow, INLINE_CONFIRM, isBbs, row, setLook, text, THEME, type Ctx } from './common'+import { ago, button, clip, col, confirmInline, confirmRow, isBbs, row, setLook, text, THEME, type Ctx } from './common'import { costView } from './cost'import { evolveView } from './evolve'import { catalogView } from './plugin-catalog'@@ -263,11 +263,11 @@ export function paneView(ctx: Ctx): RenderElement {// The confirm row sits above the body in both layouts: below it, a tall view would push the question off the screen.// Compact keeps every page's title and its line of purpose; only the banner and the spacing go.const parts = isCompact- ? [tabs(ctx), ...bbs.art, ...(about !== null ? [about] : []), ...(confirm !== null && (!INLINE_CONFIRM.has(ctx.state.view) || ctx.state.pending?.scope === 'ask') ? [confirm] : []), footer(ctx), body]+ ? [tabs(ctx), ...bbs.art, ...(about !== null ? [about] : []), ...(confirm !== null && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), footer(ctx), body]: !isMenu && isBbs()? // Every page but the main menu leads with its own title and purpose line; the welcome line and network links follow, with a blank row between the blocks.- [...bbs.art, ...(about !== null ? [about] : []), ...gap, ...bbs.strip, ...gap, tabs(ctx), ...gap, footer(ctx), ...(confirm !== null && !isTerminal && (!INLINE_CONFIRM.has(ctx.state.view) || ctx.state.pending?.scope === 'ask') ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : [])]- : [...title, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...bbs.strip, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...gap, tabs(ctx), ...gap, ...(isMenu && isBbs() ? [] : [...bbs.art, ...(about !== null ? [about] : [])]), ...gap, ...(isMenu ? [] : [footer(ctx)]), ...(confirm !== null && !isTerminal && (!INLINE_CONFIRM.has(ctx.state.view) || ctx.state.pending?.scope === 'ask') ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : []), ...gap, ...(isMenu ? [footer(ctx)] : [])]+ [...bbs.art, ...(about !== null ? [about] : []), ...gap, ...bbs.strip, ...gap, tabs(ctx), ...gap, footer(ctx), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : [])]+ : [...title, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...bbs.strip, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...gap, tabs(ctx), ...gap, ...(isMenu && isBbs() ? [] : [...bbs.art, ...(about !== null ? [about] : [])]), ...gap, ...(isMenu ? [] : [footer(ctx)]), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : []), ...gap, ...(isMenu ? [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.shindex 02a9670a3c..4345d598eb 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.13.0"+step "1. plugin.json declares ruflo-console 0.13.1"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.13.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.13.1"' "$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/labs.test.ts b/plugins/ruflo-console/tests/labs.test.tsindex 64981f6587..8819745c41 100644--- a/plugins/ruflo-console/tests/labs.test.ts+++ b/plugins/ruflo-console/tests/labs.test.ts@@ -88,7 +88,10 @@ describe('labs and starts', () => {const { text, tree } = await drawn($, 'memory')- for (const section of ['AGENTDB', 'NAMESPACES', 'RECENCY', 'BROWSE', 'SEARCH', 'ENTRY', 'RESULT', 'LAB Β· MEMORY', 'LAB Β· AGENTDB', 'LAB Β· EMBEDDINGS', 'LAB Β· MAINTAIN']) expect(text).toContain(`βββ ${section} βββ`)+ for (const section of ['AGENTDB', 'NAMESPACES', 'RECENCY', 'BROWSE', 'SEARCH', 'ENTRY']) expect(text).toContain(`βββ ${section} βββ`)+ // The lab groups fold away, and nothing is drawn for a result until an action is raised.+ for (const section of ['LAB Β· MEMORY', 'LAB Β· AGENTDB', 'LAB Β· EMBEDDINGS', 'LAB Β· MAINTAIN']) expect(text).toContain(`βββ βΎ ${section} βββ`)+ expect(text).not.toContain('βββ RESULT βββ')expect(text).toContain('1/2 of the newest listed carry a vector')expect(text).toContain('2 more rows in .swarm/agentdb-memory.db')expect(text).toMatch(/ β beta \.+/)@@ -99,6 +102,58 @@ describe('labs and starts', () => {expect(world.runs.filter(argv => /memory (retrieve|search|store|delete|export)|mcp exec -t (memory_|agentdb_|embeddings_)/.test(argv.join(' ')))).toEqual([])})+ test('memory lab: a confirm and a result open under the area that was clicked, not at the top or in one far block', { options: { boot: false } }, async ($, on) => {+ const world = memoryWorld(on)++ mock.clock(on)+ await $.session.start(SESSION)+ await $.command.run(command('memory'))++ const pane = await $.ui.mount({ ...paneAt(110), surface: 'terminal' as const, plugin: PLUGIN })+ const at = (text: string, needle: string) => text.indexOf(needle)++ await pane.drawn()++ // Browse: βΈ view answers right under the browse list, before Search.+ await pane.press({ key: 'mem-open-0' })++ const viewed = textOf(await pane.drawn())++ expect(at(viewed, 'βββ RESULT βββ')).toBeGreaterThan(at(viewed, 'βββ BROWSE βββ'))+ expect(at(viewed, 'βββ RESULT βββ')).toBeLessThan(at(viewed, 'βββ SEARCH βββ'))++ // Browse: βΈ delete asks right there too, and the page's top holds no confirm.+ await pane.press({ key: 'mem-del-0' })++ const asked = textOf(await pane.drawn())++ expect(at(asked, 'Confirm:')).toBeGreaterThan(at(asked, 'βββ BROWSE βββ'))+ expect(at(asked, 'Confirm:')).toBeLessThan(at(asked, 'βββ SEARCH βββ'))+ await pane.press({ key: 'cancel' })++ // A lab row answers inside its own group: the Memory group, before the AgentDB group.+ await pane.press({ key: 'mem-lab-mem-stats' })++ const stats = textOf(await pane.drawn())++ expect(at(stats, 'βββ RESULT βββ')).toBeGreaterThan(at(stats, 'βββ βΎ LAB Β· MEMORY βββ'))+ expect(at(stats, 'βββ RESULT βββ')).toBeLessThan(at(stats, 'βββ βΎ LAB Β· AGENTDB βββ'))+ expect(stats.split('βββ RESULT βββ').length - 1).toBe(1)++ // A write from the entry fields asks under the entry fields, before the lab groups.+ await pane.input({ key: 'mem-namespace', text: 'notes', kind: 'change' })+ await pane.input({ key: 'mem-key', text: 'alpha', kind: 'change' })+ await pane.input({ key: 'mem-value', text: 'a value', kind: 'change' })+ await pane.press({ key: 'mem-do-store' })++ const stored = textOf(await pane.drawn())++ expect(at(stored, 'Confirm:')).toBeGreaterThan(at(stored, 'βββ ENTRY βββ'))+ expect(at(stored, 'Confirm:')).toBeLessThan(at(stored, 'βββ βΎ LAB Β· MEMORY βββ'))+ expect(world.runs.filter(argv => argv.includes('store'))).toEqual([])+ await pane.unmount()+ })+test('memory lab: view reads at once with one fixed argv; delete and store ask with their argv, then run it on yes', { options: { boot: false } }, async ($, on) => {const world = memoryWorld(on)const ran = (word: string) => world.runs.filter(argv => argv[5] === word).map(argv => argv.slice(4).join(' '))diff --git a/v3/docs/adr/ADR-408-ruflo-console-mission-control.md b/v3/docs/adr/ADR-408-ruflo-console-mission-control.mdindex 0b3e3b8e50..34bc0b6f5d 100644--- a/v3/docs/adr/ADR-408-ruflo-console-mission-control.md+++ b/v3/docs/adr/ADR-408-ruflo-console-mission-control.md@@ -69,3 +69,7 @@ Writes are confirm-gated with the exact argv. Remembered actions are not offered- **β¦ Ask Claude** is in every page's footer (`hooks/ask-claude.ts`, `VIEW_ASK` has a row per view): the view's own text (what `/ruflo dump <view>` prints) goes to the primary session as a visible prompt, or a `/btw` aside, with a question (the view's default, or `/ruflo ask <question>`). It asks first with the exact text and a spend note; mid-turn it only fills the prompt box. The screen's lines are quoted data (each behind `β`, so none can start a command), secrets are redacted first (keys, tokens, JWTs, bearer headers, PEM blocks, NAME=value of a secret name), the terminal and Settings share nothing, and a typed question is screened by AIDefence.- **βΈ /plugin:command** appears beside it when the session lists the command of the ruflo plugin that fits the view (cost, security audit, swarm, memory, ...); it asks first.- **Regression matrix** (`tests/matrix.test.ts`): every view, at 80 and 150 columns, draws without error text, names itself, has no duplicate element keys, and its Ask button asks first and then sends exactly one prompt (quoted data, no secret). `tests/ask-claude.spec.ts` covers the table, the scrubber and delivery. `scripts/e2e-smoke.sh` opens every view in a real Claude Code with no AI turn and no write (live only with `RUFLO_E2E_LIVE=1`, otherwise it skips). Smoke steps 14-16 run every pure spec, the e2e skip path and the table coverage.++## 11. Answers open where they were asked (0.13.1)++Memory Lab no longer keeps one Result block far from what was clicked. Each action records where it was raised (`memoryLab.origin`: Browse, Search, Entry, or a lab group) and its confirm (scope `mem:<area>`) and its result are drawn in a bordered panel directly under that area; the pane no longer draws that confirm at the top (`confirmInline`). An area with nothing asked or answered draws no panel. The lab groups are collapsible sections; the group of the last action stays open.