@epam/ai-dial-chat-hooks 1.2.0-dev.75 → 1.2.0-dev.78
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/file-manager.d.ts +67 -1
- package/file-manager.js +3 -2
- package/files/attachment-types.js +14 -13
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
- package/index.d.ts +136 -1
- package/index.js +68 -66
- package/package.json +15 -15
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +75 -0
- package/skill-editor.d.ts +69 -0
- package/skill-editor.js +2 -1
package/file-manager.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { DiscardSharedItemDto } from '@epam/ai-dial-chat-api-client';
|
|
|
24
24
|
import { DiscardSharedResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
25
25
|
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
26
26
|
import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
27
|
+
import { FileManagerSelectableNode } from '@epam/ai-dial-chat-shared';
|
|
27
28
|
import { FileMetadataResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
28
29
|
import { FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
29
30
|
import { FileUploadBatchState } from '@epam/ai-dial-chat-shared';
|
|
@@ -521,7 +522,14 @@ export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesI
|
|
|
521
522
|
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
522
523
|
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
523
524
|
|
|
524
|
-
/**
|
|
525
|
+
/**
|
|
526
|
+
* Normalizes `*` to the all-files wildcard, canonicalizes MIME aliases, and drops
|
|
527
|
+
* any value that is not a valid `DialFileAcceptType`.
|
|
528
|
+
*
|
|
529
|
+
* Aliases are resolved because a file picker matches an `accept` entry against its
|
|
530
|
+
* own MIME table: a declared `text/json` offers no `.json` file, while the
|
|
531
|
+
* `application/json` it denotes does.
|
|
532
|
+
*/
|
|
525
533
|
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
526
534
|
|
|
527
535
|
/**
|
|
@@ -1101,6 +1109,64 @@ export declare interface UseDialFileUploadBatchResult {
|
|
|
1101
1109
|
clearUploadBatch: () => void;
|
|
1102
1110
|
}
|
|
1103
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Composes the file-manager tab/listing hooks into the stateful part of an attachment picker:
|
|
1114
|
+
* active tab, selected paths, and hidden-path/MIME/size/folder row eligibility. Returns the
|
|
1115
|
+
* existing `useDialFileManager` controller unchanged and the selection/tab/eligibility fields
|
|
1116
|
+
* `FileManagerAttachModal` already consumes — it composes that modal, it does not replace it.
|
|
1117
|
+
* Final attachment filtering, deduplication, and count enforcement stay owned by the modal.
|
|
1118
|
+
*/
|
|
1119
|
+
export declare const useFileAttachmentPicker: ({ fileManagerOptions, bucket, forbiddenSymbolsRegExp, tabLabels, allowedTabs, initialTab, allowedTypes, maxSelectableFileSize, canAttachFolders, }: UseFileAttachmentPickerOptions) => UseFileAttachmentPickerResult;
|
|
1120
|
+
|
|
1121
|
+
/** Options accepted by {@link useFileAttachmentPicker}. */
|
|
1122
|
+
export declare interface UseFileAttachmentPickerOptions {
|
|
1123
|
+
/**
|
|
1124
|
+
* Configured `useDialFileManager` options besides the values this hook derives:
|
|
1125
|
+
* `bucket`, `activeTab`, `rootLabel`, `variant`, and `forbiddenSymbolsRegExp`.
|
|
1126
|
+
*/
|
|
1127
|
+
fileManagerOptions: Omit<UseDialFileManagerOptions, 'bucket' | 'activeTab' | 'rootLabel' | 'variant' | 'forbiddenSymbolsRegExp'>;
|
|
1128
|
+
/** DIAL Core bucket to browse. */
|
|
1129
|
+
bucket: string;
|
|
1130
|
+
/** Regexp of characters forbidden in file/folder names, forwarded to `useDialFileManager`. */
|
|
1131
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
1132
|
+
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
1133
|
+
tabLabels: Record<DialFileManagerTabs, string>;
|
|
1134
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
1135
|
+
allowedTabs?: string[];
|
|
1136
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
1137
|
+
initialTab?: DialFileManagerTabs;
|
|
1138
|
+
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
1139
|
+
allowedTypes?: string[];
|
|
1140
|
+
/** Files at or below this size (bytes) remain eligible; absent allows any size. */
|
|
1141
|
+
maxSelectableFileSize?: number;
|
|
1142
|
+
/** Whether folder rows are eligible for selection. Defaults to `false`. */
|
|
1143
|
+
canAttachFolders?: boolean;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
/** Result returned by {@link useFileAttachmentPicker}. */
|
|
1147
|
+
export declare interface UseFileAttachmentPickerResult {
|
|
1148
|
+
/** The composed file-manager controller; forward to `FileManagerAttachModal`'s `controller` prop. */
|
|
1149
|
+
controller: UseDialFileManagerResult;
|
|
1150
|
+
/** Active tab. */
|
|
1151
|
+
activeTab: DialFileManagerTabs;
|
|
1152
|
+
/** Tab list filtered to `allowedTabs`; forward to `FileManagerAttachModal`'s `tabs` prop. */
|
|
1153
|
+
tabs: ToolbarOptions['tabs'];
|
|
1154
|
+
/** Switches the active tab and clears the current selection. */
|
|
1155
|
+
onTabChange: (tab: DialFileManagerTabs) => void;
|
|
1156
|
+
/** Currently selected paths. */
|
|
1157
|
+
selectedPaths: Set<string>;
|
|
1158
|
+
/** Replaces the selection with a defensive copy of the given set. */
|
|
1159
|
+
onSelectedPathsChange: (paths: Set<string>) => void;
|
|
1160
|
+
/** Row eligibility predicate; forward to `FileManagerAttachModal`'s `isRowSelectable` prop. */
|
|
1161
|
+
isRowSelectable: (node: {
|
|
1162
|
+
data?: FileManagerSelectableNode | null;
|
|
1163
|
+
}) => boolean;
|
|
1164
|
+
/** MIME eligibility predicate; forward to `FileManagerAttachModal`'s `isFileTypeAllowed` prop. */
|
|
1165
|
+
isFileTypeAllowed: (contentType: string) => boolean;
|
|
1166
|
+
/** Accepted upload MIME types; forward to `FileManagerAttachModal`'s `allowedFileTypes` prop. */
|
|
1167
|
+
allowedFileTypes: DialFileAcceptType[] | undefined;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1104
1170
|
export { useGridEditingScroll }
|
|
1105
1171
|
|
|
1106
1172
|
export { UseGridEditingScrollOptions }
|
package/file-manager.js
CHANGED
|
@@ -24,5 +24,6 @@ import { useDialFileSharing as me } from "./files/useDialFileSharing/useDialFile
|
|
|
24
24
|
import { useDialFileUploadBatch as he } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
25
25
|
import { useDialFileManager as ge } from "./files/useDialFileManager/useDialFileManager.js";
|
|
26
26
|
import { useDialFileManagerTabConfig as _e } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
27
|
-
import {
|
|
28
|
-
|
|
27
|
+
import { useFileAttachmentPicker as ve } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
28
|
+
import { useGridEditingScroll as ye } from "@epam/ai-dial-chat-shared";
|
|
29
|
+
export { m as COLUMNS_WITHOUT_AUTHOR, h as COLUMNS_WITH_AUTHOR, g as CORE_PERMISSION_MAP, _ as DATE_OPTIONS, x as DialFileManagerActionProfile, S as DialFileManagerVariant, u as DialFilesApiUploadMode, le as DownloadDestinationType, d as FileManagerNotificationReason, f as FileNameValidationErrorReason, p as FileOperationKind, v as PATH_SEPARATOR_REGEXP, y as RESERVED_MARKER_NAME, b as UPLOAD_CONCURRENCY, re as annotationToDisplayAttachment, ie as attachmentDtoToDisplayAttachment, ae as attachmentDtosToDisplayAttachments, H as buildFromCache, w as buildSharedItemVirtualPath, Z as createFilesApiClient, Q as createUploadFileWithProgress, C as deriveActionProfile, T as dialCorePathToRelative, oe as dialFileToAttachment, se as dialFilesToAttachments, ce as dialFolderPathToAttachment, U as fetchByTab, W as fetchForSearch, E as findDialFileByPath, G as findFirstSuccessfulCopyMoveItem, D as findFolderByVirtualPath, O as formatOperationFolderName, L as getParentFolderPath, ee as getUrlFileName, k as getVirtualPathName, A as hasDialFileWritePermission, j as hasForbiddenNameSymbols, M as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, te as isExternalSourcePreviewable, N as isShareActionsAllowed, K as mapCorePermissions, q as mapFileMetadataToDialFile, J as mapSearchItem, Y as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, P as normalizeVirtualPath, $ as openAnnotationAttachment, F as parseNewFolderVirtualPath, B as prepareCopyItems, ue as prepareDownloadDestination, V as prepareMoveRenameItems, R as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, ne as resolveExternalSourceContentType, I as resolveOwnerCoords, n as resolveRelativeDialFilePath, s as sanitizeFileName, c as splitFileNameExtension, l as trimFileNameToByteLimit, X as updateEntry, de as useDialFileListing, ge as useDialFileManager, _e as useDialFileManagerTabConfig, fe as useDialFileMetadata, pe as useDialFileMutations, me as useDialFileSharing, he as useDialFileUploadBatch, ve as useFileAttachmentPicker, ye as useGridEditingScroll, z as virtualPathToApiPath };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { normalizeMimeType as e } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { extension as t } from "mime-types";
|
|
2
3
|
//#region src/files/attachment-types.ts
|
|
3
|
-
var
|
|
4
|
-
if (
|
|
5
|
-
},
|
|
6
|
-
let
|
|
7
|
-
if (!(
|
|
8
|
-
},
|
|
9
|
-
if (
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
12
|
-
let
|
|
13
|
-
return
|
|
4
|
+
var n = "*/*", r = (e) => e.startsWith(".") || e.includes("/"), i = (t) => {
|
|
5
|
+
if (t != null) return t.map((t) => t === "*" ? n : t.startsWith(".") ? t : e(t)).filter(r);
|
|
6
|
+
}, a = (e) => {
|
|
7
|
+
let t = i(e);
|
|
8
|
+
if (!(t == null || t.length === 0) && !t.some((e) => e === n)) return t.join(",");
|
|
9
|
+
}, o = (n) => n.map((n) => {
|
|
10
|
+
if (n.endsWith("/*")) return n;
|
|
11
|
+
let r = e(n), i = t(r);
|
|
12
|
+
if (i !== !1) return `.${i}`;
|
|
13
|
+
let a = r.split("/")[1];
|
|
14
|
+
return a == null ? n : `.${a.toLowerCase()}`;
|
|
14
15
|
}).join(", ");
|
|
15
16
|
//#endregion
|
|
16
|
-
export {
|
|
17
|
+
export { r as isDialFileAcceptType, o as mimeTypesToAttachmentExtensionLabels, i as mimeTypesToDialFileAcceptTypes, a as mimeTypesToFileAccept };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { mimeTypesToDialFileAcceptTypes as e } from "../attachment-types.js";
|
|
2
|
+
import { DialFileManagerVariant as t } from "../file-manager-variant.js";
|
|
3
|
+
import { useDialFileManager as n } from "../useDialFileManager/useDialFileManager.js";
|
|
4
|
+
import { useDialFileManagerTabConfig as r } from "../useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
5
|
+
import { isHiddenPath as i } from "@epam/ai-dial-chat-shared";
|
|
6
|
+
import { useCallback as a, useMemo as o, useState as s } from "react";
|
|
7
|
+
import { isMimeTypeAllowed as c } from "@epam/ai-dial-attachment-input";
|
|
8
|
+
import { DialFileManagerTabs as l, DialFileNodeType as u, useDialFileManagerTabs as d } from "@epam/ai-dial-react-file-manager";
|
|
9
|
+
//#region src/files/useFileAttachmentPicker/useFileAttachmentPicker.ts
|
|
10
|
+
var f = ({ fileManagerOptions: f, bucket: p, forbiddenSymbolsRegExp: m, tabLabels: h, allowedTabs: g, initialTab: _, allowedTypes: v, maxSelectableFileSize: y, canAttachFolders: b = !1 }) => {
|
|
11
|
+
let { activeTab: x, handleTabChange: S, tabs: C } = d(h, _), [w, T] = s(() => /* @__PURE__ */ new Set()), E = a((e) => {
|
|
12
|
+
T(new Set(e));
|
|
13
|
+
}, []), D = a((e) => {
|
|
14
|
+
T(/* @__PURE__ */ new Set()), S(e);
|
|
15
|
+
}, [S]), { tabs: O } = r(x, D, C, g), k = h[x] || h[l.MyFiles], A = n({
|
|
16
|
+
...f,
|
|
17
|
+
bucket: p,
|
|
18
|
+
activeTab: x,
|
|
19
|
+
rootLabel: k,
|
|
20
|
+
variant: t.Attach,
|
|
21
|
+
forbiddenSymbolsRegExp: m
|
|
22
|
+
}), j = a((e) => v == null || v.length === 0 ? !0 : c(e, v), [v]);
|
|
23
|
+
return {
|
|
24
|
+
controller: A,
|
|
25
|
+
activeTab: x,
|
|
26
|
+
tabs: O,
|
|
27
|
+
onTabChange: D,
|
|
28
|
+
selectedPaths: w,
|
|
29
|
+
onSelectedPathsChange: E,
|
|
30
|
+
isRowSelectable: a((e) => {
|
|
31
|
+
let t = e.data;
|
|
32
|
+
return t == null || i(t.path) ? !1 : t.nodeType === u.FOLDER ? b : t.nodeType === u.ITEM ? !(t.contentType != null && !j(t.contentType) || y != null && t.contentLength != null && t.contentLength > y) : !1;
|
|
33
|
+
}, [
|
|
34
|
+
b,
|
|
35
|
+
j,
|
|
36
|
+
y
|
|
37
|
+
]),
|
|
38
|
+
isFileTypeAllowed: j,
|
|
39
|
+
allowedFileTypes: o(() => e(v), [v])
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { f as useFileAttachmentPicker };
|
package/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
|
61
61
|
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
62
62
|
import { ExportFolder } from '@epam/ai-dial-chat-shared';
|
|
63
63
|
import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
64
|
+
import { FileManagerSelectableNode } from '@epam/ai-dial-chat-shared';
|
|
64
65
|
import { FileMetadataResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
65
66
|
import { FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
66
67
|
import { FileUploadBatchState } from '@epam/ai-dial-chat-shared';
|
|
@@ -752,6 +753,13 @@ export declare interface ChatStreamCompletionOptions {
|
|
|
752
753
|
signal?: AbortSignal;
|
|
753
754
|
}
|
|
754
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Classifies an import request's HTTP status into a semantic outcome: 400/413/422 are
|
|
758
|
+
* archive-content problems, 409 is a name collision, 429 is rate limiting, 502/503 mean the
|
|
759
|
+
* backend is unavailable, and anything else (including no status at all) is generic.
|
|
760
|
+
*/
|
|
761
|
+
export declare const classifySkillArchiveImportError: (status: number | undefined) => SkillArchiveImportErrorKind;
|
|
762
|
+
|
|
755
763
|
/** Clears all cached fetch results. Call this when leaving a conversation. */
|
|
756
764
|
export declare const clearAttachmentCache: () => void;
|
|
757
765
|
|
|
@@ -2452,7 +2460,14 @@ export declare interface MessagePair {
|
|
|
2452
2460
|
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
2453
2461
|
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
2454
2462
|
|
|
2455
|
-
/**
|
|
2463
|
+
/**
|
|
2464
|
+
* Normalizes `*` to the all-files wildcard, canonicalizes MIME aliases, and drops
|
|
2465
|
+
* any value that is not a valid `DialFileAcceptType`.
|
|
2466
|
+
*
|
|
2467
|
+
* Aliases are resolved because a file picker matches an `accept` entry against its
|
|
2468
|
+
* own MIME table: a declared `text/json` offers no `.json` file, while the
|
|
2469
|
+
* `application/json` it denotes does.
|
|
2470
|
+
*/
|
|
2456
2471
|
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
2457
2472
|
|
|
2458
2473
|
/**
|
|
@@ -3363,6 +3378,28 @@ export declare interface SkillAboutDetails {
|
|
|
3363
3378
|
skillPrompt?: string;
|
|
3364
3379
|
}
|
|
3365
3380
|
|
|
3381
|
+
/** Semantic classification of an import request failure. */
|
|
3382
|
+
export declare enum SkillArchiveImportErrorKind {
|
|
3383
|
+
Validation = "validation",
|
|
3384
|
+
Collision = "collision",
|
|
3385
|
+
RateLimited = "rateLimited",
|
|
3386
|
+
ServiceUnavailable = "serviceUnavailable",
|
|
3387
|
+
Generic = "generic"
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
/** Phase of a skill-archive import, driving the host's loading/success/error presentation. */
|
|
3391
|
+
export declare enum SkillArchiveImportStatus {
|
|
3392
|
+
Idle = "idle",
|
|
3393
|
+
Uploading = "uploading",
|
|
3394
|
+
Success = "success",
|
|
3395
|
+
Error = "error"
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
/** Reason a selected/dropped file was rejected before any request was made. */
|
|
3399
|
+
export declare enum SkillArchiveSelectionRejectionReason {
|
|
3400
|
+
UnsupportedFilename = "unsupportedFilename"
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3366
3403
|
/** Injected API port for skill detail fetching. Mirrors exact server-api wrapper signatures. */
|
|
3367
3404
|
export declare interface SkillDetailsApi {
|
|
3368
3405
|
/** Downloads a raw skill file, returning the raw fetch `Response`. */
|
|
@@ -5134,6 +5171,64 @@ export declare interface UseFavoriteEntitiesStateResult {
|
|
|
5134
5171
|
toggleFavorite: (id: string, isFavorite: boolean, entityType?: FavoriteEntityType) => Promise<void>;
|
|
5135
5172
|
}
|
|
5136
5173
|
|
|
5174
|
+
/**
|
|
5175
|
+
* Composes the file-manager tab/listing hooks into the stateful part of an attachment picker:
|
|
5176
|
+
* active tab, selected paths, and hidden-path/MIME/size/folder row eligibility. Returns the
|
|
5177
|
+
* existing `useDialFileManager` controller unchanged and the selection/tab/eligibility fields
|
|
5178
|
+
* `FileManagerAttachModal` already consumes — it composes that modal, it does not replace it.
|
|
5179
|
+
* Final attachment filtering, deduplication, and count enforcement stay owned by the modal.
|
|
5180
|
+
*/
|
|
5181
|
+
export declare const useFileAttachmentPicker: ({ fileManagerOptions, bucket, forbiddenSymbolsRegExp, tabLabels, allowedTabs, initialTab, allowedTypes, maxSelectableFileSize, canAttachFolders, }: UseFileAttachmentPickerOptions) => UseFileAttachmentPickerResult;
|
|
5182
|
+
|
|
5183
|
+
/** Options accepted by {@link useFileAttachmentPicker}. */
|
|
5184
|
+
export declare interface UseFileAttachmentPickerOptions {
|
|
5185
|
+
/**
|
|
5186
|
+
* Configured `useDialFileManager` options besides the values this hook derives:
|
|
5187
|
+
* `bucket`, `activeTab`, `rootLabel`, `variant`, and `forbiddenSymbolsRegExp`.
|
|
5188
|
+
*/
|
|
5189
|
+
fileManagerOptions: Omit<UseDialFileManagerOptions, 'bucket' | 'activeTab' | 'rootLabel' | 'variant' | 'forbiddenSymbolsRegExp'>;
|
|
5190
|
+
/** DIAL Core bucket to browse. */
|
|
5191
|
+
bucket: string;
|
|
5192
|
+
/** Regexp of characters forbidden in file/folder names, forwarded to `useDialFileManager`. */
|
|
5193
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
5194
|
+
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
5195
|
+
tabLabels: Record<DialFileManagerTabs, string>;
|
|
5196
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
5197
|
+
allowedTabs?: string[];
|
|
5198
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
5199
|
+
initialTab?: DialFileManagerTabs;
|
|
5200
|
+
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
5201
|
+
allowedTypes?: string[];
|
|
5202
|
+
/** Files at or below this size (bytes) remain eligible; absent allows any size. */
|
|
5203
|
+
maxSelectableFileSize?: number;
|
|
5204
|
+
/** Whether folder rows are eligible for selection. Defaults to `false`. */
|
|
5205
|
+
canAttachFolders?: boolean;
|
|
5206
|
+
}
|
|
5207
|
+
|
|
5208
|
+
/** Result returned by {@link useFileAttachmentPicker}. */
|
|
5209
|
+
export declare interface UseFileAttachmentPickerResult {
|
|
5210
|
+
/** The composed file-manager controller; forward to `FileManagerAttachModal`'s `controller` prop. */
|
|
5211
|
+
controller: UseDialFileManagerResult;
|
|
5212
|
+
/** Active tab. */
|
|
5213
|
+
activeTab: DialFileManagerTabs;
|
|
5214
|
+
/** Tab list filtered to `allowedTabs`; forward to `FileManagerAttachModal`'s `tabs` prop. */
|
|
5215
|
+
tabs: ToolbarOptions['tabs'];
|
|
5216
|
+
/** Switches the active tab and clears the current selection. */
|
|
5217
|
+
onTabChange: (tab: DialFileManagerTabs) => void;
|
|
5218
|
+
/** Currently selected paths. */
|
|
5219
|
+
selectedPaths: Set<string>;
|
|
5220
|
+
/** Replaces the selection with a defensive copy of the given set. */
|
|
5221
|
+
onSelectedPathsChange: (paths: Set<string>) => void;
|
|
5222
|
+
/** Row eligibility predicate; forward to `FileManagerAttachModal`'s `isRowSelectable` prop. */
|
|
5223
|
+
isRowSelectable: (node: {
|
|
5224
|
+
data?: FileManagerSelectableNode | null;
|
|
5225
|
+
}) => boolean;
|
|
5226
|
+
/** MIME eligibility predicate; forward to `FileManagerAttachModal`'s `isFileTypeAllowed` prop. */
|
|
5227
|
+
isFileTypeAllowed: (contentType: string) => boolean;
|
|
5228
|
+
/** Accepted upload MIME types; forward to `FileManagerAttachModal`'s `allowedFileTypes` prop. */
|
|
5229
|
+
allowedFileTypes: DialFileAcceptType[] | undefined;
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5137
5232
|
export { useGridEditingScroll }
|
|
5138
5233
|
|
|
5139
5234
|
export { UseGridEditingScrollOptions }
|
|
@@ -5461,6 +5556,46 @@ export declare interface UseShareRecipientsCountResult {
|
|
|
5461
5556
|
invalidateRecipientsCount: (itemId: string) => void;
|
|
5462
5557
|
}
|
|
5463
5558
|
|
|
5559
|
+
/**
|
|
5560
|
+
* Headless controller for the skill-archive upload flow: dialog visibility, the exact-filename
|
|
5561
|
+
* precheck, in-flight exclusion, and import completion. The host supplies the configured request
|
|
5562
|
+
* and observes completion/failure through the injected callbacks; the hook never imports app
|
|
5563
|
+
* contexts, i18n, or a configured API client.
|
|
5564
|
+
*/
|
|
5565
|
+
export declare const useSkillArchiveImport: <TResult>({ importArchive, onImported, onError, manifestFileName, }: UseSkillArchiveImportOptions<TResult>) => UseSkillArchiveImportResult;
|
|
5566
|
+
|
|
5567
|
+
/** Options accepted by {@link useSkillArchiveImport}. */
|
|
5568
|
+
export declare interface UseSkillArchiveImportOptions<TResult> {
|
|
5569
|
+
/** Submits the selected archive; the host owns request configuration and the client. */
|
|
5570
|
+
importArchive: (file: File) => Promise<TResult>;
|
|
5571
|
+
/** Called once after a successful import (and any awaited host follow-up) settles. */
|
|
5572
|
+
onImported: (result: TResult) => void | Promise<void>;
|
|
5573
|
+
/** Called once when the import request, or the host's follow-up in {@link onImported}, fails. */
|
|
5574
|
+
onError: (error: unknown, kind: SkillArchiveImportErrorKind) => void;
|
|
5575
|
+
/** Exact filename treated as the skill manifest. Defaults to `'SKILL.md'`. */
|
|
5576
|
+
manifestFileName?: string;
|
|
5577
|
+
}
|
|
5578
|
+
|
|
5579
|
+
/** Result returned by {@link useSkillArchiveImport}. */
|
|
5580
|
+
export declare interface UseSkillArchiveImportResult {
|
|
5581
|
+
/** Whether the upload dialog is open. */
|
|
5582
|
+
isDialogOpen: boolean;
|
|
5583
|
+
/** Current phase of the import. */
|
|
5584
|
+
status: SkillArchiveImportStatus;
|
|
5585
|
+
/** Reason the current/last selection was rejected locally; `undefined` once cleared. */
|
|
5586
|
+
selectionRejectionReason: SkillArchiveSelectionRejectionReason | undefined;
|
|
5587
|
+
/** Classified failure of the last import request; `undefined` outside a request failure. */
|
|
5588
|
+
errorKind: SkillArchiveImportErrorKind | undefined;
|
|
5589
|
+
/** Opens the dialog, unless an import is already in flight. */
|
|
5590
|
+
openDialog: () => void;
|
|
5591
|
+
/** Closes the dialog and clears any rejection reason. */
|
|
5592
|
+
closeDialog: () => void;
|
|
5593
|
+
/** Wire to the dialog drop zone's `onChange`. */
|
|
5594
|
+
handleFilesSelected: (files: File[]) => void;
|
|
5595
|
+
/** Wire to the dialog drop zone's `onReject`. */
|
|
5596
|
+
handleFilesRejected: () => void;
|
|
5597
|
+
}
|
|
5598
|
+
|
|
5464
5599
|
/**
|
|
5465
5600
|
* Headless data pipeline behind a skill details side panel: resolves the
|
|
5466
5601
|
* selected skill from the listings, maps it to a catalog item with its
|
package/index.js
CHANGED
|
@@ -70,69 +70,71 @@ import { useSkillEditorSubmit as kn } from "./skill/useSkillEditorSubmit.js";
|
|
|
70
70
|
import { useSkillFileActions as An } from "./skill/useSkillFileActions.js";
|
|
71
71
|
import { SkillPreviewErrorKind as jn, useSkillFilePreview as Mn } from "./skill/useSkillFilePreview.js";
|
|
72
72
|
import { useSkillsState as Nn } from "./skill/useSkillsState/useSkillsState.js";
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
|
|
73
|
+
import { SkillArchiveImportErrorKind as Pn, SkillArchiveImportStatus as Fn, SkillArchiveSelectionRejectionReason as In, classifySkillArchiveImportError as Ln, useSkillArchiveImport as Rn } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
|
|
74
|
+
import { RecipientsCountStatus as zn, useShareRecipientsCount as Bn } from "./useShareRecipientsCount/useShareRecipientsCount.js";
|
|
75
|
+
import { deriveConversationRowActionState as Vn } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
76
|
+
import { useActiveConversationSync as Hn } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
77
|
+
import { useAsyncConfirmDialog as Un } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
78
|
+
import { useConversationLookupMaps as Wn } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
79
|
+
import { getConversationSource as Gn, useConversationPanelItems as Kn } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
80
|
+
import { useImportFilePicker as qn } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
81
|
+
import { sanitizeFileName as Jn, splitFileNameExtension as Yn, trimFileNameToByteLimit as Xn } from "./files/file-name.js";
|
|
82
|
+
import { useAttachmentUpload as Zn } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
83
|
+
import { AudioTranscriptionError as Qn, AudioTranscriptionErrorReason as $n } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
84
|
+
import { useTranscribeAudio as er } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
85
|
+
import { DEFAULT_MAX_ARCHIVE_BYTES as tr, useConversationExport as nr } from "./conversation/useConversationExport/useConversationExport.js";
|
|
86
|
+
import { attachmentToDto as rr, attachmentsToDtos as ir } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
87
|
+
import { createMessagePair as ar } from "./conversation/useConversationHandlers/message-factory.js";
|
|
88
|
+
import { hasActiveToolConfig as or, isAnswerIncomplete as sr, isMessageChanged as cr, shouldRerunGenerationOnEdit as lr } from "./conversation/useConversationHandlers/message-utils.js";
|
|
89
|
+
import { getStarterConversationText as ur, getStarterDisplayText as dr, getStarterSubmitText as fr } from "./conversation/useConversationHandlers/starter-option.js";
|
|
90
|
+
import { getConversationPath as pr } from "./conversation/useConversationStream/conversation-path.js";
|
|
91
|
+
import { useConversationHandlers as mr } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
92
|
+
import { useConversationImport as hr } from "./conversation/useConversationImport/useConversationImport.js";
|
|
93
|
+
import { useConversationScroll as gr } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
94
|
+
import { applyChunkToMessages as _r, mergeStages as vr } from "./conversation/useConversationStream/apply-chunk.js";
|
|
95
|
+
import { isAwaitingGenerationResume as yr } from "./conversation/useConversationStream/generation-resume.js";
|
|
96
|
+
import { useConversationStream as br } from "./conversation/useConversationStream/useConversationStream.js";
|
|
97
|
+
import { useConversationSources as xr } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
|
98
|
+
import { DialFilesApiUploadMode as Sr } from "./files/dial-files-api.js";
|
|
99
|
+
import { FileManagerNotificationReason as Cr, FileNameValidationErrorReason as wr, FileOperationKind as Tr } from "./files/dial-file-manager.types.js";
|
|
100
|
+
import { COLUMNS_WITHOUT_AUTHOR as Er, COLUMNS_WITH_AUTHOR as Dr, CORE_PERMISSION_MAP as Or, DATE_OPTIONS as kr, PATH_SEPARATOR_REGEXP as Ar, RESERVED_MARKER_NAME as jr, UPLOAD_CONCURRENCY as Mr } from "./files/dial-file-manager.model.js";
|
|
101
|
+
import { DialFileManagerActionProfile as Nr, DialFileManagerVariant as Pr, deriveActionProfile as Fr } from "./files/file-manager-variant.js";
|
|
102
|
+
import { buildSharedItemVirtualPath as Ir, dialCorePathToRelative as Lr, findDialFileByPath as Rr, findFolderByVirtualPath as zr, formatOperationFolderName as Br, getVirtualPathName as Vr, hasDialFileWritePermission as Hr, hasForbiddenNameSymbols as Ur, isCopyMoveDuplicateAllowed as Wr, isShareActionsAllowed as Gr, normalizeVirtualPath as Kr, parseNewFolderVirtualPath as qr, resolveOwnerCoords as Jr } from "./files/dial-file-manager-path.util.js";
|
|
103
|
+
import { getParentFolderPath as Yr, resolveDialFileApiPath as Xr, virtualPathToApiPath as Zr } from "./files/resolve-dial-file-api-path.js";
|
|
104
|
+
import { prepareCopyItems as Qr, prepareMoveRenameItems as $r } from "./files/dial-file-manager-copy-move.util.js";
|
|
105
|
+
import { buildFromCache as ei, fetchByTab as ti, fetchForSearch as ni, findFirstSuccessfulCopyMoveItem as ri, mapCorePermissions as ii, mapFileMetadataToDialFile as ai, mapSearchItem as oi, mergeCreatedFolderIntoCache as si, updateEntry as ci } from "./files/dial-file-manager-mapping.util.js";
|
|
106
|
+
import { createFilesApiClient as li } from "./files/create-files-api.js";
|
|
107
|
+
import { createUploadFileWithProgress as ui } from "./files/create-upload-file-with-progress.js";
|
|
108
|
+
import { openAnnotationAttachment as di } from "./files/annotation.js";
|
|
109
|
+
import { annotationToOoxmlCanvasContent as fi, annotationToPdfCanvasContent as pi, clearAttachmentCache as mi, hasAttachmentTextSource as hi, referenceAttachmentToPdfCanvasContent as gi, resolveCodeCanvasContent as _i, resolveGroupedVisualizerCanvasContent as vi, resolveHtmlCanvasContent as yi, resolveImageCanvasContent as bi, resolveJsonCanvasContent as xi, resolveMarkdownCanvasContent as Si, resolveOoxmlCanvasContent as Ci, resolvePdfCanvasContent as wi, resolveTextCanvasContent as Ti, resolveVisualizerCanvasContent as Ei } from "./files/attachment-canvas.js";
|
|
110
|
+
import { getUrlFileName as Di, isExternalSourcePreviewable as Oi, resolveExternalSourceContentType as ki } from "./files/source-content.js";
|
|
111
|
+
import { annotationToDisplayAttachment as Ai, attachmentDtoToDisplayAttachment as ji, attachmentDtosToDisplayAttachments as Mi } from "./files/attachment-dto-to-display.js";
|
|
112
|
+
import { dialFileToAttachment as Ni, dialFilesToAttachments as Pi, dialFolderPathToAttachment as Fi } from "./files/dial-file-to-attachment.js";
|
|
113
|
+
import { DownloadDestinationType as Ii } from "./files/download-destination.js";
|
|
114
|
+
import { prepareDownloadDestination as Li } from "./files/prepare-download-destination.js";
|
|
115
|
+
import { useDialFileListing as Ri } from "./files/useDialFileListing/useDialFileListing.js";
|
|
116
|
+
import { useDialFileMetadata as zi } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
117
|
+
import { useDialFileMutations as Bi } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
118
|
+
import { useDialFileSharing as Vi } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
119
|
+
import { useDialFileUploadBatch as Hi } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
120
|
+
import { useDialFileManager as Ui } from "./files/useDialFileManager/useDialFileManager.js";
|
|
121
|
+
import { useDialFileManagerTabConfig as Wi } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
122
|
+
import { useFileAttachmentPicker as Gi } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
123
|
+
import { isCustomAppSchema as Ki, isQuickAppSchema as qi } from "./shared/application-schema.js";
|
|
124
|
+
import { getBrowserTimezone as Ji } from "./shared/browser-timezone.js";
|
|
125
|
+
import { isValidAbsoluteUrl as Yi, isValidFeaturesData as Xi, parseFeaturesData as Zi } from "./shared/custom-apps.js";
|
|
126
|
+
import { buildExternalServiceScopeId as Qi, getExternalServiceFallbackName as $i, parseExternalServiceUrl as ea } from "./shared/external-services.js";
|
|
127
|
+
import { useChatSettingsFormConfig as ta } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
128
|
+
import { usePageFileDrag as na } from "./usePageFileDrag/usePageFileDrag.js";
|
|
129
|
+
import { useViewportWidth as ra } from "./useViewportWidth/useViewportWidth.js";
|
|
130
|
+
import { usePanelMaxWidth as ia } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
131
|
+
import { useShareLink as aa } from "./useShareLink/useShareLink.js";
|
|
132
|
+
import { useToolsMenu as oa } from "./useToolsMenu/useToolsMenu.js";
|
|
133
|
+
import { useUsageData as sa } from "./usage/useUsageData/useUsageData.js";
|
|
134
|
+
import { McpAppResourceFetchError as ca, createMcpAppsApiClient as la } from "./mcp-apps/mcp-apps-api-client.js";
|
|
135
|
+
import { useMcpAppTools as ua } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
136
|
+
import { useMcpAppHostContext as da } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
137
|
+
import { useMcpAppHostAdapter as fa } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
138
|
+
import { useOpenMcpAppCanvas as pa } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
139
|
+
import { useGridEditingScroll as ma } from "@epam/ai-dial-chat-shared";
|
|
140
|
+
export { x as AttachmentValidationErrorReason, Qn as AudioTranscriptionError, $n as AudioTranscriptionErrorReason, R as AuthenticationType, Er as COLUMNS_WITHOUT_AUTHOR, Dr as COLUMNS_WITH_AUTHOR, Or as CORE_PERMISSION_MAP, $e as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, kr as DATE_OPTIONS, Lt as DEFAULT_GENERATION_CONFLICT_MESSAGE, tr as DEFAULT_MAX_ARCHIVE_BYTES, Nr as DialFileManagerActionProfile, Pr as DialFileManagerVariant, Sr as DialFilesApiUploadMode, Ii as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, kt as FavoriteEntityType, Cr as FileManagerNotificationReason, wr as FileNameValidationErrorReason, Tr as FileOperationKind, Rt as GenerationConflictError, ca as McpAppResourceFetchError, Re as McpResourceKind, at as OAuthResourceKind, Ar as PATH_SEPARATOR_REGEXP, cn as PROMPT_CONTENT_MAX_LENGTH, ln as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, un as PROMPT_DESCRIPTION_MAX_LENGTH, dn as PROMPT_NAME_MAX_LENGTH, we as PUBLIC_SKILL_BUCKET, fn as PromptFieldError, ae as PromptSource, jr as RESERVED_MARKER_NAME, zn as RecipientsCountStatus, ue as SKILL_FILE_UPLOAD_MAX_BYTES, Te as SKILL_LISTING_MAX_PAGES, Ee as SKILL_LISTING_PAGE_SIZE, de as SKILL_MANIFEST_FILE, De as SKILL_MANIFEST_MAX_BYTES, fe as SKILL_UPLOAD_MAX_FILES, pe as SKILL_UPLOAD_MAX_TOTAL_BYTES, Pn as SkillArchiveImportErrorKind, Fn as SkillArchiveImportStatus, In as SkillArchiveSelectionRejectionReason, Dn as SkillEditorLoadState, jn as SkillPreviewErrorKind, Oe as SkillSource, ot as TOOLSET_REDIRECT_STATE_KEY, st as ToolsetAuthStatus, ct as ToolsetAuthTypes, lt as ToolsetCredentialsLevel, Tt as ToolsetLoginOutcomeType, ut as ToolsetOAuthCallbackQuery, dt as ToolsetOAuthChannelControlType, ft as ToolsetOAuthFailureReason, pt as ToolsetOAuthInitiationResultType, mt as ToolsetOAuthResultType, Mr as UPLOAD_CONCURRENCY, yn as UnsupportedTriggerReason, ht as WithLogin, Ai as annotationToDisplayAttachment, fi as annotationToOoxmlCanvasContent, pi as annotationToPdfCanvasContent, bn as apSchedulerDayToJsDay, W as appendLocaleCode, _r as applyChunkToMessages, ji as attachmentDtoToDisplayAttachment, Mi as attachmentDtosToDisplayAttachments, rr as attachmentToDto, ir as attachmentsToDtos, G as buildAdditionalLocaleOptions, Mt as buildAnnouncementSignature, ze as buildApplicationMcpUrl, N as buildChatCompletionsUrl, Be as buildConnectApi, P as buildDeploymentConnectApi, Qi as buildExternalServiceScopeId, ei as buildFromCache, an as buildPromptExportEnvelope, on as buildPromptExportFileName, se as buildPromptOverview, pn as buildPromptPath, F as buildResponsesUrl, Ir as buildSharedItemVirtualPath, Ae as buildSkillContentTree, me as buildSkillFilesPayload, he as buildSkillManifest, ge as buildSkillManifestForSubmit, _e as buildSkillManifestFromFrontmatter, je as buildSkillOverview, bt as buildToolsetAuthorizeUrl, Ve as buildToolsetMcpUrl, Ln as classifySkillArchiveImportError, mi as clearAttachmentCache, K as composeLocalePayload, zt as createChatStreamApi, i as createCsrfMiddleware, Gt as createDeploymentChangedMessage, li as createFilesApiClient, la as createMcpAppsApiClient, ar as createMessagePair, j as createPublishApiClient, a as createUnauthorizedMiddleware, ui as createUploadFileWithProgress, V as decodeToolsetId, q as decomposeLocalizedFields, Fr as deriveActionProfile, Je as deriveAvailableTabIds, Vn as deriveConversationRowActionState, Ye as deriveFavoriteItems, Lr as dialCorePathToRelative, Ni as dialFileToAttachment, Pi as dialFilesToAttachments, Fi as dialFolderPathToAttachment, m as downloadAttachment, gt as emitToolsetLoginSuccess, I as encodeDeploymentId, H as encodeToolsetId, ti as fetchByTab, ni as fetchForSearch, Xe as filterCatalogItemsBySelector, Ze as filterHiddenOwnedItems, L as findDeploymentByIdOrReference, Rr as findDialFileByPath, ri as findFirstSuccessfulCopyMoveItem, zr as findFolderByVirtualPath, Vt as formatAppVersion, X as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Br as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Ji as getBrowserTimezone, pr as getConversationPath, Gn as getConversationSource, $i as getExternalServiceFallbackName, Kt as getLastDeploymentId, qt as getLastUserMessageToolConfiguration, Ut as getModelIdFromConversationId, Yr as getParentFolderPath, Ue as getPublicCatalogEntityFolderPath, Qt as getQuickAppConversationStarters, mn as getRemainingCharacters, ur as getStarterConversationText, dr as getStarterDisplayText, tn as getStarterPopulateText, fr as getStarterSubmitText, nn as getStartersFromSchema, Wt as getTimeOfDayGreeting, vt as getToolsetOAuthChannelName, xt as getToolsetRedirectUri, Di as getUrlFileName, Vr as getVirtualPathName, or as hasActiveToolConfig, Nt as hasAnnouncementContent, hi as hasAttachmentTextSource, Hr as hasDialFileWritePermission, Ur as hasForbiddenNameSymbols, Pt as hasStructuredAnnouncement, o as includesIgnoreCase, St as initiateOAuthLogin, sr as isAnswerIncomplete, yr as isAwaitingGenerationResume, r as isConversationNotFoundError, Wr as isCopyMoveDuplicateAllowed, Ki as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, Oi as isExternalSourcePreviewable, cr as isMessageChanged, Jt as isMessageStreaming, ce as isOrganisationPromptItem, We as isPublicCatalogEntityId, U as isPublicToolsetId, qi as isQuickAppSchema, Gr as isShareActionsAllowed, Yi as isValidAbsoluteUrl, Xi as isValidFeaturesData, ve as isValidSkillRelativePath, xn as jsDayToApSchedulerDay, ii as mapCorePermissions, Q as mapDeploymentDetailsDtoToEntityDetails, z as mapDeploymentLimitsDtoToCatalogLimits, B as mapDeploymentLimitsToInput, te as mapDeploymentToCatalogItem, ne as mapDeploymentToolsetCredentials, $ as mapEntityDetailsToCatalogDetails, ai as mapFileMetadataToDialFile, Sn as mapFormValuesToCreateBody, Cn as mapFormValuesToUpdateBody, le as mapPromptToCatalogItem, Ge as mapPublishConversationResultDto, Ke as mapPublishHistoryEntryDto, wn as mapScheduledTaskDtoToFormValues, oi as mapSearchItem, Me as mapSkillToCatalogItem, $t as mapStages, ee as mapToolsetCredentials, re as mapToolsetToCatalogItem, si as mergeCreatedFolderIntoCache, vr as mergeStages, Yt as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, ye as nameFromPath, Ct as navigateToolsetOAuthPopup, Xt as normalizeResponseFormat, be as normalizeSkillName, Kr as normalizeVirtualPath, di as openAnnotationAttachment, wt as openToolsetOAuthPopup, Z as padTwoDigits, ea as parseExternalServiceUrl, Zi as parseFeaturesData, qr as parseNewFolderVirtualPath, oe as parsePromptResourceUrl, xe as parseSkillManifest, nt as parseSkillManifestDocument, ke as parseSkillResourceUrl, Qr as prepareCopyItems, Li as prepareDownloadDestination, $r as prepareMoveRenameItems, Ne as readSkillFileBytes, Pe as readSkillFilePreviewBytes, Fe as readSkillManifest, Qe as reconcileFilterTopics, gi as referenceAttachmentToPdfCanvasContent, et as resolveCatalogPrimaryAction, _i as resolveCodeCanvasContent, ie as resolveDeploymentFolder, Xr as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, ki as resolveExternalSourceContentType, vi as resolveGroupedVisualizerCanvasContent, yi as resolveHtmlCanvasContent, bi as resolveImageCanvasContent, xi as resolveJsonCanvasContent, J as resolveLocalizedText, Si as resolveMarkdownCanvasContent, He as resolveMcpResourceKind, Ci as resolveOoxmlCanvasContent, Jr as resolveOwnerCoords, wi as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Ie as resolveSkillFileDownloadPath, Le as resolveSkillManifestFileId, Ti as resolveTextCanvasContent, Ei as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Ft as sanitizeAnnouncementHtml, It as sanitizeAnnouncementMessageHtml, Jn as sanitizeFileName, Ht as sanitizeFooterHtml, sn as serializePromptExport, lr as shouldRerunGenerationOnEdit, Bt as shouldWatchForDisplayNameUpdate, Se as skillFileBytesToBlob, En as skillFileToAttachment, Yn as splitFileNameExtension, l as stripSurroundingSlashes, u as stripTrailingSlashes, _t as subscribeToolsetLoginSuccess, Y as toBaseLocale, Zt as toOverlayMessages, qe as toPublishEntityType, M as toPublishRuleDto, en as toStage, Xn as trimFileNameToByteLimit, Ce as unpackSkillArchive, ci as updateEntry, Hn as useActiveConversationSync, Un as useAsyncConfirmDialog, g as useAttachmentAction, Zn as useAttachmentUpload, S as useAttachmentValidation, tt as useCatalogEditNavigation, it as useCatalogItemDetails, Dt as useCatalogToolsetCredentials, ta as useChatSettingsFormConfig, nr as useConversationExport, mr as useConversationHandlers, hr as useConversationImport, Wn as useConversationLookupMaps, Kn as useConversationPanelItems, gr as useConversationScroll, xr as useConversationSources, br as useConversationStream, Ri as useDialFileListing, Ui as useDialFileManager, Wi as useDialFileManagerTabConfig, zi as useDialFileMetadata, Bi as useDialFileMutations, Vi as useDialFileSharing, Hi as useDialFileUploadBatch, At as useFavoriteEntitiesState, Gi as useFileAttachmentPicker, ma as useGridEditingScroll, qn as useImportFilePicker, fa as useMcpAppHostAdapter, da as useMcpAppHostContext, ua as useMcpAppTools, rn as useOAuthCallbackCompletion, pa as useOpenMcpAppCanvas, na as usePageFileDrag, ia as usePanelMaxWidth, vn as usePromptsState, jt as usePublishFolders, aa as useShareLink, Bn as useShareRecipientsCount, Rn as useSkillArchiveImport, Ot as useSkillDetailsPanelData, On as useSkillEditorLoad, kn as useSkillEditorSubmit, An as useSkillFileActions, Mn as useSkillFilePreview, rt as useSkillItemDetails, Nn as useSkillsState, oa as useToolsMenu, Et as useToolsetLogin, er as useTranscribeAudio, sa as useUsageData, ra as useViewportWidth, hn as validatePromptContent, gn as validatePromptDescription, _n as validatePromptName, Tn as validateSkillFileBatch, Zr as virtualPathToApiPath, yt as waitForToolsetOAuthResult };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.78",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@epam/ai-dial-chat-api-client": "1.2.0-dev.
|
|
109
|
+
"@epam/ai-dial-chat-api-client": "1.2.0-dev.78",
|
|
110
110
|
"dompurify": "3.4.15",
|
|
111
111
|
"fflate": "^0.8.3",
|
|
112
112
|
"lru-cache": "^10.4.3",
|
|
@@ -115,20 +115,20 @@
|
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"react": "^19.2.8",
|
|
118
|
-
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.
|
|
119
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
120
|
-
"@epam/ai-dial-builder-form": "1.2.0-dev.
|
|
121
|
-
"@epam/ai-dial-catalog": "1.2.0-dev.
|
|
122
|
-
"@epam/ai-dial-chat-overlay": "1.2.0-dev.
|
|
123
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
124
|
-
"@epam/ai-dial-mcp-apps": "1.2.0-dev.
|
|
125
|
-
"@epam/ai-dial-publish-panel": "1.2.0-dev.
|
|
126
|
-
"@epam/ai-dial-quotations": "1.2.0-dev.
|
|
118
|
+
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.78",
|
|
119
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.78",
|
|
120
|
+
"@epam/ai-dial-builder-form": "1.2.0-dev.78",
|
|
121
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.78",
|
|
122
|
+
"@epam/ai-dial-chat-overlay": "1.2.0-dev.78",
|
|
123
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.78",
|
|
124
|
+
"@epam/ai-dial-mcp-apps": "1.2.0-dev.78",
|
|
125
|
+
"@epam/ai-dial-publish-panel": "1.2.0-dev.78",
|
|
126
|
+
"@epam/ai-dial-quotations": "1.2.0-dev.78",
|
|
127
127
|
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.2",
|
|
128
|
-
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.
|
|
129
|
-
"@epam/ai-dial-share": "1.2.0-dev.
|
|
130
|
-
"@epam/ai-dial-skill-editor": "1.2.0-dev.
|
|
131
|
-
"@epam/ai-dial-source-panel": "1.2.0-dev.
|
|
128
|
+
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.78",
|
|
129
|
+
"@epam/ai-dial-share": "1.2.0-dev.78",
|
|
130
|
+
"@epam/ai-dial-skill-editor": "1.2.0-dev.78",
|
|
131
|
+
"@epam/ai-dial-source-panel": "1.2.0-dev.78",
|
|
132
132
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
|
|
133
133
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
134
134
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { getApiErrorStatus as e } from "../../api-error/api-error.js";
|
|
2
|
+
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
+
//#region src/skill/useSkillArchiveImport/useSkillArchiveImport.ts
|
|
4
|
+
var a = "SKILL.md", o = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.Idle = "idle", e.Uploading = "uploading", e.Success = "success", e.Error = "error", e;
|
|
6
|
+
}({}), s = /* @__PURE__ */ function(e) {
|
|
7
|
+
return e.Validation = "validation", e.Collision = "collision", e.RateLimited = "rateLimited", e.ServiceUnavailable = "serviceUnavailable", e.Generic = "generic", e;
|
|
8
|
+
}({}), c = /* @__PURE__ */ function(e) {
|
|
9
|
+
return e.UnsupportedFilename = "unsupportedFilename", e;
|
|
10
|
+
}({}), l = (e) => {
|
|
11
|
+
switch (e) {
|
|
12
|
+
case 400:
|
|
13
|
+
case 413:
|
|
14
|
+
case 422: return "validation";
|
|
15
|
+
case 409: return "collision";
|
|
16
|
+
case 429: return "rateLimited";
|
|
17
|
+
case 502:
|
|
18
|
+
case 503: return "serviceUnavailable";
|
|
19
|
+
default: return "generic";
|
|
20
|
+
}
|
|
21
|
+
}, u = (e, t) => e.toLowerCase().endsWith(".md") && e !== t, d = ({ importArchive: o, onImported: s, onError: c, manifestFileName: d = a }) => {
|
|
22
|
+
let [f, p] = i(!1), [m, h] = i("idle"), [g, _] = i(void 0), [v, y] = i(void 0), b = r(!1), x = r(!0);
|
|
23
|
+
n(() => (x.current = !0, () => {
|
|
24
|
+
x.current = !1;
|
|
25
|
+
}), []);
|
|
26
|
+
let S = t(async (t) => {
|
|
27
|
+
b.current = !0, h("uploading"), y(void 0);
|
|
28
|
+
try {
|
|
29
|
+
let e = await o(t);
|
|
30
|
+
if (!x.current || (await s(e), !x.current)) return;
|
|
31
|
+
h("success");
|
|
32
|
+
} catch (t) {
|
|
33
|
+
if (!x.current) return;
|
|
34
|
+
let n = l(e(t));
|
|
35
|
+
h("error"), y(n), c(t, n);
|
|
36
|
+
} finally {
|
|
37
|
+
b.current = !1;
|
|
38
|
+
}
|
|
39
|
+
}, [
|
|
40
|
+
o,
|
|
41
|
+
s,
|
|
42
|
+
c
|
|
43
|
+
]), C = t(() => {
|
|
44
|
+
b.current || (_(void 0), p(!0));
|
|
45
|
+
}, []), w = t(() => {
|
|
46
|
+
p(!1), _(void 0);
|
|
47
|
+
}, []), T = t(() => {
|
|
48
|
+
h("error"), _("unsupportedFilename");
|
|
49
|
+
}, []);
|
|
50
|
+
return {
|
|
51
|
+
isDialogOpen: f,
|
|
52
|
+
status: m,
|
|
53
|
+
selectionRejectionReason: g,
|
|
54
|
+
errorKind: v,
|
|
55
|
+
openDialog: C,
|
|
56
|
+
closeDialog: w,
|
|
57
|
+
handleFilesSelected: t((e) => {
|
|
58
|
+
let t = e[0];
|
|
59
|
+
if (!(!t || b.current)) {
|
|
60
|
+
if (u(t.name, d)) {
|
|
61
|
+
T();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
_(void 0), p(!1), S(t);
|
|
65
|
+
}
|
|
66
|
+
}, [
|
|
67
|
+
d,
|
|
68
|
+
T,
|
|
69
|
+
S
|
|
70
|
+
]),
|
|
71
|
+
handleFilesRejected: T
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { s as SkillArchiveImportErrorKind, o as SkillArchiveImportStatus, c as SkillArchiveSelectionRejectionReason, l as classifySkillArchiveImportError, d as useSkillArchiveImport };
|
package/skill-editor.d.ts
CHANGED
|
@@ -43,6 +43,13 @@ export declare const buildSkillManifestForSubmit: (frontmatter: Record<string, u
|
|
|
43
43
|
*/
|
|
44
44
|
export declare const buildSkillManifestFromFrontmatter: (baseFrontmatter: Record<string, unknown>, name: string, description: string, instructions: string) => string;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Classifies an import request's HTTP status into a semantic outcome: 400/413/422 are
|
|
48
|
+
* archive-content problems, 409 is a name collision, 429 is rate limiting, 502/503 mean the
|
|
49
|
+
* backend is unavailable, and anything else (including no status at all) is generic.
|
|
50
|
+
*/
|
|
51
|
+
export declare const classifySkillArchiveImportError: (status: number | undefined) => SkillArchiveImportErrorKind;
|
|
52
|
+
|
|
46
53
|
/**
|
|
47
54
|
* Client-side mirror of the backend's `isValidSkillRelativePath`
|
|
48
55
|
* (`apps/chat-api/src/skills/utils/skill-path.util.ts`), used only for
|
|
@@ -122,6 +129,28 @@ export declare interface SkillAboutDetails {
|
|
|
122
129
|
skillPrompt?: string;
|
|
123
130
|
}
|
|
124
131
|
|
|
132
|
+
/** Semantic classification of an import request failure. */
|
|
133
|
+
export declare enum SkillArchiveImportErrorKind {
|
|
134
|
+
Validation = "validation",
|
|
135
|
+
Collision = "collision",
|
|
136
|
+
RateLimited = "rateLimited",
|
|
137
|
+
ServiceUnavailable = "serviceUnavailable",
|
|
138
|
+
Generic = "generic"
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Phase of a skill-archive import, driving the host's loading/success/error presentation. */
|
|
142
|
+
export declare enum SkillArchiveImportStatus {
|
|
143
|
+
Idle = "idle",
|
|
144
|
+
Uploading = "uploading",
|
|
145
|
+
Success = "success",
|
|
146
|
+
Error = "error"
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Reason a selected/dropped file was rejected before any request was made. */
|
|
150
|
+
export declare enum SkillArchiveSelectionRejectionReason {
|
|
151
|
+
UnsupportedFilename = "unsupportedFilename"
|
|
152
|
+
}
|
|
153
|
+
|
|
125
154
|
/** Already-configured DIAL Core download operations `useSkillEditorLoad` needs. */
|
|
126
155
|
export declare interface SkillEditorLoadClient {
|
|
127
156
|
/** Downloads the whole-skill ZIP archive. */
|
|
@@ -346,6 +375,46 @@ export declare interface UnpackedSkillArchive {
|
|
|
346
375
|
*/
|
|
347
376
|
export declare const unpackSkillArchive: (bytes: Uint8Array) => UnpackedSkillArchive;
|
|
348
377
|
|
|
378
|
+
/**
|
|
379
|
+
* Headless controller for the skill-archive upload flow: dialog visibility, the exact-filename
|
|
380
|
+
* precheck, in-flight exclusion, and import completion. The host supplies the configured request
|
|
381
|
+
* and observes completion/failure through the injected callbacks; the hook never imports app
|
|
382
|
+
* contexts, i18n, or a configured API client.
|
|
383
|
+
*/
|
|
384
|
+
export declare const useSkillArchiveImport: <TResult>({ importArchive, onImported, onError, manifestFileName, }: UseSkillArchiveImportOptions<TResult>) => UseSkillArchiveImportResult;
|
|
385
|
+
|
|
386
|
+
/** Options accepted by {@link useSkillArchiveImport}. */
|
|
387
|
+
export declare interface UseSkillArchiveImportOptions<TResult> {
|
|
388
|
+
/** Submits the selected archive; the host owns request configuration and the client. */
|
|
389
|
+
importArchive: (file: File) => Promise<TResult>;
|
|
390
|
+
/** Called once after a successful import (and any awaited host follow-up) settles. */
|
|
391
|
+
onImported: (result: TResult) => void | Promise<void>;
|
|
392
|
+
/** Called once when the import request, or the host's follow-up in {@link onImported}, fails. */
|
|
393
|
+
onError: (error: unknown, kind: SkillArchiveImportErrorKind) => void;
|
|
394
|
+
/** Exact filename treated as the skill manifest. Defaults to `'SKILL.md'`. */
|
|
395
|
+
manifestFileName?: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** Result returned by {@link useSkillArchiveImport}. */
|
|
399
|
+
export declare interface UseSkillArchiveImportResult {
|
|
400
|
+
/** Whether the upload dialog is open. */
|
|
401
|
+
isDialogOpen: boolean;
|
|
402
|
+
/** Current phase of the import. */
|
|
403
|
+
status: SkillArchiveImportStatus;
|
|
404
|
+
/** Reason the current/last selection was rejected locally; `undefined` once cleared. */
|
|
405
|
+
selectionRejectionReason: SkillArchiveSelectionRejectionReason | undefined;
|
|
406
|
+
/** Classified failure of the last import request; `undefined` outside a request failure. */
|
|
407
|
+
errorKind: SkillArchiveImportErrorKind | undefined;
|
|
408
|
+
/** Opens the dialog, unless an import is already in flight. */
|
|
409
|
+
openDialog: () => void;
|
|
410
|
+
/** Closes the dialog and clears any rejection reason. */
|
|
411
|
+
closeDialog: () => void;
|
|
412
|
+
/** Wire to the dialog drop zone's `onChange`. */
|
|
413
|
+
handleFilesSelected: (files: File[]) => void;
|
|
414
|
+
/** Wire to the dialog drop zone's `onReject`. */
|
|
415
|
+
handleFilesRejected: () => void;
|
|
416
|
+
}
|
|
417
|
+
|
|
349
418
|
/**
|
|
350
419
|
* Owns the edit-mode skill download/unpack/parse flow: the in-memory
|
|
351
420
|
* supporting-file map, the loaded manifest values and frontmatter, the
|
package/skill-editor.js
CHANGED
|
@@ -5,4 +5,5 @@ import { skillFileToAttachment as g } from "./skill/skill-file-preview.js";
|
|
|
5
5
|
import { SkillEditorLoadState as _, useSkillEditorLoad as v } from "./skill/useSkillEditorLoad.js";
|
|
6
6
|
import { useSkillEditorSubmit as y } from "./skill/useSkillEditorSubmit.js";
|
|
7
7
|
import { useSkillFileActions as b } from "./skill/useSkillFileActions.js";
|
|
8
|
-
|
|
8
|
+
import { SkillArchiveImportErrorKind as x, SkillArchiveImportStatus as S, SkillArchiveSelectionRejectionReason as C, classifySkillArchiveImportError as w, useSkillArchiveImport as T } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
|
|
9
|
+
export { e as SKILL_FILE_UPLOAD_MAX_BYTES, t as SKILL_MANIFEST_FILE, n as SKILL_UPLOAD_MAX_FILES, r as SKILL_UPLOAD_MAX_TOTAL_BYTES, x as SkillArchiveImportErrorKind, S as SkillArchiveImportStatus, C as SkillArchiveSelectionRejectionReason, _ as SkillEditorLoadState, i as buildSkillFilesPayload, a as buildSkillManifest, o as buildSkillManifestForSubmit, s as buildSkillManifestFromFrontmatter, w as classifySkillArchiveImportError, c as isValidSkillRelativePath, l as nameFromPath, u as normalizeSkillName, d as parseSkillManifest, m as parseSkillManifestDocument, f as skillFileBytesToBlob, g as skillFileToAttachment, p as unpackSkillArchive, T as useSkillArchiveImport, v as useSkillEditorLoad, y as useSkillEditorSubmit, b as useSkillFileActions, h as validateSkillFileBatch };
|