@runtypelabs/persona 3.8.2 → 3.8.3

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.
@@ -13482,6 +13482,9 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
13482
13482
  selectedModelId: composerCfg == null ? void 0 : composerCfg.selectedModelId,
13483
13483
  onModelChange: (modelId) => {
13484
13484
  config.composer = { ...config.composer, selectedModelId: modelId };
13485
+ if (config.agent) {
13486
+ config.agent = { ...config.agent, model: modelId };
13487
+ }
13485
13488
  },
13486
13489
  onVoiceToggle: ((_A = config.voiceRecognition) == null ? void 0 : _A.enabled) === true ? () => {
13487
13490
  composerVoiceBridge == null ? void 0 : composerVoiceBridge();
@@ -13528,6 +13531,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
13528
13531
  composerForm.style.marginLeft = "auto";
13529
13532
  composerForm.style.marginRight = "auto";
13530
13533
  }
13534
+ if (contentMaxWidth && suggestions) {
13535
+ suggestions.style.maxWidth = contentMaxWidth;
13536
+ suggestions.style.marginLeft = "auto";
13537
+ suggestions.style.marginRight = "auto";
13538
+ }
13531
13539
  if (contentMaxWidth && attachmentPreviewsContainer) {
13532
13540
  attachmentPreviewsContainer.style.maxWidth = contentMaxWidth;
13533
13541
  attachmentPreviewsContainer.style.marginLeft = "auto";
@@ -16731,6 +16739,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
16731
16739
  composerForm.style.marginLeft = "auto";
16732
16740
  composerForm.style.marginRight = "auto";
16733
16741
  }
16742
+ if (suggestions) {
16743
+ suggestions.style.maxWidth = updatedContentMaxWidth;
16744
+ suggestions.style.marginLeft = "auto";
16745
+ suggestions.style.marginRight = "auto";
16746
+ }
16734
16747
  } else {
16735
16748
  messagesWrapper.style.maxWidth = "";
16736
16749
  messagesWrapper.style.marginLeft = "";
@@ -16741,6 +16754,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
16741
16754
  composerForm.style.marginLeft = "";
16742
16755
  composerForm.style.marginRight = "";
16743
16756
  }
16757
+ if (suggestions) {
16758
+ suggestions.style.maxWidth = "";
16759
+ suggestions.style.marginLeft = "";
16760
+ suggestions.style.marginRight = "";
16761
+ }
16744
16762
  }
16745
16763
  const statusIndicatorConfig = (_Qa = config.statusIndicator) != null ? _Qa : {};
16746
16764
  const isVisible = (_Ra = statusIndicatorConfig.visible) != null ? _Ra : true;
@@ -13377,6 +13377,9 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
13377
13377
  selectedModelId: composerCfg == null ? void 0 : composerCfg.selectedModelId,
13378
13378
  onModelChange: (modelId) => {
13379
13379
  config.composer = { ...config.composer, selectedModelId: modelId };
13380
+ if (config.agent) {
13381
+ config.agent = { ...config.agent, model: modelId };
13382
+ }
13380
13383
  },
13381
13384
  onVoiceToggle: ((_A = config.voiceRecognition) == null ? void 0 : _A.enabled) === true ? () => {
13382
13385
  composerVoiceBridge == null ? void 0 : composerVoiceBridge();
@@ -13423,6 +13426,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
13423
13426
  composerForm.style.marginLeft = "auto";
13424
13427
  composerForm.style.marginRight = "auto";
13425
13428
  }
13429
+ if (contentMaxWidth && suggestions) {
13430
+ suggestions.style.maxWidth = contentMaxWidth;
13431
+ suggestions.style.marginLeft = "auto";
13432
+ suggestions.style.marginRight = "auto";
13433
+ }
13426
13434
  if (contentMaxWidth && attachmentPreviewsContainer) {
13427
13435
  attachmentPreviewsContainer.style.maxWidth = contentMaxWidth;
13428
13436
  attachmentPreviewsContainer.style.marginLeft = "auto";
@@ -16626,6 +16634,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
16626
16634
  composerForm.style.marginLeft = "auto";
16627
16635
  composerForm.style.marginRight = "auto";
16628
16636
  }
