@smartspace/chat-ui 1.14.4-dev.4d23cd2 → 1.14.4-dev.5b11afb

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
@@ -319,6 +319,8 @@ type Message = {
319
319
  message?: string | null;
320
320
  data?: string | null;
321
321
  blockId?: string | null;
322
+ /** Trace id of the request that recorded the error, for a support reference. */
323
+ traceId?: string | null;
322
324
  }[] | null;
323
325
  values?: MessageValue[] | null;
324
326
  optimistic?: boolean;
@@ -449,7 +451,6 @@ interface ChatService {
449
451
  uploadFiles(files: File[], scope: FileScope, onFileUploaded?: (file: File, fileInfo: FileInfo$1) => void, onChunkUploaded?: (chunkIndex: number, totalChunks: number, file: File) => void): Promise<FileInfo$1[]>;
450
452
  downloadFile(id: string, scope?: FileScope): Promise<Blob>;
451
453
  getFileInfo(id: string, scope: FileScope): Promise<FileInfo$1>;
452
- getFileDownloadUrl(sourceUri: string): Promise<string>;
453
454
  fetchThread(workspaceId: string, threadId: string): Promise<MessageThread>;
454
455
  fetchWorkspace(workspaceId: string): Promise<Workspace>;
455
456
  fetchTaggableUsers(workspaceId: string): Promise<MentionUser[]>;
@@ -546,6 +547,7 @@ declare const messagesResponseSchema: z.ZodObject<{
546
547
  data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
547
548
  errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
549
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
550
+ traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
549
551
  }, z.core.$strip>>;
550
552
  hasComments: z.ZodBoolean;
551
553
  id: z.ZodString;
@@ -557,10 +559,7 @@ declare const messagesResponseSchema: z.ZodObject<{
557
559
  createdByUserId: z.ZodString;
558
560
  id: z.ZodString;
559
561
  name: z.ZodString;
560
- type: z.ZodEnum<{
561
- Input: "Input";
562
- Output: "Output";
563
- }>;
562
+ type: z.ZodString;
564
563
  value: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
565
564
  }, z.core.$strip>>;
566
565
  }, z.core.$strip>>;
@@ -576,6 +575,8 @@ type MessageErrorDto = NonNullable<MessageDto['errors']>[number] & {
576
575
  };
577
576
  type MessageError = NonNullable<Message['errors']>[number];
578
577
  declare function mapMessageValueDtoToModel(dto: MessageValueDto): MessageValue;
578
+ /** `type` is an extensible enum; a value this UI cannot place is dropped. */
579
+ declare const mapMessageValuesDtoToModels: (dtos: MessageValueDto[]) => MessageValue[];
579
580
  declare function mapMessageErrorDtoToModel(dto: MessageErrorDto): MessageError;
580
581
  declare function mapMessageDtoToModel(dto: MessageDto): Message;
581
582
  declare function mapMessagesDtoToModels(dto: MessageDto[]): Message[];
