Agentic headless TUI testing (AgentTui) #4

Closed
Milo wants to merge 0 commits from Milo/mudah:milo/agent-tui-testing into main
First-time contributor

Adds headless agentic testing to @mudah-cli/testing: an AI model can now drive a Mudah TUI without a PTY.

  • AgentTui.mount(root) — wraps TestTui's synchronous headless harness
  • observe() — agent-friendly observation: ASCII screen + interactive elements with stable index-path ids (e0, e1.2, ...) + focused element
  • formatAgentPrompt(goal, obs) — compact LLM prompt with the JSON action schema
  • parseAgentAction(json) — validates model output (strips ```json fences) into typed actions: press / type / click / clickAt / wait / done
  • run({ goal, decide, isComplete, maxSteps }) — observe -> decide -> act loop with per-step trace recording; wait advances widget timers deterministically via tick()

Tests: 10 new tests in packages/testing/test/agent.test.ts (all passing), biome clean.

Built by Milo (Simon's AI agent) on the milo/mudah fork.

Adds headless agentic testing to @mudah-cli/testing: an AI model can now drive a Mudah TUI without a PTY. - `AgentTui.mount(root)` — wraps TestTui's synchronous headless harness - `observe()` — agent-friendly observation: ASCII screen + interactive elements with stable index-path ids (e0, e1.2, ...) + focused element - `formatAgentPrompt(goal, obs)` — compact LLM prompt with the JSON action schema - `parseAgentAction(json)` — validates model output (strips ```json fences) into typed actions: press / type / click / clickAt / wait / done - `run({ goal, decide, isComplete, maxSteps })` — observe -> decide -> act loop with per-step trace recording; `wait` advances widget timers deterministically via tick() Tests: 10 new tests in packages/testing/test/agent.test.ts (all passing), biome clean. Built by Milo (Simon's AI agent) on the milo/mudah fork.
feat(testing): export AgentTui from @mudah-cli/testing
Some checks failed
CI / lint (push) Has been cancelled
CI / verify (macos-latest) (push) Has been cancelled
CI / verify (ubuntu-latest) (push) Has been cancelled
CI / verify (windows-latest) (push) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / verify (macos-latest) (pull_request) Has been cancelled
CI / verify (ubuntu-latest) (pull_request) Has been cancelled
CI / verify (windows-latest) (pull_request) Has been cancelled
de8ecd7018
thesimonharms closed this pull request 2026-09-26 12:57:07 -04:00
Some checks failed
CI / lint (push) Has been cancelled
CI / verify (macos-latest) (push) Has been cancelled
CI / verify (ubuntu-latest) (push) Has been cancelled
CI / verify (windows-latest) (push) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / verify (macos-latest) (pull_request) Has been cancelled
CI / verify (ubuntu-latest) (pull_request) Has been cancelled
CI / verify (windows-latest) (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No description provided.