@1interface/chat-core 0.16.0 → 0.17.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.ts CHANGED
@@ -4,6 +4,7 @@ import { ActionCreatorWithoutPayload } from '@reduxjs/toolkit';
4
4
  import { Api } from '@reduxjs/toolkit/query';
5
5
  import { AppBrandingResponse } from '@1interface/shared-core';
6
6
  import { AppResponse } from '@1interface/shared-core';
7
+ import { AttachedDocument } from '@1interface/shared-core';
7
8
  import { AuthApiResult } from '@1interface/shared-core';
8
9
  import { AuthState } from '@1interface/shared-core';
9
10
  import { BaseQueryFn } from '@reduxjs/toolkit/query';
@@ -22,6 +23,7 @@ import { LoggerContextProvider } from '@1interface/shared-core';
22
23
  import { LogoutRequest } from '@1interface/shared-core';
23
24
  import { Message } from '@1interface/shared-core';
24
25
  import { Middleware } from '@reduxjs/toolkit';
26
+ import { ModelContextPart } from '@1interface/shared-core';
25
27
  import { MutableRefObject } from 'react';
26
28
  import { MutationActionCreatorResult } from '@reduxjs/toolkit/query';
27
29
  import { MutationDefinition } from '@reduxjs/toolkit/query';
@@ -38,6 +40,7 @@ import { Reducer } from '@reduxjs/toolkit';
38
40
  import { RefObject } from 'react';
39
41
  import { RefreshApiResult } from '@1interface/shared-core';
40
42
  import { RefreshRequest } from '@1interface/shared-core';
43
+ import { RequestDocumentsPayload } from '@1interface/shared-core';
41
44
  import { ResendVerificationRequest } from '@1interface/shared-core';
42
45
  import { ResetPasswordRequest } from '@1interface/shared-core';
43
46
  import { RootState as RootState_2 } from '@reduxjs/toolkit/query';
@@ -449,6 +452,12 @@ text: string;
449
452
  queuedAt: string;
450
453
  transcriptionIds?: string[];
451
454
  messageType?: string[];
455
+ documents?: {
456
+ document_id: string;
457
+ filename: string;
458
+ mime_type: string;
459
+ size_bytes: number;
460
+ }[];
452
461
  }[];
453
462
  pendingTranscriptionIds: string[];
454
463
  };
@@ -546,6 +555,12 @@ text: string;
546
555
  queuedAt: string;
547
556
  transcriptionIds?: string[];
548
557
  messageType?: string[];
558
+ documents?: {
559
+ document_id: string;
560
+ filename: string;
561
+ mime_type: string;
562
+ size_bytes: number;
563
+ }[];
549
564
  }[];
550
565
  pendingTranscriptionIds: string[];
551
566
  };
@@ -679,6 +694,12 @@ text: string;
679
694
  queuedAt: string;
680
695
  transcriptionIds?: string[];
681
696
  messageType?: string[];
697
+ documents?: {
698
+ document_id: string;
699
+ filename: string;
700
+ mime_type: string;
701
+ size_bytes: number;
702
+ }[];
682
703
  }[];
683
704
  pendingTranscriptionIds: string[];
684
705
  }>;
