agent_gtk
agent_gtk walks a live GTK 4 widget hierarchy into
agent_core. It classifies widgets through their
GObject ancestry, reads their current geometry and content, and implements the
same grant-aware backend used on the other platforms.
import "agent_gtk/agent_gtk" as agent;
import "agent_core/auth" as auth;
agent::set_agent_id(button.raw(), #str_ptr("save\0"));
var surface = agent::open(window.raw());
let nodes = surface.describe(auth::reader());
let result = surface.click(auth::operator(), "save");
set_agent_policy pins Protected, Private, or excluded content to a widget.
mcp_backend() supplies the platform-neutral vtable for agent_mcp and
agent_inapp. Actions include live-tree refresh, exposure and affordance
checks, capability grants, versioned text writes, and semantic event delivery.
GTK remains single-threaded; callers running the backend away from the GTK main
thread must marshal according to the same rule as other GTK code.
Facet applications normally use facet_agent, which selects this backend on Linux.