@runtypelabs/persona 4.27.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 +20 -5
- package/dist/approval-ui.d.ts +20 -5
- package/dist/approval-ui.js +2 -2
- package/dist/artifacts-ui.d.cts +20 -5
- package/dist/artifacts-ui.d.ts +20 -5
- package/dist/{chunk-NQLDCJAP.js → chunk-D4TDKCT5.js} +2 -2
- package/dist/chunk-FNXK3VTC.js +1 -0
- package/dist/{client-history-HTRKHBAF.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 +20 -5
- package/dist/context-mentions.d.ts +20 -5
- package/dist/event-stream-view.d.cts +20 -5
- package/dist/event-stream-view.d.ts +20 -5
- package/dist/forms-ui.d.cts +26 -5
- package/dist/forms-ui.d.ts +26 -5
- package/dist/index.cjs +41 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -30
- package/dist/index.d.ts +59 -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 +20 -5
- package/dist/session-reconnect.d.ts +20 -5
- package/dist/smart-dom-reader.d.cts +20 -5
- package/dist/smart-dom-reader.d.ts +20 -5
- package/dist/theme-editor-preview.cjs +63 -63
- package/dist/theme-editor-preview.d.cts +20 -5
- package/dist/theme-editor-preview.d.ts +20 -5
- package/dist/theme-editor-preview.js +6 -6
- package/dist/theme-editor.d.cts +21 -6
- package/dist/theme-editor.d.ts +21 -6
- package/dist/voice-runtime-TWFJ4UUS.js +17 -0
- package/dist/voice-runtime.cjs +8 -8
- package/dist/voice-runtime.d.cts +31 -5
- package/dist/voice-runtime.d.ts +31 -5
- package/dist/voice-runtime.js +8 -8
- 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/client.interrupt.test.ts +18 -0
- package/src/client.ts +7 -0
- package/src/generated/runtype-openapi-contract.ts +3 -0
- package/src/session.ts +11 -3
- package/src/session.voice.test.ts +140 -0
- package/src/theme-editor/webmcp/types.ts +1 -1
- package/src/types.ts +26 -5
- package/src/voice/runtype-voice-provider.ts +93 -11
- package/src/voice/voice-clause-buffer.test.ts +143 -0
- package/src/voice/voice-clause-buffer.ts +187 -0
- package/src/voice/voice-delegation.ts +85 -3
- package/src/voice/voice.test.ts +257 -2
- 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-3255TNY7.js +0 -1
- package/dist/voice-runtime-RHRX4F3T.js +0 -17
- package/dist/webmcp-runtime-V6ZWW3PI.js +0 -6
package/dist/forms-ui.d.cts
CHANGED
|
@@ -3281,9 +3281,8 @@ type WebMcpConfirmInfo = {
|
|
|
3281
3281
|
};
|
|
3282
3282
|
/**
|
|
3283
3283
|
* Why the confirm was requested. Currently always `'gate'`: the default
|
|
3284
|
-
* confirm-by-default gate that fires before every `webmcp:*` call.
|
|
3285
|
-
*
|
|
3286
|
-
* internally, so Persona no longer surfaces a nested in-tool confirm.)
|
|
3284
|
+
* confirm-by-default gate that fires before every `webmcp:*` call. Tool
|
|
3285
|
+
* callbacks on v6 receive an AbortSignal, not a nested confirmation API.
|
|
3287
3286
|
*/
|
|
3288
3287
|
reason: 'gate';
|
|
3289
3288
|
};
|
|
@@ -7294,6 +7293,13 @@ type VoiceDelegationRequest = {
|
|
|
7294
7293
|
role: string;
|
|
7295
7294
|
content: unknown;
|
|
7296
7295
|
}>;
|
|
7296
|
+
/**
|
|
7297
|
+
* Set when the server streams delegated answers (`delegation_stream`): called
|
|
7298
|
+
* with each speakable piece of the turn's answer, in order, while it renders.
|
|
7299
|
+
* The pieces, concatenated, are a prefix of the result's `text`; the result
|
|
7300
|
+
* says how much of it with `streamedChars`.
|
|
7301
|
+
*/
|
|
7302
|
+
stream?: (text: string) => void;
|
|
7297
7303
|
};
|
|
7298
7304
|
/**
|
|
7299
7305
|
* How a delegated turn ended, or that it waits on an approval (contract
|
|
@@ -7324,6 +7330,12 @@ type VoiceDelegationResult = {
|
|
|
7324
7330
|
* @default true
|
|
7325
7331
|
*/
|
|
7326
7332
|
inChat?: boolean;
|
|
7333
|
+
/**
|
|
7334
|
+
* How many leading characters of `text` already went out through
|
|
7335
|
+
* `request.stream` (the rest, such as an approval script, is unstreamed).
|
|
7336
|
+
* Omitted or 0: nothing was streamed.
|
|
7337
|
+
*/
|
|
7338
|
+
streamedChars?: number;
|
|
7327
7339
|
/**
|
|
7328
7340
|
* Set when the turn parked on approvals (`text` then asks for the decision).
|
|
7329
7341
|
* Resolves with the terminal result once the visitor decides (or the
|
|
@@ -9541,8 +9553,11 @@ type AgentWidgetConfig = {
|
|
|
9541
9553
|
/**
|
|
9542
9554
|
* WebMCP: consume page-registered tools (`document.modelContext.registerTool`).
|
|
9543
9555
|
* When `enabled`, the widget installs `@mcp-b/webmcp-polyfill`, snapshots the
|
|
9544
|
-
* registry on every dispatch, ships it as `clientTools[]`,
|
|
9545
|
-
* returned `webmcp:*`
|
|
9556
|
+
* current document's registry on every dispatch, ships it as `clientTools[]`,
|
|
9557
|
+
* and executes returned `webmcp:*` calls with confirm-by-default gating.
|
|
9558
|
+
* Supports host-installed v5 JSON-string and v6 object-input contracts.
|
|
9559
|
+
* The automatic fallback stays on v5 to preserve existing browser support
|
|
9560
|
+
* and callback-result behavior.
|
|
9546
9561
|
*
|
|
9547
9562
|
* Server-side policy on the chat surface is the source of truth: these
|
|
9548
9563
|
* fields layer on top.
|
|
@@ -10507,6 +10522,12 @@ type DispatchOptions = {
|
|
|
10507
10522
|
* `submitMode: "interrupt"` so the server cancels the prior run.
|
|
10508
10523
|
*/
|
|
10509
10524
|
interrupt?: boolean;
|
|
10525
|
+
/**
|
|
10526
|
+
* Client-token only: a voice model reads the reply aloud (a delegated voice
|
|
10527
|
+
* turn). Sends `voice: { spoken: true }` so the server asks for a speakable
|
|
10528
|
+
* answer.
|
|
10529
|
+
*/
|
|
10530
|
+
voiceSpoken?: boolean;
|
|
10510
10531
|
};
|
|
10511
10532
|
type SSEHandler = (event: AgentWidgetEvent) => void;
|
|
10512
10533
|
type SSEEventCallback = (eventType: string, payload: unknown) => void;
|
package/dist/forms-ui.d.ts
CHANGED
|
@@ -3281,9 +3281,8 @@ type WebMcpConfirmInfo = {
|
|
|
3281
3281
|
};
|
|
3282
3282
|
/**
|
|
3283
3283
|
* Why the confirm was requested. Currently always `'gate'`: the default
|
|
3284
|
-
* confirm-by-default gate that fires before every `webmcp:*` call.
|
|
3285
|
-
*
|
|
3286
|
-
* internally, so Persona no longer surfaces a nested in-tool confirm.)
|
|
3284
|
+
* confirm-by-default gate that fires before every `webmcp:*` call. Tool
|
|
3285
|
+
* callbacks on v6 receive an AbortSignal, not a nested confirmation API.
|
|
3287
3286
|
*/
|
|
3288
3287
|
reason: 'gate';
|
|
3289
3288
|
};
|
|
@@ -7294,6 +7293,13 @@ type VoiceDelegationRequest = {
|
|
|
7294
7293
|
role: string;
|
|
7295
7294
|
content: unknown;
|
|
7296
7295
|
}>;
|
|
7296
|
+
/**
|
|
7297
|
+
* Set when the server streams delegated answers (`delegation_stream`): called
|
|
7298
|
+
* with each speakable piece of the turn's answer, in order, while it renders.
|
|
7299
|
+
* The pieces, concatenated, are a prefix of the result's `text`; the result
|
|
7300
|
+
* says how much of it with `streamedChars`.
|
|
7301
|
+
*/
|
|
7302
|
+
stream?: (text: string) => void;
|
|
7297
7303
|
};
|
|
7298
7304
|
/**
|
|
7299
7305
|
* How a delegated turn ended, or that it waits on an approval (contract
|
|
@@ -7324,6 +7330,12 @@ type VoiceDelegationResult = {
|
|
|
7324
7330
|
* @default true
|
|
7325
7331
|
*/
|
|
7326
7332
|
inChat?: boolean;
|
|
7333
|
+
/**
|
|
7334
|
+
* How many leading characters of `text` already went out through
|
|
7335
|
+
* `request.stream` (the rest, such as an approval script, is unstreamed).
|
|
7336
|
+
* Omitted or 0: nothing was streamed.
|
|
7337
|
+
*/
|
|
7338
|
+
streamedChars?: number;
|
|
7327
7339
|
/**
|
|
7328
7340
|
* Set when the turn parked on approvals (`text` then asks for the decision).
|
|
7329
7341
|
* Resolves with the terminal result once the visitor decides (or the
|
|
@@ -9541,8 +9553,11 @@ type AgentWidgetConfig = {
|
|
|
9541
9553
|
/**
|
|
9542
9554
|
* WebMCP: consume page-registered tools (`document.modelContext.registerTool`).
|
|
9543
9555
|
* When `enabled`, the widget installs `@mcp-b/webmcp-polyfill`, snapshots the
|
|
9544
|
-
* registry on every dispatch, ships it as `clientTools[]`,
|
|
9545
|
-
* returned `webmcp:*`
|
|
9556
|
+
* current document's registry on every dispatch, ships it as `clientTools[]`,
|
|
9557
|
+
* and executes returned `webmcp:*` calls with confirm-by-default gating.
|
|
9558
|
+
* Supports host-installed v5 JSON-string and v6 object-input contracts.
|
|
9559
|
+
* The automatic fallback stays on v5 to preserve existing browser support
|
|
9560
|
+
* and callback-result behavior.
|
|
9546
9561
|
*
|
|
9547
9562
|
* Server-side policy on the chat surface is the source of truth: these
|
|
9548
9563
|
* fields layer on top.
|
|
@@ -10507,6 +10522,12 @@ type DispatchOptions = {
|
|
|
10507
10522
|
* `submitMode: "interrupt"` so the server cancels the prior run.
|
|
10508
10523
|
*/
|
|
10509
10524
|
interrupt?: boolean;
|
|
10525
|
+
/**
|
|
10526
|
+
* Client-token only: a voice model reads the reply aloud (a delegated voice
|
|
10527
|
+
* turn). Sends `voice: { spoken: true }` so the server asks for a speakable
|
|
10528
|
+
* answer.
|
|
10529
|
+
*/
|
|
10530
|
+
voiceSpoken?: boolean;
|
|
10510
10531
|
};
|
|
10511
10532
|
type SSEHandler = (event: AgentWidgetEvent) => void;
|
|
10512
10533
|
type SSEEventCallback = (eventType: string, payload: unknown) => void;
|