@aleph-alpha/chat-kit 3.3.0 → 4.0.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.
Files changed (98) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-BAcBFs6I.js → CkInput.vue_vue_type_script_setup_true_lang-DJN-nZ2-.js} +118 -71
  2. package/dist/adapters/responses-api.d.ts +11 -5
  3. package/dist/adapters/responses-api.d.ts.map +1 -1
  4. package/dist/adapters/responses-api.js +9 -3
  5. package/dist/chat-kit.css +8 -8
  6. package/dist/components/base/CkAgentMessage/types.d.ts +1 -1
  7. package/dist/components/base/{CkCopyMessageActionButton/CkCopyMessageActionButton.stories.d.ts → CkCopyMessageButton/CkCopyMessageButton.stories.d.ts} +3 -3
  8. package/dist/components/base/CkCopyMessageButton/CkCopyMessageButton.stories.d.ts.map +1 -0
  9. package/dist/components/base/{CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts → CkCopyMessageButton/CkCopyMessageButton.vue.d.ts} +4 -4
  10. package/dist/components/base/CkCopyMessageButton/CkCopyMessageButton.vue.d.ts.map +1 -0
  11. package/dist/components/base/CkCopyMessageButton/index.d.ts +3 -0
  12. package/dist/components/base/CkCopyMessageButton/index.d.ts.map +1 -0
  13. package/dist/components/base/{CkCopyMessageActionButton → CkCopyMessageButton}/types.d.ts +3 -3
  14. package/dist/components/base/CkCopyMessageButton/types.d.ts.map +1 -0
  15. package/dist/components/base/CkFeedbackButton/types.d.ts +1 -1
  16. package/dist/components/base/CkFeedbackDialog/types.d.ts +1 -1
  17. package/dist/components/base/{CkMessageActionButton/CkMessageActionButton.stories.d.ts → CkMessageButton/CkMessageButton.stories.d.ts} +3 -3
  18. package/dist/components/base/CkMessageButton/CkMessageButton.stories.d.ts.map +1 -0
  19. package/dist/components/base/{CkMessageActionButton/CkMessageActionButton.vue.d.ts → CkMessageButton/CkMessageButton.vue.d.ts} +3 -3
  20. package/dist/components/base/CkMessageButton/CkMessageButton.vue.d.ts.map +1 -0
  21. package/dist/components/base/CkMessageButton/index.d.ts +3 -0
  22. package/dist/components/base/CkMessageButton/index.d.ts.map +1 -0
  23. package/dist/components/base/{CkMessageActionButton → CkMessageButton}/types.d.ts +2 -2
  24. package/dist/components/base/CkMessageButton/types.d.ts.map +1 -0
  25. package/dist/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.stories.d.ts +16 -0
  26. package/dist/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.stories.d.ts.map +1 -0
  27. package/dist/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.vue.d.ts +12 -0
  28. package/dist/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.vue.d.ts.map +1 -0
  29. package/dist/components/base/CkRegenerateMessageButton/index.d.ts +3 -0
  30. package/dist/components/base/{CkCopyMessageActionButton → CkRegenerateMessageButton}/index.d.ts.map +1 -1
  31. package/dist/components/base/CkRegenerateMessageButton/types.d.ts +27 -0
  32. package/dist/components/base/CkRegenerateMessageButton/types.d.ts.map +1 -0
  33. package/dist/components/base/index.d.ts +3 -2
  34. package/dist/components/base/index.d.ts.map +1 -1
  35. package/dist/components/composed/CkConversation/CkConversation.stories.d.ts +1 -1
  36. package/dist/components/composed/CkConversation/types.d.ts +1 -1
  37. package/dist/components/index.d.ts +1 -1
  38. package/dist/components/index.d.ts.map +1 -1
  39. package/dist/components/index.js +7 -6
  40. package/dist/composables/index.js +1 -1
  41. package/dist/handlers/index.js +2 -2
  42. package/dist/handlers/useChatKitLabels.d.ts +2 -0
  43. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  44. package/dist/handlers/useMessageHandler.d.ts +37 -0
  45. package/dist/handlers/useMessageHandler.d.ts.map +1 -1
  46. package/dist/helpers/conversationTree.d.ts +15 -0
  47. package/dist/helpers/conversationTree.d.ts.map +1 -1
  48. package/dist/{index-C6njJ8EB.js → index-CyrVnbS9.js} +1 -1
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +11 -10
  52. package/dist/{useChatKitLabels-BM2I7-9o.js → useChatKitLabels-zMFV7aEz.js} +1 -0
  53. package/dist/{useMessageHandler-CMdy-lm0.js → useMessageHandler-N50Yj-NU.js} +45 -7
  54. package/package.json +3 -3
  55. package/src/adapters/responses-api.spec.ts +52 -5
  56. package/src/adapters/responses-api.ts +26 -7
  57. package/src/components/base/CkAgentMessage/types.ts +1 -1
  58. package/src/components/base/{CkCopyMessageActionButton/CkCopyMessageActionButton.spec.ts → CkCopyMessageButton/CkCopyMessageButton.spec.ts} +6 -6
  59. package/src/components/base/{CkCopyMessageActionButton/CkCopyMessageActionButton.stories.ts → CkCopyMessageButton/CkCopyMessageButton.stories.ts} +8 -8
  60. package/src/components/base/{CkCopyMessageActionButton/CkCopyMessageActionButton.vue → CkCopyMessageButton/CkCopyMessageButton.vue} +6 -6
  61. package/src/components/base/CkCopyMessageButton/index.ts +2 -0
  62. package/src/components/base/{CkCopyMessageActionButton → CkCopyMessageButton}/types.ts +3 -3
  63. package/src/components/base/CkFeedbackButton/CkFeedbackButton.vue +5 -5
  64. package/src/components/base/CkFeedbackButton/types.ts +1 -1
  65. package/src/components/base/CkFeedbackDialog/types.ts +1 -1
  66. package/src/components/base/{CkMessageActionButton/CkMessageActionButton.spec.ts → CkMessageButton/CkMessageButton.spec.ts} +6 -6
  67. package/src/components/base/{CkMessageActionButton/CkMessageActionButton.stories.ts → CkMessageButton/CkMessageButton.stories.ts} +10 -10
  68. package/src/components/base/{CkMessageActionButton/CkMessageActionButton.vue → CkMessageButton/CkMessageButton.vue} +3 -3
  69. package/src/components/base/CkMessageButton/index.ts +2 -0
  70. package/src/components/base/{CkMessageActionButton → CkMessageButton}/types.ts +2 -2
  71. package/src/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.spec.ts +49 -0
  72. package/src/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.stories.ts +63 -0
  73. package/src/components/base/CkRegenerateMessageButton/CkRegenerateMessageButton.vue +43 -0
  74. package/src/components/base/CkRegenerateMessageButton/index.ts +2 -0
  75. package/src/components/base/CkRegenerateMessageButton/types.ts +27 -0
  76. package/src/components/base/index.ts +3 -2
  77. package/src/components/composed/CkConversation/CkConversation.stories.ts +6 -6
  78. package/src/components/composed/CkConversation/CkConversation.vue +2 -2
  79. package/src/components/composed/CkConversation/types.ts +1 -1
  80. package/src/components/index.ts +3 -2
  81. package/src/handlers/useChatKitLabels.spec.ts +1 -0
  82. package/src/handlers/useChatKitLabels.ts +3 -0
  83. package/src/handlers/useMessageHandler.spec.ts +79 -0
  84. package/src/handlers/useMessageHandler.ts +50 -2
  85. package/src/helpers/conversationTree.spec.ts +120 -0
  86. package/src/helpers/conversationTree.ts +57 -8
  87. package/src/index.ts +3 -2
  88. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.stories.d.ts.map +0 -1
  89. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts.map +0 -1
  90. package/dist/components/base/CkCopyMessageActionButton/index.d.ts +0 -3
  91. package/dist/components/base/CkCopyMessageActionButton/types.d.ts.map +0 -1
  92. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.stories.d.ts.map +0 -1
  93. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.vue.d.ts.map +0 -1
  94. package/dist/components/base/CkMessageActionButton/index.d.ts +0 -3
  95. package/dist/components/base/CkMessageActionButton/index.d.ts.map +0 -1
  96. package/dist/components/base/CkMessageActionButton/types.d.ts.map +0 -1
  97. package/src/components/base/CkCopyMessageActionButton/index.ts +0 -2
  98. package/src/components/base/CkMessageActionButton/index.ts +0 -2
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, renderSlot, createCommentVNode, computed, createVNode, toDisplayString, withCtx, ref, onBeforeUnmount, normalizeClass, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, mergeProps, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, useSlots, resolveDynamicComponent, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
2
  import { UiIcon, UiFileType, UiButton, UiPopover, UiPopoverTrigger, UiPopoverContent, UiTooltip, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
3
- import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, a as useMarkdownParser } from "./useChatKitLabels-BM2I7-9o.js";
3
+ import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, a as useMarkdownParser } from "./useChatKitLabels-zMFV7aEz.js";
4
4
  const MINUTE = 60;
