@superinterface/react 5.3.0-beta.10 → 5.3.0-beta.12

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesPage, ThreadStorageOptions, StyleProps, SerializedMessage, UseCreateMessageVariables, DefaultAudioSegment, PlayInputArgs, AudioRuntime, MessageAudioOverrides, Avatar as Avatar$1, SerializedRunStep, ToolCall, MessageGroup as MessageGroup$1 } from './types/index.cjs';
2
+ import { MessagesPage, ThreadStorageOptions, StyleProps, SerializedMessage, UseCreateMessageVariables, DefaultAudioSegment, PlayInputArgs, MessageAudioOverrides, AudioRuntime, Avatar as Avatar$1, SerializedRunStep, ToolCall, MessageGroup as MessageGroup$1 } from './types/index.cjs';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
5
5
  import * as react_hook_form from 'react-hook-form';
@@ -582,15 +582,16 @@ declare const AudioThreadDialog: {
582
582
  type Args$6<TSegment = DefaultAudioSegment> = {
583
583
  children: React.ReactNode;
584
584
  play?: (args: PlayInputArgs) => Promise<void> | void;
585
+ playSegments?: MessageAudioOverrides<TSegment>['playSegments'];
586
+ getSegments?: MessageAudioOverrides<TSegment>['getSegments'];
585
587
  onEnd?: () => void;
586
588
  audioRuntime?: AudioRuntime;
587
- playback?: MessageAudioOverrides<TSegment>;
588
589
  } & StyleProps;
589
590
 
590
591
  type Args$5 = Omit<Args$6, 'children'>;
591
592
  declare const AudioThread: {
592
593
  (props: Args$5): react_jsx_runtime.JSX.Element;
593
- Root: <TSegment = DefaultAudioSegment>({ children, play, onEnd, className, style, playback, ...rest }: Args$6<TSegment>) => react_jsx_runtime.JSX.Element;
594
+ Root: <TSegment = DefaultAudioSegment>({ children, play, playSegments, getSegments, onEnd, className, style, ...rest }: Args$6<TSegment>) => react_jsx_runtime.JSX.Element;
594
595
  Visualization: {
595
596
  (props: StyleProps): react_jsx_runtime.JSX.Element;
596
597
  Root: ({ children, ...rest }: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesPage, ThreadStorageOptions, StyleProps, SerializedMessage, UseCreateMessageVariables, DefaultAudioSegment, PlayInputArgs, AudioRuntime, MessageAudioOverrides, Avatar as Avatar$1, SerializedRunStep, ToolCall, MessageGroup as MessageGroup$1 } from './types/index.js';
2
+ import { MessagesPage, ThreadStorageOptions, StyleProps, SerializedMessage, UseCreateMessageVariables, DefaultAudioSegment, PlayInputArgs, MessageAudioOverrides, AudioRuntime, Avatar as Avatar$1, SerializedRunStep, ToolCall, MessageGroup as MessageGroup$1 } from './types/index.js';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
5
5
  import * as react_hook_form from 'react-hook-form';
@@ -582,15 +582,16 @@ declare const AudioThreadDialog: {
582
582
  type Args$6<TSegment = DefaultAudioSegment> = {
583
583
  children: React.ReactNode;
584
584
  play?: (args: PlayInputArgs) => Promise<void> | void;
585
+ playSegments?: MessageAudioOverrides<TSegment>['playSegments'];
586
+ getSegments?: MessageAudioOverrides<TSegment>['getSegments'];
585
587
  onEnd?: () => void;
586
588
  audioRuntime?: AudioRuntime;
587
- playback?: MessageAudioOverrides<TSegment>;
588
589
  } & StyleProps;
589
590
 
590
591
  type Args$5 = Omit<Args$6, 'children'>;
591
592
  declare const AudioThread: {
592
593
  (props: Args$5): react_jsx_runtime.JSX.Element;
593
- Root: <TSegment = DefaultAudioSegment>({ children, play, onEnd, className, style, playback, ...rest }: Args$6<TSegment>) => react_jsx_runtime.JSX.Element;
594
+ Root: <TSegment = DefaultAudioSegment>({ children, play, playSegments, getSegments, onEnd, className, style, ...rest }: Args$6<TSegment>) => react_jsx_runtime.JSX.Element;
594
595
  Visualization: {
595
596
  (props: StyleProps): react_jsx_runtime.JSX.Element;
596
597
  Root: ({ children, ...rest }: {
package/dist/index.js CHANGED
@@ -47451,7 +47451,7 @@ var useMessageAudio = function(_ref) {
47451
47451
  }
47452
47452
  var run = /* @__PURE__ */ function() {
47453
47453
  var _ref2 = _asyncToGenerator11(function() {
47454
- var assistantsDesc, assistantsAsc, nowTs, lastNIds, prevQueue, prevById, prevUnfinishedIds, streamingIds, includeIds, segCache, nextQueue, changed, touch, i, _existing$nextIndex, _existing$stopped, m_6, rawInput, prevEntry, nextEntry, playableSegments, customSegments, safeSegments, base, fullSegments, readyCount, last3, readySegments, existing, nextIndex, stopped, reuse, unfinished, finished, prunedFinished, combined, i_0, idsInQueue, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, id_3, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, id_4, entries, toRemove, i_1;
47454
+ var assistantsDesc, assistantsAsc, nowTs, lastNIds, prevQueue, prevById, prevUnfinishedIds, streamingIds, includeIds, segCache, nextQueue, changed, touch, i, _existing$nextIndex, _existing$stopped, m_6, input2, prevEntry, nextEntry, playableSegments, customSegments, safeSegments, base, fullSegments, readyCount, last3, readySegments, existing, nextIndex, stopped, reuse, unfinished, finished, prunedFinished, combined, i_0, idsInQueue, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, id_3, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, id_4, entries, toRemove, i_1;
47455
47455
  return _ts_generator(this, function(_state) {
47456
47456
  switch(_state.label){
47457
47457
  case 0:
@@ -47512,10 +47512,10 @@ var useMessageAudio = function(_ref) {
47512
47512
  3,
47513
47513
  5
47514
47514
  ];
47515
- rawInput = input({
47515
+ input2 = input({
47516
47516
  message: m_6
47517
47517
  });
47518
- if (rawInput == null) {
47518
+ if (input2 == null) {
47519
47519
  segCache.delete(m_6.id);
47520
47520
  messagesByIdRef.current.delete(m_6.id);
47521
47521
  return [
@@ -47535,14 +47535,14 @@ var useMessageAudio = function(_ref) {
47535
47535
  4,
47536
47536
  Promise.resolve(providedGetSegments({
47537
47537
  message: m_6,
47538
- rawInput: rawInput
47538
+ input: input2
47539
47539
  }))
47540
47540
  ];
47541
47541
  case 2:
47542
47542
  customSegments = _state.sent();
47543
47543
  safeSegments = Array.isArray(customSegments) ? customSegments : [];
47544
47544
  nextEntry = {
47545
- input: rawInput,
47545
+ input: input2,
47546
47546
  segments: safeSegments,
47547
47547
  touched: nowTs
47548
47548
  };
@@ -47552,7 +47552,7 @@ var useMessageAudio = function(_ref) {
47552
47552
  4
47553
47553
  ];
47554
47554
  case 3:
47555
- base = getIncrementalSegments(prevEntry, rawInput, nowTs);
47555
+ base = getIncrementalSegments(prevEntry, input2, nowTs);
47556
47556
  nextEntry = {
47557
47557
  input: base.input,
47558
47558
  segments: base.segments,
@@ -47574,7 +47574,7 @@ var useMessageAudio = function(_ref) {
47574
47574
  existing = prevById.get(m_6.id);
47575
47575
  nextIndex = Math.min((_existing$nextIndex = existing === null || existing === void 0 ? void 0 : existing.nextIndex) !== null && _existing$nextIndex !== void 0 ? _existing$nextIndex : 0, playableSegments.length);
47576
47576
  stopped = (_existing$stopped = existing === null || existing === void 0 ? void 0 : existing.stopped) !== null && _existing$stopped !== void 0 ? _existing$stopped : false;
47577
- reuse = !!existing && existing.status === m_6.status && existing.rawInput === rawInput && existing.nextIndex === nextIndex && existing.stopped === stopped && segmentsEqual(existing.segments, playableSegments);
47577
+ reuse = !!existing && existing.status === m_6.status && existing.messageInput === input2 && existing.nextIndex === nextIndex && existing.stopped === stopped && segmentsEqual(existing.segments, playableSegments);
47578
47578
  if (reuse) {
47579
47579
  nextQueue.push(existing);
47580
47580
  } else {
@@ -47584,7 +47584,7 @@ var useMessageAudio = function(_ref) {
47584
47584
  segments: playableSegments,
47585
47585
  nextIndex: nextIndex,
47586
47586
  stopped: stopped,
47587
- rawInput: rawInput
47587
+ messageInput: input2
47588
47588
  });
47589
47589
  changed = true;
47590
47590
  }
@@ -47737,13 +47737,13 @@ var useMessageAudio = function(_ref) {
47737
47737
  ]);
47738
47738
  var defaultPlay = useCallback7(/* @__PURE__ */ function() {
47739
47739
  var _ref5 = _asyncToGenerator11(function(_ref4) {
47740
- var input2, onPlay, onStop, onEnd_0, searchParams;
47740
+ var input_0, onPlay, onStop, onEnd_0, searchParams;
47741
47741
  return _ts_generator(this, function(_state) {
47742
47742
  switch(_state.label){
47743
47743
  case 0:
47744
- input2 = _ref4.input, onPlay = _ref4.onPlay, onStop = _ref4.onStop, onEnd_0 = _ref4.onEnd;
47744
+ input_0 = _ref4.input, onPlay = _ref4.onPlay, onStop = _ref4.onStop, onEnd_0 = _ref4.onEnd;
47745
47745
  searchParams = new URLSearchParams(_objectSpread47({
47746
- input: input2
47746
+ input: input_0
47747
47747
  }, superinterfaceContext.variables));
47748
47748
  return [
47749
47749
  4,
@@ -47990,7 +47990,7 @@ var useMessageAudio = function(_ref) {
47990
47990
  candidate = {
47991
47991
  messageId: msg.id,
47992
47992
  message: message_0,
47993
- rawInput: msg.rawInput,
47993
+ messageInput: msg.messageInput,
47994
47994
  startIndex: msg.nextIndex,
47995
47995
  segments: msg.segments.slice(msg.nextIndex)
47996
47996
  };
@@ -48593,29 +48593,12 @@ var _excluded7 = [
48593
48593
  var _excluded22 = [
48594
48594
  "children",
48595
48595
  "play",
48596
+ "playSegments",
48597
+ "getSegments",
48596
48598
  "onEnd",
48597
48599
  "className",
48598
- "style",
48599
- "playback"
48600
+ "style"
48600
48601
  ];
48601
- function _objectWithoutProperties7(e, t) {
48602
- if (null == e) return {};
48603
- var o, r, i = _objectWithoutPropertiesLoose7(e, t);
48604
- if (Object.getOwnPropertySymbols) {
48605
- var n = Object.getOwnPropertySymbols(e);
48606
- for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
48607
- }
48608
- return i;
48609
- }
48610
- function _objectWithoutPropertiesLoose7(r, e) {
48611
- if (null == r) return {};
48612
- var t = {};
48613
- for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
48614
- if (-1 !== e.indexOf(n)) continue;
48615
- t[n] = r[n];
48616
- }
48617
- return t;
48618
- }
48619
48602
  function ownKeys50(e, r) {
48620
48603
  var t = Object.keys(e);
48621
48604
  if (Object.getOwnPropertySymbols) {
@@ -48659,6 +48642,24 @@ function _toPrimitive50(t, r) {
48659
48642
  }
48660
48643
  return ("string" === r ? String : Number)(t);
48661
48644
  }
48645
+ function _objectWithoutProperties7(e, t) {
48646
+ if (null == e) return {};
48647
+ var o, r, i = _objectWithoutPropertiesLoose7(e, t);
48648
+ if (Object.getOwnPropertySymbols) {
48649
+ var n = Object.getOwnPropertySymbols(e);
48650
+ for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
48651
+ }
48652
+ return i;
48653
+ }
48654
+ function _objectWithoutPropertiesLoose7(r, e) {
48655
+ if (null == r) return {};
48656
+ var t = {};
48657
+ for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
48658
+ if (-1 !== e.indexOf(n)) continue;
48659
+ t[n] = r[n];
48660
+ }
48661
+ return t;
48662
+ }
48662
48663
  var Content9 = function(t0) {
48663
48664
  var $ = _c90(4);
48664
48665
  var children = t0.children, className = t0.className, style = t0.style;
@@ -48683,34 +48684,30 @@ var Content9 = function(t0) {
48683
48684
  };
48684
48685
  var AudioRuntimeProvider = function(t0) {
48685
48686
  var $ = _c90(6);
48686
- var children = t0.children, onEnd = t0.onEnd, playback = t0.playback;
48687
+ var children = t0.children, onEnd = t0.onEnd, play = t0.play, playSegments = t0.playSegments, getSegments = t0.getSegments;
48687
48688
  var audioThreadContext = useAudioThreadContext();
48688
48689
  if (audioThreadContext.audioRuntime) {
48689
48690
  return children;
48690
48691
  }
48691
48692
  var t1;
48692
- if ($[0] !== playback) {
48693
- t1 = playback !== null && playback !== void 0 ? playback : {};
48694
- $[0] = playback;
48695
- $[1] = t1;
48696
- } else {
48697
- t1 = $[1];
48698
- }
48699
- var t2;
48700
- if ($[2] !== children || $[3] !== onEnd || $[4] !== t1) {
48701
- t2 = /* @__PURE__ */ _jsx88(TtsAudioRuntimeProvider, _objectSpread50(_objectSpread50({
48702
- onEnd: onEnd
48703
- }, t1), {}, {
48693
+ if ($[0] !== children || $[1] !== getSegments || $[2] !== onEnd || $[3] !== play || $[4] !== playSegments) {
48694
+ t1 = /* @__PURE__ */ _jsx88(TtsAudioRuntimeProvider, {
48695
+ onEnd: onEnd,
48696
+ play: play,
48697
+ playSegments: playSegments,
48698
+ getSegments: getSegments,
48704
48699
  children: children
48705
- }));
48706
- $[2] = children;
48707
- $[3] = onEnd;
48708
- $[4] = t1;
48709
- $[5] = t2;
48700
+ });
48701
+ $[0] = children;
48702
+ $[1] = getSegments;
48703
+ $[2] = onEnd;
48704
+ $[3] = play;
48705
+ $[4] = playSegments;
48706
+ $[5] = t1;
48710
48707
  } else {
48711
- t2 = $[5];
48708
+ t1 = $[5];
48712
48709
  }
48713
- return t2;
48710
+ return t1;
48714
48711
  };
48715
48712
  var Provider5 = function(t0) {
48716
48713
  var $ = _c90(9);
@@ -48756,88 +48753,83 @@ var Root16 = function(t0) {
48756
48753
  var $ = _c90(22);
48757
48754
  var children;
48758
48755
  var className;
48756
+ var getSegments;
48759
48757
  var onEnd;
48760
48758
  var play;
48761
- var playback;
48759
+ var playSegments;
48762
48760
  var rest;
48763
48761
  var style;
48764
48762
  if ($[0] !== t0) {
48765
48763
  var _t2 = t0;
48766
48764
  var ref;
48767
- ref = _t2, children = ref.children, play = ref.play, onEnd = ref.onEnd, className = ref.className, style = ref.style, playback = ref.playback, ref;
48765
+ ref = _t2, children = ref.children, play = ref.play, playSegments = ref.playSegments, getSegments = ref.getSegments, onEnd = ref.onEnd, className = ref.className, style = ref.style, ref;
48768
48766
  rest = _objectWithoutProperties7(_t2, _excluded22);
48769
48767
  _t2;
48770
48768
  $[0] = t0;
48771
48769
  $[1] = children;
48772
48770
  $[2] = className;
48773
- $[3] = onEnd;
48774
- $[4] = play;
48775
- $[5] = playback;
48776
- $[6] = rest;
48777
- $[7] = style;
48771
+ $[3] = getSegments;
48772
+ $[4] = onEnd;
48773
+ $[5] = play;
48774
+ $[6] = playSegments;
48775
+ $[7] = rest;
48776
+ $[8] = style;
48778
48777
  } else {
48779
48778
  children = $[1];
48780
48779
  className = $[2];
48781
- onEnd = $[3];
48782
- play = $[4];
48783
- playback = $[5];
48784
- rest = $[6];
48785
- style = $[7];
48780
+ getSegments = $[3];
48781
+ onEnd = $[4];
48782
+ play = $[5];
48783
+ playSegments = $[6];
48784
+ rest = $[7];
48785
+ style = $[8];
48786
48786
  }
48787
48787
  var t1;
48788
- if ($[8] !== play || $[9] !== playback) {
48789
- t1 = playback !== null && playback !== void 0 ? playback : play ? {
48790
- play: play
48791
- } : void 0;
48792
- $[8] = play;
48793
- $[9] = playback;
48794
- $[10] = t1;
48795
- } else {
48796
- t1 = $[10];
48797
- }
48798
- var playbackOverrides = t1;
48799
- var t2;
48800
- if ($[11] !== children || $[12] !== className || $[13] !== style) {
48801
- t2 = /* @__PURE__ */ _jsx88(ToastsProvider, {
48788
+ if ($[9] !== children || $[10] !== className || $[11] !== style) {
48789
+ t1 = /* @__PURE__ */ _jsx88(ToastsProvider, {
48802
48790
  children: /* @__PURE__ */ _jsx88(Content9, {
48803
48791
  className: className,
48804
48792
  style: style,
48805
48793
  children: children
48806
48794
  })
48807
48795
  });
48808
- $[11] = children;
48809
- $[12] = className;
48810
- $[13] = style;
48811
- $[14] = t2;
48796
+ $[9] = children;
48797
+ $[10] = className;
48798
+ $[11] = style;
48799
+ $[12] = t1;
48812
48800
  } else {
48813
- t2 = $[14];
48801
+ t1 = $[12];
48814
48802
  }
48815
- var t3;
48816
- if ($[15] !== onEnd || $[16] !== playbackOverrides || $[17] !== t2) {
48817
- t3 = /* @__PURE__ */ _jsx88(AudioRuntimeProvider, {
48803
+ var t2;
48804
+ if ($[13] !== getSegments || $[14] !== onEnd || $[15] !== play || $[16] !== playSegments || $[17] !== t1) {
48805
+ t2 = /* @__PURE__ */ _jsx88(AudioRuntimeProvider, {
48818
48806
  onEnd: onEnd,
48819
- playback: playbackOverrides,
48820
- children: t2
48807
+ play: play,
48808
+ playSegments: playSegments,
48809
+ getSegments: getSegments,
48810
+ children: t1
48821
48811
  });
48822
- $[15] = onEnd;
48823
- $[16] = playbackOverrides;
48824
- $[17] = t2;
48825
- $[18] = t3;
48812
+ $[13] = getSegments;
48813
+ $[14] = onEnd;
48814
+ $[15] = play;
48815
+ $[16] = playSegments;
48816
+ $[17] = t1;
48817
+ $[18] = t2;
48826
48818
  } else {
48827
- t3 = $[18];
48819
+ t2 = $[18];
48828
48820
  }
48829
- var t4;
48830
- if ($[19] !== rest || $[20] !== t3) {
48831
- t4 = /* @__PURE__ */ _jsx88(Provider5, _objectSpread50(_objectSpread50({}, rest), {}, {
48832
- children: t3
48821
+ var t3;
48822
+ if ($[19] !== rest || $[20] !== t2) {
48823
+ t3 = /* @__PURE__ */ _jsx88(Provider5, _objectSpread50(_objectSpread50({}, rest), {}, {
48824
+ children: t2
48833
48825
  }));
48834
48826
  $[19] = rest;
48835
- $[20] = t3;
48836
- $[21] = t4;
48827
+ $[20] = t2;
48828
+ $[21] = t3;
48837
48829
  } else {
48838
- t4 = $[21];
48830
+ t3 = $[21];
48839
48831
  }
48840
- return t4;
48832
+ return t3;
48841
48833
  };
48842
48834
  // src/components/threads/AudioThread/Visualization/index.tsx
48843
48835
  import { c as _c92 } from "react-compiler-runtime";