@@ -597,7 +598,7 @@ declare function applyDeltaToMessage(target: Message, delta: {
597
598
  /**
598
599
  * User-facing text for message errors.
599
600
  *
600
- * The backend attaches a stable machine-readable category to LLM failures
601
+ * The backend attaches a stable machine-readable category to failures
601
602
  * (`errorCode`, e.g. "llm.rate_limit") alongside the numeric HTTP `code`.
602
603
  * Prefer the category — it distinguishes causes the HTTP code can't (a 400
603
604
  * can be a content filter, a context-window blowout, or a malformed
@@ -776,11 +777,7 @@ declare const workspaceResponseSchema: z.ZodObject<{
776
777
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
777
778
  }, z.core.$strip>>>>;
778
779
  variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
779
- access: z.ZodEnum<{
780
- None: "None";
781
- Read: "Read";
782
- Write: "Write";
783
- }>;
780
+ access: z.ZodString;
784
781
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
785
782
  }, z.core.$strip>>>>;
786
783
  }, z.core.$strip>>;
@@ -803,10 +800,7 @@ declare const workspaceResponseSchema: z.ZodObject<{
803
800
  honourSourceDeletes: z.ZodBoolean;
804
801
  id: z.ZodString;
805
802
  inputName: z.ZodString;
806
- type: z.ZodEnum<{
807
- Periodic: "Periodic";
808
- Container: "Container";
809
- }>;
803
+ type: z.ZodString;
810
804
  }, z.core.$strip>>;
811
805
  }, z.core.$strip>>;
812
806
  id: z.ZodString;
@@ -851,13 +845,7 @@ declare const workspaceResponseSchema: z.ZodObject<{
851
845
  providerDeploymentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
852
846
  providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
853
847
  region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
854
- status: z.ZodEnum<{
855
- Deploying: "Deploying";
856
- Ready: "Ready";
857
- Failed: "Failed";
858
- Deleting: "Deleting";
859
- Deleted: "Deleted";
860
- }>;
848
+ status: z.ZodString;
861
849
  statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
862
850
  statusUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
863
851
  steps: z.ZodArray<z.ZodObject<{
@@ -865,68 +853,52 @@ declare const workspaceResponseSchema: z.ZodObject<{
865
853
  id: z.ZodString;
866
854
  index: z.ZodNumber;
867
855
  message: z.ZodString;
868
- name: z.ZodEnum<{
869
- DeployVNet: "DeployVNet";
870
- DeployVM: "DeployVM";
871
- InstallDependencies: "InstallDependencies";
872
- DownloadModel: "DownloadModel";
873
- TestModel: "TestModel";
874
- }>;
856
+ name: z.ZodString;
875
857
  progress: z.ZodNumber;
876
858
  startedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
877
859
  }, z.core.$strip>>;
878
860
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
879
- virtualMachineServerType: z.ZodOptional<z.ZodEnum<{
880
- TextGenerationInference: "TextGenerationInference";
881
- VLlm: "VLlm";
882
- }>>;
861
+ virtualMachineServerType: z.ZodOptional<z.ZodString>;
883
862
  virtualMachineUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
884
863
  vmSize: z.ZodOptional<z.ZodNullable<z.ZodString>>;
885
864
  }, z.core.$strip>>;
886
865
  displayName: z.ZodString;
887
866
  id: z.ZodString;
888
- modelDeploymentProviderType: z.ZodOptional<z.ZodEnum<{
889
- OpenAi: "OpenAi";
890
- AzureOpenAi: "AzureOpenAi";
891
- HuggingFace: "HuggingFace";
892
- Cohere: "Cohere";
893
- Anthropic: "Anthropic";
894
- Gemini: "Gemini";
895
- VertexAi: "VertexAi";
896
- AzureFoundry: "AzureFoundry";
897
- }>>;
898
- modelPublisher: z.ZodOptional<z.ZodEnum<{
899
- OpenAi: "OpenAi";
900
- HuggingFace: "HuggingFace";
901
- Cohere: "Cohere";
902
- Anthropic: "Anthropic";
903
- Google: "Google";
904
- Meta: "Meta";
905
- Mistral: "Mistral";
906
- Microsoft: "Microsoft";
907
- DeepSeek: "DeepSeek";
908
- XAi: "XAi";
909
- Amazon: "Amazon";
910
- Qwen: "Qwen";
911
- Other: "Other";
912
- }>>;
867
+ modelDeploymentProviderType: z.ZodOptional<z.ZodString>;
868
+ modelPublisher: z.ZodOptional<z.ZodString>;
913
869
  name: z.ZodString;
914
- properties: z.ZodArray<z.ZodObject<{
870
+ properties: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
871
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
872
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
873
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
915
874
  name: z.ZodString;
875
+ step: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
916
876
  type: z.ZodEnum<{
917
877
  Boolean: "Boolean";
878
+ }>;
879
+ }, z.core.$strip>, z.ZodObject<{
880
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
881
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
882
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
883
+ name: z.ZodString;
884
+ step: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
885
+ type: z.ZodEnum<{
918
886
  Number: "Number";
887
+ }>;
888
+ }, z.core.$strip>, z.ZodObject<{
889
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
890
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
891
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
892
+ name: z.ZodString;
893
+ step: z.ZodOptional<z.ZodNullable<z.ZodString>>;
894
+ type: z.ZodEnum<{
919
895
  String: "String";
920
896
  }>;
921
- }, z.core.$strip>>;
897
+ }, z.core.$strip>]>>;
922
898
  }, z.core.$strip>;
923
899
  prePrompt: z.ZodString;
924
900
  presencePenalty: z.ZodNumber;
925
- role: z.ZodEnum<{
926
- Document: "Document";
927
- Agent: "Agent";
928
- Analyzer: "Analyzer";
929
- }>;
901
+ role: z.ZodString;
930
902
  temperature: z.ZodNumber;
931
903
  topP: z.ZodNumber;
932
904
  }, z.core.$strip>>;
@@ -940,11 +912,7 @@ declare const workspaceResponseSchema: z.ZodObject<{
940
912
  supportsFiles: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
941
913
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
942
914
  variables: z.ZodRecord<z.ZodString, z.ZodObject<{
943
- access: z.ZodEnum<{
944
- None: "None";
945
- Read: "Read";
946
- Write: "Write";
947
- }>;
915
+ access: z.ZodString;
948
916
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
949
917
  }, z.core.$strip>>;
950
918
  }, z.core.$strip>;
@@ -1019,11 +987,7 @@ declare const workspacesListResponseSchema: z.ZodObject<{
1019
987
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
1020
988
  }, z.core.$strip>>>>;
1021
989
  variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
1022
- access: z.ZodEnum<{
1023
- None: "None";
1024
- Read: "Read";
1025
- Write: "Write";
1026
- }>;
990
+ access: z.ZodString;
1027
991
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
1028
992
  }, z.core.$strip>>>>;
1029
993
  }, z.core.$strip>>;
@@ -1046,10 +1010,7 @@ declare const workspacesListResponseSchema: z.ZodObject<{
1046
1010
  honourSourceDeletes: z.ZodBoolean;
1047
1011
  id: z.ZodString;
1048
1012
  inputName: z.ZodString;
1049
- type: z.ZodEnum<{
1050
- Periodic: "Periodic";
1051
- Container: "Container";
1052
- }>;
1013
+ type: z.ZodString;
1053
1014
  }, z.core.$strip>>;
1054
1015
  }, z.core.$strip>>;
1055
1016
  id: z.ZodString;
@@ -1094,13 +1055,7 @@ declare const workspacesListResponseSchema: z.ZodObject<{
1094
1055
  providerDeploymentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1095
1056
  providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1096
1057
  region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1097
- status: z.ZodEnum<{
1098
- Deploying: "Deploying";
1099
- Ready: "Ready";
1100
- Failed: "Failed";
1101
- Deleting: "Deleting";
1102
- Deleted: "Deleted";
1103
- }>;
1058
+ status: z.ZodString;
1104
1059
  statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1105
1060
  statusUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1106
1061
  steps: z.ZodArray<z.ZodObject<{
@@ -1108,68 +1063,52 @@ declare const workspacesListResponseSchema: z.ZodObject<{
1108
1063
  id: z.ZodString;
1109
1064
  index: z.ZodNumber;
1110
1065
  message: z.ZodString;
1111
- name: z.ZodEnum<{
1112
- DeployVNet: "DeployVNet";
1113
- DeployVM: "DeployVM";
1114
- InstallDependencies: "InstallDependencies";
1115
- DownloadModel: "DownloadModel";
1116
- TestModel: "TestModel";
1117
- }>;
1066
+ name: z.ZodString;
1118
1067
  progress: z.ZodNumber;
1119
1068
  startedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1120
1069
  }, z.core.$strip>>;
1121
1070
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1122
- virtualMachineServerType: z.ZodOptional<z.ZodEnum<{
1123
- TextGenerationInference: "TextGenerationInference";
1124
- VLlm: "VLlm";
1125
- }>>;
1071
+ virtualMachineServerType: z.ZodOptional<z.ZodString>;
1126
1072
  virtualMachineUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1127
1073
  vmSize: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1128
1074
  }, z.core.$strip>>;
1129
1075
  displayName: z.ZodString;
1130
1076
  id: z.ZodString;
1131
- modelDeploymentProviderType: z.ZodOptional<z.ZodEnum<{
1132
- OpenAi: "OpenAi";
1133
- AzureOpenAi: "AzureOpenAi";
1134
- HuggingFace: "HuggingFace";
1135
- Cohere: "Cohere";
1136
- Anthropic: "Anthropic";
1137
- Gemini: "Gemini";
1138
- VertexAi: "VertexAi";
1139
- AzureFoundry: "AzureFoundry";
1140
- }>>;
1141
- modelPublisher: z.ZodOptional<z.ZodEnum<{
1142
- OpenAi: "OpenAi";
1143
- HuggingFace: "HuggingFace";
1144
- Cohere: "Cohere";
1145
- Anthropic: "Anthropic";
1146
- Google: "Google";
1147
- Meta: "Meta";
1148
- Mistral: "Mistral";
1149
- Microsoft: "Microsoft";
1150
- DeepSeek: "DeepSeek";
1151
- XAi: "XAi";
1152
- Amazon: "Amazon";
1153
- Qwen: "Qwen";
1154
- Other: "Other";
1155
- }>>;
1077
+ modelDeploymentProviderType: z.ZodOptional<z.ZodString>;
1078
+ modelPublisher: z.ZodOptional<z.ZodString>;
1156
1079
  name: z.ZodString;
1157
- properties: z.ZodArray<z.ZodObject<{
1080
+ properties: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1081
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1082
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1083
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1158
1084
  name: z.ZodString;
1085
+ step: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1159
1086
  type: z.ZodEnum<{
1160
1087
  Boolean: "Boolean";
1088
+ }>;
1089
+ }, z.core.$strip>, z.ZodObject<{
1090
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1091
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1092
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1093
+ name: z.ZodString;
1094
+ step: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1095
+ type: z.ZodEnum<{
1161
1096
  Number: "Number";
1097
+ }>;
1098
+ }, z.core.$strip>, z.ZodObject<{
1099
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1100
+ maxValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1101
+ minValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1102
+ name: z.ZodString;
1103
+ step: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1104
+ type: z.ZodEnum<{
1162
1105
  String: "String";
1163
1106
  }>;
1164
- }, z.core.$strip>>;
1107
+ }, z.core.$strip>]>>;
1165
1108
  }, z.core.$strip>;
1166
1109
  prePrompt: z.ZodString;
1167
1110
  presencePenalty: z.ZodNumber;
1168
- role: z.ZodEnum<{
1169
- Document: "Document";
1170
- Agent: "Agent";
1171
- Analyzer: "Analyzer";
1172
- }>;
1111
+ role: z.ZodString;
1173
1112
  temperature: z.ZodNumber;
1174
1113
  topP: z.ZodNumber;
1175
1114
  }, z.core.$strip>>;
@@ -1183,11 +1122,7 @@ declare const workspacesListResponseSchema: z.ZodObject<{
1183
1122
  supportsFiles: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1184
1123
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1185
1124
  variables: z.ZodRecord<z.ZodString, z.ZodObject<{
1186
- access: z.ZodEnum<{
1187
- None: "None";
1188
- Read: "Read";
1189
- Write: "Write";
1190
- }>;
1125
+ access: z.ZodString;
1191
1126
  schema: z.ZodRecord<z.ZodString, z.ZodAny>;
1192
1127
  }, z.core.$strip>>;
1193
1128
  }, z.core.$strip>>;
@@ -1320,9 +1255,6 @@ declare const filesKeys: {
1320
1255
  downloadBlob: (fileId: string) => readonly ["files", "mutation", "downloadBlob", {
1321
1256
  readonly fileId: string;
1322
1257
  }];
1323
- downloadByUri: (uri: string) => readonly ["files", "mutation", "downloadByUri", {
1324
- readonly uri: string;
1325
- }];
1326
1258
  };
1327
1259
  };
1328
1260
 
@@ -1418,10 +1350,6 @@ declare function useMessages(threadId: string): _tanstack_react_query.UseQueryRe
1418
1350
  declare const useFileMutations: (scope: FileScope) => {
1419
1351
  uploadFilesMutation: _tanstack_react_query.UseMutationResult<FileInfo$1[], Error, File[], unknown>;
1420
1352
  downloadFileMutation: _tanstack_react_query.UseMutationResult<void, Error, FileInfo$1, unknown>;
1421
- downloadFileByUriMutation: _tanstack_react_query.UseMutationResult<Blob, Error, {
1422
- name: string;
1423
- sourceUri: string;
1424
- }, unknown>;
1425
1353
  getFileBlobUrl: (id: string) => Promise<string>;
1426
1354
  fileProgress: Record<string, number>;
1427
1355
  uploadedFiles: FileInfo$1[];
@@ -1576,4 +1504,4 @@ declare function useModels({ search, take, skip, }?: {
1576
1504
  */
1577
1505
  declare function useSpeechConfig(): _tanstack_react_query.UseQueryResult<SpeechConfig, Error>;
1578
1506
 
1579
- export { type ChatContextIds, type ChatIdentity, ChatProvider, type ChatProviderProps, type ChatService, ChatVariablesForm, DRAFT_THREAD_PREFIX, DateFromApi, DictationButton, type DictationButtonProps, type DictationError, type DictationState, type FileInfo$1 as FileInfo, type FileScope, type FlowRunVariables, MarkdownEditor, type MarkdownEditorHandle, type MentionUser, type Message, MessageComposer, type MessageComposerProps, type MessageContentItem, type MessageError, type MessageErrorLike, MessageList, type MessageListProps, MessageListSkeleton, MessageMarkdown, type MessageThread, type MessageValue, MessageValueType, type Model, type ModelProperty, NEW_THREAD_ID, type RetryStatus, type SpeechConfig, type SpeechToken, THREAD_LIST_PAGE_SIZE, type ThreadsResponse, type UseDictationOptions, type Variables, type Workspace, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getMessageErrorDetail, getMessageErrorText, getModelIcon, getRetryStatusText, getThreadPlaceholderFromListCache, getUserPhotoUrl, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, parseDateTime, parseDateTimeHuman, parseRetryStatus, randomUUID, setThreadOptimisticRunning, setThreadRunningInLists, speechKeys, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDictation, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useIsDraftThreadId, useMessages, useModels, useSendMessage, useSpeechConfig, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, utcDate, workspaceDetailOptions, workspaceKeys };
1507
+ export { type ChatContextIds, type ChatIdentity, ChatProvider, type ChatProviderProps, type ChatService, ChatVariablesForm, DRAFT_THREAD_PREFIX, DateFromApi, DictationButton, type DictationButtonProps, type DictationError, type DictationState, type FileInfo$1 as FileInfo, type FileScope, type FlowRunVariables, MarkdownEditor, type MarkdownEditorHandle, type MentionUser, type Message, MessageComposer, type MessageComposerProps, type MessageContentItem, type MessageError, type MessageErrorLike, MessageList, type MessageListProps, MessageListSkeleton, MessageMarkdown, type MessageThread, type MessageValue, MessageValueType, type Model, type ModelProperty, NEW_THREAD_ID, type RetryStatus, type SpeechConfig, type SpeechToken, THREAD_LIST_PAGE_SIZE, type ThreadsResponse, type UseDictationOptions, type Variables, type Workspace, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getMessageErrorDetail, getMessageErrorText, getModelIcon, getRetryStatusText, getThreadPlaceholderFromListCache, getUserPhotoUrl, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessageValuesDtoToModels, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, parseDateTime, parseDateTimeHuman, parseRetryStatus, randomUUID, setThreadOptimisticRunning, setThreadRunningInLists, speechKeys, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDictation, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useIsDraftThreadId, useMessages, useModels, useSendMessage, useSpeechConfig, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, utcDate, workspaceDetailOptions, workspaceKeys };
package/dist/index.js CHANGED
@@ -115,8 +115,7 @@ var filesKeys = {
115
115
  mutation: {
116
116
  upload: (scope) => [...filesKeys.mutations(), "upload", { scope }],
117
117
  download: (fileId) => [...filesKeys.mutations(), "download", { fileId }],
118
- downloadBlob: (fileId) => [...filesKeys.mutations(), "downloadBlob", { fileId }],
119
- downloadByUri: (uri) => [...filesKeys.mutations(), "downloadByUri", { uri }]
118
+ downloadBlob: (fileId) => [...filesKeys.mutations(), "downloadBlob", { fileId }]
120
119
  }
121
120
  };
122
121
 
@@ -163,20 +162,6 @@ var useFileMutations = (scope) => {
163
162
  },
164
163
  onError: () => toast.error("Failed to download file")
165
164
  });
