@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,1005 @@
|
|
|
1
|
+
import { i as e, n as t, r as n } from "./string-utils-iBi2Y55C.js";
|
|
2
|
+
import { r } from "./toolset-id-CkxRHyU0.js";
|
|
3
|
+
import { n as i, s as a, t as o } from "./prompt-resource-Bt1I-8ri.js";
|
|
4
|
+
import { t as s } from "./formatting-CZyyxBG3.js";
|
|
5
|
+
import { r as c, t as l } from "./skill-manifest-CCX8s4nn.js";
|
|
6
|
+
import { CatalogEntityType as u, extractPromptParams as d, formatCost as f, formatLastUsed as p, formatUnitPrice as m } from "@epam/ai-dial-chat-shared";
|
|
7
|
+
import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
8
|
+
import { mimeTypesToExtensionLabels as b } from "@epam/ai-dial-attachment-input";
|
|
9
|
+
import { CatalogContentNodeType as x, CatalogLimitStatus as S, CodeLanguage as C, CredentialStatus as w, ToolsetAuthenticationType as T } from "@epam/ai-dial-catalog";
|
|
10
|
+
import { ListFilesItemDtoNodeTypeEnum as ee, SkillMetadataItemDtoNodeTypeEnum as E } from "@epam/ai-dial-chat-api-client";
|
|
11
|
+
import { fromFolderPathKey as D, mergeFolderPaths as te, toFolderPathKey as ne } from "@epam/ai-dial-publish-panel";
|
|
12
|
+
//#region src/catalog/create-publish-api.ts
|
|
13
|
+
var re = (e) => ({
|
|
14
|
+
source: e.source,
|
|
15
|
+
targets: e.targets,
|
|
16
|
+
function: e.function
|
|
17
|
+
}), ie = (e) => ({
|
|
18
|
+
publishCatalogEntity: (t, n, r) => e.publishCatalogEntity({
|
|
19
|
+
entityType: t,
|
|
20
|
+
entityId: n,
|
|
21
|
+
publishCatalogEntityDto: r
|
|
22
|
+
}),
|
|
23
|
+
unpublishCatalogEntity: (t, n, r) => e.unpublishCatalogEntity({
|
|
24
|
+
entityType: t,
|
|
25
|
+
entityId: n,
|
|
26
|
+
unpublishCatalogEntityDto: r
|
|
27
|
+
}),
|
|
28
|
+
getCatalogPublishHistory: (t, n) => e.getCatalogPublishHistory({
|
|
29
|
+
entityType: t,
|
|
30
|
+
entityId: n
|
|
31
|
+
}),
|
|
32
|
+
getPublishRules: async (t) => (await e.getPublishRules({ folderPath: t })).rules.map(({ function: e, ...t }) => ({
|
|
33
|
+
...t,
|
|
34
|
+
function: e
|
|
35
|
+
}))
|
|
36
|
+
}), ae = (e) => e.endsWith("/") ? e.slice(0, -1) : e, oe = (e) => e.split("/").map((e) => encodeURIComponent(n(e))).join("/"), se = (e) => e.split("/").map(n).join("/"), ce = (e, t) => `${ae(e)}/openai/deployments/${oe(t)}/chat/completions`, O = (e) => `${ae(e)}/openai/v1/responses`, k = (e, t, { hasChatCompletion: n, hasResponsesApi: r }) => {
|
|
37
|
+
let i = [];
|
|
38
|
+
if (n) {
|
|
39
|
+
let n = ce(e, t);
|
|
40
|
+
i.push({
|
|
41
|
+
label: "Chat Completions",
|
|
42
|
+
url: n,
|
|
43
|
+
snippets: [{
|
|
44
|
+
language: C.Curl,
|
|
45
|
+
code: `curl -X POST '${n}?api-version=<api-version>' \\\n -H 'Content-Type: application/json' \\\n -H 'Api-Key: <key>' \\\n -d '{"messages":[{"role":"user","content":"Hello"}]}'`
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (r) {
|
|
50
|
+
let n = O(e);
|
|
51
|
+
i.push({
|
|
52
|
+
label: "Responses",
|
|
53
|
+
url: n,
|
|
54
|
+
snippets: [{
|
|
55
|
+
language: C.Curl,
|
|
56
|
+
code: `curl -X POST '${n}' \\\n -H 'Content-Type: application/json' \\\n -H 'Api-Key: <key>' \\\n -d '{"model":"${t}","input":"Hello"}'`
|
|
57
|
+
}]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (i.length !== 0) return {
|
|
61
|
+
resource: { modelId: se(t) },
|
|
62
|
+
endpoints: i
|
|
63
|
+
};
|
|
64
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
65
|
+
return e.None = "NONE", e.ApiKey = "API_KEY", e.OAuth = "OAUTH", e;
|
|
66
|
+
}({}), le = [
|
|
67
|
+
{
|
|
68
|
+
key: "dayTokenStats",
|
|
69
|
+
labelField: "tokensPerDay",
|
|
70
|
+
costKey: "dayCostStats"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "weekTokenStats",
|
|
74
|
+
labelField: "tokensPerWeek",
|
|
75
|
+
costKey: "weekCostStats"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "monthTokenStats",
|
|
79
|
+
labelField: "tokensPerMonth",
|
|
80
|
+
costKey: "monthCostStats"
|
|
81
|
+
}
|
|
82
|
+
], ue = 2 ** 53 - 1, de = .75, fe = [1e6, 1e3], j = new Intl.NumberFormat(void 0, {
|
|
83
|
+
notation: "compact",
|
|
84
|
+
maximumFractionDigits: 1
|
|
85
|
+
}), M = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), pe = (e) => {
|
|
86
|
+
let t = fe.find((t) => Math.abs(e) >= t);
|
|
87
|
+
return t == null ? e : Math.trunc(e / t * 10) / 10 * t;
|
|
88
|
+
}, me = (e) => e != null && Number.isFinite(e.total) && Number.isFinite(e.used) && e.total > 0, N = (e) => e >= ue, he = (e) => e != null && Number.isFinite(e.total) && Number.isFinite(e.used), ge = (e, t) => {
|
|
89
|
+
if (he(e)) return t.formatSpentCaption(f(Math.max(0, e.used)));
|
|
90
|
+
}, _e = (e, t, n, r) => {
|
|
91
|
+
let i = Math.max(0, e.used), a = e.total, o = j.format(pe(i)), s = j.format(a), c = M.format(i), l = M.format(a), u = N(a);
|
|
92
|
+
return {
|
|
93
|
+
label: t,
|
|
94
|
+
used: i,
|
|
95
|
+
total: a,
|
|
96
|
+
captionLabel: n,
|
|
97
|
+
...u ? {
|
|
98
|
+
isUnlimited: !0,
|
|
99
|
+
noteLabel: r.followsCostLimit
|
|
100
|
+
} : {
|
|
101
|
+
usedLabel: o,
|
|
102
|
+
totalLabel: s
|
|
103
|
+
},
|
|
104
|
+
valueLabel: u ? o : r.formatValueLabel(o, s),
|
|
105
|
+
ariaLabel: u ? r.formatFollowsCostLimitAriaLabel({
|
|
106
|
+
label: t,
|
|
107
|
+
used: c
|
|
108
|
+
}) : r.formatProgressAriaLabel({
|
|
109
|
+
label: t,
|
|
110
|
+
used: c,
|
|
111
|
+
total: l
|
|
112
|
+
})
|
|
113
|
+
};
|
|
114
|
+
}, ve = (e) => N(e.total) ? 0 : Math.max(e.used, 0) / e.total, ye = (e) => e.reduce((e, t) => {
|
|
115
|
+
let n = ve(t);
|
|
116
|
+
return n >= 1 ? S.LimitReached : n >= de && e !== S.LimitReached ? S.RunningLow : e;
|
|
117
|
+
}, void 0), P = (e, t) => {
|
|
118
|
+
if (e == null) return;
|
|
119
|
+
let n = [], r = le.flatMap((r) => {
|
|
120
|
+
let i = e[r.key];
|
|
121
|
+
if (!me(i)) return [];
|
|
122
|
+
n.push(i);
|
|
123
|
+
let a = ge(e[r.costKey], t);
|
|
124
|
+
return [_e(i, t[r.labelField], a, t)];
|
|
125
|
+
});
|
|
126
|
+
return r.length > 0 ? {
|
|
127
|
+
groups: [{
|
|
128
|
+
label: t.tokenGroup,
|
|
129
|
+
rows: r
|
|
130
|
+
}],
|
|
131
|
+
status: ye(n)
|
|
132
|
+
} : void 0;
|
|
133
|
+
}, be = (e) => {
|
|
134
|
+
let t = e?.monthTokenStats;
|
|
135
|
+
if (t == null || !Number.isFinite(t.total) || !Number.isFinite(t.used) || t.total <= 0 || t.total >= 2 ** 53 - 1) return;
|
|
136
|
+
let n = Math.max(0, t.used);
|
|
137
|
+
return {
|
|
138
|
+
used: n,
|
|
139
|
+
total: t.total,
|
|
140
|
+
remaining: Math.max(0, t.total - n),
|
|
141
|
+
usedPercent: Math.min(100, Math.round(n / t.total * 100))
|
|
142
|
+
};
|
|
143
|
+
}, F = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens` : `${e} tokens`, I = (e) => {
|
|
144
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
145
|
+
if (t == null) return e;
|
|
146
|
+
let [, n, r, i] = t, a = Number(n), o = Number(r) - 1, c = Number(i), l = new Date(a, o, c);
|
|
147
|
+
return l.getFullYear() !== a || l.getMonth() !== o || l.getDate() !== c ? e : s(l.getTime());
|
|
148
|
+
}, xe = "unit", Se = (e) => {
|
|
149
|
+
let t = [];
|
|
150
|
+
if (e.capabilities != null) {
|
|
151
|
+
let { capabilities: n } = e, r = [];
|
|
152
|
+
n.hasTools != null && r.push({
|
|
153
|
+
label: "Tools",
|
|
154
|
+
value: n.hasTools
|
|
155
|
+
}), n.hasParallelToolCalls != null && r.push({
|
|
156
|
+
label: "Parallel tool calls",
|
|
157
|
+
value: n.hasParallelToolCalls
|
|
158
|
+
}), n.reasoningEfforts?.length && r.push({
|
|
159
|
+
label: "Reasoning efforts",
|
|
160
|
+
value: n.reasoningEfforts.join(" · ")
|
|
161
|
+
}), r.length > 0 && t.push({
|
|
162
|
+
title: "Capabilities",
|
|
163
|
+
specs: r
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (e.specification != null) {
|
|
167
|
+
let { specification: n } = e, r = [];
|
|
168
|
+
n.provider != null && r.push({
|
|
169
|
+
label: "Provider",
|
|
170
|
+
value: n.provider
|
|
171
|
+
}), n.vendor != null && r.push({
|
|
172
|
+
label: "Vendor",
|
|
173
|
+
value: n.vendor
|
|
174
|
+
}), n.license != null && r.push({
|
|
175
|
+
label: "License",
|
|
176
|
+
value: n.license
|
|
177
|
+
}), n.knowledgeCutoffDate != null && r.push({
|
|
178
|
+
label: "Knowledge cutoff date",
|
|
179
|
+
value: I(n.knowledgeCutoffDate)
|
|
180
|
+
}), n.parameters != null && r.push({
|
|
181
|
+
label: "Parameters",
|
|
182
|
+
value: n.parameters
|
|
183
|
+
}), n.hostedBy != null && r.push({
|
|
184
|
+
label: "Hosted by",
|
|
185
|
+
value: n.hostedBy
|
|
186
|
+
}), n.createdAt != null && r.push({
|
|
187
|
+
label: "Release date",
|
|
188
|
+
value: s(n.createdAt)
|
|
189
|
+
}), n.contextWindowTokens != null && r.push({
|
|
190
|
+
label: "Context window",
|
|
191
|
+
value: F(n.contextWindowTokens)
|
|
192
|
+
}), n.maxOutputTokens != null && r.push({
|
|
193
|
+
label: "Max output tokens",
|
|
194
|
+
value: F(n.maxOutputTokens)
|
|
195
|
+
}), n.inputTypes?.length && r.push({
|
|
196
|
+
label: "Input modalities",
|
|
197
|
+
value: b(n.inputTypes)
|
|
198
|
+
}), r.length > 0 && t.push({
|
|
199
|
+
title: "Specification",
|
|
200
|
+
specs: r
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
let n = Te(e.pricing), r = Ee(e);
|
|
204
|
+
return {
|
|
205
|
+
overview: t.length > 0 ? { sections: t } : void 0,
|
|
206
|
+
pricing: n,
|
|
207
|
+
api: r
|
|
208
|
+
};
|
|
209
|
+
}, Ce = {
|
|
210
|
+
prompt: "Input tokens",
|
|
211
|
+
completion: "Output tokens",
|
|
212
|
+
cache_read: "Cached input",
|
|
213
|
+
cacheRead: "Cached input",
|
|
214
|
+
cache_write: "Cached write",
|
|
215
|
+
cacheWrite: "Cached write"
|
|
216
|
+
}, L = [
|
|
217
|
+
"prompt",
|
|
218
|
+
"completion",
|
|
219
|
+
"cache_read",
|
|
220
|
+
"cacheRead",
|
|
221
|
+
"cache_write",
|
|
222
|
+
"cacheWrite"
|
|
223
|
+
], R = (e) => {
|
|
224
|
+
let t = L.indexOf(e);
|
|
225
|
+
return t === -1 ? L.length : t;
|
|
226
|
+
}, we = (e) => {
|
|
227
|
+
let t = Ce[e];
|
|
228
|
+
if (t != null) return t;
|
|
229
|
+
let n = e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
230
|
+
return n === "" ? e : ` ${n.charAt(0).toUpperCase()}${n.slice(1)}`;
|
|
231
|
+
}, Te = (e) => {
|
|
232
|
+
if (e == null) return;
|
|
233
|
+
let t = [...e.prices ?? []].sort((e, t) => R(e.key) - R(t.key)).map(({ key: e, price: t }) => ({
|
|
234
|
+
label: we(e),
|
|
235
|
+
price: t
|
|
236
|
+
}));
|
|
237
|
+
if (t.length !== 0) return { prices: t };
|
|
238
|
+
}, Ee = (e) => {
|
|
239
|
+
let { api: t } = e;
|
|
240
|
+
if (t?.modelId != null) return { resource: { modelId: t.modelId } };
|
|
241
|
+
}, De = (e) => {
|
|
242
|
+
let t = [];
|
|
243
|
+
if (e.specification != null) {
|
|
244
|
+
let { specification: n } = e, r = [];
|
|
245
|
+
n.provider != null && r.push({
|
|
246
|
+
label: "Provider",
|
|
247
|
+
value: n.provider
|
|
248
|
+
}), n.vendor != null && r.push({
|
|
249
|
+
label: "Vendor",
|
|
250
|
+
value: n.vendor
|
|
251
|
+
}), n.license != null && r.push({
|
|
252
|
+
label: "License",
|
|
253
|
+
value: n.license
|
|
254
|
+
}), n.knowledgeCutoffDate != null && r.push({
|
|
255
|
+
label: "Knowledge cutoff date",
|
|
256
|
+
value: I(n.knowledgeCutoffDate)
|
|
257
|
+
}), n.parameters != null && r.push({
|
|
258
|
+
label: "Parameters",
|
|
259
|
+
value: n.parameters
|
|
260
|
+
}), n.hostedBy != null && r.push({
|
|
261
|
+
label: "Hosted by",
|
|
262
|
+
value: n.hostedBy
|
|
263
|
+
}), n.createdAt != null && r.push({
|
|
264
|
+
label: "Release date",
|
|
265
|
+
value: s(n.createdAt)
|
|
266
|
+
}), n.routes?.length && r.push({
|
|
267
|
+
label: "Routes",
|
|
268
|
+
value: n.routes.join(" · ")
|
|
269
|
+
}), r.length > 0 && t.push({
|
|
270
|
+
title: "Specification",
|
|
271
|
+
specs: r
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
if (e.capabilities != null) {
|
|
275
|
+
let { capabilities: n } = e, r = [];
|
|
276
|
+
n.hasTools != null && r.push({
|
|
277
|
+
label: "Tools",
|
|
278
|
+
value: n.hasTools
|
|
279
|
+
}), n.hasParallelToolCalls != null && r.push({
|
|
280
|
+
label: "Parallel tool calls",
|
|
281
|
+
value: n.hasParallelToolCalls
|
|
282
|
+
}), n.hasConfiguration != null && r.push({
|
|
283
|
+
label: "Configuration schema",
|
|
284
|
+
value: n.hasConfiguration
|
|
285
|
+
}), r.length > 0 && t.push({
|
|
286
|
+
title: "Capabilities",
|
|
287
|
+
specs: r
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (e.configuration != null) {
|
|
291
|
+
let { configuration: n } = e, r = [];
|
|
292
|
+
n.inputAttachmentTypes?.length && r.push({
|
|
293
|
+
label: "Input attachments",
|
|
294
|
+
value: b(n.inputAttachmentTypes)
|
|
295
|
+
}), r.length > 0 && t.push({
|
|
296
|
+
title: "Configuration",
|
|
297
|
+
specs: r
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
return { overview: t.length > 0 ? { sections: t } : void 0 };
|
|
301
|
+
}, Oe = {
|
|
302
|
+
[A.None]: T.None,
|
|
303
|
+
[A.ApiKey]: T.ApiKey,
|
|
304
|
+
[A.OAuth]: T.OAuth
|
|
305
|
+
}, z = {
|
|
306
|
+
SIGNED_IN: w.SignedIn,
|
|
307
|
+
SIGNED_OUT: w.SignedOut,
|
|
308
|
+
FAILED: w.Failed
|
|
309
|
+
}, B = (e, t, n) => {
|
|
310
|
+
let i = Oe[t.specification?.authentication ?? A.None];
|
|
311
|
+
if (i == null) return;
|
|
312
|
+
let { userLevel: a, global: o } = t.specification?.authStatus ?? {}, s = r(e);
|
|
313
|
+
return {
|
|
314
|
+
authenticationType: i,
|
|
315
|
+
userStatus: a ? z[a] : void 0,
|
|
316
|
+
globalStatus: o ? z[o] : void 0,
|
|
317
|
+
isPublic: s,
|
|
318
|
+
isManageableByAdmin: n && s,
|
|
319
|
+
apiKeyHeader: t.specification?.authStatus?.apiKeyHeader
|
|
320
|
+
};
|
|
321
|
+
}, ke = (e) => {
|
|
322
|
+
let t = e?.permissions?.length ? e.permissions : e?.allTools;
|
|
323
|
+
if (t?.length) return { tools: t.map((e) => ({ name: e })) };
|
|
324
|
+
}, Ae = (e) => {
|
|
325
|
+
let t = [];
|
|
326
|
+
if (e.specification != null) {
|
|
327
|
+
let { specification: n } = e, r = [];
|
|
328
|
+
n.authentication != null && r.push({
|
|
329
|
+
label: "Authentication",
|
|
330
|
+
value: n.authentication
|
|
331
|
+
}), n.provider != null && r.push({
|
|
332
|
+
label: "Provider",
|
|
333
|
+
value: n.provider
|
|
334
|
+
}), n.vendor != null && r.push({
|
|
335
|
+
label: "Vendor",
|
|
336
|
+
value: n.vendor
|
|
337
|
+
}), n.license != null && r.push({
|
|
338
|
+
label: "License",
|
|
339
|
+
value: n.license
|
|
340
|
+
}), n.knowledgeCutoffDate != null && r.push({
|
|
341
|
+
label: "Knowledge cutoff date",
|
|
342
|
+
value: I(n.knowledgeCutoffDate)
|
|
343
|
+
}), n.parameters != null && r.push({
|
|
344
|
+
label: "Parameters",
|
|
345
|
+
value: n.parameters
|
|
346
|
+
}), n.hostedBy != null && r.push({
|
|
347
|
+
label: "Hosted by",
|
|
348
|
+
value: n.hostedBy
|
|
349
|
+
}), n.createdAt != null && r.push({
|
|
350
|
+
label: "Release date",
|
|
351
|
+
value: s(n.createdAt)
|
|
352
|
+
}), n.authStatus?.scopesSupported?.length && r.push({
|
|
353
|
+
label: "OAuth scopes",
|
|
354
|
+
value: n.authStatus.scopesSupported.join(" · ")
|
|
355
|
+
}), n.authStatus?.authorizationEndpoint != null && r.push({
|
|
356
|
+
label: "Authorization endpoint",
|
|
357
|
+
value: n.authStatus.authorizationEndpoint
|
|
358
|
+
}), n.authStatus?.tokenEndpoint != null && r.push({
|
|
359
|
+
label: "Token endpoint",
|
|
360
|
+
value: n.authStatus.tokenEndpoint
|
|
361
|
+
}), r.length > 0 && t.push({
|
|
362
|
+
title: "Specification",
|
|
363
|
+
specs: r
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
overview: t.length > 0 ? { sections: t } : void 0,
|
|
368
|
+
tools: ke(e.specification)
|
|
369
|
+
};
|
|
370
|
+
}, V = (e) => {
|
|
371
|
+
switch (e.type) {
|
|
372
|
+
case "MODEL": return Se(e.data);
|
|
373
|
+
case "AGENT": return De(e.data);
|
|
374
|
+
case "TOOLSET": return Ae(e.data);
|
|
375
|
+
}
|
|
376
|
+
}, H = (e) => {
|
|
377
|
+
if (e != null) return {
|
|
378
|
+
hasTools: e.tools,
|
|
379
|
+
hasMcp: e.mcp,
|
|
380
|
+
hasCaching: e.cache,
|
|
381
|
+
hasParallelToolCalls: e.parallelToolCalls,
|
|
382
|
+
hasUrlAttachments: e.urlAttachments,
|
|
383
|
+
hasFolderAttachments: e.folderAttachments,
|
|
384
|
+
hasSeed: e.seed,
|
|
385
|
+
hasSystemPrompt: e.systemPrompt,
|
|
386
|
+
hasResume: e.allowResume,
|
|
387
|
+
hasConfiguration: e.hasConfigurationSchema,
|
|
388
|
+
hasChatCompletion: e.chatCompletion,
|
|
389
|
+
hasResponsesApi: e.responsesApi,
|
|
390
|
+
reasoningEfforts: e.reasoningEfforts
|
|
391
|
+
};
|
|
392
|
+
}, je = (e) => {
|
|
393
|
+
if (e == null) return;
|
|
394
|
+
let { unit: t } = e, n = Object.entries(e).flatMap(([e, n]) => {
|
|
395
|
+
if (e === xe || typeof n != "string" || n.trim() === "") return [];
|
|
396
|
+
let r = m(n, t);
|
|
397
|
+
return r == null ? [] : [{
|
|
398
|
+
key: e,
|
|
399
|
+
price: r
|
|
400
|
+
}];
|
|
401
|
+
});
|
|
402
|
+
return n.length > 0 ? { prices: n } : void 0;
|
|
403
|
+
}, Me = (e) => {
|
|
404
|
+
let { limits: t, pricing: n, features: r, catalogProperties: i, owner: a, inputAttachmentTypes: o, defaultMaxTokens: s, createdAt: c } = e.modelDetails ?? {}, l = t != null || i != null || a != null || c != null || (o?.length ?? 0) > 0;
|
|
405
|
+
return {
|
|
406
|
+
type: "MODEL",
|
|
407
|
+
data: {
|
|
408
|
+
capabilities: H(r),
|
|
409
|
+
specification: l ? {
|
|
410
|
+
provider: i?.provider,
|
|
411
|
+
vendor: i?.vendor,
|
|
412
|
+
license: i?.license,
|
|
413
|
+
knowledgeCutoffDate: i?.knowledgeCutoffDate,
|
|
414
|
+
parameters: i?.parameters,
|
|
415
|
+
contextWindowTokens: t?.maxTotalTokens,
|
|
416
|
+
maxOutputTokens: t?.maxCompletionTokens ?? s,
|
|
417
|
+
inputTypes: o,
|
|
418
|
+
hostedBy: a,
|
|
419
|
+
createdAt: c
|
|
420
|
+
} : void 0,
|
|
421
|
+
pricing: je(n),
|
|
422
|
+
api: { modelId: e.id }
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}, Ne = (e) => {
|
|
426
|
+
let { routes: t, owner: n, inputAttachmentTypes: r, features: i, catalogProperties: a, createdAt: o } = e.applicationDetails ?? {}, s = a != null || n != null || o != null || (t?.length ?? 0) > 0;
|
|
427
|
+
return {
|
|
428
|
+
type: "AGENT",
|
|
429
|
+
data: {
|
|
430
|
+
capabilities: H(i),
|
|
431
|
+
specification: s ? {
|
|
432
|
+
provider: a?.provider,
|
|
433
|
+
vendor: a?.vendor,
|
|
434
|
+
license: a?.license,
|
|
435
|
+
knowledgeCutoffDate: a?.knowledgeCutoffDate,
|
|
436
|
+
parameters: a?.parameters,
|
|
437
|
+
hostedBy: n,
|
|
438
|
+
createdAt: o,
|
|
439
|
+
routes: t
|
|
440
|
+
} : void 0,
|
|
441
|
+
configuration: r?.length ? { inputAttachmentTypes: r } : void 0
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
}, Pe = (e) => e === A.None || e === A.ApiKey || e === A.OAuth, Fe = (e) => {
|
|
445
|
+
if (e == null) return;
|
|
446
|
+
let { globalAuthStatus: t, appLevelAuthStatus: n, userLevelAuthStatus: r, scopesSupported: i, authorizationEndpoint: a, tokenEndpoint: o, apiKeyHeader: s } = e;
|
|
447
|
+
if (!(t == null && n == null && r == null && a == null && o == null && s == null && !i?.length)) return {
|
|
448
|
+
global: t,
|
|
449
|
+
appLevel: n,
|
|
450
|
+
userLevel: r,
|
|
451
|
+
scopesSupported: i,
|
|
452
|
+
authorizationEndpoint: a,
|
|
453
|
+
tokenEndpoint: o,
|
|
454
|
+
apiKeyHeader: s
|
|
455
|
+
};
|
|
456
|
+
}, Ie = (e) => {
|
|
457
|
+
let t = e.toolsetDetails, n = t?.authSettings?.authenticationType;
|
|
458
|
+
return {
|
|
459
|
+
type: "TOOLSET",
|
|
460
|
+
data: {
|
|
461
|
+
capabilities: H(t?.features),
|
|
462
|
+
specification: t == null ? void 0 : {
|
|
463
|
+
authentication: Pe(n) ? n : void 0,
|
|
464
|
+
provider: t.catalogProperties?.provider,
|
|
465
|
+
vendor: t.catalogProperties?.vendor,
|
|
466
|
+
license: t.catalogProperties?.license,
|
|
467
|
+
knowledgeCutoffDate: t.catalogProperties?.knowledgeCutoffDate,
|
|
468
|
+
parameters: t.catalogProperties?.parameters,
|
|
469
|
+
permissions: t.allowedTools,
|
|
470
|
+
allTools: t.allToolNames,
|
|
471
|
+
hostedBy: t.owner,
|
|
472
|
+
createdAt: t.createdAt,
|
|
473
|
+
authStatus: Fe(t.authSettings)
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
}, U = (e) => {
|
|
478
|
+
switch (e.type) {
|
|
479
|
+
case "model": return Me(e);
|
|
480
|
+
case "application": return Ne(e);
|
|
481
|
+
case "toolset": return Ie(e);
|
|
482
|
+
}
|
|
483
|
+
}, Le = {
|
|
484
|
+
NONE: T.None,
|
|
485
|
+
API_KEY: T.ApiKey,
|
|
486
|
+
OAUTH: T.OAuth
|
|
487
|
+
}, W = {
|
|
488
|
+
SIGNED_IN: w.SignedIn,
|
|
489
|
+
SIGNED_OUT: w.SignedOut,
|
|
490
|
+
FAILED: w.Failed
|
|
491
|
+
}, Re = (e, t, n) => {
|
|
492
|
+
if (t == null) return;
|
|
493
|
+
let i = r(e), a = t.userLevelAuthStatus ? W[t.userLevelAuthStatus] : void 0, o = t.globalAuthStatus ? W[t.globalAuthStatus] : void 0;
|
|
494
|
+
return {
|
|
495
|
+
authenticationType: !n && i && a !== w.SignedIn && o === w.SignedIn ? T.None : Le[t.authenticationType],
|
|
496
|
+
userStatus: a,
|
|
497
|
+
globalStatus: o,
|
|
498
|
+
isPublic: i,
|
|
499
|
+
isManageableByAdmin: n && i,
|
|
500
|
+
apiKeyHeader: t.apiKeyHeader
|
|
501
|
+
};
|
|
502
|
+
}, ze = {
|
|
503
|
+
model: u.Model,
|
|
504
|
+
toolset: u.Toolset,
|
|
505
|
+
application: u.Agent
|
|
506
|
+
}, Be = "applications/", G = "toolsets/", K = "public", q = (e, t) => (e.startsWith(t) ? e.slice(t.length) : e).split("/").filter(Boolean).map(n), Ve = (e, t) => {
|
|
507
|
+
if (e.isMy) return [t.personal];
|
|
508
|
+
let n = q(e.applicationFolder ?? "", Be);
|
|
509
|
+
return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n[0]?.toLowerCase() === K ? [t.public, ...n.slice(1)] : n;
|
|
510
|
+
}, He = (e, t) => {
|
|
511
|
+
if (e.isMy && t != null) return [t.personal];
|
|
512
|
+
let n = e.toolset || e.id;
|
|
513
|
+
if (!n.startsWith(G)) return [];
|
|
514
|
+
let r = q(n, G).slice(0, -1);
|
|
515
|
+
return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() === K && t != null ? [t.public, ...r.slice(1)] : r.slice(1);
|
|
516
|
+
}, Ue = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: n, folderLabels: r, editableSchemaIds: i = [], isCustomAppsEditable: o = !1, activeLocale: s, primaryLocale: c, resolveIconUrl: l }) => {
|
|
517
|
+
let d = a(e.displayName, s, c) || e.id, f = (e.type ?? "").toLowerCase();
|
|
518
|
+
return {
|
|
519
|
+
id: e.id,
|
|
520
|
+
type: ze[f] ?? u.Model,
|
|
521
|
+
name: d,
|
|
522
|
+
description: a(e.description, s, c),
|
|
523
|
+
iconUrl: l(e.iconUrl),
|
|
524
|
+
version: e.displayVersion ?? "",
|
|
525
|
+
lastUsed: p(e.updatedAt),
|
|
526
|
+
updatedAt: e.updatedAt,
|
|
527
|
+
createdAt: e.createdAt,
|
|
528
|
+
isFeatured: e.isFeatured ?? !1,
|
|
529
|
+
isHidden: e.isHidden ?? !1,
|
|
530
|
+
topics: e.topics ?? [],
|
|
531
|
+
isUserFavorite: t.has(e.id),
|
|
532
|
+
isStarred: t.has(e.id),
|
|
533
|
+
isMyApp: e.isMy ?? !1,
|
|
534
|
+
sharedWithMe: e.sharedWithMe ?? !1,
|
|
535
|
+
isEditable: (!!e.isMy || !!e.canEdit) && (i.length > 0 && i.includes(e.applicationTypeSchemaId ?? "") || o && !e.applicationTypeSchemaId && f === "application"),
|
|
536
|
+
folder: Ve(e, r),
|
|
537
|
+
details: n == null ? void 0 : V(n),
|
|
538
|
+
supportsMcp: e.features?.mcp === !0,
|
|
539
|
+
supportsChat: e.interfaces == null || e.interfaces.includes("chat")
|
|
540
|
+
};
|
|
541
|
+
}, We = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), isAdmin: n = !1, folderLabels: r, activeLocale: i, primaryLocale: o, resolveIconUrl: s }) => {
|
|
542
|
+
let c = a(e.displayName, i, o) || e.toolset || e.reference || e.id, l = e.allowedTools ?? [];
|
|
543
|
+
return {
|
|
544
|
+
id: e.id,
|
|
545
|
+
type: u.Toolset,
|
|
546
|
+
name: c,
|
|
547
|
+
description: a(e.description, i, o),
|
|
548
|
+
iconUrl: s(e.iconUrl),
|
|
549
|
+
version: e.displayVersion ?? "",
|
|
550
|
+
lastUsed: p(e.updatedAt),
|
|
551
|
+
updatedAt: e.updatedAt,
|
|
552
|
+
createdAt: e.createdAt,
|
|
553
|
+
isFeatured: !1,
|
|
554
|
+
isHidden: !1,
|
|
555
|
+
topics: e.descriptionKeywords ?? [],
|
|
556
|
+
isUserFavorite: t.has(e.id),
|
|
557
|
+
isStarred: t.has(e.id),
|
|
558
|
+
isMyApp: e.isMy ?? !1,
|
|
559
|
+
sharedWithMe: e.sharedWithMe ?? !1,
|
|
560
|
+
isEditable: !!(e.isMy || e.canEdit),
|
|
561
|
+
folder: He(e, r),
|
|
562
|
+
credentials: Re(e.id, e.authSettings, n),
|
|
563
|
+
details: l.length > 0 ? { tools: { tools: l.map((e) => ({ name: e })) } } : void 0
|
|
564
|
+
};
|
|
565
|
+
}, Ge = {
|
|
566
|
+
[o.Personal]: "personal",
|
|
567
|
+
[o.SharedWithMe]: "shared",
|
|
568
|
+
[o.Public]: "public"
|
|
569
|
+
}, Ke = (e, t, r) => [r[Ge[t]], ...e.split("/").filter(Boolean).map(n)], J = (e, t) => {
|
|
570
|
+
let n = [];
|
|
571
|
+
return e.author && n.push({
|
|
572
|
+
label: t.authorLabel,
|
|
573
|
+
value: e.author
|
|
574
|
+
}), n.push({
|
|
575
|
+
label: t.updatedLabel,
|
|
576
|
+
value: s(e.updatedAt)
|
|
577
|
+
}), { sections: [{
|
|
578
|
+
title: t.sectionTitle,
|
|
579
|
+
specs: n
|
|
580
|
+
}] };
|
|
581
|
+
}, qe = (e) => !e.isMyApp && !e.sharedWithMe, Je = (e, { folderLabels: t, overviewLabels: n, source: r, favoriteIds: i }) => {
|
|
582
|
+
let a = r === o.Personal, s = e.id, c = i.has(s);
|
|
583
|
+
return {
|
|
584
|
+
id: s,
|
|
585
|
+
type: u.Prompt,
|
|
586
|
+
name: e.name,
|
|
587
|
+
description: e.description ?? "",
|
|
588
|
+
version: "",
|
|
589
|
+
lastUsed: p(e.updatedAt),
|
|
590
|
+
createdAt: e.createdAt,
|
|
591
|
+
updatedAt: e.updatedAt,
|
|
592
|
+
isFeatured: !1,
|
|
593
|
+
isHidden: !1,
|
|
594
|
+
topics: [],
|
|
595
|
+
isUserFavorite: c,
|
|
596
|
+
isStarred: c,
|
|
597
|
+
isMyApp: e.isMy ?? a,
|
|
598
|
+
sharedWithMe: e.sharedWithMe ?? r === o.SharedWithMe,
|
|
599
|
+
isEditable: r !== o.Public && (e.canEdit ?? a),
|
|
600
|
+
folder: Ke(e.folderId, r, t),
|
|
601
|
+
details: {
|
|
602
|
+
...e.content ? { promptContent: { content: e.content } } : void 0,
|
|
603
|
+
overview: J(e, n)
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
}, Y = /* @__PURE__ */ function(e) {
|
|
607
|
+
return e.Personal = "personal", e.SharedWithMe = "sharedWithMe", e.Public = "public", e;
|
|
608
|
+
}({}), Ye = "public", Xe = "skills/", Ze = 256 * 1024, Qe = 1e3, $e = 10, et = (e) => {
|
|
609
|
+
if (!e.startsWith(Xe)) return null;
|
|
610
|
+
let t = e.slice(7), n = t.indexOf("/");
|
|
611
|
+
if (n <= 0) return null;
|
|
612
|
+
let r = t.slice(0, n), i = t.slice(n + 1);
|
|
613
|
+
return r === "" || i === "" ? null : {
|
|
614
|
+
bucket: r,
|
|
615
|
+
path: i
|
|
616
|
+
};
|
|
617
|
+
}, tt = {
|
|
618
|
+
[Y.Personal]: "personal",
|
|
619
|
+
[Y.SharedWithMe]: "shared",
|
|
620
|
+
[Y.Public]: "public"
|
|
621
|
+
}, nt = (e, t, r) => [r[tt[t]], ...(e ?? "").split("/").filter(Boolean).map(n)], rt = (e, { folderLabels: t, source: n, favoriteIds: r }) => {
|
|
622
|
+
let i = r.has(e.url), a = n === Y.Public, o = n === Y.Personal;
|
|
623
|
+
return {
|
|
624
|
+
id: e.url,
|
|
625
|
+
type: u.Skill,
|
|
626
|
+
name: e.name,
|
|
627
|
+
description: "",
|
|
628
|
+
version: "",
|
|
629
|
+
lastUsed: p(e.updatedAt),
|
|
630
|
+
createdAt: e.createdAt,
|
|
631
|
+
updatedAt: e.updatedAt,
|
|
632
|
+
isFeatured: !1,
|
|
633
|
+
isHidden: !1,
|
|
634
|
+
topics: [],
|
|
635
|
+
isUserFavorite: i,
|
|
636
|
+
isStarred: i,
|
|
637
|
+
isMyApp: o && (e.isMy ?? !0),
|
|
638
|
+
sharedWithMe: e.sharedWithMe ?? n === Y.SharedWithMe,
|
|
639
|
+
isEditable: !a && (e.canEdit ?? o),
|
|
640
|
+
folder: nt(e.parentPath, n, t)
|
|
641
|
+
};
|
|
642
|
+
}, it = (e) => e.join(" · "), at = (e, t) => {
|
|
643
|
+
if (e == null) return null;
|
|
644
|
+
let n = [];
|
|
645
|
+
return e.whenToUse != null && n.push({
|
|
646
|
+
label: t.whenToUseLabel,
|
|
647
|
+
value: e.whenToUse
|
|
648
|
+
}), e.allowedTools?.length && n.push({
|
|
649
|
+
label: t.allowedToolsLabel,
|
|
650
|
+
value: it(e.allowedTools)
|
|
651
|
+
}), e.bundledResources?.length && n.push({
|
|
652
|
+
label: t.bundledResourcesLabel,
|
|
653
|
+
value: it(e.bundledResources)
|
|
654
|
+
}), n.length === 0 ? null : {
|
|
655
|
+
title: t.specificationSectionTitle,
|
|
656
|
+
specs: n
|
|
657
|
+
};
|
|
658
|
+
}, ot = (e) => e.filter((e) => e.nodeType === E.Item), st = (t, n) => {
|
|
659
|
+
let r = e(n), i = r ? `${r}/files` : "files";
|
|
660
|
+
return ot(t).find((t) => {
|
|
661
|
+
let n = e(t.path);
|
|
662
|
+
return n === "SKILL.md" || n === "files/SKILL.md" || n === `${i}/SKILL.md`;
|
|
663
|
+
})?.path ?? "SKILL.md";
|
|
664
|
+
}, ct = (t, n) => {
|
|
665
|
+
let r = e(t), i = e(n), a = i ? `${i}/files` : "files";
|
|
666
|
+
return r === "" || r === "files" || r === a ? null : r.startsWith(`${a}/`) ? r.slice(a.length + 1) : r.startsWith("files/") ? r.slice(6) : r;
|
|
667
|
+
}, X = (e, t) => ct(e, t), lt = (e, t, n, r) => {
|
|
668
|
+
let i = [], a = at(n, r);
|
|
669
|
+
a != null && i.push(a);
|
|
670
|
+
let o = [];
|
|
671
|
+
return e?.author && o.push({
|
|
672
|
+
label: r.authorLabel,
|
|
673
|
+
value: e.author
|
|
674
|
+
}), o.push({
|
|
675
|
+
label: r.updatedLabel,
|
|
676
|
+
value: e?.updatedAt ? s(e.updatedAt) : ""
|
|
677
|
+
}), o.push({
|
|
678
|
+
label: r.fileCountLabel,
|
|
679
|
+
value: String(ot(t).length)
|
|
680
|
+
}), i.push({
|
|
681
|
+
title: r.detailsSectionTitle,
|
|
682
|
+
specs: o
|
|
683
|
+
}), { sections: i };
|
|
684
|
+
}, Z = (e, t, n) => {
|
|
685
|
+
if (e === "") return n;
|
|
686
|
+
let r = t.get(e);
|
|
687
|
+
if (r != null) return r.items;
|
|
688
|
+
let i = e.split("/"), a = Z(i.slice(0, -1).join("/"), t, n), o = {
|
|
689
|
+
type: x.Folder,
|
|
690
|
+
id: e,
|
|
691
|
+
name: i[i.length - 1],
|
|
692
|
+
items: []
|
|
693
|
+
};
|
|
694
|
+
return t.set(e, o), a.push(o), o.items;
|
|
695
|
+
}, ut = (e, t) => {
|
|
696
|
+
e.sort((e, n) => {
|
|
697
|
+
if (t) {
|
|
698
|
+
if (e.name === "SKILL.md") return -1;
|
|
699
|
+
if (n.name === "SKILL.md") return 1;
|
|
700
|
+
}
|
|
701
|
+
return e.name.localeCompare(n.name);
|
|
702
|
+
});
|
|
703
|
+
for (let t of e) t.type === x.Folder && ut(t.items, !1);
|
|
704
|
+
}, dt = (e, t) => {
|
|
705
|
+
let n = /* @__PURE__ */ new Map(), r = [];
|
|
706
|
+
for (let i of e) {
|
|
707
|
+
let e = ct(i.path, t);
|
|
708
|
+
if (e == null) continue;
|
|
709
|
+
if (i.nodeType === E.Folder) {
|
|
710
|
+
Z(e, n, r);
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
let a = e.lastIndexOf("/");
|
|
714
|
+
Z(a === -1 ? "" : e.slice(0, a), n, r).push({
|
|
715
|
+
type: x.File,
|
|
716
|
+
id: i.path,
|
|
717
|
+
name: i.name
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
return ut(r, !0), r;
|
|
721
|
+
}, Q = async (e) => {
|
|
722
|
+
let t = Number(e.headers.get("content-length"));
|
|
723
|
+
if (Number.isFinite(t) && t > 262144) return null;
|
|
724
|
+
let n = await e.arrayBuffer();
|
|
725
|
+
return n.byteLength > 262144 ? null : new Uint8Array(n);
|
|
726
|
+
}, $ = async (e) => {
|
|
727
|
+
let t = await Q(e);
|
|
728
|
+
return t == null ? null : new TextDecoder().decode(t);
|
|
729
|
+
}, ft = /* @__PURE__ */ function(e) {
|
|
730
|
+
return e.Toolset = "toolset", e.Application = "application", e;
|
|
731
|
+
}({}), pt = (e) => {
|
|
732
|
+
try {
|
|
733
|
+
return decodeURIComponent(e);
|
|
734
|
+
} catch {
|
|
735
|
+
return e;
|
|
736
|
+
}
|
|
737
|
+
}, mt = (e) => e.split("/").map((e) => encodeURIComponent(pt(e))).join("/"), ht = (e) => e.endsWith("/") ? e.slice(0, -1) : e, gt = (e, t) => `${ht(e)}/v1/toolset/${mt(t)}/mcp`, _t = (e, t) => `${ht(e)}/v1/deployments/${mt(t)}/mcp`, vt = {
|
|
738
|
+
toolset: gt,
|
|
739
|
+
application: _t
|
|
740
|
+
}, yt = (e, t) => e === u.Toolset ? "toolset" : e === u.Agent && t === !0 ? "application" : null, bt = (e, t, n) => {
|
|
741
|
+
let r = vt[n](e, t);
|
|
742
|
+
return {
|
|
743
|
+
resource: { endpointUrl: r },
|
|
744
|
+
snippets: [{
|
|
745
|
+
language: C.Curl,
|
|
746
|
+
code: `curl -X POST ${r} \\\n -H 'Content-Type: application/json' \\\n -H 'Api-Key: <key>' \\\n -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`
|
|
747
|
+
}]
|
|
748
|
+
};
|
|
749
|
+
}, xt = {
|
|
750
|
+
[u.Model]: "model",
|
|
751
|
+
[u.Toolset]: "toolset",
|
|
752
|
+
[u.Agent]: "application",
|
|
753
|
+
[u.Prompt]: "prompt",
|
|
754
|
+
[u.Skill]: "skill"
|
|
755
|
+
}, St = (e) => xt[e], Ct = (e) => ({
|
|
756
|
+
version: e.version,
|
|
757
|
+
publishedAt: Date.parse(e.publishedAt),
|
|
758
|
+
folderPath: e.folderPath.split("/").filter(Boolean)
|
|
759
|
+
}), wt = (e) => ({
|
|
760
|
+
publishedAt: Date.parse(e.publishedAt),
|
|
761
|
+
folderPath: e.folderPath.split("/").filter(Boolean)
|
|
762
|
+
}), Tt = (e, t) => e.filter((e) => t.has(e.type)), Et = (e, t) => t ? e.filter((e) => !e.isMyApp) : [...e], Dt = (e) => e.filter((e) => e.isUserFavorite), Ot = (e, t) => {
|
|
763
|
+
let n = new Set(e.map((e) => e.type));
|
|
764
|
+
return t.filter((e) => n.has(e));
|
|
765
|
+
}, kt = (e, t) => {
|
|
766
|
+
let n = new Set(t.flatMap((e) => e.topics));
|
|
767
|
+
return new Set(Array.from(e).filter((e) => n.has(e)));
|
|
768
|
+
}, At = /* @__PURE__ */ function(e) {
|
|
769
|
+
return e.Deployment = "deployment", e.Prompt = "prompt", e;
|
|
770
|
+
}({}), jt = async (e, t) => {
|
|
771
|
+
if (e.type !== u.Prompt) return {
|
|
772
|
+
kind: "deployment",
|
|
773
|
+
id: e.id
|
|
774
|
+
};
|
|
775
|
+
let n = e.details?.promptContent?.content;
|
|
776
|
+
return n ??= (await t(e)).content, {
|
|
777
|
+
kind: "prompt",
|
|
778
|
+
id: e.id,
|
|
779
|
+
name: e.name,
|
|
780
|
+
description: e.description,
|
|
781
|
+
content: n,
|
|
782
|
+
hasParameters: d(n).length > 0
|
|
783
|
+
};
|
|
784
|
+
}, Mt = (e) => (t) => {
|
|
785
|
+
if (!qe(t)) return e.getPrompt(t.id);
|
|
786
|
+
let n = i(t.id);
|
|
787
|
+
return e.getPublicPrompt(n?.path ?? t.id);
|
|
788
|
+
}, Nt = ({ api: e, skills: t, isAdmin: n, dialCoreExternalUrl: r, skillOverviewLabels: i, promptOverviewLabels: a, deploymentLimitsLabels: o }) => {
|
|
789
|
+
let s = v(null);
|
|
790
|
+
return {
|
|
791
|
+
onFetchDetails: h(async (d) => {
|
|
792
|
+
if (d.type === u.Prompt) try {
|
|
793
|
+
let t = await Mt(e)(d);
|
|
794
|
+
return {
|
|
795
|
+
promptContent: { content: t.content },
|
|
796
|
+
overview: J(t, a)
|
|
797
|
+
};
|
|
798
|
+
} catch {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
if (d.type === u.Skill) {
|
|
802
|
+
let n = et(d.id);
|
|
803
|
+
if (n == null) return;
|
|
804
|
+
let { bucket: r, path: a } = n;
|
|
805
|
+
s.current = n;
|
|
806
|
+
let [o, u] = await Promise.allSettled([e.downloadSkillFile(r, a, c).then($), e.listSkillFiles({
|
|
807
|
+
bucket: r,
|
|
808
|
+
path: a,
|
|
809
|
+
filePath: "",
|
|
810
|
+
recursive: !0
|
|
811
|
+
})]), f = o.status === "fulfilled" && o.value != null ? l(o.value) : void 0, p = t.find((e) => e.url === d.id), m = u.status === "fulfilled" ? lt(p, u.value.items, f?.about, i) : void 0, h = u.status === "fulfilled" ? dt(u.value.items, a) : [], g = u.status === "fulfilled" ? st(u.value.items, a) : c;
|
|
812
|
+
return f == null && m == null ? void 0 : {
|
|
813
|
+
...f == null ? {} : { promptContent: {
|
|
814
|
+
content: f.body,
|
|
815
|
+
...f.description == null ? {} : { description: f.description },
|
|
816
|
+
files: h,
|
|
817
|
+
selectedFileId: g
|
|
818
|
+
} },
|
|
819
|
+
...m == null ? {} : { overview: m }
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
try {
|
|
823
|
+
let t = d.type === u.Model ? e.getDeploymentLimits(d.id).catch(() => void 0) : Promise.resolve(void 0), [i, a] = await Promise.all([e.getDeploymentDetails(d.id), t]), s = U(i), c = V(s), l = yt(d.type, d.supportsMcp), f = s.type === "MODEL" || s.type === "AGENT" ? k(r ?? "", d.id, {
|
|
824
|
+
hasChatCompletion: s.data.capabilities?.hasChatCompletion,
|
|
825
|
+
hasResponsesApi: s.data.capabilities?.hasResponsesApi
|
|
826
|
+
}) : void 0;
|
|
827
|
+
return {
|
|
828
|
+
...c,
|
|
829
|
+
api: l == null ? f ?? c.api : bt(r ?? "", d.id, l),
|
|
830
|
+
limits: P(a, o),
|
|
831
|
+
credentials: s.type === "TOOLSET" ? B(d.id, s.data, n) : void 0
|
|
832
|
+
};
|
|
833
|
+
} catch {
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
}, [
|
|
837
|
+
e,
|
|
838
|
+
n,
|
|
839
|
+
o,
|
|
840
|
+
r,
|
|
841
|
+
t,
|
|
842
|
+
a,
|
|
843
|
+
i
|
|
844
|
+
]),
|
|
845
|
+
onLoadContentFile: h(async (t) => {
|
|
846
|
+
let n = s.current;
|
|
847
|
+
if (n == null) return;
|
|
848
|
+
let r = X(t, n.path);
|
|
849
|
+
if (r == null) return;
|
|
850
|
+
let i = await $(await e.downloadSkillFile(n.bucket, n.path, r));
|
|
851
|
+
if (i != null) return r === "SKILL.md" ? l(i).body : i;
|
|
852
|
+
}, [e]),
|
|
853
|
+
onLoadSkillDetailsFile: h(async (t) => {
|
|
854
|
+
let n = s.current;
|
|
855
|
+
if (n == null) throw Error("No skill details are open");
|
|
856
|
+
let r = X(t, n.path);
|
|
857
|
+
if (r == null) throw Error("A folder cannot be previewed");
|
|
858
|
+
let i = await e.downloadSkillFile(n.bucket, n.path, r);
|
|
859
|
+
if (!i.ok) throw Object.assign(/* @__PURE__ */ Error(`File preview failed with status ${i.status}`), { status: i.status });
|
|
860
|
+
let a = await Q(i);
|
|
861
|
+
if (a == null) throw Error("File exceeds the preview size limit");
|
|
862
|
+
let o = i.headers.get("content-type")?.split(";")[0].trim() || void 0;
|
|
863
|
+
return {
|
|
864
|
+
bytes: a,
|
|
865
|
+
mimeType: o === "application/octet-stream" ? void 0 : o
|
|
866
|
+
};
|
|
867
|
+
}, [e])
|
|
868
|
+
};
|
|
869
|
+
}, Pt = /* @__PURE__ */ function(e) {
|
|
870
|
+
return e.Deployment = "deployment", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e;
|
|
871
|
+
}({}), Ft = ({ loadFavorites: e, updateFavorite: t }) => {
|
|
872
|
+
let [n, r] = y(/* @__PURE__ */ new Set()), [i, a] = y(!0);
|
|
873
|
+
g(() => {
|
|
874
|
+
let t = { value: !1 };
|
|
875
|
+
return (async () => {
|
|
876
|
+
try {
|
|
877
|
+
let n = await e();
|
|
878
|
+
t.value || r(new Set([
|
|
879
|
+
...n.deployments,
|
|
880
|
+
...n.toolsets,
|
|
881
|
+
...n.prompts,
|
|
882
|
+
...n.skills
|
|
883
|
+
]));
|
|
884
|
+
} catch {} finally {
|
|
885
|
+
t.value || a(!1);
|
|
886
|
+
}
|
|
887
|
+
})(), () => {
|
|
888
|
+
t.value = !0;
|
|
889
|
+
};
|
|
890
|
+
}, [e]);
|
|
891
|
+
let o = h(async (e, n, i = "deployment") => {
|
|
892
|
+
r((t) => {
|
|
893
|
+
let r = new Set(t);
|
|
894
|
+
return n ? r.add(e) : r.delete(e), r;
|
|
895
|
+
});
|
|
896
|
+
try {
|
|
897
|
+
await t(e, n, i);
|
|
898
|
+
} catch (t) {
|
|
899
|
+
throw r((t) => {
|
|
900
|
+
let r = new Set(t);
|
|
901
|
+
return n ? r.delete(e) : r.add(e), r;
|
|
902
|
+
}), t;
|
|
903
|
+
}
|
|
904
|
+
}, [t]);
|
|
905
|
+
return _(() => ({
|
|
906
|
+
favoriteIds: n,
|
|
907
|
+
isLoading: i,
|
|
908
|
+
toggleFavorite: o
|
|
909
|
+
}), [
|
|
910
|
+
n,
|
|
911
|
+
i,
|
|
912
|
+
o
|
|
913
|
+
]);
|
|
914
|
+
}, It = "Production", Lt = 50, Rt = (e, n, r) => {
|
|
915
|
+
let i = e.get(n);
|
|
916
|
+
return i == null ? [] : i.filter((e) => e.nodeType === ee.Folder).map((i) => {
|
|
917
|
+
let a = t(i.name), o = [...r, a], s = `${n}${i.name}/`;
|
|
918
|
+
return {
|
|
919
|
+
path: o,
|
|
920
|
+
name: a,
|
|
921
|
+
children: e.has(s) ? Rt(e, s, o) : void 0
|
|
922
|
+
};
|
|
923
|
+
});
|
|
924
|
+
}, zt = ({ listPublicFiles: e, rememberedFolderKeys: t, onRememberedFolderKeysChange: n }) => {
|
|
925
|
+
let [r, i] = y(() => /* @__PURE__ */ new Map()), [a, o] = y(() => /* @__PURE__ */ new Set()), [s, c] = y(() => /* @__PURE__ */ new Set()), [l, u] = y([]), d = _(() => {
|
|
926
|
+
let e = /* @__PURE__ */ new Set();
|
|
927
|
+
return a.forEach((t) => {
|
|
928
|
+
let n = t ? `${t}/` : "";
|
|
929
|
+
r.has(n) && e.add(t);
|
|
930
|
+
}), e;
|
|
931
|
+
}, [a, r]), f = h(async (t) => {
|
|
932
|
+
c((e) => new Set(e).add(t));
|
|
933
|
+
try {
|
|
934
|
+
let { items: n } = await e({ path: t || void 0 });
|
|
935
|
+
i((e) => new Map(e).set(t, n));
|
|
936
|
+
} finally {
|
|
937
|
+
c((e) => {
|
|
938
|
+
let n = new Set(e);
|
|
939
|
+
return n.delete(t), n;
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
}, [e]);
|
|
943
|
+
g(() => {
|
|
944
|
+
f("");
|
|
945
|
+
}, []);
|
|
946
|
+
let p = h((e) => {
|
|
947
|
+
o(e), e.forEach((e) => {
|
|
948
|
+
let t = `${e}/`;
|
|
949
|
+
!r.has(t) && !s.has(t) && f(t);
|
|
950
|
+
});
|
|
951
|
+
}, [
|
|
952
|
+
r,
|
|
953
|
+
s,
|
|
954
|
+
f
|
|
955
|
+
]), m = h((e, t) => {
|
|
956
|
+
let n = ne([...e, t]);
|
|
957
|
+
return u((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
|
|
958
|
+
}, []), v = h((e) => {
|
|
959
|
+
let r = ne(e), i = Array.isArray(t) ? t : [];
|
|
960
|
+
!r || i.includes(r) || n?.([r, ...i].slice(0, Lt));
|
|
961
|
+
}, [t, n]), b = h((e) => !e.includes(It), []);
|
|
962
|
+
return {
|
|
963
|
+
folderItems: _(() => {
|
|
964
|
+
let e = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
965
|
+
return te(Rt(r, "", []), [...e.map(D), ...l.map(D)]);
|
|
966
|
+
}, [
|
|
967
|
+
r,
|
|
968
|
+
t,
|
|
969
|
+
l
|
|
970
|
+
]),
|
|
971
|
+
expandedPaths: a,
|
|
972
|
+
loadedPaths: d,
|
|
973
|
+
loadingPaths: s,
|
|
974
|
+
onExpandedPathsChange: p,
|
|
975
|
+
onCreatePublishFolder: m,
|
|
976
|
+
rememberPublishFolder: v,
|
|
977
|
+
hasPublishWriteAccess: b
|
|
978
|
+
};
|
|
979
|
+
}, Bt = /* @__PURE__ */ function(e) {
|
|
980
|
+
return e.Forbidden = "forbidden", e.Generic = "generic", e;
|
|
981
|
+
}({}), Vt = ({ fileId: e, onLoadFile: t }) => {
|
|
982
|
+
let [n, r] = y(!1), [i, a] = y(null), [o, s] = y(null);
|
|
983
|
+
return g(() => {
|
|
984
|
+
let n = !1;
|
|
985
|
+
return r(!0), a(null), s(null), (async () => {
|
|
986
|
+
try {
|
|
987
|
+
let i = await t(e);
|
|
988
|
+
if (n) return;
|
|
989
|
+
a(i), r(!1);
|
|
990
|
+
} catch (e) {
|
|
991
|
+
if (n) return;
|
|
992
|
+
let t = e.status;
|
|
993
|
+
s(t === 403 ? "forbidden" : "generic"), r(!1);
|
|
994
|
+
}
|
|
995
|
+
})(), () => {
|
|
996
|
+
n = !0;
|
|
997
|
+
};
|
|
998
|
+
}, [e, t]), {
|
|
999
|
+
isLoading: n,
|
|
1000
|
+
content: i,
|
|
1001
|
+
error: o
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
//#endregion
|
|
1005
|
+
export { $e as A, We as B, lt as C, X as D, $ as E, J as F, be as G, U as H, qe as I, ce as J, P as K, Je as L, Ze as M, Y as N, st as O, et as P, re as Q, Ue as R, dt as S, Q as T, V as U, Ve as V, B as W, O as X, k as Y, ie as Z, ft as _, Ft as a, gt as b, jt as c, Tt as d, Et as f, St as g, Ct as h, Pt as i, Qe as j, Ye as k, Ot as l, wt as m, Vt as n, Nt as o, kt as p, A as q, zt as r, At as s, Bt as t, Dt as u, _t as v, rt as w, yt as x, bt as y, Re as z };
|