@assistant-ui/react 0.5.75 → 0.5.76

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/dist/index.mjs CHANGED
@@ -632,13 +632,9 @@ var useActionBarStopSpeaking = () => {
632
632
  import { useCallback as useCallback8 } from "react";
633
633
  var useActionBarFeedbackPositive = () => {
634
634
  const messageRuntime = useMessageRuntime();
635
- const messageUtilsStore = useMessageUtilsStore();
636
635
  const callback = useCallback8(() => {
637
- messageRuntime.submitFeedback({
638
- type: "positive"
639
- });
640
- messageUtilsStore.getState().setSubmittedFeedback("positive");
641
- }, [messageUtilsStore, messageRuntime]);
636
+ messageRuntime.submitFeedback({ type: "positive" });
637
+ }, [messageRuntime]);
642
638
  return callback;
643
639
  };
644
640
 
@@ -646,13 +642,9 @@ var useActionBarFeedbackPositive = () => {
646
642
  import { useCallback as useCallback9 } from "react";
647
643
  var useActionBarFeedbackNegative = () => {
648
644
  const messageRuntime = useMessageRuntime();
649
- const messageUtilsStore = useMessageUtilsStore();
650
645
  const callback = useCallback9(() => {
651
- messageRuntime.submitFeedback({
652
- type: "negative"
653
- });
654
- messageUtilsStore.getState().setSubmittedFeedback("negative");
655
- }, [messageUtilsStore, messageRuntime]);
646
+ messageRuntime.submitFeedback({ type: "negative" });
647
+ }, [messageRuntime]);
656
648
  return callback;
657
649
  };
658
650
 
@@ -740,23 +732,21 @@ var useComposerSend = () => {
740
732
  import { useCallback as useCallback14 } from "react";
741
733
  var useComposerAddAttachment = () => {
742
734
  const disabled = useComposer((c) => !c.isEditing);
743
- const threadComposerStore = useThreadComposerStore();
744
- const threadRuntimeStore = useThreadComposerStore();
735
+ const composerRuntime = useComposerRuntime();
745
736
  const callback = useCallback14(() => {
746
- const { addAttachment } = threadComposerStore.getState();
747
- const { attachmentAccept } = threadRuntimeStore.getState();
748
737
  const input = document.createElement("input");
749
738
  input.type = "file";
739
+ const attachmentAccept = composerRuntime.getAttachmentAccept();
750
740
  if (attachmentAccept !== "*") {
751
741
  input.accept = attachmentAccept;
752
742
  }
753
743
  input.onchange = (e) => {
754
744
  const file = e.target.files?.[0];
755
745
  if (!file) return;
756
- addAttachment(file);
746
+ composerRuntime.addAttachment(file);
757
747
  };
758
748
  input.click();
759
- }, [threadComposerStore, threadRuntimeStore]);
749
+ }, [composerRuntime]);
760
750
  if (disabled) return null;
761
751
  return callback;
762
752
  };