166
- const downloadFileByUriMutation = useMutation({
167
- mutationFn: async ({
168
- name,
169
- sourceUri
170
- }) => {
171
- const uri = await service.getFileDownloadUrl(sourceUri);
172
- if (!uri) throw new Error("No download URL");
173
- const response = await fetch(uri);
174
- const blob = await response.blob();
175
- saveFile(blob, name);
176
- return blob;
177
- },
178
- onError: () => toast.error("Failed to download file")
179
- });
180
165
  const fileStates = (files) => files.map((file) => ({
181
166
  name: file.name,
182
167
  progress: fileProgress[file.name] ?? 0,
@@ -200,7 +185,6 @@ var useFileMutations = (scope) => {
200
185
  return {
201
186
  uploadFilesMutation,
202
187
  downloadFileMutation,
203
- downloadFileByUriMutation,
204
188
  getFileBlobUrl,
205
189
  fileProgress,
206
190
  uploadedFiles,
@@ -2620,7 +2604,8 @@ function kickOff(fn) {
2620
2604
  var isSupported = () => typeof window !== "undefined" && window.isSecureContext && !!navigator.mediaDevices?.getUserMedia;
2621
2605
  function classifyTokenFailure(error) {
2622
2606
  const code3 = error?.code;
2623
- if (code3 === "SP500") return "unavailable";
2607
+ if (code3 === "speech.identity_misconfigured" || code3 === "SP500")
2608
+ return "unavailable";
2624
2609
  if (error?.type === "NotFound") {
2625
2610
  return "unavailable";
2626
2611
  }
@@ -19626,7 +19611,20 @@ var ERROR_CODE_TEXT = {
19626
19611
  "llm.content_policy": "\u26A0\uFE0F **The response was blocked by a content filter**\n\nPlease rephrase your request.",
19627
19612
  "llm.schema_validation": "\u26A0\uFE0F **The model returned an invalid response**\n\nPlease try again.",
19628
19613
  "llm.unsupported_modality": "\u26A0\uFE0F **This model can't read images**\n\nSwitch to a vision-capable model, or remove the attachment and describe it instead.",
19629
- "llm.unknown": GENERIC_ERROR_TEXT
19614
+ "llm.unknown": GENERIC_ERROR_TEXT,
19615
+ // The AI API's current names for the two above; older messages stored those.
19616
+ "llm.auth_failed": "\u26A0\uFE0F **The model connection isn't authorised**\n\nAn administrator needs to check the model configuration.",
19617
+ "llm.provider_error": GENERIC_ERROR_TEXT,
19618
+ "llm.unsupported_tools": "\u26A0\uFE0F **This model can't use tools**\n\nAn administrator needs to choose a model that supports tools for this step.",
19619
+ // Managed secrets. A secret's failure arrives as a 404 or 400, which the
19620
+ // status table below would read as a missing model or a generic error.
19621
+ "secret.user_value_not_set": "\u26A0\uFE0F **Your own key for this isn't set**\n\nThis step uses a credential each person sets for themselves, and none is set for you yet. Ask an administrator to add it.",
19622
+ "secret.run_has_no_user": "\u26A0\uFE0F **This step needs a signed-in user**\n\nIt uses a person's own credential, so it can't run when no one started the run.",
19623
+ "secret.user_mismatch": "\u26A0\uFE0F **A credential couldn't be loaded**\n\nAn administrator needs to check this flow's secrets.",
19624
+ "secret.run_required": "\u26A0\uFE0F **A credential couldn't be loaded**\n\nAn administrator needs to check this flow's secrets.",
19625
+ "secret.not_found": "\u26A0\uFE0F **A secret this flow uses doesn't exist**\n\nAn administrator needs to add it, or point the flow at another one.",
19626
+ // The API's name for secret.not_found before it was renamed; older messages stored it.
19627
+ MS404: "\u26A0\uFE0F **A secret this flow uses doesn't exist**\n\nAn administrator needs to add it, or point the flow at another one."
19630
19628
  };
19631
19629
  var STATUS_CODE_TEXT = {
19632
19630
  408: ERROR_CODE_TEXT["llm.timeout"],
@@ -19719,7 +19717,8 @@ var MessageErrorMessageSchema = z.object({
19719
19717
  error_code: z.string().nullish(),
19720
19718
  message: z.string().nullish(),
19721
19719
  data: z.string().nullish(),
19722
- blockId: z.string().nullish()
19720
+ blockId: z.string().nullish(),
19721
+ traceId: z.string().nullish()
19723
19722
  });
19724
19723
  var MessageSchema = z.object({
19725
19724
  id: z.string().nullish(),
@@ -20567,7 +20566,10 @@ var MessageBubble = (props) => {
20567
20566
  /* @__PURE__ */ jsx("div", { className: "mt-1.5", children: metaRow })
20568
20567
  ] });
20569
20568
  };
20570
- function MessageErrorDetails({ detail }) {
20569
+ function MessageErrorDetails({
20570
+ detail,
20571
+ traceId
20572
+ }) {
20571
20573
  const [expanded, setExpanded] = useState(false);
20572
20574
  return /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
20573
20575
  /* @__PURE__ */ jsxs(
@@ -20583,7 +20585,13 @@ function MessageErrorDetails({ detail }) {
20583
20585
  ]
20584
20586
  }
20585
20587
  ),
20586
- expanded && /* @__PURE__ */ jsx("div", { className: "mt-1.5 whitespace-pre-wrap break-words rounded-md bg-secondary/60 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: detail })
20588
+ expanded && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 whitespace-pre-wrap break-words rounded-md bg-secondary/60 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: [
20589
+ detail,
20590
+ traceId && /* @__PURE__ */ jsxs("div", { className: detail ? "mt-1.5" : void 0, children: [
20591
+ "Reference: ",
20592
+ traceId
20593
+ ] })
20594
+ ] })
20587
20595
  ] });
20588
20596
  }
20589
20597
  var ThinkingSection = ({ status }) => /* @__PURE__ */ jsxs(
@@ -20891,7 +20899,7 @@ var MessageItem = ({
20891
20899
  userInput: null
20892
20900
  }
20893
20901
  ),
20894
- detail && /* @__PURE__ */ jsx(MessageErrorDetails, { detail })
20902
+ (detail || error.traceId) && /* @__PURE__ */ jsx(MessageErrorDetails, { detail, traceId: error.traceId })
20895
20903
  ] }, key)
20896
20904
  );
20897
20905
  });
