@runtypelabs/persona 3.34.1 → 3.35.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 +11 -11
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-CthJFfNx.d.cts → types-DgYsuwXL.d.cts} +15 -14
- package/dist/animations/{types-CthJFfNx.d.ts → types-DgYsuwXL.d.ts} +15 -14
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/codegen.cjs +11 -11
- package/dist/codegen.js +10 -10
- package/dist/index.cjs +46 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +514 -158
- package/dist/index.d.ts +514 -158
- package/dist/index.global.js +41 -89
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +46 -44
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/launcher.global.js +2 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/markdown-parsers.js +53 -0
- package/dist/plugin-kit.d.cts +4 -4
- package/dist/plugin-kit.d.ts +4 -4
- package/dist/runtype-tts.js +1 -0
- package/dist/smart-dom-reader.cjs +1 -1
- package/dist/smart-dom-reader.d.cts +352 -103
- package/dist/smart-dom-reader.d.ts +352 -103
- package/dist/smart-dom-reader.js +1 -1
- package/dist/theme-editor-preview.cjs +203 -0
- package/dist/theme-editor-preview.d.cts +5748 -0
- package/dist/theme-editor-preview.d.ts +5748 -0
- package/dist/theme-editor-preview.js +203 -0
- package/dist/theme-editor.cjs +14 -131
- package/dist/theme-editor.d.cts +362 -574
- package/dist/theme-editor.d.ts +362 -574
- package/dist/theme-editor.js +14 -131
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +1 -1
- package/dist/theme-reference.d.ts +1 -1
- package/dist/theme-reference.js +1 -1
- package/dist/voice-worklet-player.cjs +80 -0
- package/dist/voice-worklet-player.d.cts +215 -0
- package/dist/voice-worklet-player.d.ts +215 -0
- package/dist/voice-worklet-player.js +80 -0
- package/dist/widget.css +54 -36
- package/package.json +16 -2
- package/src/animations/glyph-cycle.ts +11 -14
- package/src/animations/wipe.ts +1 -1
- package/src/ask-user-question-tool.test.ts +1 -1
- package/src/ask-user-question-tool.ts +6 -8
- package/src/client.test.ts +12 -12
- package/src/client.ts +30 -31
- package/src/codegen.test.ts +1 -1
- package/src/codegen.ts +1 -1
- package/src/components/approval-bubble.test.ts +1 -1
- package/src/components/approval-bubble.ts +3 -3
- package/src/components/artifact-pane.ts +3 -3
- package/src/components/ask-user-question-bubble.test.ts +14 -14
- package/src/components/ask-user-question-bubble.ts +10 -10
- package/src/components/composer-builder.ts +17 -16
- package/src/components/composer-parts.test.ts +54 -0
- package/src/components/composer-parts.ts +95 -126
- package/src/components/demo-carousel.ts +1 -1
- package/src/components/event-stream-view.test.ts +7 -7
- package/src/components/event-stream-view.ts +5 -5
- package/src/components/header-builder.ts +33 -27
- package/src/components/header-layouts.ts +1 -1
- package/src/components/header-parts.test.ts +90 -0
- package/src/components/header-parts.ts +62 -93
- package/src/components/launcher.test.ts +11 -0
- package/src/components/launcher.ts +1 -1
- package/src/components/message-bubble.test.ts +74 -2
- package/src/components/message-bubble.ts +25 -11
- package/src/components/messages.ts +2 -2
- package/src/components/panel.test.ts +1 -1
- package/src/components/panel.ts +92 -97
- package/src/components/pill-composer-builder.ts +28 -24
- package/src/components/reasoning-bubble.ts +2 -2
- package/src/components/suggestions.ts +1 -1
- package/src/components/tool-bubble.ts +1 -1
- package/src/components/widget-view.test.ts +181 -0
- package/src/components/widget-view.ts +234 -0
- package/src/defaults.ts +54 -51
- package/src/generated/runtype-openapi-contract.ts +5 -0
- package/src/index-core.ts +30 -4
- package/src/index-global.ts +73 -6
- package/src/index.ts +7 -1
- package/src/install.test.ts +11 -11
- package/src/install.ts +28 -18
- package/src/launcher-global.ts +25 -14
- package/src/markdown-parsers-eager.ts +20 -0
- package/src/markdown-parsers-entry.ts +4 -0
- package/src/markdown-parsers-loader.ts +49 -0
- package/src/plugin-kit.test.ts +1 -1
- package/src/plugin-kit.ts +7 -7
- package/src/plugins/types.ts +5 -5
- package/src/postprocessors.ts +27 -14
- package/src/runtime/host-layout.test.ts +1 -1
- package/src/runtime/host-layout.ts +4 -5
- package/src/runtime/init.ts +2 -2
- package/src/session.test.ts +5 -6
- package/src/session.ts +333 -227
- package/src/session.voice.test.ts +146 -0
- package/src/session.webmcp.test.ts +24 -25
- package/src/smart-dom-reader.ts +3 -4
- package/src/styles/widget.css +54 -36
- package/src/suggest-replies-tool.test.ts +3 -3
- package/src/suggest-replies-tool.ts +5 -5
- package/src/testing/index.ts +1 -1
- package/src/theme-editor/color-utils.ts +2 -2
- package/src/theme-editor/index.ts +4 -13
- package/src/theme-editor/presets.ts +1 -1
- package/src/theme-editor/preview-utils.ts +22 -20
- package/src/theme-editor/preview.ts +4 -1
- package/src/theme-editor/role-mappings.ts +3 -3
- package/src/theme-editor/sections.ts +21 -20
- package/src/theme-editor/types.ts +1 -1
- package/src/theme-editor/webmcp/index.ts +1 -1
- package/src/theme-editor/webmcp/summary.ts +1 -2
- package/src/theme-editor/webmcp/tools.ts +30 -30
- package/src/theme-editor/webmcp/types.ts +2 -2
- package/src/theme-editor-preview.ts +10 -0
- package/src/theme-reference.ts +26 -26
- package/src/types.ts +368 -99
- package/src/ui.approval-plugin.test.ts +3 -3
- package/src/ui.ask-user-question-plugin.test.ts +9 -9
- package/src/ui.component-directive.test.ts +4 -4
- package/src/ui.composer-bar.test.ts +10 -11
- package/src/ui.composer-keyboard.test.ts +5 -5
- package/src/ui.header-icon-color.test.ts +59 -0
- package/src/ui.scroll.test.ts +5 -6
- package/src/ui.stop-button.test.ts +3 -4
- package/src/ui.suggest-replies.test.ts +2 -2
- package/src/ui.ts +292 -131
- package/src/utils/buttons.ts +1 -1
- package/src/utils/code-generators.ts +1 -1
- package/src/utils/composer-history.ts +3 -3
- package/src/utils/dom-context.test.ts +2 -2
- package/src/utils/dom-context.ts +7 -7
- package/src/utils/dom.test.ts +67 -0
- package/src/utils/dom.ts +75 -0
- package/src/utils/dropdown.ts +2 -2
- package/src/utils/event-stream-buffer.test.ts +2 -2
- package/src/utils/message-fingerprint.test.ts +9 -0
- package/src/utils/message-fingerprint.ts +5 -0
- package/src/utils/morph.ts +1 -1
- package/src/utils/sanitize.ts +32 -16
- package/src/utils/sequence-buffer.test.ts +8 -8
- package/src/utils/sequence-buffer.ts +4 -4
- package/src/utils/smart-dom-adapter.test.ts +1 -1
- package/src/utils/smart-dom-adapter.ts +4 -5
- package/src/utils/speech-text.test.ts +122 -0
- package/src/utils/speech-text.ts +101 -0
- package/src/utils/stream-animation.test.ts +3 -3
- package/src/utils/stream-animation.ts +6 -6
- package/src/utils/theme.test.ts +1 -1
- package/src/utils/throughput-tracker.test.ts +11 -11
- package/src/utils/throughput-tracker.ts +9 -9
- package/src/utils/tokens.ts +13 -13
- package/src/utils/virtual-scroller.ts +1 -1
- package/src/vendor/smart-dom-reader/README.md +4 -4
- package/src/vendor/smart-dom-reader/index.d.ts +1 -1
- package/src/vendor/smart-dom-reader/index.js +2 -2
- package/src/version.ts +1 -1
- package/src/voice/audio-playback-manager.test.ts +159 -0
- package/src/voice/audio-playback-manager.ts +145 -30
- package/src/voice/browser-speech-engine.ts +130 -0
- package/src/voice/fallback-speech-engine.ts +89 -0
- package/src/voice/index.ts +21 -0
- package/src/voice/read-aloud-controller.test.ts +143 -0
- package/src/voice/read-aloud-controller.ts +136 -0
- package/src/voice/runtype-speech-engine.test.ts +280 -0
- package/src/voice/runtype-speech-engine.ts +211 -0
- package/src/voice/runtype-tts-entry.ts +10 -0
- package/src/voice/runtype-tts-loader.test.ts +47 -0
- package/src/voice/runtype-tts-loader.ts +42 -0
- package/src/voice/runtype-voice-provider.ts +332 -537
- package/src/voice/voice-factory.ts +26 -4
- package/src/voice/voice.test.ts +321 -7
- package/src/voice/worklet-playback-engine.ts +272 -0
- package/src/voice-worklet-player.ts +39 -0
- package/src/webmcp-bridge.test.ts +6 -6
- package/src/webmcp-bridge.ts +24 -25
- package/src/webmcp-polyfill.ts +1 -1
- package/src/voice/voice-activity-detector.ts +0 -90
|
@@ -33,7 +33,7 @@ const parseDockWidthToPx = (width: string, shellClientWidth: number): number =>
|
|
|
33
33
|
* the dock column would grow with the conversation and scroll off the page.
|
|
34
34
|
* Clamping the slot keeps the panel viewport-sized (messages scroll
|
|
35
35
|
* internally) even when the page's height chain is missing. `100vh` is set
|
|
36
|
-
* first as a fallback for engines without `dvh` support
|
|
36
|
+
* first as a fallback for engines without `dvh` support: an invalid value
|
|
37
37
|
* leaves the previous one in place.
|
|
38
38
|
*/
|
|
39
39
|
const applyDockSlotMaxHeight = (
|
|
@@ -372,7 +372,7 @@ const applyDockStyles = (
|
|
|
372
372
|
// the containing block for any `position: fixed` descendant, so host pages
|
|
373
373
|
// that render viewport-fixed chrome inside the pushed content (e.g. the
|
|
374
374
|
// dashboard editor's `fixed top-0 right-0` toolbar) resolve `right: 0`
|
|
375
|
-
// against the track's right edge
|
|
375
|
+
// against the track's right edge: `panelPx` past the viewport, off-screen.
|
|
376
376
|
// `margin-left` produces the identical visual offset (the track is clipped
|
|
377
377
|
// by the overflow:hidden shell) without establishing a containing block for
|
|
378
378
|
// fixed OR absolutely-positioned descendants.
|
|
@@ -395,8 +395,7 @@ const applyDockStyles = (
|
|
|
395
395
|
pushTrack.style.width = `${contentPx + panelPx}px`;
|
|
396
396
|
pushTrack.style.transition = dockTransition;
|
|
397
397
|
pushTrack.style.marginLeft = `${marginOffsetPx}px`;
|
|
398
|
-
// Defensively clear any transform a previous reveal mode may have set
|
|
399
|
-
// leaving one would re-establish the fixed-position containing block.
|
|
398
|
+
// Defensively clear any transform a previous reveal mode may have set: // leaving one would re-establish the fixed-position containing block.
|
|
400
399
|
pushTrack.style.transform = "";
|
|
401
400
|
|
|
402
401
|
contentSlot.style.flex = "0 0 auto";
|
|
@@ -536,7 +535,7 @@ const createDockedLayout = (target: HTMLElement, config?: AgentWidgetConfig): Wi
|
|
|
536
535
|
syncPushResizeObserver();
|
|
537
536
|
// Check the height chain once, the first time the panel is actually shown
|
|
538
537
|
// in a layout that depends on it (mobile fullscreen is fixed-position and
|
|
539
|
-
// doesn't
|
|
538
|
+
// doesn't: keep checking until a dependent layout comes around).
|
|
540
539
|
if (
|
|
541
540
|
expanded &&
|
|
542
541
|
!heightChainChecked &&
|
package/src/runtime/init.ts
CHANGED
|
@@ -161,7 +161,7 @@ export const initAgentWidget = (
|
|
|
161
161
|
|
|
162
162
|
mountController();
|
|
163
163
|
// Fired when the controller is mounted and its API is callable. `onReady` is
|
|
164
|
-
// the deprecated alias of `onChatReady` (removed next major)
|
|
164
|
+
// the deprecated alias of `onChatReady` (removed next major): warn once.
|
|
165
165
|
if (options.onChatReady) {
|
|
166
166
|
options.onChatReady();
|
|
167
167
|
} else if (options.onReady) {
|
|
@@ -169,7 +169,7 @@ export const initAgentWidget = (
|
|
|
169
169
|
warnedOnReadyDeprecated = true;
|
|
170
170
|
// eslint-disable-next-line no-console
|
|
171
171
|
console.warn(
|
|
172
|
-
"[Persona] `onReady` is deprecated
|
|
172
|
+
"[Persona] `onReady` is deprecated: use `onChatReady`. `onReady` still works but is removed in the next major."
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
175
|
options.onReady();
|
package/src/session.test.ts
CHANGED
|
@@ -379,8 +379,7 @@ describe('AgentWidgetSession - cancel()', () => {
|
|
|
379
379
|
|
|
380
380
|
it('aborts the in-flight dispatch and flips streaming/status back to idle', async () => {
|
|
381
381
|
let capturedSignal: AbortSignal | null = null;
|
|
382
|
-
// Fetch returns a promise that only settles when the AbortSignal fires
|
|
383
|
-
// modeling a dispatch that's still receiving SSE tokens.
|
|
382
|
+
// Fetch returns a promise that only settles when the AbortSignal fires: // modeling a dispatch that's still receiving SSE tokens.
|
|
384
383
|
global.fetch = vi.fn().mockImplementation((_url: string, options: any) => {
|
|
385
384
|
capturedSignal = options.signal as AbortSignal;
|
|
386
385
|
return new Promise((_resolve, reject) => {
|
|
@@ -403,7 +402,7 @@ describe('AgentWidgetSession - cancel()', () => {
|
|
|
403
402
|
}
|
|
404
403
|
);
|
|
405
404
|
|
|
406
|
-
// Kick off the dispatch but don't await
|
|
405
|
+
// Kick off the dispatch but don't await: we want it in-flight when we cancel.
|
|
407
406
|
const dispatchPromise = session.sendMessage('Hello');
|
|
408
407
|
// Let the session set up the AbortController and call fetch.
|
|
409
408
|
await Promise.resolve();
|
|
@@ -554,7 +553,7 @@ describe('AgentWidgetSession.resolveAskUserQuestion', () => {
|
|
|
554
553
|
|
|
555
554
|
vi.spyOn(session, 'connectStream').mockResolvedValue(undefined);
|
|
556
555
|
|
|
557
|
-
// Capture the flag state at the exact moment fetch is called
|
|
556
|
+
// Capture the flag state at the exact moment fetch is called: this is
|
|
558
557
|
// the "before the POST fires" assertion. The flag must be flipped BEFORE
|
|
559
558
|
// any network I/O so the subsequent stream-driven renders skip the sheet.
|
|
560
559
|
let flagAtFetch: { awaiting?: boolean; answered?: boolean } | undefined;
|
|
@@ -666,7 +665,7 @@ describe('AgentWidgetSession.resolveAskUserQuestion', () => {
|
|
|
666
665
|
|
|
667
666
|
vi.spyOn(session, 'connectStream').mockResolvedValue(undefined);
|
|
668
667
|
|
|
669
|
-
// Kick off
|
|
668
|
+
// Kick off: don't await.
|
|
670
669
|
const resolvePromise = session.resolveAskUserQuestion(awaiting, 'Hobbyists');
|
|
671
670
|
|
|
672
671
|
// Yield a microtask so synchronous setup (markResolved → setStreaming(true)
|
|
@@ -920,7 +919,7 @@ describe('AgentWidgetSession - approval context across agent_approval_complete',
|
|
|
920
919
|
}
|
|
921
920
|
);
|
|
922
921
|
|
|
923
|
-
// `agent_approval_complete` carries only the resolution
|
|
922
|
+
// `agent_approval_complete` carries only the resolution: none of the
|
|
924
923
|
// context fields from `agent_approval_start`. The session merge must keep
|
|
925
924
|
// them so a full re-render of the resolved bubble (morph, virtual-scroll
|
|
926
925
|
// re-mount, storage restore) still shows the tool, description, and the
|