The library is the agent-interface-protocol package in packages/aip. The React bindings need nothing beyond React.
The package isn’t published to npm yet. Until it is, add the repo as a workspace or copy packages/aip into your project.

1. Wrap your app

The provider creates the session, shows the token and agent instructions, syncs snapshots and polls for invocations. pages limits it to your agent-enabled pathnames (omit it to connect everywhere); widgetStyle styles its built-in connection panel.

2. Publish state

Every key you publish appears under state in the manifest and updates live. Unmounting removes it. If your state lives in a zustand store, publish the whole store at once:

3. Register actions

The returned function is the same handler the agent calls. Wire your button to it and humans and agents share one code path. Throwing from a handler returns 422 with your error message to the agent.

Input schemas

0.1 supports two shapes:
Numbers are passed as strings (for example "quantity": "2"). Metadata is validated when registered, and input_example must itself be valid.

4. Serve the bridge

Create a bridge for the page, serve discovery, and mount both into Vite:
vite.config.ts
createBridge(storage, waitMs, publicActions, page, pages): publicActions is the catalog agents see without a session, and pages lists every AIP page on the site. The demo’s server/application.ts shows a fuller setup with login and two pages. For production hosting, see Deploy.