From feb42e204cffc31174ceaa3d4d27fccf60f38848 Mon Sep 17 00:00:00 2001 From: ruv Date: Mon, 5 Oct 2026 14:28:49 -0400 Subject: [PATCH] feat(ruflo-console): the Security view's text field sits in a round border (0.33.19) The paste field under "Check text" was a bare line among the buttons, so it was hard to tell where to type. It is now wrapped in a round bordered box (info colour, one column of padding), the same treatment the loops, missions and events fields already have. The check buttons below still act on it; without a text-field surface the view still says how to type instead. Co-Authored-By: RuFlo --- .../ruflo-console/.claude-plugin/plugin.json | 2 +- plugins/ruflo-console/hooks/version.ts | 2 +- plugins/ruflo-console/hooks/views/secure.ts | 35 +++++++++------ plugins/ruflo-console/scripts/smoke.sh | 4 +- plugins/ruflo-console/tests/secure.spec.ts | 44 ++++++++++++++++++- 5 files changed, 69 insertions(+), 18 deletions(-) diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json index eb88a4854c..7b7a4960be 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. The one network call it makes by itself is a daily read of the published plugin.json at github.com/ruvnet/ruflo to offer an update (Settings → Updates: ask, auto, or off); it installs only through Claude Code's own claude plugin update, and never a new major version without asking.", - "version": "0.33.18", + "version": "0.33.19", "author": { "name": "ruvnet", "url": "https://github.com/ruvnet" diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts index 076933a87b..520e609493 100644 --- a/plugins/ruflo-console/hooks/version.ts +++ b/plugins/ruflo-console/hooks/version.ts @@ -2,4 +2,4 @@ * The console's version, shown on the header so a person can tell which build is running. Kept equal to the plugin's manifest * (`.claude-plugin/plugin.json`); tests/version.spec.ts fails if the two drift. */ -export const CONSOLE_VERSION = '0.33.18' +export const CONSOLE_VERSION = '0.33.19' diff --git a/plugins/ruflo-console/hooks/views/secure.ts b/plugins/ruflo-console/hooks/views/secure.ts index b404795dfa..d1456f9ef0 100644 --- a/plugins/ruflo-console/hooks/views/secure.ts +++ b/plugins/ruflo-console/hooks/views/secure.ts @@ -155,20 +155,29 @@ function pasteRows(ctx: Ctx): RenderElement[] { const rows: RenderElement[] = [] if (ctx.kit.Input !== undefined) { + // In a round border, like the other views' fields (loops, missions, events): the field is the first thing the eye finds, and the buttons below act on it. rows.push( - ctx.kit.Input({ - key: 'sec-text', - label: 'text', - placeholder: 'paste a prompt, a message or a plan: Enter checks it locally (it is passed as one argv value)', - value: memo.draft, - submitLabel: 'check', - onInput: value => { - memo.draft = value - }, - onSubmit: value => { - memo.draft = value - void ctx.act.run('aid-check', value) - }, + ctx.kit.Box({ + key: 'sec-text-box', + borderStyle: 'round', + borderColor: THEME.info, + paddingX: 1, + children: [ + ctx.kit.Input({ + key: 'sec-text', + label: 'text', + placeholder: 'paste a prompt, a message or a plan: Enter checks it locally (it is passed as one argv value)', + value: memo.draft, + submitLabel: 'check', + onInput: value => { + memo.draft = value + }, + onSubmit: value => { + memo.draft = value + void ctx.act.run('aid-check', value) + }, + }), + ], }), ) } else { diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh index f922aebbe2..ecae447e6e 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.33.18" +step "1. plugin.json declares ruflo-console 0.33.19" grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \ - && grep -q '"version": "0.33.18"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version" + && grep -q '"version": "0.33.19"' "$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/secure.spec.ts b/plugins/ruflo-console/tests/secure.spec.ts index b8464c1509..1631567af8 100644 --- a/plugins/ruflo-console/tests/secure.spec.ts +++ b/plugins/ruflo-console/tests/secure.spec.ts @@ -7,7 +7,9 @@ import { describe, expect, it } from 'vitest' import { PERF, perfMemo, sparkline } from '../hooks/perf' import { actionTypeOf, parseDoctor, pastedOf, SECURE, SECURE_KEYWORDS, SECURE_TEXT, secMemo, secSpec, secTextSpec, textLines } from '../hooks/secure' -import { newState } from '../hooks/state' +import { newState, type State } from '../hooks/state' +import { type Ctx } from '../hooks/views/common' +import { secureView } from '../hooks/views/secure' const ESC = '\u001b' const SCAN_OUT = `\n${ESC}[1mSecurity Scan${ESC}[0m\n${JSON.stringify({ timestamp: '2026-10-02T21:46:00.000Z', target: '.', depth: 'quick', type: 'code', summary: { critical: 1, high: 2, medium: 0, low: 3, total: 6 }, findings: [{ severity: 'critical', type: 'AWS Access Key', location: 'src/a.ts:3', description: 'AWS Access Key' }, { severity: 'high', type: 'Hardcoded Secret', location: 'src/b.ts:9', description: 'Hardcoded Secret' }] }, null, 2)}\n` @@ -142,3 +144,43 @@ describe('the readers', () => { expect(sparkline([1, 2, 3, 4], 2)).toBe('▁█') }) }) + +describe('the paste field is drawn in a border', () => { + type El = { kind: string; props: Record } + const make = (kind: string) => (props: Record): El => ({ kind, props }) + const kit = { Box: make('Box'), Text: make('Text'), Button: make('Button'), Input: make('Input') } + const act = (() => { + const proxy: unknown = new Proxy(() => undefined, { get: (_target, key) => (key === 'then' ? undefined : proxy), apply: () => undefined }) + + return proxy + })() as Ctx['act'] + const flat = (node: unknown): El[] => { + if (typeof node !== 'object' || node === null) return [] + const el = node as El + const children = el.props.children + + return [el, ...(Array.isArray(children) ? children.flatMap(flat) : flat(children))] + } + const draw = (state: State, withInput: boolean) => secureView({ kit: withInput ? kit : { Box: kit.Box, Text: kit.Text, Button: kit.Button }, state, act, columns: 100, nowMs: 1_000, pictures: new Map() } as unknown as Ctx) + + it('wraps the text field in a round bordered box, and the box holds that one field', () => { + const state = newState({ boot: false }) + + state.view = 'secure' + const boxes = flat(draw(state, true)).filter(el => el.kind === 'Box' && el.props.key === 'sec-text-box') + + expect(boxes).toHaveLength(1) + expect(boxes[0]?.props.borderStyle).toBe('round') + expect(flat(boxes[0]).filter(el => el.kind === 'Input').map(el => el.props.key)).toEqual(['sec-text']) + }) + + it('keeps no field in the tree when the surface has no text field, and says how to type instead', () => { + const state = newState({ boot: false }) + + state.view = 'secure' + const tree = flat(draw(state, false)) + + expect(tree.some(el => el.kind === 'Input' || el.props.key === 'sec-text-box')).toBe(false) + expect(tree.some(el => typeof el.props.children === 'string' && /no text field/.test(el.props.children))).toBe(true) + }) +})