@runtypelabs/persona 4.20.0 → 4.21.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/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-CG-bLFmk.d.cts → types-B_JdVK9o.d.cts} +2 -0
- package/dist/animations/{types-CG-bLFmk.d.ts → types-B_JdVK9o.d.ts} +2 -0
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/animations-extra.d.cts +2 -0
- package/dist/animations-extra.d.ts +2 -0
- package/dist/approval-ui.d.cts +22 -0
- package/dist/approval-ui.d.ts +22 -0
- package/dist/artifacts-ui.d.cts +22 -0
- package/dist/artifacts-ui.d.ts +22 -0
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/context-mentions.d.cts +22 -0
- package/dist/context-mentions.d.ts +22 -0
- package/dist/event-stream-view.d.cts +22 -0
- package/dist/event-stream-view.d.ts +22 -0
- package/dist/forms-ui.d.cts +46 -4
- package/dist/forms-ui.d.ts +46 -4
- package/dist/history-view.d.cts +2 -0
- package/dist/history-view.d.ts +2 -0
- package/dist/index.cjs +43 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -4
- package/dist/index.d.ts +50 -4
- package/dist/index.global.js +30 -30
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +43 -43
- package/dist/index.js.map +1 -1
- package/dist/session-reconnect.d.cts +22 -0
- package/dist/session-reconnect.d.ts +22 -0
- package/dist/smart-dom-reader.d.cts +22 -0
- package/dist/smart-dom-reader.d.ts +22 -0
- package/dist/theme-editor-preview.cjs +53 -53
- package/dist/theme-editor-preview.d.cts +22 -0
- package/dist/theme-editor-preview.d.ts +22 -0
- package/dist/theme-editor-preview.js +31 -31
- package/dist/theme-editor.d.cts +22 -0
- package/dist/theme-editor.d.ts +22 -0
- package/dist/webmcp-runtime.d.cts +16 -0
- package/dist/webmcp-runtime.d.ts +16 -0
- package/package.json +1 -1
- package/src/client-visitor-history.test.ts +342 -3
- package/src/client.test.ts +141 -3
- package/src/client.ts +157 -39
- package/src/generated/runtype-openapi-contract.ts +2 -0
- package/src/session.ts +139 -103
- package/src/session.webmcp.test.ts +48 -1
- package/src/types.ts +30 -0
- package/src/ui.history-lifecycle.test.ts +2 -2
- package/src/ui.ts +77 -6
package/dist/approval-ui.d.cts
CHANGED
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
package/dist/approval-ui.d.ts
CHANGED
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
package/dist/artifacts-ui.d.cts
CHANGED
|
@@ -1646,8 +1646,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1646
1646
|
message: string;
|
|
1647
1647
|
};
|
|
1648
1648
|
executionId: string;
|
|
1649
|
+
finalOutput?: string;
|
|
1649
1650
|
kind: "agent" | "flow";
|
|
1650
1651
|
seq: number;
|
|
1652
|
+
stopReason?: string;
|
|
1651
1653
|
type: "execution_error";
|
|
1652
1654
|
upgradeUrl?: string;
|
|
1653
1655
|
}) | ({
|
|
@@ -2981,6 +2983,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2981
2983
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2982
2984
|
*/
|
|
2983
2985
|
onConfirm?: WebMcpConfirmHandler;
|
|
2986
|
+
/**
|
|
2987
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2988
|
+
* several at once.
|
|
2989
|
+
*
|
|
2990
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2991
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2992
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2993
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2994
|
+
* emitted them; the next starts only after the previous one settles
|
|
2995
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2996
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2997
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2998
|
+
*
|
|
2999
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
3000
|
+
*/
|
|
3001
|
+
execution?: 'parallel' | 'sequential';
|
|
2984
3002
|
};
|
|
2985
3003
|
/**
|
|
2986
3004
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7270,6 +7288,10 @@ type ClientSession = {
|
|
|
7270
7288
|
targetId?: string;
|
|
7271
7289
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7272
7290
|
conversationRevision?: string;
|
|
7291
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7292
|
+
durableRecovery?: {
|
|
7293
|
+
enabled: boolean;
|
|
7294
|
+
};
|
|
7273
7295
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7274
7296
|
visitor?: ClientVisitorGrant;
|
|
7275
7297
|
/** Configuration from the server */
|
package/dist/artifacts-ui.d.ts
CHANGED
|
@@ -1646,8 +1646,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1646
1646
|
message: string;
|
|
1647
1647
|
};
|
|
1648
1648
|
executionId: string;
|
|
1649
|
+
finalOutput?: string;
|
|
1649
1650
|
kind: "agent" | "flow";
|
|
1650
1651
|
seq: number;
|
|
1652
|
+
stopReason?: string;
|
|
1651
1653
|
type: "execution_error";
|
|
1652
1654
|
upgradeUrl?: string;
|
|
1653
1655
|
}) | ({
|
|
@@ -2981,6 +2983,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2981
2983
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2982
2984
|
*/
|
|
2983
2985
|
onConfirm?: WebMcpConfirmHandler;
|
|
2986
|
+
/**
|
|
2987
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2988
|
+
* several at once.
|
|
2989
|
+
*
|
|
2990
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2991
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2992
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2993
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2994
|
+
* emitted them; the next starts only after the previous one settles
|
|
2995
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2996
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2997
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2998
|
+
*
|
|
2999
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
3000
|
+
*/
|
|
3001
|
+
execution?: 'parallel' | 'sequential';
|
|
2984
3002
|
};
|
|
2985
3003
|
/**
|
|
2986
3004
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7270,6 +7288,10 @@ type ClientSession = {
|
|
|
7270
7288
|
targetId?: string;
|
|
7271
7289
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7272
7290
|
conversationRevision?: string;
|
|
7291
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7292
|
+
durableRecovery?: {
|
|
7293
|
+
enabled: boolean;
|
|
7294
|
+
};
|
|
7273
7295
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7274
7296
|
visitor?: ClientVisitorGrant;
|
|
7275
7297
|
/** Configuration from the server */
|
package/dist/codegen.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var R=(e,i)=>{for(var r in i)w(e,r,{get:i[r],enumerable:!0})},W=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of T(i))!M.call(e,a)&&a!==r&&w(e,a,{get:()=>i[a],enumerable:!(s=_(i,a))||s.enumerable});return e};var H=e=>W(w({},"__esModule",{value:!0}),e);var z={};R(z,{generateCodeSnippet:()=>P});module.exports=H(z);var S="4.
|
|
1
|
+
"use strict";var w=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var R=(e,i)=>{for(var r in i)w(e,r,{get:i[r],enumerable:!0})},W=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of T(i))!M.call(e,a)&&a!==r&&w(e,a,{get:()=>i[a],enumerable:!(s=_(i,a))||s.enumerable});return e};var H=e=>W(w({},"__esModule",{value:!0}),e);var z={};R(z,{generateCodeSnippet:()=>P});module.exports=H(z);var S="4.21.0";var j=S;function $(e){return e?.cdnBase?.trim().replace(/\/+$/,"").replace(/[\\'"<>`]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)||`https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${j}/dist`}function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(i=>i.toString()).join(", ")}]`:e.toString()}function q(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var A=`({ text, message }: any) => {
|
|
2
2
|
const jsonSource = (message as any).rawContent || text || message.content;
|
|
3
3
|
if (!jsonSource || typeof jsonSource !== 'string') return null;
|
|
4
4
|
let cleanJson = jsonSource
|
package/dist/codegen.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var x="4.
|
|
1
|
+
var x="4.21.0";var S=x;function w(e){return e?.cdnBase?.trim().replace(/\/+$/,"").replace(/[\\'"<>`]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)||`https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${S}/dist`}function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(i=>i.toString()).join(", ")}]`:e.toString()}function I(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var j=`({ text, message }: any) => {
|
|
2
2
|
const jsonSource = (message as any).rawContent || text || message.content;
|
|
3
3
|
if (!jsonSource || typeof jsonSource !== 'string') return null;
|
|
4
4
|
let cleanJson = jsonSource
|
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -2979,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
2979
2981
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
2980
2982
|
*/
|
|
2981
2983
|
onConfirm?: WebMcpConfirmHandler;
|
|
2984
|
+
/**
|
|
2985
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
2986
|
+
* several at once.
|
|
2987
|
+
*
|
|
2988
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
2989
|
+
* sibling's approval never blocks another's execution. Right for
|
|
2990
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
2991
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
2992
|
+
* emitted them; the next starts only after the previous one settles
|
|
2993
|
+
* (including its approval bubble). Use this when the page tools share
|
|
2994
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
2995
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
2996
|
+
*
|
|
2997
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
2998
|
+
*/
|
|
2999
|
+
execution?: 'parallel' | 'sequential';
|
|
2982
3000
|
};
|
|
2983
3001
|
/**
|
|
2984
3002
|
* The coordinates needed to resume a durable agent turn after the SSE
|
|
@@ -7268,6 +7286,10 @@ type ClientSession = {
|
|
|
7268
7286
|
targetId?: string;
|
|
7269
7287
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7270
7288
|
conversationRevision?: string;
|
|
7289
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7290
|
+
durableRecovery?: {
|
|
7291
|
+
enabled: boolean;
|
|
7292
|
+
};
|
|
7271
7293
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7272
7294
|
visitor?: ClientVisitorGrant;
|
|
7273
7295
|
/** Configuration from the server */
|
package/dist/forms-ui.d.cts
CHANGED
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -3065,6 +3067,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
3065
3067
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
3066
3068
|
*/
|
|
3067
3069
|
onConfirm?: WebMcpConfirmHandler;
|
|
3070
|
+
/**
|
|
3071
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
3072
|
+
* several at once.
|
|
3073
|
+
*
|
|
3074
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
3075
|
+
* sibling's approval never blocks another's execution. Right for
|
|
3076
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
3077
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
3078
|
+
* emitted them; the next starts only after the previous one settles
|
|
3079
|
+
* (including its approval bubble). Use this when the page tools share
|
|
3080
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
3081
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
3082
|
+
*
|
|
3083
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
3084
|
+
*/
|
|
3085
|
+
execution?: 'parallel' | 'sequential';
|
|
3068
3086
|
};
|
|
3069
3087
|
/**
|
|
3070
3088
|
* Agent execution state tracking.
|
|
@@ -7425,6 +7443,10 @@ type ClientSession = {
|
|
|
7425
7443
|
targetId?: string;
|
|
7426
7444
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7427
7445
|
conversationRevision?: string;
|
|
7446
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7447
|
+
durableRecovery?: {
|
|
7448
|
+
enabled: boolean;
|
|
7449
|
+
};
|
|
7428
7450
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7429
7451
|
visitor?: ClientVisitorGrant;
|
|
7430
7452
|
/** Configuration from the server */
|
|
@@ -7524,6 +7546,17 @@ interface WidgetHistoryInternals {
|
|
|
7524
7546
|
/** Persist the revision beside the active conversation id (internal only). */
|
|
7525
7547
|
setStoredConversationRevision?: (revision: string | null) => void;
|
|
7526
7548
|
getStoredConversationRevision?: () => string | null;
|
|
7549
|
+
/** Internal client-token durable resume handle, persisted with widget state. */
|
|
7550
|
+
setStoredResumableHandle?: (handle: {
|
|
7551
|
+
executionId: string;
|
|
7552
|
+
after: string;
|
|
7553
|
+
} | null) => void;
|
|
7554
|
+
getStoredResumableHandle?: () => {
|
|
7555
|
+
executionId: string;
|
|
7556
|
+
after: string;
|
|
7557
|
+
} | null;
|
|
7558
|
+
/** True only while Persona owns a persisted client-token recovery attempt. */
|
|
7559
|
+
shouldResumeDurableConversation?: () => boolean;
|
|
7527
7560
|
/** "Show earlier messages" cursor for the persisted transcript. */
|
|
7528
7561
|
setStoredMessageCursor?: (cursor: string | null) => void;
|
|
7529
7562
|
getStoredMessageCursor?: () => string | null;
|
|
@@ -9906,6 +9939,12 @@ declare class AgentWidgetClient {
|
|
|
9906
9939
|
* Get the current client session (if any)
|
|
9907
9940
|
*/
|
|
9908
9941
|
getClientSession(): ClientSession | null;
|
|
9942
|
+
/** Persona's built-in reconnect transport for client-token sessions. */
|
|
9943
|
+
reconnectClientTokenStream(ctx: {
|
|
9944
|
+
executionId: string;
|
|
9945
|
+
after: string;
|
|
9946
|
+
signal: AbortSignal;
|
|
9947
|
+
}): Promise<Response>;
|
|
9909
9948
|
/**
|
|
9910
9949
|
* Initialize session for client token mode.
|
|
9911
9950
|
* Called automatically on first message if not already initialized.
|
|
@@ -10220,6 +10259,7 @@ declare class AgentWidgetClient {
|
|
|
10220
10259
|
resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
|
|
10221
10260
|
streamResponse?: boolean;
|
|
10222
10261
|
signal?: AbortSignal;
|
|
10262
|
+
after?: string;
|
|
10223
10263
|
}): Promise<Response>;
|
|
10224
10264
|
/**
|
|
10225
10265
|
* The opt-in structured mention channel: the MOST RECENT user turn's
|
|
@@ -11070,10 +11110,12 @@ declare class AgentWidgetSession {
|
|
|
11070
11110
|
/**
|
|
11071
11111
|
* Resolve one or more parallel local-tool awaits sharing one paused
|
|
11072
11112
|
* executionId with a SINGLE `/resume` (core#3878); `resolveWebMcpToolCall`
|
|
11073
|
-
* delegates size-1 resolves here after its guards.
|
|
11074
|
-
* against the page registry concurrently: every gated call renders
|
|
11075
|
-
* native approval bubble, and a sibling's confirm Promise never
|
|
11076
|
-
* another's execution.
|
|
11113
|
+
* delegates size-1 resolves here after its guards. By default each call is
|
|
11114
|
+
* executed against the page registry concurrently: every gated call renders
|
|
11115
|
+
* its own native approval bubble, and a sibling's confirm Promise never
|
|
11116
|
+
* blocks another's execution. With `webmcp.execution: "sequential"` the
|
|
11117
|
+
* calls run one at a time in emission order instead (see the config docs
|
|
11118
|
+
* for when that matters). Outputs are keyed by per-call `webMcpToolCallId`
|
|
11077
11119
|
* (server prefers it over tool name; name-keying remains the fallback for
|
|
11078
11120
|
* legacy single/distinct-tool turns), so two calls to the SAME tool no longer
|
|
11079
11121
|
* collide. The server is tolerant: any call we omit (declined-after-abort,
|
package/dist/forms-ui.d.ts
CHANGED
|
@@ -1644,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1644
1644
|
message: string;
|
|
1645
1645
|
};
|
|
1646
1646
|
executionId: string;
|
|
1647
|
+
finalOutput?: string;
|
|
1647
1648
|
kind: "agent" | "flow";
|
|
1648
1649
|
seq: number;
|
|
1650
|
+
stopReason?: string;
|
|
1649
1651
|
type: "execution_error";
|
|
1650
1652
|
upgradeUrl?: string;
|
|
1651
1653
|
}) | ({
|
|
@@ -3065,6 +3067,22 @@ type AgentWidgetWebMcpConfig = {
|
|
|
3065
3067
|
* `window.confirm` fallback only applies when no widget UI is attached.
|
|
3066
3068
|
*/
|
|
3067
3069
|
onConfirm?: WebMcpConfirmHandler;
|
|
3070
|
+
/**
|
|
3071
|
+
* How the widget runs the `webmcp:*` calls of ONE turn when the model emits
|
|
3072
|
+
* several at once.
|
|
3073
|
+
*
|
|
3074
|
+
* - `'parallel'` (default): every call executes concurrently and a gated
|
|
3075
|
+
* sibling's approval never blocks another's execution. Right for
|
|
3076
|
+
* independent, order-insensitive tools (catalog lookups, add-to-cart).
|
|
3077
|
+
* - `'sequential'`: calls execute one at a time, in the order the model
|
|
3078
|
+
* emitted them; the next starts only after the previous one settles
|
|
3079
|
+
* (including its approval bubble). Use this when the page tools share
|
|
3080
|
+
* mutable state that concurrent execution would interleave, e.g. a
|
|
3081
|
+
* canvas where every stroke selects a color/tool before drawing.
|
|
3082
|
+
*
|
|
3083
|
+
* Either way, all outputs still return to the server in a single `/resume`.
|
|
3084
|
+
*/
|
|
3085
|
+
execution?: 'parallel' | 'sequential';
|
|
3068
3086
|
};
|
|
3069
3087
|
/**
|
|
3070
3088
|
* Agent execution state tracking.
|
|
@@ -7425,6 +7443,10 @@ type ClientSession = {
|
|
|
7425
7443
|
targetId?: string;
|
|
7426
7444
|
/** Opaque change token; differs whenever the conversation transcript mutated. */
|
|
7427
7445
|
conversationRevision?: string;
|
|
7446
|
+
/** Server-negotiated durable reconnect support for this client-token session. */
|
|
7447
|
+
durableRecovery?: {
|
|
7448
|
+
enabled: boolean;
|
|
7449
|
+
};
|
|
7428
7450
|
/** Visitor grant backing history. `token` appears only at mint. */
|
|
7429
7451
|
visitor?: ClientVisitorGrant;
|
|
7430
7452
|
/** Configuration from the server */
|
|
@@ -7524,6 +7546,17 @@ interface WidgetHistoryInternals {
|
|
|
7524
7546
|
/** Persist the revision beside the active conversation id (internal only). */
|
|
7525
7547
|
setStoredConversationRevision?: (revision: string | null) => void;
|
|
7526
7548
|
getStoredConversationRevision?: () => string | null;
|
|
7549
|
+
/** Internal client-token durable resume handle, persisted with widget state. */
|
|
7550
|
+
setStoredResumableHandle?: (handle: {
|
|
7551
|
+
executionId: string;
|
|
7552
|
+
after: string;
|
|
7553
|
+
} | null) => void;
|
|
7554
|
+
getStoredResumableHandle?: () => {
|
|
7555
|
+
executionId: string;
|
|
7556
|
+
after: string;
|
|
7557
|
+
} | null;
|
|
7558
|
+
/** True only while Persona owns a persisted client-token recovery attempt. */
|
|
7559
|
+
shouldResumeDurableConversation?: () => boolean;
|
|
7527
7560
|
/** "Show earlier messages" cursor for the persisted transcript. */
|
|
7528
7561
|
setStoredMessageCursor?: (cursor: string | null) => void;
|
|
7529
7562
|
getStoredMessageCursor?: () => string | null;
|
|
@@ -9906,6 +9939,12 @@ declare class AgentWidgetClient {
|
|
|
9906
9939
|
* Get the current client session (if any)
|
|
9907
9940
|
*/
|
|
9908
9941
|
getClientSession(): ClientSession | null;
|
|
9942
|
+
/** Persona's built-in reconnect transport for client-token sessions. */
|
|
9943
|
+
reconnectClientTokenStream(ctx: {
|
|
9944
|
+
executionId: string;
|
|
9945
|
+
after: string;
|
|
9946
|
+
signal: AbortSignal;
|
|
9947
|
+
}): Promise<Response>;
|
|
9909
9948
|
/**
|
|
9910
9949
|
* Initialize session for client token mode.
|
|
9911
9950
|
* Called automatically on first message if not already initialized.
|
|
@@ -10220,6 +10259,7 @@ declare class AgentWidgetClient {
|
|
|
10220
10259
|
resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
|
|
10221
10260
|
streamResponse?: boolean;
|
|
10222
10261
|
signal?: AbortSignal;
|
|
10262
|
+
after?: string;
|
|
10223
10263
|
}): Promise<Response>;
|
|
10224
10264
|
/**
|
|
10225
10265
|
* The opt-in structured mention channel: the MOST RECENT user turn's
|
|
@@ -11070,10 +11110,12 @@ declare class AgentWidgetSession {
|
|
|
11070
11110
|
/**
|
|
11071
11111
|
* Resolve one or more parallel local-tool awaits sharing one paused
|
|
11072
11112
|
* executionId with a SINGLE `/resume` (core#3878); `resolveWebMcpToolCall`
|
|
11073
|
-
* delegates size-1 resolves here after its guards.
|
|
11074
|
-
* against the page registry concurrently: every gated call renders
|
|
11075
|
-
* native approval bubble, and a sibling's confirm Promise never
|
|
11076
|
-
* another's execution.
|
|
11113
|
+
* delegates size-1 resolves here after its guards. By default each call is
|
|
11114
|
+
* executed against the page registry concurrently: every gated call renders
|
|
11115
|
+
* its own native approval bubble, and a sibling's confirm Promise never
|
|
11116
|
+
* blocks another's execution. With `webmcp.execution: "sequential"` the
|
|
11117
|
+
* calls run one at a time in emission order instead (see the config docs
|
|
11118
|
+
* for when that matters). Outputs are keyed by per-call `webMcpToolCallId`
|
|
11077
11119
|
* (server prefers it over tool name; name-keying remains the fallback for
|
|
11078
11120
|
* legacy single/distinct-tool turns), so two calls to the SAME tool no longer
|
|
11079
11121
|
* collide. The server is tolerant: any call we omit (declined-after-abort,
|