@runtypelabs/persona 3.24.0 → 3.26.0
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 +25 -0
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -190
- package/dist/index.d.ts +190 -190
- package/dist/index.global.js +76 -396
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +37 -37
- package/dist/theme-editor.js +35 -35
- package/package.json +1 -1
- package/src/client.test.ts +49 -0
- package/src/client.ts +18 -0
- package/src/index-core.ts +406 -0
- package/src/index-global.ts +4 -2
- package/src/index.ts +24 -400
package/README.md
CHANGED
|
@@ -525,6 +525,31 @@ inside the subtree is still pierced.
|
|
|
525
525
|
> provenance and update steps. Once upstream republishes correctly this can revert to a
|
|
526
526
|
> normal optional peer dependency.
|
|
527
527
|
|
|
528
|
+
### WebMCP page tools
|
|
529
|
+
|
|
530
|
+
When `webmcp: { enabled: true }` is set, the widget consumes tools the page
|
|
531
|
+
registers on `document.modelContext` (the [WebMCP](https://github.com/webmachinelearning/webmcp)
|
|
532
|
+
producer surface), snapshots them into each request as `clientTools[]`, runs the
|
|
533
|
+
agent's calls on the page, and gates each behind a confirm bubble (override with
|
|
534
|
+
`autoApprove` / `onConfirm`).
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
initAgentWidget({
|
|
538
|
+
// ...config
|
|
539
|
+
webmcp: {
|
|
540
|
+
enabled: true,
|
|
541
|
+
autoApprove: (info) => READ_ONLY_TOOLS.has(info.toolName),
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
**Using WebMCP against a non-Runtype backend (e.g. the Vercel AI SDK)?** The
|
|
547
|
+
widget's WebMCP loop expects Runtype's proxy wire protocol (a `step_await` pause
|
|
548
|
+
→ `/resume` round-trip). See
|
|
549
|
+
[`docs/webmcp-without-runtype.md`](../../docs/webmcp-without-runtype.md) for the
|
|
550
|
+
exact contract and two integration paths, with a runnable Next.js example at
|
|
551
|
+
[`examples/ai-sdk-webmcp/`](../../examples/ai-sdk-webmcp/).
|
|
552
|
+
|
|
528
553
|
### DOM Events
|
|
529
554
|
|
|
530
555
|
The widget dispatches custom DOM events that you can listen to for integration with your application:
|