@superinterface/react 3.7.1 → 3.7.2

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
@@ -8,11 +8,13 @@ import * as _tanstack_query_core from '@tanstack/query-core';
8
8
  import * as react from 'react';
9
9
  import { Dispatch, SetStateAction } from 'react';
10
10
  import * as openai_resources from 'openai/resources';
11
+ import * as react_use_audio_player from 'react-use-audio-player';
12
+ import { UseAudioCaptureProps } from 'use-audio-capture';
11
13
  import OpenAI from 'openai';
12
14
  import remarkGfm from 'remark-gfm';
13
15
  import * as openai_resources_beta_threads_runs_steps from 'openai/resources/beta/threads/runs/steps';
14
16
 
15
- type Args$9 = {
17
+ type Args$a = {
16
18
  children: React.ReactNode;
17
19
  baseUrl?: string;
18
20
  variables?: {
@@ -24,7 +26,7 @@ type Args$9 = {
24
26
  };
25
27
  threadIdStorageOptions?: ThreadStorageOptions | null;
26
28
  };
27
- declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdStorageOptions, }: Args$9) => react_jsx_runtime.JSX.Element;
29
+ declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdStorageOptions, }: Args$a) => react_jsx_runtime.JSX.Element;
28
30
 
29
31
  declare const useSuperinterfaceContext: () => {
30
32
  baseUrl: string | null;
@@ -37,14 +39,14 @@ declare const useSuperinterfaceContext: () => {
37
39
  createMessageAbortControllerRef: React.MutableRefObject<AbortController | null>;
38
40
  };
39
41
 
40
- type Args$8 = Args$9;
42
+ type Args$9 = Args$a;
41
43
 
42
- type Args$7 = Args$8 & StyleProps;
44
+ type Args$8 = Args$9 & StyleProps;
43
45
 
44
- type Args$6 = Omit<Args$7, 'children'>;
46
+ type Args$7 = Omit<Args$8, 'children'>;
45
47
  declare const Thread: {
46
- (props: Args$6): react_jsx_runtime.JSX.Element;
47
- Root: ({ children, style, className, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
48
+ (props: Args$7): react_jsx_runtime.JSX.Element;
49
+ Root: ({ children, style, className, ...rest }: Args$8) => react_jsx_runtime.JSX.Element;
48
50
  Messages: {
49
51
  ({ children, className, style, }: {
50
52
  children?: React.ReactNode;
@@ -336,10 +338,10 @@ declare const useMessageFormContext: () => {
336
338
 
337
339
  declare const useIsMutatingMessage: () => boolean;
338
340
 
339
- type Args$5 = {
341
+ type Args$6 = {
340
342
  assistantId: string;
341
343
  };
342
- declare const useAssistant: ({ assistantId, }: Args$5) => {
344
+ declare const useAssistant: ({ assistantId, }: Args$6) => {
343
345
  assistant: any;
344
346
  data: any;
345
347
  error: Error;
@@ -533,14 +535,14 @@ declare const AudioThreadDialog: {
533
535
  };
534
536
  };
535
537
 
536
- type Args$4 = {
538
+ type Args$5 = {
537
539
  children: React.ReactNode;
538
540
  } & StyleProps;
539
541
 
540
- type Args$3 = Omit<Args$4, 'children'>;
542
+ type Args$4 = Omit<Args$5, 'children'>;
541
543
  declare const AudioThread: {
542
- (props: Args$3): react_jsx_runtime.JSX.Element;
543
- Root: ({ children, ...rest }: Args$4) => react_jsx_runtime.JSX.Element;
544
+ (props: Args$4): react_jsx_runtime.JSX.Element;
545
+ Root: ({ children, ...rest }: Args$5) => react_jsx_runtime.JSX.Element;
544
546
  Visualization: (props: StyleProps) => react_jsx_runtime.JSX.Element;
545
547
  Status: (props: StyleProps) => react_jsx_runtime.JSX.Element;
546
548
  Form: (props: StyleProps) => react_jsx_runtime.JSX.Element;
@@ -551,6 +553,70 @@ declare const useThreadDialogContext: () => {
551
553
  setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
552
554
  };
553
555
 
556
+ declare const useMessageAudio: ({ onEnd, }: {
557
+ onEnd: () => void;
558
+ }) => {
559
+ visualizationAnalyser: AnalyserNode | null;
560
+ play: () => void;
561
+ pause: () => void;
562
+ togglePlayPause: () => void;
563
+ stop: () => void;
564
+ setVolume: (volume: number) => void;
565
+ fade: (from: number, to: number, duration: number) => void;
566
+ setRate: (speed: number) => void;
567
+ seek: (seconds: number) => void;
568
+ mute: (muteOnOff: boolean) => void;
569
+ loop: (loopOnOff: boolean) => void;
570
+ getPosition: () => number;
571
+ load: (...args: react_use_audio_player.LoadArguments) => void;
572
+ src: string | null;
573
+ looping: boolean;
574
+ isReady: boolean;
575
+ isLoading: boolean;
576
+ paused: boolean;
577
+ stopped: boolean;
578
+ playing: boolean;
579
+ duration: number;
580
+ muted: boolean;
581
+ rate: number;
582
+ volume: number;
583
+ error: string | null;
584
+ cleanup: VoidFunction;
585
+ isPending: boolean;
586
+ isAudioPlayed: boolean;
587
+ };
588
+
589
+ type Args$3 = UseAudioCaptureProps & {
590
+ isStopOnSilence: boolean;
591
+ };
592
+ declare const useRecorder: ({ isStopOnSilence, onStart, onStop, }: Args$3) => {
593
+ status: "paused" | "idle" | "recording" | "stopped";
594
+ visualizationAnalyser: AnalyserNode | null;
595
+ start: () => Promise<void>;
596
+ stop: () => Promise<void>;
597
+ pause: () => Promise<void>;
598
+ resume: () => Promise<void>;
599
+ };
600
+
601
+ declare const statusMessages: {
602
+ recording: string;
603
+ creatingMessage: string;
604
+ runActive: string;
605
+ playing: string;
606
+ loading: string;
607
+ idle: string;
608
+ recorderPaused: string;
609
+ playerPaused: string;
610
+ acquiringMedia: string;
611
+ other: string;
612
+ };
613
+
614
+ declare const useAudioThreadContext: () => {
615
+ status: keyof typeof statusMessages;
616
+ recorderProps: ReturnType<typeof useRecorder>;
617
+ messageAudioProps: ReturnType<typeof useMessageAudio>;
618
+ };
619
+
554
620
  declare const Suggestions: {
555
621
  ({ children, className, style, }: {
556
622
  children: React.ReactNode;
@@ -664,4 +730,4 @@ type Args = {
664
730
  };
665
731
  declare const AssistantProvider: ({ children, }: Args) => react_jsx_runtime.JSX.Element;
666
732
 
667
- export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
733
+ export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useAudioThreadContext, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
package/dist/index.d.ts CHANGED
@@ -8,11 +8,13 @@ import * as _tanstack_query_core from '@tanstack/query-core';
8
8
  import * as react from 'react';
9
9
  import { Dispatch, SetStateAction } from 'react';
10
10
  import * as openai_resources from 'openai/resources';
11
+ import * as react_use_audio_player from 'react-use-audio-player';
12
+ import { UseAudioCaptureProps } from 'use-audio-capture';
11
13
  import OpenAI from 'openai';
12
14
  import remarkGfm from 'remark-gfm';
13
15
  import * as openai_resources_beta_threads_runs_steps from 'openai/resources/beta/threads/runs/steps';
14
16
 
15
- type Args$9 = {
17
+ type Args$a = {
16
18
  children: React.ReactNode;
17
19
  baseUrl?: string;
18
20
  variables?: {
@@ -24,7 +26,7 @@ type Args$9 = {
24
26
  };
25
27
  threadIdStorageOptions?: ThreadStorageOptions | null;
26
28
  };
27
- declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdStorageOptions, }: Args$9) => react_jsx_runtime.JSX.Element;
29
+ declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdStorageOptions, }: Args$a) => react_jsx_runtime.JSX.Element;
28
30
 
29
31
  declare const useSuperinterfaceContext: () => {
30
32
  baseUrl: string | null;
@@ -37,14 +39,14 @@ declare const useSuperinterfaceContext: () => {
37
39
  createMessageAbortControllerRef: React.MutableRefObject<AbortController | null>;
38
40
  };
39
41
 
40
- type Args$8 = Args$9;
42
+ type Args$9 = Args$a;
41
43
 
42
- type Args$7 = Args$8 & StyleProps;
44
+ type Args$8 = Args$9 & StyleProps;
43
45
 
44
- type Args$6 = Omit<Args$7, 'children'>;
46
+ type Args$7 = Omit<Args$8, 'children'>;
45
47
  declare const Thread: {
46
- (props: Args$6): react_jsx_runtime.JSX.Element;
47
- Root: ({ children, style, className, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
48
+ (props: Args$7): react_jsx_runtime.JSX.Element;
49
+ Root: ({ children, style, className, ...rest }: Args$8) => react_jsx_runtime.JSX.Element;
48
50
  Messages: {
49
51
  ({ children, className, style, }: {
50
52
  children?: React.ReactNode;
@@ -336,10 +338,10 @@ declare const useMessageFormContext: () => {
336
338
 
337
339
  declare const useIsMutatingMessage: () => boolean;
338
340
 
339
- type Args$5 = {
341
+ type Args$6 = {
340
342
  assistantId: string;
341
343
  };
342
- declare const useAssistant: ({ assistantId, }: Args$5) => {
344
+ declare const useAssistant: ({ assistantId, }: Args$6) => {
343
345
  assistant: any;
344
346
  data: any;
345
347
  error: Error;
@@ -533,14 +535,14 @@ declare const AudioThreadDialog: {
533
535
  };
534
536
  };
535
537
 
536
- type Args$4 = {
538
+ type Args$5 = {
537
539
  children: React.ReactNode;
538
540
  } & StyleProps;
539
541
 
540
- type Args$3 = Omit<Args$4, 'children'>;
542
+ type Args$4 = Omit<Args$5, 'children'>;
541
543
  declare const AudioThread: {
542
- (props: Args$3): react_jsx_runtime.JSX.Element;
543
- Root: ({ children, ...rest }: Args$4) => react_jsx_runtime.JSX.Element;
544
+ (props: Args$4): react_jsx_runtime.JSX.Element;
545
+ Root: ({ children, ...rest }: Args$5) => react_jsx_runtime.JSX.Element;
544
546
  Visualization: (props: StyleProps) => react_jsx_runtime.JSX.Element;
545
547
  Status: (props: StyleProps) => react_jsx_runtime.JSX.Element;
546
548
  Form: (props: StyleProps) => react_jsx_runtime.JSX.Element;
@@ -551,6 +553,70 @@ declare const useThreadDialogContext: () => {
551
553
  setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
552
554
  };
553
555
 
556
+ declare const useMessageAudio: ({ onEnd, }: {
557
+ onEnd: () => void;
558
+ }) => {
559
+ visualizationAnalyser: AnalyserNode | null;
560
+ play: () => void;
561
+ pause: () => void;
562
+ togglePlayPause: () => void;
563
+ stop: () => void;
564
+ setVolume: (volume: number) => void;
565
+ fade: (from: number, to: number, duration: number) => void;
566
+ setRate: (speed: number) => void;
567
+ seek: (seconds: number) => void;
568
+ mute: (muteOnOff: boolean) => void;
569
+ loop: (loopOnOff: boolean) => void;
570
+ getPosition: () => number;
571
+ load: (...args: react_use_audio_player.LoadArguments) => void;
572
+ src: string | null;
573
+ looping: boolean;
574
+ isReady: boolean;
575
+ isLoading: boolean;
576
+ paused: boolean;
577
+ stopped: boolean;
578
+ playing: boolean;
579
+ duration: number;
580
+ muted: boolean;
581
+ rate: number;
582
+ volume: number;
583
+ error: string | null;
584
+ cleanup: VoidFunction;
585
+ isPending: boolean;
586
+ isAudioPlayed: boolean;
587
+ };
588
+
589
+ type Args$3 = UseAudioCaptureProps & {
590
+ isStopOnSilence: boolean;
591
+ };
592
+ declare const useRecorder: ({ isStopOnSilence, onStart, onStop, }: Args$3) => {
593
+ status: "paused" | "idle" | "recording" | "stopped";
594
+ visualizationAnalyser: AnalyserNode | null;
595
+ start: () => Promise<void>;
596
+ stop: () => Promise<void>;
597
+ pause: () => Promise<void>;
598
+ resume: () => Promise<void>;
599
+ };
600
+
601
+ declare const statusMessages: {
602
+ recording: string;
603
+ creatingMessage: string;
604
+ runActive: string;
605
+ playing: string;
606
+ loading: string;
607
+ idle: string;
608
+ recorderPaused: string;
609
+ playerPaused: string;
610
+ acquiringMedia: string;
611
+ other: string;
612
+ };
613
+
614
+ declare const useAudioThreadContext: () => {
615
+ status: keyof typeof statusMessages;
616
+ recorderProps: ReturnType<typeof useRecorder>;
617
+ messageAudioProps: ReturnType<typeof useMessageAudio>;
618
+ };
619
+
554
620
  declare const Suggestions: {
555
621
  ({ children, className, style, }: {
556
622
  children: React.ReactNode;
@@ -664,4 +730,4 @@ type Args = {
664
730
  };
665
731
  declare const AssistantProvider: ({ children, }: Args) => react_jsx_runtime.JSX.Element;
666
732
 
667
- export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
733
+ export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useAudioThreadContext, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
package/dist/index.js CHANGED
@@ -11028,5 +11028,5 @@ var AssistantProvider = function(t0) {
11028
11028
  }
11029
11029
  return t6;
11030
11030
  };
11031
- export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar6 as Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
11031
+ export { AssistantAvatarContext, AssistantNameContext, AssistantProvider, AudioThread, AudioThreadDialog, Avatar6 as Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useAudioThreadContext, useComponents, useCreateMessage, useIsMutatingMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
11032
11032
  //# sourceMappingURL=index.js.map