@dudko.dev/agent-web 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -297,8 +297,15 @@ SDK added — read `error.code` for the number. A paginated `tools/list` is
297
297
  followed for up to 100 pages (a repeated cursor ends the walk; past the cap a
298
298
  `warn` line says the rest is not mounted).
299
299
 
300
- `connectMcpHttp` returns `{ tools, catalog, results, instructions, protocols, refreshServer, close }`.
301
- `tools` and `catalog` are mutated **in place** by `refreshServer(name)`, so an
300
+ `connectMcpHttp` returns `{ tools, catalog, listed, results, instructions, protocols, refreshServer, close }`.
301
+ `listed` is EVERY tool each server listed, for a host's settings: the ones offered to the model
302
+ and the ones that are not (for its app only, or skipped), each with the key the consent rules
303
+ match (`server__tool`; one not mounted gets a key of its own after the mounted ones - `…_2` when
304
+ its name sanitizes to a mounted tool's -, so no two tools of a connection share one), `mounted`,
305
+ `title`, `readOnly`, `destructive` (MCP's reading of `destructiveHint`, which means something only
306
+ for a tool that is not read-only: there, true unless the server says false; never for a read-only
307
+ tool), the app it declares in `_meta.ui` whatever the apps mode (described only), and
308
+ `appCallable`. It changes nothing of what is mounted or sent. `tools`, `catalog` and `listed` are mutated **in place** by `refreshServer(name)`, so an
302
309
  agent built from them picks up a server's new tool list (react to it via the
303
310
  `onToolsChanged` option) without being rebuilt. Filtering is plain object work:
304
311
  delete the keys you don't want before merging.
@@ -451,11 +458,19 @@ const result = await mcp.apps!.callAppTool('travel', 'flights.book', args)
451
458
  - **Who may call what** (`_meta.ui.visibility`): a tool for its app only (`['app']`) is not
452
459
  mounted for the model; `appTool` / `callAppTool` refuse a tool whose visibility leaves out
453
460
  `'app'`, or that the server does not list - before anything is sent.
454
- - **Consent for an app's calls** - `agent.approveAppToolCall` - is the agent's own gate
455
- (`toolApproval`: its rules, handler and timeout) with two differences: under `'autopilot'` a
456
- write still asks (read-only tools run, as in `'ask-writes'`), and "always allow" given to an app
457
- is remembered for apps only. The request carries `app: { server, tool, resourceUri }`.
458
- `callAppTool` itself does not ask: call it after the consent.
461
+ - **Consent for an app's calls** - `agent.approveAppToolCall(call, onEvent?, signal?, options?)`
462
+ - is the agent's own gate (`toolApproval`: its mode, rules, handler and timeout), the same as
463
+ for the model's calls: `'autopilot'` asks nothing - writes and destructive tools included -,
464
+ an explicit rule still wins (`'ask'` asks, `'deny'` refuses), `'ask-writes'` asks before a write.
465
+ "Always allow" given to an app is remembered for apps only and for THAT app: `appGrantKey` - the
466
+ server's identity on its connection (`call.serverId`, from `McpAppTool.serverId`: opaque, new
467
+ for every connection, so a server removed and another added under the same name inherits
468
+ nothing), the tool and the app's resource - in `options.remembered` when the host passes a set
469
+ (it then outlives the agent: the React package keeps one for the page's life), else in the
470
+ agent's own. It never answers a rule nor outranks a refusal: a `'deny'` rule, `'read-only'` and
471
+ an `'ask'` rule are decided before it (the gate's one order, as for the model's calls - an
472
+ `'ask'` rule asks every time, and its request carries `rule`). The request carries `app: { server, tool, resourceUri }`. `callAppTool` itself does not
473
+ ask: call it after the consent.
459
474
 
460
475
  - **One server's apps off**: `McpHttpServerConfig.apps: false` (over the connection's `apps`) -
461
476
  that server is not told of apps, none of its apps is read, no `mcp.app` is told for it, and a