@epam/ai-dial-chat-hooks 1.2.0-dev.170 → 1.2.0-dev.174

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.
@@ -23,6 +23,9 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
23
23
  }), n.reasoningEfforts?.length && r.push({
24
24
  label: "Reasoning efforts",
25
25
  value: n.reasoningEfforts.join(" · ")
26
+ }), n.hasSkills != null && r.push({
27
+ label: "Skills",
28
+ value: n.hasSkills
26
29
  }), r.length > 0 && t.push({
27
30
  title: "Capabilities",
28
31
  specs: r
@@ -147,6 +150,9 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
147
150
  }), n.hasConfiguration != null && r.push({
148
151
  label: "Configuration schema",
149
152
  value: n.hasConfiguration
153
+ }), n.hasSkills != null && r.push({
154
+ label: "Skills",
155
+ value: n.hasSkills
150
156
  }), r.length > 0 && t.push({
151
157
  title: "Capabilities",
152
158
  specs: r
@@ -252,6 +258,7 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
252
258
  hasConfiguration: e.hasConfigurationSchema,
253
259
  hasChatCompletion: e.chatCompletion,
254
260
  hasResponsesApi: e.responsesApi,
261
+ hasSkills: e.skillsSupported,
255
262
  reasoningEfforts: e.reasoningEfforts
256
263
  };
257
264
  }, T = (e) => {
package/catalog.d.ts CHANGED
@@ -50,6 +50,7 @@ export declare interface AgentCapabilities {
50
50
  hasConfiguration?: boolean;
51
51
  hasChatCompletion?: boolean;
52
52
  hasResponsesApi?: boolean;
53
+ hasSkills?: boolean;
53
54
  }
54
55
 
55
56
  /** Input-attachment configuration for an agent (application) deployment. */
@@ -575,6 +576,7 @@ export declare interface ModelCapabilities {
575
576
  hasResume?: boolean;
576
577
  hasChatCompletion?: boolean;
577
578
  hasResponsesApi?: boolean;
579
+ hasSkills?: boolean;
578
580
  reasoningEfforts?: string[];
579
581
  }
580
582
 
@@ -9,6 +9,48 @@ var i = (t, n, r, i) => i && n === r - 1 && t.role === e.Assistant, a = (e) => {
9
9
  return null;
10
10
  }, o = (t) => t.role === e.Assistant && (t.custom_content?.stages?.length ?? 0) > 0, s = (t) => {
11
11
  for (let n = t.length - 1; n >= 0; n--) if (t[n].role === e.User) return t[n].custom_content?.configuration_value;
12
- }, c = (e) => (e ?? "").toLowerCase().replace(/[^a-z]/g, "") === "plaintext" ? t.PlainText : t.Markdown;
12
+ }, c = (e) => {
13
+ if (typeof e.default == "boolean") return e.default;
14
+ let t = e.oneOf;
15
+ if (Array.isArray(t) && t.length === 1) {
16
+ let e = t[0];
17
+ if (typeof e == "object" && e && "const" in e && typeof e.const == "boolean") return e.const;
18
+ }
19
+ }, l = (e) => {
20
+ let t = e?.properties;
21
+ if (t == null) return;
22
+ let n = Object.entries(t).flatMap(([e, t]) => {
23
+ let n = c(t);
24
+ return n === void 0 ? [] : [[e, n]];
25
+ });
26
+ return n.length > 0 ? Object.fromEntries(n) : void 0;
27
+ }, u = (t) => {
28
+ let n = -1;
29
+ for (let r = t.length - 1; r >= 0; r--) if (t[r].role === e.User) {
30
+ n = r;
31
+ break;
32
+ }
33
+ let r = t[n]?.custom_content?.configuration_value;
34
+ for (let i = n + 1; i < t.length; i++) {
35
+ let n = t[i];
36
+ if (n.role !== e.Assistant) continue;
37
+ let a = l(n.custom_content?.form_schema);
38
+ a && (r = {
39
+ ...r,
40
+ ...a
41
+ });
42
+ }
43
+ return r;
44
+ }, d = (t, n, r) => {
45
+ let i = n.length - 1, a = n[i];
46
+ if (a?.role !== e.Assistant) return;
47
+ let o = l(a.custom_content?.form_schema);
48
+ if (!o) return;
49
+ let s = Object.fromEntries(r.filter((e) => e in o).sort().map((e) => [e, o[e]]));
50
+ if (Object.keys(s).length !== 0) return {
51
+ key: `${t}|${i}|${JSON.stringify(s)}`,
52
+ values: s
53
+ };
54
+ }, f = (e) => (e ?? "").toLowerCase().replace(/[^a-z]/g, "") === "plaintext" ? t.PlainText : t.Markdown;
13
55
  //#endregion
14
- export { a as getLastDeploymentId, s as getLastUserMessageToolConfiguration, i as isMessageStreaming, o as messageHasStages, c as normalizeResponseFormat };
56
+ export { d as getFormSchemaToolSyncKey, a as getLastDeploymentId, s as getLastUserMessageToolConfiguration, u as getLatestToolConfiguration, l as getToolConfigurationFromFormSchema, i as isMessageStreaming, o as messageHasStages, f as normalizeResponseFormat };
package/conversation.d.ts CHANGED
@@ -424,6 +424,21 @@ export declare const getConversationPath: (conversationId: string) => string;
424
424
  */
