@assistant-ui/react 0.5.52 → 0.5.53

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -373,7 +373,8 @@ var fromCoreMessages = (message) => {
373
373
  };
374
374
  var fromCoreMessage = (message, {
375
375
  id = generateId(),
376
- status = { type: "complete", reason: "unknown" }
376
+ status = { type: "complete", reason: "unknown" },
377
+ attachments = []
377
378
  } = {}) => {
378
379
  const commonProps = {
379
380
  id,
@@ -401,7 +402,7 @@ var fromCoreMessage = (message, {
401
402
  ...commonProps,
402
403
  role,
403
404
  content: message.content,
404
- attachments: []
405
+ attachments
405
406
  };
406
407
  case "system":
407
408
  return {
@@ -1218,20 +1219,16 @@ var LocalThreadRuntime = class {
1218
1219
  this.notifySubscribers();
1219
1220
  }
1220
1221
  async append(message) {
1221
- if (message.role !== "user")
1222
- throw new Error(
1223
- "Only appending user messages are supported in LocalRuntime. This is likely an internal bug in assistant-ui."
1224
- );
1225
- const userMessageId = generateId();
1226
- const userMessage = {
1227
- id: userMessageId,
1228
- role: "user",
1229
- content: message.content,
1230
- attachments: message.attachments ?? [],
1231
- createdAt: /* @__PURE__ */ new Date()
1232
- };
1233
- this.repository.addOrUpdateMessage(message.parentId, userMessage);
1234
- await this.startRun(userMessageId);
1222
+ const newMessage = fromCoreMessage(message, {
1223
+ attachments: message.attachments
1224
+ });
1225
+ this.repository.addOrUpdateMessage(message.parentId, newMessage);
1226
+ if (message.role === "user") {
1227
+ await this.startRun(newMessage.id);
1228
+ } else {
1229
+ this.repository.resetHead(newMessage.id);
1230
+ this.notifySubscribers();
1231
+ }
1235
1232
  }
1236
1233
  async startRun(parentId) {
1237
1234
  this.repository.resetHead(parentId);
@@ -2506,11 +2503,8 @@ var useActionBarCopy = ({
2506
2503
  // src/primitive-hooks/actionBar/useActionBarEdit.tsx
2507
2504
  import { useCallback as useCallback4 } from "react";
2508
2505
  var useActionBarEdit = () => {
2509
- const { useMessage, useEditComposer } = useMessageContext();
2510
- const disabled = useCombinedStore(
2511
- [useMessage, useEditComposer],
2512
- (m, c) => m.message.role !== "user" || c.isEditing
2513
- );
2506
+ const { useEditComposer } = useMessageContext();
2507
+ const disabled = useEditComposer((c) => c.isEditing);
2514
2508
  const callback = useCallback4(() => {
2515
2509
  const { edit } = useEditComposer.getState();
2516
2510
  edit();
@@ -3233,6 +3227,8 @@ var getContentPartState = ({ message }, useContentPart, partIndex) => {
3233
3227
  } else {
3234
3228
  return null;
3235
3229
  }
3230
+ } else if (message.content.length === 1 && part.type === "text" && part.text.length === 0) {
3231
+ part = EMPTY_CONTENT;
3236
3232
  }
3237
3233
  const status = toContentPartStatus(message, partIndex, part);
3238
3234
  const currentState = useContentPart?.getState();
@@ -3335,8 +3331,8 @@ var defaultComponents = {
3335
3331
  };
3336
3332
  var MessageContentPartComponent = ({
3337
3333
  components: {
3338
- Empty = defaultComponents.Text,
3339
3334
  Text: Text2 = defaultComponents.Text,
3335
+ Empty,
3340
3336
  Image: Image2 = defaultComponents.Image,
3341
3337
  UI = defaultComponents.UI,
3342
3338
  tools: { by_name = {}, Fallback: Fallback2 = void 0 } = {}
@@ -3352,7 +3348,9 @@ var MessageContentPartComponent = ({
3352
3348
  case "text":
3353
3349
  if (status.type === "requires-action")
3354
3350
  throw new Error("Encountered unexpected requires-action status");
3355
- if (part === EMPTY_CONTENT) return /* @__PURE__ */ jsx23(Empty, { part, status });
3351
+ if (part === EMPTY_CONTENT && !!Empty) {
3352
+ return /* @__PURE__ */ jsx23(Empty, { status });
3353
+ }
3356
3354
  return /* @__PURE__ */ jsx23(Text2, { part, status });
3357
3355
  case "image":
3358
3356
  if (status.type === "requires-action")
@@ -4055,19 +4053,11 @@ var useMessageContext2 = (messageIndex) => {
4055
4053
  const useEditComposer = makeEditComposerStore({
4056
4054
  onEdit: () => {
4057
4055
  const message = useMessage.getState().message;
4058
- if (message.role !== "user")
4059
- throw new Error(
4060
- "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4061
- );
4062
4056
  const text = getThreadMessageText(message);
4063
4057
  return text;
4064
4058
  },
4065
4059
  onSend: (text) => {
4066
4060
  const { message, parentId } = useMessage.getState();
4067
- if (message.role !== "user")
4068
- throw new Error(
4069
- "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4070
- );
4071
4061
  const previousText = getThreadMessageText(message);
4072
4062
  if (previousText === text) return;
4073
4063
  const nonTextParts = message.content.filter(
@@ -4075,7 +4065,7 @@ var useMessageContext2 = (messageIndex) => {
4075
4065
  );
4076
4066
  useThreadActions.getState().append({
4077
4067
  parentId,
4078
- role: "user",
4068
+ role: message.role,
4079
4069
  content: [{ type: "text", text }, ...nonTextParts],
4080
4070
  attachments: message.attachments
4081
4071
  });
@@ -4108,33 +4098,54 @@ var MessageProvider = ({
4108
4098
  };
4109
4099
 
4110
4100
  // src/primitives/thread/ThreadMessages.tsx
4111
- import { jsx as jsx34, jsxs as jsxs4 } from "react/jsx-runtime";
4101
+ import { jsx as jsx34 } from "react/jsx-runtime";
4102
+ var isComponentsSame = (prev, next) => {
4103
+ return prev.Message === next.Message && prev.EditComposer === next.EditComposer && prev.UserEditComposer === next.UserEditComposer && prev.AssistantEditComposer === next.AssistantEditComposer && prev.SystemEditComposer === next.SystemEditComposer && prev.UserMessage === next.UserMessage && prev.AssistantMessage === next.AssistantMessage && prev.SystemMessage === next.SystemMessage;
4104
+ };
4112
4105
  var DEFAULT_SYSTEM_MESSAGE = () => null;
4113
- var getComponents = (components) => {
4114
- return {
4115
- EditComposer: components.EditComposer ?? components.UserMessage ?? components.Message,
4116
- UserMessage: components.UserMessage ?? components.Message,
4117
- AssistantMessage: components.AssistantMessage ?? components.Message,
4118
- SystemMessage: components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE
4119
- };
4106
+ var getComponent3 = (components, role, isEditing) => {
4107
+ switch (role) {
4108
+ case "user":
4109
+ if (isEditing) {
4110
+ return components.UserEditComposer ?? components.EditComposer ?? components.UserMessage ?? components.Message;
4111
+ } else {
4112
+ return components.UserMessage ?? components.Message;
4113
+ }
4114
+ case "assistant":
4115
+ if (isEditing) {
4116
+ return components.AssistantEditComposer ?? components.EditComposer ?? components.AssistantMessage ?? components.Message;
4117
+ } else {
4118
+ return components.AssistantMessage ?? components.Message;
4119
+ }
4120
+ case "system":
4121
+ if (isEditing) {
4122
+ return components.SystemEditComposer ?? components.EditComposer ?? components.SystemMessage ?? components.Message;
4123
+ } else {
4124
+ return components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE;
4125
+ }
4126
+ default:
4127
+ const _exhaustiveCheck = role;
4128
+ throw new Error(`Unknown message role: ${_exhaustiveCheck}`);
4129
+ }
4130
+ };
4131
+ var ThreadMessageComponent = ({
4132
+ components
4133
+ }) => {
4134
+ const { useMessage, useEditComposer } = useMessageContext();
4135
+ const role = useMessage((m) => m.message.role);
4136
+ const isEditing = useEditComposer((c) => c.isEditing);
4137
+ const Component = getComponent3(components, role, isEditing);
4138
+ return /* @__PURE__ */ jsx34(Component, {});
4120
4139
  };
4121
4140
  var ThreadMessageImpl = ({
4122
4141
  messageIndex,
4123
4142
  components
4124
4143
  }) => {
4125
- const { UserMessage: UserMessage2, EditComposer: EditComposer2, AssistantMessage: AssistantMessage2, SystemMessage: SystemMessage2 } = getComponents(components);
4126
- return /* @__PURE__ */ jsxs4(MessageProvider, { messageIndex, children: [
4127
- /* @__PURE__ */ jsxs4(MessagePrimitiveIf, { user: true, children: [
4128
- /* @__PURE__ */ jsx34(ComposerPrimitiveIf, { editing: false, children: /* @__PURE__ */ jsx34(UserMessage2, {}) }),
4129
- /* @__PURE__ */ jsx34(ComposerPrimitiveIf, { editing: true, children: /* @__PURE__ */ jsx34(EditComposer2, {}) })
4130
- ] }),
4131
- /* @__PURE__ */ jsx34(MessagePrimitiveIf, { assistant: true, children: /* @__PURE__ */ jsx34(AssistantMessage2, {}) }),
4132
- /* @__PURE__ */ jsx34(MessagePrimitiveIf, { system: true, children: /* @__PURE__ */ jsx34(SystemMessage2, {}) })
4133
- ] });
4144
+ return /* @__PURE__ */ jsx34(MessageProvider, { messageIndex, children: /* @__PURE__ */ jsx34(ThreadMessageComponent, { components }) });
4134
4145
  };
4135
4146
  var ThreadMessage = memo5(
4136
4147
  ThreadMessageImpl,
4137
- (prev, next) => prev.messageIndex === next.messageIndex && prev.components.Message === next.components.Message && prev.components.UserMessage === next.components.UserMessage && prev.components.EditComposer === next.components.EditComposer && prev.components.AssistantMessage === next.components.AssistantMessage && prev.components.SystemMessage === next.components.SystemMessage
4148
+ (prev, next) => prev.messageIndex === next.messageIndex && isComponentsSame(prev.components, next.components)
4138
4149
  );
4139
4150
  var ThreadPrimitiveMessagesImpl = ({
4140
4151
  components
@@ -4147,7 +4158,7 @@ var ThreadPrimitiveMessagesImpl = ({
4147
4158
  ThreadPrimitiveMessagesImpl.displayName = "ThreadPrimitive.Messages";
4148
4159
  var ThreadPrimitiveMessages = memo5(
4149
4160
  ThreadPrimitiveMessagesImpl,
4150
- (prev, next) => prev.components?.Message === next.components?.Message && prev.components?.UserMessage === next.components?.UserMessage && prev.components?.EditComposer === next.components?.EditComposer && prev.components?.AssistantMessage === next.components?.AssistantMessage && prev.components?.SystemMessage === next.components?.SystemMessage
4161
+ (prev, next) => isComponentsSame(prev.components, next.components)
4151
4162
  );
4152
4163
 
4153
4164
  // src/primitives/thread/ThreadScrollToBottom.tsx
@@ -4198,7 +4209,7 @@ import {
4198
4209
  RefreshCwIcon,
4199
4210
  StopCircleIcon
4200
4211
  } from "lucide-react";
4201
- import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs5 } from "react/jsx-runtime";
4212
+ import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs4 } from "react/jsx-runtime";
4202
4213
  var useAllowCopy = (ensureCapability = false) => {
4203
4214
  const { assistantMessage: { allowCopy = true } = {} } = useThreadConfig();
4204
4215
  const { useThread } = useThreadContext();
@@ -4222,7 +4233,7 @@ var AssistantActionBar = () => {
4222
4233
  const allowReload = useAllowReload(true);
4223
4234
  const allowSpeak = useAllowSpeak(true);
4224
4235
  if (!allowCopy && !allowReload && !allowSpeak) return null;
4225
- return /* @__PURE__ */ jsxs5(
4236
+ return /* @__PURE__ */ jsxs4(
4226
4237
  AssistantActionBarRoot,
4227
4238
  {
4228
4239
  hideWhenRunning: true,
@@ -4247,14 +4258,14 @@ var AssistantActionBarCopy = forwardRef19((props, ref) => {
4247
4258
  assistantMessage: { copy: { tooltip = "Copy" } = {} } = {}
4248
4259
  } = {}
4249
4260
  } = useThreadConfig();
4250
- return /* @__PURE__ */ jsx36(actionBar_exports.Copy, { asChild: true, children: /* @__PURE__ */ jsx36(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsxs5(Fragment4, { children: [
4261
+ return /* @__PURE__ */ jsx36(actionBar_exports.Copy, { asChild: true, children: /* @__PURE__ */ jsx36(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsxs4(Fragment4, { children: [
4251
4262
  /* @__PURE__ */ jsx36(message_exports.If, { copied: true, children: /* @__PURE__ */ jsx36(CheckIcon, {}) }),
4252
4263
  /* @__PURE__ */ jsx36(message_exports.If, { copied: false, children: /* @__PURE__ */ jsx36(CopyIcon, {}) })
4253
4264
  ] }) }) });
4254
4265
  });
4255
4266
  AssistantActionBarCopy.displayName = "AssistantActionBarCopy";
4256
4267
  var AssistantActionBarSpeechControl = () => {
4257
- return /* @__PURE__ */ jsxs5(Fragment4, { children: [
4268
+ return /* @__PURE__ */ jsxs4(Fragment4, { children: [
4258
4269
  /* @__PURE__ */ jsx36(message_exports.If, { speaking: false, children: /* @__PURE__ */ jsx36(AssistantActionBarSpeak, {}) }),
4259
4270
  /* @__PURE__ */ jsx36(message_exports.If, { speaking: true, children: /* @__PURE__ */ jsx36(AssistantActionBarStopSpeaking, {}) })
4260
4271
  ] });
@@ -4310,7 +4321,7 @@ import { forwardRef as forwardRef21, useMemo as useMemo5 } from "react";
4310
4321
  // src/ui/branch-picker.tsx
4311
4322
  import { forwardRef as forwardRef20 } from "react";
4312
4323
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
4313
- import { jsx as jsx37, jsxs as jsxs6 } from "react/jsx-runtime";
4324
+ import { jsx as jsx37, jsxs as jsxs5 } from "react/jsx-runtime";
4314
4325
  var useAllowBranchPicker = (ensureCapability = false) => {
4315
4326
  const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();
4316
4327
  const { useThread } = useThreadContext();
@@ -4320,7 +4331,7 @@ var useAllowBranchPicker = (ensureCapability = false) => {
4320
4331
  var BranchPicker = () => {
4321
4332
  const allowBranchPicker = useAllowBranchPicker();
4322
4333
  if (!allowBranchPicker) return null;
4323
- return /* @__PURE__ */ jsxs6(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
4334
+ return /* @__PURE__ */ jsxs5(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
4324
4335
  /* @__PURE__ */ jsx37(BranchPickerPrevious2, {}),
4325
4336
  /* @__PURE__ */ jsx37(BranchPickerState, {}),
4326
4337
  /* @__PURE__ */ jsx37(BranchPickerNext, {})
@@ -4345,7 +4356,7 @@ var BranchPickerStateWrapper = withDefaults("span", {
4345
4356
  className: "aui-branch-picker-state"
4346
4357
  });
4347
4358
  var BranchPickerState = forwardRef20((props, ref) => {
4348
- return /* @__PURE__ */ jsxs6(BranchPickerStateWrapper, { ...props, ref, children: [
4359
+ return /* @__PURE__ */ jsxs5(BranchPickerStateWrapper, { ...props, ref, children: [
4349
4360
  /* @__PURE__ */ jsx37(branchPicker_exports.Number, {}),
4350
4361
  " / ",
4351
4362
  /* @__PURE__ */ jsx37(branchPicker_exports.Count, {})
@@ -4369,10 +4380,10 @@ var branch_picker_default = Object.assign(BranchPicker, exports2);
4369
4380
 
4370
4381
  // src/ui/base/avatar.tsx
4371
4382
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
4372
- import { jsx as jsx38, jsxs as jsxs7 } from "react/jsx-runtime";
4383
+ import { jsx as jsx38, jsxs as jsxs6 } from "react/jsx-runtime";
4373
4384
  var Avatar = ({ src, alt, fallback }) => {
4374
4385
  if (src == null && fallback == null) return null;
4375
- return /* @__PURE__ */ jsxs7(AvatarRoot, { children: [
4386
+ return /* @__PURE__ */ jsxs6(AvatarRoot, { children: [
4376
4387
  src != null && /* @__PURE__ */ jsx38(AvatarImage, { src, alt }),
4377
4388
  fallback != null && /* @__PURE__ */ jsx38(AvatarFallback, { children: fallback })
4378
4389
  ] });
@@ -4411,9 +4422,9 @@ var exports3 = { Text: withSmoothContextProvider(Text) };
4411
4422
  var content_part_default = exports3;
4412
4423
 
4413
4424
  // src/ui/assistant-message.tsx
4414
- import { jsx as jsx40, jsxs as jsxs8 } from "react/jsx-runtime";
4425
+ import { jsx as jsx40, jsxs as jsxs7 } from "react/jsx-runtime";
4415
4426
  var AssistantMessage = () => {
4416
- return /* @__PURE__ */ jsxs8(AssistantMessageRoot, { children: [
4427
+ return /* @__PURE__ */ jsxs7(AssistantMessageRoot, { children: [
4417
4428
  /* @__PURE__ */ jsx40(AssistantMessageAvatar, {}),
4418
4429
  /* @__PURE__ */ jsx40(AssistantMessageContent, {}),
4419
4430
  /* @__PURE__ */ jsx40(branch_picker_default, {}),
@@ -4501,7 +4512,7 @@ CircleStopIcon.displayName = "CircleStopIcon";
4501
4512
  // src/ui/composer-attachment.tsx
4502
4513
  import { forwardRef as forwardRef22 } from "react";
4503
4514
  import { CircleXIcon } from "lucide-react";
4504
- import { jsx as jsx42, jsxs as jsxs9 } from "react/jsx-runtime";
4515
+ import { jsx as jsx42, jsxs as jsxs8 } from "react/jsx-runtime";
4505
4516
  var ComposerAttachmentRoot = withDefaults("div", {
4506
4517
  className: "aui-composer-attachment-root"
4507
4518
  });
@@ -4509,7 +4520,7 @@ ComposerAttachmentRoot.displayName = "ComposerAttachmentRoot";
4509
4520
  var ComposerAttachment2 = () => {
4510
4521
  const { useAttachment } = useAttachmentContext({ type: "composer" });
4511
4522
  const attachment = useAttachment((a) => a.attachment);
4512
- return /* @__PURE__ */ jsxs9(ComposerAttachmentRoot, { children: [
4523
+ return /* @__PURE__ */ jsxs8(ComposerAttachmentRoot, { children: [
4513
4524
  ".",
4514
4525
  attachment.name.split(".").pop(),
4515
4526
  /* @__PURE__ */ jsx42(ComposerAttachmentRemove, {})
@@ -4551,7 +4562,7 @@ var composer_attachment_default = Object.assign(
4551
4562
  );
4552
4563
 
4553
4564
  // src/ui/composer.tsx
4554
- import { Fragment as Fragment5, jsx as jsx43, jsxs as jsxs10 } from "react/jsx-runtime";
4565
+ import { Fragment as Fragment5, jsx as jsx43, jsxs as jsxs9 } from "react/jsx-runtime";
4555
4566
  var useAllowAttachments = (ensureCapability = false) => {
4556
4567
  const { composer: { allowAttachments = true } = {} } = useThreadConfig();
4557
4568
  const { useThread } = useThreadContext();
@@ -4560,7 +4571,7 @@ var useAllowAttachments = (ensureCapability = false) => {
4560
4571
  };
4561
4572
  var Composer = () => {
4562
4573
  const allowAttachments = useAllowAttachments(true);
4563
- return /* @__PURE__ */ jsxs10(ComposerRoot, { children: [
4574
+ return /* @__PURE__ */ jsxs9(ComposerRoot, { children: [
4564
4575
  allowAttachments && /* @__PURE__ */ jsx43(ComposerAttachments, {}),
4565
4576
  allowAttachments && /* @__PURE__ */ jsx43(ComposerAddAttachment, {}),
4566
4577
  /* @__PURE__ */ jsx43(ComposerInput, { autoFocus: true }),
@@ -4633,7 +4644,7 @@ var useAllowCancel = () => {
4633
4644
  var ComposerAction = () => {
4634
4645
  const allowCancel = useAllowCancel();
4635
4646
  if (!allowCancel) return /* @__PURE__ */ jsx43(ComposerSend, {});
4636
- return /* @__PURE__ */ jsxs10(Fragment5, { children: [
4647
+ return /* @__PURE__ */ jsxs9(Fragment5, { children: [
4637
4648
  /* @__PURE__ */ jsx43(thread_exports.If, { running: false, children: /* @__PURE__ */ jsx43(ComposerSend, {}) }),
4638
4649
  /* @__PURE__ */ jsx43(thread_exports.If, { running: true, children: /* @__PURE__ */ jsx43(ComposerCancel, {}) })
4639
4650
  ] });
@@ -4674,10 +4685,10 @@ var composer_default = Object.assign(Composer, exports6);
4674
4685
 
4675
4686
  // src/ui/thread-welcome.tsx
4676
4687
  import { forwardRef as forwardRef24 } from "react";
4677
- import { jsx as jsx44, jsxs as jsxs11 } from "react/jsx-runtime";
4688
+ import { jsx as jsx44, jsxs as jsxs10 } from "react/jsx-runtime";
4678
4689
  var ThreadWelcome = () => {
4679
- return /* @__PURE__ */ jsxs11(ThreadWelcomeRoot, { children: [
4680
- /* @__PURE__ */ jsxs11(ThreadWelcomeCenter, { children: [
4690
+ return /* @__PURE__ */ jsxs10(ThreadWelcomeRoot, { children: [
4691
+ /* @__PURE__ */ jsxs10(ThreadWelcomeCenter, { children: [
4681
4692
  /* @__PURE__ */ jsx44(ThreadWelcomeAvatar, {}),
4682
4693
  /* @__PURE__ */ jsx44(ThreadWelcomeMessage, {})
4683
4694
  ] }),
@@ -4784,7 +4795,7 @@ var exports8 = {
4784
4795
  var user_action_bar_default = Object.assign(UserActionBar, exports8);
4785
4796
 
4786
4797
  // src/ui/user-message-attachment.tsx
4787
- import { jsxs as jsxs12 } from "react/jsx-runtime";
4798
+ import { jsxs as jsxs11 } from "react/jsx-runtime";
4788
4799
  var UserMessageAttachmentRoot = withDefaults("div", {
4789
4800
  className: "aui-user-message-attachment-root"
4790
4801
  });
@@ -4792,7 +4803,7 @@ UserMessageAttachmentRoot.displayName = "UserMessageAttachmentRoot";
4792
4803
  var UserMessageAttachment = () => {
4793
4804
  const { useAttachment } = useAttachmentContext();
4794
4805
  const attachment = useAttachment((a) => a.attachment);
4795
- return /* @__PURE__ */ jsxs12(UserMessageAttachmentRoot, { children: [
4806
+ return /* @__PURE__ */ jsxs11(UserMessageAttachmentRoot, { children: [
4796
4807
  ".",
4797
4808
  attachment.name.split(".").pop()
4798
4809
  ] });
@@ -4807,9 +4818,9 @@ var user_message_attachment_default = Object.assign(
4807
4818
  );
4808
4819
 
4809
4820
  // src/ui/user-message.tsx
4810
- import { jsx as jsx46, jsxs as jsxs13 } from "react/jsx-runtime";
4821
+ import { jsx as jsx46, jsxs as jsxs12 } from "react/jsx-runtime";
4811
4822
  var UserMessage = () => {
4812
- return /* @__PURE__ */ jsxs13(UserMessageRoot, { children: [
4823
+ return /* @__PURE__ */ jsxs12(UserMessageRoot, { children: [
4813
4824
  /* @__PURE__ */ jsx46(UserMessageAttachments, {}),
4814
4825
  /* @__PURE__ */ jsx46(user_action_bar_default, {}),
4815
4826
  /* @__PURE__ */ jsx46(UserMessageContent, {}),
@@ -4863,11 +4874,11 @@ var user_message_default = Object.assign(UserMessage, exports10);
4863
4874
 
4864
4875
  // src/ui/edit-composer.tsx
4865
4876
  import { forwardRef as forwardRef27 } from "react";
4866
- import { jsx as jsx47, jsxs as jsxs14 } from "react/jsx-runtime";
4877
+ import { jsx as jsx47, jsxs as jsxs13 } from "react/jsx-runtime";
4867
4878
  var EditComposer = () => {
4868
- return /* @__PURE__ */ jsxs14(EditComposerRoot, { children: [
4879
+ return /* @__PURE__ */ jsxs13(EditComposerRoot, { children: [
4869
4880
  /* @__PURE__ */ jsx47(EditComposerInput, {}),
4870
- /* @__PURE__ */ jsxs14(EditComposerFooter, { children: [
4881
+ /* @__PURE__ */ jsxs13(EditComposerFooter, { children: [
4871
4882
  /* @__PURE__ */ jsx47(EditComposerCancel, {}),
4872
4883
  /* @__PURE__ */ jsx47(EditComposerSend, {})
4873
4884
  ] })
@@ -4916,12 +4927,12 @@ var exports11 = {
4916
4927
  var edit_composer_default = Object.assign(EditComposer, exports11);
4917
4928
 
4918
4929
  // src/ui/thread.tsx
4919
- import { jsx as jsx48, jsxs as jsxs15 } from "react/jsx-runtime";
4930
+ import { jsx as jsx48, jsxs as jsxs14 } from "react/jsx-runtime";
4920
4931
  var Thread = (config) => {
4921
- return /* @__PURE__ */ jsx48(ThreadRoot, { config, children: /* @__PURE__ */ jsxs15(ThreadViewport, { children: [
4932
+ return /* @__PURE__ */ jsx48(ThreadRoot, { config, children: /* @__PURE__ */ jsxs14(ThreadViewport, { children: [
4922
4933
  /* @__PURE__ */ jsx48(thread_welcome_default, {}),
4923
4934
  /* @__PURE__ */ jsx48(ThreadMessages, {}),
4924
- /* @__PURE__ */ jsxs15(ThreadViewportFooter, { children: [
4935
+ /* @__PURE__ */ jsxs14(ThreadViewportFooter, { children: [
4925
4936
  /* @__PURE__ */ jsx48(ThreadScrollToBottom, {}),
4926
4937
  /* @__PURE__ */ jsx48(composer_default, {})
4927
4938
  ] })
@@ -4983,9 +4994,9 @@ var exports12 = {
4983
4994
  var thread_default = Object.assign(Thread, exports12);
4984
4995
 
4985
4996
  // src/ui/assistant-modal.tsx
4986
- import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs16 } from "react/jsx-runtime";
4997
+ import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs15 } from "react/jsx-runtime";
4987
4998
  var AssistantModal = (config) => {
4988
- return /* @__PURE__ */ jsxs16(AssistantModalRoot, { config, children: [
4999
+ return /* @__PURE__ */ jsxs15(AssistantModalRoot, { config, children: [
4989
5000
  /* @__PURE__ */ jsx49(AssistantModalTrigger, {}),
4990
5001
  /* @__PURE__ */ jsx49(AssistantModalContent, { children: /* @__PURE__ */ jsx49(thread_default, {}) })
4991
5002
  ] });
@@ -5029,7 +5040,7 @@ var AssistantModalButton = forwardRef29(({ "data-state": state, ...rest }, ref)
5029
5040
  "data-state": state,
5030
5041
  ...rest,
5031
5042
  ref,
5032
- children: rest.children ?? /* @__PURE__ */ jsxs16(Fragment6, { children: [
5043
+ children: rest.children ?? /* @__PURE__ */ jsxs15(Fragment6, { children: [
5033
5044
  /* @__PURE__ */ jsx49(
5034
5045
  BotIcon,
5035
5046
  {