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): confirm rows asserted by argv; typed text takes any punctuation; a new workflow goes to the picked agent

ruvef6335699079
diff --git a/plugins/ruflo-console/hooks/automate.ts b/plugins/ruflo-console/hooks/automate.ts
index ff9afc6f29..c191d5f7d8 100644
--- a/plugins/ruflo-console/hooks/automate.ts
+++ b/plugins/ruflo-console/hooks/automate.ts
@@ -200,10 +200,10 @@ export function taskCreate(text: string): ActionSpec | null {
})
}
-/** One task step for the first agent on disk (a run needs one); the prompt is the person's, the name its first words. */
+/** One task step for the agent picked on the board (a run needs one); the prompt is the person's, the name its first words. */
export function workflowCreate(state: State, text: string): ActionSpec | null {
const prompt = freeText(text, 300)
- const agentId = idOf(state.snapshot?.agents[0]?.id)
+ const agentId = idOf(selection(state).agent?.id)
if (prompt === null) return null
diff --git a/plugins/ruflo-console/hooks/data/automate.ts b/plugins/ruflo-console/hooks/data/automate.ts
index 8ec6206263..f76499317c 100644
--- a/plugins/ruflo-console/hooks/data/automate.ts
+++ b/plugins/ruflo-console/hooks/data/automate.ts
@@ -56,8 +56,8 @@ export const WORKER_ABOUT: Record<WorkerName, string> = {
testgaps: 'test coverage analysis',
}
-/** Typed text: printable, no control characters, never read as a flag. */
-const TYPED = /^[\p{L}\p{N} .,:;!?'"()[\]{}/@#%&*+=_~<>|$^-]+$/u
+/** Typed text: letters, digits, spaces, punctuation and symbols (an em dash or curly quotes too); `plain` drops controls. */
+const TYPED = /^[\p{L}\p{N}\p{M}\p{P}\p{S} ]+$/u
/** Free text from a field as one argv element or JSON string: cleaned, 1..max characters, not starting with -. */
export function freeText(value: string, max = 200): string | null {
diff --git a/plugins/ruflo-console/hooks/views/automate.ts b/plugins/ruflo-console/hooks/views/automate.ts
index 7d138a37a1..3944bfed2e 100644
--- a/plugins/ruflo-console/hooks/views/automate.ts
+++ b/plugins/ruflo-console/hooks/views/automate.ts
@@ -211,7 +211,7 @@ function workflowRows(ctx: Ctx): RenderElement[] {
rows.push(row(ctx, [text(ctx, ` template ${clip(template.name, 40)} · ${template.steps} steps `, { dimColor: true }), ctx.kit.Button({ key: `run-auto-tpl-new-${template.id}`, label: ' ▸ new', plain: true, onPress: () => void ctx.act.run(`auto-tpl-new-${template.id}`) })], `tpl-${template.id}`))
}
- rows.push(field(ctx, 'auto-wf-new', 'new workflow', 'the prompt for its one task step, for the first agent on disk'))
+ rows.push(field(ctx, 'auto-wf-new', 'new workflow', 'the prompt for its one task step, for the agent picked on the board'))
rows.push(field(ctx, 'auto-wf-validate', 'validate', 'a workflow file in the project, e.g. workflows/build.json', 'check'))
return rows
diff --git a/plugins/ruflo-console/tests/automate.spec.ts b/plugins/ruflo-console/tests/automate.spec.ts
index 91076a02f3..ed82df2e6c 100644
--- a/plugins/ruflo-console/tests/automate.spec.ts
+++ b/plugins/ruflo-console/tests/automate.spec.ts
@@ -77,6 +77,7 @@ describe('typed values', () => {
expect(freeText('')).toBeNull()
expect(freeText('x'.repeat(201))).toBeNull()
expect(freeText('a\u0000b')).toBe('a b')
+ expect(freeText('fix the login — it loops “again”…')).toBe('fix the login — it loops “again”…')
})
it('config keys, values, pairs and paths', () => {
diff --git a/plugins/ruflo-console/tests/views.test.ts b/plugins/ruflo-console/tests/views.test.ts
index 1f0a9c1b00..ea315b4ee9 100644
--- a/plugins/ruflo-console/tests/views.test.ts
+++ b/plugins/ruflo-console/tests/views.test.ts
@@ -401,6 +401,7 @@ describe('views', () => {
const asked = textOf(await pane.drawn())
expect(asked).toContain(`Confirm: run workflow ${WF_ID} (its task steps call a model)?`)
+ expect(asked).toContain(`runs: ruflo mcp exec -t workflow_execute -p ${JSON.stringify({ workflowId: WF_ID })}`)
expect(asked).toContain('COSTS MONEY')
expect(mine()).toHaveLength(1)
await pane.press({ key: 'confirm' })
@@ -433,7 +434,10 @@ describe('views', () => {
const pane = await $.ui.mount({ ...paneAt(110), surface: 'terminal' as const, plugin: PLUGIN })
await pane.press({ key: 'run-nn-train-coordination-20' })
- expect(textOf(await pane.drawn())).toContain('Confirm: train coordination patterns for 20 epochs?')
+ const asked = textOf(await pane.drawn())
+
+ expect(asked).toContain('Confirm: train coordination patterns for 20 epochs?')
+ expect(asked).toContain('runs: ruflo neural train --pattern coordination --epochs 20')
expect(mine()).toEqual([])
await pane.press({ key: 'confirm' })
expect(mine()).toEqual(['neural train --pattern coordination --epochs 20'])