@superinterface/react 2.17.5 → 2.19.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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesPage, SerializedMessage, SerializedRunStep, ToolCall } from './types/index.cjs';
2
+ import { MessagesPage, SerializedMessage, Avatar as Avatar$1, SerializedRunStep, ToolCall } 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';
@@ -21,7 +21,7 @@ declare const options: {
21
21
  }) => any;
22
22
  };
23
23
 
24
- type Args$7 = {
24
+ type Args$8 = {
25
25
  children: React.ReactNode;
26
26
  baseUrl?: string;
27
27
  variables?: {
@@ -33,7 +33,7 @@ type Args$7 = {
33
33
  };
34
34
  threadIdCookieOptions?: typeof options | null;
35
35
  };
36
- declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdCookieOptions, }: Args$7) => react_jsx_runtime.JSX.Element;
36
+ declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdCookieOptions, }: Args$8) => react_jsx_runtime.JSX.Element;
37
37
 
38
38
  declare const useSuperinterfaceContext: () => {
39
39
  baseUrl: string | null;
@@ -46,14 +46,14 @@ declare const useSuperinterfaceContext: () => {
46
46
  createMessageAbortControllerRef: React.MutableRefObject<AbortController | null>;
47
47
  };
48
48
 
49
- type Args$6 = Args$7;
49
+ type Args$7 = Args$8;
50
50
 
51
- type Args$5 = Args$6;
51
+ type Args$6 = Args$7;
52
52
 
53
- type Args$4 = Omit<Args$5, 'children'>;
53
+ type Args$5 = Omit<Args$6, 'children'>;
54
54
  declare const Thread: {
55
- (props: Args$4): react_jsx_runtime.JSX.Element;
56
- Root: ({ children, ...rest }: Args$5) => react_jsx_runtime.JSX.Element;
55
+ (props: Args$5): react_jsx_runtime.JSX.Element;
56
+ Root: ({ children, ...rest }: Args$6) => react_jsx_runtime.JSX.Element;
57
57
  Messages: {
58
58
  ({ children, style, }: {
59
59
  children?: React.ReactNode;
@@ -338,6 +338,141 @@ declare const useMessageFormContext: () => {
338
338
  isFileLoading: boolean;
339
339
  };
340
340
 
341
+ type Args$4 = {
342
+ assistantId: string;
343
+ };
344
+ declare const useAssistant: ({ assistantId, }: Args$4) => {
345
+ assistant: any;
346
+ data: any;
347
+ error: Error;
348
+ isError: true;
349
+ isPending: false;
350
+ isLoading: false;
351
+ isLoadingError: false;
352
+ isRefetchError: true;
353
+ isSuccess: false;
354
+ status: "error";
355
+ dataUpdatedAt: number;
356
+ errorUpdatedAt: number;
357
+ failureCount: number;
358
+ failureReason: Error | null;
359
+ errorUpdateCount: number;
360
+ isFetched: boolean;
361
+ isFetchedAfterMount: boolean;
362
+ isFetching: boolean;
363
+ isInitialLoading: boolean;
364
+ isPaused: boolean;
365
+ isPlaceholderData: boolean;
366
+ isRefetching: boolean;
367
+ isStale: boolean;
368
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
369
+ fetchStatus: _tanstack_react_query.FetchStatus;
370
+ } | {
371
+ assistant: any;
372
+ data: any;
373
+ error: null;
374
+ isError: false;
375
+ isPending: false;
376
+ isLoading: false;
377
+ isLoadingError: false;
378
+ isRefetchError: false;
379
+ isSuccess: true;
380
+ status: "success";
381
+ dataUpdatedAt: number;
382
+ errorUpdatedAt: number;
383
+ failureCount: number;
384
+ failureReason: Error | null;
385
+ errorUpdateCount: number;
386
+ isFetched: boolean;
387
+ isFetchedAfterMount: boolean;
388
+ isFetching: boolean;
389
+ isInitialLoading: boolean;
390
+ isPaused: boolean;
391
+ isPlaceholderData: boolean;
392
+ isRefetching: boolean;
393
+ isStale: boolean;
394
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
395
+ fetchStatus: _tanstack_react_query.FetchStatus;
396
+ } | {
397
+ assistant: any;
398
+ data: undefined;
399
+ error: Error;
400
+ isError: true;
401
+ isPending: false;
402
+ isLoading: false;
403
+ isLoadingError: true;
404
+ isRefetchError: false;
405
+ isSuccess: false;
406
+ status: "error";
407
+ dataUpdatedAt: number;
408
+ errorUpdatedAt: number;
409
+ failureCount: number;
410
+ failureReason: Error | null;
411
+ errorUpdateCount: number;
412
+ isFetched: boolean;
413
+ isFetchedAfterMount: boolean;
414
+ isFetching: boolean;
415
+ isInitialLoading: boolean;
416
+ isPaused: boolean;
417
+ isPlaceholderData: boolean;
418
+ isRefetching: boolean;
419
+ isStale: boolean;
420
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
421
+ fetchStatus: _tanstack_react_query.FetchStatus;
422
+ } | {
423
+ assistant: any;
424
+ data: undefined;
425
+ error: null;
426
+ isError: false;
427
+ isPending: true;
428
+ isLoading: true;
429
+ isLoadingError: false;
430
+ isRefetchError: false;
431
+ isSuccess: false;
432
+ status: "pending";
433
+ dataUpdatedAt: number;
434
+ errorUpdatedAt: number;
435
+ failureCount: number;
436
+ failureReason: Error | null;
437
+ errorUpdateCount: number;
438
+ isFetched: boolean;
439
+ isFetchedAfterMount: boolean;
440
+ isFetching: boolean;
441
+ isInitialLoading: boolean;
442
+ isPaused: boolean;
443
+ isPlaceholderData: boolean;
444
+ isRefetching: boolean;
445
+ isStale: boolean;
446
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
447
+ fetchStatus: _tanstack_react_query.FetchStatus;
448
+ } | {
449
+ assistant: any;
450
+ data: undefined;
451
+ error: null;
452
+ isError: false;
453
+ isPending: true;
454
+ isLoadingError: false;
455
+ isRefetchError: false;
456
+ isSuccess: false;
457
+ status: "pending";
458
+ dataUpdatedAt: number;
459
+ errorUpdatedAt: number;
460
+ failureCount: number;
461
+ failureReason: Error | null;
462
+ errorUpdateCount: number;
463
+ isFetched: boolean;
464
+ isFetchedAfterMount: boolean;
465
+ isFetching: boolean;
466
+ isLoading: boolean;
467
+ isInitialLoading: boolean;
468
+ isPaused: boolean;
469
+ isPlaceholderData: boolean;
470
+ isRefetching: boolean;
471
+ isStale: boolean;
472
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
473
+ fetchStatus: _tanstack_react_query.FetchStatus;
474
+ };
475
+
341
476
  declare const ThreadDialog: {
342
477
  (): react_jsx_runtime.JSX.Element;
343
478
  Root: ({ children, }: {
@@ -490,6 +625,11 @@ declare const AssistantNameContext: react.Context<string>;
490
625
 
491
626
  declare const UserAvatarContext: react.Context<react_jsx_runtime.JSX.Element>;
492
627
 
628
+ declare const Avatar: ({ avatar, size, }: {
629
+ avatar: Avatar$1;
630
+ size?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
631
+ }) => react_jsx_runtime.JSX.Element;
632
+
493
633
  type FunctionComponents = {
494
634
  [key: string]: React.ReactNode;
495
635
  };
@@ -551,4 +691,4 @@ declare const RunStep: {
551
691
  };
552
692
  };
553
693
 
554
- export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
694
+ export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesPage, SerializedMessage, SerializedRunStep, ToolCall } from './types/index.js';
2
+ import { MessagesPage, SerializedMessage, Avatar as Avatar$1, SerializedRunStep, ToolCall } 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';
@@ -21,7 +21,7 @@ declare const options: {
21
21
  }) => any;
22
22
  };
23
23
 
24
- type Args$7 = {
24
+ type Args$8 = {
25
25
  children: React.ReactNode;
26
26
  baseUrl?: string;
27
27
  variables?: {
@@ -33,7 +33,7 @@ type Args$7 = {
33
33
  };
34
34
  threadIdCookieOptions?: typeof options | null;
35
35
  };
36
- declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdCookieOptions, }: Args$7) => react_jsx_runtime.JSX.Element;
36
+ declare const SuperinterfaceProvider: ({ children, baseUrl, variables, defaultOptions, threadIdCookieOptions, }: Args$8) => react_jsx_runtime.JSX.Element;
37
37
 
38
38
  declare const useSuperinterfaceContext: () => {
39
39
  baseUrl: string | null;
@@ -46,14 +46,14 @@ declare const useSuperinterfaceContext: () => {
46
46
  createMessageAbortControllerRef: React.MutableRefObject<AbortController | null>;
47
47
  };
48
48
 
49
- type Args$6 = Args$7;
49
+ type Args$7 = Args$8;
50
50
 
51
- type Args$5 = Args$6;
51
+ type Args$6 = Args$7;
52
52
 
53
- type Args$4 = Omit<Args$5, 'children'>;
53
+ type Args$5 = Omit<Args$6, 'children'>;
54
54
  declare const Thread: {
55
- (props: Args$4): react_jsx_runtime.JSX.Element;
56
- Root: ({ children, ...rest }: Args$5) => react_jsx_runtime.JSX.Element;
55
+ (props: Args$5): react_jsx_runtime.JSX.Element;
56
+ Root: ({ children, ...rest }: Args$6) => react_jsx_runtime.JSX.Element;
57
57
  Messages: {
58
58
  ({ children, style, }: {
59
59
  children?: React.ReactNode;
@@ -338,6 +338,141 @@ declare const useMessageFormContext: () => {
338
338
  isFileLoading: boolean;
339
339
  };
340
340
 
341
+ type Args$4 = {
342
+ assistantId: string;
343
+ };
344
+ declare const useAssistant: ({ assistantId, }: Args$4) => {
345
+ assistant: any;
346
+ data: any;
347
+ error: Error;
348
+ isError: true;
349
+ isPending: false;
350
+ isLoading: false;
351
+ isLoadingError: false;
352
+ isRefetchError: true;
353
+ isSuccess: false;
354
+ status: "error";
355
+ dataUpdatedAt: number;
356
+ errorUpdatedAt: number;
357
+ failureCount: number;
358
+ failureReason: Error | null;
359
+ errorUpdateCount: number;
360
+ isFetched: boolean;
361
+ isFetchedAfterMount: boolean;
362
+ isFetching: boolean;
363
+ isInitialLoading: boolean;
364
+ isPaused: boolean;
365
+ isPlaceholderData: boolean;
366
+ isRefetching: boolean;
367
+ isStale: boolean;
368
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
369
+ fetchStatus: _tanstack_react_query.FetchStatus;
370
+ } | {
371
+ assistant: any;
372
+ data: any;
373
+ error: null;
374
+ isError: false;
375
+ isPending: false;
376
+ isLoading: false;
377
+ isLoadingError: false;
378
+ isRefetchError: false;
379
+ isSuccess: true;
380
+ status: "success";
381
+ dataUpdatedAt: number;
382
+ errorUpdatedAt: number;
383
+ failureCount: number;
384
+ failureReason: Error | null;
385
+ errorUpdateCount: number;
386
+ isFetched: boolean;
387
+ isFetchedAfterMount: boolean;
388
+ isFetching: boolean;
389
+ isInitialLoading: boolean;
390
+ isPaused: boolean;
391
+ isPlaceholderData: boolean;
392
+ isRefetching: boolean;
393
+ isStale: boolean;
394
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
395
+ fetchStatus: _tanstack_react_query.FetchStatus;
396
+ } | {
397
+ assistant: any;
398
+ data: undefined;
399
+ error: Error;
400
+ isError: true;
401
+ isPending: false;
402
+ isLoading: false;
403
+ isLoadingError: true;
404
+ isRefetchError: false;
405
+ isSuccess: false;
406
+ status: "error";
407
+ dataUpdatedAt: number;
408
+ errorUpdatedAt: number;
409
+ failureCount: number;
410
+ failureReason: Error | null;
411
+ errorUpdateCount: number;
412
+ isFetched: boolean;
413
+ isFetchedAfterMount: boolean;
414
+ isFetching: boolean;
415
+ isInitialLoading: boolean;
416
+ isPaused: boolean;
417
+ isPlaceholderData: boolean;
418
+ isRefetching: boolean;
419
+ isStale: boolean;
420
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
421
+ fetchStatus: _tanstack_react_query.FetchStatus;
422
+ } | {
423
+ assistant: any;
424
+ data: undefined;
425
+ error: null;
426
+ isError: false;
427
+ isPending: true;
428
+ isLoading: true;
429
+ isLoadingError: false;
430
+ isRefetchError: false;
431
+ isSuccess: false;
432
+ status: "pending";
433
+ dataUpdatedAt: number;
434
+ errorUpdatedAt: number;
435
+ failureCount: number;
436
+ failureReason: Error | null;
437
+ errorUpdateCount: number;
438
+ isFetched: boolean;
439
+ isFetchedAfterMount: boolean;
440
+ isFetching: boolean;
441
+ isInitialLoading: boolean;
442
+ isPaused: boolean;
443
+ isPlaceholderData: boolean;
444
+ isRefetching: boolean;
445
+ isStale: boolean;
446
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
447
+ fetchStatus: _tanstack_react_query.FetchStatus;
448
+ } | {
449
+ assistant: any;
450
+ data: undefined;
451
+ error: null;
452
+ isError: false;
453
+ isPending: true;
454
+ isLoadingError: false;
455
+ isRefetchError: false;
456
+ isSuccess: false;
457
+ status: "pending";
458
+ dataUpdatedAt: number;
459
+ errorUpdatedAt: number;
460
+ failureCount: number;
461
+ failureReason: Error | null;
462
+ errorUpdateCount: number;
463
+ isFetched: boolean;
464
+ isFetchedAfterMount: boolean;
465
+ isFetching: boolean;
466
+ isLoading: boolean;
467
+ isInitialLoading: boolean;
468
+ isPaused: boolean;
469
+ isPlaceholderData: boolean;
470
+ isRefetching: boolean;
471
+ isStale: boolean;
472
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
473
+ fetchStatus: _tanstack_react_query.FetchStatus;
474
+ };
475
+
341
476
  declare const ThreadDialog: {
342
477
  (): react_jsx_runtime.JSX.Element;
343
478
  Root: ({ children, }: {
@@ -490,6 +625,11 @@ declare const AssistantNameContext: react.Context<string>;
490
625
 
491
626
  declare const UserAvatarContext: react.Context<react_jsx_runtime.JSX.Element>;
492
627
 
628
+ declare const Avatar: ({ avatar, size, }: {
629
+ avatar: Avatar$1;
630
+ size?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
631
+ }) => react_jsx_runtime.JSX.Element;
632
+
493
633
  type FunctionComponents = {
494
634
  [key: string]: React.ReactNode;
495
635
  };
@@ -551,4 +691,4 @@ declare const RunStep: {
551
691
  };
552
692
  };
553
693
 
554
- export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
694
+ export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, Avatar, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useAssistant, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };