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): Dev Tools field entries say which field to fill when empty

ruv0d968d6ecce2
diff --git a/plugins/ruflo-console/hooks/devtools.ts b/plugins/ruflo-console/hooks/devtools.ts
index e12ac021ba..672f572e9e 100644
--- a/plugins/ruflo-console/hooks/devtools.ts
+++ b/plugins/ruflo-console/hooks/devtools.ts
@@ -203,7 +203,10 @@ export function devWhy(entry: DevEntry, fields: DevFields): string {
const filled = (except: DevField | null): DevFields => ({ ...fields, ...Object.fromEntries(failing.filter(field => field !== except).map(field => [field, SAMPLE[field]])) })
const broken = entry.args === undefined || entry.args(filled(null)) === null ? undefined : failing.find(field => entry.args?.(filled(field)) === null)
- return broken === undefined ? 'nothing to run' : `${broken} field: ${fieldRule(broken)}`
+ if (broken === undefined) return 'nothing to run'
+
+ // An empty field is the common case: say where to type, not only the rule.
+ return `${broken} field${fields[broken].trim() === '' ? ' is empty: type it in the field above, then â–¶ run' : ''}: ${fieldRule(broken)}`
}
/** A value each field accepts, to find which field kept an entry from running. */
@@ -228,6 +231,8 @@ export function devPalette(state: State): PaletteEntry[] {
run: {
kind: 'text',
keyword: entry.id,
+ // Said when nothing builds: the field to fill and its rule, not a generic palette hint.
+ why: text => devWhy(entry, text.trim() === '' ? fields : { ...fields, [input]: text.trim() }),
make: text => {
if (text.trim() !== '') fields[input] = text.trim()
diff --git a/plugins/ruflo-console/tests/devtools.spec.ts b/plugins/ruflo-console/tests/devtools.spec.ts
index a92f0c458c..3c06851e55 100644
--- a/plugins/ruflo-console/tests/devtools.spec.ts
+++ b/plugins/ruflo-console/tests/devtools.spec.ts
@@ -180,7 +180,7 @@ describe('the Dev Tools catalog', () => {
const checkpoint = DEV.find(entry => entry.id === 'dt-cow-checkpoint')!
expect(devSpec(checkpoint, fields)).toBeNull()
- expect(devWhy(checkpoint, fields)).toMatch(/^path field: /)
+ expect(devWhy(checkpoint, fields)).toMatch(/^path field( is empty: type it in the field above, then â–¶ run)?: /)
expect(devSpec(DEV.find(entry => entry.id === 'dt-diff-stats')!, fields)?.args).toEqual(['mcp', 'exec', '-t', 'analyze_diff-stats', '-p', '{"ref":"HEAD"}'])
})
})
@@ -274,6 +274,17 @@ describe('headless and the fields', () => {
expect(entries.find(entry => entry.id === 'dt-prov-list')?.run).toMatchObject({ kind: 'spec', spec: { args: ['providers', 'list'], isReadOnly: true } })
})
+ it('a field entry with nothing to run says which field to fill, not a palette hint', () => {
+ const entry = devPalette(newState({})).find(candidate => candidate.id === 'dt-brain')
+
+ expect(entry?.run.kind).toBe('text')
+ if (entry?.run.kind !== 'text') return
+ expect(entry.run.make('')).toBeNull()
+ expect(entry.run.why?.('')).toMatch(/^task field is empty: type it in the field above, then â–¶ run: what you want to do/)
+ expect(entry.run.why?.('-x')).toMatch(/^task field: what you want to do/)
+ expect(entry.run.why?.('review my PR')).toBe('nothing to run')
+ })
+
it('Enter in a field keeps its text and runs its entry, or says the rule; a field with no entry only keeps it', () => {
const state = newState({})
const host = { invalidate: vi.fn() } as unknown as Host