@superinterface/react 2.0.3 → 2.0.5

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,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { MessagesPage, Message } from './types/index.cjs';
3
3
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
4
+ export { u as useSuperinterfaceContext, u as useThreadContext } from './index-Dp6WTBGJ.cjs';
4
5
  import * as react from 'react';
5
6
  import { Dispatch, SetStateAction } from 'react';
6
7
  import * as _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw from '@tanstack/query-core/build/legacy/queryClient-Ho-z40Sw';
@@ -8,7 +9,7 @@ import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query
8
9
  import * as openai_resources_beta_threads_runs_runs from 'openai/resources/beta/threads/runs/runs';
9
10
  import OpenAI from 'openai';
10
11
 
11
- type Args$7 = {
12
+ type Args$6 = {
12
13
  children: React.ReactNode;
13
14
  baseUrl?: string;
14
15
  publicApiKey?: string;
@@ -20,24 +21,16 @@ type Args$7 = {
20
21
  mutations?: UseMutationOptions;
21
22
  };
22
23
  };
23
- declare const SuperinterfaceProvider: ({ children, baseUrl, publicApiKey, variables, defaultOptions, }: Args$7) => react_jsx_runtime.JSX.Element;
24
+ declare const SuperinterfaceProvider: ({ children, baseUrl, publicApiKey, variables, defaultOptions, }: Args$6) => react_jsx_runtime.JSX.Element;
24
25
 
25
- declare const useSuperinterfaceContext: () => {
26
- baseUrl: string | null;
27
- variables: Record<string, any>;
28
- defaultOptions: {
29
- queries: Record<string, any>;
30
- mutations: Record<string, any>;
31
- };
32
- publicApiKey?: string | undefined;
33
- };
26
+ type Args$5 = Args$6;
34
27
 
35
- type Args$6 = Args$7;
28
+ type Args$4 = Args$5;
36
29
 
37
- type Args$5 = Omit<Args$6, 'children'>;
30
+ type Args$3 = Omit<Args$4, 'children'>;
38
31
  declare const Thread: {
39
- (props: Args$5): react_jsx_runtime.JSX.Element;
40
- Root: ({ children, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
32
+ (props: Args$3): react_jsx_runtime.JSX.Element;
33
+ Root: ({ children, ...rest }: Args$6) => react_jsx_runtime.JSX.Element;
41
34
  Messages: {
42
35
  ({ children, style, }: {
43
36
  children?: react.ReactNode;
@@ -231,6 +224,10 @@ declare const useMessages: () => {
231
224
  fetchStatus: _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.a8;
232
225
  };
233
226
 
227
+ declare const useMessageContext: () => {
228
+ message: Message | null;
229
+ };
230
+
234
231
  declare const useLatestMessage: () => {
235
232
  latestMessage: Message;
236
233
  messages: Message[];
@@ -558,14 +555,14 @@ declare const AudioThreadDialog: {
558
555
  };
559
556
  };
560
557
 
561
- type Args$4 = {
558
+ type Args$2 = {
562
559
  children: React.ReactNode;
563
560
  };
564
561
 
565
- type Args$3 = Omit<Args$4, 'children'>;
562
+ type Args$1 = Omit<Args$2, 'children'>;
566
563
  declare const AudioThread: {
567
- (props: Args$3): react_jsx_runtime.JSX.Element;
568
- Root: ({ children, }: Args$4) => react_jsx_runtime.JSX.Element;
564
+ (props: Args$1): react_jsx_runtime.JSX.Element;
565
+ Root: ({ children, }: Args$2) => react_jsx_runtime.JSX.Element;
569
566
  Visualization: () => react_jsx_runtime.JSX.Element;
570
567
  Form: () => react_jsx_runtime.JSX.Element;
571
568
  };
@@ -1190,16 +1187,23 @@ declare const useIsRunActive: () => {
1190
1187
  fetchStatus: _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.a8;
1191
1188
  };
1192
1189
 
1193
- type Args$2 = {
1194
- emptyStateSuggestions?: string[];
1195
- suggestions?: string[];
1196
- };
1197
- declare const Suggestions: ({ emptyStateSuggestions, suggestions, }: Args$2) => react_jsx_runtime.JSX.Element | null;
1198
-
1199
- type Args$1 = {
1200
- suggestion: string;
1190
+ declare const Suggestions: {
1191
+ ({ children, }: {
1192
+ children: React.ReactNode;
1193
+ }): react_jsx_runtime.JSX.Element | null;
1194
+ Item: {
1195
+ ({ suggestion, isDisabled, }: {
1196
+ suggestion: string;
1197
+ isDisabled: boolean;
1198
+ }): react_jsx_runtime.JSX.Element;
1199
+ Content: ({ onClick, isDisabled, isPending, children, }: {
1200
+ onClick: () => void;
1201
+ isDisabled: boolean;
1202
+ isPending: boolean;
1203
+ children: react.ReactNode;
1204
+ }) => react_jsx_runtime.JSX.Element;
1205
+ };
1201
1206
  };
1202
- declare const Suggestion: ({ suggestion, }: Args$1) => react_jsx_runtime.JSX.Element;
1203
1207
 
1204
1208
  declare const MarkdownContext: react.Context<{
1205
1209
  remarkPlugins: any[];
@@ -1211,10 +1215,16 @@ declare const MarkdownContext: react.Context<{
1211
1215
  ul: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1212
1216
  ol: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1213
1217
  li: ({ children }: react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>) => react_jsx_runtime.JSX.Element;
1218
+ pre: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>) => react_jsx_runtime.JSX.Element;
1219
+ code: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>) => react_jsx_runtime.JSX.Element;
1214
1220
  };
1215
1221
  };
1216
1222
  }>;
1217
1223
 
1224
+ declare const MarkdownProvider: ({ children, ...rest }: {
1225
+ children: React.ReactNode;
1226
+ }) => react_jsx_runtime.JSX.Element;
1227
+
1218
1228
  declare const useMarkdownContext: () => {
1219
1229
  remarkPlugins: any[];
1220
1230
  rehypeReactOptions: {
@@ -1225,6 +1235,8 @@ declare const useMarkdownContext: () => {
1225
1235
  ul: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1226
1236
  ol: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1227
1237
  li: ({ children }: react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>) => react_jsx_runtime.JSX.Element;
1238
+ pre: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>) => react_jsx_runtime.JSX.Element;
1239
+ code: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>) => react_jsx_runtime.JSX.Element;
1228
1240
  };
1229
1241
  };
1230
1242
  };
@@ -1245,4 +1257,4 @@ type Args = {
1245
1257
  };
1246
1258
  declare const FunctionBase: ({ fn, runStep, title, }: Args) => react_jsx_runtime.JSX.Element;
1247
1259
 
1248
- export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, FunctionBase, FunctionComponentsContext, MarkdownContext, Suggestion, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, useCreateMessage, useCreateRun, useIsRunActive, useLatestMessage, useLatestRun, useLifecycle, useMarkdownContext, useMessages, useRuns, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext };
1260
+ export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, useCreateMessage, useCreateRun, useIsRunActive, useLatestMessage, useLatestRun, useLifecycle, useMarkdownContext, useMessageContext, useMessages, useRuns };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { MessagesPage, Message } from './types/index.js';
3
3
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
4
+ export { u as useSuperinterfaceContext, u as useThreadContext } from './index-Dp6WTBGJ.js';
4
5
  import * as react from 'react';
5
6
  import { Dispatch, SetStateAction } from 'react';
6
7
  import * as _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw from '@tanstack/query-core/build/legacy/queryClient-Ho-z40Sw';
@@ -8,7 +9,7 @@ import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query
8
9
  import * as openai_resources_beta_threads_runs_runs from 'openai/resources/beta/threads/runs/runs';
9
10
  import OpenAI from 'openai';
10
11
 
11
- type Args$7 = {
12
+ type Args$6 = {
12
13
  children: React.ReactNode;
13
14
  baseUrl?: string;
14
15
  publicApiKey?: string;
@@ -20,24 +21,16 @@ type Args$7 = {
20
21
  mutations?: UseMutationOptions;
21
22
  };
22
23
  };
23
- declare const SuperinterfaceProvider: ({ children, baseUrl, publicApiKey, variables, defaultOptions, }: Args$7) => react_jsx_runtime.JSX.Element;
24
+ declare const SuperinterfaceProvider: ({ children, baseUrl, publicApiKey, variables, defaultOptions, }: Args$6) => react_jsx_runtime.JSX.Element;
24
25
 
25
- declare const useSuperinterfaceContext: () => {
26
- baseUrl: string | null;
27
- variables: Record<string, any>;
28
- defaultOptions: {
29
- queries: Record<string, any>;
30
- mutations: Record<string, any>;
31
- };
32
- publicApiKey?: string | undefined;
33
- };
26
+ type Args$5 = Args$6;
34
27
 
35
- type Args$6 = Args$7;
28
+ type Args$4 = Args$5;
36
29
 
37
- type Args$5 = Omit<Args$6, 'children'>;
30
+ type Args$3 = Omit<Args$4, 'children'>;
38
31
  declare const Thread: {
39
- (props: Args$5): react_jsx_runtime.JSX.Element;
40
- Root: ({ children, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
32
+ (props: Args$3): react_jsx_runtime.JSX.Element;
33
+ Root: ({ children, ...rest }: Args$6) => react_jsx_runtime.JSX.Element;
41
34
  Messages: {
42
35
  ({ children, style, }: {
43
36
  children?: react.ReactNode;
@@ -231,6 +224,10 @@ declare const useMessages: () => {
231
224
  fetchStatus: _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.a8;
232
225
  };
233
226
 
227
+ declare const useMessageContext: () => {
228
+ message: Message | null;
229
+ };
230
+
234
231
  declare const useLatestMessage: () => {
235
232
  latestMessage: Message;
236
233
  messages: Message[];
@@ -558,14 +555,14 @@ declare const AudioThreadDialog: {
558
555
  };
559
556
  };
560
557
 
561
- type Args$4 = {
558
+ type Args$2 = {
562
559
  children: React.ReactNode;
563
560
  };
564
561
 
565
- type Args$3 = Omit<Args$4, 'children'>;
562
+ type Args$1 = Omit<Args$2, 'children'>;
566
563
  declare const AudioThread: {
567
- (props: Args$3): react_jsx_runtime.JSX.Element;
568
- Root: ({ children, }: Args$4) => react_jsx_runtime.JSX.Element;
564
+ (props: Args$1): react_jsx_runtime.JSX.Element;
565
+ Root: ({ children, }: Args$2) => react_jsx_runtime.JSX.Element;
569
566
  Visualization: () => react_jsx_runtime.JSX.Element;
570
567
  Form: () => react_jsx_runtime.JSX.Element;
571
568
  };
@@ -1190,16 +1187,23 @@ declare const useIsRunActive: () => {
1190
1187
  fetchStatus: _tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.a8;
1191
1188
  };
1192
1189
 
1193
- type Args$2 = {
1194
- emptyStateSuggestions?: string[];
1195
- suggestions?: string[];
1196
- };
1197
- declare const Suggestions: ({ emptyStateSuggestions, suggestions, }: Args$2) => react_jsx_runtime.JSX.Element | null;
1198
-
1199
- type Args$1 = {
1200
- suggestion: string;
1190
+ declare const Suggestions: {
1191
+ ({ children, }: {
1192
+ children: React.ReactNode;
1193
+ }): react_jsx_runtime.JSX.Element | null;
1194
+ Item: {
1195
+ ({ suggestion, isDisabled, }: {
1196
+ suggestion: string;
1197
+ isDisabled: boolean;
1198
+ }): react_jsx_runtime.JSX.Element;
1199
+ Content: ({ onClick, isDisabled, isPending, children, }: {
1200
+ onClick: () => void;
1201
+ isDisabled: boolean;
1202
+ isPending: boolean;
1203
+ children: react.ReactNode;
1204
+ }) => react_jsx_runtime.JSX.Element;
1205
+ };
1201
1206
  };
1202
- declare const Suggestion: ({ suggestion, }: Args$1) => react_jsx_runtime.JSX.Element;
1203
1207
 
1204
1208
  declare const MarkdownContext: react.Context<{
1205
1209
  remarkPlugins: any[];
@@ -1211,10 +1215,16 @@ declare const MarkdownContext: react.Context<{
1211
1215
  ul: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1212
1216
  ol: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1213
1217
  li: ({ children }: react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>) => react_jsx_runtime.JSX.Element;
1218
+ pre: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>) => react_jsx_runtime.JSX.Element;
1219
+ code: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>) => react_jsx_runtime.JSX.Element;
1214
1220
  };
1215
1221
  };
1216
1222
  }>;
1217
1223
 
1224
+ declare const MarkdownProvider: ({ children, ...rest }: {
1225
+ children: React.ReactNode;
1226
+ }) => react_jsx_runtime.JSX.Element;
1227
+
1218
1228
  declare const useMarkdownContext: () => {
1219
1229
  remarkPlugins: any[];
1220
1230
  rehypeReactOptions: {
@@ -1225,6 +1235,8 @@ declare const useMarkdownContext: () => {
1225
1235
  ul: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1226
1236
  ol: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>) => react_jsx_runtime.JSX.Element;
1227
1237
  li: ({ children }: react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>) => react_jsx_runtime.JSX.Element;
1238
+ pre: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLPreElement>, HTMLPreElement>) => react_jsx_runtime.JSX.Element;
1239
+ code: ({ children }: react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>) => react_jsx_runtime.JSX.Element;
1228
1240
  };
1229
1241
  };
1230
1242
  };
@@ -1245,4 +1257,4 @@ type Args = {
1245
1257
  };
1246
1258
  declare const FunctionBase: ({ fn, runStep, title, }: Args) => react_jsx_runtime.JSX.Element;
1247
1259
 
1248
- export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, FunctionBase, FunctionComponentsContext, MarkdownContext, Suggestion, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, useCreateMessage, useCreateRun, useIsRunActive, useLatestMessage, useLatestRun, useLifecycle, useMarkdownContext, useMessages, useRuns, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext };
1260
+ export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, useCreateMessage, useCreateRun, useIsRunActive, useLatestMessage, useLatestRun, useLifecycle, useMarkdownContext, useMessageContext, useMessages, useRuns };