425
425
  export declare const getConversationSource: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe">) => FilterTab;
426
426
 
427
+ /**
428
+ * Returns the tool values the conversation's last message sets through its
429
+ * `form_schema`, restricted to `toolIds`, plus a key identifying that exact
430
+ * application. `undefined` when the last message is not an assistant message
431
+ * or sets no known tool.
432
+ *
433
+ * Streamed chunks and reloads re-create an identical `form_schema`; comparing
434
+ * keys rather than object identity applies an app's value once and leaves a
435
+ * later user toggle alone until the app sends a different value.
436
+ */
437
+ export declare const getFormSchemaToolSyncKey: (conversationId: string, messages: Message[], toolIds: readonly string[]) => {
438
+ key: string;
439
+ values: Record<string, boolean>;
440
+ } | undefined;
441
+
427
442
  /**
428
443
  * Returns the deployment the conversation was last running on: scanning
429
444
  * backwards, the `new_deployment_id` of a `model_changed` status message or
@@ -447,6 +462,15 @@ export declare const getLastDeploymentId: (messages: Message[]) => string | null
447
462
  */
448
463
  export declare const getLastUserMessageToolConfiguration: (messages: Message[]) => Record<string, unknown> | undefined;
449
464
 
465
+ /**
466
+ * Returns the tool configuration a (re-)loaded conversation should show: the
467
+ * last user message's `configuration_value`, overlaid in order by the
468
+ * `form_schema` values of the assistant messages after it. An app that turned
469
+ * a toggle off in its final response must not see it re-armed on reload just
470
+ * because the user message that started the run had it on.
471
+ */
472
+ export declare const getLatestToolConfiguration: (messages: Message[]) => Record<string, unknown> | undefined;
473
+
450
474
  /**
451
475
  * Extracts the deployment/model ID from a DIAL Core conversation ID.
452
476
  *
@@ -530,6 +554,15 @@ export declare const getStarterSubmitText: (starter: StarterOption, description?
530
554
  */
531
555
  export declare const getTimeOfDayGreeting: (hour: number, translations: GreetingTranslations, firstName?: string) => string;
532
556
 
557
+ /**
558
+ * Returns the boolean values an assistant message's `form_schema` sets, keyed
559
+ * by property name, or `undefined` when no property resolves to a boolean.
560
+ * Lets a DIAL app switch a tools-menu toggle (e.g. `deep_research`) per
561
+ * message — on while a run is in progress, off once its result is delivered.
562
+ * Not filtered by tool id: `restoreToolConfiguration` ignores unknown ids.
563
+ */
564
+ export declare const getToolConfigurationFromFormSchema: (formSchema: DeploymentConfigurationSchema | undefined) => Record<string, boolean> | undefined;
565
+
533
566
  /** Pre-translated greeting phrase strings for each time-of-day period. */
