Gua supports both an AI that assists the developer and an AI that participates in the game. They do not receive the same information or permissions.
01 / DRAWThe game engine renders UI normally
02 / REFLECTThe adapter collects semantic state
03 / CONNECTThe bridge publishes it over WebSocket
04 / ACTTests, Inspector, and MCP operate it
Gua goes beyond UI testing. It exposes UI, explicitly selected game-world information, and authorized gameplay input through one semantic protocol used consistently by tests, Inspector, MCP, WebMCP, Recording, and visual comparison.
OBSERVE / 01Observe UI as a meaningful tree
Read id, role, text, hierarchy, and bounds together with visible, enabled, value, focus, checked, selected, caret, scroll, and range state, all tied to a frame and revision.
Semantic UI Tree · Node state · Logs · Runtime capabilitiesLOCATE / 02Find controls by role and state
Match id, role, text, and value exactly, by substring, or by regular expression. Combine parent scope, direct children, visibility, enabled, selection, and count conditions.
GetById · GetByRole · GetByText · Within · QueryAllACT / 03Operate the game's normal input path
Send click, focus, value, check, select, scroll, and key actions to semantic targets. Confirm the correlated host completion event instead of treating queue acceptance as success.
Click · SetValue · SetChecked · Select · Scroll · PressKeyTEST / 04Wait for UI state in ordinary tests
From NUnit, xUnit, MSTest, or C++, wait for visibility, values, focus, selection, counts, and stable snapshots. Build deterministic tests without fixed sleeps.
Gua.Testing · C++ helpers · Async waits · CancellationCAPTURE / 05Capture a rendered frame as PNG
Request PNGs from rendered Godot or Unity runs and save them with dimensions, session, and frame metadata. Headless, unsupported, timeout, and cancellation remain distinct outcomes.
CaptureScreenshot · SaveScreenshot · Test attachmentVISUAL / 06Detect PNG baseline regressions
Gua.Testing.Visual supports pixel thresholds, allowed difference ratios, masks, and OS/renderer variants. Failures produce Expected, Actual, Diff, and a comparison manifest.
Baseline comparison · Masks · CI artifactsRECORD / 07Record and replay semantic actions
Gua.Testing.Recording stores actions, timing, revisions, and wait conditions, then replays with host completion checks. Sensitive values are represented only by secret keys.
GuaRecorder · GuaReplayer · recording.schema.jsonDIAGNOSE / 08Keep evidence from the failing moment
Collect the UI tree and diff, pending requests, event history, logs, runtime version, environment, screenshot, and game-process output into one failure artifact.
Failure diagnostics · stdout/stderr · Strict isolationINSPECT / 09Investigate and operate through Inspector
The browser and Windows desktop Inspector show the tree, node state, logs, and screenshot. Invoke every semantic action, Recording, Replay, and Visual comparison from the UI.
Tree inspector · Node bounds · Automation panelAGENT / 10Connect development AI and AI players
During development, gui-mcp exposes Debug capabilities. For a native release build, the host must configure gui-mcp with the Player profile; browser WebMCP is always fixed to Player. Both paths then expose only Player-scoped observation and operations.
Debug development · Player gameplay · MCP · WebMCPWORLD / 11Observe opted-in world objects
Publish stable doors, objectives, enemies, and checkpoints as a separate read-only tree with semantic state and player visibility.
World Object Tree · Selectors · Waits · InspectorINPUT / 12Drive bounded gameplay input
Expose a Semantic Game Action map or capability-gated raw input with owner isolation, bounded leases, confirmation, and neutral cleanup.
Action Map · Keyboard · Pointer · Gamepad · TextPOLICY / 13Show an AI player only safe information
Keep developer Debug data complete while the game restricts the UI and World information and UI operations exposed to an AI player.
Debug / Player · Field rules · Action allowlistWEBMCP / 14Expose Web exports inside the browser tab
Register Godot Web or Unity WebGL semantic tools through the page's experimental WebMCP API without a separate MCP server or WebSocket.
gua-webmcp · Godot Web · Unity WebGL · Player profile Godot 4.7The recommended GDScript add-on recursively reflects the Control tree, including Button, LineEdit, TextEdit, CheckBox, OptionButton, ItemList, Range, and ScrollContainer. The external host manages scene startup, available ports, headless/rendered runs, stdout/stderr, and strict resets.
Unity 6The UPM package automatically reflects UI Toolkit, uGUI, and TextMeshPro. External tests can launch Editor Play Mode or a Windows Mono Player for headless semantic tests and rendered Screenshot or Visual tests.
State-based waitsWait for visible, enabled, text, value, focus, checked, selected, count, or a stable snapshot from fresh frames.
Strict locatorsZero or multiple matches fail clearly; multi-result queries are explicit through QueryAll.
Request correlationPair actions with observed host results by request ID without consuming unrelated events.
Test isolationStrict reset detects pending requests, in-flight actions, and leaked events between tests.
Secret handlingRedact sensitive values from snapshots, logs, diagnostics, and recordings, resolving them in memory only during replay.
CI reproductionRun ordinary dotnet test with the public Godot Action and retain diagnostic and Visual artifacts on failure.
The guides are grouped into getting started, exposing the game, operating it with AI, testing and inspection, and cross-cutting safety and reproducibility.