@runtypelabs/persona 4.28.0 → 4.28.1
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/{approval-ui-QAKWNFNM.js → approval-ui-OBBI62ES.js} +1 -1
- package/dist/approval-ui.cjs +2 -2
- package/dist/approval-ui.d.cts +7 -5
- package/dist/approval-ui.d.ts +7 -5
- package/dist/approval-ui.js +2 -2
- package/dist/artifacts-ui.d.cts +7 -5
- package/dist/artifacts-ui.d.ts +7 -5
- package/dist/{chunk-NQLDCJAP.js → chunk-D4TDKCT5.js} +2 -2
- package/dist/chunk-FNXK3VTC.js +1 -0
- package/dist/{client-history-LV3KHEFA.js → client-history-QGAFMCBE.js} +1 -1
- package/dist/client-history.js +1 -1
- package/dist/{client-stream-N22JHTLE.js → client-stream-WXD2FL23.js} +1 -1
- package/dist/client-stream.js +3 -3
- package/dist/codegen.cjs +4 -4
- package/dist/codegen.js +5 -5
- package/dist/context-mentions.d.cts +7 -5
- package/dist/context-mentions.d.ts +7 -5
- package/dist/event-stream-view.d.cts +7 -5
- package/dist/event-stream-view.d.ts +7 -5
- package/dist/forms-ui.d.cts +7 -5
- package/dist/forms-ui.d.ts +7 -5
- package/dist/index.cjs +40 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -30
- package/dist/index.d.ts +32 -30
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/session-reconnect.d.cts +7 -5
- package/dist/session-reconnect.d.ts +7 -5
- package/dist/smart-dom-reader.d.cts +7 -5
- package/dist/smart-dom-reader.d.ts +7 -5
- package/dist/theme-editor-preview.cjs +51 -51
- package/dist/theme-editor-preview.d.cts +7 -5
- package/dist/theme-editor-preview.d.ts +7 -5
- package/dist/theme-editor-preview.js +4 -4
- package/dist/theme-editor.d.cts +8 -6
- package/dist/theme-editor.d.ts +8 -6
- package/dist/{voice-runtime-LVUMPUDS.js → voice-runtime-TWFJ4UUS.js} +1 -1
- package/dist/voice-runtime.cjs +1 -1
- package/dist/voice-runtime.d.cts +7 -5
- package/dist/voice-runtime.d.ts +7 -5
- package/dist/voice-runtime.js +1 -1
- package/dist/webmcp-runtime-5Q3IHAHP.js +6 -0
- package/dist/webmcp-runtime.cjs +2 -2
- package/dist/webmcp-runtime.d.cts +22 -26
- package/dist/webmcp-runtime.d.ts +22 -26
- package/dist/webmcp-runtime.js +2 -2
- package/package.json +5 -2
- package/src/generated/runtype-openapi-contract.ts +3 -0
- package/src/theme-editor/webmcp/types.ts +1 -1
- package/src/types.ts +7 -5
- package/src/webmcp-bridge.test.ts +87 -21
- package/src/webmcp-bridge.ts +21 -26
- package/src/webmcp-polyfill.integration.test.ts +339 -0
- package/src/webmcp-polyfill.ts +7 -4
- package/src/webmcp-runtime-bundle.test.ts +1 -1
- package/src/webmcp-runtime-entry.ts +34 -19
- package/dist/chunk-AALCT54S.js +0 -1
- package/dist/webmcp-runtime-V6ZWW3PI.js +0 -6
package/dist/index.d.cts
CHANGED
|
@@ -2413,6 +2413,9 @@ type RuntypeClientChatRequest = {
|
|
|
2413
2413
|
sessionId: string;
|
|
2414
2414
|
submitMode?: "normal" | "interrupt" | "steer";
|
|
2415
2415
|
turnId?: string;
|
|
2416
|
+
voice?: {
|
|
2417
|
+
spoken?: boolean;
|
|
2418
|
+
};
|
|
2416
2419
|
};
|
|
2417
2420
|
type RuntypeClientChatStreamEvent = RuntypeExecutionStreamEvent;
|
|
2418
2421
|
type RuntypeClientResumeRequest = {
|
|
@@ -3455,9 +3458,8 @@ type WebMcpConfirmInfo = {
|
|
|
3455
3458
|
};
|
|
3456
3459
|
/**
|
|
3457
3460
|
* Why the confirm was requested. Currently always `'gate'`: the default
|
|
3458
|
-
* confirm-by-default gate that fires before every `webmcp:*` call.
|
|
3459
|
-
*
|
|
3460
|
-
* internally, so Persona no longer surfaces a nested in-tool confirm.)
|
|
3461
|
+
* confirm-by-default gate that fires before every `webmcp:*` call. Tool
|
|
3462
|
+
* callbacks on v6 receive an AbortSignal, not a nested confirmation API.
|
|
3461
3463
|
*/
|
|
3462
3464
|
reason: 'gate';
|
|
3463
3465
|
};
|
|
@@ -9948,8 +9950,11 @@ type AgentWidgetConfig = {
|
|
|
9948
9950
|
/**
|
|
9949
9951
|
* WebMCP: consume page-registered tools (`document.modelContext.registerTool`).
|
|
9950
9952
|
* When `enabled`, the widget installs `@mcp-b/webmcp-polyfill`, snapshots the
|
|
9951
|
-
* registry on every dispatch, ships it as `clientTools[]`,
|
|
9952
|
-
* returned `webmcp:*`
|
|
9953
|
+
* current document's registry on every dispatch, ships it as `clientTools[]`,
|
|
9954
|
+
* and executes returned `webmcp:*` calls with confirm-by-default gating.
|
|
9955
|
+
* Supports host-installed v5 JSON-string and v6 object-input contracts.
|
|
9956
|
+
* The automatic fallback stays on v5 to preserve existing browser support
|
|
9957
|
+
* and callback-result behavior.
|
|
9953
9958
|
*
|
|
9954
9959
|
* Server-side policy on the chat surface is the source of truth: these
|
|
9955
9960
|
* fields layer on top.
|
|
@@ -12677,26 +12682,19 @@ declare const createWidgetHostLayout: (target: HTMLElement, config?: AgentWidget
|
|
|
12677
12682
|
* enforcement live on the Runtype API; this bridge mirrors those checks
|
|
12678
12683
|
* client-side as a usability convenience, not a security boundary.
|
|
12679
12684
|
*
|
|
12680
|
-
*
|
|
12681
|
-
*
|
|
12682
|
-
*
|
|
12683
|
-
*
|
|
12684
|
-
*
|
|
12685
|
-
*
|
|
12686
|
-
*
|
|
12687
|
-
*
|
|
12688
|
-
*
|
|
12689
|
-
*
|
|
12690
|
-
*
|
|
12691
|
-
*
|
|
12692
|
-
*
|
|
12693
|
-
*: a static import would install the global for every widget consumer,
|
|
12694
|
-
* including those that never opted into WebMCP.
|
|
12695
|
-
*
|
|
12696
|
-
* Confirm model: every `webmcp:*` call goes through one confirm gate before
|
|
12697
|
-
* `execute()` runs, regardless of `annotations.readOnlyHint`. (The polyfill owns
|
|
12698
|
-
* the spec's `client.requestUserInteraction` callback internally; Persona cannot
|
|
12699
|
-
* inject a nested confirm there, so the single outer gate is the whole story.)
|
|
12685
|
+
* Supports v5's JSON-string input and v6's object input with a single call:
|
|
12686
|
+
* the runtime passes a JSON object that also string-coerces to JSON text.
|
|
12687
|
+
* Never infer the execution contract from metadata or retry a failed call.
|
|
12688
|
+
* Only tools owned by this document are exposed: the wire addresses tools by
|
|
12689
|
+
* name, not by frame. Callbacks must validate their own input.
|
|
12690
|
+
*
|
|
12691
|
+
* The automatic fallback stays on v5 to preserve its browser requirements and
|
|
12692
|
+
* result semantics. Host pages may install v5 or v6 themselves; Persona does
|
|
12693
|
+
* not replace an existing context. v5's initializeWebMCPPolyfill() and v6's
|
|
12694
|
+
* installWebMCP() are both accepted by custom loaders.
|
|
12695
|
+
*
|
|
12696
|
+
* Every call passes one confirm gate before execution, regardless of
|
|
12697
|
+
* annotations.readOnlyHint. v6 callbacks also receive an invocation signal.
|
|
12700
12698
|
*/
|
|
12701
12699
|
|
|
12702
12700
|
/** Server-applied wire prefix; strip when looking up registry entries. */
|
|
@@ -12719,18 +12717,20 @@ interface ModelContextToolInfo {
|
|
|
12719
12717
|
* object. `@mcp-b/webmcp-polyfill` made the switch in v5, and Chrome ships it
|
|
12720
12718
|
* from 154.0.8013 (cross-document tools first) -- but Chrome 149-153, most of
|
|
12721
12719
|
* the Origin Trial population, and 154's same-document tools still emit the
|
|
12722
|
-
* string. Both
|
|
12720
|
+
* string. Both input execution contracts are supported independently of
|
|
12721
|
+
* schema representation.
|
|
12723
12722
|
*
|
|
12724
12723
|
* Absent when the tool registered no schema: v5 omits the member, where v4
|
|
12725
12724
|
* always emitted a `{"type":"object"}` string.
|
|
12726
12725
|
*/
|
|
12727
12726
|
inputSchema?: object | string;
|
|
12727
|
+
/** Owning frame and origin, when supplied by the registry. Never sent on the wire. */
|
|
12728
|
+
window?: Window;
|
|
12729
|
+
origin?: string;
|
|
12728
12730
|
/**
|
|
12729
12731
|
* Display title declared on the tool (`ToolDescriptor.title` in the WebMCP
|
|
12730
12732
|
* spec). The polyfill returns `""` when the tool didn't declare one. Note:
|
|
12731
|
-
* `
|
|
12732
|
-
* this strict consumer surface: top-level `title` is the only display-name
|
|
12733
|
-
* channel available to us.
|
|
12733
|
+
* top-level `title` is the display-name channel, not `annotations.title`.
|
|
12734
12734
|
*/
|
|
12735
12735
|
title?: string;
|
|
12736
12736
|
/**
|
|
@@ -12747,6 +12747,8 @@ interface ModelContextToolInfo {
|
|
|
12747
12747
|
/** The slice of `@mcp-b/webmcp-polyfill` the bridge consumes on install. */
|
|
12748
12748
|
type WebMcpPolyfillModule = {
|
|
12749
12749
|
initializeWebMCPPolyfill: () => void;
|
|
12750
|
+
} | {
|
|
12751
|
+
installWebMCP: () => void;
|
|
12750
12752
|
};
|
|
12751
12753
|
/**
|
|
12752
12754
|
* Strip the server-applied `webmcp:` prefix from a wire-format tool name.
|
|
@@ -14543,7 +14545,7 @@ declare class WebMcpBridge$1 {
|
|
|
14543
14545
|
* - tool not in registry (e.g. unmounted between snapshot and call)
|
|
14544
14546
|
* - tool excluded by the client allowlist
|
|
14545
14547
|
* - user declined the confirm gate
|
|
14546
|
-
* - `execute()` threw or
|
|
14548
|
+
* - `execute()` threw or returned a non-serializable result
|
|
14547
14549
|
* - `execute()` exceeded the 30s timeout
|
|
14548
14550
|
* - `signal` fired (session-level `cancel()`)
|
|
14549
14551
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -2413,6 +2413,9 @@ type RuntypeClientChatRequest = {
|
|
|
2413
2413
|
sessionId: string;
|
|
2414
2414
|
submitMode?: "normal" | "interrupt" | "steer";
|
|
2415
2415
|
turnId?: string;
|
|
2416
|
+
voice?: {
|
|
2417
|
+
spoken?: boolean;
|
|
2418
|
+
};
|
|
2416
2419
|
};
|
|
2417
2420
|
type RuntypeClientChatStreamEvent = RuntypeExecutionStreamEvent;
|
|
2418
2421
|
type RuntypeClientResumeRequest = {
|
|
@@ -3455,9 +3458,8 @@ type WebMcpConfirmInfo = {
|
|
|
3455
3458
|
};
|
|
3456
3459
|
/**
|
|
3457
3460
|
* Why the confirm was requested. Currently always `'gate'`: the default
|
|
3458
|
-
* confirm-by-default gate that fires before every `webmcp:*` call.
|
|
3459
|
-
*
|
|
3460
|
-
* internally, so Persona no longer surfaces a nested in-tool confirm.)
|
|
3461
|
+
* confirm-by-default gate that fires before every `webmcp:*` call. Tool
|
|
3462
|
+
* callbacks on v6 receive an AbortSignal, not a nested confirmation API.
|
|
3461
3463
|
*/
|
|
3462
3464
|
reason: 'gate';
|
|
3463
3465
|
};
|
|
@@ -9948,8 +9950,11 @@ type AgentWidgetConfig = {
|
|
|
9948
9950
|
/**
|
|
9949
9951
|
* WebMCP: consume page-registered tools (`document.modelContext.registerTool`).
|
|
9950
9952
|
* When `enabled`, the widget installs `@mcp-b/webmcp-polyfill`, snapshots the
|
|
9951
|
-
* registry on every dispatch, ships it as `clientTools[]`,
|
|
9952
|
-
* returned `webmcp:*`
|
|
9953
|
+
* current document's registry on every dispatch, ships it as `clientTools[]`,
|
|
9954
|
+
* and executes returned `webmcp:*` calls with confirm-by-default gating.
|
|
9955
|
+
* Supports host-installed v5 JSON-string and v6 object-input contracts.
|
|
9956
|
+
* The automatic fallback stays on v5 to preserve existing browser support
|
|
9957
|
+
* and callback-result behavior.
|
|
9953
9958
|
*
|
|
9954
9959
|
* Server-side policy on the chat surface is the source of truth: these
|
|
9955
9960
|
* fields layer on top.
|
|
@@ -12677,26 +12682,19 @@ declare const createWidgetHostLayout: (target: HTMLElement, config?: AgentWidget
|
|
|
12677
12682
|
* enforcement live on the Runtype API; this bridge mirrors those checks
|
|
12678
12683
|
* client-side as a usability convenience, not a security boundary.
|
|
12679
12684
|
*
|
|
12680
|
-
*
|
|
12681
|
-
*
|
|
12682
|
-
*
|
|
12683
|
-
*
|
|
12684
|
-
*
|
|
12685
|
-
*
|
|
12686
|
-
*
|
|
12687
|
-
*
|
|
12688
|
-
*
|
|
12689
|
-
*
|
|
12690
|
-
*
|
|
12691
|
-
*
|
|
12692
|
-
*
|
|
12693
|
-
*: a static import would install the global for every widget consumer,
|
|
12694
|
-
* including those that never opted into WebMCP.
|
|
12695
|
-
*
|
|
12696
|
-
* Confirm model: every `webmcp:*` call goes through one confirm gate before
|
|
12697
|
-
* `execute()` runs, regardless of `annotations.readOnlyHint`. (The polyfill owns
|
|
12698
|
-
* the spec's `client.requestUserInteraction` callback internally; Persona cannot
|
|
12699
|
-
* inject a nested confirm there, so the single outer gate is the whole story.)
|
|
12685
|
+
* Supports v5's JSON-string input and v6's object input with a single call:
|
|
12686
|
+
* the runtime passes a JSON object that also string-coerces to JSON text.
|
|
12687
|
+
* Never infer the execution contract from metadata or retry a failed call.
|
|
12688
|
+
* Only tools owned by this document are exposed: the wire addresses tools by
|
|
12689
|
+
* name, not by frame. Callbacks must validate their own input.
|
|
12690
|
+
*
|
|
12691
|
+
* The automatic fallback stays on v5 to preserve its browser requirements and
|
|
12692
|
+
* result semantics. Host pages may install v5 or v6 themselves; Persona does
|
|
12693
|
+
* not replace an existing context. v5's initializeWebMCPPolyfill() and v6's
|
|
12694
|
+
* installWebMCP() are both accepted by custom loaders.
|
|
12695
|
+
*
|
|
12696
|
+
* Every call passes one confirm gate before execution, regardless of
|
|
12697
|
+
* annotations.readOnlyHint. v6 callbacks also receive an invocation signal.
|
|
12700
12698
|
*/
|
|
12701
12699
|
|
|
12702
12700
|
/** Server-applied wire prefix; strip when looking up registry entries. */
|
|
@@ -12719,18 +12717,20 @@ interface ModelContextToolInfo {
|
|
|
12719
12717
|
* object. `@mcp-b/webmcp-polyfill` made the switch in v5, and Chrome ships it
|
|
12720
12718
|
* from 154.0.8013 (cross-document tools first) -- but Chrome 149-153, most of
|
|
12721
12719
|
* the Origin Trial population, and 154's same-document tools still emit the
|
|
12722
|
-
* string. Both
|
|
12720
|
+
* string. Both input execution contracts are supported independently of
|
|
12721
|
+
* schema representation.
|
|
12723
12722
|
*
|
|
12724
12723
|
* Absent when the tool registered no schema: v5 omits the member, where v4
|
|
12725
12724
|
* always emitted a `{"type":"object"}` string.
|
|
12726
12725
|
*/
|
|
12727
12726
|
inputSchema?: object | string;
|
|
12727
|
+
/** Owning frame and origin, when supplied by the registry. Never sent on the wire. */
|
|
12728
|
+
window?: Window;
|
|
12729
|
+
origin?: string;
|
|
12728
12730
|
/**
|
|
12729
12731
|
* Display title declared on the tool (`ToolDescriptor.title` in the WebMCP
|
|
12730
12732
|
* spec). The polyfill returns `""` when the tool didn't declare one. Note:
|
|
12731
|
-
* `
|
|
12732
|
-
* this strict consumer surface: top-level `title` is the only display-name
|
|
12733
|
-
* channel available to us.
|
|
12733
|
+
* top-level `title` is the display-name channel, not `annotations.title`.
|
|
12734
12734
|
*/
|
|
12735
12735
|
title?: string;
|
|
12736
12736
|
/**
|
|
@@ -12747,6 +12747,8 @@ interface ModelContextToolInfo {
|
|
|
12747
12747
|
/** The slice of `@mcp-b/webmcp-polyfill` the bridge consumes on install. */
|
|
12748
12748
|
type WebMcpPolyfillModule = {
|
|
12749
12749
|
initializeWebMCPPolyfill: () => void;
|
|
12750
|
+
} | {
|
|
12751
|
+
installWebMCP: () => void;
|
|
12750
12752
|
};
|
|
12751
12753
|
/**
|
|
12752
12754
|
* Strip the server-applied `webmcp:` prefix from a wire-format tool name.
|
|
@@ -14543,7 +14545,7 @@ declare class WebMcpBridge$1 {
|
|
|
14543
14545
|
* - tool not in registry (e.g. unmounted between snapshot and call)
|
|
14544
14546
|
* - tool excluded by the client allowlist
|
|
14545
14547
|
* - user declined the confirm gate
|
|
14546
|
-
* - `execute()` threw or
|
|
14548
|
+
* - `execute()` threw or returned a non-serializable result
|
|
14547
14549
|
* - `execute()` exceeded the 30s timeout
|
|
14548
14550
|
* - `signal` fired (session-level `cancel()`)
|
|
14549
14551
|
*
|