@epam/ai-dial-chat-hooks 1.1.0-dev.383 → 1.1.0-dev.390
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-DuLNy43N.js +45 -0
- package/attachment-types-AAoN9E95.js +7760 -0
- package/{attachment/useAttachmentValidation/useAttachmentValidation.d.ts → attachments.d.ts} +88 -44
- package/attachments.js +2 -0
- package/browser-Btsa0Lmr.js +607 -0
- package/catalog.d.ts +946 -0
- package/catalog.js +3 -0
- package/{conversation-sources/useConversationSources/useConversationSources.d.ts → conversation-sources.d.ts} +25 -20
- package/conversation-sources.js +2 -0
- package/conversation-transfer.d.ts +189 -0
- package/conversation-transfer.js +3 -0
- package/conversation.d.ts +907 -0
- package/conversation.js +2 -0
- package/cron-weekday-B4w29eAC.js +4 -0
- package/date-BeuD8G79.js +4 -0
- package/deployment-id-CxWgJTs9.js +6 -0
- package/file-manager.d.ts +1344 -0
- package/file-manager.js +4 -0
- package/formatting-CZyyxBG3.js +4 -0
- package/index.d.ts +4945 -126
- package/index.js +27 -19152
- package/oauth.d.ts +440 -0
- package/oauth.js +3 -0
- package/package.json +142 -21
- package/prompt-resource-Bt1I-8ri.js +41 -0
- package/scheduled-task-trigger-D9RZCk52.js +145 -0
- package/{scheduled-task/scheduled-task-trigger.d.ts → scheduled-tasks.d.ts} +51 -27
- package/scheduled-tasks.js +2 -0
- package/{conversation/useConversationScroll/useConversationScroll.d.ts → scroll-anchoring.d.ts} +50 -46
- package/scroll-anchoring.js +2 -0
- package/{useShareRecipientsCount/useShareRecipientsCount.d.ts → sharing.d.ts} +65 -36
- package/sharing.js +3 -0
- package/skill-editor.d.ts +503 -0
- package/skill-editor.js +3 -0
- package/skill-manifest-CCX8s4nn.js +4035 -0
- package/{skill/useSkillsState/useSkillsState.d.ts → skills-state.d.ts} +40 -35
- package/skills-state.js +2 -0
- package/string-utils-iBi2Y55C.js +10 -0
- package/toolset-id-CkxRHyU0.js +10 -0
- package/useAttachmentValidation-CkMTd5lA.js +102 -0
- package/useConversationImport-C2h1GBY4.js +807 -0
- package/useConversationScroll-CliIMnjP.js +122 -0
- package/useConversationSources-DKaKvjXZ.js +47 -0
- package/useDialFileManagerTabConfig-DGQw8H8H.js +2289 -0
- package/usePanelMaxWidth-BEZYuqF9.js +44 -0
- package/useShareLink-xkiaxATt.js +44 -0
- package/useShareRecipientsCount-BgwCLKY0.js +37 -0
- package/useSkillFileActions-BU5PzZ_8.js +373 -0
- package/useSkillFilePreview-BYfZUJhr.js +1005 -0
- package/useSkillsState-BoLlwmzb.js +52 -0
- package/useToolsMenu-BXdahO0i.js +1874 -0
- package/useToolsetLogin-GhFtKs4D.js +276 -0
- package/useUsageData-D7BxloKZ.js +201 -0
- package/utils.d.ts +373 -0
- package/utils.js +7 -0
- package/{usePageFileDrag/usePageFileDrag.d.ts → viewport-layout.d.ts} +27 -16
- package/viewport-layout.js +2 -0
- package/api-error/api-error.d.ts +0 -18
- package/api-error/api-error.d.ts.map +0 -1
- package/api-transport/create-csrf-middleware.d.ts +0 -15
- package/api-transport/create-csrf-middleware.d.ts.map +0 -1
- package/api-transport/create-unauthorized-middleware.d.ts +0 -40
- package/api-transport/create-unauthorized-middleware.d.ts.map +0 -1
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -32
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +0 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +0 -1
- package/catalog/catalog-derivations.d.ts +0 -27
- package/catalog/catalog-derivations.d.ts.map +0 -1
- package/catalog/catalog-primary-action.d.ts +0 -47
- package/catalog/catalog-primary-action.d.ts.map +0 -1
- package/catalog/create-publish-api.d.ts +0 -32
- package/catalog/create-publish-api.d.ts.map +0 -1
- package/catalog/deployment-endpoint-url.d.ts +0 -19
- package/catalog/deployment-endpoint-url.d.ts.map +0 -1
- package/catalog/deployment-id.d.ts +0 -21
- package/catalog/deployment-id.d.ts.map +0 -1
- package/catalog/entity-details.d.ts +0 -132
- package/catalog/entity-details.d.ts.map +0 -1
- package/catalog/map-deployment-limits-to-catalog.d.ts +0 -33
- package/catalog/map-deployment-limits-to-catalog.d.ts.map +0 -1
- package/catalog/map-deployment-limits-to-input.d.ts +0 -15
- package/catalog/map-deployment-limits-to-input.d.ts.map +0 -1
- package/catalog/map-deployment-to-catalog-item.d.ts +0 -60
- package/catalog/map-deployment-to-catalog-item.d.ts.map +0 -1
- package/catalog/map-entity-details-to-catalog.d.ts +0 -23
- package/catalog/map-entity-details-to-catalog.d.ts.map +0 -1
- package/catalog/map-prompt-to-catalog-item.d.ts +0 -43
- package/catalog/map-prompt-to-catalog-item.d.ts.map +0 -1
- package/catalog/map-skill-to-catalog-item.d.ts +0 -87
- package/catalog/map-skill-to-catalog-item.d.ts.map +0 -1
- package/catalog/mcp-endpoint-url.d.ts +0 -18
- package/catalog/mcp-endpoint-url.d.ts.map +0 -1
- package/catalog/publish.d.ts +0 -17
- package/catalog/publish.d.ts.map +0 -1
- package/catalog/useCatalogItemDetails.d.ts +0 -73
- package/catalog/useCatalogItemDetails.d.ts.map +0 -1
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +0 -37
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +0 -1
- package/catalog/usePublishFolders/usePublishFolders.d.ts +0 -73
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +0 -1
- package/conversation/announcement-message.d.ts +0 -34
- package/conversation/announcement-message.d.ts.map +0 -1
- package/conversation/conversation-transfer/async.d.ts +0 -10
- package/conversation/conversation-transfer/async.d.ts.map +0 -1
- package/conversation/conversation-transfer/attachment-refs.d.ts +0 -12
- package/conversation/conversation-transfer/attachment-refs.d.ts.map +0 -1
- package/conversation/conversation-transfer/build-upload-path.d.ts +0 -40
- package/conversation/conversation-transfer/build-upload-path.d.ts.map +0 -1
- package/conversation/conversation-transfer/date.d.ts +0 -5
- package/conversation/conversation-transfer/date.d.ts.map +0 -1
- package/conversation/conversation-transfer/dial-file-resolve.d.ts +0 -10
- package/conversation/conversation-transfer/dial-file-resolve.d.ts.map +0 -1
- package/conversation/conversation-transfer/export-conversation.d.ts +0 -8
- package/conversation/conversation-transfer/export-conversation.d.ts.map +0 -1
- package/conversation/conversation-transfer/import-conversation.d.ts +0 -82
- package/conversation/conversation-transfer/import-conversation.d.ts.map +0 -1
- package/conversation/conversation-transfer/progress.d.ts +0 -60
- package/conversation/conversation-transfer/progress.d.ts.map +0 -1
- package/conversation/conversation-transfer/queue.d.ts +0 -54
- package/conversation/conversation-transfer/queue.d.ts.map +0 -1
- package/conversation/conversation-transfer/types.d.ts +0 -36
- package/conversation/conversation-transfer/types.d.ts.map +0 -1
- package/conversation/conversation-transfer/zip-export.d.ts +0 -31
- package/conversation/conversation-transfer/zip-export.d.ts.map +0 -1
- package/conversation/conversation-transfer/zip-import.d.ts +0 -17
- package/conversation/conversation-transfer/zip-import.d.ts.map +0 -1
- package/conversation/create-chat-stream-api.d.ts +0 -38
- package/conversation/create-chat-stream-api.d.ts.map +0 -1
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +0 -39
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +0 -1
- package/conversation/display-name-watch.d.ts +0 -4
- package/conversation/display-name-watch.d.ts.map +0 -1
- package/conversation/footer-message.d.ts +0 -10
- package/conversation/footer-message.d.ts.map +0 -1
- package/conversation/get-model-id-from-conversation-id.d.ts +0 -27
- package/conversation/get-model-id-from-conversation-id.d.ts.map +0 -1
- package/conversation/greeting.d.ts +0 -18
- package/conversation/greeting.d.ts.map +0 -1
- package/conversation/message-factory.d.ts +0 -7
- package/conversation/message-factory.d.ts.map +0 -1
- package/conversation/message-utils.d.ts +0 -27
- package/conversation/message-utils.d.ts.map +0 -1
- package/conversation/overlay-messages.d.ts +0 -5
- package/conversation/overlay-messages.d.ts.map +0 -1
- package/conversation/quick-app-conversation-starters.d.ts +0 -10
- package/conversation/quick-app-conversation-starters.d.ts.map +0 -1
- package/conversation/starter-option.d.ts +0 -21
- package/conversation/starter-option.d.ts.map +0 -1
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +0 -34
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +0 -1
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +0 -46
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +0 -1
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts +0 -26
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts.map +0 -1
- package/conversation/useConversationExport/useConversationExport.d.ts +0 -72
- package/conversation/useConversationExport/useConversationExport.d.ts.map +0 -1
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts +0 -7
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts.map +0 -1
- package/conversation/useConversationHandlers/message-factory.d.ts +0 -9
- package/conversation/useConversationHandlers/message-factory.d.ts.map +0 -1
- package/conversation/useConversationHandlers/message-utils.d.ts +0 -14
- package/conversation/useConversationHandlers/message-utils.d.ts.map +0 -1
- package/conversation/useConversationHandlers/starter-option.d.ts +0 -14
- package/conversation/useConversationHandlers/starter-option.d.ts.map +0 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts +0 -66
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +0 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +0 -53
- package/conversation/useConversationImport/useConversationImport.d.ts.map +0 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +0 -24
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +0 -1
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +0 -58
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +0 -1
- package/conversation/useConversationScroll/useConversationScroll.d.ts.map +0 -1
- package/conversation/useConversationStream/apply-chunk.d.ts +0 -20
- package/conversation/useConversationStream/apply-chunk.d.ts.map +0 -1
- package/conversation/useConversationStream/buffered-generation.d.ts +0 -15
- package/conversation/useConversationStream/buffered-generation.d.ts.map +0 -1
- package/conversation/useConversationStream/conversation-path.d.ts +0 -7
- package/conversation/useConversationStream/conversation-path.d.ts.map +0 -1
- package/conversation/useConversationStream/generation-resume.d.ts +0 -39
- package/conversation/useConversationStream/generation-resume.d.ts.map +0 -1
- package/conversation/useConversationStream/useConversationStream.d.ts +0 -92
- package/conversation/useConversationStream/useConversationStream.d.ts.map +0 -1
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts +0 -32
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +0 -1
- package/conversation-sources/useConversationSources/useConversationSources.d.ts.map +0 -1
- package/files/annotation.d.ts +0 -10
- package/files/annotation.d.ts.map +0 -1
- package/files/attachment-canvas.d.ts +0 -104
- package/files/attachment-canvas.d.ts.map +0 -1
- package/files/attachment-dto-to-display.d.ts +0 -10
- package/files/attachment-dto-to-display.d.ts.map +0 -1
- package/files/attachment-types.d.ts +0 -14
- package/files/attachment-types.d.ts.map +0 -1
- package/files/create-files-api.d.ts +0 -52
- package/files/create-files-api.d.ts.map +0 -1
- package/files/create-upload-file-with-progress.d.ts +0 -24
- package/files/create-upload-file-with-progress.d.ts.map +0 -1
- package/files/dial-file-manager-copy-move.util.d.ts +0 -15
- package/files/dial-file-manager-copy-move.util.d.ts.map +0 -1
- package/files/dial-file-manager-mapping.util.d.ts +0 -35
- package/files/dial-file-manager-mapping.util.d.ts.map +0 -1
- package/files/dial-file-manager-path.util.d.ts +0 -39
- package/files/dial-file-manager-path.util.d.ts.map +0 -1
- package/files/dial-file-manager.model.d.ts +0 -26
- package/files/dial-file-manager.model.d.ts.map +0 -1
- package/files/dial-file-manager.types.d.ts +0 -317
- package/files/dial-file-manager.types.d.ts.map +0 -1
- package/files/dial-file-to-attachment.d.ts +0 -26
- package/files/dial-file-to-attachment.d.ts.map +0 -1
- package/files/dial-file.d.ts +0 -17
- package/files/dial-file.d.ts.map +0 -1
- package/files/dial-files-api.d.ts +0 -71
- package/files/dial-files-api.d.ts.map +0 -1
- package/files/download-destination.d.ts +0 -31
- package/files/download-destination.d.ts.map +0 -1
- package/files/file-manager-variant.d.ts +0 -4
- package/files/file-manager-variant.d.ts.map +0 -1
- package/files/file-name.d.ts +0 -19
- package/files/file-name.d.ts.map +0 -1
- package/files/prepare-download-destination.d.ts +0 -8
- package/files/prepare-download-destination.d.ts.map +0 -1
- package/files/resolve-dial-file-api-path.d.ts +0 -13
- package/files/resolve-dial-file-api-path.d.ts.map +0 -1
- package/files/useDialFileListing/useDialFileListing.d.ts +0 -73
- package/files/useDialFileListing/useDialFileListing.d.ts.map +0 -1
- package/files/useDialFileManager/useDialFileManager.d.ts +0 -16
- package/files/useDialFileManager/useDialFileManager.d.ts.map +0 -1
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +0 -14
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +0 -1
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts +0 -28
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +0 -1
- package/files/useDialFileMutations/useDialFileMutations.d.ts +0 -68
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +0 -1
- package/files/useDialFileSharing/useDialFileSharing.d.ts +0 -30
- package/files/useDialFileSharing/useDialFileSharing.d.ts.map +0 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +0 -45
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/oauth/authorize-url.d.ts +0 -16
- package/oauth/authorize-url.d.ts.map +0 -1
- package/oauth/handshake.d.ts +0 -30
- package/oauth/handshake.d.ts.map +0 -1
- package/oauth/models.d.ts +0 -81
- package/oauth/models.d.ts.map +0 -1
- package/oauth/popup.d.ts +0 -30
- package/oauth/popup.d.ts.map +0 -1
- package/oauth/toolset-id.d.ts +0 -23
- package/oauth/toolset-id.d.ts.map +0 -1
- package/oauth/types.d.ts +0 -84
- package/oauth/types.d.ts.map +0 -1
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +0 -54
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +0 -1
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +0 -79
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +0 -1
- package/prompt/export-prompt.d.ts +0 -31
- package/prompt/export-prompt.d.ts.map +0 -1
- package/prompt/prompt-resource.d.ts +0 -30
- package/prompt/prompt-resource.d.ts.map +0 -1
- package/prompt/prompt.d.ts +0 -34
- package/prompt/prompt.d.ts.map +0 -1
- package/prompt/usePromptsState/usePromptsState.d.ts +0 -34
- package/prompt/usePromptsState/usePromptsState.d.ts.map +0 -1
- package/scheduled-task/scheduled-task-mapping.d.ts +0 -19
- package/scheduled-task/scheduled-task-mapping.d.ts.map +0 -1
- package/scheduled-task/scheduled-task-trigger.d.ts.map +0 -1
- package/shared/application-schema.d.ts +0 -10
- package/shared/application-schema.d.ts.map +0 -1
- package/shared/browser-timezone.d.ts +0 -7
- package/shared/browser-timezone.d.ts.map +0 -1
- package/shared/cron-weekday.d.ts +0 -5
- package/shared/cron-weekday.d.ts.map +0 -1
- package/shared/custom-apps.d.ts +0 -7
- package/shared/custom-apps.d.ts.map +0 -1
- package/shared/external-services.d.ts +0 -16
- package/shared/external-services.d.ts.map +0 -1
- package/shared/formatting.d.ts +0 -5
- package/shared/formatting.d.ts.map +0 -1
- package/shared/locale.d.ts +0 -45
- package/shared/locale.d.ts.map +0 -1
- package/shared/string-utils.d.ts +0 -9
- package/shared/string-utils.d.ts.map +0 -1
- package/shared/toolset-login-events.d.ts +0 -15
- package/shared/toolset-login-events.d.ts.map +0 -1
- package/skill/skill-file-batch-validation.d.ts +0 -70
- package/skill/skill-file-batch-validation.d.ts.map +0 -1
- package/skill/skill-file-preview.d.ts +0 -25
- package/skill/skill-file-preview.d.ts.map +0 -1
- package/skill/skill-manifest.d.ts +0 -28
- package/skill/skill-manifest.d.ts.map +0 -1
- package/skill/skill-types.d.ts +0 -42
- package/skill/skill-types.d.ts.map +0 -1
- package/skill/skill.d.ts +0 -114
- package/skill/skill.d.ts.map +0 -1
- package/skill/useSkillEditorLoad.d.ts +0 -74
- package/skill/useSkillEditorLoad.d.ts.map +0 -1
- package/skill/useSkillEditorSubmit.d.ts +0 -105
- package/skill/useSkillEditorSubmit.d.ts.map +0 -1
- package/skill/useSkillFileActions.d.ts +0 -53
- package/skill/useSkillFileActions.d.ts.map +0 -1
- package/skill/useSkillFilePreview.d.ts +0 -38
- package/skill/useSkillFilePreview.d.ts.map +0 -1
- package/skill/useSkillsState/useSkillsState.d.ts.map +0 -1
- package/test-setup.d.ts +0 -2
- package/test-setup.d.ts.map +0 -1
- package/usage/useUsageData/useUsageData.d.ts +0 -20
- package/usage/useUsageData/useUsageData.d.ts.map +0 -1
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts +0 -128
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts.map +0 -1
- package/usePageFileDrag/usePageFileDrag.d.ts.map +0 -1
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts +0 -6
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts.map +0 -1
- package/useShareLink/useShareLink.d.ts +0 -23
- package/useShareLink/useShareLink.d.ts.map +0 -1
- package/useShareRecipientsCount/useShareRecipientsCount.d.ts.map +0 -1
- package/useToolsMenu/useToolsMenu.d.ts +0 -31
- package/useToolsMenu/useToolsMenu.d.ts.map +0 -1
- package/useViewportWidth/useViewportWidth.d.ts +0 -3
- package/useViewportWidth/useViewportWidth.d.ts.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
2
|
+
//#region src/usePageFileDrag/usePageFileDrag.ts
|
|
3
|
+
var a = (a = !0, o = !0) => {
|
|
4
|
+
let [s, c] = i(!1), [l, u] = i([]), d = r(0), f = r(a), p = r(o);
|
|
5
|
+
n(() => {
|
|
6
|
+
f.current = a, p.current = o, o || (d.current = 0, c(!1));
|
|
7
|
+
}, [a, o]);
|
|
8
|
+
let m = e(() => {
|
|
9
|
+
u([]);
|
|
10
|
+
}, []);
|
|
11
|
+
return t(() => {
|
|
12
|
+
let e = (e) => !!e.dataTransfer?.types.includes("Files"), t = (t) => {
|
|
13
|
+
!p.current || !e(t) || (d.current += 1, c(!0));
|
|
14
|
+
}, n = (t) => {
|
|
15
|
+
!p.current || !e(t) || (--d.current, d.current <= 0 && (d.current = 0, c(!1)));
|
|
16
|
+
}, r = (t) => {
|
|
17
|
+
e(t) && (t.preventDefault(), p.current);
|
|
18
|
+
}, i = (t) => {
|
|
19
|
+
if (!(!e(t) || !p.current) && (t.preventDefault(), d.current = 0, c(!1), f.current)) {
|
|
20
|
+
let e = Array.from(t.dataTransfer?.files ?? []);
|
|
21
|
+
e.length > 0 && u(e);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return document.addEventListener("dragenter", t), document.addEventListener("dragleave", n), document.addEventListener("dragover", r), document.addEventListener("drop", i), () => {
|
|
25
|
+
document.removeEventListener("dragenter", t), document.removeEventListener("dragleave", n), document.removeEventListener("dragover", r), document.removeEventListener("drop", i);
|
|
26
|
+
};
|
|
27
|
+
}, []), {
|
|
28
|
+
isDragging: s,
|
|
29
|
+
pendingFiles: l,
|
|
30
|
+
onFilesConsumed: m
|
|
31
|
+
};
|
|
32
|
+
}, o = () => typeof window < "u" ? window.innerWidth : 1024, s = () => {
|
|
33
|
+
let [e, n] = i(o);
|
|
34
|
+
return t(() => {
|
|
35
|
+
if (typeof window > "u") return;
|
|
36
|
+
let e = () => n(window.innerWidth);
|
|
37
|
+
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
38
|
+
}, []), e;
|
|
39
|
+
}, c = (e) => {
|
|
40
|
+
let t = s();
|
|
41
|
+
return Math.max(0, t - e);
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as n, a as r, c as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
import { ShareLinkResponseDtoAccessEnum as i } from "@epam/ai-dial-chat-api-client";
|
|
3
|
+
import { ShareLinkAccess as a } from "@epam/ai-dial-share";
|
|
4
|
+
//#region src/useShareLink/useShareLink.ts
|
|
5
|
+
var o = (e) => e.map((e) => e === i.Edit ? a.Edit : a.View), s = (e, t) => {
|
|
6
|
+
let n = new URL(e, t);
|
|
7
|
+
return `${t}${n.pathname}${n.search}${n.hash}`;
|
|
8
|
+
}, c = (i, c, l = window.location.origin) => {
|
|
9
|
+
let [u, d] = r(), [f, p] = r(!0), [m, h] = r(null), g = n(0), _ = e(async (e = [a.View]) => {
|
|
10
|
+
let t = ++g.current;
|
|
11
|
+
p(!0), h(null);
|
|
12
|
+
try {
|
|
13
|
+
let n = await i.createShareLink({ createShareLinkDto: {
|
|
14
|
+
itemId: c,
|
|
15
|
+
access: e
|
|
16
|
+
} });
|
|
17
|
+
g.current === t && d({
|
|
18
|
+
url: s(n.url, l),
|
|
19
|
+
expiresInDays: n.expiresInDays,
|
|
20
|
+
access: o(n.access)
|
|
21
|
+
});
|
|
22
|
+
} catch (e) {
|
|
23
|
+
g.current === t && h(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create share link"));
|
|
24
|
+
} finally {
|
|
25
|
+
g.current === t && p(!1);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
c,
|
|
29
|
+
l,
|
|
30
|
+
i
|
|
31
|
+
]);
|
|
32
|
+
return t(() => {
|
|
33
|
+
d(void 0), _();
|
|
34
|
+
}, [c, _]), {
|
|
35
|
+
data: u,
|
|
36
|
+
isLoading: f,
|
|
37
|
+
error: m,
|
|
38
|
+
setAccess: e((e) => {
|
|
39
|
+
_(e);
|
|
40
|
+
}, [_])
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { c as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
2
|
+
//#region src/useShareRecipientsCount/useShareRecipientsCount.ts
|
|
3
|
+
var r = /* @__PURE__ */ function(e) {
|
|
4
|
+
return e.Idle = "idle", e.Loading = "loading", e.Resolved = "resolved", e.Unknown = "unknown", e;
|
|
5
|
+
}({}), i = { status: "idle" }, a = (r) => {
|
|
6
|
+
let [a, o] = n({}), s = t(/* @__PURE__ */ new Set());
|
|
7
|
+
return {
|
|
8
|
+
requestRecipientsCount: e((e) => {
|
|
9
|
+
s.current.has(e) || (s.current.add(e), o((t) => ({
|
|
10
|
+
...t,
|
|
11
|
+
[e]: { status: "loading" }
|
|
12
|
+
})), (async () => {
|
|
13
|
+
try {
|
|
14
|
+
let { recipientsCount: t } = await r.getShareRecipientsCount({ itemId: e });
|
|
15
|
+
o((n) => ({
|
|
16
|
+
...n,
|
|
17
|
+
[e]: {
|
|
18
|
+
status: "resolved",
|
|
19
|
+
count: t
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
} catch {
|
|
23
|
+
o((t) => ({
|
|
24
|
+
...t,
|
|
25
|
+
[e]: { status: "unknown" }
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
})());
|
|
29
|
+
}, [r]),
|
|
30
|
+
getRecipientsCount: e((e) => a[e] ?? i, [a]),
|
|
31
|
+
invalidateRecipientsCount: e((e) => {
|
|
32
|
+
s.current.delete(e), o(({ [e]: t, ...n }) => n);
|
|
33
|
+
}, [])
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { a as n, r as t };
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { r as e, t } from "./api-error-DuLNy43N.js";
|
|
2
|
+
import { i as n } from "./string-utils-iBi2Y55C.js";
|
|
3
|
+
import { c as r, d as i, f as a, h as o, l as s, n as c, o as l, p as u, r as d, s as f, u as p } from "./skill-manifest-CCX8s4nn.js";
|
|
4
|
+
import { RequestStatus as m, formatFileSize as h, getAttachmentTypeFromMime as g, getUtf8ByteLength as _, inferMimeTypeFromPath as v } from "@epam/ai-dial-chat-shared";
|
|
5
|
+
import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
6
|
+
import { SkillFileCandidateKind as w, SkillFileNodeKind as T, SkillFileValidationStatus as E } from "@epam/ai-dial-skill-editor";
|
|
7
|
+
import { NotificationVariant as D } from "@epam/ai-dial-ui-kit";
|
|
8
|
+
//#region src/skill/skill-file-batch-validation.ts
|
|
9
|
+
var O = async (e, t) => {
|
|
10
|
+
let { existingPaths: n, existingTotalBytes: r, manifestByteLength: i, messages: a } = t, o = [], s = [], l = new Set(n), d = /* @__PURE__ */ new Map();
|
|
11
|
+
for (let { path: t } of e) t !== "SKILL.md" && d.set(t, (d.get(t) ?? 0) + 1);
|
|
12
|
+
let f = 0, m = /* @__PURE__ */ new Set(), g, _ = i, v = 0;
|
|
13
|
+
for (let t of e) {
|
|
14
|
+
let { id: e, file: n, path: r } = t, i, s = w.SupportingFile;
|
|
15
|
+
if (r.toLowerCase() === "skill.md" && r !== "SKILL.md") i = a.manifestCasingInvalid;
|
|
16
|
+
else if (r === "SKILL.md") if (s = w.Manifest, v += 1, n.size > 1048576) i = a.fileTooLarge(h(c));
|
|
17
|
+
else try {
|
|
18
|
+
let t = await n.text();
|
|
19
|
+
if (t.includes("�")) i = a.manifestInvalidUtf8;
|
|
20
|
+
else {
|
|
21
|
+
let { frontmatter: r, instructions: o } = u(t), s = typeof r.name == "string" ? r.name : "", c = typeof r.description == "string" ? r.description : "";
|
|
22
|
+
!s.trim() || !c.trim() ? i = a.manifestInvalidFrontmatter : v === 1 && (g = {
|
|
23
|
+
candidateId: e,
|
|
24
|
+
name: s,
|
|
25
|
+
description: c,
|
|
26
|
+
frontmatter: r,
|
|
27
|
+
instructions: o
|
|
28
|
+
}, _ = n.size);
|
|
29
|
+
}
|
|
30
|
+
} catch {
|
|
31
|
+
i = a.manifestInvalidFrontmatter;
|
|
32
|
+
}
|
|
33
|
+
else r ? p(r) ? l.has(r) || (d.get(r) ?? 0) > 1 ? i = a.pathDuplicate : n.size > 1048576 && (i = a.fileTooLarge(h(c))) : i = a.pathInvalid : i = a.required;
|
|
34
|
+
!i && s === w.SupportingFile && (m.add(r), f += n.size), o.push({
|
|
35
|
+
candidateId: e,
|
|
36
|
+
status: i ? E.Invalid : E.Valid,
|
|
37
|
+
kind: s,
|
|
38
|
+
error: i
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (v > 1) {
|
|
42
|
+
s.push({ message: a.manifestDuplicate }), g = void 0, _ = i;
|
|
43
|
+
for (let e of o) e.kind === w.Manifest && !e.error && (e.status = E.Invalid, e.error = a.manifestDuplicate);
|
|
44
|
+
}
|
|
45
|
+
return r + f + _ > 16777216 && s.push({ message: a.totalSizeExceeded }), l.size + m.size + 1 > 100 && s.push({ message: a.totalCountExceeded }), {
|
|
46
|
+
results: o,
|
|
47
|
+
batchErrors: s,
|
|
48
|
+
manifestCandidate: g
|
|
49
|
+
};
|
|
50
|
+
}, k = (e, t) => {
|
|
51
|
+
let n = t.mimeType || v(e.path) || "", r = new File([new Uint8Array(t.bytes)], e.name, n ? { type: n } : void 0);
|
|
52
|
+
return {
|
|
53
|
+
id: e.path,
|
|
54
|
+
name: e.name,
|
|
55
|
+
contentType: n,
|
|
56
|
+
type: g(n),
|
|
57
|
+
status: m.Idle,
|
|
58
|
+
file: r
|
|
59
|
+
};
|
|
60
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
61
|
+
return e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e.Forbidden = "forbidden", e.NotFound = "not-found", e;
|
|
62
|
+
}({}), j = class extends Error {}, M = (e, t) => {
|
|
63
|
+
let r = e.parentPath ? n(e.parentPath) : "", i = `${t.replace(/\/+$/g, "")}/files`;
|
|
64
|
+
return r === i ? e.name : r.startsWith(`${i}/`) ? `${r.slice(i.length + 1)}/${e.name}` : r === "files" ? e.name : r.startsWith("files/") ? `${r.slice(6)}/${e.name}` : null;
|
|
65
|
+
}, N = async (e, t, n) => {
|
|
66
|
+
let r = await e.downloadSkill(t, n), i = r.headers.get("etag");
|
|
67
|
+
if (!i) throw new j("Skill ETag is missing");
|
|
68
|
+
try {
|
|
69
|
+
let e = await r.arrayBuffer(), { manifestText: t, files: n } = o(new Uint8Array(e));
|
|
70
|
+
return {
|
|
71
|
+
etag: i,
|
|
72
|
+
manifestText: t,
|
|
73
|
+
files: n
|
|
74
|
+
};
|
|
75
|
+
} catch {
|
|
76
|
+
throw new j("Skill ZIP is invalid");
|
|
77
|
+
}
|
|
78
|
+
}, P = async (e, t, n) => {
|
|
79
|
+
let [r, i] = await Promise.all([e.downloadSkillFile(t, n, d), e.listSkillFiles({
|
|
80
|
+
bucket: t,
|
|
81
|
+
path: n,
|
|
82
|
+
filePath: "",
|
|
83
|
+
recursive: !0
|
|
84
|
+
})]), a = i.items.find((e) => e.nodeType === "item" && M(e, n) === "SKILL.md"), o = r.headers.get("etag") ?? a?.etag;
|
|
85
|
+
if (!o) throw Error("Skill ETag is missing");
|
|
86
|
+
let s = i.items.filter((e) => e.nodeType === "item").map((e) => ({
|
|
87
|
+
item: e,
|
|
88
|
+
path: M(e, n)
|
|
89
|
+
})).filter((e) => e.path != null && e.path !== "SKILL.md"), c = await Promise.all(s.map(async ({ path: r }) => {
|
|
90
|
+
let i = await e.downloadSkillFile(t, n, r);
|
|
91
|
+
return [r, new Uint8Array(await i.arrayBuffer())];
|
|
92
|
+
}));
|
|
93
|
+
return {
|
|
94
|
+
etag: o,
|
|
95
|
+
manifestText: await r.text(),
|
|
96
|
+
files: new Map(c)
|
|
97
|
+
};
|
|
98
|
+
}, F = ({ isEditMode: t, bucket: n, skillPath: r, client: a }) => {
|
|
99
|
+
let [o, s] = C(t ? "loading" : "loaded"), [c, l] = C(0), [d, f] = C(), p = S(void 0), m = S({}), h = S(void 0), [g, _] = C([]), v = S(/* @__PURE__ */ new Map());
|
|
100
|
+
return b(() => {
|
|
101
|
+
if (!t || !n) return;
|
|
102
|
+
if (r == null) {
|
|
103
|
+
s("error");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
let o = !1;
|
|
107
|
+
return s("loading"), (async () => {
|
|
108
|
+
if (await Promise.resolve(), !o) try {
|
|
109
|
+
let t;
|
|
110
|
+
try {
|
|
111
|
+
t = await N(a, n, r);
|
|
112
|
+
} catch (i) {
|
|
113
|
+
let o = e(i);
|
|
114
|
+
if (!(i instanceof j) && o !== 400) throw i;
|
|
115
|
+
t = await P(a, n, r);
|
|
116
|
+
}
|
|
117
|
+
let { frontmatter: c, instructions: l } = u(t.manifestText);
|
|
118
|
+
if (o) return;
|
|
119
|
+
p.current = t.etag, m.current = c, h.current = r, v.current = new Map([...t.files].map(([e, t]) => [e, { bytes: t }])), _([...t.files.keys()].map((e) => ({
|
|
120
|
+
path: e,
|
|
121
|
+
name: i(e),
|
|
122
|
+
kind: T.File
|
|
123
|
+
}))), f({
|
|
124
|
+
name: typeof c.name == "string" ? c.name : "",
|
|
125
|
+
description: typeof c.description == "string" ? c.description : "",
|
|
126
|
+
instructions: l
|
|
127
|
+
}), s("loaded");
|
|
128
|
+
} catch (t) {
|
|
129
|
+
if (o) return;
|
|
130
|
+
let n = e(t);
|
|
131
|
+
s(n === 403 ? "forbidden" : n === 404 ? "not-found" : "error");
|
|
132
|
+
}
|
|
133
|
+
})(), () => {
|
|
134
|
+
o = !0;
|
|
135
|
+
};
|
|
136
|
+
}, [
|
|
137
|
+
t,
|
|
138
|
+
n,
|
|
139
|
+
r,
|
|
140
|
+
c,
|
|
141
|
+
a
|
|
142
|
+
]), {
|
|
143
|
+
loadState: o,
|
|
144
|
+
loadedValues: d,
|
|
145
|
+
setLoadedValues: f,
|
|
146
|
+
files: g,
|
|
147
|
+
setFiles: _,
|
|
148
|
+
filesContentRef: v,
|
|
149
|
+
frontmatterRef: m,
|
|
150
|
+
etagRef: p,
|
|
151
|
+
loadedPathRef: h,
|
|
152
|
+
retryLoad: () => l((e) => e + 1)
|
|
153
|
+
};
|
|
154
|
+
}, I = (e, t) => JSON.stringify({
|
|
155
|
+
values: e,
|
|
156
|
+
files: [...t].sort((e, t) => e.path.localeCompare(t.path))
|
|
157
|
+
}), L = ({ bucket: n, isEditMode: i, files: o, filesContentRef: s, frontmatterRef: c, loadedPathRef: u, etagRef: d, returnUrl: f, refetchSkills: m, client: h, messages: g, onNavigate: _, onNotify: v }) => {
|
|
158
|
+
let [b, x] = C({}), [w, T] = C(), [E, O] = C(), [k, A] = C("idle"), j = S(null), M = y(async (n) => {
|
|
159
|
+
switch (e(n)) {
|
|
160
|
+
case 409:
|
|
161
|
+
x({ name: g.nameConflict });
|
|
162
|
+
return;
|
|
163
|
+
case 412:
|
|
164
|
+
x({ name: g.nameConflict });
|
|
165
|
+
return;
|
|
166
|
+
case 413:
|
|
167
|
+
T(g.archiveTooLarge);
|
|
168
|
+
return;
|
|
169
|
+
case 503:
|
|
170
|
+
T(g.serviceUnavailable);
|
|
171
|
+
return;
|
|
172
|
+
case 400: {
|
|
173
|
+
let { message: e } = await t(n);
|
|
174
|
+
T(e ?? g.pathInvalid);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
default: {
|
|
178
|
+
let { traceId: e } = await t(n);
|
|
179
|
+
T(g.saveError), v({
|
|
180
|
+
variant: D.Error,
|
|
181
|
+
message: g.saveError,
|
|
182
|
+
requestId: e
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, [g, v]), N = y(async (e) => {
|
|
187
|
+
let t = a(e.name);
|
|
188
|
+
if (!t || !p(t)) {
|
|
189
|
+
x({ name: g.nameInvalid });
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
let i = I(e, o), u = j.current, d = u != null && u.fingerprint === i, y = t, b, S, C;
|
|
193
|
+
d ? {skillManifest: b, filePaths: S, files: C} = u : (b = r(c.current, t, e.description, e.instructions), {filePaths: S, files: C} = l(o, s.current)), A("submitting"), j.current = {
|
|
194
|
+
fingerprint: i,
|
|
195
|
+
bucket: n,
|
|
196
|
+
path: y,
|
|
197
|
+
skillManifest: b,
|
|
198
|
+
filePaths: S,
|
|
199
|
+
files: C
|
|
200
|
+
};
|
|
201
|
+
try {
|
|
202
|
+
await h.createSkill(n, y, b, S, C), await m(), A("success"), v({
|
|
203
|
+
variant: D.Success,
|
|
204
|
+
title: g.saveSuccessTitle,
|
|
205
|
+
message: g.createSuccess(t)
|
|
206
|
+
}), _(f);
|
|
207
|
+
} catch (e) {
|
|
208
|
+
A("failure"), await M(e);
|
|
209
|
+
}
|
|
210
|
+
}, [
|
|
211
|
+
n,
|
|
212
|
+
o,
|
|
213
|
+
s,
|
|
214
|
+
c,
|
|
215
|
+
g,
|
|
216
|
+
h,
|
|
217
|
+
v,
|
|
218
|
+
_,
|
|
219
|
+
f,
|
|
220
|
+
m,
|
|
221
|
+
M
|
|
222
|
+
]), P = y(async (t) => {
|
|
223
|
+
let i = u.current, a = d.current;
|
|
224
|
+
if (!i || !a) {
|
|
225
|
+
T(g.saveError);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
let p = r(c.current, t.name, t.description, t.instructions), { filePaths: y, files: b } = l(o, s.current);
|
|
229
|
+
A("submitting");
|
|
230
|
+
try {
|
|
231
|
+
d.current = (await h.updateSkill(n, i, p, y, b, a)).etag ?? a, await m(), A("success"), v({
|
|
232
|
+
variant: D.Success,
|
|
233
|
+
title: g.updateSuccessTitle,
|
|
234
|
+
message: g.updateSuccess(t.name)
|
|
235
|
+
}), _(f);
|
|
236
|
+
} catch (t) {
|
|
237
|
+
if (A("failure"), e(t) === 412) {
|
|
238
|
+
O({ message: g.conflictMessage });
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
await M(t);
|
|
242
|
+
}
|
|
243
|
+
}, [
|
|
244
|
+
n,
|
|
245
|
+
o,
|
|
246
|
+
s,
|
|
247
|
+
c,
|
|
248
|
+
u,
|
|
249
|
+
d,
|
|
250
|
+
g,
|
|
251
|
+
h,
|
|
252
|
+
v,
|
|
253
|
+
_,
|
|
254
|
+
f,
|
|
255
|
+
m,
|
|
256
|
+
M
|
|
257
|
+
]);
|
|
258
|
+
return {
|
|
259
|
+
phase: k,
|
|
260
|
+
errors: b,
|
|
261
|
+
submitError: w,
|
|
262
|
+
conflict: E,
|
|
263
|
+
clearConflict: () => O(void 0),
|
|
264
|
+
handleSubmit: y(async (e) => {
|
|
265
|
+
if (k === "submitting" || !n) return;
|
|
266
|
+
let t = {};
|
|
267
|
+
if (e.name.trim() || (t.name = g.required), e.description.trim() || (t.description = g.required), e.instructions.trim() || (t.instructions = g.required), Object.keys(t).length > 0) {
|
|
268
|
+
x(t);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
x({}), T(void 0), O(void 0), i ? await P(e) : await N(e);
|
|
272
|
+
}, [
|
|
273
|
+
k,
|
|
274
|
+
n,
|
|
275
|
+
g,
|
|
276
|
+
i,
|
|
277
|
+
P,
|
|
278
|
+
N
|
|
279
|
+
])
|
|
280
|
+
};
|
|
281
|
+
}, R = ({ files: e, setFiles: t, filesContentRef: n, frontmatterRef: r, loadedValues: a, setLoadedValues: o, isEditMode: c, isDirty: l, setSelectedPath: u, messages: p }) => {
|
|
282
|
+
let [m, h] = C(!1), g = S(null), v = y(() => {
|
|
283
|
+
let t = e.filter((e) => e.kind === T.File).map((e) => e.path), i = 0;
|
|
284
|
+
for (let e of t) i += n.current.get(e)?.bytes.length ?? 0;
|
|
285
|
+
let o = {
|
|
286
|
+
name: a?.name ?? "",
|
|
287
|
+
description: a?.description ?? "",
|
|
288
|
+
instructions: a?.instructions ?? ""
|
|
289
|
+
}, l = c ? s(r.current, o.name, o.description, o.instructions) : f(o);
|
|
290
|
+
return {
|
|
291
|
+
existingPaths: t,
|
|
292
|
+
existingTotalBytes: i,
|
|
293
|
+
manifestByteLength: _(l),
|
|
294
|
+
messages: p
|
|
295
|
+
};
|
|
296
|
+
}, [
|
|
297
|
+
e,
|
|
298
|
+
n,
|
|
299
|
+
c,
|
|
300
|
+
r,
|
|
301
|
+
a,
|
|
302
|
+
p
|
|
303
|
+
]), b = y(() => new Promise((e) => {
|
|
304
|
+
g.current = e, h(!0);
|
|
305
|
+
}), []), w = y((e) => {
|
|
306
|
+
h(!1), g.current?.(e), g.current = null;
|
|
307
|
+
}, []);
|
|
308
|
+
return {
|
|
309
|
+
fileActions: x(() => ({
|
|
310
|
+
validateBatch: async (e) => {
|
|
311
|
+
let { results: t, batchErrors: n } = await O(e, v());
|
|
312
|
+
return {
|
|
313
|
+
results: t,
|
|
314
|
+
batchErrors: n
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
commitBatch: async (e) => {
|
|
318
|
+
let { results: s, batchErrors: u, manifestCandidate: d } = await O(e, v());
|
|
319
|
+
if (s.some((e) => e.error !== void 0) || u.length > 0) return { error: u[0]?.message ?? p.saveError };
|
|
320
|
+
if (d) {
|
|
321
|
+
if (c && d.name !== (a?.name ?? "")) return { error: p.manifestNameMismatch };
|
|
322
|
+
if ((c || l) && !await b()) return { error: p.manifestImportDeclined };
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
let s = e.filter((e) => e.id !== d?.candidateId), l = await Promise.all(s.map(async (e) => ({
|
|
326
|
+
path: e.path,
|
|
327
|
+
bytes: new Uint8Array(await e.file.arrayBuffer()),
|
|
328
|
+
mimeType: e.file.type || void 0
|
|
329
|
+
})));
|
|
330
|
+
for (let e of l) n.current.set(e.path, {
|
|
331
|
+
bytes: e.bytes,
|
|
332
|
+
mimeType: e.mimeType
|
|
333
|
+
});
|
|
334
|
+
return l.length > 0 && t((e) => [...e, ...l.map((e) => ({
|
|
335
|
+
path: e.path,
|
|
336
|
+
name: i(e.path),
|
|
337
|
+
kind: T.File
|
|
338
|
+
}))]), d && (r.current = c ? {
|
|
339
|
+
...r.current,
|
|
340
|
+
...d.frontmatter
|
|
341
|
+
} : d.frontmatter, o({
|
|
342
|
+
name: c ? a?.name ?? d.name : d.name,
|
|
343
|
+
description: d.description,
|
|
344
|
+
instructions: d.instructions
|
|
345
|
+
})), {};
|
|
346
|
+
} catch (e) {
|
|
347
|
+
return { error: e instanceof Error ? e.message : String(e) };
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
onRemoveNode: (e) => {
|
|
351
|
+
t((t) => t.filter((t) => t.path !== e && !t.path.startsWith(`${e}/`)));
|
|
352
|
+
for (let t of [...n.current.keys()]) (t === e || t.startsWith(`${e}/`)) && n.current.delete(t);
|
|
353
|
+
u((t) => t === e || t.startsWith(`${e}/`) ? d : t);
|
|
354
|
+
}
|
|
355
|
+
}), [
|
|
356
|
+
v,
|
|
357
|
+
c,
|
|
358
|
+
l,
|
|
359
|
+
a,
|
|
360
|
+
b,
|
|
361
|
+
n,
|
|
362
|
+
r,
|
|
363
|
+
t,
|
|
364
|
+
o,
|
|
365
|
+
u,
|
|
366
|
+
p
|
|
367
|
+
]),
|
|
368
|
+
pendingManifestImport: m,
|
|
369
|
+
resolveManifestImport: w
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
//#endregion
|
|
373
|
+
export { k as a, F as i, L as n, O as o, A as r, R as t };
|