@@ -716,6 +737,7 @@ export declare interface ClientConfig {
716
737
  conversations: ConversationsConfig;
717
738
  voice_agent: VoiceAgentConfig;
718
739
  stt: SttConfig;
740
+ documents: DocumentsConfig;
719
741
  features?: string[];
720
742
  backend_version?: string;
721
743
  panel_switcher_enabled?: boolean;
@@ -800,6 +822,12 @@ export declare const DEFAULT_PROTOCOL: ProtocolType;
800
822
 
801
823
  export declare const dequeueMessage: ActionCreatorWithoutPayload<"chat/dequeueMessage">;
802
824
 
825
+ export declare interface DocumentsConfig {
826
+ max_bytes: number;
827
+ max_documents: number;
828
+ allowed_mime_types: string[] | null;
829
+ }
830
+
803
831
  export declare type DocumentUploadFile = File | Blob | {
804
832
  uri: string;
805
833
  name: string;
@@ -957,13 +985,15 @@ export declare type NormalizedEventData = {
957
985
  payment: PaymentInitPayload;
958
986
  } | {
959
987
  signIn: SignInInitPayload;
988
+ } | {
989
+ requestDocuments: RequestDocumentsPayload;
960
990
  } | {
961
991
  conversationTitle: string;
962
992
  } | {
963
993
  isEnd: true;
964
994
  };
965
995
 
966
- export declare type NormalizedEventType = 'text' | 'error' | 'widget' | 'status_update' | 'payment' | 'sign_in' | 'conversation_title' | 'stream_end';
996
+ export declare type NormalizedEventType = 'text' | 'error' | 'widget' | 'status_update' | 'payment' | 'sign_in' | 'request_documents' | 'conversation_title' | 'stream_end';
967
997
 
968
998
  export declare const OAUTH_ERROR_TYPE: "OAUTH_ERROR";
969
999
 
@@ -1094,6 +1124,7 @@ export declare interface QueuedMessage {
1094
1124
  queuedAt: string;
1095
1125
  transcriptionIds?: string[];
1096
1126
  messageType?: string[];
1127
+ documents?: AttachedDocument[];
1097
1128
  }
1098
1129
 
1099
1130
  export declare function refreshTokenApi(payload: RefreshRequest): Promise<RefreshApiResult>;
@@ -1118,6 +1149,7 @@ declare type SendMessageFn_3 = (text?: string) => Promise<void>;
1118
1149
 
1119
1150
  export declare interface SendMessageOptions {
1120
1151
  messageType?: string[];
1152
+ documents?: AttachedDocument[];
1121
1153
  }
1122
1154
 
1123
1155
  export declare const serializableCheck: {
@@ -1151,6 +1183,7 @@ export declare enum SSEEventType {
1151
1183
  CLEAR_STATUS = "clear_status",
1152
1184
  PAYMENT = "payment",
1153
1185
  SIGN_IN = "sign_in",
1186
+ REQUEST_DOCUMENTS = "request_documents",
1154
1187
  CONVERSATION_TITLE = "conversation_title",
1155
1188
  END = "end"
1156
1189
  }
@@ -1195,6 +1228,12 @@ text: string;
1195
1228
  queuedAt: string;
1196
1229
  transcriptionIds?: string[];
1197
1230
  messageType?: string[];
1231
+ documents?: {
1232
+ document_id: string;
1233
+ filename: string;
1234
+ mime_type: string;
1235
+ size_bytes: number;
1236
+ }[];
1198
1237
  }[];
1199
1238
  pendingTranscriptionIds: string[];
1200
1239
  };
@@ -1293,6 +1332,12 @@ text: string;
1293
1332
  queuedAt: string;
1294
1333
  transcriptionIds?: string[];
1295
1334
  messageType?: string[];
1335
+ documents?: {
1336
+ document_id: string;
1337
+ filename: string;
1338
+ mime_type: string;
1339
+ size_bytes: number;
1340
+ }[];
1296
1341
  }[];
1297
1342
  pendingTranscriptionIds: string[];
1298
1343
  };
@@ -1404,6 +1449,7 @@ export declare interface StreamMessageParams {
1404
1449
  enableTts?: boolean;
1405
1450
  debugMode?: boolean;
1406
1451
  transcriptionIds?: string[];
1452
+ modelContext?: ModelContextPart[];
1407
1453
  body?: Record<string, unknown>;
1408
1454
  }
1409
1455
 
@@ -1470,7 +1516,7 @@ export declare const useAuth: () => {
1470
1516
 
1471
1517
  export declare const useChatCallbacks: () => ChatCallbacks;
1472
1518
 
1473
- export declare const useChatConnection: ({ conversationId, messages, setMessages, enableTts, userLocation, startSession, debugMode, onPaymentInit, onSignInInit, onConversationTitle, }: UseChatConnectionParams) => UseChatConnectionReturn;
1519
+ export declare const useChatConnection: ({ conversationId, messages, setMessages, enableTts, userLocation, startSession, debugMode, onPaymentInit, onSignInInit, onRequestDocuments, onConversationTitle, }: UseChatConnectionParams) => UseChatConnectionReturn;
1474
1520
 
1475
1521
  declare interface UseChatConnectionParams {
1476
1522
  conversationId: string | null;
@@ -1482,6 +1528,7 @@ declare interface UseChatConnectionParams {
1482
1528
  debugMode?: boolean;
1483
1529
  onPaymentInit?: (init: PaymentInitPayload) => void;
1484
1530
  onSignInInit?: (init: SignInInitPayload) => void;
1531
+ onRequestDocuments?: (payload: RequestDocumentsPayload) => void;
1485
1532
  onConversationTitle?: (title: string) => void;
1486
1533
  }
1487
1534
 
@@ -1514,11 +1561,12 @@ declare interface UseChatHistoryParams {
1514
1561
  onClearChat?: () => void;
1515
1562
  }
1516
1563
 
1517
- export declare const useChatInput: ({ onSend, disabled, transcribedText, onTranscribedTextUsed, isRecording, isTranscribing, }: UseChatInputParams) => UseChatInputResult;
1564
+ export declare const useChatInput: ({ onSend, disabled, hasAttachments, transcribedText, onTranscribedTextUsed, isRecording, isTranscribing, }: UseChatInputParams) => UseChatInputResult;
1518
1565
 
1519
1566
  export declare interface UseChatInputParams {
1520
1567
  onSend: (text: string) => void;
1521
1568
  disabled?: boolean;
1569
+ hasAttachments?: boolean;
1522
1570
  transcribedText?: string | null;
1523
1571
  onTranscribedTextUsed?: () => void;
1524
1572
  isRecording?: boolean;