@@ -803,7 +793,15 @@ var useMessageIf = (props) => {
803
793
  const messageUtilsStore = useMessageUtilsStore();
804
794
  return useCombinedStore(
805
795
  [messageStore, messageUtilsStore],
806
- ({ role, attachments, branchCount, isLast, speech }, { isCopied, isHovering, submittedFeedback }) => {
796
+ ({
797
+ role,
798
+ attachments,
799
+ content,
800
+ branchCount,
801
+ isLast,
802
+ speech,
803
+ submittedFeedback
804
+ }, { isCopied, isHovering }) => {
807
805
  if (props.hasBranches === true && branchCount < 2) return false;
808
806
  if (props.user && role !== "user") return false;
809
807
  if (props.assistant && role !== "assistant") return false;
@@ -817,7 +815,9 @@ var useMessageIf = (props) => {
817
815
  return false;
818
816
  if (props.hasAttachments === false && role === "user" && !!attachments.length)
819
817
  return false;
820
- if (props.submittedFeedback !== void 0 && submittedFeedback !== props.submittedFeedback)
818
+ if (props.hasContent === true && content.length === 0) return false;
819
+ if (props.hasContent === false && content.length > 0) return false;
820
+ if (props.submittedFeedback !== void 0 && (submittedFeedback?.type ?? null) !== props.submittedFeedback)
821
821
  return false;
822
822
  return true;
823
823
  }
@@ -913,7 +913,7 @@ var useActionBarFloatStatus = ({
913
913
  const autohideEnabled = autohide === "always" || autohide === "not-last" && !m.isLast;
914
914
  if (!autohideEnabled) return "normal" /* Normal */;
915
915
  if (!mu.isHovering) return "hidden" /* Hidden */;
916
- if (autohideFloat === "always" || autohideFloat === "single-branch" && m.branches.length <= 1)
916
+ if (autohideFloat === "always" || autohideFloat === "single-branch" && m.branchCount <= 1)
917
917
  return "floating" /* Floating */;
918
918
  return "normal" /* Normal */;
919
919
  }
@@ -1051,8 +1051,8 @@ import { composeEventHandlers as composeEventHandlers4 } from "@radix-ui/primiti
1051
1051
  import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
1052
1052
  import { jsx as jsx8 } from "react/jsx-runtime";
1053
1053
  var ActionBarPrimitiveFeedbackPositive = forwardRef5(({ onClick, disabled, ...props }, forwardedRef) => {
1054
- const isSubmitted = useMessageUtils(
1055
- (u) => u.submittedFeedback === "positive"
1054
+ const isSubmitted = useMessage(
1055
+ (u) => u.submittedFeedback?.type === "positive"
1056
1056
  );
1057
1057
  const callback = useActionBarFeedbackPositive();
1058
1058
  return /* @__PURE__ */ jsx8(
@@ -1077,8 +1077,8 @@ import { composeEventHandlers as composeEventHandlers5 } from "@radix-ui/primiti
1077
1077
  import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
1078
1078
  import { jsx as jsx9 } from "react/jsx-runtime";
1079
1079
  var ActionBarPrimitiveFeedbackNegative = forwardRef6(({ onClick, disabled, ...props }, forwardedRef) => {
1080
- const isSubmitted = useMessageUtils(
1081
- (u) => u.submittedFeedback === "negative"
1080
+ const isSubmitted = useMessage(
1081
+ (u) => u.submittedFeedback?.type === "negative"
1082
1082
  );
1083
1083
  const callback = useActionBarFeedbackNegative();
1084
1084
  return /* @__PURE__ */ jsx9(
@@ -1302,9 +1302,9 @@ var { useAttachment: useMessageAttachment } = createContextStoreHook(
1302
1302
  // src/primitives/attachment/AttachmentThumb.tsx
1303
1303
  import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
1304
1304
  import { jsxs } from "react/jsx-runtime";
1305
- var AttachmentPrimitiveThumb = forwardRef11(() => {
1305
+ var AttachmentPrimitiveThumb = forwardRef11((props, ref) => {
1306
1306
  const ext = useAttachment((a) => a.name.split(".").pop());
1307
- return /* @__PURE__ */ jsxs(Primitive8.div, { children: [
1307
+ return /* @__PURE__ */ jsxs(Primitive8.div, { ...props, ref, children: [
1308
1308
  ".",
1309
1309
  ext
1310
1310
  ] });
@@ -1845,7 +1845,6 @@ var getThreadComposerState = (runtime, focus, onFocus) => {
1845
1845
  isEmpty: runtime?.isEmpty ?? true,
1846
1846
  text: runtime?.text ?? "",
1847
1847
  attachments: runtime?.attachments ?? EMPTY_ARRAY,
1848
- attachmentAccept: runtime?.attachmentAccept ?? "*",
1849
1848
  value: runtime?.text ?? "",
1850
1849
  setValue: runtime?.setText.bind(runtime) ?? METHOD_NOT_SUPPORTED,
1851
1850
  setText: runtime?.setText.bind(runtime) ?? METHOD_NOT_SUPPORTED,
@@ -1867,7 +1866,6 @@ var getEditComposerState = (runtime, beginEdit) => {
1867
1866
  isEmpty: runtime?.isEmpty ?? true,
1868
1867
  text: runtime?.text ?? "",
1869
1868
  attachments: runtime?.attachments ?? EMPTY_ARRAY,
1870
- attachmentAccept: runtime?.attachmentAccept ?? "*",
1871
1869
  value: runtime?.text ?? "",
1872
1870
  setValue: runtime?.setText.bind(runtime) ?? METHOD_NOT_SUPPORTED,
1873
1871
  setText: runtime?.setText.bind(runtime) ?? METHOD_NOT_SUPPORTED,
@@ -1904,12 +1902,6 @@ var ComposerRuntimeImpl = class {
1904
1902
  get text() {
1905
1903
  return this.getState().text;
1906
1904
  }
1907
- /**
1908
- * @deprecated Use `getState().attachmentAccept` instead. This will be removed in 0.6.0.
1909
- */
1910
- get attachmentAccept() {
1911
- return this.getState().attachmentAccept;
1912
- }
1913
1905
  /**
1914
1906
  * @deprecated Use `getState().attachments` instead. This will be removed in 0.6.0.
1915
1907
  */
@@ -1964,6 +1956,11 @@ var ComposerRuntimeImpl = class {
1964
1956
  subscribe(callback) {
1965
1957
  return this._core.subscribe(callback);
1966
1958
  }
1959
+ getAttachmentAccept() {
1960
+ const core = this._core.getState();
1961
+ if (!core) throw new Error("Composer is not available");
1962
+ return core.getAttachmentAccept();
1963
+ }
1967
1964
  };
1968
1965
  var ThreadComposerRuntimeImpl = class extends ComposerRuntimeImpl {
1969
1966
  get type() {
@@ -2828,10 +2825,6 @@ var makeMessageUtilsStore = () => create9((set) => {
2828
2825
  isHovering: false,
2829
2826
  setIsHovering: (value) => {
2830
2827
  set({ isHovering: value });
2831
- },
2832
- submittedFeedback: null,
2833
- setSubmittedFeedback: (feedback) => {
2834
- set({ submittedFeedback: feedback });
2835
2828
  }
2836
2829
  };
2837
2830
  });
@@ -3028,7 +3021,9 @@ __export(internal_exports, {
3028
3021
  var isAttachmentComplete = (a) => a.status.type === "complete";
3029
3022
  var BaseComposerRuntimeCore = class {
3030
3023
  isEditing = true;
3031
- attachmentAccept = "*";
3024
+ getAttachmentAccept() {
3025
+ return this.getAttachmentAdapter()?.accept ?? "*";
3026
+ }
3032
3027
  _attachments = [];
3033
3028
  set attachments(value) {
3034
3029
  this._attachments = value;
@@ -3054,10 +3049,11 @@ var BaseComposerRuntimeCore = class {
3054
3049
  this.notifySubscribers();
3055
3050
  }
3056
3051
  async send() {
3057
- const attachments = this._attachmentAdapter ? await Promise.all(
3052
+ const adapter = this.getAttachmentAdapter();
3053
+ const attachments = adapter && this.attachments.length > 0 ? await Promise.all(
3058
3054
  this.attachments.map(async (a) => {
3059
3055
  if (isAttachmentComplete(a)) return a;
3060
- const result = await this._attachmentAdapter.send(a);
3056
+ const result = await adapter.send(a);
3061
3057
  if (result.status?.type !== "complete") {
3062
3058
  result.status = { type: "complete" };
3063
3059
  }
@@ -3072,19 +3068,10 @@ var BaseComposerRuntimeCore = class {
3072
3068
  this.reset();
3073
3069
  this.handleSend(message);
3074
3070
  }
3075
- _attachmentAdapter;
3076
- setAttachmentAdapter(adapter) {
3077
- this._attachmentAdapter = adapter;
3078
- const accept = adapter?.accept ?? "*";
3079
- if (this.attachmentAccept !== accept) {
3080
- this.attachmentAccept = accept;
3081
- this.notifySubscribers();
3082
- }
3083
- }
3084
3071
  async addAttachment(file) {
3085
- if (!this._attachmentAdapter)
3086
- throw new Error("Attachments are not supported");
3087
- const attachment = await this._attachmentAdapter.add({ file });
3072
+ const adapter = this.getAttachmentAdapter();
3073
+ if (!adapter) throw new Error("Attachments are not supported");
3074
+ const attachment = await adapter.add({ file });
3088
3075
  if (attachment.status === void 0) {
3089
3076
  attachment.status = { type: "requires-action", reason: "composer-send" };
3090
3077
  }
@@ -3092,12 +3079,12 @@ var BaseComposerRuntimeCore = class {
3092
3079
  this.notifySubscribers();
3093
3080
  }
3094
3081
  async removeAttachment(attachmentId) {
3095
- if (!this._attachmentAdapter)
3096
- throw new Error("Attachments are not supported");
3082
+ const adapter = this.getAttachmentAdapter();
3083
+ if (!adapter) throw new Error("Attachments are not supported");
3097
3084
  const index = this._attachments.findIndex((a) => a.id === attachmentId);
3098
3085
  if (index === -1) throw new Error("Attachment not found");
3099
3086
  const attachment = this._attachments[index];
3100
- await this._attachmentAdapter.remove(attachment);
3087
+ await adapter.remove(attachment);
3101
3088
  this._attachments = this._attachments.toSpliced(index, 1);
3102
3089
  this.notifySubscribers();
3103
3090
  }
@@ -3125,6 +3112,9 @@ var DefaultThreadComposerRuntimeCore = class extends BaseComposerRuntimeCore {
3125
3112
  get attachments() {
3126
3113
  return super.attachments;
3127
3114
  }
3115
+ getAttachmentAdapter() {
3116
+ return this.runtime.adapters?.attachments;
3117
+ }
3128
3118
  connect() {
3129
3119
  return this.runtime.subscribe(() => {
3130
3120
  if (this.canCancel !== this.runtime.capabilities.cancel) {
@@ -3503,36 +3493,6 @@ var TooltipIconButton = forwardRef23(({ children, tooltip, side = "bottom", ...r
3503
3493
  });
3504
3494
  TooltipIconButton.displayName = "TooltipIconButton";
3505
3495
 
3506
- // src/api/AssistantRuntime.ts
3507
- var AssistantRuntimeImpl = class {
3508
- constructor(_core, CustomThreadRuntime) {
3509
- this._core = _core;
3510
- this.thread = new CustomThreadRuntime(
3511
- new NestedSubscriptionSubject({
3512
- getState: () => this._core.thread,
3513
- subscribe: (callback) => this._core.subscribe(callback)
3514
- })
3515
- );
3516
- }
3517
- thread;
3518
- switchToNewThread() {
3519
- return this._core.switchToNewThread();
3520
- }
3521
- switchToThread(threadId) {
3522
- return this._core.switchToThread(threadId);
3523
- }
3524
- registerModelConfigProvider(provider) {
3525
- return this._core.registerModelConfigProvider(provider);
3526
- }
3527
- // TODO events for thread switching
3528
- /**
3529
- * @deprecated Thread is now static and never gets updated. This will be removed in 0.6.0.
3530
- */
3531
- subscribe(callback) {
3532
- return this._core.subscribe(callback);
3533
- }
3534
- };
3535
-
3536
3496
  // src/api/ThreadRuntime.ts
3537
3497
  var toAppendMessage = (messages2, message) => {
3538
3498
  if (typeof message === "string") {
@@ -3685,6 +3645,9 @@ var ThreadRuntimeImpl = class {
3685
3645
  stopSpeaking() {
3686
3646
  return this._threadBinding.getState().stopSpeaking();
3687
3647
  }
3648
+ getSubmittedFeedback(messageId) {
3649
+ return this._threadBinding.getState().getSubmittedFeedback(messageId);
3650
+ }
3688
3651
  /**
3689
3652
  * @deprecated Use `getMesssageById(id).submitFeedback({ type })` instead. This will be removed in 0.6.0.
3690
3653
  */
@@ -3717,7 +3680,9 @@ var ThreadRuntimeImpl = class {
3717
3680
  const { messages: messages2, speech: speechState } = this.getState();
3718
3681
  const message = messages2[idx];
3719
3682
  if (!message) return SKIP_UPDATE;
3720
- const branches = this._threadBinding.getState().getBranches(message.id);
3683
+ const thread = this._threadBinding.getState();
3684
+ const branches = thread.getBranches(message.id);
3685
+ const submittedFeedback = thread.getSubmittedFeedback(message.id);
3721
3686
  return {
3722
3687
  ...message,
3723
3688
  message,
@@ -3726,7 +3691,8 @@ var ThreadRuntimeImpl = class {
3726
3691
  branches,
3727
3692
  branchNumber: branches.indexOf(message.id) + 1,
3728
3693
  branchCount: branches.length,
3729
- speech: speechState?.messageId === message.id ? speechState : null
3694
+ speech: speechState?.messageId === message.id ? speechState : void 0,
3695
+ submittedFeedback
3730
3696
  };
3731
3697
  },
3732
3698
  subscribe: (callback) => this._threadBinding.subscribe(callback)
@@ -3736,6 +3702,47 @@ var ThreadRuntimeImpl = class {
3736
3702
  }
3737
3703
  };
3738
3704
 
3705
+ // src/api/AssistantRuntime.ts
3706
+ var AssistantRuntimeImpl = class _AssistantRuntimeImpl {
3707
+ constructor(_core, _thread) {
3708
+ this._core = _core;
3709
+ this._thread = _thread;
3710
+ }
3711
+ get thread() {
3712
+ return this._thread;
3713
+ }
3714
+ switchToNewThread() {
3715
+ return this._core.switchToNewThread();
3716
+ }
3717
+ switchToThread(threadId) {
3718
+ return this._core.switchToThread(threadId);
3719
+ }
3720
+ registerModelConfigProvider(provider) {
3721
+ return this._core.registerModelConfigProvider(provider);
3722
+ }
3723
+ // TODO events for thread switching
3724
+ /**
3725
+ * @deprecated Thread is now static and never gets updated. This will be removed in 0.6.0.
3726
+ */
3727
+ subscribe(callback) {
3728
+ return this._core.subscribe(callback);
3729
+ }
3730
+ static createThreadRuntime(_core, CustomThreadRuntime = ThreadRuntimeImpl) {
3731
+ return new CustomThreadRuntime(
3732
+ new NestedSubscriptionSubject({
3733
+ getState: () => _core.thread,
3734
+ subscribe: (callback) => _core.subscribe(callback)
3735
+ })
3736
+ );
3737
+ }
3738
+ static create(_core, CustomThreadRuntime = ThreadRuntimeImpl) {
3739
+ return new _AssistantRuntimeImpl(
3740
+ _core,
3741
+ _AssistantRuntimeImpl.createThreadRuntime(_core, CustomThreadRuntime)
3742
+ );
3743
+ }
3744
+ };
3745
+
3739
3746
  // src/runtimes/edge/converters/fromLanguageModelMessages.ts
3740
3747
  var fromLanguageModelMessages = (lm, { mergeSteps }) => {
3741
3748
  const messages2 = [];
@@ -4098,10 +4105,14 @@ var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
4098
4105
  this._nonTextParts = message.content.filter(
4099
4106
  (part) => part.type !== "text" && part.type !== "ui"
4100
4107
  );
4108
+ this.attachments = message.attachments ?? [];
4101
4109
  }
4102
4110
  get canCancel() {
4103
4111
  return true;
4104
4112
  }
4113
+ getAttachmentAdapter() {
4114
+ return this.runtime.adapters?.attachments;
4115
+ }
4105
4116
  _nonTextParts;
4106
4117
  _previousText;
4107
4118
  _parentId;
@@ -4123,10 +4134,107 @@ var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
4123
4134
  }
4124
4135
  };
4125
4136
 
4137
+ // src/runtimes/core/BaseThreadRuntimeCore.tsx
4138
+ var BaseThreadRuntimeCore = class {
4139
+ constructor(configProvider) {
4140
+ this.configProvider = configProvider;
4141
+ }
4142
+ _subscriptions = /* @__PURE__ */ new Set();
4143
+ repository = new MessageRepository();
4144
+ get messages() {
4145
+ return this.repository.getMessages();
4146
+ }
4147
+ composer = new DefaultThreadComposerRuntimeCore(this);
4148
+ getModelConfig() {
4149
+ return this.configProvider.getModelConfig();
4150
+ }
4151
+ _editComposers = /* @__PURE__ */ new Map();
4152
+ getEditComposer(messageId) {
4153
+ return this._editComposers.get(messageId);
4154
+ }
4155
+ beginEdit(messageId) {
4156
+ if (this._editComposers.has(messageId))
4157
+ throw new Error("Edit already in progress");
4158
+ this._editComposers.set(
4159
+ messageId,
4160
+ new DefaultEditComposerRuntimeCore(
4161
+ this,
4162
+ () => this._editComposers.delete(messageId),
4163
+ this.repository.getMessage(messageId)
4164
+ )
4165
+ );
4166
+ this.notifySubscribers();
4167
+ }
4168
+ getBranches(messageId) {
4169
+ return this.repository.getBranches(messageId);
4170
+ }
4171
+ switchToBranch(branchId) {
4172
+ this.repository.switchToBranch(branchId);
4173
+ this.notifySubscribers();
4174
+ }
4175
+ notifySubscribers() {
4176
+ for (const callback of this._subscriptions) callback();
4177
+ }
4178
+ subscribe(callback) {
4179
+ this._subscriptions.add(callback);
4180
+ return () => this._subscriptions.delete(callback);
4181
+ }
4182
+ _submittedFeedback = {};
4183
+ getSubmittedFeedback(messageId) {
4184
+ return this._submittedFeedback[messageId];
4185
+ }
4186
+ submitFeedback({ messageId, type }) {
4187
+ const adapter = this.adapters?.feedback;
4188
+ if (!adapter) throw new Error("Feedback adapter not configured");
4189
+ const { message } = this.repository.getMessage(messageId);
4190
+ adapter.submit({ message, type });
4191
+ this._submittedFeedback[messageId] = { type };
4192
+ this.notifySubscribers();
4193
+ }
4194
+ _stopSpeaking;
4195
+ speech;
4196
+ speak(messageId) {
4197
+ const adapter = this.adapters?.speech;
4198
+ if (!adapter) throw new Error("Speech adapter not configured");
4199
+ const { message } = this.repository.getMessage(messageId);
4200
+ this._stopSpeaking?.();
4201
+ const utterance = adapter.speak(message);
4202
+ const unsub = utterance.subscribe(() => {
4203
+ if (utterance.status.type === "ended") {
4204
+ this._stopSpeaking = void 0;
4205
+ this.speech = void 0;
4206
+ } else {
4207
+ this.speech = { messageId, status: utterance.status };
4208
+ }
4209
+ this.notifySubscribers();
4210
+ });
4211
+ this.speech = { messageId, status: utterance.status };
4212
+ this.notifySubscribers();
4213
+ this._stopSpeaking = () => {
4214
+ utterance.cancel();
4215
+ unsub();
4216
+ this.speech = void 0;
4217
+ this._stopSpeaking = void 0;
4218
+ };
4219
+ }
4220
+ stopSpeaking() {
4221
+ if (!this._stopSpeaking) throw new Error("No message is being spoken");
4222
+ this._stopSpeaking();
4223
+ this.notifySubscribers();
4224
+ }
4225
+ export() {
4226
+ return this.repository.export();
4227
+ }
4228
+ import(data) {
4229
+ this.repository.import(data);
4230
+ this.notifySubscribers();
4231
+ }
4232
+ };
4233
+
4126
4234
  // src/runtimes/local/LocalThreadRuntimeCore.tsx
4127
- var LocalThreadRuntimeCore = class {
4235
+ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
4128
4236
  constructor(configProvider, adapter, { initialMessages, ...options }) {
4129
- this.configProvider = configProvider;
4237
+ super(configProvider);
4130
4238
  this.adapter = adapter;
4131
4239
  this.threadId = generateId();
4132
4240
  this.options = options;
@@ -4139,28 +4247,22 @@ var LocalThreadRuntimeCore = class {
4139
4247
  }
4140
4248
  }
4141
4249
  }
4142
- _subscriptions = /* @__PURE__ */ new Set();
4143
- abortController = null;
4144
- repository = new MessageRepository();
4145
4250
  capabilities = {
4146
4251
  switchToBranch: true,
4147
4252
  edit: true,
4148
4253
  reload: true,
4149
4254
  cancel: true,
4150
4255
  unstable_copy: true,
4151
- speak: false,
4256
+ speech: false,
4152
4257
  attachments: false,
4153
4258
  feedback: false
4154
4259
  };
4260
+ abortController = null;
4155
4261
  threadId;
4156
4262
  isDisabled = false;
4157
4263
  suggestions = [];
4158
- get messages() {
4159
- return this.repository.getMessages();
4160
- }
4161
- composer = new DefaultThreadComposerRuntimeCore(this);
4162
- getModelConfig() {
4163
- return this.configProvider.getModelConfig();
4264
+ get adapters() {
4265
+ return this.options.adapters;
4164
4266
  }
4165
4267
  _options;
4166
4268
  get options() {
@@ -4173,11 +4275,10 @@ var LocalThreadRuntimeCore = class {
4173
4275
  this._options = options;
4174
4276
  let hasUpdates = false;
4175
4277
  const canSpeak = options.adapters?.speech !== void 0;
4176
- if (this.capabilities.speak !== canSpeak) {
4177
- this.capabilities.speak = canSpeak;
4278
+ if (this.capabilities.speech !== canSpeak) {
4279
+ this.capabilities.speech = canSpeak;
4178
4280
  hasUpdates = true;
4179
4281
  }
4180
- this.composer.setAttachmentAdapter(options.adapters?.attachments);
4181
4282
  const canAttach = options.adapters?.attachments !== void 0;
4182
4283
  if (this.capabilities.attachments !== canAttach) {
4183
4284
  this.capabilities.attachments = canAttach;
@@ -4190,30 +4291,6 @@ var LocalThreadRuntimeCore = class {
4190
4291
  }
4191
4292
  if (hasUpdates) this.notifySubscribers();
4192
4293
  }
4193
- _editComposers = /* @__PURE__ */ new Map();
4194
- getEditComposer(messageId) {
4195
- return this._editComposers.get(messageId);
4196
- }
4197
- beginEdit(messageId) {
4198
- if (this._editComposers.has(messageId))
4199
- throw new Error("Edit already in progress");
4200
- this._editComposers.set(
4201
- messageId,
4202
- new DefaultEditComposerRuntimeCore(
4203
- this,
4204
- () => this._editComposers.delete(messageId),
4205
- this.repository.getMessage(messageId)
4206
- )
4207
- );
4208
- this.notifySubscribers();
4209
- }
4210
- getBranches(messageId) {
4211
- return this.repository.getBranches(messageId);
4212
- }
4213
- switchToBranch(branchId) {
4214
- this.repository.switchToBranch(branchId);
4215
- this.notifySubscribers();
4216
- }
4217
4294
  async append(message) {
4218
4295
  const newMessage = fromCoreMessage(message, {
4219
4296
  attachments: message.attachments
@@ -4290,7 +4367,7 @@ var LocalThreadRuntimeCore = class {
4290
4367
  const promiseOrGenerator = this.adapter.run({
4291
4368
  messages: messages2,
4292
4369
  abortSignal: this.abortController.signal,
4293
- config: this.configProvider.getModelConfig(),
4370
+ config: this.getModelConfig(),
4294
4371
  onUpdate: updateMessage
4295
4372
  });
4296
4373
  if (Symbol.asyncIterator in promiseOrGenerator) {
@@ -4322,17 +4399,9 @@ var LocalThreadRuntimeCore = class {
4322
4399
  return message;
4323
4400
  }
4324
4401
  cancelRun() {
4325
- if (!this.abortController) return;
4326
- this.abortController.abort();
4402
+ this.abortController?.abort();
4327
4403
  this.abortController = null;
4328
4404
  }
4329
- notifySubscribers() {
4330
- for (const callback of this._subscriptions) callback();
4331
- }
4332
- subscribe(callback) {
4333
- this._subscriptions.add(callback);
4334
- return () => this._subscriptions.delete(callback);
4335
- }
4336
4405
  addToolResult({
4337
4406
  messageId,
4338
4407
  toolCallId,
@@ -4366,49 +4435,6 @@ var LocalThreadRuntimeCore = class {
4366
4435
  this.performRoundtrip(parentId, message);
4367
4436
  }
4368
4437
  }
4369
- // TODO speech runtime?
4370
- _stopSpeaking;
4371
- speech = null;
4372
- speak(messageId) {
4373
- const adapter = this.options.adapters?.speech;
4374
- if (!adapter) throw new Error("Speech adapter not configured");
4375
- const { message } = this.repository.getMessage(messageId);
4376
- this._stopSpeaking?.();
4377
- const utterance = adapter.speak(message);
4378
- const unsub = utterance.subscribe(() => {
4379
- if (utterance.status.type === "ended") {
4380
- this._stopSpeaking = void 0;
4381
- this.speech = null;
4382
- } else {
4383
- this.speech = { messageId, status: utterance.status };
4384
- }
4385
- this.notifySubscribers();
4386
- });
4387
- this.speech = { messageId, status: utterance.status };
4388
- this._stopSpeaking = () => {
4389
- utterance.cancel();
4390
- unsub();
4391
- this.speech = null;
4392
- this._stopSpeaking = void 0;
4393
- };
4394
- }
4395
- stopSpeaking() {
4396
- if (!this._stopSpeaking) throw new Error("No message is being spoken");
4397
- this._stopSpeaking();
4398
- }
4399
- submitFeedback({ messageId, type }) {
4400
- const adapter = this.options.adapters?.feedback;
4401
- if (!adapter) throw new Error("Feedback adapter not configured");
4402
- const { message } = this.repository.getMessage(messageId);
4403
- adapter.submit({ message, type });
4404
- }
4405
- export() {
4406
- return this.repository.export();
4407
- }
4408
- import(data) {
4409
- this.repository.import(data);
4410
- this.notifySubscribers();
4411
- }
4412
4438
  };
4413
4439
 
4414
4440
  // src/runtimes/local/LocalRuntimeCore.tsx
@@ -4452,14 +4478,20 @@ var LocalRuntimeCore = class extends BaseAssistantRuntimeCore {
4452
4478
  };
4453
4479
 
4454
4480
  // src/runtimes/local/useLocalRuntime.tsx
4455
- var LocalRuntime = class extends AssistantRuntimeImpl {
4456
- constructor(core) {
4457
- super(core, ThreadRuntimeImpl);
4481
+ var LocalRuntimeImpl = class _LocalRuntimeImpl extends AssistantRuntimeImpl {
4482
+ constructor(core, thread) {
4483
+ super(core, thread);
4458
4484
  this.core = core;
4459
4485
  }
4460
4486
  reset(options) {
4461
4487
  this.core.reset(options);
4462
4488
  }
4489
+ static create(_core) {
4490
+ return new _LocalRuntimeImpl(
4491
+ _core,
4492
+ AssistantRuntimeImpl.createThreadRuntime(_core, ThreadRuntimeImpl)
4493
+ );
4494
+ }
4463
4495
  };
4464
4496
  var useLocalRuntime = (adapter, options = {}) => {
4465
4497
  const [runtime] = useState11(() => new LocalRuntimeCore(adapter, options));
@@ -4467,7 +4499,7 @@ var useLocalRuntime = (adapter, options = {}) => {
4467
4499
  runtime.thread.adapter = adapter;
4468
4500
  runtime.thread.options = options;
4469
4501
  });
4470
- return useMemo11(() => new LocalRuntime(runtime), [runtime]);
4502
+ return useMemo11(() => LocalRuntimeImpl.create(runtime), [runtime]);
4471
4503
  };
4472
4504
 
4473
4505
  // src/runtimes/external-store/useExternalStoreRuntime.tsx
@@ -4580,13 +4612,7 @@ var EMPTY_ARRAY2 = Object.freeze([]);
4580
4612
  var hasUpcomingMessage = (isRunning, messages2) => {
4581
4613
  return isRunning && messages2[messages2.length - 1]?.role !== "assistant";
4582
4614
  };
4583
- var ExternalStoreThreadRuntimeCore = class {
4584
- constructor(configProvider, store) {
4585
- this.configProvider = configProvider;
4586
- this.store = store;
4587
- }
4588
- _subscriptions = /* @__PURE__ */ new Set();
4589
- repository = new MessageRepository();
4615
+ var ExternalStoreThreadRuntimeCore = class extends BaseThreadRuntimeCore {
4590
4616
  assistantOptimisticId = null;
4591
4617
  _capabilities = {
4592
4618
  switchToBranch: false,
@@ -4594,7 +4620,7 @@ var ExternalStoreThreadRuntimeCore = class {
4594
4620
  reload: false,
4595
4621
  cancel: false,
4596
4622
  unstable_copy: false,
4597
- speak: false,
4623
+ speech: false,
4598
4624
  attachments: false,
4599
4625
  feedback: false
4600
4626
  };
@@ -4602,29 +4628,26 @@ var ExternalStoreThreadRuntimeCore = class {
4602
4628
  return this._capabilities;
4603
4629
  }
4604
4630
  threadId;
4605
- messages;
4631
+ _messages;
4606
4632
  isDisabled;
4633
+ get messages() {
4634
+ return this._messages;
4635
+ }
4636
+ get adapters() {
4637
+ return this._store.adapters;
4638
+ }
4607
4639
  suggestions = [];
4608
4640
  extras = void 0;
4609
4641
  _converter = new ThreadMessageConverter();
4610
4642
  _store;
4611
- composer = new DefaultThreadComposerRuntimeCore(this);
4612
- _editComposers = /* @__PURE__ */ new Map();
4613
- getEditComposer(messageId) {
4614
- return this._editComposers.get(messageId);
4615
- }
4616
4643
  beginEdit(messageId) {
4617
- if (this._editComposers.has(messageId))
4618
- throw new Error("Edit already in progress");
4619
- this._editComposers.set(
4620
- messageId,
4621
- new DefaultEditComposerRuntimeCore(
4622
- this,
4623
- () => this._editComposers.delete(messageId),
4624
- this.repository.getMessage(messageId)
4625
- )
4626
- );
4627
- this.notifySubscribers();
4644
+ if (!this.store.onEdit)
4645
+ throw new Error("Runtime does not support editing.");
4646
+ super.beginEdit(messageId);
4647
+ }
4648
+ constructor(configProvider, store) {
4649
+ super(configProvider);
4650
+ this.store = store;
4628
4651
  }
4629
4652
  get store() {
4630
4653
  return this._store;
@@ -4643,13 +4666,12 @@ var ExternalStoreThreadRuntimeCore = class {
4643
4666
  edit: this._store.onEdit !== void 0,
4644
4667
  reload: this._store.onReload !== void 0,
4645
4668
  cancel: this._store.onCancel !== void 0,
4646
- speak: this._store.onSpeak !== void 0,
4669
+ speech: this._store.adapters?.speech !== void 0,
4647
4670
  unstable_copy: this._store.unstable_capabilities?.copy !== false,
4648
4671
  // default true
4649
4672
  attachments: !!this.store.adapters?.attachments,
4650
4673
  feedback: !!this.store.adapters?.feedback
4651
4674
  };
4652
- this.composer.setAttachmentAdapter(this._store.adapters?.attachments);
4653
4675
  if (oldStore) {
4654
4676
  if (oldStore.convertMessage !== store.convertMessage) {
4655
4677
  this._converter = new ThreadMessageConverter();
@@ -4693,18 +4715,9 @@ var ExternalStoreThreadRuntimeCore = class {
4693
4715
  this.repository.resetHead(
4694
4716
  this.assistantOptimisticId ?? messages2.at(-1)?.id ?? null
4695
4717
  );
4696
- this.messages = this.repository.getMessages();
4718
+ this._messages = this.repository.getMessages();
4697
4719
  this.notifySubscribers();
4698
4720
  }
4699
- getModelConfig() {
4700
- return this.configProvider.getModelConfig();
4701
- }
4702
- notifySubscribers() {
4703
- for (const callback of this._subscriptions) callback();
4704
- }
4705
- getBranches(messageId) {
4706
- return this.repository.getBranches(messageId);
4707
- }
4708
4721
  switchToBranch(branchId) {
4709
4722
  if (!this._store.setMessages)
4710
4723
  throw new Error("Runtime does not support switching branches.");
@@ -4753,60 +4766,11 @@ var ExternalStoreThreadRuntimeCore = class {
4753
4766
  throw new Error("Runtime does not support tool results.");
4754
4767
  this._store.onAddToolResult(options);
4755
4768
  }
4756
- // TODO speech runtime?
4757
- _stopSpeaking;
4758
- speech = null;
4759
- speak(messageId) {
4760
- let adapter = this.store.adapters?.speech;
4761
- if (!adapter && this.store.onSpeak) {
4762
- adapter = { speak: this.store.onSpeak };
4763
- }
4764
- if (!adapter) throw new Error("Speech adapter not configured");
4765
- const { message } = this.repository.getMessage(messageId);
4766
- this._stopSpeaking?.();
4767
- const utterance = adapter.speak(message);
4768
- const unsub = utterance.subscribe(() => {
4769
- if (utterance.status.type === "ended") {
4770
- this._stopSpeaking = void 0;
4771
- this.speech = null;
4772
- } else {
4773
- this.speech = { messageId, status: utterance.status };
4774
- }
4775
- this.notifySubscribers();
4776
- });
4777
- this.speech = { messageId, status: utterance.status };
4778
- this._stopSpeaking = () => {
4779
- utterance.cancel();
4780
- unsub();
4781
- this.speech = null;
4782
- this._stopSpeaking = void 0;
4783
- };
4784
- }
4785
- stopSpeaking() {
4786
- if (!this._stopSpeaking) throw new Error("No message is being spoken");
4787
- this._stopSpeaking();
4788
- }
4789
- submitFeedback({ messageId, type }) {
4790
- const adapter = this._store.adapters?.feedback;
4791
- if (!adapter) throw new Error("Feedback adapter not configured");
4792
- const { message } = this.repository.getMessage(messageId);
4793
- adapter.submit({ message, type });
4794
- }
4795
- subscribe(callback) {
4796
- this._subscriptions.add(callback);
4797
- return () => this._subscriptions.delete(callback);
4798
- }
4799
4769
  updateMessages = (messages2) => {
4800
4770
  this._store.setMessages?.(
4801
4771
  messages2.flatMap(getExternalStoreMessage).filter((m) => m != null)
4802
4772
  );
4803
4773
  };
4804
- import(repository) {
4805
- this.repository.import(repository);
4806
- }
4807
- export() {
4808
- return this.repository.export();
4809
- }
4810
4774
  };
4811
4775
 
4812
4776
  // src/runtimes/external-store/ExternalStoreRuntimeCore.tsx
@@ -4861,7 +4825,7 @@ var useExternalStoreRuntime = (store) => {
4861
4825
  runtime.thread.store = store;
4862
4826
  });
4863
4827
  return useMemo12(
4864
- () => new AssistantRuntimeImpl(runtime, ThreadRuntimeImpl),
4828
+ () => AssistantRuntimeImpl.create(runtime, ThreadRuntimeImpl),
4865
4829
  [runtime]
4866
4830
  );
4867
4831
  };
@@ -5281,8 +5245,8 @@ var useAllowCopy = (ensureCapability = false) => {
5281
5245
  };
5282
5246
  var useAllowSpeak = (ensureCapability = false) => {
5283
5247
  const { assistantMessage: { allowSpeak = true } = {} } = useThreadConfig();
5284
- const speakSupported = useThread((t) => t.capabilities.speak);
5285
- return allowSpeak && (!ensureCapability || speakSupported);
5248
+ const speechSupported = useThread((t) => t.capabilities.speech);
5249
+ return allowSpeak && (!ensureCapability || speechSupported);
5286
5250
  };
5287
5251
  var useAllowReload = (ensureCapability = false) => {
5288
5252
  const { assistantMessage: { allowReload = true } = {} } = useThreadConfig();
@@ -5631,12 +5595,30 @@ import { forwardRef as forwardRef27 } from "react";
5631
5595
  import { CircleXIcon } from "lucide-react";
5632
5596
  import { jsx as jsx45, jsxs as jsxs8 } from "react/jsx-runtime";
5633
5597
  var ComposerAttachmentRoot = withDefaults(attachment_exports.Root, {
5634
- className: "aui-composer-attachment-root"
5598
+ className: "aui-attachment-root"
5635
5599
  });
5636
5600
  ComposerAttachmentRoot.displayName = "ComposerAttachmentRoot";
5637
5601
  var ComposerAttachment2 = () => {
5602
+ const typeLabel = useAttachment((a) => {
5603
+ const type = a.type;
5604
+ switch (type) {
5605
+ case "image":
5606
+ return "Image";
5607
+ case "document":
5608
+ return "Document";
5609
+ case "file":
5610
+ return "File";
5611
+ default:
5612
+ const _exhaustiveCheck = type;
5613
+ throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
5614
+ }
5615
+ });
5638
5616
  return /* @__PURE__ */ jsxs8(ComposerAttachmentRoot, { children: [
5639
- /* @__PURE__ */ jsx45(attachment_exports.unstable_Thumb, {}),
5617
+ /* @__PURE__ */ jsx45(attachment_exports.unstable_Thumb, { className: "aui-attachment-thumb" }),
5618
+ /* @__PURE__ */ jsxs8("div", { className: "aui-attachment-text", children: [
5619
+ /* @__PURE__ */ jsx45("p", { className: "aui-attachment-name", children: /* @__PURE__ */ jsx45(attachment_exports.Name, {}) }),
5620
+ /* @__PURE__ */ jsx45("p", { className: "aui-attachment-type", children: typeLabel })
5621
+ ] }),
5640
5622
  /* @__PURE__ */ jsx45(ComposerAttachmentRemove, {})
5641
5623
  ] });
5642
5624
  };
@@ -5896,13 +5878,33 @@ var exports8 = {
5896
5878
  var user_action_bar_default = Object.assign(UserActionBar, exports8);
5897
5879
 
5898
5880
  // src/ui/user-message-attachment.tsx
5899
- import { jsx as jsx49 } from "react/jsx-runtime";
5881
+ import { jsx as jsx49, jsxs as jsxs11 } from "react/jsx-runtime";
5900
5882
  var UserMessageAttachmentRoot = withDefaults(attachment_exports.Root, {
5901
- className: "aui-user-message-attachment-root"
5883
+ className: "aui-attachment-root"
5902
5884
  });
5903
5885
  UserMessageAttachmentRoot.displayName = "UserMessageAttachmentRoot";
5904
5886
  var UserMessageAttachment = () => {
5905
- return /* @__PURE__ */ jsx49(UserMessageAttachmentRoot, { children: /* @__PURE__ */ jsx49(attachment_exports.unstable_Thumb, {}) });
5887
+ const typeLabel = useAttachment((a) => {
5888
+ const type = a.type;
5889
+ switch (type) {
5890
+ case "image":
5891
+ return "Image";
5892
+ case "document":
5893
+ return "Document";
5894
+ case "file":
5895
+ return "File";
5896
+ default:
5897
+ const _exhaustiveCheck = type;
5898
+ throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
5899
+ }
5900
+ });
5901
+ return /* @__PURE__ */ jsxs11(UserMessageAttachmentRoot, { children: [
5902
+ /* @__PURE__ */ jsx49(attachment_exports.unstable_Thumb, { className: "aui-attachment-thumb" }),
5903
+ /* @__PURE__ */ jsxs11("div", { className: "aui-attachment-text", children: [
5904
+ /* @__PURE__ */ jsx49("p", { className: "aui-attachment-name", children: /* @__PURE__ */ jsx49(attachment_exports.Name, {}) }),
5905
+ /* @__PURE__ */ jsx49("p", { className: "aui-attachment-type", children: typeLabel })
5906
+ ] })
5907
+ ] });
5906
5908
  };
5907
5909
  UserMessageAttachment.displayName = "UserMessageAttachment";
5908
5910
  var exports9 = {
@@ -5914,12 +5916,14 @@ var user_message_attachment_default = Object.assign(
5914
5916
  );
5915
5917
 
5916
5918
  // src/ui/user-message.tsx
5917
- import { jsx as jsx50, jsxs as jsxs11 } from "react/jsx-runtime";
5919
+ import { jsx as jsx50, jsxs as jsxs12 } from "react/jsx-runtime";
5918
5920
  var UserMessage = () => {
5919
- return /* @__PURE__ */ jsxs11(UserMessageRoot, { children: [
5921
+ return /* @__PURE__ */ jsxs12(UserMessageRoot, { children: [
5920
5922
  /* @__PURE__ */ jsx50(UserMessageAttachments, {}),
5921
- /* @__PURE__ */ jsx50(user_action_bar_default, {}),
5922
- /* @__PURE__ */ jsx50(UserMessageContent, {}),
5923
+ /* @__PURE__ */ jsxs12(message_exports.If, { hasContent: true, children: [
5924
+ /* @__PURE__ */ jsx50(user_action_bar_default, {}),
5925
+ /* @__PURE__ */ jsx50(UserMessageContent, {})
5926
+ ] }),
5923
5927
  /* @__PURE__ */ jsx50(branch_picker_default, {})
5924
5928
  ] });
5925
5929
  };
@@ -5968,11 +5972,11 @@ var user_message_default = Object.assign(UserMessage, exports10);
5968
5972
 
5969
5973
  // src/ui/edit-composer.tsx
5970
5974
  import { forwardRef as forwardRef32 } from "react";
5971
- import { jsx as jsx51, jsxs as jsxs12 } from "react/jsx-runtime";
5975
+ import { jsx as jsx51, jsxs as jsxs13 } from "react/jsx-runtime";
5972
5976
  var EditComposer = () => {
5973
- return /* @__PURE__ */ jsxs12(EditComposerRoot, { children: [
5977
+ return /* @__PURE__ */ jsxs13(EditComposerRoot, { children: [
5974
5978
  /* @__PURE__ */ jsx51(EditComposerInput, {}),
5975
- /* @__PURE__ */ jsxs12(EditComposerFooter, { children: [
5979
+ /* @__PURE__ */ jsxs13(EditComposerFooter, { children: [
5976
5980
  /* @__PURE__ */ jsx51(EditComposerCancel, {}),
5977
5981
  /* @__PURE__ */ jsx51(EditComposerSend, {})
5978
5982
  ] })
@@ -6015,7 +6019,7 @@ var exports11 = {
6015
6019
  var edit_composer_default = Object.assign(EditComposer, exports11);
6016
6020
 
6017
6021
  // src/ui/thread.tsx
6018
- import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs13 } from "react/jsx-runtime";
6022
+ import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs14 } from "react/jsx-runtime";
6019
6023
  var Thread = (config) => {
6020
6024
  const {
6021
6025
  components: {
@@ -6023,11 +6027,11 @@ var Thread = (config) => {
6023
6027
  ThreadWelcome: ThreadWelcomeComponent = thread_welcome_default
6024
6028
  } = {}
6025
6029
  } = config;
6026
- return /* @__PURE__ */ jsx52(ThreadRoot, { config, children: /* @__PURE__ */ jsxs13(ThreadViewport, { children: [
6030
+ return /* @__PURE__ */ jsx52(ThreadRoot, { config, children: /* @__PURE__ */ jsxs14(ThreadViewport, { children: [
6027
6031
  /* @__PURE__ */ jsx52(ThreadWelcomeComponent, {}),
6028
6032
  /* @__PURE__ */ jsx52(ThreadMessages, {}),
6029
6033
  /* @__PURE__ */ jsx52(ThreadFollowupSuggestions, {}),
6030
- /* @__PURE__ */ jsxs13(ThreadViewportFooter, { children: [
6034
+ /* @__PURE__ */ jsxs14(ThreadViewportFooter, { children: [
6031
6035
  /* @__PURE__ */ jsx52(ThreadScrollToBottom, {}),
6032
6036
  /* @__PURE__ */ jsx52(ComposerComponent, {})
6033
6037
  ] })
@@ -6052,7 +6056,7 @@ var ThreadViewportFooter = withDefaults("div", {
6052
6056
  ThreadViewportFooter.displayName = "ThreadViewportFooter";
6053
6057
  var SystemMessage = () => null;
6054
6058
  var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ...rest }) => {
6055
- return /* @__PURE__ */ jsxs13(Fragment7, { children: [
6059
+ return /* @__PURE__ */ jsxs14(Fragment7, { children: [
6056
6060
  /* @__PURE__ */ jsx52(
6057
6061
  thread_exports.Messages,
6058
6062
  {
@@ -6107,9 +6111,9 @@ var exports12 = {
6107
6111
  var thread_default = Object.assign(Thread, exports12);
6108
6112
 
6109
6113
  // src/ui/assistant-modal.tsx
6110
- import { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs14 } from "react/jsx-runtime";
6114
+ import { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs15 } from "react/jsx-runtime";
6111
6115
  var AssistantModal = (config) => {
6112
- return /* @__PURE__ */ jsxs14(AssistantModalRoot, { config, children: [
6116
+ return /* @__PURE__ */ jsxs15(AssistantModalRoot, { config, children: [
6113
6117
  /* @__PURE__ */ jsx53(AssistantModalTrigger, {}),
6114
6118
  /* @__PURE__ */ jsx53(AssistantModalContent, { children: /* @__PURE__ */ jsx53(thread_default, {}) })
6115
6119
  ] });
@@ -6156,7 +6160,7 @@ var AssistantModalButton = forwardRef34(({ "data-state": state, ...rest }, ref)
6156
6160
  "data-state": state,
6157
6161
  ...rest,
6158
6162
  ref,
6159
- children: rest.children ?? /* @__PURE__ */ jsxs14(Fragment8, { children: [
6163
+ children: rest.children ?? /* @__PURE__ */ jsxs15(Fragment8, { children: [
6160
6164
  /* @__PURE__ */ jsx53(
6161
6165
  BotIcon,
6162
6166
  {