🌊 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
fix(ruflo-console): a Dev Tools entry's own cost is the floor of its class; jsonAfter stops at the JSON's own end (0.33.17)
ruv8612da1ed98c
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex d69b8e3bb4..3846d6c94c 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.16",+ "version": "0.33.17","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/hooks/actions.ts b/plugins/ruflo-console/hooks/actions.tsindex d2f19bb00c..29fe656be5 100644--- a/plugins/ruflo-console/hooks/actions.ts+++ b/plugins/ruflo-console/hooks/actions.ts@@ -25,6 +25,8 @@ export type ActionSpec = {scope?: string/** The command line the confirm row shows when it is not `ruflo <args>`. */shows?: string+ /** The class the entry itself declares (a Dev Tools entry's `cost`): Claude's confirm gate never reads it as less than this. */+ declared?: 'write' | 'network' | 'install' | 'spend' | 'delete'/** A MetaHarness lab entry's id: the runner keeps what it printed for the lab's result panel. */lab?: string/** What a run costs or writes, in words: the confirm row and the result panel show it. */diff --git a/plugins/ruflo-console/hooks/data/cli.ts b/plugins/ruflo-console/hooks/data/cli.tsindex 4041a8d555..ae4b3a58b2 100644--- a/plugins/ruflo-console/hooks/data/cli.ts+++ b/plugins/ruflo-console/hooks/data/cli.ts@@ -4,6 +4,7 @@* when the person turns `federationNetwork` on. `plugins list` is never run (it fetches the IPFS registry), nor `verify` (it* fetches a manifest from GitHub).*/+import { closeOf } from './json-span'import { idOf, msOf, numberOf, plain, recordOf, stringOf, valuesOf } from './parse'import { researchProbe } from './research'@@ -39,7 +40,11 @@ export function jsonAfter(stdout: string): unknown {return null}- const end = Math.max(text.lastIndexOf('}'), text.lastIndexOf(']'))+ const end = closeOf(text, start)++ if (end < 0) {+ return null+ }try {return JSON.parse(text.slice(start, end + 1))diff --git a/plugins/ruflo-console/hooks/data/json-span.ts b/plugins/ruflo-console/hooks/data/json-span.tsnew file mode 100644index 0000000000..20aec9b0eb--- /dev/null+++ b/plugins/ruflo-console/hooks/data/json-span.ts@@ -0,0 +1,22 @@+/** The index of the bracket that closes the one at `start`, skipping strings; -1 when it never closes. A trailing log line with a stray `}` or `]` is not part of the JSON. */+export function closeOf(text: string, start: number): number {+ let depth = 0+ let inString = false++ for (let i = start; i < text.length; i++) {+ const ch = text[i]++ if (inString) {+ if (ch === '\\') i+++ else if (ch === '"') inString = false+ } else if (ch === '"') {+ inString = true+ } else if (ch === '{' || ch === '[') {+ depth+++ } else if ((ch === '}' || ch === ']') && --depth === 0) {+ return i+ }+ }++ return -1+}diff --git a/plugins/ruflo-console/hooks/devtools.ts b/plugins/ruflo-console/hooks/devtools.tsindex cfedc676a3..b19a3b0491 100644--- a/plugins/ruflo-console/hooks/devtools.ts+++ b/plugins/ruflo-console/hooks/devtools.ts@@ -171,6 +171,9 @@ export const DEV: readonly DevEntry[] = [...SANDBOX,]+/** What an entry's own `cost` says its class is: the console's confirm gate never reads an action as less than this. `local` and `read` declare nothing. */+const DECLARED: Partial<Record<DevCost, NonNullable<ActionSpec['declared']>>> = { writes: 'write', network: 'network', spends: 'spend', deletes: 'delete' }+/** The confirm-free spec for a local read, the asked one for the rest; null when a field breaks its rule or it is n/a. */export function devSpec(entry: DevEntry, fields: DevFields): ActionSpec | null {const args = entry.na === undefined ? ((entry.exec ?? entry.args)?.(fields) ?? null) : null@@ -186,6 +189,7 @@ export function devSpec(entry: DevEntry, fields: DevFields): ActionSpec | null {lab: entry.id,lines: (stdout, stderr) => devLines(entry.id, stdout, stderr),...(entry.cost === 'read' && { isReadOnly: true }),+ ...(DECLARED[entry.cost] !== undefined && { declared: DECLARED[entry.cost] }),...(entry.note !== undefined && { note: entry.note }),...(entry.timeoutMs !== undefined && { timeoutMs: entry.timeoutMs }),}diff --git a/plugins/ruflo-console/hooks/model-tools.ts b/plugins/ruflo-console/hooks/model-tools.tsindex f3970ac5e3..ca60f87577 100644--- a/plugins/ruflo-console/hooks/model-tools.ts+++ b/plugins/ruflo-console/hooks/model-tools.ts@@ -61,7 +61,15 @@ const INSTALL = /\b(install\w*|marketplace|claude plugin|plugin (enable|disable|const NETWORK = /\b(network|publish|deploy|push|install|download|fetch|registry|github|npm|gcloud|upload|update|clone|join|federat|reaches|curl|https?:|ssh|webhook|slack|ipfs|pi\.ruv\.io|x\.ruv\.io|relay|peer|broadcast|sends?|sync)//** Which class an action is, from its label, command and notes; anything unclear counts as the most dangerous class. */-export function classOf(pending: Pick<Pending, 'label' | 'args' | 'note' | 'shows' | 'expect'>): ActionClass {+/** From least to most dangerous: the stricter of the class read from the words and the class the entry declares wins. */+const SEVERITY: readonly ActionClass[] = ['read', 'write', 'network', 'install', 'spend', 'delete']+const stricter = (a: ActionClass, b: ActionClass | undefined): ActionClass => (b !== undefined && SEVERITY.indexOf(b) > SEVERITY.indexOf(a) ? b : a)++export function classOf(pending: Pick<Pending, 'label' | 'args' | 'note' | 'shows' | 'expect' | 'declared'>): ActionClass {+ return stricter(classFromWords(pending), pending.declared)+}++function classFromWords(pending: Pick<Pending, 'label' | 'args' | 'note' | 'shows' | 'expect'>): ActionClass {// The console's own notes say what an action does NOT do too ("spends nothing", "not a charge", "runs no agent"): those must not count.const prose = `${pending.note ?? ''} ${pending.shows ?? ''}`.toLowerCase()diff --git a/plugins/ruflo-console/hooks/runner.ts b/plugins/ruflo-console/hooks/runner.tsindex 05ab8554d1..0455b16710 100644--- a/plugins/ruflo-console/hooks/runner.ts+++ b/plugins/ruflo-console/hooks/runner.ts@@ -143,7 +143,7 @@ export function createRunner(state: State, host: Host, deps: RunnerDeps): Runner}pendingSpec = spec- state.pending = { view: state.view, ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), source: state.control.viaModel ? 'claude' : 'you', ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }) }+ state.pending = { view: state.view, ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), source: state.control.viaModel ? 'claude' : 'you', ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }), ...(spec.declared !== undefined && { declared: spec.declared }) }host.invalidate()}diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.tsindex 7bf7cf7159..ec45bf284a 100644--- a/plugins/ruflo-console/hooks/state.ts+++ b/plugins/ruflo-console/hooks/state.ts@@ -134,7 +134,7 @@ export function optionsOf(raw: PluginOptions | undefined): Options {}/** A mutating action waiting for the person's second press; `shows` is the command line when it is not a ruflo one. */-export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string; /** The page that raised it: the ask shows in full there, and as a pointer on every other page. */ view?: string; /** Who raised it: Claude's tool call or the person's own action (ADR-450 T14). */ source?: 'claude' | 'you'; /** The class of action, set only on Claude's asks. */ kind?: 'write' | 'network' | 'install' | 'spend' | 'delete' }+export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string; /** The page that raised it: the ask shows in full there, and as a pointer on every other page. */ view?: string; /** Who raised it: Claude's tool call or the person's own action (ADR-450 T14). */ source?: 'claude' | 'you'; /** The class the entry declares for itself; the gate takes the stricter of this and the class read from its words. */ declared?: 'write' | 'network' | 'install' | 'spend' | 'delete'; /** The class of action, set only on Claude's asks. */ kind?: 'write' | 'network' | 'install' | 'spend' | 'delete' }/** The MetaHarness lab's last run: what it was, how it exited, its cost note, and its output as lines to scroll. */export type LabResult = { id: string; label: string; ok: boolean; exitCode: number | null; note?: string; lines: string[]; atMs: number }diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.tsindex 5b7183af71..105fb63c48 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.16'+export const CONSOLE_VERSION = '0.33.17'diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex 26c17b65db..5b3955a276 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.16"+step "1. plugin.json declares ruflo-console 0.33.17"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.33.16"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.33.17"' "$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/control-guards.spec.ts b/plugins/ruflo-console/tests/control-guards.spec.tsindex 1142e20b77..0d80643ba6 100644--- a/plugins/ruflo-console/tests/control-guards.spec.ts+++ b/plugins/ruflo-console/tests/control-guards.spec.ts@@ -4,7 +4,8 @@*/import { describe, expect, it } from 'vitest'-import { allows, callTool, lowerOnly, parseControlEnv } from '../hooks/model-tools'+import { DEV } from '../hooks/devtools'+import { allows, callTool, classOf, lowerOnly, parseControlEnv } from '../hooks/model-tools'import { setup } from './fixtures/control-setup'describe('what auto-confirm may never answer (ADR-450 T8)', () => {@@ -43,6 +44,22 @@ describe('what auto-confirm may never answer (ADR-450 T8)', () => {})})+describe('an entry\'s own cost is the floor of its class (ADR-450 T8)', () => {+ it('never reads a network, spend or delete Dev Tools entry as a plain write, whatever its words say', () => {+ const entry = DEV.find(e => e.id === 'dt-prov-test')+ expect(entry?.cost).toBe('network')+ const pending = { label: 'test every configured provider', args: ['providers', 'test', '--all'], expect: 'its result', note: 'asks each one for its models' }++ expect(classOf(pending)).toBe('write')+ expect(classOf({ ...pending, declared: 'network' })).toBe('network')+ expect(classOf({ ...pending, declared: 'write' })).toBe('write')+ })++ it('a declared class never lowers one the words already show', () => {+ expect(classOf({ label: 'delete the thing', args: [], expect: '', declared: 'write' })).toBe('delete')+ })+})+describe('text Claude passes is screened for secrets before it reaches an entry (ADR-450 T8)', () => {const TOKEN = `ghp_${'a1B2c3D4e5'.repeat(4)}`const SECRETS = [TOKEN, 'AKIAABCDEFGHIJKLMNOP', '-----BEGIN OPENSSH PRIVATE KEY-----', 'password=hunter2hunter2hunter2', `sk-ant-${'x'.repeat(30)}`, `xoxb-${'1'.repeat(12)}`]diff --git a/plugins/ruflo-console/tests/pure.spec.ts b/plugins/ruflo-console/tests/pure.spec.tsindex efed0a4964..65936a5ac7 100644--- a/plugins/ruflo-console/tests/pure.spec.ts+++ b/plugins/ruflo-console/tests/pure.spec.ts@@ -115,6 +115,11 @@ describe('CLI JSON', () => {expect(jsonAfter('Transformers.js loaded: x\n{\n "a": 1\n}\n')).toEqual({ a: 1 })expect(jsonAfter('[INFO] Executing tool\nResult:\n{\n "b": [1]\n}')).toEqual({ b: [1] })expect(jsonAfter('no json here')).toBeNull()+ // a trailing log line with a stray bracket is not part of the JSON (#3789)+ expect(jsonAfter('{"available":true,"totalDecisions":5}\n[info] see https://x/guide]')).toEqual({ available: true, totalDecisions: 5 })+ expect(jsonAfter('{"backend":"sqlite","entries":{"total":10}}\nDone (lexical-degraded}')).toEqual({ backend: 'sqlite', entries: { total: 10 } })+ expect(jsonAfter('{"s":"a } and ] in a string","n":1}\ntrailing ]')).toEqual({ s: 'a } and ] in a string', n: 1 })+ expect(jsonAfter('{"cut":')).toBeNull()})it('no probe reaches the network but the opt-in roster and registry; plugins list and verify are never run', () => {