C+
Packages · View as Markdown

agent_inapp

agent_inapp calls a live agent_core::Backend without sockets or JSON-RPC. It exposes the same describe, action, navigation, hit-test, and event surface as agent_mcp, using typed C+ calls.

An in-process session still carries a capability grant. The default open uses auth::operator(): it can read and operate ordinary exposed nodes, but it cannot reach Protected or Private content or edit the tree. Use open_with_grant when a task needs a narrower or explicitly approved wider grant.

import "agent_core/auth" as auth;
import "agent_inapp/agent_inapp" as inapp;

let ordinary: inapp::Session = inapp::open(surface, backend);
let read_only: inapp::Session =
    inapp::open_with_grant(surface, backend, auth::reader());
let approved: inapp::Session =
    inapp::open_with_grant(surface, backend, auth::protected_operator());

let tree = ordinary.describe_ui();
let acted = ordinary.click("save");

The grant is fixed for the session lifetime. Widening access means opening a new session, so approval for one task does not silently become ambient state. Each session also owns its event subscriber and exposes poll_event.

For Facet applications, facet_agent supplies the attached platform surface and backend. Provider I/O and the model tool loop intentionally remain outside this package.