@superinterface/react 2.17.4 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -433,6 +433,9 @@ __export(src_exports, {
433
433
  UserAvatarContext: function() {
434
434
  return UserAvatarContext;
435
435
  },
436
+ useAssistant: function() {
437
+ return useAssistant;
438
+ },
436
439
  useComponents: function() {
437
440
  return useComponents;
438
441
  },
@@ -1506,12 +1509,13 @@ var remarkAnnotation = function(param) {
1506
1509
  return function() {
1507
1510
  return function(tree) {
1508
1511
  (0, import_unist_util_flatmap.default)(tree, function(node) {
1512
+ var _content_text_annotations, _content_text;
1509
1513
  if (node.type !== "text") {
1510
1514
  return [
1511
1515
  node
1512
1516
  ];
1513
1517
  }
1514
- if (!content.text.annotations.length) {
1518
+ if (!((_content_text = content.text) === null || _content_text === void 0 ? void 0 : (_content_text_annotations = _content_text.annotations) === null || _content_text_annotations === void 0 ? void 0 : _content_text_annotations.length)) {
1515
1519
  return [
1516
1520
  node
1517
1521
  ];
@@ -3393,25 +3397,123 @@ var import_react39 = require("react");
3393
3397
  var useMessageContext = function() {
3394
3398
  return (0, import_react39.useContext)(MessageContext);
3395
3399
  };
3400
+ // src/hooks/assistants/useAssistant/index.ts
3401
+ var import_react40 = require("react");
3402
+ var import_react_query8 = require("@tanstack/react-query");
3403
+ // src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
3404
+ var import_react_query7 = require("@tanstack/react-query");
3405
+ // src/hooks/assistants/useAssistant/lib/queryOptions/queryFn.ts
3406
+ var queryFn = function(param) {
3407
+ var superinterfaceContext = param.superinterfaceContext;
3408
+ return function() {
3409
+ var _ref = _async_to_generator(function(param) {
3410
+ var queryKey, _queryKey, _key, assistantId, params;
3411
+ return _ts_generator(this, function(_state) {
3412
+ queryKey = param.queryKey;
3413
+ _queryKey = _sliced_to_array(queryKey, 2), _key = _queryKey[0], assistantId = _queryKey[1].assistantId;
3414
+ params = new URLSearchParams({
3415
+ publicApiKey: superinterfaceContext.variables.publicApiKey
3416
+ });
3417
+ return [
3418
+ 2,
3419
+ fetch("".concat(superinterfaceContext.baseUrl, "/assistants/").concat(assistantId, "?").concat(params)).then(function() {
3420
+ var _ref = _async_to_generator(function(response) {
3421
+ var errorResponse, error;
3422
+ return _ts_generator(this, function(_state) {
3423
+ switch(_state.label){
3424
+ case 0:
3425
+ if (!(response.status !== 200)) return [
3426
+ 3,
3427
+ 4
3428
+ ];
3429
+ _state.label = 1;
3430
+ case 1:
3431
+ _state.trys.push([
3432
+ 1,
3433
+ 3,
3434
+ ,
3435
+ 4
3436
+ ]);
3437
+ return [
3438
+ 4,
3439
+ response.json()
3440
+ ];
3441
+ case 2:
3442
+ errorResponse = _state.sent();
3443
+ throw new Error(errorResponse.error);
3444
+ case 3:
3445
+ error = _state.sent();
3446
+ throw new Error("Failed to fetch");
3447
+ case 4:
3448
+ return [
3449
+ 2,
3450
+ response.json()
3451
+ ];
3452
+ }
3453
+ });
3454
+ });
3455
+ return function(response) {
3456
+ return _ref.apply(this, arguments);
3457
+ };
3458
+ }())
3459
+ ];
3460
+ });
3461
+ });
3462
+ return function(_) {
3463
+ return _ref.apply(this, arguments);
3464
+ };
3465
+ }();
3466
+ };
3467
+ // src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
3468
+ var queryOptions2 = function(param) {
3469
+ var assistantId = param.assistantId, superinterfaceContext = param.superinterfaceContext;
3470
+ return (0, import_react_query7.queryOptions)({
3471
+ queryKey: [
3472
+ "assistants",
3473
+ {
3474
+ assistantId: assistantId
3475
+ }
3476
+ ],
3477
+ queryFn: queryFn({
3478
+ superinterfaceContext: superinterfaceContext
3479
+ })
3480
+ });
3481
+ };
3482
+ // src/hooks/assistants/useAssistant/index.ts
3483
+ var useAssistant = function(param) {
3484
+ var assistantId = param.assistantId;
3485
+ var superinterfaceContext = useSuperinterfaceContext();
3486
+ var props = (0, import_react_query8.useQuery)(queryOptions2({
3487
+ assistantId: assistantId,
3488
+ superinterfaceContext: superinterfaceContext
3489
+ }));
3490
+ return (0, import_react40.useMemo)(function() {
3491
+ return _object_spread_props(_object_spread({}, props), {
3492
+ assistant: props.data ? props.data.assistant : null
3493
+ });
3494
+ }, [
3495
+ props
3496
+ ]);
3497
+ };
3396
3498
  // src/components/threads/ThreadDialog/Provider/index.tsx
3397
- var import_react42 = require("react");
3499
+ var import_react43 = require("react");
3398
3500
  // src/contexts/threads/ThreadDialogContext/index.ts
3399
- var import_react40 = require("react");
3400
- var ThreadDialogContext = (0, import_react40.createContext)({
3501
+ var import_react41 = require("react");
3502
+ var ThreadDialogContext = (0, import_react41.createContext)({
3401
3503
  isOpen: false,
3402
3504
  setIsOpen: function() {}
3403
3505
  });
3404
3506
  // src/hooks/threads/useThreadDialogContext/index.ts
3405
- var import_react41 = require("react");
3507
+ var import_react42 = require("react");
3406
3508
  var useThreadDialogContext = function() {
3407
- return (0, import_react41.useContext)(ThreadDialogContext);
3509
+ return (0, import_react42.useContext)(ThreadDialogContext);
3408
3510
  };
3409
3511
  // src/components/threads/ThreadDialog/Provider/index.tsx
3410
3512
  var import_jsx_runtime57 = require("react/jsx-runtime");
3411
3513
  var Provider3 = function(param) {
3412
3514
  var children = param.children;
3413
3515
  var threadDialogContext = useThreadDialogContext();
3414
- var _ref = _sliced_to_array((0, import_react42.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
3516
+ var _ref = _sliced_to_array((0, import_react43.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
3415
3517
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThreadDialogContext.Provider, {
3416
3518
  value: {
3417
3519
  isOpen: isOpen,
@@ -3421,7 +3523,7 @@ var Provider3 = function(param) {
3421
3523
  });
3422
3524
  };
3423
3525
  // src/components/toasts/ToastsProvider/index.tsx
3424
- var import_react43 = require("react");
3526
+ var import_react44 = require("react");
3425
3527
  var Toast2 = __toESM(require("@radix-ui/react-toast"), 1);
3426
3528
  // src/components/toasts/ToastsProvider/CustomToast.tsx
3427
3529
  var Toast = __toESM(require("@radix-ui/react-toast"), 1);
@@ -3460,8 +3562,8 @@ var CustomToast = function(param) {
3460
3562
  var import_jsx_runtime59 = require("react/jsx-runtime");
3461
3563
  var ToastsProvider = function(param) {
3462
3564
  var children = param.children;
3463
- var _ref = _sliced_to_array((0, import_react43.useState)([]), 2), toasts = _ref[0], setToasts = _ref[1];
3464
- var addToast = (0, import_react43.useCallback)(function(toast) {
3565
+ var _ref = _sliced_to_array((0, import_react44.useState)([]), 2), toasts = _ref[0], setToasts = _ref[1];
3566
+ var addToast = (0, import_react44.useCallback)(function(toast) {
3465
3567
  return setToasts(function(prevToasts) {
3466
3568
  return _to_consumable_array(prevToasts).concat([
3467
3569
  toast
@@ -3708,8 +3810,8 @@ ThreadDialog.Content = Content4;
3708
3810
  // src/components/threads/AudioThread/Root/index.tsx
3709
3811
  var import_themes45 = require("@radix-ui/themes");
3710
3812
  // src/contexts/threads/AudioThreadContext/index.ts
3711
- var import_react44 = require("react");
3712
- var AudioThreadContext = (0, import_react44.createContext)({
3813
+ var import_react45 = require("react");
3814
+ var AudioThreadContext = (0, import_react45.createContext)({
3713
3815
  status: "idle",
3714
3816
  recorderProps: {
3715
3817
  status: "idle",
@@ -3765,7 +3867,7 @@ var AudioThreadContext = (0, import_react44.createContext)({
3765
3867
  }
3766
3868
  });
3767
3869
  // src/hooks/misc/usePermission/index.ts
3768
- var import_react45 = require("react");
3870
+ var import_react46 = require("react");
3769
3871
  // src/hooks/misc/usePermission/util.ts
3770
3872
  var noop = function() {};
3771
3873
  function on(obj) {
@@ -3788,8 +3890,8 @@ function off(obj) {
3788
3890
  }
3789
3891
  // src/hooks/misc/usePermission/index.ts
3790
3892
  var usePermission = function(permissionDesc) {
3791
- var _ref = _sliced_to_array((0, import_react45.useState)(""), 2), state = _ref[0], setState = _ref[1];
3792
- (0, import_react45.useEffect)(function() {
3893
+ var _ref = _sliced_to_array((0, import_react46.useState)(""), 2), state = _ref[0], setState = _ref[1];
3894
+ (0, import_react46.useEffect)(function() {
3793
3895
  var mounted = true;
3794
3896
  var permissionStatus = null;
3795
3897
  var onChange = function() {
@@ -3827,11 +3929,11 @@ var blobToData = function(blob) {
3827
3929
  });
3828
3930
  };
3829
3931
  // src/hooks/audioThreads/useStatus/index.ts
3830
- var import_react46 = require("react");
3932
+ var import_react47 = require("react");
3831
3933
  var useStatus = function(param) {
3832
3934
  var messageAudioProps = param.messageAudioProps, recorderProps = param.recorderProps, createMessageProps = param.createMessageProps;
3833
3935
  var latestMessageProps = useLatestMessage();
3834
- var status = (0, import_react46.useMemo)(function() {
3936
+ var status = (0, import_react47.useMemo)(function() {
3835
3937
  var _latestMessageProps_latestMessage;
3836
3938
  if (recorderProps.status === "recording") return "recording";
3837
3939
  if (createMessageProps.isPending) return "creatingMessage";
@@ -3855,16 +3957,16 @@ var useStatus = function(param) {
3855
3957
  // src/hooks/audioThreads/useRecorder/index.ts
3856
3958
  var import_dayjs3 = __toESM(require("dayjs"), 1);
3857
3959
  var import_use_audio_capture = require("use-audio-capture");
3858
- var import_react48 = require("react");
3960
+ var import_react49 = require("react");
3859
3961
  var import_react_use_audio_player = require("react-use-audio-player");
3860
3962
  // src/hooks/misc/useInterval.ts
3861
- var import_react47 = require("react");
3963
+ var import_react48 = require("react");
3862
3964
  var useInterval = function(callback, delay) {
3863
- var savedCallback = (0, import_react47.useRef)(function() {});
3864
- (0, import_react47.useEffect)(function() {
3965
+ var savedCallback = (0, import_react48.useRef)(function() {});
3966
+ (0, import_react48.useEffect)(function() {
3865
3967
  savedCallback.current = callback;
3866
3968
  });
3867
- (0, import_react47.useEffect)(function() {
3969
+ (0, import_react48.useEffect)(function() {
3868
3970
  if (delay !== null) {
3869
3971
  var interval = setInterval(function() {
3870
3972
  return savedCallback.current();
@@ -3881,14 +3983,14 @@ var useInterval = function(callback, delay) {
3881
3983
  // src/hooks/audioThreads/useRecorder/index.ts
3882
3984
  var useRecorder = function(param) {
3883
3985
  var isStopOnSilence = param.isStopOnSilence, onStart = param.onStart, onStop = param.onStop;
3884
- var _ref = _sliced_to_array((0, import_react48.useState)(null), 2), silenceStart = _ref[0], setSilenceStart = _ref[1];
3885
- var _ref1 = _sliced_to_array((0, import_react48.useState)(null), 2), noiseStart = _ref1[0], setNoiseStart = _ref1[1];
3886
- var _ref2 = _sliced_to_array((0, import_react48.useState)(null), 2), mediaStream = _ref2[0], setMediaStream = _ref2[1];
3887
- var _ref3 = _sliced_to_array((0, import_react48.useState)("idle"), 2), status = _ref3[0], setStatus = _ref3[1];
3986
+ var _ref = _sliced_to_array((0, import_react49.useState)(null), 2), silenceStart = _ref[0], setSilenceStart = _ref[1];
3987
+ var _ref1 = _sliced_to_array((0, import_react49.useState)(null), 2), noiseStart = _ref1[0], setNoiseStart = _ref1[1];
3988
+ var _ref2 = _sliced_to_array((0, import_react49.useState)(null), 2), mediaStream = _ref2[0], setMediaStream = _ref2[1];
3989
+ var _ref3 = _sliced_to_array((0, import_react49.useState)("idle"), 2), status = _ref3[0], setStatus = _ref3[1];
3888
3990
  var startAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
3889
3991
  var endAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
3890
- var _ref4 = _sliced_to_array((0, import_react48.useState)(false), 2), isLoaded = _ref4[0], setIsLoaded = _ref4[1];
3891
- (0, import_react48.useEffect)(function() {
3992
+ var _ref4 = _sliced_to_array((0, import_react49.useState)(false), 2), isLoaded = _ref4[0], setIsLoaded = _ref4[1];
3993
+ (0, import_react49.useEffect)(function() {
3892
3994
  if (isLoaded) return;
3893
3995
  setIsLoaded(true);
3894
3996
  }, [
@@ -3946,9 +4048,9 @@ var useRecorder = function(param) {
3946
4048
  setNoiseStart(null);
3947
4049
  }
3948
4050
  });
3949
- var _ref5 = _sliced_to_array((0, import_react48.useState)(null), 2), audioEngine = _ref5[0], setAudioEngine = _ref5[1];
3950
- var isInited = (0, import_react48.useRef)(false);
3951
- (0, import_react48.useEffect)(function() {
4051
+ var _ref5 = _sliced_to_array((0, import_react49.useState)(null), 2), audioEngine = _ref5[0], setAudioEngine = _ref5[1];
4052
+ var isInited = (0, import_react49.useRef)(false);
4053
+ (0, import_react49.useEffect)(function() {
3952
4054
  if (!mediaStream) return;
3953
4055
  if (isInited.current) return;
3954
4056
  isInited.current = true;
@@ -3961,7 +4063,7 @@ var useRecorder = function(param) {
3961
4063
  isInited,
3962
4064
  mediaStream
3963
4065
  ]);
3964
- var visualizationAnalyser = (0, import_react48.useMemo)(function() {
4066
+ var visualizationAnalyser = (0, import_react49.useMemo)(function() {
3965
4067
  if (!audioEngine) return null;
3966
4068
  var result = audioEngine.audioContext.createAnalyser();
3967
4069
  audioEngine.source.connect(result);
@@ -3969,7 +4071,7 @@ var useRecorder = function(param) {
3969
4071
  }, [
3970
4072
  audioEngine
3971
4073
  ]);
3972
- var silenceAnalyser = (0, import_react48.useMemo)(function() {
4074
+ var silenceAnalyser = (0, import_react49.useMemo)(function() {
3973
4075
  if (!audioEngine) return null;
3974
4076
  var result = audioEngine.audioContext.createAnalyser();
3975
4077
  result.minDecibels = -60;
@@ -3978,7 +4080,7 @@ var useRecorder = function(param) {
3978
4080
  }, [
3979
4081
  audioEngine
3980
4082
  ]);
3981
- var handleSilence = (0, import_react48.useCallback)(function() {
4083
+ var handleSilence = (0, import_react49.useCallback)(function() {
3982
4084
  if (!silenceAnalyser) return;
3983
4085
  var frequencyData = new Uint8Array(silenceAnalyser.frequencyBinCount);
3984
4086
  silenceAnalyser.getByteFrequencyData(frequencyData);
@@ -4001,7 +4103,7 @@ var useRecorder = function(param) {
4001
4103
  setNoiseStart,
4002
4104
  setSilenceStart
4003
4105
  ]);
4004
- (0, import_react48.useEffect)(function() {
4106
+ (0, import_react49.useEffect)(function() {
4005
4107
  if (!isStopOnSilence) return;
4006
4108
  requestAnimationFrame(function() {
4007
4109
  return handleSilence();
@@ -4024,7 +4126,7 @@ var useRecorder = function(param) {
4024
4126
  });
4025
4127
  };
4026
4128
  // src/hooks/audioThreads/useMessageAudio/index.ts
4027
- var import_react49 = require("react");
4129
+ var import_react50 = require("react");
4028
4130
  var import_compromise = __toESM(require("compromise"), 1);
4029
4131
  var import_howler = require("howler");
4030
4132
  var import_react_use_audio_player2 = require("react-use-audio-player");
@@ -4062,15 +4164,15 @@ var getMessageSentences = function(param) {
4062
4164
  };
4063
4165
  var useMessageAudio = function(param) {
4064
4166
  var onEnd = param.onEnd;
4065
- var _ref = _sliced_to_array((0, import_react49.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
4066
- var _ref1 = _sliced_to_array((0, import_react49.useState)([]), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
4067
- var _ref2 = _sliced_to_array((0, import_react49.useState)([]), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
4167
+ var _ref = _sliced_to_array((0, import_react50.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
4168
+ var _ref1 = _sliced_to_array((0, import_react50.useState)([]), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
4169
+ var _ref2 = _sliced_to_array((0, import_react50.useState)([]), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
4068
4170
  var audioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
4069
4171
  var nextAudioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
4070
4172
  var superinterfaceContext = useSuperinterfaceContext();
4071
- var _ref3 = _sliced_to_array((0, import_react49.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
4173
+ var _ref3 = _sliced_to_array((0, import_react50.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
4072
4174
  var latestMessageProps = useLatestMessage();
4073
- var unplayedMessageSentences = (0, import_react49.useMemo)(function() {
4175
+ var unplayedMessageSentences = (0, import_react50.useMemo)(function() {
4074
4176
  if (!latestMessageProps.latestMessage) return [];
4075
4177
  if (latestMessageProps.latestMessage.role !== "assistant") return [];
4076
4178
  if (stoppedMessageIds.includes(latestMessageProps.latestMessage.id)) return [];
@@ -4091,7 +4193,7 @@ var useMessageAudio = function(param) {
4091
4193
  latestMessageProps,
4092
4194
  playedMessageSentences
4093
4195
  ]);
4094
- (0, import_react49.useEffect)(function() {
4196
+ (0, import_react50.useEffect)(function() {
4095
4197
  if (isPlaying) return;
4096
4198
  if (audioPlayer.playing) return;
4097
4199
  if (!latestMessageProps.latestMessage) return;
@@ -4159,7 +4261,7 @@ var useMessageAudio = function(param) {
4159
4261
  playedMessageSentences,
4160
4262
  onEnd
4161
4263
  ]);
4162
- (0, import_react49.useEffect)(function() {
4264
+ (0, import_react50.useEffect)(function() {
4163
4265
  if (isHtmlAudioSupported) {
4164
4266
  var _import_howler_Howler__howls___sounds_, _import_howler_Howler__howls_, _import_howler_Howler;
4165
4267
  if (!((_import_howler_Howler = import_howler.Howler) === null || _import_howler_Howler === void 0 ? void 0 : (_import_howler_Howler__howls_ = _import_howler_Howler._howls[0]) === null || _import_howler_Howler__howls_ === void 0 ? void 0 : (_import_howler_Howler__howls___sounds_ = _import_howler_Howler__howls_._sounds[0]) === null || _import_howler_Howler__howls___sounds_ === void 0 ? void 0 : _import_howler_Howler__howls___sounds_._node)) return;
@@ -4168,9 +4270,9 @@ var useMessageAudio = function(param) {
4168
4270
  }, [
4169
4271
  audioPlayer
4170
4272
  ]);
4171
- var _ref4 = _sliced_to_array((0, import_react49.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
4172
- var isAudioEngineInited = (0, import_react49.useRef)(false);
4173
- (0, import_react49.useEffect)(function() {
4273
+ var _ref4 = _sliced_to_array((0, import_react50.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
4274
+ var isAudioEngineInited = (0, import_react50.useRef)(false);
4275
+ (0, import_react50.useEffect)(function() {
4174
4276
  if (!audioPlayer.playing) return;
4175
4277
  if (isAudioEngineInited.current) return;
4176
4278
  isAudioEngineInited.current = true;
@@ -4191,7 +4293,7 @@ var useMessageAudio = function(param) {
4191
4293
  audioPlayer,
4192
4294
  isAudioEngineInited
4193
4295
  ]);
4194
- var visualizationAnalyser = (0, import_react49.useMemo)(function() {
4296
+ var visualizationAnalyser = (0, import_react50.useMemo)(function() {
4195
4297
  if (!audioEngine) return null;
4196
4298
  var result = audioEngine.audioContext.createAnalyser();
4197
4299
  audioEngine.source.connect(audioEngine.audioContext.destination);
@@ -4200,7 +4302,7 @@ var useMessageAudio = function(param) {
4200
4302
  }, [
4201
4303
  audioEngine
4202
4304
  ]);
4203
- var isPending = (0, import_react49.useMemo)(function() {
4305
+ var isPending = (0, import_react50.useMemo)(function() {
4204
4306
  return isPlaying || unplayedMessageSentences.length > 0;
4205
4307
  }, [
4206
4308
  isPlaying,
@@ -4287,25 +4389,25 @@ var Root12 = function(param) {
4287
4389
  });
4288
4390
  };
4289
4391
  // src/components/threads/AudioThread/Visualization/index.tsx
4290
- var import_react52 = require("react");
4392
+ var import_react53 = require("react");
4291
4393
  var import_lodash9 = __toESM(require("lodash"), 1);
4292
4394
  var import_themes47 = require("@radix-ui/themes");
4293
4395
  // src/hooks/threads/useAudioThreadContext/index.ts
4294
- var import_react50 = require("react");
4396
+ var import_react51 = require("react");
4295
4397
  var useAudioThreadContext = function() {
4296
- return (0, import_react50.useContext)(AudioThreadContext);
4398
+ return (0, import_react51.useContext)(AudioThreadContext);
4297
4399
  };
4298
4400
  // src/components/threads/AudioThread/BarsVisualizer/index.tsx
4299
4401
  var import_lodash8 = __toESM(require("lodash"), 1);
4300
4402
  var import_themes46 = require("@radix-ui/themes");
4301
- var import_react51 = require("react");
4403
+ var import_react52 = require("react");
4302
4404
  var import_radash16 = require("radash");
4303
4405
  var import_jsx_runtime67 = require("react/jsx-runtime");
4304
4406
  var barCount = 4;
4305
4407
  var BarsVisualizer = function(param) {
4306
4408
  var visualizationAnalyser = param.visualizationAnalyser, backgroundColor = param.backgroundColor, height = param.height, barWidth = param.barWidth;
4307
- var _ref = _sliced_to_array((0, import_react51.useState)([]), 2), barHeights = _ref[0], setBarHeights = _ref[1];
4308
- var draw = (0, import_react51.useCallback)(function(param) {
4409
+ var _ref = _sliced_to_array((0, import_react52.useState)([]), 2), barHeights = _ref[0], setBarHeights = _ref[1];
4410
+ var draw = (0, import_react52.useCallback)(function(param) {
4309
4411
  var visualizationAnalyser2 = param.visualizationAnalyser;
4310
4412
  if (!visualizationAnalyser2) {
4311
4413
  setBarHeights(Array(barCount).fill(0));
@@ -4323,7 +4425,7 @@ var BarsVisualizer = function(param) {
4323
4425
  });
4324
4426
  });
4325
4427
  }, []);
4326
- (0, import_react51.useEffect)(function() {
4428
+ (0, import_react52.useEffect)(function() {
4327
4429
  draw({
4328
4430
  visualizationAnalyser: visualizationAnalyser
4329
4431
  });
@@ -4363,9 +4465,9 @@ var BarsVisualizer = function(param) {
4363
4465
  var import_jsx_runtime68 = require("react/jsx-runtime");
4364
4466
  var Visualization = function() {
4365
4467
  var audioThreadContext = useAudioThreadContext();
4366
- var assistantNameContext = (0, import_react52.useContext)(AssistantNameContext);
4367
- var _ref = _sliced_to_array((0, import_react52.useState)(0), 2), scale = _ref[0], setScale = _ref[1];
4368
- var draw = (0, import_react52.useCallback)(function(param) {
4468
+ var assistantNameContext = (0, import_react53.useContext)(AssistantNameContext);
4469
+ var _ref = _sliced_to_array((0, import_react53.useState)(0), 2), scale = _ref[0], setScale = _ref[1];
4470
+ var draw = (0, import_react53.useCallback)(function(param) {
4369
4471
  var visualizationAnalyser = param.visualizationAnalyser;
4370
4472
  if (!visualizationAnalyser) {
4371
4473
  setScale(1);
@@ -4380,7 +4482,7 @@ var Visualization = function() {
4380
4482
  });
4381
4483
  });
4382
4484
  }, []);
4383
- (0, import_react52.useEffect)(function() {
4485
+ (0, import_react53.useEffect)(function() {
4384
4486
  draw({
4385
4487
  visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser
4386
4488
  });
@@ -4665,9 +4767,9 @@ AudioThreadDialog.Root = Root9;
4665
4767
  AudioThreadDialog.Trigger = Trigger;
4666
4768
  AudioThreadDialog.Content = Content4;
4667
4769
  // src/components/suggestions/Suggestions/index.tsx
4668
- var import_react54 = require("react");
4770
+ var import_react55 = require("react");
4669
4771
  // src/components/suggestions/Suggestions/Content.tsx
4670
- var import_react53 = require("react");
4772
+ var import_react54 = require("react");
4671
4773
  var import_radash17 = require("radash");
4672
4774
  var import_react_children_utilities = require("react-children-utilities");
4673
4775
  var import_themes52 = require("@radix-ui/themes");
@@ -4724,7 +4826,7 @@ var import_jsx_runtime77 = require("react/jsx-runtime");
4724
4826
  var Content6 = function(param) {
4725
4827
  var children = param.children;
4726
4828
  var isMutatingMessage = useIsMutatingMessage();
4727
- var suggestions = (0, import_react53.useMemo)(function() {
4829
+ var suggestions = (0, import_react54.useMemo)(function() {
4728
4830
  return (0, import_react_children_utilities.onlyText)(children).split(/\r?\n/).filter(function(c) {
4729
4831
  return !(0, import_radash17.isEmpty)(c);
4730
4832
  }).map(function(c) {
@@ -4751,7 +4853,7 @@ var import_jsx_runtime78 = require("react/jsx-runtime");
4751
4853
  var Suggestions = function(param) {
4752
4854
  var children = param.children;
4753
4855
  var latestMessageProps = useLatestMessage();
4754
- var isDisabled = (0, import_react54.useMemo)(function() {
4856
+ var isDisabled = (0, import_react55.useMemo)(function() {
4755
4857
  var // @ts-ignore-next-line
4756
4858
  _latestMessageProps_latestMessage_metadata, _latestMessageProps_latestMessage;
4757
4859
  return (_latestMessageProps_latestMessage = latestMessageProps.latestMessage) === null || _latestMessageProps_latestMessage === void 0 ? void 0 : (_latestMessageProps_latestMessage_metadata = _latestMessageProps_latestMessage.metadata) === null || _latestMessageProps_latestMessage_metadata === void 0 ? void 0 : _latestMessageProps_latestMessage_metadata.isBlocking;
@@ -4766,14 +4868,14 @@ var Suggestions = function(param) {
4766
4868
  };
4767
4869
  Suggestions.Item = Item;
4768
4870
  // src/components/markdown/MarkdownProvider/index.tsx
4769
- var import_react55 = require("react");
4871
+ var import_react56 = require("react");
4770
4872
  var import_jsx_runtime79 = require("react/jsx-runtime");
4771
4873
  var MarkdownProvider = function(_param) {
4772
4874
  var children = _param.children, rest = _object_without_properties(_param, [
4773
4875
  "children"
4774
4876
  ]);
4775
4877
  var prevMarkdownContext = useMarkdownContext();
4776
- var value = (0, import_react55.useMemo)(function() {
4878
+ var value = (0, import_react56.useMemo)(function() {
4777
4879
  return merge(prevMarkdownContext, rest);
4778
4880
  }, [
4779
4881
  rest,
@@ -4785,11 +4887,11 @@ var MarkdownProvider = function(_param) {
4785
4887
  });
4786
4888
  };
4787
4889
  // src/components/components/ComponentsProvider.tsx
4788
- var import_react57 = require("react");
4890
+ var import_react58 = require("react");
4789
4891
  // src/hooks/components/useComponents.ts
4790
- var import_react56 = require("react");
4892
+ var import_react57 = require("react");
4791
4893
  var useComponents = function() {
4792
- return (0, import_react56.useContext)(ComponentsContext);
4894
+ return (0, import_react57.useContext)(ComponentsContext);
4793
4895
  };
4794
4896
  // src/components/components/ComponentsProvider.tsx
4795
4897
  var import_jsx_runtime80 = require("react/jsx-runtime");
@@ -4798,7 +4900,7 @@ var ComponentsProvider = function(_param) {
4798
4900
  "children"
4799
4901
  ]);
4800
4902
  var prevComponents = useComponents();
4801
- var value = (0, import_react57.useMemo)(function() {
4903
+ var value = (0, import_react58.useMemo)(function() {
4802
4904
  return merge(prevComponents, rest);
4803
4905
  }, [
4804
4906
  rest,
@@ -4827,6 +4929,7 @@ var ComponentsProvider = function(_param) {
4827
4929
  ThreadDialog: ThreadDialog,
4828
4930
  ThreadDialogContext: ThreadDialogContext,
4829
4931
  UserAvatarContext: UserAvatarContext,
4932
+ useAssistant: useAssistant,
4830
4933
  useComponents: useComponents,
4831
4934
  useCreateMessage: useCreateMessage,
4832
4935
  useLatestMessage: useLatestMessage,