@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,503 @@
|
|
|
1
|
+
import { Attachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
import { NotificationVariant } from '@epam/ai-dial-ui-kit';
|
|
4
|
+
import { SetStateAction } from 'react';
|
|
5
|
+
import { SkillEditorErrors } from '@epam/ai-dial-skill-editor';
|
|
6
|
+
import { SkillEditorFileActions } from '@epam/ai-dial-skill-editor';
|
|
7
|
+
import { SkillEditorValues } from '@epam/ai-dial-skill-editor';
|
|
8
|
+
import { SkillFileBatchError } from '@epam/ai-dial-skill-editor';
|
|
9
|
+
import { SkillFileListResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
10
|
+
import { SkillFileTreeNode } from '@epam/ai-dial-skill-editor';
|
|
11
|
+
import { SkillFileUploadCandidate } from '@epam/ai-dial-skill-editor';
|
|
12
|
+
import { SkillFileValidationResult } from '@epam/ai-dial-skill-editor';
|
|
13
|
+
import { SkillUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Builds the ordered supporting-file paths and `Blob` payload
|
|
17
|
+
* `createSkill`/`updateSkill` expect from the editor's file tree and
|
|
18
|
+
* in-memory content map.
|
|
19
|
+
*/
|
|
20
|
+
export declare const buildSkillFilesPayload: (files: SkillFileTreeNode[], filesContent: Map<string, SkillFileContent>) => SkillFilesPayload;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builds `SKILL.md`'s content: a YAML frontmatter block (`name`/`description`,
|
|
24
|
+
* serialized with the `yaml` package so special characters are always
|
|
25
|
+
* correctly escaped) followed by the raw instructions body.
|
|
26
|
+
*/
|
|
27
|
+
export declare const buildSkillManifest: ({ name, description, instructions, }: SkillManifestValues) => string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Builds `SKILL.md`'s content for a create or edit submission: reassigns
|
|
31
|
+
* onto the loaded/imported frontmatter when one exists (so unrecognized
|
|
32
|
+
* fields survive), otherwise builds a fresh manifest from just `name`/
|
|
33
|
+
* `description`/`instructions`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const buildSkillManifestForSubmit: (frontmatter: Record<string, unknown>, name: string, description: string, instructions: string) => string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Builds `SKILL.md`'s content for an edit save: reassigns only `name`/
|
|
39
|
+
* `description` onto the *loaded* frontmatter object (mutating a shallow
|
|
40
|
+
* copy, never the original) so unrecognized fields (e.g. `version`) survive
|
|
41
|
+
* re-serialization unchanged, then appends the (possibly edited)
|
|
42
|
+
* instructions body.
|
|
43
|
+
*/
|
|
44
|
+
export declare const buildSkillManifestFromFrontmatter: (baseFrontmatter: Record<string, unknown>, name: string, description: string, instructions: string) => string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Client-side mirror of the backend's `isValidSkillRelativePath`
|
|
48
|
+
* (`apps/chat-api/src/skills/utils/skill-path.util.ts`), used only for
|
|
49
|
+
* immediate inline feedback — the server remains authoritative and may still
|
|
50
|
+
* reject a path this function accepts.
|
|
51
|
+
*/
|
|
52
|
+
export declare const isValidSkillRelativePath: (relativePath: string) => boolean;
|
|
53
|
+
|
|
54
|
+
/** Returns a skill relative path's final segment (its display name in the file tree). */
|
|
55
|
+
export declare const nameFromPath: (path: string) => string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Normalizes a user-entered skill name to the DIAL naming convention
|
|
59
|
+
* (lowercase letters, digits, and hyphens; no spaces): lowercases the input,
|
|
60
|
+
* replaces every run of whitespace/invalid characters with a single hyphen,
|
|
61
|
+
* and trims leading/trailing hyphens.
|
|
62
|
+
*/
|
|
63
|
+
export declare const normalizeSkillName: (input: string) => string;
|
|
64
|
+
|
|
65
|
+
/** A skill's `SKILL.md` split into its parsed frontmatter object and the raw instructions body. */
|
|
66
|
+
export declare interface ParsedSkillManifest {
|
|
67
|
+
/** The full parsed frontmatter object, including fields this app never renders. */
|
|
68
|
+
frontmatter: Record<string, unknown>;
|
|
69
|
+
/** The instructions body following the closing `---` delimiter. */
|
|
70
|
+
instructions: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Parses a `SKILL.md`'s YAML frontmatter and instructions body — the inverse
|
|
75
|
+
* of `buildSkillManifest`/`buildSkillManifestFromFrontmatter`. Throws if the
|
|
76
|
+
* manifest has no `---`-delimited frontmatter block.
|
|
77
|
+
*/
|
|
78
|
+
export declare const parseSkillManifest: (manifestText: string) => ParsedSkillManifest;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Splits a `SKILL.md` into its YAML frontmatter fields and its prose body.
|
|
82
|
+
*
|
|
83
|
+
* Never throws: a file with no opening fence, no closing fence, or frontmatter
|
|
84
|
+
* that fails to parse resolves to the whole input as `body` with no
|
|
85
|
+
* frontmatter fields. Parse failure is strictly weaker than fetch failure —
|
|
86
|
+
* the manifest text is still returned so the Content tab can render it.
|
|
87
|
+
*/
|
|
88
|
+
export declare const parseSkillManifestDocument: (raw: string) => SkillManifestDocument;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Client-side mirror of the backend's default `SKILL_FILE_UPLOAD_MAX_BYTES`
|
|
92
|
+
* (`apps/chat-api/src/config/environment.config.ts`), used only for
|
|
93
|
+
* immediate inline feedback when a user picks a file to upload — the server
|
|
94
|
+
* remains authoritative and enforces its own configured limit regardless.
|
|
95
|
+
*/
|
|
96
|
+
export declare const SKILL_FILE_UPLOAD_MAX_BYTES = 1048576;
|
|
97
|
+
|
|
98
|
+
/** Root manifest filename required at the top of every skill archive (mirrors `SKILL_MANIFEST_FILE` in `apps/chat-api/src/skills/utils/skill-path.util.ts`). */
|
|
99
|
+
export declare const SKILL_MANIFEST_FILE = "SKILL.md";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Client-side mirror of the backend's default `SKILL_UPLOAD_MAX_FILES`
|
|
103
|
+
* (`apps/chat-api/src/config/environment.config.ts`), used only for
|
|
104
|
+
* immediate inline feedback on the projected total file count (including the
|
|
105
|
+
* root `SKILL.md`) — the server remains authoritative regardless.
|
|
106
|
+
*/
|
|
107
|
+
export declare const SKILL_UPLOAD_MAX_FILES = 100;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Client-side mirror of the backend's default `SKILL_UPLOAD_MAX_TOTAL_BYTES`
|
|
111
|
+
* (`apps/chat-api/src/config/environment.config.ts`), used only for
|
|
112
|
+
* immediate inline feedback on the projected total package size — the server
|
|
113
|
+
* remains authoritative and enforces its own configured limit regardless.
|
|
114
|
+
*/
|
|
115
|
+
export declare const SKILL_UPLOAD_MAX_TOTAL_BYTES = 16777216;
|
|
116
|
+
|
|
117
|
+
/** Structured fields lifted from a skill manifest's frontmatter. */
|
|
118
|
+
export declare interface SkillAboutDetails {
|
|
119
|
+
whenToUse?: string;
|
|
120
|
+
allowedTools?: string[];
|
|
121
|
+
bundledResources?: string[];
|
|
122
|
+
skillPrompt?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Already-configured DIAL Core download operations `useSkillEditorLoad` needs. */
|
|
126
|
+
export declare interface SkillEditorLoadClient {
|
|
127
|
+
/** Downloads the whole-skill ZIP archive. */
|
|
128
|
+
downloadSkill: (bucket: string, path: string) => Promise<Response>;
|
|
129
|
+
/** Downloads one file within the skill (the manifest or a supporting file). */
|
|
130
|
+
downloadSkillFile: (bucket: string, path: string, filePath: string) => Promise<Response>;
|
|
131
|
+
/** Lists the skill's files when the whole-skill ZIP route is unusable. */
|
|
132
|
+
listSkillFiles: (params: {
|
|
133
|
+
bucket: string;
|
|
134
|
+
path?: string;
|
|
135
|
+
filePath: string;
|
|
136
|
+
recursive?: boolean;
|
|
137
|
+
}) => Promise<SkillFileListResponseDto>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Edit-mode load state for a skill-authoring form; create mode never leaves `Loaded`. */
|
|
141
|
+
export declare enum SkillEditorLoadState {
|
|
142
|
+
/** The edit-mode download/parse flow is in flight. */
|
|
143
|
+
Loading = "loading",
|
|
144
|
+
/** The skill loaded successfully (or create mode, which starts here). */
|
|
145
|
+
Loaded = "loaded",
|
|
146
|
+
/** The download/parse flow failed for a reason other than 403/404. */
|
|
147
|
+
Error = "error",
|
|
148
|
+
/** The caller lacks permission to read the skill. */
|
|
149
|
+
Forbidden = "forbidden",
|
|
150
|
+
/** The skill no longer exists at the given path. */
|
|
151
|
+
NotFound = "not-found"
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Already-configured DIAL Core write operations `useSkillEditorSubmit` needs. */
|
|
155
|
+
export declare interface SkillEditorSubmitClient {
|
|
156
|
+
/** Creates a new skill. */
|
|
157
|
+
createSkill: (bucket: string, path: string, skillManifest: string, filePaths: string[], files: Blob[]) => Promise<SkillUploadResponseDto>;
|
|
158
|
+
/** Updates an existing skill, sending `ifMatch` as the concurrency guard. */
|
|
159
|
+
updateSkill: (bucket: string, path: string, skillManifest: string, filePaths: string[], files: Blob[], ifMatch: string) => Promise<SkillUploadResponseDto>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Localized messages `useSkillEditorSubmit` needs. */
|
|
163
|
+
export declare interface SkillEditorSubmitMessages {
|
|
164
|
+
/** Shown when a required field is empty. */
|
|
165
|
+
required: string;
|
|
166
|
+
/** Shown when the normalized skill name fails DIAL's naming rules. */
|
|
167
|
+
nameInvalid: string;
|
|
168
|
+
/** Shown when the skill name already exists (409), or defensively on an unreachable create-mode 412. */
|
|
169
|
+
nameConflict: string;
|
|
170
|
+
/** Shown when the submitted package exceeds the server's size limit (413). */
|
|
171
|
+
archiveTooLarge: string;
|
|
172
|
+
/** Shown when the backend is temporarily unavailable (503). */
|
|
173
|
+
serviceUnavailable: string;
|
|
174
|
+
/** Fallback shown for a 400 whose response body carries no message. */
|
|
175
|
+
pathInvalid: string;
|
|
176
|
+
/** Generic fallback shown for any other error status. */
|
|
177
|
+
saveError: string;
|
|
178
|
+
/** Notification title on a successful create. */
|
|
179
|
+
saveSuccessTitle: string;
|
|
180
|
+
/** Notification message on a successful create, given the created name. */
|
|
181
|
+
createSuccess: (name: string) => string;
|
|
182
|
+
/** Notification title on a successful update. */
|
|
183
|
+
updateSuccessTitle: string;
|
|
184
|
+
/** Notification message on a successful update, given the skill's name. */
|
|
185
|
+
updateSuccess: (name: string) => string;
|
|
186
|
+
/** Shown when a save hits a stale-ETag conflict (412) in edit mode. */
|
|
187
|
+
conflictMessage: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** A host notification `useSkillEditorSubmit` asks to be shown. */
|
|
191
|
+
export declare interface SkillEditorSubmitNotification {
|
|
192
|
+
/** Notification style. */
|
|
193
|
+
variant: NotificationVariant;
|
|
194
|
+
/** Optional heading. */
|
|
195
|
+
title?: string;
|
|
196
|
+
/** Body text. */
|
|
197
|
+
message: string;
|
|
198
|
+
/** W3C trace ID, when the triggering error carried one. */
|
|
199
|
+
requestId?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Localized messages `useSkillFileActions` needs beyond per-candidate batch validation. */
|
|
203
|
+
export declare interface SkillFileActionsMessages extends SkillFileBatchValidationMessages {
|
|
204
|
+
/** Returned as the commit error when an imported manifest's `name` doesn't match the skill being edited. */
|
|
205
|
+
manifestNameMismatch: string;
|
|
206
|
+
/** Returned as the commit error when the user declines the manifest-import confirmation. */
|
|
207
|
+
manifestImportDeclined: string;
|
|
208
|
+
/** Generic fallback commit error for a batch with invalid candidates but no specific batch error. */
|
|
209
|
+
saveError: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Snapshot of editor state the batch validator projects new totals against. */
|
|
213
|
+
export declare interface SkillFileBatchValidationContext {
|
|
214
|
+
/** Paths already present in the editor's supporting-file tree. */
|
|
215
|
+
existingPaths: string[];
|
|
216
|
+
/** Sum of the bytes already held for existing supporting files. */
|
|
217
|
+
existingTotalBytes: number;
|
|
218
|
+
/** UTF-8 byte length of the currently generated/loaded root `SKILL.md`. */
|
|
219
|
+
manifestByteLength: number;
|
|
220
|
+
/** Localized messages. */
|
|
221
|
+
messages: SkillFileBatchValidationMessages;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Localized messages the batch validator needs, resolved by the caller. */
|
|
225
|
+
export declare interface SkillFileBatchValidationMessages {
|
|
226
|
+
/** Shown when a required field (e.g. a candidate's path) is empty. */
|
|
227
|
+
required: string;
|
|
228
|
+
/** Shown when a candidate's path collides with a reserved entry name. */
|
|
229
|
+
pathReserved: string;
|
|
230
|
+
/** Shown when a candidate's path fails DIAL's relative-path rules. */
|
|
231
|
+
pathInvalid: string;
|
|
232
|
+
/** Shown when a candidate's path duplicates another candidate or an existing file. */
|
|
233
|
+
pathDuplicate: string;
|
|
234
|
+
/** Shown when a candidate exceeds the per-file size limit; receives the formatted limit. */
|
|
235
|
+
fileTooLarge: (maxSize: string) => string;
|
|
236
|
+
/** Shown when a root-level `SKILL.md`-like path has the wrong casing. */
|
|
237
|
+
manifestCasingInvalid: string;
|
|
238
|
+
/** Shown when the batch stages more than one root `SKILL.md`. */
|
|
239
|
+
manifestDuplicate: string;
|
|
240
|
+
/** Shown when a root `SKILL.md`'s bytes are not valid UTF-8. */
|
|
241
|
+
manifestInvalidUtf8: string;
|
|
242
|
+
/** Shown when a root `SKILL.md`'s frontmatter is missing or missing `name`/`description`. */
|
|
243
|
+
manifestInvalidFrontmatter: string;
|
|
244
|
+
/** Shown when the batch's projected total package size exceeds the limit. */
|
|
245
|
+
totalSizeExceeded: string;
|
|
246
|
+
/** Shown when the batch's projected total file count exceeds the limit. */
|
|
247
|
+
totalCountExceeded: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** Result of validating a whole staged batch. */
|
|
251
|
+
export declare interface SkillFileBatchValidationOutcome {
|
|
252
|
+
/** One result per candidate, in the same order as the input. */
|
|
253
|
+
results: SkillFileValidationResult[];
|
|
254
|
+
/** Batch-level errors (projected total size/count, multiple manifests). */
|
|
255
|
+
batchErrors: SkillFileBatchError[];
|
|
256
|
+
/** The single accepted manifest import, when the batch has exactly one valid `SKILL.md`. */
|
|
257
|
+
manifestCandidate?: SkillManifestImportCandidate;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Wraps raw bytes in a `Blob`, copying them so the source buffer can be reused. */
|
|
261
|
+
export declare const skillFileBytesToBlob: (bytes: Uint8Array) => Blob;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* In-memory bytes for a Skill supporting file, plus its MIME type when known
|
|
265
|
+
* (e.g. from a browser upload's `File.type`).
|
|
266
|
+
*/
|
|
267
|
+
export declare interface SkillFileContent {
|
|
268
|
+
/** The file's raw bytes. */
|
|
269
|
+
bytes: Uint8Array;
|
|
270
|
+
/**
|
|
271
|
+
* MIME type from the original browser `File.type`. Omit for edit-mode ZIP
|
|
272
|
+
* entries, which carry no MIME metadata — the type is then inferred from
|
|
273
|
+
* the file's path.
|
|
274
|
+
*/
|
|
275
|
+
mimeType?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** The ordered supporting-file paths and `Blob` payload `createSkill`/`updateSkill` expect. */
|
|
279
|
+
export declare interface SkillFilesPayload {
|
|
280
|
+
/** Relative paths, positionally paired with `files`. */
|
|
281
|
+
filePaths: string[];
|
|
282
|
+
/** File contents, positionally paired with `filePaths`. */
|
|
283
|
+
files: Blob[];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Converts a Skill supporting file's in-memory bytes into the `Attachment`
|
|
288
|
+
* shape the chat attachment-canvas pipeline expects, so it can be previewed
|
|
289
|
+
* with `useOpenAttachmentCanvas` exactly like a chat attachment. The id is
|
|
290
|
+
* the file's full relative path (not its basename), so two files with the
|
|
291
|
+
* same name in different folders never collide.
|
|
292
|
+
*/
|
|
293
|
+
export declare const skillFileToAttachment: (node: SkillFileTreeNode, content: SkillFileContent) => Attachment;
|
|
294
|
+
|
|
295
|
+
/** A `SKILL.md` split into its frontmatter fields and its prose body. */
|
|
296
|
+
export declare interface SkillManifestDocument {
|
|
297
|
+
/** `name` frontmatter field, when present and a string. */
|
|
298
|
+
name?: string;
|
|
299
|
+
/** `description` frontmatter field, when present and a string. */
|
|
300
|
+
description?: string;
|
|
301
|
+
/** Recognised `about.*` frontmatter fields. Absent when none resolved. */
|
|
302
|
+
about?: SkillAboutDetails;
|
|
303
|
+
/** Everything after the frontmatter fence, or the whole file when there is none. */
|
|
304
|
+
body: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** A recognized, structurally valid manifest candidate from a staged batch. */
|
|
308
|
+
export declare interface SkillManifestImportCandidate {
|
|
309
|
+
/** The `SkillFileUploadCandidate.id` this manifest came from. */
|
|
310
|
+
candidateId: string;
|
|
311
|
+
/** The imported manifest's `name` field. */
|
|
312
|
+
name: string;
|
|
313
|
+
/** The imported manifest's `description` field. */
|
|
314
|
+
description: string;
|
|
315
|
+
/** The imported manifest's full parsed frontmatter, including unknown fields. */
|
|
316
|
+
frontmatter: Record<string, unknown>;
|
|
317
|
+
/** The imported manifest's instructions body. */
|
|
318
|
+
instructions: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Skill fields serialized into the `SKILL.md` manifest. */
|
|
322
|
+
export declare interface SkillManifestValues {
|
|
323
|
+
/** Normalized skill name. */
|
|
324
|
+
name: string;
|
|
325
|
+
/** Short description of what the skill does. */
|
|
326
|
+
description: string;
|
|
327
|
+
/** The skill's instructions body (Markdown). */
|
|
328
|
+
instructions: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare type SubmitPhase = 'idle' | 'submitting' | 'success' | 'failure';
|
|
332
|
+
|
|
333
|
+
/** A skill archive unpacked into its manifest text and a relative-path → bytes map of every other entry. */
|
|
334
|
+
export declare interface UnpackedSkillArchive {
|
|
335
|
+
/** The root `SKILL.md` entry's decoded text content. */
|
|
336
|
+
manifestText: string;
|
|
337
|
+
/** Every non-manifest entry, keyed by relative path. */
|
|
338
|
+
files: Map<string, Uint8Array>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Unpacks a whole-skill ZIP (as downloaded from `GET /api/v1/skills/download`
|
|
343
|
+
* — DIAL Core's whole-resource `GET` is the one place this contract still
|
|
344
|
+
* uses a ZIP, per design.md) into its manifest text and every other entry's
|
|
345
|
+
* bytes. Throws if the archive has no root `SKILL.md` entry.
|
|
346
|
+
*/
|
|
347
|
+
export declare const unpackSkillArchive: (bytes: Uint8Array) => UnpackedSkillArchive;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Owns the edit-mode skill download/unpack/parse flow: the in-memory
|
|
351
|
+
* supporting-file map, the loaded manifest values and frontmatter, the
|
|
352
|
+
* concurrency ETag, and the load-state machine driving the form's
|
|
353
|
+
* loading/error/forbidden/not-found presentation. Create mode never leaves
|
|
354
|
+
* `'loaded'` and starts with empty state.
|
|
355
|
+
*/
|
|
356
|
+
export declare const useSkillEditorLoad: ({ isEditMode, bucket, skillPath, client, }: UseSkillEditorLoadParams) => UseSkillEditorLoadResult;
|
|
357
|
+
|
|
358
|
+
/** Parameters accepted by {@link useSkillEditorLoad}. */
|
|
359
|
+
export declare interface UseSkillEditorLoadParams {
|
|
360
|
+
/** Whether the form is editing an existing skill rather than creating a new one. */
|
|
361
|
+
isEditMode: boolean;
|
|
362
|
+
/** DIAL Core bucket holding the skill. Load is skipped until this resolves. */
|
|
363
|
+
bucket: string | undefined;
|
|
364
|
+
/** Path to the skill within `bucket`. */
|
|
365
|
+
skillPath: string | null | undefined;
|
|
366
|
+
/** Already-configured download operations. */
|
|
367
|
+
client: SkillEditorLoadClient;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** Return value of {@link useSkillEditorLoad}. */
|
|
371
|
+
export declare interface UseSkillEditorLoadResult {
|
|
372
|
+
/** Current load-state machine value driving the form's presentation. */
|
|
373
|
+
loadState: SkillEditorLoadState;
|
|
374
|
+
/** The loaded (or, in create mode, seeded) manifest values. */
|
|
375
|
+
loadedValues: SkillEditorValues | undefined;
|
|
376
|
+
/** Updates `loadedValues`, e.g. after a manifest import. */
|
|
377
|
+
setLoadedValues: Dispatch<SetStateAction<SkillEditorValues | undefined>>;
|
|
378
|
+
/** The loaded supporting-file tree. */
|
|
379
|
+
files: SkillFileTreeNode[];
|
|
380
|
+
/** Updates `files`, e.g. after a batch commit or node removal. */
|
|
381
|
+
setFiles: Dispatch<SetStateAction<SkillFileTreeNode[]>>;
|
|
382
|
+
/** In-memory bytes for every supporting file, keyed by relative path. */
|
|
383
|
+
filesContentRef: React.MutableRefObject<Map<string, SkillFileContent>>;
|
|
384
|
+
/** The loaded manifest's full parsed frontmatter, including fields the form never renders. */
|
|
385
|
+
frontmatterRef: React.MutableRefObject<Record<string, unknown>>;
|
|
386
|
+
/** The concurrency ETag from the load, sent back as `If-Match` on save. */
|
|
387
|
+
etagRef: React.MutableRefObject<string | undefined>;
|
|
388
|
+
/** The skill path the currently loaded state belongs to. */
|
|
389
|
+
loadedPathRef: React.MutableRefObject<string | undefined>;
|
|
390
|
+
/** Re-attempts the edit-mode download (load-error retry or post-conflict reload). */
|
|
391
|
+
retryLoad: () => void;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Owns the Skill Editor's create/edit submission flow: field validation,
|
|
396
|
+
* building and (in edit mode) merging the `SKILL.md` manifest, calling
|
|
397
|
+
* `client.createSkill`/`client.updateSkill`, and mapping the resulting
|
|
398
|
+
* success/error/conflict outcomes to presentable state.
|
|
399
|
+
*/
|
|
400
|
+
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
401
|
+
|
|
402
|
+
/** Parameters accepted by {@link useSkillEditorSubmit}. */
|
|
403
|
+
export declare interface UseSkillEditorSubmitParams {
|
|
404
|
+
/** DIAL Core bucket the skill is saved to. */
|
|
405
|
+
bucket: string | undefined;
|
|
406
|
+
/** Whether the form is editing an existing skill rather than creating a new one. */
|
|
407
|
+
isEditMode: boolean;
|
|
408
|
+
/** The editor's current supporting-file tree. */
|
|
409
|
+
files: SkillFileTreeNode[];
|
|
410
|
+
/** In-memory bytes for every supporting file, keyed by relative path. */
|
|
411
|
+
filesContentRef: React.MutableRefObject<Map<string, SkillFileContent>>;
|
|
412
|
+
/** The loaded (or imported) manifest's full parsed frontmatter. */
|
|
413
|
+
frontmatterRef: React.MutableRefObject<Record<string, unknown>>;
|
|
414
|
+
/** The path the currently loaded edit-mode state belongs to. */
|
|
415
|
+
loadedPathRef: React.MutableRefObject<string | undefined>;
|
|
416
|
+
/** The concurrency ETag from the load, sent back as `If-Match` on save. */
|
|
417
|
+
etagRef: React.MutableRefObject<string | undefined>;
|
|
418
|
+
/** Where to navigate on a successful save. */
|
|
419
|
+
returnUrl: string;
|
|
420
|
+
/** Refetches the host's skill listing after a successful save. */
|
|
421
|
+
refetchSkills: () => Promise<void>;
|
|
422
|
+
/** Already-configured create/update operations. */
|
|
423
|
+
client: SkillEditorSubmitClient;
|
|
424
|
+
/** Localized messages, resolved by the host. */
|
|
425
|
+
messages: SkillEditorSubmitMessages;
|
|
426
|
+
/** Called with `returnUrl` after a successful save. */
|
|
427
|
+
onNavigate: (url: string) => void;
|
|
428
|
+
/** Called to surface a host notification (success toast or unexpected-error toast). */
|
|
429
|
+
onNotify: (notification: SkillEditorSubmitNotification) => void;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Return value of {@link useSkillEditorSubmit}. */
|
|
433
|
+
export declare interface UseSkillEditorSubmitResult {
|
|
434
|
+
/** Current submit-phase. */
|
|
435
|
+
phase: SubmitPhase;
|
|
436
|
+
/** Inline field validation errors. */
|
|
437
|
+
errors: SkillEditorErrors;
|
|
438
|
+
/** General submit-time error, distinct from a stale-edit `conflict`. */
|
|
439
|
+
submitError: string | undefined;
|
|
440
|
+
/** Present when the last save hit a stale-ETag conflict. */
|
|
441
|
+
conflict: {
|
|
442
|
+
message: string;
|
|
443
|
+
} | undefined;
|
|
444
|
+
/** Clears `conflict`, e.g. once the host has reloaded the latest skill. */
|
|
445
|
+
clearConflict: () => void;
|
|
446
|
+
/** Validates and submits the given form values. */
|
|
447
|
+
handleSubmit: (values: SkillEditorValues) => Promise<void>;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Owns the Skill Editor's batch file upload workflow: validating a staged
|
|
452
|
+
* batch, committing it atomically (supporting files plus an optional
|
|
453
|
+
* `SKILL.md` manifest import, with a confirmation gate), and removing
|
|
454
|
+
* already-committed nodes.
|
|
455
|
+
*/
|
|
456
|
+
export declare const useSkillFileActions: ({ files, setFiles, filesContentRef, frontmatterRef, loadedValues, setLoadedValues, isEditMode, isDirty, setSelectedPath, messages, }: UseSkillFileActionsParams) => UseSkillFileActionsResult;
|
|
457
|
+
|
|
458
|
+
/** Parameters accepted by {@link useSkillFileActions}. */
|
|
459
|
+
export declare interface UseSkillFileActionsParams {
|
|
460
|
+
/** The editor's current supporting-file tree. */
|
|
461
|
+
files: SkillFileTreeNode[];
|
|
462
|
+
/** Updates `files`. */
|
|
463
|
+
setFiles: Dispatch<SetStateAction<SkillFileTreeNode[]>>;
|
|
464
|
+
/** In-memory bytes for every supporting file, keyed by relative path. */
|
|
465
|
+
filesContentRef: React.MutableRefObject<Map<string, SkillFileContent>>;
|
|
466
|
+
/** The loaded (or imported) manifest's full parsed frontmatter. */
|
|
467
|
+
frontmatterRef: React.MutableRefObject<Record<string, unknown>>;
|
|
468
|
+
/** The seeded baseline manifest values, used to approximate the projected total size. */
|
|
469
|
+
loadedValues: SkillEditorValues | undefined;
|
|
470
|
+
/** Updates `loadedValues` after a manifest import. */
|
|
471
|
+
setLoadedValues: Dispatch<SetStateAction<SkillEditorValues | undefined>>;
|
|
472
|
+
/** Whether the form is editing an existing skill rather than creating a new one. */
|
|
473
|
+
isEditMode: boolean;
|
|
474
|
+
/** Whether the form currently diverges from its seeded baseline. */
|
|
475
|
+
isDirty: boolean;
|
|
476
|
+
/** Updates the currently selected file-tree node path. */
|
|
477
|
+
setSelectedPath: Dispatch<SetStateAction<string>>;
|
|
478
|
+
/** Localized messages, resolved by the host. */
|
|
479
|
+
messages: SkillFileActionsMessages;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** Return value of {@link useSkillFileActions}. */
|
|
483
|
+
export declare interface UseSkillFileActionsResult {
|
|
484
|
+
/** File-tree mutation operations, passed straight to `SkillEditor`'s `fileActions` prop. */
|
|
485
|
+
fileActions: SkillEditorFileActions;
|
|
486
|
+
/** Whether the "replace Skill metadata?" confirmation prompt should be shown. */
|
|
487
|
+
pendingManifestImport: boolean;
|
|
488
|
+
/** Resolves the in-flight manifest-import confirmation with the user's choice. */
|
|
489
|
+
resolveManifestImport: (accepted: boolean) => void;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Validates a whole staged upload batch against per-file limits, path
|
|
494
|
+
* safety, in-batch/against-existing duplicates, and projected total
|
|
495
|
+
* size/count — mirroring the BFF's authoritative `SkillsPackageService`
|
|
496
|
+
* limits for immediate feedback (the server remains the final gate). Reads
|
|
497
|
+
* each candidate's bytes only where required (the root `SKILL.md` manifest,
|
|
498
|
+
* to decode and parse its frontmatter) — never for an ordinary supporting
|
|
499
|
+
* file, whose size is checked via `File.size` alone.
|
|
500
|
+
*/
|
|
501
|
+
export declare const validateSkillFileBatch: (candidates: SkillFileUploadCandidate[], context: SkillFileBatchValidationContext) => Promise<SkillFileBatchValidationOutcome>;
|
|
502
|
+
|
|
503
|
+
export { }
|
package/skill-editor.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m } from "./skill-manifest-CCX8s4nn.js";
|
|
2
|
+
import { a as h, i as g, n as _, o as v, r as y, t as b } from "./useSkillFileActions-BU5PzZ_8.js";
|
|
3
|
+
export { c as SKILL_FILE_UPLOAD_MAX_BYTES, d as SKILL_MANIFEST_FILE, a as SKILL_UPLOAD_MAX_FILES, e as SKILL_UPLOAD_MAX_TOTAL_BYTES, y as SkillEditorLoadState, l as buildSkillFilesPayload, f as buildSkillManifest, t as buildSkillManifestForSubmit, o as buildSkillManifestFromFrontmatter, m as isValidSkillRelativePath, n as nameFromPath, r as normalizeSkillName, u as parseSkillManifest, p as parseSkillManifestDocument, s as skillFileBytesToBlob, h as skillFileToAttachment, i as unpackSkillArchive, g as useSkillEditorLoad, _ as useSkillEditorSubmit, b as useSkillFileActions, v as validateSkillFileBatch };
|