534
567
  export declare interface GreetingTranslations {
535
568
  morningWithName: string;
package/conversation.js CHANGED
@@ -5,29 +5,29 @@ import { formatAppVersion as m, sanitizeFooterHtml as h } from "./conversation/f
5
5
  import { getModelIdFromConversationId as g } from "./conversation/get-model-id-from-conversation-id.js";
6
6
  import { getTimeOfDayGreeting as _ } from "./conversation/greeting.js";
7
7
  import { createDeploymentChangedMessage as v } from "./conversation/message-factory.js";
8
- import { getLastDeploymentId as y, getLastUserMessageToolConfiguration as b, isMessageStreaming as x, messageHasStages as S, normalizeResponseFormat as C } from "./conversation/message-utils.js";
9
- import { getQuickAppConversationStarters as w } from "./conversation/quick-app-conversation-starters.js";
10
- import { mapStages as T, toStage as E } from "./conversation/stage.js";
11
- import { getStarterPopulateText as D, getStartersFromSchema as O } from "./conversation/starter-option.js";
12
- import { deriveConversationRowActionState as k } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
13
- import { useActiveConversationSync as A } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
14
- import { useAsyncConfirmDialog as j } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
15
- import { useConversationLookupMaps as M } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
16
- import { getConversationSource as N, useConversationPanelItems as P } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
17
- import { useImportFilePicker as F } from "./conversation/useImportFilePicker/useImportFilePicker.js";
18
- import { useMessageSelectionReply as I } from "./conversation/useMessageSelectionReply/useMessageSelectionReply.js";
19
- import { useAttachmentUpload as L } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
20
- import { AudioTranscriptionError as R, AudioTranscriptionErrorReason as z } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
21
- import { useTranscribeAudio as B } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
22
- import { attachmentToDto as V, attachmentsToDtos as H } from "./conversation/useConversationHandlers/attachment-to-dto.js";
23
- import { createMessagePair as U } from "./conversation/useConversationHandlers/message-factory.js";
24
- import { hasActiveToolConfig as W, isAnswerIncomplete as G, isMessageChanged as K, shouldRerunGenerationOnEdit as q } from "./conversation/useConversationHandlers/message-utils.js";
25
- import { getStarterConversationText as J, getStarterDisplayText as Y, getStarterSubmitText as X } from "./conversation/useConversationHandlers/starter-option.js";
26
- import { getConversationPath as Z } from "./conversation/useConversationStream/conversation-path.js";
27
- import { useConversationHandlers as Q } from "./conversation/useConversationHandlers/useConversationHandlers.js";
28
- import { applyChunkToMessages as $, mergeStages as ee } from "./conversation/useConversationStream/apply-chunk.js";
29
- import { isAwaitingGenerationResume as te } from "./conversation/useConversationStream/generation-resume.js";
30
- import { useConversationStream as ne } from "./conversation/useConversationStream/useConversationStream.js";
31
- import { useChatSettingsFormConfig as re } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
32
- import { useToolsMenu as ie } from "./useToolsMenu/useToolsMenu.js";
33
- export { R as AudioTranscriptionError, z as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, s as DEFAULT_STREAM_IDLE_TIMEOUT_MS, c as GenerationConflictError, l as GenerationPersistenceError, u as StreamInterruptedError, d as StreamUpstreamError, $ as applyChunkToMessages, V as attachmentToDto, H as attachmentsToDtos, e as buildAnnouncementSignature, f as createChatStreamApi, v as createDeploymentChangedMessage, U as createMessagePair, k as deriveConversationRowActionState, m as formatAppVersion, Z as getConversationPath, N as getConversationSource, y as getLastDeploymentId, b as getLastUserMessageToolConfiguration, g as getModelIdFromConversationId, w as getQuickAppConversationStarters, J as getStarterConversationText, Y as getStarterDisplayText, D as getStarterPopulateText, X as getStarterSubmitText, O as getStartersFromSchema, _ as getTimeOfDayGreeting, W as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, G as isAnswerIncomplete, te as isAwaitingGenerationResume, K as isMessageChanged, x as isMessageStreaming, T as mapStages, ee as mergeStages, S as messageHasStages, C as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, h as sanitizeFooterHtml, q as shouldRerunGenerationOnEdit, p as shouldWatchForDisplayNameUpdate, E as toStage, A as useActiveConversationSync, j as useAsyncConfirmDialog, L as useAttachmentUpload, re as useChatSettingsFormConfig, Q as useConversationHandlers, M as useConversationLookupMaps, P as useConversationPanelItems, ne as useConversationStream, F as useImportFilePicker, I as useMessageSelectionReply, ie as useToolsMenu, B as useTranscribeAudio };
8
+ import { getFormSchemaToolSyncKey as y, getLastDeploymentId as b, getLastUserMessageToolConfiguration as x, getLatestToolConfiguration as S, getToolConfigurationFromFormSchema as C, isMessageStreaming as w, messageHasStages as T, normalizeResponseFormat as E } from "./conversation/message-utils.js";
9
+ import { getQuickAppConversationStarters as D } from "./conversation/quick-app-conversation-starters.js";
10
+ import { mapStages as O, toStage as k } from "./conversation/stage.js";
11
+ import { getStarterPopulateText as A, getStartersFromSchema as j } from "./conversation/starter-option.js";
12
+ import { deriveConversationRowActionState as M } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
13
+ import { useActiveConversationSync as N } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
14
+ import { useAsyncConfirmDialog as P } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
15
+ import { useConversationLookupMaps as F } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
16
+ import { getConversationSource as I, useConversationPanelItems as L } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
17
+ import { useImportFilePicker as R } from "./conversation/useImportFilePicker/useImportFilePicker.js";
18
+ import { useMessageSelectionReply as z } from "./conversation/useMessageSelectionReply/useMessageSelectionReply.js";
19
+ import { useAttachmentUpload as B } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
20
+ import { AudioTranscriptionError as V, AudioTranscriptionErrorReason as H } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
21
+ import { useTranscribeAudio as U } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
22
+ import { attachmentToDto as W, attachmentsToDtos as G } from "./conversation/useConversationHandlers/attachment-to-dto.js";
23
+ import { createMessagePair as K } from "./conversation/useConversationHandlers/message-factory.js";
24
+ import { hasActiveToolConfig as q, isAnswerIncomplete as J, isMessageChanged as Y, shouldRerunGenerationOnEdit as X } from "./conversation/useConversationHandlers/message-utils.js";
25
+ import { getStarterConversationText as Z, getStarterDisplayText as Q, getStarterSubmitText as $ } from "./conversation/useConversationHandlers/starter-option.js";
26
+ import { getConversationPath as ee } from "./conversation/useConversationStream/conversation-path.js";
27
+ import { useConversationHandlers as te } from "./conversation/useConversationHandlers/useConversationHandlers.js";
28
+ import { applyChunkToMessages as ne, mergeStages as re } from "./conversation/useConversationStream/apply-chunk.js";
29
+ import { isAwaitingGenerationResume as ie } from "./conversation/useConversationStream/generation-resume.js";
30
+ import { useConversationStream as ae } from "./conversation/useConversationStream/useConversationStream.js";
31
+ import { useChatSettingsFormConfig as oe } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
32
+ import { useToolsMenu as se } from "./useToolsMenu/useToolsMenu.js";
33
+ export { V as AudioTranscriptionError, H as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, s as DEFAULT_STREAM_IDLE_TIMEOUT_MS, c as GenerationConflictError, l as GenerationPersistenceError, u as StreamInterruptedError, d as StreamUpstreamError, ne as applyChunkToMessages, W as attachmentToDto, G as attachmentsToDtos, e as buildAnnouncementSignature, f as createChatStreamApi, v as createDeploymentChangedMessage, K as createMessagePair, M as deriveConversationRowActionState, m as formatAppVersion, ee as getConversationPath, I as getConversationSource, y as getFormSchemaToolSyncKey, b as getLastDeploymentId, x as getLastUserMessageToolConfiguration, S as getLatestToolConfiguration, g as getModelIdFromConversationId, D as getQuickAppConversationStarters, Z as getStarterConversationText, Q as getStarterDisplayText, A as getStarterPopulateText, $ as getStarterSubmitText, j as getStartersFromSchema, _ as getTimeOfDayGreeting, C as getToolConfigurationFromFormSchema, q as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, J as isAnswerIncomplete, ie as isAwaitingGenerationResume, Y as isMessageChanged, w as isMessageStreaming, O as mapStages, re as mergeStages, T as messageHasStages, E as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, h as sanitizeFooterHtml, X as shouldRerunGenerationOnEdit, p as shouldWatchForDisplayNameUpdate, k as toStage, N as useActiveConversationSync, P as useAsyncConfirmDialog, B as useAttachmentUpload, oe as useChatSettingsFormConfig, te as useConversationHandlers, F as useConversationLookupMaps, L as useConversationPanelItems, ae as useConversationStream, R as useImportFilePicker, z as useMessageSelectionReply, se as useToolsMenu, U as useTranscribeAudio };
package/file-manager.d.ts CHANGED
@@ -365,8 +365,6 @@ export declare type FileNameValidationError = {
365
365
  } | {
366
366
  reason: FileNameValidationErrorReason.DuplicateName;
367
367
  existingName: string;
368
- } | {
369
- reason: FileNameValidationErrorReason.LeadingDot;
370
368
  };
371
369
 
372
370
  /**
@@ -379,8 +377,7 @@ export declare enum FileNameValidationErrorReason {
379
377
  ForbiddenSymbols = "forbiddenSymbols",
380
378
  ReservedName = "reservedName",
381
379
  TooLong = "tooLong",
382
- DuplicateName = "duplicateName",
383
- LeadingDot = "leadingDot"
380
+ DuplicateName = "duplicateName"
384
381
  }
385
382
 
386
383
  /**
@@ -397,7 +394,10 @@ export declare enum FileOperationKind {
397
394
  FileCopied = "fileCopied",
398
395
  FilesCopied = "filesCopied",
399
396
  FileMoved = "fileMoved",
400
- FilesMoved = "filesMoved"
397
+ FilesMoved = "filesMoved",
398
+ /** A copy whose every item landed in its own source folder (Duplicate). */
399
+ FileDuplicated = "fileDuplicated",
400
+ FilesDuplicated = "filesDuplicated"
401
401
  }