16637
+ if (suggestions) {
16638
+ suggestions.style.maxWidth = updatedContentMaxWidth;
16639
+ suggestions.style.marginLeft = "auto";
16640
+ suggestions.style.marginRight = "auto";
16641
+ }
16629
16642
  } else {
16630
16643
  messagesWrapper.style.maxWidth = "";
16631
16644
  messagesWrapper.style.marginLeft = "";
@@ -16636,6 +16649,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
16636
16649
  composerForm.style.marginLeft = "";
16637
16650
  composerForm.style.marginRight = "";
16638
16651
  }
16652
+ if (suggestions) {
16653
+ suggestions.style.maxWidth = "";
16654
+ suggestions.style.marginLeft = "";
16655
+ suggestions.style.marginRight = "";
16656
+ }
16639
16657
  }
16640
16658
  const statusIndicatorConfig = (_Qa = config.statusIndicator) != null ? _Qa : {};
16641
16659
  const isVisible = (_Ra = statusIndicatorConfig.visible) != null ? _Ra : true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/persona",
3
- "version": "3.8.2",
3
+ "version": "3.8.3",
4
4
  "description": "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
package/src/ui.ts CHANGED
@@ -883,6 +883,10 @@ export const createAgentExperience = (
883
883
  selectedModelId: composerCfg?.selectedModelId,
884
884
  onModelChange: (modelId: string) => {
885
885
  config.composer = { ...config.composer, selectedModelId: modelId };
886
+ // Sync to agent config so the next request uses the selected model
887
+ if (config.agent) {
888
+ config.agent = { ...config.agent, model: modelId };
889
+ }
886
890
  },
887
891
  onVoiceToggle:
888
892
  config.voiceRecognition?.enabled === true
@@ -929,13 +933,18 @@ export const createAgentExperience = (
929
933
  ensureComposerAttachmentSurface(footer);
930
934
  bindComposerRefsFromFooter(footer);
931
935
 
932
- // Apply contentMaxWidth to composer form and attachment previews if configured
936
+ // Apply contentMaxWidth to composer form, suggestions, and attachment previews if configured
933
937
  const contentMaxWidth = config.layout?.contentMaxWidth;
934
938
  if (contentMaxWidth && composerForm) {
935
939
  composerForm.style.maxWidth = contentMaxWidth;
936
940
  composerForm.style.marginLeft = "auto";
937
941
  composerForm.style.marginRight = "auto";
938
942
  }
943
+ if (contentMaxWidth && suggestions) {
944
+ suggestions.style.maxWidth = contentMaxWidth;
945
+ suggestions.style.marginLeft = "auto";
946
+ suggestions.style.marginRight = "auto";
947
+ }
939
948
  if (contentMaxWidth && attachmentPreviewsContainer) {
940
949
  attachmentPreviewsContainer.style.maxWidth = contentMaxWidth;
941
950
  attachmentPreviewsContainer.style.marginLeft = "auto";
@@ -5021,6 +5030,11 @@ export const createAgentExperience = (
5021
5030
  composerForm.style.marginLeft = "auto";
5022
5031
  composerForm.style.marginRight = "auto";
5023
5032
  }
5033
+ if (suggestions) {
5034
+ suggestions.style.maxWidth = updatedContentMaxWidth;
5035
+ suggestions.style.marginLeft = "auto";
5036
+ suggestions.style.marginRight = "auto";
5037
+ }
5024
5038
  } else {
5025
5039
  messagesWrapper.style.maxWidth = "";
5026
5040
  messagesWrapper.style.marginLeft = "";
@@ -5031,6 +5045,11 @@ export const createAgentExperience = (
5031
5045
  composerForm.style.marginLeft = "";
5032
5046
  composerForm.style.marginRight = "";
5033
5047
  }
5048
+ if (suggestions) {
5049
+ suggestions.style.maxWidth = "";
5050
+ suggestions.style.marginLeft = "";
5051
+ suggestions.style.marginRight = "";
5052
+ }
5034
5053
  }
5035
5054
 
5036
5055
  // Update status indicator visibility and text