@epam/ai-dial-chat-hooks 1.2.0-dev.99 → 1.3.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-error/api-error.js +7 -4
- package/catalog/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- package/catalog/map-deployment-limits-to-catalog.js +16 -24
- package/catalog/map-deployment-limits-to-input.js +81 -9
- package/catalog/map-deployment-to-catalog-item.js +34 -34
- package/catalog/map-entity-details-to-catalog.js +237 -192
- package/catalog/map-skill-to-catalog-item.js +61 -54
- package/catalog/publish.js +4 -4
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
- package/catalog/useCatalogItemDetails.js +9 -8
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog.d.ts +171 -34
- package/catalog.js +23 -23
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/create-chat-stream-api.js +89 -49
- package/conversation/get-model-id-from-conversation-id.js +15 -9
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +6 -2
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/message-utils.js +8 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +181 -167
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +49 -31
- package/conversation/useConversationStream/frame-scheduler.js +39 -0
- package/conversation/useConversationStream/generation-resume.js +122 -64
- package/conversation/useConversationStream/useConversationStream.js +298 -118
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
- package/conversation-sources.d.ts +1 -1
- package/conversation-transfer.d.ts +2 -1
- package/conversation.d.ts +218 -22
- package/conversation.js +32 -31
- package/file-manager-canvas.d.ts +27 -7
- package/file-manager.d.ts +87 -32
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +67 -44
- package/files/dial-file-manager-copy-move.util.js +9 -8
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +24 -2
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/file-manager-variant.js +1 -1
- package/files/resolve-dial-file-api-path.js +11 -12
- package/files/useDialFileListing/useDialFileListing.js +140 -127
- package/files/useDialFileManager/useDialFileManager.js +139 -135
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -15
- package/files/useDialFileMutations/useDialFileMutations.js +65 -60
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +28 -23
- package/index.d.ts +643 -128
- package/index.js +136 -134
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/oauth/authorize-url.js +3 -3
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +34 -2
- package/oauth.js +9 -9
- package/package.json +19 -23
- package/scheduled-task/scheduled-task-description.js +43 -39
- package/scheduled-task/scheduled-task-trigger.js +74 -71
- package/scheduled-task/use-scheduled-task-runs.js +162 -50
- package/scheduled-task/use-scheduled-tasks.js +52 -48
- package/scheduled-tasks.d.ts +27 -6
- package/scheduled-tasks.js +2 -2
- package/shared/application-schema.js +5 -2
- package/shared/cron-day-of-month.js +13 -0
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +52 -29
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +38 -34
- package/skill/useSkillEditorLoad.js +65 -59
- package/skill/useSkillEditorSubmit.js +105 -93
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +62 -13
- package/skill-editor.js +9 -9
- package/usage/map-user-usage-to-model-limits.js +137 -95
- package/usage.d.ts +8 -3
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +26 -6
- package/utils.js +10 -10
package/file-manager-canvas.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export declare const annotationToOoxmlCanvasContent: (annotation: Annotation, an
|
|
|
21
21
|
/**
|
|
22
22
|
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
23
23
|
* for the clicked annotation's document within its citation group.
|
|
24
|
+
* When the clicked annotation has a page but no selector with valid geometry,
|
|
25
|
+
* an invisible page-anchor highlight is added and selected so the viewer
|
|
26
|
+
* still opens that page.
|
|
24
27
|
* Returns `null` if the annotation has no PDF source attachment.
|
|
25
28
|
*/
|
|
26
29
|
export declare const annotationToPdfCanvasContent: (annotation: Annotation, groups: AnnotationGroup[], resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
@@ -37,6 +40,8 @@ export declare interface AttachmentCanvasUrlResolvers {
|
|
|
37
40
|
resolveDialUrl: (attachment: DisplayAttachment) => string | undefined;
|
|
38
41
|
/** Resolves a DIAL Core file id to a fetchable metadata URL (used for cache-freshness validation). */
|
|
39
42
|
resolveDialFileMetadataUrl: (fileId: string) => string | undefined;
|
|
43
|
+
/** URL of a host-served bootstrap document that renders HTML with no download URL (inline `data`) under its own response CSP instead of the embedding page's — forwarded as `HtmlCanvasContent.srcdocHostUrl`. When omitted, that HTML renders via plain `srcdoc`. */
|
|
44
|
+
htmlSrcdocHostUrl?: string;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
/** The type of content the canvas can display. */
|
|
@@ -127,10 +132,16 @@ export declare const hasAttachmentTextSource: (attachment: DisplayAttachment, re
|
|
|
127
132
|
declare interface HtmlCanvasContent {
|
|
128
133
|
/** Discriminates the content type to select the correct renderer. */
|
|
129
134
|
type: AttachmentContentType.Html;
|
|
130
|
-
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe.
|
|
135
|
+
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe. Populated only when no `url` is available (local, non-downloadable file attachments); when `url` is set, "View source" instead calls `resolveSourceText`. */
|
|
131
136
|
srcdoc?: string;
|
|
132
|
-
/**
|
|
137
|
+
/** URL rendered via `src` in a sandboxed iframe when `srcdoc` is absent, or in preference to `srcdoc` when `isSameOriginUrl` is set. Also used as the download-button/"Open in new tab" target. */
|
|
133
138
|
url?: string;
|
|
139
|
+
/** True when `url`'s origin matches the embedding document's own origin. Forces the iframe sandbox to omit `allow-same-origin` — granting it would let a same-origin framed document reach this page's own cookies/storage — and makes `src` take precedence over `srcdoc`; also skips the `contentDocument` block-detection check, since the iframe is intentionally opaque-origin either way. */
|
|
140
|
+
isSameOriginUrl?: boolean;
|
|
141
|
+
/** Lazily fetches the full HTML source text for the "View source" toggle. Used instead of an eagerly-populated `srcdoc` when `url` is set; absent when `srcdoc` is already populated. */
|
|
142
|
+
resolveSourceText?: () => Promise<string>;
|
|
143
|
+
/** Host-served bootstrap document used to render `srcdoc` without inheriting the embedding page's CSP. When set alongside `srcdoc`, the iframe loads this URL via `src` (still `sandbox="allow-scripts"`) and posts `{ type: HTML_PREVIEW_FRAME_RENDER_MESSAGE, html: srcdoc }` to it once loaded, so the HTML renders under that response's own policy. Ignored when `srcdoc` is absent or `isSameOriginUrl` selects `url`. */
|
|
144
|
+
srcdocHostUrl?: string;
|
|
134
145
|
}
|
|
135
146
|
|
|
136
147
|
/** Content payload for image attachments. */
|
|
@@ -189,7 +200,7 @@ declare interface OoxmlDocxHighlightLocation {
|
|
|
189
200
|
path: number[];
|
|
190
201
|
/** Inclusive start character offset within the story's matched text. */
|
|
191
202
|
start: number;
|
|
192
|
-
/** Exclusive end character offset
|
|
203
|
+
/** Exclusive end character offset — the wire's `end`, already exclusive, copied through unchanged. */
|
|
193
204
|
endExclusive: number;
|
|
194
205
|
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
195
206
|
text: string;
|
|
@@ -253,7 +264,7 @@ declare interface OoxmlPptxHighlightLocation {
|
|
|
253
264
|
shapeId: string;
|
|
254
265
|
/** Inclusive start character offset within the shape's matched text. */
|
|
255
266
|
start: number;
|
|
256
|
-
/** Exclusive end character offset
|
|
267
|
+
/** Exclusive end character offset — the wire's `end`, already exclusive, copied through unchanged. */
|
|
257
268
|
endExclusive: number;
|
|
258
269
|
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
259
270
|
text: string;
|
|
@@ -330,9 +341,18 @@ export declare const resolveGroupedVisualizerCanvasContent: (attachments: Displa
|
|
|
330
341
|
|
|
331
342
|
/**
|
|
332
343
|
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
344
|
+
* When the attachment has a download URL, that URL is the primary render
|
|
345
|
+
* target so the preview loads via `src` and gets its own response-level CSP
|
|
346
|
+
* instead of inheriting the host document's — no HTML text is fetched up
|
|
347
|
+
* front; `resolveSourceText` fetches it lazily, only when the "View source"
|
|
348
|
+
* toggle is used, and rejects if that fetch fails. `isSameOriginUrl` reflects
|
|
349
|
+
* a real comparison against the embedding document's own origin.
|
|
350
|
+
* With no download URL (local file or inline data), falls back to `srcdoc`,
|
|
351
|
+
* rejecting payloads larger than 1 MiB to prevent browser truncation, and
|
|
352
|
+
* forwards `resolvers.htmlSrcdocHostUrl` so that HTML can still render under
|
|
353
|
+
* its own response-level CSP.
|
|
354
|
+
* Returns `null` if no source is available, or an `ErrorCanvasContent` when
|
|
355
|
+
* that fallback fetch fails.
|
|
336
356
|
*/
|
|
337
357
|
export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
|
|
338
358
|
|
package/file-manager.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ import { FileUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
|
34
34
|
import { FileUploadStatus } from '@epam/ai-dial-chat-shared';
|
|
35
35
|
import { FileUploadValidationResult } from '@epam/ai-dial-chat-shared';
|
|
36
36
|
import { FilterChipItem } from '@epam/ai-dial-ui-kit';
|
|
37
|
-
import { getParentFolderPath } from '@epam/ai-dial-chat-shared';
|
|
38
37
|
import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
39
38
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
40
39
|
import { ListPublicFilesRequest } from '@epam/ai-dial-chat-api-client';
|
|
@@ -123,12 +122,19 @@ export declare const DATE_OPTIONS: Intl.DateTimeFormatOptions;
|
|
|
123
122
|
|
|
124
123
|
export declare const deriveActionProfile: (variant: DialFileManagerVariant) => DialFileManagerActionProfile;
|
|
125
124
|
|
|
125
|
+
/** Source tabs `useDialFileManagerSections` can merge into the All tab, in display order. */
|
|
126
|
+
export declare const DIAL_FILE_MANAGER_SECTION_TABS: readonly DialFileManagerTabs[];
|
|
127
|
+
|
|
126
128
|
/** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
|
|
127
129
|
export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
/** One source tab rendered as a top-level folder of the All view. */
|
|
132
|
+
export declare interface DialFileManagerSection {
|
|
133
|
+
/** Source tab backing this section — `MyFiles`, `Shared` or `Organization`. */
|
|
134
|
+
tab: DialFileManagerTabs;
|
|
135
|
+
/** Display name of the section's top-level folder; also the first segment of its virtual paths. An empty, slash-containing or repeated label is replaced by the tab id. */
|
|
136
|
+
rootLabel: string;
|
|
137
|
+
}
|
|
132
138
|
|
|
133
139
|
/**
|
|
134
140
|
* Operation port every file-manager hook that performs network I/O accepts as
|
|
@@ -344,7 +350,9 @@ export declare enum FileManagerNotificationReason {
|
|
|
344
350
|
/** `onUploadArchive` extracted some entries successfully and some failed; `count`/`names`/`restCount` describe the failures. */
|
|
345
351
|
UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed",
|
|
346
352
|
/** `onUploadArchive`'s `uploadArchive` request itself rejected. */
|
|
347
|
-
UploadArchiveRequestFailed = "uploadArchiveRequestFailed"
|
|
353
|
+
UploadArchiveRequestFailed = "uploadArchiveRequestFailed",
|
|
354
|
+
/** A copy/move targeted a destination in a different All-view section from its source items; no request was made. */
|
|
355
|
+
CrossSectionTransferUnsupported = "crossSectionTransferUnsupported"
|
|
348
356
|
}
|
|
349
357
|
|
|
350
358
|
/**
|
|
@@ -365,8 +373,6 @@ export declare type FileNameValidationError = {
|
|
|
365
373
|
} | {
|
|
366
374
|
reason: FileNameValidationErrorReason.DuplicateName;
|
|
367
375
|
existingName: string;
|
|
368
|
-
} | {
|
|
369
|
-
reason: FileNameValidationErrorReason.LeadingDot;
|
|
370
376
|
};
|
|
371
377
|
|
|
372
378
|
/**
|
|
@@ -379,8 +385,7 @@ export declare enum FileNameValidationErrorReason {
|
|
|
379
385
|
ForbiddenSymbols = "forbiddenSymbols",
|
|
380
386
|
ReservedName = "reservedName",
|
|
381
387
|
TooLong = "tooLong",
|
|
382
|
-
DuplicateName = "duplicateName"
|
|
383
|
-
LeadingDot = "leadingDot"
|
|
388
|
+
DuplicateName = "duplicateName"
|
|
384
389
|
}
|
|
385
390
|
|
|
386
391
|
/**
|
|
@@ -397,7 +402,10 @@ export declare enum FileOperationKind {
|
|
|
397
402
|
FileCopied = "fileCopied",
|
|
398
403
|
FilesCopied = "filesCopied",
|
|
399
404
|
FileMoved = "fileMoved",
|
|
400
|
-
FilesMoved = "filesMoved"
|
|
405
|
+
FilesMoved = "filesMoved",
|
|
406
|
+
/** A copy whose every item landed in its own source folder (Duplicate). */
|
|
407
|
+
FileDuplicated = "fileDuplicated",
|
|
408
|
+
FilesDuplicated = "filesDuplicated"
|
|
401
409
|
}
|
|
402
410
|
|
|
403
411
|
/**
|
|
@@ -412,13 +420,15 @@ export declare interface FileOperationSuccessEvent {
|
|
|
412
420
|
name?: string;
|
|
413
421
|
/** Number of items the operation covered, when applicable. */
|
|
414
422
|
count?: number;
|
|
415
|
-
/**
|
|
423
|
+
/**
|
|
424
|
+
* Destination folder as a slash-joined virtual path starting at the root
|
|
425
|
+
* label (e.g. `My files/reports`), for copy/move/duplicate operations.
|
|
426
|
+
*/
|
|
416
427
|
destinationFolderName?: string;
|
|
417
428
|
/**
|
|
418
|
-
* Whether the affected item is a folder rather than a file.
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
* "File renamed").
|
|
429
|
+
* Whether the affected item is a folder rather than a file. Set for rename,
|
|
430
|
+
* copy, move, and duplicate events; on a multi-item event it describes the
|
|
431
|
+
* first successfully affected item (the one `name` refers to).
|
|
422
432
|
*/
|
|
423
433
|
isFolder?: boolean;
|
|
424
434
|
}
|
|
@@ -453,8 +463,6 @@ export declare interface FilesApiClient {
|
|
|
453
463
|
listSharedByMe: (bucket: string) => Promise<ListFilesResponseDto>;
|
|
454
464
|
}
|
|
455
465
|
|
|
456
|
-
export { FileUploadValidationResult }
|
|
457
|
-
|
|
458
466
|
export declare const findDialFileByPath: (nodes: DialFile[], targetPath: string) => DialFile | undefined;
|
|
459
467
|
|
|
460
468
|
export declare const findFirstSuccessfulCopyMoveItem: <TDto extends {
|
|
@@ -471,8 +479,6 @@ export declare const findFolderByVirtualPath: (nodes: DialFile[], virtualPath: s
|
|
|
471
479
|
|
|
472
480
|
export declare const formatOperationFolderName: (destinationFolder: string, rootLabel: string) => string;
|
|
473
481
|
|
|
474
|
-
export { getParentFolderPath }
|
|
475
|
-
|
|
476
482
|
/**
|
|
477
483
|
* Returns the last path segment of `url` — its file name — for both absolute
|
|
478
484
|
* URLs and DIAL-relative resource paths such as
|
|
@@ -489,6 +495,9 @@ export declare const hasDialFileWritePermission: (folder?: DialFile) => boolean;
|
|
|
489
495
|
|
|
490
496
|
export declare const hasForbiddenNameSymbols: (name: string, forbiddenSymbolsRegExp?: RegExp) => boolean;
|
|
491
497
|
|
|
498
|
+
/** Returns `true` when both sets contain exactly the same paths. */
|
|
499
|
+
export declare const hasSamePaths: (a: ReadonlySet<string>, b: ReadonlySet<string>) => boolean;
|
|
500
|
+
|
|
492
501
|
/** Copy/Move/Duplicate are Browse/Full-only — the attach picker excludes them. */
|
|
493
502
|
export declare const isCopyMoveDuplicateAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
494
503
|
|
|
@@ -572,7 +581,7 @@ export declare interface PreparedCopyMoveItem<TDto> {
|
|
|
572
581
|
export declare const prepareDownloadDestination: (filename: string, mimeType?: string) => Promise<DownloadDestination>;
|
|
573
582
|
|
|
574
583
|
/**
|
|
575
|
-
* Rename-vs-move disambiguation (design.md D3): entries whose parent folder
|
|
584
|
+
* Rename-vs-move disambiguation (`openspec/changes/archive/2026-07-21-split-use-dial-file-manager/design.md` D3): entries whose parent folder
|
|
576
585
|
* is unchanged become `renameDtos`; entries whose parent folder changed
|
|
577
586
|
* become `preparedMoveItems`.
|
|
578
587
|
*/
|
|
@@ -634,6 +643,9 @@ export declare const resolveOwnerCoords: (apiPath: string, sharedRootMeta: Map<s
|
|
|
634
643
|
*/
|
|
635
644
|
export declare const resolveRelativeDialFilePath: (pathOrFileId: string, bucket: string) => string;
|
|
636
645
|
|
|
646
|
+
/** Returns the section whose root label is the first segment of `virtualPath`, or `undefined` when none matches. */
|
|
647
|
+
export declare const resolveSectionByPath: <TSection extends DialFileManagerSection>(virtualPath: string, sections: readonly TSection[]) => TSection | undefined;
|
|
648
|
+
|
|
637
649
|
/**
|
|
638
650
|
* Sanitizes a filename for upload by replacing forbidden characters with `_`,
|
|
639
651
|
* trimming trailing dots/whitespace from the base name, and capping the result
|
|
@@ -662,7 +674,10 @@ export declare const splitFileNameExtension: (fileName: string) => {
|
|
|
662
674
|
|
|
663
675
|
export declare const trimFileNameToByteLimit: (name: string, limit?: number) => string;
|
|
664
676
|
|
|
665
|
-
|
|
677
|
+
/** Returns a new set containing every path from each of `pathSets`. */
|
|
678
|
+
export declare const unionPathSets: (pathSets: readonly ReadonlySet<string>[]) => Set<string>;
|
|
679
|
+
|
|
680
|
+
export declare const updateEntry: (prev: FileUploadBatchState | null, id: string, patch: FileUploadStatus | Partial<Pick<FileUploadEntry, "status" | "percent">>) => FileUploadBatchState | null;
|
|
666
681
|
|
|
667
682
|
/** Max number of files uploaded concurrently within a single upload batch. */
|
|
668
683
|
export declare const UPLOAD_CONCURRENCY = 3;
|
|
@@ -691,14 +706,14 @@ export declare type UploadMode = 'overwrite' | 'create-only';
|
|
|
691
706
|
* tree's expand/collapse state, search, and the shared per-folder cache that
|
|
692
707
|
* `useDialFileUploadBatch`/`useDialFileMutations`/`useDialFileSharing` invalidate
|
|
693
708
|
* through `invalidateFolders`/`bumpRetry` after their own mutations settle
|
|
694
|
-
* (design.md D1) — this hook is the sole owner/writer of that cache.
|
|
709
|
+
* (`openspec/changes/archive/2026-07-21-split-use-dial-file-manager/design.md` D1) — this hook is the sole owner/writer of that cache.
|
|
695
710
|
*
|
|
696
711
|
* Supports three listing sources via `activeTab`:
|
|
697
712
|
* - my_files: user's own bucket via `DialFilesApi.listFiles`
|
|
698
713
|
* - shared: files shared with the user via `DialFilesApi.listSharedFiles`
|
|
699
714
|
* - organization: public bucket via `DialFilesApi.listPublicFiles`
|
|
700
715
|
*/
|
|
701
|
-
export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, }: UseDialFileListingOptions) => UseDialFileListingResult;
|
|
716
|
+
export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, isActive, sessionKey, }: UseDialFileListingOptions) => UseDialFileListingResult;
|
|
702
717
|
|
|
703
718
|
/** Options accepted by `useDialFileListing`. */
|
|
704
719
|
export declare interface UseDialFileListingOptions {
|
|
@@ -712,6 +727,10 @@ export declare interface UseDialFileListingOptions {
|
|
|
712
727
|
activeTab: DialFileManagerTabs;
|
|
713
728
|
/** Called with a structured event when a folder-load operation fails. */
|
|
714
729
|
onNotification?: (notification: FileManagerNotification) => void;
|
|
730
|
+
/** When false, the hook issues no `DialFilesApi` call and reports `isLoading: false`. Defaults to `true`. */
|
|
731
|
+
isActive?: boolean;
|
|
732
|
+
/** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
|
|
733
|
+
sessionKey?: string;
|
|
715
734
|
}
|
|
716
735
|
|
|
717
736
|
/** Values returned by `useDialFileListing`. */
|
|
@@ -747,7 +766,7 @@ export declare interface UseDialFileListingResult {
|
|
|
747
766
|
/**
|
|
748
767
|
* Deletes the given API-path cache keys so the next listing fetch/expand for
|
|
749
768
|
* that folder re-fetches from the server. The only way sibling sub-hooks may
|
|
750
|
-
* invalidate the shared cache (design.md D1).
|
|
769
|
+
* invalidate the shared cache (`openspec/changes/archive/2026-07-21-split-use-dial-file-manager/design.md` D1).
|
|
751
770
|
*/
|
|
752
771
|
invalidateFolders: (apiPaths: string[]) => void;
|
|
753
772
|
/** Merges a just-created folder into its parent's cache entry (optimistic display for create-folder). */
|
|
@@ -768,7 +787,7 @@ export declare interface UseDialFileListingResult {
|
|
|
768
787
|
* every translated string reaches it through `labels`,
|
|
769
788
|
* `disabledNewButtonTooltip`, and `buildValidationErrorMessage`.
|
|
770
789
|
*/
|
|
771
|
-
export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
|
|
790
|
+
export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, isActive, sessionKey, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
|
|
772
791
|
|
|
773
792
|
export declare interface UseDialFileManagerOptions {
|
|
774
793
|
/** Injected operation port used for every file-manager network call. */
|
|
@@ -779,6 +798,10 @@ export declare interface UseDialFileManagerOptions {
|
|
|
779
798
|
rootLabel?: string;
|
|
780
799
|
/** Active tab — drives listing source and per-tab options. Defaults to MyFiles. */
|
|
781
800
|
activeTab?: DialFileManagerTabs;
|
|
801
|
+
/** When false, the listing issues no `DialFilesApi` call and reports `isLoading: false`. Defaults to `true`. */
|
|
802
|
+
isActive?: boolean;
|
|
803
|
+
/** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
|
|
804
|
+
sessionKey?: string;
|
|
782
805
|
/** Called when a file-manager action should surface a toast notification. */
|
|
783
806
|
onNotification?: (notification: FileManagerNotification) => void;
|
|
784
807
|
/** Called when a mutation succeeds, instead of invoking an application notification service directly. */
|
|
@@ -833,7 +856,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
833
856
|
onSearchFiles: (folder: string, query: string) => void;
|
|
834
857
|
/** Search: true while a search request is in flight. */
|
|
835
858
|
isSearching: boolean;
|
|
836
|
-
/** Search: flat
|
|
859
|
+
/** Search: flat, unfiltered recursive listing of the current folder, or null when search is not active. */
|
|
837
860
|
searchResults: DialFile[] | null;
|
|
838
861
|
/** Search: clears results and exits search mode. */
|
|
839
862
|
clearSearchResults: () => void;
|
|
@@ -857,7 +880,9 @@ export declare interface UseDialFileManagerResult {
|
|
|
857
880
|
uploadBatchState: FileUploadBatchState | null;
|
|
858
881
|
/** Upload: abort all in-flight and queued uploads. */
|
|
859
882
|
cancelUpload: () => void;
|
|
860
|
-
/** Upload:
|
|
883
|
+
/** Upload: abort one queued or in-flight upload by its entry id. */
|
|
884
|
+
cancelUploadFile: (id: string) => void;
|
|
885
|
+
/** Upload: empty the upload queue. */
|
|
861
886
|
clearUploadBatch: () => void;
|
|
862
887
|
/** Folder creation: called when user confirms a new folder name. */
|
|
863
888
|
onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
|
|
@@ -924,7 +949,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
924
949
|
/**
|
|
925
950
|
* True while any mutating file-manager operation is in flight: the OR of
|
|
926
951
|
* `isCreatingFolder`, `isDownloading`, `isDeleting`, `isRenaming`, `isCopying`,
|
|
927
|
-
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and
|
|
952
|
+
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and any upload still queued or running.
|
|
928
953
|
*
|
|
929
954
|
* Deliberately excludes three flags, each already fully contained by its own
|
|
930
955
|
* scoped loading UI:
|
|
@@ -935,11 +960,36 @@ export declare interface UseDialFileManagerResult {
|
|
|
935
960
|
isAnyOperationInProgress: boolean;
|
|
936
961
|
}
|
|
937
962
|
|
|
963
|
+
/**
|
|
964
|
+
* Composes one `useDialFileManager` per source tab (My files, Shared,
|
|
965
|
+
* Organization) so the File storage page can offer an All tab without a
|
|
966
|
+
* second copy of the per-tab rules. On a single tab it returns that section's
|
|
967
|
+
* result; on All it merges the section roots into one tree and routes every
|
|
968
|
+
* callback to the section owning the path. Section availability and names
|
|
969
|
+
* arrive through `sections` — the hook reads no config, i18n, or context.
|
|
970
|
+
*/
|
|
971
|
+
export declare const useDialFileManagerSections: ({ activeTab, sections, ...managerOptions }: UseDialFileManagerSectionsOptions) => UseDialFileManagerSectionsResult;
|
|
972
|
+
|
|
973
|
+
/** Options accepted by `useDialFileManagerSections`. */
|
|
974
|
+
export declare interface UseDialFileManagerSectionsOptions extends Omit<UseDialFileManagerOptions, 'activeTab' | 'rootLabel' | 'isActive' | 'sessionKey'> {
|
|
975
|
+
/** Active tab, including `DialFileManagerTabs.All`. */
|
|
976
|
+
activeTab: DialFileManagerTabs;
|
|
977
|
+
/** Enabled source tabs in display order, each with its translated top-level folder name. */
|
|
978
|
+
sections: DialFileManagerSection[];
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** Values returned by `useDialFileManagerSections`. */
|
|
982
|
+
export declare interface UseDialFileManagerSectionsResult extends UseDialFileManagerResult {
|
|
983
|
+
/** Source tab of the browsed folder; never `DialFileManagerTabs.All`. */
|
|
984
|
+
sectionTab: DialFileManagerTabs;
|
|
985
|
+
}
|
|
986
|
+
|
|
938
987
|
/**
|
|
939
988
|
* Filters the file-manager's tab list down to the host's configured set and
|
|
940
989
|
* resets `activeTab` to the highest-priority still-enabled tab when the
|
|
941
990
|
* current one becomes excluded. A `fileManagerTabs` of `undefined` means no
|
|
942
991
|
* restriction — every tab in `allTabs` stays enabled and no reset ever fires.
|
|
992
|
+
* The All tab is kept only while at least two source tabs are enabled.
|
|
943
993
|
*/
|
|
944
994
|
export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs: FilterChipItem<DialFileManagerTabs>[] | undefined, fileManagerTabs: string[] | undefined) => UseDialFileManagerTabConfigResult;
|
|
945
995
|
|
|
@@ -1070,10 +1120,11 @@ export declare interface UseDialFileSharingResult {
|
|
|
1070
1120
|
|
|
1071
1121
|
/**
|
|
1072
1122
|
* Manages upload batches (single-file and ZIP-archive extraction), including
|
|
1073
|
-
* concurrency-limited progress tracking and abort.
|
|
1074
|
-
*
|
|
1075
|
-
* `
|
|
1076
|
-
* cache
|
|
1123
|
+
* concurrency-limited progress tracking and per-file abort. A batch started
|
|
1124
|
+
* while another is on screen is appended to it, and settled entries stay in
|
|
1125
|
+
* `uploadBatchState` until `clearUploadBatch`. Invalidates the shared listing
|
|
1126
|
+
* cache for the destination folder through `invalidateFolders`/`bumpRetry`
|
|
1127
|
+
* after a batch settles — it never holds its own copy of the cache.
|
|
1077
1128
|
*/
|
|
1078
1129
|
export declare const useDialFileUploadBatch: ({ filesApi, bucket, rootLabel, activeTab, cache, sharedRootMetaRef, invalidateFolders, bumpRetry, onNotification, }: UseDialFileUploadBatchOptions) => UseDialFileUploadBatchResult;
|
|
1079
1130
|
|
|
@@ -1106,6 +1157,7 @@ export declare interface UseDialFileUploadBatchResult {
|
|
|
1106
1157
|
onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
|
|
1107
1158
|
uploadBatchState: FileUploadBatchState | null;
|
|
1108
1159
|
cancelUpload: () => void;
|
|
1160
|
+
cancelUploadFile: (id: string) => void;
|
|
1109
1161
|
clearUploadBatch: () => void;
|
|
1110
1162
|
}
|
|
1111
1163
|
|
|
@@ -1179,4 +1231,7 @@ export { UseGridEditingScrollResult }
|
|
|
1179
1231
|
*/
|
|
1180
1232
|
export declare const virtualPathToApiPath: (virtualPath: string, rootLabel: string) => string;
|
|
1181
1233
|
|
|
1234
|
+
/** Returns `sections` with every root label usable as a unique first path segment, falling back to the tab id. */
|
|
1235
|
+
export declare const withRoutableRootLabels: <TSection extends DialFileManagerSection>(sections: readonly TSection[]) => TSection[];
|
|
1236
|
+
|
|
1182
1237
|
export { }
|
package/file-manager.js
CHANGED
|
@@ -3,27 +3,28 @@ import { isDialFileAcceptType as r, mimeTypesToAttachmentExtensionLabels as i, m
|
|
|
3
3
|
import { sanitizeFileName as s, splitFileNameExtension as c, trimFileNameToByteLimit as l } from "./files/file-name.js";
|
|
4
4
|
import { DialFilesApiUploadMode as u } from "./files/dial-files-api.js";
|
|
5
5
|
import { FileManagerNotificationReason as d, FileNameValidationErrorReason as f, FileOperationKind as p } from "./files/dial-file-manager.types.js";
|
|
6
|
-
import { COLUMNS_WITHOUT_AUTHOR as m, COLUMNS_WITH_AUTHOR as h, CORE_PERMISSION_MAP as g, DATE_OPTIONS as _,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { useDialFileListing as
|
|
21
|
-
import { useDialFileMetadata as
|
|
22
|
-
import { useDialFileMutations as
|
|
23
|
-
import { useDialFileSharing as
|
|
24
|
-
import { useDialFileUploadBatch as
|
|
25
|
-
import { useDialFileManager as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
6
|
+
import { COLUMNS_WITHOUT_AUTHOR as m, COLUMNS_WITH_AUTHOR as h, CORE_PERMISSION_MAP as g, DATE_OPTIONS as _, DIAL_FILE_MANAGER_SECTION_TABS as v, PATH_SEPARATOR_REGEXP as y, RESERVED_MARKER_NAME as b, UPLOAD_CONCURRENCY as x } from "./files/dial-file-manager.model.js";
|
|
7
|
+
import { buildSharedItemVirtualPath as S, dialCorePathToRelative as C, findDialFileByPath as w, findFolderByVirtualPath as T, formatOperationFolderName as E, getVirtualPathName as D, hasDialFileWritePermission as O, hasForbiddenNameSymbols as k, hasSamePaths as A, isCopyMoveDuplicateAllowed as j, isShareActionsAllowed as M, normalizeVirtualPath as N, parseNewFolderVirtualPath as P, resolveOwnerCoords as F, resolveSectionByPath as I, unionPathSets as L, withRoutableRootLabels as R } from "./files/dial-file-manager-path.util.js";
|
|
8
|
+
import { resolveDialFileApiPath as z, virtualPathToApiPath as B } from "./files/resolve-dial-file-api-path.js";
|
|
9
|
+
import { prepareCopyItems as V, prepareMoveRenameItems as H } from "./files/dial-file-manager-copy-move.util.js";
|
|
10
|
+
import { buildFromCache as U, fetchByTab as W, fetchForSearch as G, findFirstSuccessfulCopyMoveItem as K, mapCorePermissions as q, mapFileMetadataToDialFile as J, mapSearchItem as Y, mergeCreatedFolderIntoCache as X, updateEntry as Z } from "./files/dial-file-manager-mapping.util.js";
|
|
11
|
+
import { createFilesApiClient as Q } from "./files/create-files-api.js";
|
|
12
|
+
import { createUploadFileWithProgress as $ } from "./files/create-upload-file-with-progress.js";
|
|
13
|
+
import { openAnnotationAttachment as ee } from "./files/annotation.js";
|
|
14
|
+
import { getUrlFileName as te, isExternalSourcePreviewable as ne, resolveExternalSourceContentType as re } from "./files/source-content.js";
|
|
15
|
+
import { annotationToDisplayAttachment as ie, attachmentDtoToDisplayAttachment as ae, attachmentDtosToDisplayAttachments as oe } from "./files/attachment-dto-to-display.js";
|
|
16
|
+
import { dialFileToAttachment as se, dialFilesToAttachments as ce, dialFolderPathToAttachment as le } from "./files/dial-file-to-attachment.js";
|
|
17
|
+
import { DownloadDestinationType as ue } from "./files/download-destination.js";
|
|
18
|
+
import { prepareDownloadDestination as de } from "./files/prepare-download-destination.js";
|
|
19
|
+
import { deriveActionProfile as fe } from "./files/file-manager-variant.js";
|
|
20
|
+
import { useDialFileListing as pe } from "./files/useDialFileListing/useDialFileListing.js";
|
|
21
|
+
import { useDialFileMetadata as me } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
22
|
+
import { useDialFileMutations as he } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
23
|
+
import { useDialFileSharing as ge } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
24
|
+
import { useDialFileUploadBatch as _e } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
25
|
+
import { useDialFileManager as ve } from "./files/useDialFileManager/useDialFileManager.js";
|
|
26
|
+
import { useDialFileManagerSections as ye } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
27
|
+
import { useDialFileManagerTabConfig as be } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
28
|
+
import { useFileAttachmentPicker as xe } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
29
|
+
import { useGridEditingScroll as Se } from "@epam/ai-dial-chat-shared";
|
|
30
|
+
export { m as COLUMNS_WITHOUT_AUTHOR, h as COLUMNS_WITH_AUTHOR, g as CORE_PERMISSION_MAP, _ as DATE_OPTIONS, v as DIAL_FILE_MANAGER_SECTION_TABS, u as DialFilesApiUploadMode, ue as DownloadDestinationType, d as FileManagerNotificationReason, f as FileNameValidationErrorReason, p as FileOperationKind, y as PATH_SEPARATOR_REGEXP, b as RESERVED_MARKER_NAME, x as UPLOAD_CONCURRENCY, ie as annotationToDisplayAttachment, ae as attachmentDtoToDisplayAttachment, oe as attachmentDtosToDisplayAttachments, U as buildFromCache, S as buildSharedItemVirtualPath, Q as createFilesApiClient, $ as createUploadFileWithProgress, fe as deriveActionProfile, C as dialCorePathToRelative, se as dialFileToAttachment, ce as dialFilesToAttachments, le as dialFolderPathToAttachment, W as fetchByTab, G as fetchForSearch, w as findDialFileByPath, K as findFirstSuccessfulCopyMoveItem, T as findFolderByVirtualPath, E as formatOperationFolderName, te as getUrlFileName, D as getVirtualPathName, O as hasDialFileWritePermission, k as hasForbiddenNameSymbols, A as hasSamePaths, j as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, ne as isExternalSourcePreviewable, M as isShareActionsAllowed, q as mapCorePermissions, J as mapFileMetadataToDialFile, Y as mapSearchItem, X as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, N as normalizeVirtualPath, ee as openAnnotationAttachment, P as parseNewFolderVirtualPath, V as prepareCopyItems, de as prepareDownloadDestination, H as prepareMoveRenameItems, z as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, re as resolveExternalSourceContentType, F as resolveOwnerCoords, n as resolveRelativeDialFilePath, I as resolveSectionByPath, s as sanitizeFileName, c as splitFileNameExtension, l as trimFileNameToByteLimit, L as unionPathSets, Z as updateEntry, pe as useDialFileListing, ve as useDialFileManager, ye as useDialFileManagerSections, be as useDialFileManagerTabConfig, me as useDialFileMetadata, he as useDialFileMutations, ge as useDialFileSharing, _e as useDialFileUploadBatch, xe as useFileAttachmentPicker, Se as useGridEditingScroll, B as virtualPathToApiPath, R as withRoutableRootLabels };
|