C+
Packages · View as Markdown

agent_appkit

agent_appkit walks a live AppKit window into the agent_core identity model and implements the common backend vtable used by agent_mcp and agent_inapp.

import "agent_appkit/agent_appkit" as agent;
import "agent_core/auth" as auth;
import "agent_core/identity" as identity;

agent::set_agent_id(button.as_view().raw(), "save");
agent::set_agent_policy(secret.as_view().raw(), identity::policy_protected());

var surface = agent::open(window.raw());
let nodes = surface.describe(auth::reader());
let result = surface.click(auth::operator(), "save");

The backend:

  • derives stable ids from explicit tags and Facet keys;
  • supports exposed and full descriptions without bypassing value grants;
  • applies Open, Protected, Private, and excluded node policy;
  • authorizes reads, actions, and versioned text writes before touching AppKit;
  • translates native notifications into semantic events;
  • marshals UI operations to AppKit's main thread; and
  • exposes mcp_backend() for the platform-neutral adapters.

Use facet_agent when a Facet application should install this backend automatically. See AppKit agent surface for a direct-window example.