5
5
  const HOUR = 60 * MINUTE;
6
6
  const DAY = 24 * HOUR;
@@ -36,7 +36,7 @@ function formatRelativeTime(unixSeconds, nowSeconds = Math.floor(Date.now() / 1e
36
36
  const years = Math.floor(delta / YEAR);
37
37
  return years === 1 ? "1 year ago" : `${years} years ago`;
38
38
  }
39
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
39
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
40
40
  ...{ name: "CkSendIcon" },
41
41
  __name: "CkSendIcon",
42
42
  setup(__props) {
@@ -52,7 +52,7 @@ const _hoisted_1$f = {
52
52
  viewBox: "0 0 16 16",
53
53
  fill: "none"
54
54
  };
55
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
55
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
56
56
  ...{ name: "CkStopIcon" },
57
57
  __name: "CkStopIcon",
58
58
  setup(__props) {
@@ -86,7 +86,7 @@ const _hoisted_6$3 = {
86
86
  key: 1,
87
87
  class: "flex items-center gap-4"
88
88
  };
89
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
89
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
90
90
  ...{ name: "CkAgentMessage" },
91
91
  __name: "CkAgentMessage",
92
92
  setup(__props) {
@@ -118,7 +118,7 @@ const _hoisted_5$4 = {
118
118
  key: 0,
119
119
  class: "text-sm leading-5 text-content-on-surface-muted"
120
120
  };
121
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
121
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
122
122
  ...{
123
123
  name: "CkCitationCard"
124
124
  },
@@ -180,7 +180,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
180
180
  });
181
181
  const _hoisted_1$c = ["aria-label"];
182
182
  const CLOSE_DELAY_MS = 80;
183
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
183
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
184
184
  ...{
185
185
  name: "CkCitation"
186
186
  },
@@ -273,7 +273,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
273
273
  onFocusout: onContentFocusOut
274
274
  }, {
275
275
  default: withCtx(() => [
276
- createVNode(unref(_sfc_main$n), {
276
+ createVNode(unref(_sfc_main$o), {
277
277
  "file-name": __props.fileName,
278
278
  snippet: __props.snippet,
279
279
  "location-label": __props.locationLabel,
@@ -297,7 +297,7 @@ const _export_sfc = (sfc, props) => {
297
297
  }
298
298
  return target;
299
299
  };
300
- const CkCitation = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-0d83c5f8"]]);
300
+ const CkCitation = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-0d83c5f8"]]);
301
301
  const _hoisted_1$b = ["data-message-row"];
302
302
  const _hoisted_2$7 = {
303
303
  key: 0,
@@ -307,7 +307,7 @@ const _hoisted_3$6 = {
307
307
  key: 1,
308
308
  class: "flex min-w-0 justify-start"
309
309
  };
310
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
310
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
311
311
  ...{ name: "CkConversationLayout" },
312
312
  __name: "CkConversationLayout",
313
313
  props: {
@@ -464,11 +464,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
464
464
  };
465
465
  }
466
466
  });
467
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
467
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
468
468
  ...{
469
- name: "CkMessageActionButton"
469
+ name: "CkMessageButton"
470
470
  },
471
- __name: "CkMessageActionButton",
471
+ __name: "CkMessageButton",
472
472
  props: {
473
473
  ariaLabel: {},
474
474
  disabled: { type: Boolean, default: false }
@@ -492,11 +492,11 @@ const _hoisted_1$a = {
492
492
  class: "sr-only",
493
493
  "aria-live": "polite"
494
494
  };
495
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
495
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
496
496
  ...{
497
- name: "CkCopyMessageActionButton"
497
+ name: "CkCopyMessageButton"
498
498
  },
499
- __name: "CkCopyMessageActionButton",
499
+ __name: "CkCopyMessageButton",
500
500
  props: {
501
501
  text: {},
502
502
  disabled: { type: Boolean, default: false },
@@ -549,7 +549,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
549
549
  "delay-duration": 0
550
550
  }, {
551
551
  default: withCtx(() => [
552
- createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
552
+ createVNode(unref(_sfc_main$l), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
553
553
  disabled: __props.disabled,
554
554
  onClick: handleClick
555
555
  }), {
@@ -583,7 +583,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
583
583
  };
584
584
  }
585
585
  });
586
- const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-f77a1193"]]);
586
+ const CkCopyMessageButton = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-ba2e5f32"]]);
587
587
  const _hoisted_1$9 = {
588
588
  width: "208",
589
589
  height: "144",
@@ -593,7 +593,7 @@ const _hoisted_1$9 = {
593
593
  "aria-hidden": "true",
594
594
  focusable: "false"
595
595
  };
596
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
596
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
597
597
  ...{ name: "CkDropZoneIllustration" },
598
598
  __name: "CkDropZoneIllustration",
599
599
  setup(__props) {
@@ -618,7 +618,7 @@ const _hoisted_6$2 = {
618
618
  class: "pointer-events-none fixed bottom-6 left-1/2 z-50 max-w-[36rem] -translate-x-1/2 flex list-inside list-disc flex-col gap-1 rounded-md border border-border-surface-default bg-background-surface-default p-3 text-sm text-content-on-surface-secondary",
619
619
  role: "alert"
620
620
  };
621
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
621
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
622
622
  ...{
623
623
  name: "CkDropZoneOverlay"
624
624
  },
@@ -781,7 +781,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
781
781
  }, [
782
782
  createElementVNode("div", _hoisted_2$6, [
783
783
  renderSlot(_ctx.$slots, "default", {}, () => [
784
- createVNode(_sfc_main$i, { class: "h-36 w-52" }),
784
+ createVNode(_sfc_main$j, { class: "h-36 w-52" }),
785
785
  createElementVNode("div", _hoisted_3$5, [
786
786
  createElementVNode("p", _hoisted_4$5, toDisplayString(resolvedHeading.value), 1),
787
787
  __props.hint ? (openBlock(), createElementBlock("p", _hoisted_5$3, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
@@ -806,9 +806,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
806
806
  };
807
807
  }
808
808
  });
809
- const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-54119668"]]);
809
+ const CkDropZoneOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-54119668"]]);
810
810
  const _hoisted_1$7 = ["aria-label"];
811
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
811
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
812
812
  ...{
813
813
  name: "CkFeedbackButton"
814
814
  },
@@ -863,7 +863,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
863
863
  "delay-duration": 0
864
864
  }, {
865
865
  default: withCtx(() => [
866
- createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
866
+ createVNode(unref(_sfc_main$l), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
867
867
  "aria-pressed": isUpSelected.value,
868
868
  "aria-disabled": __props.locked || void 0,
869
869
  disabled: isUpDisabled.value,
@@ -893,7 +893,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
893
893
  "delay-duration": 0
894
894
  }, {
895
895
  default: withCtx(() => [
896
- createVNode(unref(_sfc_main$k), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
896
+ createVNode(unref(_sfc_main$l), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
897
897
  "aria-pressed": isDownSelected.value,
898
898
  "aria-disabled": __props.locked || void 0,
899
899
  disabled: isDownDisabled.value,
@@ -920,7 +920,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
920
920
  };
921
921
  }
922
922
  });
923
- const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-245705b8"]]);
923
+ const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-cf3d46b6"]]);
924
924
  function useCitationRendering(citations, onOpenSource) {
925
925
  const sourcesByIndex = computed(
926
926
  () => new Map(
@@ -1003,7 +1003,7 @@ function domToVNode(node, ctx) {
1003
1003
  }
1004
1004
  return vnode;
1005
1005
  }
1006
- const _sfc_main$f = defineComponent({
1006
+ const _sfc_main$g = defineComponent({
1007
1007
  name: "CkMarkdownRenderer",
1008
1008
  props: {
1009
1009
  content: { type: String, required: true },
@@ -1071,7 +1071,7 @@ const _hoisted_4$4 = {
1071
1071
  class: "self-end text-sm text-content-on-surface-muted tabular-nums",
1072
1072
  "aria-live": "polite"
1073
1073
  };
1074
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
1074
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1075
1075
  ...{
1076
1076
  name: "CkFeedbackDialog"
1077
1077
  },
@@ -1232,7 +1232,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1232
1232
  _: 1
1233
1233
  }),
1234
1234
  createElementVNode("div", _hoisted_2$5, [
1235
- createVNode(unref(_sfc_main$f), { content: __props.responseText }, null, 8, ["content"])
1235
+ createVNode(unref(_sfc_main$g), { content: __props.responseText }, null, 8, ["content"])
1236
1236
  ])
1237
1237
  ])) : createCommentVNode("", true),
1238
1238
  createElementVNode("section", _hoisted_3$4, [
@@ -1298,8 +1298,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1298
1298
  };
1299
1299
  }
1300
1300
  });
1301
- const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-12dfee8a"]]);
1302
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
1301
+ const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-12dfee8a"]]);
1302
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1303
1303
  ...{
1304
1304
  name: "CkFileItemRow",
1305
1305
  inheritAttrs: false
@@ -1359,7 +1359,7 @@ const _hoisted_6$1 = {
1359
1359
  };
1360
1360
  const _hoisted_7$1 = ["aria-label"];
1361
1361
  const _hoisted_8$1 = ["onClick"];
1362
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
1362
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1363
1363
  ...{
1364
1364
  name: "CkFileItemsList"
1365
1365
  },
@@ -1448,7 +1448,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1448
1448
  class: "min-w-0 max-w-64 flex-1 basis-0",
1449
1449
  onClick: ($event) => handleRowClick(file, $event)
1450
1450
  }, [
1451
- createVNode(_sfc_main$d, {
1451
+ createVNode(_sfc_main$e, {
1452
1452
  file,
1453
1453
  size: __props.size,
1454
1454
  "is-removable": __props.isRemovable,
@@ -1527,7 +1527,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1527
1527
  class: "min-w-0 max-w-64",
1528
1528
  onClick: ($event) => handleRowClick(file, $event)
1529
1529
  }, [
1530
- createVNode(_sfc_main$d, {
1530
+ createVNode(_sfc_main$e, {
1531
1531
  file,
1532
1532
  size: __props.size,
1533
1533
  "is-removable": __props.isRemovable,
@@ -1575,7 +1575,7 @@ const _hoisted_7 = {
1575
1575
  const _hoisted_8 = ["aria-label"];
1576
1576
  const _hoisted_9 = ["aria-label"];
1577
1577
  const _hoisted_10 = ["aria-label"];
1578
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
1578
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1579
1579
  ...{
1580
1580
  name: "CkHistoryItem",
1581
1581
  inheritAttrs: false
@@ -1816,7 +1816,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1816
1816
  }
1817
1817
  });
1818
1818
  const baseClass = "flex w-full min-w-0 flex-col p-2";
1819
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
1819
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1820
1820
  ...{
1821
1821
  name: "CkHistoryWrapper",
1822
1822
  inheritAttrs: false
@@ -1851,7 +1851,7 @@ const _hoisted_2$2 = { class: "min-w-0 max-w-[10rem] truncate" };
1851
1851
  const _hoisted_3$1 = ["aria-label"];
1852
1852
  const _hoisted_4$1 = ["aria-selected", "onClick"];
1853
1853
  const _hoisted_5 = { class: "min-w-0 flex-1 truncate" };
1854
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1854
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1855
1855
  ...{ name: "CkModelSelector" },
1856
1856
  __name: "CkModelSelector",
1857
1857
  props: {
@@ -1959,7 +1959,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1959
1959
  };
1960
1960
  }
1961
1961
  });
1962
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1962
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1963
1963
  ...{ name: "CkPromptSendButton" },
1964
1964
  __name: "CkPromptSendButton",
1965
1965
  props: {
@@ -1985,7 +1985,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1985
1985
  };
1986
1986
  }
1987
1987
  });
1988
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1988
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1989
1989
  ...{ name: "CkPromptMenuButton" },
1990
1990
  __name: "CkPromptMenuButton",
1991
1991
  props: {
@@ -2015,7 +2015,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2015
2015
  };
2016
2016
  }
2017
2017
  });
2018
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2018
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2019
2019
  ...{ name: "CkPromptStopButton" },
2020
2020
  __name: "CkPromptStopButton",
2021
2021
  props: {
@@ -2050,7 +2050,7 @@ const _hoisted_3 = ["for"];
2050
2050
  const _hoisted_4 = ["id", "value", "placeholder", "disabled"];
2051
2051
  const LINE_HEIGHT = 24;
2052
2052
  const MAX_LINES = 6;
2053
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2053
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2054
2054
  ...{ name: "CkPromptInput" },
2055
2055
  __name: "CkPromptInput",
2056
2056
  props: {
@@ -2183,12 +2183,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2183
2183
  };
2184
2184
  }
2185
2185
  });
2186
- const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-92b05731"]]);
2186
+ const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-92b05731"]]);
2187
2187
  const _hoisted_1$1 = {
2188
2188
  key: 0,
2189
2189
  class: "text-core-content-tertiary text-center text-xs leading-3.5"
2190
2190
  };
2191
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2191
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2192
2192
  ...{ name: "CkPromptInputDisclaimer" },
2193
2193
  __name: "CkPromptInputDisclaimer",
2194
2194
  props: {
@@ -2204,6 +2204,52 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2204
2204
  };
2205
2205
  }
2206
2206
  });
2207
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2208
+ ...{
2209
+ name: "CkRegenerateMessageButton"
2210
+ },
2211
+ __name: "CkRegenerateMessageButton",
2212
+ props: {
2213
+ disabled: { type: Boolean, default: false },
2214
+ ariaLabel: { default: "Regenerate response" }
2215
+ },
2216
+ emits: ["regenerate"],
2217
+ setup(__props, { emit: __emit }) {
2218
+ const props = __props;
2219
+ const emit = __emit;
2220
+ function handleClick() {
2221
+ if (props.disabled) {
2222
+ return;
2223
+ }
2224
+ emit("regenerate");
2225
+ }
2226
+ return (_ctx, _cache) => {
2227
+ return openBlock(), createBlock(unref(UiTooltip), {
2228
+ content: __props.ariaLabel,
2229
+ side: "bottom",
2230
+ align: "center",
2231
+ "delay-duration": 0
2232
+ }, {
2233
+ default: withCtx(() => [
2234
+ createVNode(unref(_sfc_main$l), mergeProps({ ariaLabel: __props.ariaLabel }, {
2235
+ disabled: __props.disabled,
2236
+ onClick: handleClick
2237
+ }), {
2238
+ default: withCtx(() => [
2239
+ createVNode(unref(UiIcon), {
2240
+ name: "repeat",
2241
+ size: 16,
2242
+ "aria-hidden": "true"
2243
+ })
2244
+ ]),
2245
+ _: 1
2246
+ }, 16, ["disabled"])
2247
+ ]),
2248
+ _: 1
2249
+ }, 8, ["content"]);
2250
+ };
2251
+ }
2252
+ });
2207
2253
  const _hoisted_1 = { class: "inline-flex max-w-[536px] flex-col items-end justify-start gap-1" };
2208
2254
  const _hoisted_2 = ["aria-expanded"];
2209
2255
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -2298,7 +2344,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2298
2344
  return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
2299
2345
  }
2300
2346
  return (_ctx, _cache) => {
2301
- return openBlock(), createBlock(_sfc_main$l, { messages: __props.messages }, {
2347
+ return openBlock(), createBlock(_sfc_main$m, { messages: __props.messages }, {
2302
2348
  "user-message": withCtx(({ message }) => [
2303
2349
  createElementVNode("div", {
2304
2350
  class: normalizeClass({ "ml-8": hasIcon.value })
@@ -2317,10 +2363,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2317
2363
  ]),
2318
2364
  "agent-message": withCtx(({ message }) => [
2319
2365
  renderSlot(_ctx.$slots, "agent-message", { message }, () => [
2320
- createVNode(_sfc_main$o, null, createSlots({
2366
+ createVNode(_sfc_main$p, null, createSlots({
2321
2367
  footer: withCtx(() => [
2322
2368
  renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
2323
- getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
2369
+ getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageButton, {
2324
2370
  key: 0,
2325
2371
  text: getMessageText(message),
2326
2372
  "aria-label-copy": unref(labels).copyMessageAction,
@@ -2330,7 +2376,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2330
2376
  ]),
2331
2377
  default: withCtx(() => [
2332
2378
  renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
2333
- createVNode(_sfc_main$f, {
2379
+ createVNode(_sfc_main$g, {
2334
2380
  content: getMessageText(message),
2335
2381
  classes: __props.agentMarkdownClasses
2336
2382
  }, createSlots({ _: 2 }, [
@@ -2456,7 +2502,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2456
2502
  }
2457
2503
  return (_ctx, _cache) => {
2458
2504
  return openBlock(), createElementBlock("div", null, [
2459
- createVNode(_sfc_main$a, {
2505
+ createVNode(_sfc_main$b, {
2460
2506
  class: normalizeClass(isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0),
2461
2507
  style: normalizeStyle(
2462
2508
  isExpanded.value && props.maxHeight ? { maxHeight: props.maxHeight } : void 0
@@ -2475,7 +2521,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2475
2521
  edit: () => emit("edit", conversation),
2476
2522
  delete: () => emit("delete", conversation)
2477
2523
  }, () => [
2478
- createVNode(_sfc_main$b, {
2524
+ createVNode(_sfc_main$c, {
2479
2525
  as: "a",
2480
2526
  href: hrefFor(conversation),
2481
2527
  "is-active": conversation.id === props.activeId,
@@ -2588,7 +2634,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2588
2634
  }, createSlots({
2589
2635
  "toolbar-right": withCtx((scope) => [
2590
2636
  renderSlot(_ctx.$slots, "toolbar-right", normalizeProps(guardReactiveProps(scope)), () => [
2591
- __props.loading ? (openBlock(), createBlock(_sfc_main$6, {
2637
+ __props.loading ? (openBlock(), createBlock(_sfc_main$7, {
2592
2638
  key: 0,
2593
2639
  "aria-label": __props.stopAriaLabel,
2594
2640
  disabled: __props.disabled,
@@ -2596,17 +2642,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2596
2642
  }, {
2597
2643
  default: withCtx(() => [
2598
2644
  renderSlot(_ctx.$slots, "stop-icon", {}, () => [
2599
- createVNode(_sfc_main$p)
2645
+ createVNode(_sfc_main$q)
2600
2646
  ])
2601
2647
  ]),
2602
2648
  _: 3
2603
- }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$8, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
2649
+ }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$9, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
2604
2650
  type: "submit",
2605
2651
  disabled: scope.disabled
2606
2652
  }), {
2607
2653
  default: withCtx(() => [
2608
2654
  renderSlot(_ctx.$slots, "send-icon", {}, () => [
2609
- createVNode(_sfc_main$q)
2655
+ createVNode(_sfc_main$r)
2610
2656
  ])
2611
2657
  ]),
2612
2658
  _: 3
@@ -2615,7 +2661,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2615
2661
  ]),
2616
2662
  footer: withCtx(() => [
2617
2663
  renderSlot(_ctx.$slots, "footer", {}, () => [
2618
- __props.disclaimer ? (openBlock(), createBlock(_sfc_main$4, {
2664
+ __props.disclaimer ? (openBlock(), createBlock(_sfc_main$5, {
2619
2665
  key: 0,
2620
2666
  text: __props.disclaimer
2621
2667
  }, null, 8, ["text"])) : createCommentVNode("", true)
@@ -2643,29 +2689,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2643
2689
  });
2644
2690
  export {
2645
2691
  CkCitation as C,
2646
- _sfc_main$o as _,
2647
- _sfc_main$n as a,
2692
+ _sfc_main$p as _,
2693
+ _sfc_main$o as a,
2648
2694
  _sfc_main$2 as b,
2649
- _sfc_main$l as c,
2650
- CkCopyMessageActionButton as d,
2695
+ _sfc_main$m as c,
2696
+ CkCopyMessageButton as d,
2651
2697
  CkDropZoneOverlay as e,
2652
2698
  CkFeedbackButton as f,
2653
2699
  CkFeedbackDialog as g,
2654
- _sfc_main$c as h,
2700
+ _sfc_main$d as h,
2655
2701
  _sfc_main$1 as i,
2656
- _sfc_main$b as j,
2657
- _sfc_main$a as k,
2702
+ _sfc_main$c as j,
2703
+ _sfc_main$b as k,
2658
2704
  _sfc_main as l,
2659
- _sfc_main$f as m,
2660
- _sfc_main$k as n,
2661
- _sfc_main$9 as o,
2705
+ _sfc_main$g as m,
2706
+ _sfc_main$l as n,
2707
+ _sfc_main$a as o,
2662
2708
  CkPromptInput as p,
2663
- _sfc_main$4 as q,
2664
- _sfc_main$7 as r,
2665
- _sfc_main$8 as s,
2666
- _sfc_main$6 as t,
2667
- _sfc_main$q as u,
2668
- _sfc_main$p as v,
2669
- CkUserMessage as w,
2670
- formatRelativeTime as x
2709
+ _sfc_main$5 as q,
2710
+ _sfc_main$8 as r,
2711
+ _sfc_main$9 as s,
2712
+ _sfc_main$7 as t,
2713
+ _sfc_main$4 as u,
2714
+ _sfc_main$r as v,
2715
+ _sfc_main$q as w,
2716
+ CkUserMessage as x,
2717
+ formatRelativeTime as y
2671
2718
  };
@@ -156,21 +156,24 @@ export interface ResponseAttachment {
156
156
  fileId: string;
157
157
  fileName: string;
158
158
  searchStoreId: string;
159
+ documentId?: string;
159
160
  }
160
161
  /**
161
162
  * Render-side attachment shape produced by `responsesToTree`. Stored under
162
163
  * `metadata.attachments` on the user `TreeMessage` (chat-kit's `BaseMessage`
163
164
  * /`TreeMessage` carry `metadata` as an opaque `Record<string, unknown>`).
164
165
  *
165
- * The shape is intentionally minimal — a human-readable `name` plus the
166
- * optional ids needed to resolve a public URL for the file. Consumers
167
- * using a different attachment shape can either skip this adapter or
168
- * project this onto their own type at the read site.
166
+ * Carries a human-readable `name` plus every id needed to resolve a public
167
+ * URL for the file or to re-submit it on a later turn (e.g. regenerate).
168
+ * Consumers using a different attachment shape can either skip this adapter
169
+ * or project this onto their own type at the read site.
169
170
  */
170
171
  export interface ResponseMessageAttachment {
171
172
  name: string;
172
173
  fileId?: string;
174
+ fileName?: string;
173
175
  searchStoreId?: string;
176
+ documentId?: string;
174
177
  }
175
178
  /**
176
179
  * One stored response from the OpenAI-style Responses API, as returned by
@@ -218,6 +221,7 @@ export interface ResponseList {
218
221
  */
219
222
  export type ResponseTreeMessageMetadata = MessageMetadata & {
220
223
  responseId: string;
224
+ model?: string;
221
225
  attachments?: ResponseMessageAttachment[];
222
226
  };
223
227
  /**
@@ -247,7 +251,9 @@ export interface ResponseConversationTree extends ConversationTree {
247
251
  * pass: each response's `previous_response_id` always points to a response
248
252
  * we have already processed, so we can wire its messages onto the parent's
249
253
  * last message immediately. Sibling responses (same `previous_response_id`)
250
- * surface as branches; the latest one wins as the active branch.
254
+ * surface as branches; the latest one wins as the active branch. The same
255
+ * preference applies at the top level: when the first turn is branched into
256
+ * several root responses, the latest becomes the active `rootId`.
251
257
  *
252
258
  * Every emitted node carries `metadata.responseId` pointing back to the
253
259
  * originating `StoredResponse.id` (see {@link ResponseTreeMessage}). The
@@ -1 +1 @@
1
- {"version":3,"file":"responses-api.d.ts","sourceRoot":"","sources":["../../src/adapters/responses-api.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EAEf,WAAW,EACZ,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IA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MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QACnC,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AAMD;;;;;;;;GAQG;AACH,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,2BAA2B,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC5C;AAsVD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,cAAc,EAAE,GAC1B,wBAAwB,CAgB1B"}
@@ -112,13 +112,18 @@ function responseToMessageNodes(resp) {
112
112
  const text = extractInputText(rawContent);
113
113
  const userContent = text || responseAttachments?.length;
114
114
  if (role !== "user" || !userContent) continue;
115
- const metadata = { responseId: resp.id };
115
+ const metadata = {
116
+ responseId: resp.id,
117
+ ...resp.model ? { model: resp.model } : {}
118
+ };
116
119
  if (responseAttachments && userNodesPushed === 0) {
117
120
  metadata.attachments = responseAttachments.map(
118
121
  (a) => ({
119
122
  name: a.fileName,
120
123
  fileId: a.fileId,
121
- searchStoreId: a.searchStoreId
124
+ fileName: a.fileName,
125
+ searchStoreId: a.searchStoreId,
126
+ ...a.documentId ? { documentId: a.documentId } : {}
122
127
  })
123
128
  );
124
129
  }
@@ -182,6 +187,7 @@ function linkResponse(state, resp) {
182
187
  const { treeNodes, tailMessageByResponse } = state;
183
188
  const parentResponseId = resp.previous_response_id && tailMessageByResponse.has(resp.previous_response_id) ? resp.previous_response_id : null;
184
189
  let chainParent = parentResponseId !== null ? tailMessageByResponse.get(parentResponseId) ?? null : null;
190
+ const isRootChain = chainParent === null;
185
191
  const messageNodes = responseToMessageNodes(resp);
186
192
  const parentNode = chainParent !== null ? treeNodes[chainParent] : null;
187
193
  if (parentNode && isAssistantContinuation(parentNode, messageNodes, resp)) {
@@ -195,7 +201,7 @@ function linkResponse(state, resp) {
195
201
  if (firstId === null) firstId = node.id;
196
202
  chainParent = node.id;
197
203
  }
198
- if (state.rootMessageId === null && firstId !== null) {
204
+ if (firstId !== null && (state.rootMessageId === null || isRootChain)) {
199
205
  state.rootMessageId = firstId;
200
206
  }
201
207
  tailMessageByResponse.set(resp.id, chainParent);
package/dist/chat-kit.css CHANGED
@@ -6,17 +6,17 @@
6
6
  }
7
7
  }
8
8
 
9
- .copy-message-icon-fade-enter-active[data-v-f77a1193],
10
- .copy-message-icon-fade-leave-active[data-v-f77a1193] {
9
+ .copy-message-icon-fade-enter-active[data-v-ba2e5f32],
10
+ .copy-message-icon-fade-leave-active[data-v-ba2e5f32] {
11
11
  transition: opacity 0.15s ease-out;
12
12
  }
13
- .copy-message-icon-fade-enter-from[data-v-f77a1193],
14
- .copy-message-icon-fade-leave-to[data-v-f77a1193] {
13
+ .copy-message-icon-fade-enter-from[data-v-ba2e5f32],
14
+ .copy-message-icon-fade-leave-to[data-v-ba2e5f32] {
15
15
  opacity: 0;
16
16
  }
17
17
  @media (prefers-reduced-motion: reduce) {
18
- .copy-message-icon-fade-enter-active[data-v-f77a1193],
19
- .copy-message-icon-fade-leave-active[data-v-f77a1193] {
18
+ .copy-message-icon-fade-enter-active[data-v-ba2e5f32],
19
+ .copy-message-icon-fade-leave-active[data-v-ba2e5f32] {
20
20
  transition-duration: 0.01ms;
21
21
  }
22
22
  }
@@ -36,11 +36,11 @@
36
36
  }
37
37
  }
38
38
 
39
- .ck-feedback-button__thumb[data-v-245705b8] {
39
+ .ck-feedback-button__thumb[data-v-cf3d46b6] {
40
40
  transition: background-color 0.15s ease-out;
41
41
  }
42
42
  @media (prefers-reduced-motion: reduce) {
43
- .ck-feedback-button__thumb[data-v-245705b8] {
43
+ .ck-feedback-button__thumb[data-v-cf3d46b6] {
44
44
  transition-duration: 0.01ms;
45
45
  }
46
46
  }
@@ -6,7 +6,7 @@
6
6
  * @category Messages
7
7
  * @useCases render assistant reply, AI message layout, conversation turn, streaming message container
8
8
  * @keywords agent, assistant, message, bubble, reply, ai, conversation
9
- * @related CkUserMessage, CkConversation, CkMarkdownRenderer, CkCopyMessageActionButton
9
+ * @related CkUserMessage, CkConversation, CkMarkdownRenderer, CkCopyMessageButton
10
10
  */
11
11
  export type CkAgentMessageProps = Record<string, never>;
12
12
  //# sourceMappingURL=types.d.ts.map