@@ -21147,6 +21155,11 @@ function MessageListSkeleton() {
21147
21155
  i
21148
21156
  )) });
21149
21157
  }
21158
+
21159
+ // src/shared/utils/enums.ts
21160
+ var isMember = (e, value) => Object.values(e).includes(value);
21161
+
21162
+ // src/domains/messages/mapper.ts
21150
21163
  var {
21151
21164
  messageThreadsThreadMessagesIdMessagesResponse: messagesResponseSchema
21152
21165
  } = ChatZod;
@@ -21173,6 +21186,7 @@ function mapMessageValueDtoToModel(dto) {
21173
21186
  createdByUserId: dto.createdByUserId ?? void 0
21174
21187
  };
21175
21188
  }
21189
+ var mapMessageValuesDtoToModels = (dtos) => dtos.filter((dto) => isMember(MessageValueType, dto.type)).map(mapMessageValueDtoToModel);
21176
21190
  function mapMessageErrorDtoToModel(dto) {
21177
21191
  const { error_code, ...rest } = dto;
21178
21192
  return {
@@ -21190,7 +21204,7 @@ function mapMessageDtoToModel(dto) {
21190
21204
  createdByUserId: dto.createdByUserId ?? void 0,
21191
21205
  messageThreadId: dto.messageThreadId ?? void 0,
21192
21206
  errors: dto.errors?.map(mapMessageErrorDtoToModel) ?? void 0,
21193
- values: dto.values?.map(mapMessageValueDtoToModel)
21207
+ values: dto.values && mapMessageValuesDtoToModels(dto.values)
21194
21208
  };
21195
21209
  }
21196
21210
  function mapMessagesDtoToModels(dto) {
@@ -21306,8 +21320,7 @@ var mapWorkspacesDtoToModels = (arr) => arr.map(mapWorkspaceDtoToModel);
21306
21320
  function getChatApiBaseUrl() {
21307
21321
  try {
21308
21322
  const w = window;
21309
- const env2 = import.meta.env;
21310
- const cfg = w?.ssconfig?.Chat_Api_Uri ?? env2?.VITE_CHAT_API_URI;
21323
+ const cfg = w?.ssconfig?.Chat_Api_Uri;
21311
21324
  return typeof cfg === "string" && cfg.trim() ? cfg.trim() : "";
21312
21325
  } catch {
21313
21326
  return "";
@@ -21320,6 +21333,6 @@ function getUserPhotoUrl(userId) {
21320
21333
  return `${base2}/users/${userId}/photo`;
21321
21334
  }
21322
21335
 
21323
- export { ChatProvider, ChatVariablesForm, DRAFT_THREAD_PREFIX, DateFromApi, DictationButton, MarkdownEditor, MessageComposer, MessageList, MessageListSkeleton, MessageMarkdown, MessageValueType, NEW_THREAD_ID, THREAD_LIST_PAGE_SIZE, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getMessageErrorDetail, getMessageErrorText, getModelIcon, getRetryStatusText, getThreadPlaceholderFromListCache, getUserPhotoUrl, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, parseDateTime, parseDateTimeHuman, parseRetryStatus, randomUUID, setThreadOptimisticRunning, setThreadRunningInLists, speechKeys, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDictation, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useIsDraftThreadId, useMessages, useModels, useSendMessage, useSpeechConfig, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, utcDate, workspaceDetailOptions, workspaceKeys };
21336
+ export { ChatProvider, ChatVariablesForm, DRAFT_THREAD_PREFIX, DateFromApi, DictationButton, MarkdownEditor, MessageComposer, MessageList, MessageListSkeleton, MessageMarkdown, MessageValueType, NEW_THREAD_ID, THREAD_LIST_PAGE_SIZE, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getMessageErrorDetail, getMessageErrorText, getModelIcon, getRetryStatusText, getThreadPlaceholderFromListCache, getUserPhotoUrl, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessageValuesDtoToModels, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, parseDateTime, parseDateTimeHuman, parseRetryStatus, randomUUID, setThreadOptimisticRunning, setThreadRunningInLists, speechKeys, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDictation, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useIsDraftThreadId, useMessages, useModels, useSendMessage, useSpeechConfig, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, utcDate, workspaceDetailOptions, workspaceKeys };
21324
21337
  //# sourceMappingURL=index.js.map
21325
21338
  //# sourceMappingURL=index.js.map