🌊 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): strip whole ANSI sequences from CLI text (agent logs showed [1m)
ruv0f29acc73d0a
diff --git a/plugins/ruflo-console/hooks/data/parse.ts b/plugins/ruflo-console/hooks/data/parse.tsindex 2ea306844a..43327e13cc 100644--- a/plugins/ruflo-console/hooks/data/parse.ts+++ b/plugins/ruflo-console/hooks/data/parse.ts@@ -19,7 +19,8 @@ export function plain(value: unknown, max = 200): string {return ''}- const cleaned = value.replace(/[\u0000-\u001f\u007f-\u009f---]/g, ' ').replace(/\s+/g, ' ').trim()+ // Whole ANSI sequences first (the CLI colours its output): stripping only the ESC byte left `[1m` in log lines.+ const cleaned = value.replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, '').replace(/[\u0000-\u001f\u007f-\u009f---]/g, ' ').replace(/\s+/g, ' ').trim()return cleaned.length <= max ? cleaned : `${cleaned.slice(0, Math.max(0, max - 1))}…`}diff --git a/plugins/ruflo-console/tests/behaviour.test.ts b/plugins/ruflo-console/tests/behaviour.test.tsindex 3a3553483e..960df24e15 100644--- a/plugins/ruflo-console/tests/behaviour.test.ts+++ b/plugins/ruflo-console/tests/behaviour.test.ts@@ -197,7 +197,8 @@ describe('behaviour', () => {const swarm = textOf(await $.ui.render(paneAt(110)))- expect(swarm).toContain('c1 [31m EVIL')+ expect(swarm).toContain('c1 EVIL') // the whole colour sequence is gone, not just its ESC byte+ expect(swarm).not.toContain('[31m')expect(swarm).not.toMatch(/[\u0000-\u001f-](?<!\n)/)await $.command.run(command('claims'))expect(textOf(await $.ui.render(paneAt(110)))).toContain('No claims on disk')diff --git a/plugins/ruflo-console/tests/pure.spec.ts b/plugins/ruflo-console/tests/pure.spec.tsindex 7e3ad6e560..3963738993 100644--- a/plugins/ruflo-console/tests/pure.spec.ts+++ b/plugins/ruflo-console/tests/pure.spec.ts@@ -25,6 +25,11 @@ const memoryFs = (files: Record<string, string>) => ({})describe('readers', () => {+ it('plain() drops whole ANSI colour sequences, not just the ESC byte', () => {+ expect(plain('\u001b[1mLogs for agent-1\u001b[0m')).toBe('Logs for agent-1')+ expect(plain('\u001b[2m11:24:13 AM\u001b[0m [INFO] created')).toBe('11:24:13 AM [INFO] created')+ })+it('read the captured run: one swarm, two agents, two claims (one stealable), a queen and a proposal, no token', () => {expect(parseSwarmStore(at('.claude-flow/swarm/swarm-state.json'))).toMatchObject({ id: 'swarm-1790903031804-y9rnjr', topology: 'hierarchical', status: 'running', strategy: 'specialized', maxAgents: 6 })expect(parseAgents(at('.claude-flow/agents/store.json')).map(agent => `${agent.type}:${agent.status}`)).toEqual(['coder:idle', 'tester:idle'])@@ -53,7 +58,7 @@ describe('readers', () => {})it('plain strips control and bidi characters; idOf admits only id-shaped strings', () => {- expect(plain('a\u001b[31mb\u0000c')).toBe('a [31m b c')+ expect(plain('a\u001b[31mb\u0000c')).toBe('a b c')expect(plain('x'.repeat(50), 10)).toHaveLength(10)expect(idOf('agent-1790903032181-97m25s')).toBe('agent-1790903032181-97m25s')for (const bad of ['bad id!', '-rf', '', 'a'.repeat(200), '../etc', 42]) expect(idOf(bad)).toBeNull()