@epam/ai-dial-chat-hooks 1.2.0-dev.3 → 1.2.0-dev.300
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/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
- package/attachments.d.ts +10 -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 +7 -0
- package/catalog/map-skill-to-catalog-item.js +55 -48
- package/catalog/publish.js +6 -5
- package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +19 -17
- package/catalog.d.ts +159 -35
- package/catalog.js +23 -22
- package/conversation/announcement-message.js +16 -5
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/create-chat-stream-api.js +85 -49
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +27 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/message-utils.js +8 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +187 -177
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +50 -32
- package/conversation/useConversationScroll/useConversationScroll.js +68 -64
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/frame-scheduler.js +39 -0
- package/conversation/useConversationStream/generation-resume.js +122 -64
- package/conversation/useConversationStream/useConversationStream.js +279 -116
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation/useTranscribeAudio/transcription-retry.js +5 -4
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -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 +328 -25
- package/conversation.js +32 -30
- package/file-manager-canvas.d.ts +418 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +155 -359
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +116 -55
- package/files/attachment-types.js +14 -13
- 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 -19
- package/files/useDialFileMutations/useDialFileMutations.js +65 -60
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +48 -0
- package/index.d.ts +1281 -136
- package/index.js +136 -122
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
- package/mcp-apps.d.ts +8 -6
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +32 -0
- package/oauth.js +9 -9
- package/package.json +37 -22
- package/scheduled-task/scheduled-task-description.js +81 -0
- package/scheduled-task/scheduled-task-preparation.js +24 -0
- package/scheduled-task/scheduled-task-trigger.js +74 -71
- package/scheduled-task/scheduled-tasks-api-client.js +19 -0
- package/scheduled-task/use-scheduled-task-runs.js +194 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +197 -3
- package/scheduled-tasks.js +7 -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 +53 -27
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
- package/skill/useSkillEditorLoad.js +65 -59
- package/skill/useSkillEditorSubmit.js +108 -84
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +160 -8
- package/skill-editor.js +9 -8
- package/usage/map-usage-data-to-dashboard.js +66 -0
- package/usage/map-user-usage-to-model-limits.js +202 -0
- package/usage.d.ts +125 -0
- package/usage.js +3 -0
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +26 -6
- package/utils.js +10 -10
package/file-manager.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Annotation } from '@epam/ai-dial-chat-shared';
|
|
2
|
-
import { AnnotationGroup } from '@epam/ai-dial-quotations';
|
|
3
2
|
import { ArchiveItemDto } from '@epam/ai-dial-chat-api-client';
|
|
4
3
|
import { Attachment } from '@epam/ai-dial-chat-shared';
|
|
5
4
|
import { AttachmentDisplayResolvers } from '@epam/ai-dial-chat-shared';
|
|
@@ -8,8 +7,6 @@ import { CopyFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
|
8
7
|
import { CopyItemDto } from '@epam/ai-dial-chat-api-client';
|
|
9
8
|
import { CreateFolderDto } from '@epam/ai-dial-chat-api-client';
|
|
10
9
|
import { CreateFolderResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
11
|
-
import { CustomVisualizer } from '@epam/ai-dial-chat-shared';
|
|
12
|
-
import type { CustomVisualizerDataLayout } from '@epam/ai-dial-chat-shared';
|
|
13
10
|
import { DeleteFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
14
11
|
import { DeleteItemDto } from '@epam/ai-dial-chat-api-client';
|
|
15
12
|
import { DialCopiedItem } from '@epam/ai-dial-react-file-manager';
|
|
@@ -27,15 +24,16 @@ import { DiscardSharedItemDto } from '@epam/ai-dial-chat-api-client';
|
|
|
27
24
|
import { DiscardSharedResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
28
25
|
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
29
26
|
import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
27
|
+
import { FileManagerSelectableNode } from '@epam/ai-dial-chat-shared';
|
|
30
28
|
import { FileMetadataResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
31
29
|
import { FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
30
|
+
import { FileTreeOptions } from '@epam/ai-dial-react-file-manager';
|
|
32
31
|
import { FileUploadBatchState } from '@epam/ai-dial-chat-shared';
|
|
33
32
|
import { FileUploadEntry } from '@epam/ai-dial-chat-shared';
|
|
34
33
|
import { FileUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
35
34
|
import { FileUploadStatus } from '@epam/ai-dial-chat-shared';
|
|
36
35
|
import { FileUploadValidationResult } from '@epam/ai-dial-chat-shared';
|
|
37
|
-
import {
|
|
38
|
-
import type { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
36
|
+
import { FilterChipItem } from '@epam/ai-dial-ui-kit';
|
|
39
37
|
import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
40
38
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
41
39
|
import { ListPublicFilesRequest } from '@epam/ai-dial-chat-api-client';
|
|
@@ -48,8 +46,6 @@ import { RenameFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
|
48
46
|
import { RenameItemDto } from '@epam/ai-dial-chat-api-client';
|
|
49
47
|
import { RevokeAccessItemDto } from '@epam/ai-dial-chat-api-client';
|
|
50
48
|
import { RevokeAccessResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
51
|
-
import { TabModel } from '@epam/ai-dial-ui-kit';
|
|
52
|
-
import { ToolbarOptions } from '@epam/ai-dial-react-file-manager';
|
|
53
49
|
import { UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
54
50
|
import { useGridEditingScroll } from '@epam/ai-dial-chat-shared';
|
|
55
51
|
import { UseGridEditingScrollOptions } from '@epam/ai-dial-chat-shared';
|
|
@@ -58,55 +54,6 @@ import { UseGridEditingScrollResult } from '@epam/ai-dial-chat-shared';
|
|
|
58
54
|
/** Maps an annotation's source attachment to the display-only attachment model. */
|
|
59
55
|
export declare const annotationToDisplayAttachment: (annotation: Annotation) => DisplayAttachment | null;
|
|
60
56
|
|
|
61
|
-
/**
|
|
62
|
-
* Builds an `OoxmlCanvasContent` for a DOCX/PPTX/XLSX citation annotation,
|
|
63
|
-
* including highlights for every annotation sharing the clicked one's source
|
|
64
|
-
* document. Returns `null` when the annotation has no source attachment,
|
|
65
|
-
* the source is not a format `@silurus/ooxml` renders as DOCX/XLSX/PPTX (a
|
|
66
|
-
* CSV source returns `null` — citation highlighting targets Office documents
|
|
67
|
-
* only), or no URL resolves.
|
|
68
|
-
*/
|
|
69
|
-
export declare const annotationToOoxmlCanvasContent: (annotation: Annotation, annotations: Annotation[], resolvers: AttachmentCanvasUrlResolvers) => OoxmlCanvasContent | null;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
73
|
-
* for the clicked annotation's document within its citation group.
|
|
74
|
-
* Returns `null` if the annotation has no PDF source attachment.
|
|
75
|
-
*/
|
|
76
|
-
export declare const annotationToPdfCanvasContent: (annotation: Annotation, groups: AnnotationGroup[], resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* DIAL-file URL resolution injected by the host into every attachment-canvas
|
|
80
|
-
* content resolver below. Host-owned — encodes the app's own
|
|
81
|
-
* file-download endpoint.
|
|
82
|
-
*/
|
|
83
|
-
export declare interface AttachmentCanvasUrlResolvers {
|
|
84
|
-
/** Resolves a DIAL Core file id to a downloadable URL. */
|
|
85
|
-
resolveDialFileDownloadUrl: (fileId: string) => string | undefined;
|
|
86
|
-
/** Resolves the best downloadable DIAL-file URL from an attachment's `url` or `referenceUrl`. */
|
|
87
|
-
resolveDialUrl: (attachment: DisplayAttachment) => string | undefined;
|
|
88
|
-
/** Resolves a DIAL Core file id to a fetchable metadata URL (used for cache-freshness validation). */
|
|
89
|
-
resolveDialFileMetadataUrl: (fileId: string) => string | undefined;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** The type of content the canvas can display. */
|
|
93
|
-
declare enum AttachmentContentType {
|
|
94
|
-
PlainText = 'plain_text',
|
|
95
|
-
Image = 'image',
|
|
96
|
-
Audio = 'audio',
|
|
97
|
-
Markdown = 'markdown',
|
|
98
|
-
MarkdownTable = 'markdown_table',
|
|
99
|
-
Json = 'json',
|
|
100
|
-
Pdf = 'pdf',
|
|
101
|
-
Ooxml = 'ooxml',
|
|
102
|
-
Code = 'code',
|
|
103
|
-
Html = 'html',
|
|
104
|
-
Visualizer = 'visualizer',
|
|
105
|
-
McpApp = 'mcp_app',
|
|
106
|
-
Unsupported = 'unsupported',
|
|
107
|
-
Error = 'error',
|
|
108
|
-
}
|
|
109
|
-
|
|
110
57
|
/** Maps Chat API attachment DTOs to display-only attachment models. */
|
|
111
58
|
export declare const attachmentDtosToDisplayAttachments: (dtos: MessageAttachment[] | undefined, resolvers: AttachmentDisplayResolvers) => DisplayAttachment[];
|
|
112
59
|
|
|
@@ -115,14 +62,6 @@ export declare const attachmentDtosToDisplayAttachments: (dtos: MessageAttachmen
|
|
|
115
62
|
*/
|
|
116
63
|
export declare const attachmentDtoToDisplayAttachment: (dto: MessageAttachment, resolvers: AttachmentDisplayResolvers) => DisplayAttachment;
|
|
117
64
|
|
|
118
|
-
/** The kind of failure that produced an `ErrorCanvasContent`. */
|
|
119
|
-
declare enum AttachmentErrorType {
|
|
120
|
-
/** The file failed to load (network error or a non-`403` non-OK response). */
|
|
121
|
-
LoadFailed = 'load_failed',
|
|
122
|
-
/** The file request failed with HTTP `403` — the user lacks permission to access it. */
|
|
123
|
-
Forbidden = 'forbidden',
|
|
124
|
-
}
|
|
125
|
-
|
|
126
65
|
export declare const buildFromCache: (cache: Map<string, ListFilesItemDto[]>, listingPermissionsCache: Map<string, string[] | undefined>, apiPath: string, virtualBasePath: string, folderId: string) => DialFile[];
|
|
127
66
|
|
|
128
67
|
/**
|
|
@@ -136,19 +75,6 @@ export declare const buildFromCache: (cache: Map<string, ListFilesItemDto[]>, li
|
|
|
136
75
|
*/
|
|
137
76
|
export declare const buildSharedItemVirtualPath: (relativePath: string, rootLabel: string, isFolder: boolean) => string;
|
|
138
77
|
|
|
139
|
-
/** Clears all cached fetch results. Call this when leaving a conversation. */
|
|
140
|
-
export declare const clearAttachmentCache: () => void;
|
|
141
|
-
|
|
142
|
-
/** Content payload for syntax-highlighted source-code or text file attachments. */
|
|
143
|
-
declare interface CodeCanvasContent {
|
|
144
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
145
|
-
type: AttachmentContentType.Code;
|
|
146
|
-
/** The raw source text to display. */
|
|
147
|
-
text: string;
|
|
148
|
-
/** `react-syntax-highlighter` language identifier (e.g. `'typescript'`). `undefined` renders plain monospace. */
|
|
149
|
-
language?: string;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
78
|
export declare const COLUMNS_WITH_AUTHOR: FileManagerColumnKey[];
|
|
153
79
|
|
|
154
80
|
export declare const COLUMNS_WITHOUT_AUTHOR: FileManagerColumnKey[];
|
|
@@ -196,12 +122,19 @@ export declare const DATE_OPTIONS: Intl.DateTimeFormatOptions;
|
|
|
196
122
|
|
|
197
123
|
export declare const deriveActionProfile: (variant: DialFileManagerVariant) => DialFileManagerActionProfile;
|
|
198
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
|
+
|
|
199
128
|
/** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
|
|
200
129
|
export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
|
|
201
130
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
+
}
|
|
205
138
|
|
|
206
139
|
/**
|
|
207
140
|
* Operation port every file-manager hook that performs network I/O accepts as
|
|
@@ -335,18 +268,6 @@ export declare enum DownloadDestinationType {
|
|
|
335
268
|
Cancelled = "cancelled"
|
|
336
269
|
}
|
|
337
270
|
|
|
338
|
-
/** Content payload for attachments whose file failed to load or that the user cannot access. */
|
|
339
|
-
declare interface ErrorCanvasContent {
|
|
340
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
341
|
-
type: AttachmentContentType.Error;
|
|
342
|
-
/** The kind of failure that occurred. */
|
|
343
|
-
errorType: AttachmentErrorType;
|
|
344
|
-
/** Remote URL of the file, if known. Ignored for download purposes when `errorType` is `Forbidden`. */
|
|
345
|
-
url?: string;
|
|
346
|
-
/** Overrides the default `loadErrorLabel`/`forbiddenErrorLabel` message, for callers whose failed content isn't a generic "file" (e.g. an MCP App). */
|
|
347
|
-
label?: string;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
271
|
export declare const fetchByTab: (filesApi: DialFilesApi, tab: DialFileManagerTabs, bucket: string, folderPath: string, sharedRootMeta: Map<string, SharedRootMeta>) => Promise<{
|
|
351
272
|
items: ListFilesItemDto[];
|
|
352
273
|
permissions?: string[];
|
|
@@ -429,7 +350,9 @@ export declare enum FileManagerNotificationReason {
|
|
|
429
350
|
/** `onUploadArchive` extracted some entries successfully and some failed; `count`/`names`/`restCount` describe the failures. */
|
|
430
351
|
UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed",
|
|
431
352
|
/** `onUploadArchive`'s `uploadArchive` request itself rejected. */
|
|
432
|
-
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"
|
|
433
356
|
}
|
|
434
357
|
|
|
435
358
|
/**
|
|
@@ -450,8 +373,6 @@ export declare type FileNameValidationError = {
|
|
|
450
373
|
} | {
|
|
451
374
|
reason: FileNameValidationErrorReason.DuplicateName;
|
|
452
375
|
existingName: string;
|
|
453
|
-
} | {
|
|
454
|
-
reason: FileNameValidationErrorReason.LeadingDot;
|
|
455
376
|
};
|
|
456
377
|
|
|
457
378
|
/**
|
|
@@ -464,8 +385,7 @@ export declare enum FileNameValidationErrorReason {
|
|
|
464
385
|
ForbiddenSymbols = "forbiddenSymbols",
|
|
465
386
|
ReservedName = "reservedName",
|
|
466
387
|
TooLong = "tooLong",
|
|
467
|
-
DuplicateName = "duplicateName"
|
|
468
|
-
LeadingDot = "leadingDot"
|
|
388
|
+
DuplicateName = "duplicateName"
|
|
469
389
|
}
|
|
470
390
|
|
|
471
391
|
/**
|
|
@@ -482,7 +402,10 @@ export declare enum FileOperationKind {
|
|
|
482
402
|
FileCopied = "fileCopied",
|
|
483
403
|
FilesCopied = "filesCopied",
|
|
484
404
|
FileMoved = "fileMoved",
|
|
485
|
-
FilesMoved = "filesMoved"
|
|
405
|
+
FilesMoved = "filesMoved",
|
|
406
|
+
/** A copy whose every item landed in its own source folder (Duplicate). */
|
|
407
|
+
FileDuplicated = "fileDuplicated",
|
|
408
|
+
FilesDuplicated = "filesDuplicated"
|
|
486
409
|
}
|
|
487
410
|
|
|
488
411
|
/**
|
|
@@ -497,13 +420,15 @@ export declare interface FileOperationSuccessEvent {
|
|
|
497
420
|
name?: string;
|
|
498
421
|
/** Number of items the operation covered, when applicable. */
|
|
499
422
|
count?: number;
|
|
500
|
-
/**
|
|
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
|
+
*/
|
|
501
427
|
destinationFolderName?: string;
|
|
502
428
|
/**
|
|
503
|
-
* Whether the affected item is a folder rather than a file.
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
* "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).
|
|
507
432
|
*/
|
|
508
433
|
isFolder?: boolean;
|
|
509
434
|
}
|
|
@@ -538,8 +463,6 @@ export declare interface FilesApiClient {
|
|
|
538
463
|
listSharedByMe: (bucket: string) => Promise<ListFilesResponseDto>;
|
|
539
464
|
}
|
|
540
465
|
|
|
541
|
-
export { FileUploadValidationResult }
|
|
542
|
-
|
|
543
466
|
export declare const findDialFileByPath: (nodes: DialFile[], targetPath: string) => DialFile | undefined;
|
|
544
467
|
|
|
545
468
|
export declare const findFirstSuccessfulCopyMoveItem: <TDto extends {
|
|
@@ -556,8 +479,6 @@ export declare const findFolderByVirtualPath: (nodes: DialFile[], virtualPath: s
|
|
|
556
479
|
|
|
557
480
|
export declare const formatOperationFolderName: (destinationFolder: string, rootLabel: string) => string;
|
|
558
481
|
|
|
559
|
-
export { getParentFolderPath }
|
|
560
|
-
|
|
561
482
|
/**
|
|
562
483
|
* Returns the last path segment of `url` — its file name — for both absolute
|
|
563
484
|
* URLs and DIAL-relative resource paths such as
|
|
@@ -570,35 +491,12 @@ export declare const getUrlFileName: (url: string) => string;
|
|
|
570
491
|
|
|
571
492
|
export declare const getVirtualPathName: (virtualPath: string, fallback: string) => string;
|
|
572
493
|
|
|
573
|
-
/**
|
|
574
|
-
* Whether the attachment carries text `resolveAttachmentText` can resolve —
|
|
575
|
-
* inline data, a DIAL download URL, or a locally-picked file. Mirrors that
|
|
576
|
-
* function's source list, so a `null` resolver result can be read as "the text
|
|
577
|
-
* was fetched and rejected" rather than "there was no text to fetch".
|
|
578
|
-
*/
|
|
579
|
-
export declare const hasAttachmentTextSource: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => boolean;
|
|
580
|
-
|
|
581
494
|
export declare const hasDialFileWritePermission: (folder?: DialFile) => boolean;
|
|
582
495
|
|
|
583
496
|
export declare const hasForbiddenNameSymbols: (name: string, forbiddenSymbolsRegExp?: RegExp) => boolean;
|
|
584
497
|
|
|
585
|
-
/**
|
|
586
|
-
declare
|
|
587
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
588
|
-
type: AttachmentContentType.Html;
|
|
589
|
-
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe. Used for file attachments. */
|
|
590
|
-
srcdoc?: string;
|
|
591
|
-
/** External URL rendered via `src` in a sandboxed iframe. Used for external link sources. */
|
|
592
|
-
url?: string;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/** Content payload for image attachments. */
|
|
596
|
-
declare interface ImageCanvasContent {
|
|
597
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
598
|
-
type: AttachmentContentType.Image;
|
|
599
|
-
/** URL of the image to display (object URL or resolved download URL). */
|
|
600
|
-
url: string;
|
|
601
|
-
}
|
|
498
|
+
/** Returns `true` when both sets contain exactly the same paths. */
|
|
499
|
+
export declare const hasSamePaths: (a: ReadonlySet<string>, b: ReadonlySet<string>) => boolean;
|
|
602
500
|
|
|
603
501
|
/** Copy/Move/Duplicate are Browse/Full-only — the attach picker excludes them. */
|
|
604
502
|
export declare const isCopyMoveDuplicateAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
@@ -615,14 +513,6 @@ export declare const isExternalSourcePreviewable: (contentType: string, url: str
|
|
|
615
513
|
/** Share/Unshare/Remove access are Full-only — Browse and Attach never expose them. */
|
|
616
514
|
export declare const isShareActionsAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
617
515
|
|
|
618
|
-
/** Content payload for JSON file attachments. */
|
|
619
|
-
declare interface JsonCanvasContent {
|
|
620
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
621
|
-
type: AttachmentContentType.Json;
|
|
622
|
-
/** Already-parsed JSON value. The lib never calls JSON.parse. */
|
|
623
|
-
value: unknown;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
516
|
export declare const mapCorePermissions: (permissions?: string[]) => DialFile["permissions"] | undefined;
|
|
627
517
|
|
|
628
518
|
/**
|
|
@@ -636,20 +526,19 @@ export declare const mapFileMetadataToDialFile: (metadata: FileMetadataResponseD
|
|
|
636
526
|
|
|
637
527
|
export declare const mapSearchItem: (item: ListFilesItemDto, fallbackBucket: string, rootLabel: string) => DialFile;
|
|
638
528
|
|
|
639
|
-
/** Content payload for Markdown file attachments. */
|
|
640
|
-
declare interface MarkdownCanvasContent {
|
|
641
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
642
|
-
type: AttachmentContentType.Markdown;
|
|
643
|
-
/** Raw Markdown string to render. */
|
|
644
|
-
text: string;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
529
|
export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesItemDto[]>, parentApiPath: string, created: CreateFolderResponseDto, inheritedPermissions?: string[]) => Map<string, ListFilesItemDto[]>;
|
|
648
530
|
|
|
649
531
|
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
650
532
|
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
651
533
|
|
|
652
|
-
/**
|
|
534
|
+
/**
|
|
535
|
+
* Normalizes `*` to the all-files wildcard, canonicalizes MIME aliases, and drops
|
|
536
|
+
* any value that is not a valid `DialFileAcceptType`.
|
|
537
|
+
*
|
|
538
|
+
* Aliases are resolved because a file picker matches an `accept` entry against its
|
|
539
|
+
* own MIME table: a declared `text/json` offers no `.json` file, while the
|
|
540
|
+
* `application/json` it denotes does.
|
|
541
|
+
*/
|
|
653
542
|
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
654
543
|
|
|
655
544
|
/**
|
|
@@ -661,104 +550,6 @@ export declare const mimeTypesToFileAccept: (types?: string[]) => string | undef
|
|
|
661
550
|
|
|
662
551
|
export declare const normalizeVirtualPath: (value: string) => string;
|
|
663
552
|
|
|
664
|
-
/** Content payload for OOXML document and CSV spreadsheet attachments. */
|
|
665
|
-
declare interface OoxmlCanvasContent {
|
|
666
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
667
|
-
type: AttachmentContentType.Ooxml;
|
|
668
|
-
/** Resolved download URL or object URL for the source file. */
|
|
669
|
-
url: string;
|
|
670
|
-
/** The document format used to select and configure the format-specific renderer. */
|
|
671
|
-
format: OoxmlFileType;
|
|
672
|
-
/** Cited locations to draw over the document. Omitted, never `[]`, when there is nothing to highlight. */
|
|
673
|
-
highlights?: OoxmlHighlight[];
|
|
674
|
-
/** Id of the highlight to navigate to and emphasise. Omitted when the clicked citation resolved to no location. */
|
|
675
|
-
selectedHighlightId?: string;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
/** A 1-based cell address, matching `@silurus/ooxml`'s own `CellAddress`. */
|
|
679
|
-
declare interface OoxmlCellAddress {
|
|
680
|
-
/** 1-based row number. */
|
|
681
|
-
row: number;
|
|
682
|
-
/** 1-based column number. */
|
|
683
|
-
col: number;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/** A cited character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
687
|
-
declare interface OoxmlDocxHighlightLocation {
|
|
688
|
-
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
689
|
-
kind: OoxmlHighlightKind.DocxTextRange;
|
|
690
|
-
/** Name of the DOCX story the range lives in, as an opaque string (only `'body'` is confirmed upstream). */
|
|
691
|
-
story: string;
|
|
692
|
-
/** Source-tree element indices identifying the paragraph, matched element-wise. */
|
|
693
|
-
path: number[];
|
|
694
|
-
/** Inclusive start character offset within the story's matched text. */
|
|
695
|
-
start: number;
|
|
696
|
-
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
697
|
-
endExclusive: number;
|
|
698
|
-
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
699
|
-
text: string;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
/** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
|
|
703
|
-
declare enum OoxmlFileType {
|
|
704
|
-
Docx = 'docx',
|
|
705
|
-
Xlsx = 'xlsx',
|
|
706
|
-
Pptx = 'pptx',
|
|
707
|
-
Csv = 'csv',
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
/** One citation's highlight: the locations it resolved to, under a stable id. */
|
|
711
|
-
declare interface OoxmlHighlight {
|
|
712
|
-
/** Stable id, used to mark exactly one highlight selected. */
|
|
713
|
-
id: string;
|
|
714
|
-
/** One or more locations — a single citation may carry several selectors. */
|
|
715
|
-
locations: OoxmlHighlightLocation[];
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
/** Discriminates the Office highlight location descriptors an `OoxmlCanvasContent` can carry. */
|
|
719
|
-
declare enum OoxmlHighlightKind {
|
|
720
|
-
/** A character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
721
|
-
DocxTextRange = 'docxTextRange',
|
|
722
|
-
/** A character range inside a single PPTX shape on one slide. */
|
|
723
|
-
PptxTextRange = 'pptxTextRange',
|
|
724
|
-
/** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
|
|
725
|
-
XlsxCellRange = 'xlsxCellRange',
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
/** A cited location inside an Office document, in document coordinates. */
|
|
729
|
-
declare type OoxmlHighlightLocation =
|
|
730
|
-
| OoxmlDocxHighlightLocation
|
|
731
|
-
| OoxmlPptxHighlightLocation
|
|
732
|
-
| OoxmlXlsxHighlightLocation;
|
|
733
|
-
|
|
734
|
-
/** A cited character range inside a single shape on one PPTX slide. */
|
|
735
|
-
declare interface OoxmlPptxHighlightLocation {
|
|
736
|
-
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
737
|
-
kind: OoxmlHighlightKind.PptxTextRange;
|
|
738
|
-
/** 1-based slide number. */
|
|
739
|
-
slide: number;
|
|
740
|
-
/** Shape identifier, compared as a string against the run's own `shapeId`. */
|
|
741
|
-
shapeId: string;
|
|
742
|
-
/** Inclusive start character offset within the shape's matched text. */
|
|
743
|
-
start: number;
|
|
744
|
-
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
745
|
-
endExclusive: number;
|
|
746
|
-
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
747
|
-
text: string;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
/** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
|
|
751
|
-
declare interface OoxmlXlsxHighlightLocation {
|
|
752
|
-
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
753
|
-
kind: OoxmlHighlightKind.XlsxCellRange;
|
|
754
|
-
/** Sheet name, matched exactly against the workbook's own sheet names. */
|
|
755
|
-
sheet: string;
|
|
756
|
-
/** First cell of the range. 1-based, passed to the viewer unconverted. */
|
|
757
|
-
start: OoxmlCellAddress;
|
|
758
|
-
/** Last cell of the range, on the same row as `start`. Omitted for a single cell. */
|
|
759
|
-
end?: OoxmlCellAddress;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
553
|
/**
|
|
763
554
|
* Opens a cited/referenced attachment: triggers a browser download for
|
|
764
555
|
* DIAL-hosted files (`files/...` ids) via the injected `resolveDownloadUrl`,
|
|
@@ -774,28 +565,6 @@ export declare const parseNewFolderVirtualPath: (newFolderVirtualPath: string, r
|
|
|
774
565
|
|
|
775
566
|
export declare const PATH_SEPARATOR_REGEXP: RegExp;
|
|
776
567
|
|
|
777
|
-
/** Content payload for PDF file attachments. */
|
|
778
|
-
declare interface PdfCanvasContent {
|
|
779
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
780
|
-
type: AttachmentContentType.Pdf;
|
|
781
|
-
/** Resolved download URL or object URL for the PDF file. */
|
|
782
|
-
url: string;
|
|
783
|
-
/** Highlight regions to render over the PDF pages. */
|
|
784
|
-
highlights?: InputHighlightData[];
|
|
785
|
-
/** ID of the highlight to scroll to and select on initial load. */
|
|
786
|
-
selectedHighlightId?: string;
|
|
787
|
-
/** 1-based page to navigate to on initial load, independent of highlight geometry. */
|
|
788
|
-
page?: number;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
/** Content payload for plain-text attachments. */
|
|
792
|
-
declare interface PlainTextCanvasContent {
|
|
793
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
794
|
-
type: AttachmentContentType.PlainText;
|
|
795
|
-
/** The raw text to display. */
|
|
796
|
-
text: string;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
568
|
/** Builds the `copyFiles` DTOs (with their destination display name) for `onCopyFiles`. */
|
|
800
569
|
export declare const prepareCopyItems: (copiedItems: DialCopiedItem[], bucket: string, rootLabel: string) => PreparedCopyMoveItem<CopyItemDto>[];
|
|
801
570
|
|
|
@@ -812,7 +581,7 @@ export declare interface PreparedCopyMoveItem<TDto> {
|
|
|
812
581
|
export declare const prepareDownloadDestination: (filename: string, mimeType?: string) => Promise<DownloadDestination>;
|
|
813
582
|
|
|
814
583
|
/**
|
|
815
|
-
* 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
|
|
816
585
|
* is unchanged become `renameDtos`; entries whose parent folder changed
|
|
817
586
|
* become `preparedMoveItems`.
|
|
818
587
|
*/
|
|
@@ -821,21 +590,9 @@ export declare const prepareMoveRenameItems: (copiedItems: DialCopiedItem[], buc
|
|
|
821
590
|
preparedMoveItems: PreparedCopyMoveItem<MoveItemDto>[];
|
|
822
591
|
};
|
|
823
592
|
|
|
824
|
-
/**
|
|
825
|
-
* Builds a `PdfCanvasContent` for a reference-only attachment whose
|
|
826
|
-
* `reference_url` points at a PDF file (optionally with a `#page=N`
|
|
827
|
-
* fragment), so it can be opened in the canvas and scrolled to the
|
|
828
|
-
* referenced page the same way a regular PDF citation is. Returns `null`
|
|
829
|
-
* when the attachment's `url` does not target a PDF.
|
|
830
|
-
*/
|
|
831
|
-
export declare const referenceAttachmentToPdfCanvasContent: (attachment: AttachmentResource, resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
832
|
-
|
|
833
593
|
/** Name reserved for the hidden marker file used to create empty folders. */
|
|
834
594
|
export declare const RESERVED_MARKER_NAME = ".dial_folder";
|
|
835
595
|
|
|
836
|
-
/** Resolves a syntax-highlighted code canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
837
|
-
export declare const resolveCodeCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, language?: string) => Promise<CodeCanvasContent | ErrorCanvasContent | null>;
|
|
838
|
-
|
|
839
596
|
/**
|
|
840
597
|
* Resolves a DialFile to the bucket-relative API path used by files BFF endpoints.
|
|
841
598
|
* Prefers DIAL resource ids when present; otherwise converts DialFile.path virtual paths.
|
|
@@ -870,35 +627,6 @@ declare type ResolveDownloadUrl = (fileId: string) => string | undefined;
|
|
|
870
627
|
*/
|
|
871
628
|
export declare const resolveExternalSourceContentType: (contentType: string, url: string) => string;
|
|
872
629
|
|
|
873
|
-
/**
|
|
874
|
-
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
875
|
-
* Fetches and inlines the HTML as `srcdoc` when the attachment has a download URL or inline data.
|
|
876
|
-
* Returns `null` if no source is available, or an `ErrorCanvasContent` on fetch failure.
|
|
877
|
-
* Rejects `srcdoc` payloads larger than 1 MiB to prevent browser truncation.
|
|
878
|
-
*/
|
|
879
|
-
export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* Resolves an image canvas content payload from a DisplayAttachment without
|
|
883
|
-
* fetching — returns the BFF download URL (or a local/inline blob URL)
|
|
884
|
-
* directly so the browser cache can be shared with the conversation view's
|
|
885
|
-
* `<img>` element. Error detection is delegated to `<img onError>` in the
|
|
886
|
-
* canvas renderer. Returns `null` if no URL source is available.
|
|
887
|
-
*/
|
|
888
|
-
export declare const resolveImageCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => ImageCanvasContent | null;
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Resolves a JSON canvas content payload from a DisplayAttachment, or `null` if unavailable.
|
|
892
|
-
* Falls back to `PlainTextCanvasContent` when the fetched text is not valid JSON.
|
|
893
|
-
*/
|
|
894
|
-
export declare const resolveJsonCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<JsonCanvasContent | PlainTextCanvasContent | ErrorCanvasContent | null>;
|
|
895
|
-
|
|
896
|
-
/** Resolves a Markdown canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
897
|
-
export declare const resolveMarkdownCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<MarkdownCanvasContent | ErrorCanvasContent | null>;
|
|
898
|
-
|
|
899
|
-
/** Resolves an OOXML or CSV renderer payload from a DisplayAttachment, or `null` if unavailable. */
|
|
900
|
-
export declare const resolveOoxmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, format: OoxmlFileType) => Promise<OoxmlCanvasContent | ErrorCanvasContent | null>;
|
|
901
|
-
|
|
902
630
|
/**
|
|
903
631
|
* Resolves the effective bucket and path for a write operation on the Shared tab.
|
|
904
632
|
* For Shared tab items, the first segment of apiPath is the shared root folder name
|
|
@@ -909,29 +637,14 @@ export declare const resolveOwnerCoords: (apiPath: string, sharedRootMeta: Map<s
|
|
|
909
637
|
path: string;
|
|
910
638
|
};
|
|
911
639
|
|
|
912
|
-
/** Resolves a PDF canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
913
|
-
export declare const resolvePdfCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<PdfCanvasContent | ErrorCanvasContent | null>;
|
|
914
|
-
|
|
915
640
|
/**
|
|
916
641
|
* Converts a DIAL file ID or full resource path to the relative bucket path
|
|
917
642
|
* expected by the files download API.
|
|
918
643
|
*/
|
|
919
644
|
export declare const resolveRelativeDialFilePath: (pathOrFileId: string, bucket: string) => string;
|
|
920
645
|
|
|
921
|
-
/**
|
|
922
|
-
export declare const
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* Fetches the attachment payload and builds a `VisualizerCanvasContent` for the
|
|
926
|
-
* given registry entry and theme. Returns `null` when the payload cannot be
|
|
927
|
-
* fetched (caller should fall through to default content-type handling).
|
|
928
|
-
*
|
|
929
|
-
* Only JSON payloads are parsed into `data`. Non-JSON payloads (plain text,
|
|
930
|
-
* CSV, binary, …) resolve with `data: {}` — the visualizer still receives
|
|
931
|
-
* `mimeType` and `layout`, just no payload body. This is intentional: only
|
|
932
|
-
* JSON attachment content is forwarded to visualizers in this version.
|
|
933
|
-
*/
|
|
934
|
-
export declare const resolveVisualizerCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, entry: CustomVisualizer, themeId: string) => Promise<VisualizerCanvasContent | null>;
|
|
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;
|
|
935
648
|
|
|
936
649
|
/**
|
|
937
650
|
* Sanitizes a filename for upload by replacing forbidden characters with `_`,
|
|
@@ -961,7 +674,10 @@ export declare const splitFileNameExtension: (fileName: string) => {
|
|
|
961
674
|
|
|
962
675
|
export declare const trimFileNameToByteLimit: (name: string, limit?: number) => string;
|
|
963
676
|
|
|
964
|
-
|
|
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;
|
|
965
681
|
|
|
966
682
|
/** Max number of files uploaded concurrently within a single upload batch. */
|
|
967
683
|
export declare const UPLOAD_CONCURRENCY = 3;
|
|
@@ -990,14 +706,14 @@ export declare type UploadMode = 'overwrite' | 'create-only';
|
|
|
990
706
|
* tree's expand/collapse state, search, and the shared per-folder cache that
|
|
991
707
|
* `useDialFileUploadBatch`/`useDialFileMutations`/`useDialFileSharing` invalidate
|
|
992
708
|
* through `invalidateFolders`/`bumpRetry` after their own mutations settle
|
|
993
|
-
* (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.
|
|
994
710
|
*
|
|
995
711
|
* Supports three listing sources via `activeTab`:
|
|
996
712
|
* - my_files: user's own bucket via `DialFilesApi.listFiles`
|
|
997
713
|
* - shared: files shared with the user via `DialFilesApi.listSharedFiles`
|
|
998
714
|
* - organization: public bucket via `DialFilesApi.listPublicFiles`
|
|
999
715
|
*/
|
|
1000
|
-
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;
|
|
1001
717
|
|
|
1002
718
|
/** Options accepted by `useDialFileListing`. */
|
|
1003
719
|
export declare interface UseDialFileListingOptions {
|
|
@@ -1011,6 +727,10 @@ export declare interface UseDialFileListingOptions {
|
|
|
1011
727
|
activeTab: DialFileManagerTabs;
|
|
1012
728
|
/** Called with a structured event when a folder-load operation fails. */
|
|
1013
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;
|
|
1014
734
|
}
|
|
1015
735
|
|
|
1016
736
|
/** Values returned by `useDialFileListing`. */
|
|
@@ -1046,7 +766,7 @@ export declare interface UseDialFileListingResult {
|
|
|
1046
766
|
/**
|
|
1047
767
|
* Deletes the given API-path cache keys so the next listing fetch/expand for
|
|
1048
768
|
* that folder re-fetches from the server. The only way sibling sub-hooks may
|
|
1049
|
-
* 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).
|
|
1050
770
|
*/
|
|
1051
771
|
invalidateFolders: (apiPaths: string[]) => void;
|
|
1052
772
|
/** Merges a just-created folder into its parent's cache entry (optimistic display for create-folder). */
|
|
@@ -1067,7 +787,7 @@ export declare interface UseDialFileListingResult {
|
|
|
1067
787
|
* every translated string reaches it through `labels`,
|
|
1068
788
|
* `disabledNewButtonTooltip`, and `buildValidationErrorMessage`.
|
|
1069
789
|
*/
|
|
1070
|
-
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;
|
|
1071
791
|
|
|
1072
792
|
export declare interface UseDialFileManagerOptions {
|
|
1073
793
|
/** Injected operation port used for every file-manager network call. */
|
|
@@ -1078,6 +798,10 @@ export declare interface UseDialFileManagerOptions {
|
|
|
1078
798
|
rootLabel?: string;
|
|
1079
799
|
/** Active tab — drives listing source and per-tab options. Defaults to MyFiles. */
|
|
1080
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;
|
|
1081
805
|
/** Called when a file-manager action should surface a toast notification. */
|
|
1082
806
|
onNotification?: (notification: FileManagerNotification) => void;
|
|
1083
807
|
/** Called when a mutation succeeds, instead of invoking an application notification service directly. */
|
|
@@ -1132,7 +856,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
1132
856
|
onSearchFiles: (folder: string, query: string) => void;
|
|
1133
857
|
/** Search: true while a search request is in flight. */
|
|
1134
858
|
isSearching: boolean;
|
|
1135
|
-
/** Search: flat
|
|
859
|
+
/** Search: flat, unfiltered recursive listing of the current folder, or null when search is not active. */
|
|
1136
860
|
searchResults: DialFile[] | null;
|
|
1137
861
|
/** Search: clears results and exits search mode. */
|
|
1138
862
|
clearSearchResults: () => void;
|
|
@@ -1156,7 +880,9 @@ export declare interface UseDialFileManagerResult {
|
|
|
1156
880
|
uploadBatchState: FileUploadBatchState | null;
|
|
1157
881
|
/** Upload: abort all in-flight and queued uploads. */
|
|
1158
882
|
cancelUpload: () => void;
|
|
1159
|
-
/** 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. */
|
|
1160
886
|
clearUploadBatch: () => void;
|
|
1161
887
|
/** Folder creation: called when user confirms a new folder name. */
|
|
1162
888
|
onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
|
|
@@ -1223,7 +949,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
1223
949
|
/**
|
|
1224
950
|
* True while any mutating file-manager operation is in flight: the OR of
|
|
1225
951
|
* `isCreatingFolder`, `isDownloading`, `isDeleting`, `isRenaming`, `isCopying`,
|
|
1226
|
-
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and
|
|
952
|
+
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and any upload still queued or running.
|
|
1227
953
|
*
|
|
1228
954
|
* Deliberately excludes three flags, each already fully contained by its own
|
|
1229
955
|
* scoped loading UI:
|
|
@@ -1234,17 +960,42 @@ export declare interface UseDialFileManagerResult {
|
|
|
1234
960
|
isAnyOperationInProgress: boolean;
|
|
1235
961
|
}
|
|
1236
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
|
+
|
|
1237
987
|
/**
|
|
1238
988
|
* Filters the file-manager's tab list down to the host's configured set and
|
|
1239
989
|
* resets `activeTab` to the highest-priority still-enabled tab when the
|
|
1240
990
|
* current one becomes excluded. A `fileManagerTabs` of `undefined` means no
|
|
1241
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.
|
|
1242
993
|
*/
|
|
1243
|
-
export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs:
|
|
994
|
+
export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs: FilterChipItem<DialFileManagerTabs>[] | undefined, fileManagerTabs: string[] | undefined) => UseDialFileManagerTabConfigResult;
|
|
1244
995
|
|
|
1245
996
|
/** Values returned by `useDialFileManagerTabConfig`. */
|
|
1246
997
|
export declare interface UseDialFileManagerTabConfigResult {
|
|
1247
|
-
tabs:
|
|
998
|
+
tabs: FileTreeOptions['tabs'];
|
|
1248
999
|
}
|
|
1249
1000
|
|
|
1250
1001
|
/**
|
|
@@ -1369,10 +1120,11 @@ export declare interface UseDialFileSharingResult {
|
|
|
1369
1120
|
|
|
1370
1121
|
/**
|
|
1371
1122
|
* Manages upload batches (single-file and ZIP-archive extraction), including
|
|
1372
|
-
* concurrency-limited progress tracking and abort.
|
|
1373
|
-
*
|
|
1374
|
-
* `
|
|
1375
|
-
* 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.
|
|
1376
1128
|
*/
|
|
1377
1129
|
export declare const useDialFileUploadBatch: ({ filesApi, bucket, rootLabel, activeTab, cache, sharedRootMetaRef, invalidateFolders, bumpRetry, onNotification, }: UseDialFileUploadBatchOptions) => UseDialFileUploadBatchResult;
|
|
1378
1130
|
|
|
@@ -1405,9 +1157,68 @@ export declare interface UseDialFileUploadBatchResult {
|
|
|
1405
1157
|
onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
|
|
1406
1158
|
uploadBatchState: FileUploadBatchState | null;
|
|
1407
1159
|
cancelUpload: () => void;
|
|
1160
|
+
cancelUploadFile: (id: string) => void;
|
|
1408
1161
|
clearUploadBatch: () => void;
|
|
1409
1162
|
}
|
|
1410
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* Composes the file-manager tab/listing hooks into the stateful part of an attachment picker:
|
|
1166
|
+
* active tab, selected paths, and hidden-path/MIME/size/folder row eligibility. Returns the
|
|
1167
|
+
* existing `useDialFileManager` controller unchanged and the selection/tab/eligibility fields
|
|
1168
|
+
* `FileManagerAttachModal` already consumes — it composes that modal, it does not replace it.
|
|
1169
|
+
* Final attachment filtering, deduplication, and count enforcement stay owned by the modal.
|
|
1170
|
+
*/
|
|
1171
|
+
export declare const useFileAttachmentPicker: ({ fileManagerOptions, bucket, forbiddenSymbolsRegExp, tabLabels, allowedTabs, initialTab, allowedTypes, maxSelectableFileSize, canAttachFolders, }: UseFileAttachmentPickerOptions) => UseFileAttachmentPickerResult;
|
|
1172
|
+
|
|
1173
|
+
/** Options accepted by {@link useFileAttachmentPicker}. */
|
|
1174
|
+
export declare interface UseFileAttachmentPickerOptions {
|
|
1175
|
+
/**
|
|
1176
|
+
* Configured `useDialFileManager` options besides the values this hook derives:
|
|
1177
|
+
* `bucket`, `activeTab`, `rootLabel`, `variant`, and `forbiddenSymbolsRegExp`.
|
|
1178
|
+
*/
|
|
1179
|
+
fileManagerOptions: Omit<UseDialFileManagerOptions, 'bucket' | 'activeTab' | 'rootLabel' | 'variant' | 'forbiddenSymbolsRegExp'>;
|
|
1180
|
+
/** DIAL Core bucket to browse. */
|
|
1181
|
+
bucket: string;
|
|
1182
|
+
/** Regexp of characters forbidden in file/folder names, forwarded to `useDialFileManager`. */
|
|
1183
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
1184
|
+
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
1185
|
+
tabLabels: Record<DialFileManagerTabs, string>;
|
|
1186
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
1187
|
+
allowedTabs?: string[];
|
|
1188
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
1189
|
+
initialTab?: DialFileManagerTabs;
|
|
1190
|
+
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
1191
|
+
allowedTypes?: string[];
|
|
1192
|
+
/** Files at or below this size (bytes) remain eligible; absent allows any size. */
|
|
1193
|
+
maxSelectableFileSize?: number;
|
|
1194
|
+
/** Whether folder rows are eligible for selection. Defaults to `false`. */
|
|
1195
|
+
canAttachFolders?: boolean;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/** Result returned by {@link useFileAttachmentPicker}. */
|
|
1199
|
+
export declare interface UseFileAttachmentPickerResult {
|
|
1200
|
+
/** The composed file-manager controller; forward to `FileManagerAttachModal`'s `controller` prop. */
|
|
1201
|
+
controller: UseDialFileManagerResult;
|
|
1202
|
+
/** Active tab. */
|
|
1203
|
+
activeTab: DialFileManagerTabs;
|
|
1204
|
+
/** Tab list filtered to `allowedTabs`; forward to `FileManagerAttachModal`'s `tabs` prop. */
|
|
1205
|
+
tabs: FileTreeOptions['tabs'];
|
|
1206
|
+
/** Switches the active tab and clears the current selection. */
|
|
1207
|
+
onTabChange: (tab: DialFileManagerTabs) => void;
|
|
1208
|
+
/** Currently selected paths. */
|
|
1209
|
+
selectedPaths: Set<string>;
|
|
1210
|
+
/** Replaces the selection with a defensive copy of the given set. */
|
|
1211
|
+
onSelectedPathsChange: (paths: Set<string>) => void;
|
|
1212
|
+
/** Row eligibility predicate; forward to `FileManagerAttachModal`'s `isRowSelectable` prop. */
|
|
1213
|
+
isRowSelectable: (node: {
|
|
1214
|
+
data?: FileManagerSelectableNode | null;
|
|
1215
|
+
}) => boolean;
|
|
1216
|
+
/** MIME eligibility predicate; forward to `FileManagerAttachModal`'s `isFileTypeAllowed` prop. */
|
|
1217
|
+
isFileTypeAllowed: (contentType: string) => boolean;
|
|
1218
|
+
/** Accepted upload MIME types; forward to `FileManagerAttachModal`'s `allowedFileTypes` prop. */
|
|
1219
|
+
allowedFileTypes: DialFileAcceptType[] | undefined;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1411
1222
|
export { useGridEditingScroll }
|
|
1412
1223
|
|
|
1413
1224
|
export { UseGridEditingScrollOptions }
|
|
@@ -1420,22 +1231,7 @@ export { UseGridEditingScrollResult }
|
|
|
1420
1231
|
*/
|
|
1421
1232
|
export declare const virtualPathToApiPath: (virtualPath: string, rootLabel: string) => string;
|
|
1422
1233
|
|
|
1423
|
-
/**
|
|
1424
|
-
declare
|
|
1425
|
-
/** Discriminates the content type to select the correct renderer. */
|
|
1426
|
-
type: AttachmentContentType.Visualizer;
|
|
1427
|
-
/** Iframe `src`, resolved from the matching registry entry's `url`. */
|
|
1428
|
-
url: string;
|
|
1429
|
-
/** The attachment's own MIME type (not the registry entry's raw, possibly comma-separated, `contentType`). */
|
|
1430
|
-
mimeType: string;
|
|
1431
|
-
/** Opaque attachment payload consumed by the visualizer. */
|
|
1432
|
-
data: unknown;
|
|
1433
|
-
/** Presentation layout hints (`themeId`, `width`, `height`, `mobileHeight`). */
|
|
1434
|
-
layout: CustomVisualizerDataLayout;
|
|
1435
|
-
/** postMessage protocol namespace — MUST equal the registry entry's `title`, or the iframe never receives data. */
|
|
1436
|
-
visualizerName: string;
|
|
1437
|
-
/** Milliseconds to wait for a `send()` request's response before rejecting. From the registry entry; does NOT bound the handshake. */
|
|
1438
|
-
requestTimeout?: number;
|
|
1439
|
-
}
|
|
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[];
|
|
1440
1236
|
|
|
1441
1237
|
export { }
|