Note: making flua even easier for agents

Status: tier 1 and 2 implemented (2026-10-13); tier 3 (MCP) deferred.

Context

A user with a bare pip install fibaro-flua + --tool setup already has a working agent loop: self-asserting QA → flua --api local --instant qa.lua → grep stdout → exit code. The loop leaned on three fragile things: hand-rolled expect() boilerplate, human-formatted log text, and curl/browser for anything UI-related.

Shipped (2026-10-13)

Verified facts (probed 2026-10-13)

Ideas, ranked

Tier 1 — the loop itself — DONE

  1. Built-in test library via require — require("flua-test").
  2. Machine-readable output — --log json / --logfile FILE.
  3. UI helpers in Lua — _FLUA.uiEvent + self:getView().
  4. Text rendering of the UI — flua --tool ui.

Tier 2 — loop robustness — DONE

  1. Multi-QA exit aggregation regression test.
  2. Per-run log file — --logfile FILE.
  3. Final verdict line — stderr, every failing QA, any log mode.

Tier 3 — the long game — DRAFTED

  1. MCP server exposing run/check/inspect as tools — the agent-ecosystem direction (Claude/Copilot hosts). Real project; not a quick win. First design draft: docs/notes/notes-mcp.md.

Benefit analysis (2026-10-13): skills = knowledge, --tool/CLI = the engine's manual interface, MCP = a machine interface for hosts that prefer one. Four deltas: (1) typed tool schemas instead of arg-string/parse-text friction; (2) hosts with no/unreliable shell (Claude Desktop etc.) get flua at all; (3) live stateful sessions — a running engine across tool calls (inspect, inject events, poke) vs one-shot runs; (4) one standard surface for every host. V1 scope suggestion: stdio JSON-RPC, dependency-free, 4-6 tools (check, run with instant/json, ui_text, inject_ui_event, devices) wrapping the existing engine/tools.

Known gaps (found while shipping)