402
402
 
403
403
  /**
@@ -412,13 +412,15 @@ export declare interface FileOperationSuccessEvent {
412
412
  name?: string;
413
413
  /** Number of items the operation covered, when applicable. */
414
414
  count?: number;
415
- /** Destination folder name, for copy/move operations. */
415
+ /**
416
+ * Destination folder as a slash-joined virtual path starting at the root
417
+ * label (e.g. `My files/reports`), for copy/move/duplicate operations.
418
+ */
416
419
  destinationFolderName?: string;
417
420
  /**
418
- * Whether the affected item is a folder rather than a file. Only set for
419
- * `fileRenamed`, since it is the only kind whose current wording depends
420
- * on the item's node type (a rename toast reads "Folder renamed" vs.
421
- * "File renamed").
421
+ * Whether the affected item is a folder rather than a file. Set for rename,
422
+ * copy, move, and duplicate events; on a multi-item event it describes the
423
+ * first successfully affected item (the one `name` refers to).
422
424
  */
423
425
  isFolder?: boolean;
424
426
  }
@@ -662,7 +664,7 @@ export declare const splitFileNameExtension: (fileName: string) => {
662
664
 
663
665
  export declare const trimFileNameToByteLimit: (name: string, limit?: number) => string;
664
666
 
665
- export declare const updateEntry: (prev: FileUploadBatchState | null, index: number, patch: FileUploadStatus | Partial<Pick<FileUploadEntry, "status" | "percent">>) => FileUploadBatchState | null;
667
+ export declare const updateEntry: (prev: FileUploadBatchState | null, id: string, patch: FileUploadStatus | Partial<Pick<FileUploadEntry, "status" | "percent">>) => FileUploadBatchState | null;
666
668
 
667
669
  /** Max number of files uploaded concurrently within a single upload batch. */
668
670
  export declare const UPLOAD_CONCURRENCY = 3;
@@ -857,7 +859,9 @@ export declare interface UseDialFileManagerResult {
857
859
  uploadBatchState: FileUploadBatchState | null;
858
860
  /** Upload: abort all in-flight and queued uploads. */
859
861
  cancelUpload: () => void;
860
- /** Upload: dismiss the progress modal after the batch has settled. */
862
+ /** Upload: abort one queued or in-flight upload by its entry id. */
863
+ cancelUploadFile: (id: string) => void;
864
+ /** Upload: empty the upload queue. */
861
865
  clearUploadBatch: () => void;
862
866
  /** Folder creation: called when user confirms a new folder name. */
863
867
  onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
@@ -924,7 +928,7 @@ export declare interface UseDialFileManagerResult {
924
928
  /**
925
929
  * True while any mutating file-manager operation is in flight: the OR of
926
930
  * `isCreatingFolder`, `isDownloading`, `isDeleting`, `isRenaming`, `isCopying`,
927
- * `isMoving`, `isUnsharing`, `isRemovingAccess`, and `uploadBatchState != null`.
931
+ * `isMoving`, `isUnsharing`, `isRemovingAccess`, and any upload still queued or running.
928
932
  *
929
933
  * Deliberately excludes three flags, each already fully contained by its own
930
934
  * scoped loading UI:
@@ -1070,10 +1074,11 @@ export declare interface UseDialFileSharingResult {
1070
1074
 
1071
1075
  /**
1072
1076
  * Manages upload batches (single-file and ZIP-archive extraction), including
1073
- * concurrency-limited progress tracking and abort. Invalidates the shared
1074
- * listing cache for the destination folder through `invalidateFolders`/
1075
- * `bumpRetry` after a batch settles — it never holds its own copy of the
1076
- * cache.
1077
+ * concurrency-limited progress tracking and per-file abort. A batch started
1078
+ * while another is on screen is appended to it, and settled entries stay in
1079
+ * `uploadBatchState` until `clearUploadBatch`. Invalidates the shared listing
1080
+ * cache for the destination folder through `invalidateFolders`/`bumpRetry`
1081
+ * after a batch settles — it never holds its own copy of the cache.
1077
1082
  */
1078
1083
  export declare const useDialFileUploadBatch: ({ filesApi, bucket, rootLabel, activeTab, cache, sharedRootMetaRef, invalidateFolders, bumpRetry, onNotification, }: UseDialFileUploadBatchOptions) => UseDialFileUploadBatchResult;
1079
1084
 
@@ -1106,6 +1111,7 @@ export declare interface UseDialFileUploadBatchResult {
1106
1111
  onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
1107
1112
  uploadBatchState: FileUploadBatchState | null;
1108
1113
  cancelUpload: () => void;
1114
+ cancelUploadFile: (id: string) => void;
1109
1115
  clearUploadBatch: () => void;
1110
1116
  }
1111
1117
 
@@ -50,7 +50,7 @@ var o = (t) => {
50
50
  return o.some((e) => e.name.toLowerCase() === n.name.toLowerCase()) || o.push(s), a.set(t, o), a;
51
51
  }, u = (e, t, n) => {
52
52
  if (!e) return e;
53
- let r = typeof n == "string" ? { status: n } : n, i = e.files.map((e, n) => n === t ? {
53
+ let r = typeof n == "string" ? { status: n } : n, i = e.files.map((e) => e.id === t ? {
54
54
  ...e,
55
55
  ...r
56
56
  } : e);
@@ -2,9 +2,9 @@
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.FolderLoadFailed = "folderLoadFailed", e.MetadataLoadFailed = "metadataLoadFailed", e.FolderCreateFailed = "folderCreateFailed", e.DownloadFileFailed = "downloadFileFailed", e.DownloadFilesFailed = "downloadFilesFailed", e.FilesDeleted = "filesDeleted", e.FilesDeletePartiallyFailed = "filesDeletePartiallyFailed", e.DeleteFailed = "deleteFailed", e.RenameFailed = "renameFailed", e.RenamePartiallyFailed = "renamePartiallyFailed", e.MoveFailed = "moveFailed", e.MovePartiallyFailed = "movePartiallyFailed", e.CopyFailed = "copyFailed", e.CopyPartiallyFailed = "copyPartiallyFailed", e.UnshareFailed = "unshareFailed", e.RemoveAccessFailed = "removeAccessFailed", e.UploadFailed = "uploadFailed", e.UploadCompleted = "uploadCompleted", e.UploadArchiveFailed = "uploadArchiveFailed", e.UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed", e.UploadArchiveRequestFailed = "uploadArchiveRequestFailed", e;
4
4
  }({}), t = /* @__PURE__ */ function(e) {
5
- return e.Empty = "empty", e.ForbiddenSymbols = "forbiddenSymbols", e.ReservedName = "reservedName", e.TooLong = "tooLong", e.DuplicateName = "duplicateName", e.LeadingDot = "leadingDot", e;
5
+ return e.Empty = "empty", e.ForbiddenSymbols = "forbiddenSymbols", e.ReservedName = "reservedName", e.TooLong = "tooLong", e.DuplicateName = "duplicateName", e;
6
6
  }({}), n = /* @__PURE__ */ function(e) {
7
- return e.FolderCreated = "folderCreated", e.FileRenamed = "fileRenamed", e.FileDownloaded = "fileDownloaded", e.FilesDownloaded = "filesDownloaded", e.FileCopied = "fileCopied", e.FilesCopied = "filesCopied", e.FileMoved = "fileMoved", e.FilesMoved = "filesMoved", e;
7
+ return e.FolderCreated = "folderCreated", e.FileRenamed = "fileRenamed", e.FileDownloaded = "fileDownloaded", e.FilesDownloaded = "filesDownloaded", e.FileCopied = "fileCopied", e.FilesCopied = "filesCopied", e.FileMoved = "fileMoved", e.FilesMoved = "filesMoved", e.FileDuplicated = "fileDuplicated", e.FilesDuplicated = "filesDuplicated", e;
8
8
  }({});
9
9
  //#endregion
10
10
  export { e as FileManagerNotificationReason, t as FileNameValidationErrorReason, n as FileOperationKind };
@@ -6,141 +6,143 @@ import { useDialFileMetadata as u } from "../useDialFileMetadata/useDialFileMeta
6
6
  import { useDialFileMutations as d } from "../useDialFileMutations/useDialFileMutations.js";
7
7
  import { useDialFileSharing as f } from "../useDialFileSharing/useDialFileSharing.js";
8
8
  import { useDialFileUploadBatch as p } from "../useDialFileUploadBatch/useDialFileUploadBatch.js";
9
- import { useCallback as m, useMemo as h } from "react";
10
- import { DialFileManagerActions as g, DialFileManagerTabs as _ } from "@epam/ai-dial-react-file-manager";
9
+ import { isUploadInProgress as m } from "@epam/ai-dial-chat-shared";
10
+ import { useCallback as h, useMemo as g } from "react";
11
+ import { DialFileManagerActions as _, DialFileManagerTabs as v } from "@epam/ai-dial-react-file-manager";
11
12
  //#region src/files/useDialFileManager/useDialFileManager.ts
12
- var v = ({ filesApi: v, bucket: y, rootLabel: b = "My files", activeTab: x = _.MyFiles, onNotification: S, onOperationSuccess: C, forbiddenSymbolsRegExp: w, variant: T = i.Attach, actionProfile: E, labels: D, locale: O, disabledNewButtonTooltip: k, downloadDestination: A, buildValidationErrorMessage: j }) => {
13
- let M = E ?? a(T), N = l({
14
- filesApi: v,
15
- bucket: y,
16
- rootLabel: b,
17
- activeTab: x,
18
- onNotification: S
19
- }), P = p({
20
- filesApi: v,
21
- bucket: y,
22
- rootLabel: b,
23
- activeTab: x,
24
- cache: N.cache,
25
- sharedRootMetaRef: N.sharedRootMetaRef,
26
- invalidateFolders: N.invalidateFolders,
27
- bumpRetry: N.bumpRetry,
28
- onNotification: S
29
- }), F = d({
30
- filesApi: v,
31
- bucket: y,
32
- rootLabel: b,
33
- activeTab: x,
34
- folderPath: N.folderPath,
35
- currentFolder: N.currentFolder,
36
- sharedRootMetaRef: N.sharedRootMetaRef,
37
- listingPermissionsCache: N.listingPermissionsCache,
38
- invalidateFolders: N.invalidateFolders,
39
- bumpRetry: N.bumpRetry,
40
- mergeCreatedFolder: N.mergeCreatedFolder,
41
- setFolderPath: N.setFolderPath,
42
- onNotification: S,
43
- onOperationSuccess: C,
44
- downloadDestination: A,
45
- forbiddenSymbolsRegExp: w
46
- }), I = f({
47
- filesApi: v,
48
- bucket: y,
49
- rootLabel: b,
50
- bumpRetry: N.bumpRetry,
51
- onNotification: S
52
- }), L = u({
53
- filesApi: v,
54
- bucket: y,
55
- rootLabel: b,
56
- onNotification: S
57
- }), R = o(N.currentFolder), z = h(() => x === _.Organization || x === _.Shared && N.folderPath === "" ? !1 : R, [
58
- x,
59
- N.folderPath,
60
- R
61
- ]), B = h(() => x === _.Shared ? t : e, [x]), V = h(() => {
13
+ var y = ({ filesApi: y, bucket: b, rootLabel: x = "My files", activeTab: S = v.MyFiles, onNotification: C, onOperationSuccess: w, forbiddenSymbolsRegExp: T, variant: E = i.Attach, actionProfile: D, labels: O, locale: k, disabledNewButtonTooltip: A, downloadDestination: j, buildValidationErrorMessage: M }) => {
14
+ let N = D ?? a(E), P = l({
15
+ filesApi: y,
16
+ bucket: b,
17
+ rootLabel: x,
18
+ activeTab: S,
19
+ onNotification: C
20
+ }), F = p({
21
+ filesApi: y,
22
+ bucket: b,
23
+ rootLabel: x,
24
+ activeTab: S,
25
+ cache: P.cache,
26
+ sharedRootMetaRef: P.sharedRootMetaRef,
27
+ invalidateFolders: P.invalidateFolders,
28
+ bumpRetry: P.bumpRetry,
29
+ onNotification: C
30
+ }), I = d({
31
+ filesApi: y,
32
+ bucket: b,
33
+ rootLabel: x,
34
+ activeTab: S,
35
+ folderPath: P.folderPath,
36
+ currentFolder: P.currentFolder,
37
+ sharedRootMetaRef: P.sharedRootMetaRef,
38
+ listingPermissionsCache: P.listingPermissionsCache,
39
+ invalidateFolders: P.invalidateFolders,
40
+ bumpRetry: P.bumpRetry,
41
+ mergeCreatedFolder: P.mergeCreatedFolder,
42
+ setFolderPath: P.setFolderPath,
43
+ onNotification: C,
44
+ onOperationSuccess: w,
45
+ downloadDestination: j,
46
+ forbiddenSymbolsRegExp: T
47
+ }), L = f({
48
+ filesApi: y,
49
+ bucket: b,
50
+ rootLabel: x,
51
+ bumpRetry: P.bumpRetry,
52
+ onNotification: C
53
+ }), R = u({
54
+ filesApi: y,
55
+ bucket: b,
56
+ rootLabel: x,
57
+ onNotification: C
58
+ }), z = o(P.currentFolder), B = g(() => S === v.Organization || S === v.Shared && P.folderPath === "" ? !1 : z, [
59
+ S,
60
+ P.folderPath,
61
+ z
62
+ ]), V = g(() => S === v.Shared ? t : e, [S]), H = g(() => {
62
63
  let e = {}, t = (t) => {
63
- let n = D[t];
64
+ let n = O[t];
64
65
  n != null && (e[t] = n);
65
66
  };
66
- return t(g.Download), x === _.MyFiles ? (t(g.Delete), z && (t(g.Rename), s(M) && (t(g.Copy), t(g.Move), t(g.Duplicate))), c(M) && t(g.RemoveAccess)) : x === _.Shared && c(M) && t(g.Unshare), M === r.Full && t(g.Info), e;
67
+ return t(_.Download), S === v.MyFiles ? (t(_.Delete), B && (t(_.Rename), s(N) && (t(_.Copy), t(_.Move), t(_.Duplicate))), c(N) && t(_.RemoveAccess)) : S === v.Shared && c(N) && t(_.Unshare), N === r.Full && t(_.Info), e;
67
68
  }, [
68
- x,
69
- z,
70
- M,
71
- D
72
- ]), H = h(() => F.isCreatingFolder || F.isDownloading || F.isDeleting || F.isRenaming || F.isCopying || F.isMoving || I.isUnsharing || I.isRemovingAccess || P.uploadBatchState != null, [
73
- F.isCreatingFolder,
74
- F.isDownloading,
75
- F.isDeleting,
76
- F.isRenaming,
77
- F.isCopying,
78
- F.isMoving,
79
- I.isUnsharing,
80
- I.isRemovingAccess,
81
- P.uploadBatchState
82
- ]), U = m((e, t) => {
83
- let n = F.onCreateFolderValidate(e, t);
84
- return n ? j(n) : null;
85
- }, [F, j]), W = m((e, t) => {
86
- let n = F.onRenameValidate(e, t);
87
- return n ? j(n, t) : null;
88
- }, [F, j]);
69
+ S,
70
+ B,
71
+ N,
72
+ O
73
+ ]), U = g(() => I.isCreatingFolder || I.isDownloading || I.isDeleting || I.isRenaming || I.isCopying || I.isMoving || L.isUnsharing || L.isRemovingAccess || m(F.uploadBatchState), [
74
+ I.isCreatingFolder,
75
+ I.isDownloading,
76
+ I.isDeleting,
77
+ I.isRenaming,
78
+ I.isCopying,
79
+ I.isMoving,
80
+ L.isUnsharing,
81
+ L.isRemovingAccess,
82
+ F.uploadBatchState
83
+ ]), W = h((e, t) => {
84
+ let n = I.onCreateFolderValidate(e, t);
85
+ return n ? M(n) : null;
86
+ }, [I, M]), G = h((e, t) => {
87
+ let n = I.onRenameValidate(e, t);
88
+ return n ? M(n, t) : null;
89
+ }, [I, M]);
89
90
  return {
90
- items: N.items,
91
- isLoading: N.isLoading,
92
- error: N.error,
93
- path: N.path,
94
- onPathChange: N.onPathChange,
95
- retry: N.retry,
96
- onSearchFiles: N.onSearchFiles,
97
- isSearching: N.isSearching,
98
- searchResults: N.searchResults,
99
- clearSearchResults: N.clearSearchResults,
100
- expandedPaths: N.expandedPaths,
101
- loadedPaths: N.loadedPaths,
102
- onExpandedPathsChange: N.onExpandedPathsChange,
103
- onFolderPopupPathChange: N.onFolderPopupPathChange,
104
- folderPopupLoadingPaths: N.folderPopupLoadingPaths,
105
- onUploadFiles: P.onUploadFiles,
106
- onUploadArchive: P.onUploadArchive,
107
- onValidateUpload: P.onValidateUpload,
108
- uploadBatchState: P.uploadBatchState,
109
- cancelUpload: P.cancelUpload,
110
- clearUploadBatch: P.clearUploadBatch,
111
- onCreateFolder: F.onCreateFolder,
112
- onCreateFolderValidate: U,
113
- isCreatingFolder: F.isCreatingFolder,
114
- onDownloadFiles: F.onDownloadFiles,
115
- isDownloading: F.isDownloading,
116
- onDeleteFiles: F.onDeleteFiles,
117
- isDeleting: F.isDeleting,
118
- onRenameValidate: W,
119
- onMoveToFiles: F.onMoveToFiles,
120
- isRenaming: F.isRenaming,
121
- onCopyFiles: F.onCopyFiles,
122
- isCopying: F.isCopying,
123
- isMoving: F.isMoving,
124
- cancelCopyMove: F.cancelCopyMove,
125
- uploadEnabled: z,
126
- isNewButtonDisabled: !z,
127
- disabledNewButtonTooltip: k,
128
- visibleColumns: B,
129
- dateLocale: O,
91
+ items: P.items,
92
+ isLoading: P.isLoading,
93
+ error: P.error,
94
+ path: P.path,
95
+ onPathChange: P.onPathChange,
96
+ retry: P.retry,
97
+ onSearchFiles: P.onSearchFiles,
98
+ isSearching: P.isSearching,
99
+ searchResults: P.searchResults,
100
+ clearSearchResults: P.clearSearchResults,
101
+ expandedPaths: P.expandedPaths,
102
+ loadedPaths: P.loadedPaths,
103
+ onExpandedPathsChange: P.onExpandedPathsChange,
104
+ onFolderPopupPathChange: P.onFolderPopupPathChange,
105
+ folderPopupLoadingPaths: P.folderPopupLoadingPaths,
106
+ onUploadFiles: F.onUploadFiles,
107
+ onUploadArchive: F.onUploadArchive,
108
+ onValidateUpload: F.onValidateUpload,
109
+ uploadBatchState: F.uploadBatchState,
110
+ cancelUpload: F.cancelUpload,
111
+ cancelUploadFile: F.cancelUploadFile,
112
+ clearUploadBatch: F.clearUploadBatch,
113
+ onCreateFolder: I.onCreateFolder,
114
+ onCreateFolderValidate: W,
115
+ isCreatingFolder: I.isCreatingFolder,
116
+ onDownloadFiles: I.onDownloadFiles,
117
+ isDownloading: I.isDownloading,
118
+ onDeleteFiles: I.onDeleteFiles,
119
+ isDeleting: I.isDeleting,
120
+ onRenameValidate: G,
121
+ onMoveToFiles: I.onMoveToFiles,
122
+ isRenaming: I.isRenaming,
123
+ onCopyFiles: I.onCopyFiles,
124
+ isCopying: I.isCopying,
125
+ isMoving: I.isMoving,
126
+ cancelCopyMove: I.cancelCopyMove,
127
+ uploadEnabled: B,
128
+ isNewButtonDisabled: !B,
129
+ disabledNewButtonTooltip: A,
130
+ visibleColumns: V,
131
+ dateLocale: k,
130
132
  dateOptions: n,
131
- actionLabels: V,
132
- sharedWithMeIds: N.sharedWithMeIds,
133
- sharedByMePaths: N.sharedByMePaths,
134
- onUnshareFiles: I.onUnshareFiles,
135
- isUnsharing: I.isUnsharing,
136
- onRemoveFilesAccess: I.onRemoveFilesAccess,
137
- isRemovingAccess: I.isRemovingAccess,
138
- fileMetadata: L.fileMetadata,
139
- isFileMetadataLoading: L.isFileMetadataLoading,
140
- onGetInfo: L.onGetInfo,
141
- clearMetadata: L.clearMetadata,
142
- isAnyOperationInProgress: H
133
+ actionLabels: H,
134
+ sharedWithMeIds: P.sharedWithMeIds,
135
+ sharedByMePaths: P.sharedByMePaths,
136
+ onUnshareFiles: L.onUnshareFiles,
137
+ isUnsharing: L.isUnsharing,
138
+ onRemoveFilesAccess: L.onRemoveFilesAccess,
139
+ isRemovingAccess: L.isRemovingAccess,
140
+ fileMetadata: R.fileMetadata,
141
+ isFileMetadataLoading: R.isFileMetadataLoading,
142
+ onGetInfo: R.onGetInfo,
143
+ clearMetadata: R.clearMetadata,
144
+ isAnyOperationInProgress: U
143
145
  };
144
146
  };
145
147
  //#endregion
146
- export { v as useDialFileManager };
148
+ export { y as useDialFileManager };