@epam/ai-dial-chat-hooks 1.2.0-dev.12 → 1.2.0-dev.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-error/api-error.js +5 -4
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
- package/attachments.d.ts +10 -4
- package/catalog/map-deployment-to-catalog-item.js +2 -2
- package/catalog/map-skill-to-catalog-item.js +30 -27
- package/catalog/publish.js +2 -1
- package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +17 -13
- package/catalog.d.ts +42 -5
- package/catalog.js +6 -5
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/create-chat-stream-api.js +18 -14
- package/conversation/stage.js +23 -0
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +13 -17
- package/conversation/useConversationImport/useConversationImport.js +1 -1
- package/conversation/useConversationScroll/useConversationScroll.js +68 -64
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/useConversationStream.js +87 -78
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -0
- package/conversation.d.ts +127 -6
- package/conversation.js +30 -29
- package/file-manager-canvas.d.ts +398 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +71 -330
- package/file-manager.js +15 -15
- package/files/attachment-canvas.js +51 -13
- package/files/attachment-types.js +14 -13
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -5
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
- package/index.d.ts +736 -32
- package/index.js +123 -111
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
- package/mcp-apps.d.ts +8 -6
- package/package.json +37 -18
- package/scheduled-task/scheduled-task-description.js +77 -0
- package/scheduled-task/scheduled-task-preparation.js +24 -0
- package/scheduled-task/scheduled-task-trigger.js +7 -2
- package/scheduled-task/scheduled-tasks-api-client.js +19 -0
- package/scheduled-task/use-scheduled-task-runs.js +82 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +180 -3
- package/scheduled-tasks.js +7 -2
- package/skill/skill.js +10 -7
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +75 -0
- package/skill/useSkillEditorLoad.js +29 -28
- package/skill/useSkillEditorSubmit.js +92 -75
- package/skill-editor.d.ts +107 -0
- package/skill-editor.js +9 -8
- package/usage/map-usage-data-to-dashboard.js +66 -0
- package/usage/map-user-usage-to-model-limits.js +160 -0
- package/usage.d.ts +120 -0
- package/usage.js +3 -0
- package/utils.d.ts +3 -1
package/index.js
CHANGED
|
@@ -23,114 +23,126 @@ import { mapDeploymentDetailsDtoToEntityDetails as Q, mapEntityDetailsToCatalogD
|
|
|
23
23
|
import { mapDeploymentToCatalogItem as te, mapDeploymentToolsetCredentials as ne, mapToolsetToCatalogItem as re, resolveDeploymentFolder as ie } from "./catalog/map-deployment-to-catalog-item.js";
|
|
24
24
|
import { PromptSource as ae, parsePromptResourceUrl as oe } from "./prompt/prompt-resource.js";
|
|
25
25
|
import { buildPromptOverview as se, isOrganisationPromptItem as ce, mapPromptToCatalogItem as le } from "./catalog/map-prompt-to-catalog-item.js";
|
|
26
|
-
import { SKILL_FILE_UPLOAD_MAX_BYTES as ue, SKILL_MANIFEST_FILE as de, SKILL_UPLOAD_MAX_FILES as fe, SKILL_UPLOAD_MAX_TOTAL_BYTES as pe, buildSkillFilesPayload as me, buildSkillManifest as he, buildSkillManifestForSubmit as ge, buildSkillManifestFromFrontmatter as _e, isValidSkillRelativePath as ve, nameFromPath as ye, normalizeSkillName as be, parseSkillManifest as xe, skillFileBytesToBlob as Se,
|
|
27
|
-
import { PUBLIC_SKILL_BUCKET as
|
|
28
|
-
import { buildSkillContentTree as
|
|
29
|
-
import { McpResourceKind as
|
|
30
|
-
import { getPublicCatalogEntityFolderPath as
|
|
31
|
-
import { deriveAvailableTabIds as
|
|
32
|
-
import { CatalogPrimaryActionType as
|
|
33
|
-
import { useCatalogEditNavigation as
|
|
34
|
-
import { parseSkillManifestDocument as
|
|
35
|
-
import { useSkillItemDetails as
|
|
36
|
-
import { useCatalogItemDetails as
|
|
37
|
-
import { OAuthResourceKind as
|
|
38
|
-
import { emitToolsetLoginSuccess as
|
|
39
|
-
import { getToolsetOAuthChannelName as
|
|
40
|
-
import { buildToolsetAuthorizeUrl as
|
|
41
|
-
import { initiateOAuthLogin as
|
|
42
|
-
import { ToolsetLoginOutcomeType as
|
|
43
|
-
import { useCatalogToolsetCredentials as
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
|
|
26
|
+
import { SKILL_FILE_UPLOAD_MAX_BYTES as ue, SKILL_MANIFEST_FILE as de, SKILL_UPLOAD_MAX_FILES as fe, SKILL_UPLOAD_MAX_TOTAL_BYTES as pe, buildSkillFilesPayload as me, buildSkillManifest as he, buildSkillManifestForSubmit as ge, buildSkillManifestFromFrontmatter as _e, isValidSkillRelativePath as ve, nameFromPath as ye, normalizeSkillName as be, parseSkillManifest as xe, skillFileBytesToBlob as Se, startsWithFrontmatterBlock as Ce, unpackSkillArchive as we } from "./skill/skill.js";
|
|
27
|
+
import { PUBLIC_SKILL_BUCKET as Te, SKILL_LISTING_MAX_PAGES as Ee, SKILL_LISTING_PAGE_SIZE as De, SKILL_MANIFEST_MAX_BYTES as Oe, SkillSource as ke, parseSkillResourceUrl as Ae } from "./skill/skill-types.js";
|
|
28
|
+
import { buildSkillContentTree as je, buildSkillOverview as Me, mapSkillToCatalogItem as Ne, readSkillFileBytes as Pe, readSkillFilePreviewBytes as Fe, readSkillManifest as Ie, resolveSkillFileDownloadPath as Le, resolveSkillManifestFileId as Re } from "./catalog/map-skill-to-catalog-item.js";
|
|
29
|
+
import { McpResourceKind as ze, buildApplicationMcpUrl as Be, buildConnectApi as Ve, buildToolsetMcpUrl as He, resolveMcpResourceKind as Ue } from "./catalog/mcp-endpoint-url.js";
|
|
30
|
+
import { getPublicCatalogEntityFolderPath as We, isPublicCatalogEntityId as Ge, mapPublishConversationResultDto as Ke, mapPublishHistoryEntryDto as qe, toPublishEntityType as Je } from "./catalog/publish.js";
|
|
31
|
+
import { deriveAvailableTabIds as Ye, deriveFavoriteItems as Xe, filterCatalogItemsBySelector as Ze, filterHiddenOwnedItems as Qe, reconcileFilterTopics as $e } from "./catalog/catalog-derivations.js";
|
|
32
|
+
import { CatalogPrimaryActionType as et, resolveCatalogPrimaryAction as tt } from "./catalog/catalog-primary-action.js";
|
|
33
|
+
import { useCatalogEditNavigation as nt } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
34
|
+
import { parseSkillManifestDocument as rt } from "./skill/skill-manifest.js";
|
|
35
|
+
import { useSkillItemDetails as it } from "./catalog/useSkillItemDetails.js";
|
|
36
|
+
import { useCatalogItemDetails as at } from "./catalog/useCatalogItemDetails.js";
|
|
37
|
+
import { OAuthResourceKind as ot, TOOLSET_REDIRECT_STATE_KEY as st, ToolsetAuthStatus as ct, ToolsetAuthTypes as lt, ToolsetCredentialsLevel as ut, ToolsetOAuthCallbackQuery as dt, ToolsetOAuthChannelControlType as ft, ToolsetOAuthFailureReason as pt, ToolsetOAuthInitiationResultType as mt, ToolsetOAuthResultType as ht, WithLogin as gt } from "./oauth/types.js";
|
|
38
|
+
import { emitToolsetLoginSuccess as _t, subscribeToolsetLoginSuccess as vt } from "./shared/toolset-login-events.js";
|
|
39
|
+
import { getToolsetOAuthChannelName as yt, waitForToolsetOAuthResult as bt } from "./oauth/handshake.js";
|
|
40
|
+
import { buildToolsetAuthorizeUrl as xt, getToolsetRedirectUri as St } from "./oauth/authorize-url.js";
|
|
41
|
+
import { initiateOAuthLogin as Ct, navigateToolsetOAuthPopup as wt, openToolsetOAuthPopup as Tt } from "./oauth/popup.js";
|
|
42
|
+
import { ToolsetLoginOutcomeType as Et, useToolsetLogin as Dt } from "./oauth/useToolsetLogin/useToolsetLogin.js";
|
|
43
|
+
import { useCatalogToolsetCredentials as Ot } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
44
|
+
import { useApplicationCredentials as kt } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
|
|
45
|
+
import { useSkillDetailsPanelData as At } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
46
|
+
import { FavoriteEntityType as jt, useFavoriteEntitiesState as Mt } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
47
|
+
import { usePublishFolders as Nt } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
48
|
+
import { buildAnnouncementSignature as Pt, hasAnnouncementContent as Ft, hasStructuredAnnouncement as It, sanitizeAnnouncementHtml as Lt, sanitizeAnnouncementMessageHtml as Rt } from "./conversation/announcement-message.js";
|
|
49
|
+
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as zt, GenerationConflictError as Bt, StreamUpstreamError as Vt, createChatStreamApi as Ht } from "./conversation/create-chat-stream-api.js";
|
|
50
|
+
import { shouldWatchForDisplayNameUpdate as Ut } from "./conversation/display-name-watch.js";
|
|
51
|
+
import { formatAppVersion as Wt, sanitizeFooterHtml as Gt } from "./conversation/footer-message.js";
|
|
52
|
+
import { getModelIdFromConversationId as Kt } from "./conversation/get-model-id-from-conversation-id.js";
|
|
53
|
+
import { getTimeOfDayGreeting as qt } from "./conversation/greeting.js";
|
|
54
|
+
import { createDeploymentChangedMessage as Jt } from "./conversation/message-factory.js";
|
|
55
|
+
import { getLastDeploymentId as Yt, getLastUserMessageToolConfiguration as Xt, isMessageStreaming as Zt, messageHasStages as Qt, normalizeResponseFormat as $t } from "./conversation/message-utils.js";
|
|
56
|
+
import { toOverlayMessages as en } from "./conversation/overlay-messages.js";
|
|
57
|
+
import { getQuickAppConversationStarters as tn } from "./conversation/quick-app-conversation-starters.js";
|
|
58
|
+
import { mapStages as nn, toStage as rn } from "./conversation/stage.js";
|
|
59
|
+
import { getStarterPopulateText as an, getStartersFromSchema as on } from "./conversation/starter-option.js";
|
|
60
|
+
import { useOAuthCallbackCompletion as sn } from "./oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js";
|
|
61
|
+
import { buildPromptExportEnvelope as cn, buildPromptExportFileName as ln, serializePromptExport as un } from "./prompt/export-prompt.js";
|
|
62
|
+
import { PROMPT_CONTENT_MAX_LENGTH as dn, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as fn, PROMPT_DESCRIPTION_MAX_LENGTH as pn, PROMPT_NAME_MAX_LENGTH as mn, PromptFieldError as hn, buildPromptPath as gn, getRemainingCharacters as _n, validatePromptContent as vn, validatePromptDescription as yn, validatePromptName as bn } from "./prompt/prompt.js";
|
|
63
|
+
import { usePromptsState as xn } from "./prompt/usePromptsState/usePromptsState.js";
|
|
64
|
+
import { UnsupportedTriggerReason as Sn } from "./scheduled-task/scheduled-task-mapping.js";
|
|
65
|
+
import { ScheduledTaskTriggerDescriptionKind as Cn, describeScheduledTaskTrigger as wn } from "./scheduled-task/scheduled-task-description.js";
|
|
66
|
+
import { apSchedulerDayToJsDay as Tn, jsDayToApSchedulerDay as En } from "./shared/cron-weekday.js";
|
|
67
|
+
import { mapFormValuesToCreateBody as Dn, mapFormValuesToUpdateBody as On, mapScheduledTaskDtoToFormValues as kn } from "./scheduled-task/scheduled-task-trigger.js";
|
|
68
|
+
import { prepareScheduledTaskCreateBody as An, prepareScheduledTaskUpdateBody as jn } from "./scheduled-task/scheduled-task-preparation.js";
|
|
69
|
+
import { createScheduledTasksApiClient as Mn } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
70
|
+
import { useScheduledTasks as Nn } from "./scheduled-task/use-scheduled-tasks.js";
|
|
71
|
+
import { useScheduledTaskRuns as Pn } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
72
|
+
import { validateSkillFileBatch as Fn } from "./skill/skill-file-batch-validation.js";
|
|
73
|
+
import { skillFileToAttachment as In } from "./skill/skill-file-preview.js";
|
|
74
|
+
import { SkillEditorLoadState as Ln, useSkillEditorLoad as Rn } from "./skill/useSkillEditorLoad.js";
|
|
75
|
+
import { useSkillEditorSubmit as zn } from "./skill/useSkillEditorSubmit.js";
|
|
76
|
+
import { useSkillFileActions as Bn } from "./skill/useSkillFileActions.js";
|
|
77
|
+
import { SkillPreviewErrorKind as Vn, useSkillFilePreview as Hn } from "./skill/useSkillFilePreview.js";
|
|
78
|
+
import { useSkillsState as Un } from "./skill/useSkillsState/useSkillsState.js";
|
|
79
|
+
import { SkillArchiveImportErrorKind as Wn, SkillArchiveImportStatus as Gn, SkillArchiveSelectionRejectionReason as Kn, classifySkillArchiveImportError as qn, useSkillArchiveImport as Jn } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
|
|
80
|
+
import { RecipientsCountStatus as Yn, useShareRecipientsCount as Xn } from "./useShareRecipientsCount/useShareRecipientsCount.js";
|
|
81
|
+
import { deriveConversationRowActionState as Zn } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
82
|
+
import { useActiveConversationSync as Qn } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
83
|
+
import { useAsyncConfirmDialog as $n } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
84
|
+
import { useConversationLookupMaps as er } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
85
|
+
import { getConversationSource as tr, useConversationPanelItems as nr } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
86
|
+
import { useImportFilePicker as rr } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
87
|
+
import { sanitizeFileName as ir, splitFileNameExtension as ar, trimFileNameToByteLimit as or } from "./files/file-name.js";
|
|
88
|
+
import { useAttachmentUpload as sr } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
89
|
+
import { AudioTranscriptionError as cr, AudioTranscriptionErrorReason as lr } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
90
|
+
import { useTranscribeAudio as ur } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
91
|
+
import { DEFAULT_MAX_ARCHIVE_BYTES as dr, useConversationExport as fr } from "./conversation/useConversationExport/useConversationExport.js";
|
|
92
|
+
import { attachmentToDto as pr, attachmentsToDtos as mr } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
93
|
+
import { createMessagePair as hr } from "./conversation/useConversationHandlers/message-factory.js";
|
|
94
|
+
import { hasActiveToolConfig as gr, isAnswerIncomplete as _r, isMessageChanged as vr, shouldRerunGenerationOnEdit as yr } from "./conversation/useConversationHandlers/message-utils.js";
|
|
95
|
+
import { getStarterConversationText as br, getStarterDisplayText as xr, getStarterSubmitText as Sr } from "./conversation/useConversationHandlers/starter-option.js";
|
|
96
|
+
import { getConversationPath as Cr } from "./conversation/useConversationStream/conversation-path.js";
|
|
97
|
+
import { useConversationHandlers as wr } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
98
|
+
import { useConversationImport as Tr } from "./conversation/useConversationImport/useConversationImport.js";
|
|
99
|
+
import { useConversationScroll as Er } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
100
|
+
import { applyChunkToMessages as Dr, mergeStages as Or } from "./conversation/useConversationStream/apply-chunk.js";
|
|
101
|
+
import { isAwaitingGenerationResume as kr } from "./conversation/useConversationStream/generation-resume.js";
|
|
102
|
+
import { useConversationStream as Ar } from "./conversation/useConversationStream/useConversationStream.js";
|
|
103
|
+
import { useConversationSources as jr } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
|
104
|
+
import { DialFilesApiUploadMode as Mr } from "./files/dial-files-api.js";
|
|
105
|
+
import { FileManagerNotificationReason as Nr, FileNameValidationErrorReason as Pr, FileOperationKind as Fr } from "./files/dial-file-manager.types.js";
|
|
106
|
+
import { COLUMNS_WITHOUT_AUTHOR as Ir, COLUMNS_WITH_AUTHOR as Lr, CORE_PERMISSION_MAP as Rr, DATE_OPTIONS as zr, PATH_SEPARATOR_REGEXP as Br, RESERVED_MARKER_NAME as Vr, UPLOAD_CONCURRENCY as Hr } from "./files/dial-file-manager.model.js";
|
|
107
|
+
import { DialFileManagerActionProfile as Ur, DialFileManagerVariant as Wr, deriveActionProfile as Gr } from "./files/file-manager-variant.js";
|
|
108
|
+
import { buildSharedItemVirtualPath as Kr, dialCorePathToRelative as qr, findDialFileByPath as Jr, findFolderByVirtualPath as Yr, formatOperationFolderName as Xr, getVirtualPathName as Zr, hasDialFileWritePermission as Qr, hasForbiddenNameSymbols as $r, isCopyMoveDuplicateAllowed as ei, isShareActionsAllowed as ti, normalizeVirtualPath as ni, parseNewFolderVirtualPath as ri, resolveOwnerCoords as ii } from "./files/dial-file-manager-path.util.js";
|
|
109
|
+
import { getParentFolderPath as ai, resolveDialFileApiPath as oi, virtualPathToApiPath as si } from "./files/resolve-dial-file-api-path.js";
|
|
110
|
+
import { prepareCopyItems as ci, prepareMoveRenameItems as li } from "./files/dial-file-manager-copy-move.util.js";
|
|
111
|
+
import { buildFromCache as ui, fetchByTab as di, fetchForSearch as fi, findFirstSuccessfulCopyMoveItem as pi, mapCorePermissions as mi, mapFileMetadataToDialFile as hi, mapSearchItem as gi, mergeCreatedFolderIntoCache as _i, updateEntry as vi } from "./files/dial-file-manager-mapping.util.js";
|
|
112
|
+
import { createFilesApiClient as yi } from "./files/create-files-api.js";
|
|
113
|
+
import { createUploadFileWithProgress as bi } from "./files/create-upload-file-with-progress.js";
|
|
114
|
+
import { openAnnotationAttachment as xi } from "./files/annotation.js";
|
|
115
|
+
import { annotationToOoxmlCanvasContent as Si, annotationToPdfCanvasContent as Ci, clearAttachmentCache as wi, hasAttachmentTextSource as Ti, referenceAttachmentToPdfCanvasContent as Ei, resolveCodeCanvasContent as Di, resolveGroupedVisualizerCanvasContent as Oi, resolveHtmlCanvasContent as ki, resolveImageCanvasContent as Ai, resolveJsonCanvasContent as ji, resolveMarkdownCanvasContent as Mi, resolveOoxmlCanvasContent as Ni, resolvePdfCanvasContent as Pi, resolveTextCanvasContent as Fi, resolveVisualizerCanvasContent as Ii } from "./files/attachment-canvas.js";
|
|
116
|
+
import { getUrlFileName as Li, isExternalSourcePreviewable as Ri, resolveExternalSourceContentType as zi } from "./files/source-content.js";
|
|
117
|
+
import { annotationToDisplayAttachment as Bi, attachmentDtoToDisplayAttachment as Vi, attachmentDtosToDisplayAttachments as Hi } from "./files/attachment-dto-to-display.js";
|
|
118
|
+
import { dialFileToAttachment as Ui, dialFilesToAttachments as Wi, dialFolderPathToAttachment as Gi } from "./files/dial-file-to-attachment.js";
|
|
119
|
+
import { DownloadDestinationType as Ki } from "./files/download-destination.js";
|
|
120
|
+
import { prepareDownloadDestination as qi } from "./files/prepare-download-destination.js";
|
|
121
|
+
import { useDialFileListing as Ji } from "./files/useDialFileListing/useDialFileListing.js";
|
|
122
|
+
import { useDialFileMetadata as Yi } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
123
|
+
import { useDialFileMutations as Xi } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
124
|
+
import { useDialFileSharing as Zi } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
125
|
+
import { useDialFileUploadBatch as Qi } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
126
|
+
import { useDialFileManager as $i } from "./files/useDialFileManager/useDialFileManager.js";
|
|
127
|
+
import { useDialFileManagerTabConfig as ea } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
128
|
+
import { useFileAttachmentPicker as ta } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
129
|
+
import { isCustomAppSchema as na, isQuickAppSchema as ra } from "./shared/application-schema.js";
|
|
130
|
+
import { getBrowserTimezone as ia } from "./shared/browser-timezone.js";
|
|
131
|
+
import { isValidAbsoluteUrl as aa, isValidFeaturesData as oa, parseFeaturesData as sa } from "./shared/custom-apps.js";
|
|
132
|
+
import { buildExternalServiceScopeId as ca, getExternalServiceFallbackName as la, parseExternalServiceUrl as ua } from "./shared/external-services.js";
|
|
133
|
+
import { useChatSettingsFormConfig as da } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
134
|
+
import { usePageFileDrag as fa } from "./usePageFileDrag/usePageFileDrag.js";
|
|
135
|
+
import { useViewportWidth as pa } from "./useViewportWidth/useViewportWidth.js";
|
|
136
|
+
import { usePanelMaxWidth as ma } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
137
|
+
import { useShareLink as ha } from "./useShareLink/useShareLink.js";
|
|
138
|
+
import { useToolsMenu as ga } from "./useToolsMenu/useToolsMenu.js";
|
|
139
|
+
import { USAGE_DATA_I18N_KEYS as _a, mapUsageDataToDashboard as va } from "./usage/map-usage-data-to-dashboard.js";
|
|
140
|
+
import { USAGE_MODEL_LIMITS_I18N_KEYS as ya, mapOverallCostLimitsToPeriodStatuses as ba, mapUserUsageToModelLimits as xa } from "./usage/map-user-usage-to-model-limits.js";
|
|
141
|
+
import { useUsageData as Sa } from "./usage/useUsageData/useUsageData.js";
|
|
142
|
+
import { McpAppResourceFetchError as Ca, createMcpAppsApiClient as wa } from "./mcp-apps/mcp-apps-api-client.js";
|
|
143
|
+
import { useMcpAppTools as Ta } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
144
|
+
import { useMcpAppHostContext as Ea } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
145
|
+
import { useMcpAppHostAdapter as Da } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
146
|
+
import { useOpenMcpAppCanvas as Oa } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
147
|
+
import { useGridEditingScroll as ka } from "@epam/ai-dial-chat-shared";
|
|
148
|
+
export { x as AttachmentValidationErrorReason, cr as AudioTranscriptionError, lr as AudioTranscriptionErrorReason, R as AuthenticationType, Ir as COLUMNS_WITHOUT_AUTHOR, Lr as COLUMNS_WITH_AUTHOR, Rr as CORE_PERMISSION_MAP, et as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, zr as DATE_OPTIONS, zt as DEFAULT_GENERATION_CONFLICT_MESSAGE, dr as DEFAULT_MAX_ARCHIVE_BYTES, Ur as DialFileManagerActionProfile, Wr as DialFileManagerVariant, Mr as DialFilesApiUploadMode, Ki as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, jt as FavoriteEntityType, Nr as FileManagerNotificationReason, Pr as FileNameValidationErrorReason, Fr as FileOperationKind, Bt as GenerationConflictError, Ca as McpAppResourceFetchError, ze as McpResourceKind, ot as OAuthResourceKind, Br as PATH_SEPARATOR_REGEXP, dn as PROMPT_CONTENT_MAX_LENGTH, fn as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, pn as PROMPT_DESCRIPTION_MAX_LENGTH, mn as PROMPT_NAME_MAX_LENGTH, Te as PUBLIC_SKILL_BUCKET, hn as PromptFieldError, ae as PromptSource, Vr as RESERVED_MARKER_NAME, Yn as RecipientsCountStatus, ue as SKILL_FILE_UPLOAD_MAX_BYTES, Ee as SKILL_LISTING_MAX_PAGES, De as SKILL_LISTING_PAGE_SIZE, de as SKILL_MANIFEST_FILE, Oe as SKILL_MANIFEST_MAX_BYTES, fe as SKILL_UPLOAD_MAX_FILES, pe as SKILL_UPLOAD_MAX_TOTAL_BYTES, Cn as ScheduledTaskTriggerDescriptionKind, Wn as SkillArchiveImportErrorKind, Gn as SkillArchiveImportStatus, Kn as SkillArchiveSelectionRejectionReason, Ln as SkillEditorLoadState, Vn as SkillPreviewErrorKind, ke as SkillSource, Vt as StreamUpstreamError, st as TOOLSET_REDIRECT_STATE_KEY, ct as ToolsetAuthStatus, lt as ToolsetAuthTypes, ut as ToolsetCredentialsLevel, Et as ToolsetLoginOutcomeType, dt as ToolsetOAuthCallbackQuery, ft as ToolsetOAuthChannelControlType, pt as ToolsetOAuthFailureReason, mt as ToolsetOAuthInitiationResultType, ht as ToolsetOAuthResultType, Hr as UPLOAD_CONCURRENCY, _a as USAGE_DATA_I18N_KEYS, ya as USAGE_MODEL_LIMITS_I18N_KEYS, Sn as UnsupportedTriggerReason, gt as WithLogin, Bi as annotationToDisplayAttachment, Si as annotationToOoxmlCanvasContent, Ci as annotationToPdfCanvasContent, Tn as apSchedulerDayToJsDay, W as appendLocaleCode, Dr as applyChunkToMessages, Vi as attachmentDtoToDisplayAttachment, Hi as attachmentDtosToDisplayAttachments, pr as attachmentToDto, mr as attachmentsToDtos, G as buildAdditionalLocaleOptions, Pt as buildAnnouncementSignature, Be as buildApplicationMcpUrl, N as buildChatCompletionsUrl, Ve as buildConnectApi, P as buildDeploymentConnectApi, ca as buildExternalServiceScopeId, ui as buildFromCache, cn as buildPromptExportEnvelope, ln as buildPromptExportFileName, se as buildPromptOverview, gn as buildPromptPath, F as buildResponsesUrl, Kr as buildSharedItemVirtualPath, je as buildSkillContentTree, me as buildSkillFilesPayload, he as buildSkillManifest, ge as buildSkillManifestForSubmit, _e as buildSkillManifestFromFrontmatter, Me as buildSkillOverview, xt as buildToolsetAuthorizeUrl, He as buildToolsetMcpUrl, qn as classifySkillArchiveImportError, wi as clearAttachmentCache, K as composeLocalePayload, Ht as createChatStreamApi, i as createCsrfMiddleware, Jt as createDeploymentChangedMessage, yi as createFilesApiClient, wa as createMcpAppsApiClient, hr as createMessagePair, j as createPublishApiClient, Mn as createScheduledTasksApiClient, a as createUnauthorizedMiddleware, bi as createUploadFileWithProgress, V as decodeToolsetId, q as decomposeLocalizedFields, Gr as deriveActionProfile, Ye as deriveAvailableTabIds, Zn as deriveConversationRowActionState, Xe as deriveFavoriteItems, wn as describeScheduledTaskTrigger, qr as dialCorePathToRelative, Ui as dialFileToAttachment, Wi as dialFilesToAttachments, Gi as dialFolderPathToAttachment, m as downloadAttachment, _t as emitToolsetLoginSuccess, I as encodeDeploymentId, H as encodeToolsetId, di as fetchByTab, fi as fetchForSearch, Ze as filterCatalogItemsBySelector, Qe as filterHiddenOwnedItems, L as findDeploymentByIdOrReference, Jr as findDialFileByPath, pi as findFirstSuccessfulCopyMoveItem, Yr as findFolderByVirtualPath, Wt as formatAppVersion, X as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Xr as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, ia as getBrowserTimezone, Cr as getConversationPath, tr as getConversationSource, la as getExternalServiceFallbackName, Yt as getLastDeploymentId, Xt as getLastUserMessageToolConfiguration, Kt as getModelIdFromConversationId, ai as getParentFolderPath, We as getPublicCatalogEntityFolderPath, tn as getQuickAppConversationStarters, _n as getRemainingCharacters, br as getStarterConversationText, xr as getStarterDisplayText, an as getStarterPopulateText, Sr as getStarterSubmitText, on as getStartersFromSchema, qt as getTimeOfDayGreeting, yt as getToolsetOAuthChannelName, St as getToolsetRedirectUri, Li as getUrlFileName, Zr as getVirtualPathName, gr as hasActiveToolConfig, Ft as hasAnnouncementContent, Ti as hasAttachmentTextSource, Qr as hasDialFileWritePermission, $r as hasForbiddenNameSymbols, It as hasStructuredAnnouncement, o as includesIgnoreCase, Ct as initiateOAuthLogin, _r as isAnswerIncomplete, kr as isAwaitingGenerationResume, r as isConversationNotFoundError, ei as isCopyMoveDuplicateAllowed, na as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, Ri as isExternalSourcePreviewable, vr as isMessageChanged, Zt as isMessageStreaming, ce as isOrganisationPromptItem, Ge as isPublicCatalogEntityId, U as isPublicToolsetId, ra as isQuickAppSchema, ti as isShareActionsAllowed, aa as isValidAbsoluteUrl, oa as isValidFeaturesData, ve as isValidSkillRelativePath, En as jsDayToApSchedulerDay, mi as mapCorePermissions, Q as mapDeploymentDetailsDtoToEntityDetails, z as mapDeploymentLimitsDtoToCatalogLimits, B as mapDeploymentLimitsToInput, te as mapDeploymentToCatalogItem, ne as mapDeploymentToolsetCredentials, $ as mapEntityDetailsToCatalogDetails, hi as mapFileMetadataToDialFile, Dn as mapFormValuesToCreateBody, On as mapFormValuesToUpdateBody, ba as mapOverallCostLimitsToPeriodStatuses, le as mapPromptToCatalogItem, Ke as mapPublishConversationResultDto, qe as mapPublishHistoryEntryDto, kn as mapScheduledTaskDtoToFormValues, gi as mapSearchItem, Ne as mapSkillToCatalogItem, nn as mapStages, ee as mapToolsetCredentials, re as mapToolsetToCatalogItem, va as mapUsageDataToDashboard, xa as mapUserUsageToModelLimits, _i as mergeCreatedFolderIntoCache, Or as mergeStages, Qt as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, ye as nameFromPath, wt as navigateToolsetOAuthPopup, $t as normalizeResponseFormat, be as normalizeSkillName, ni as normalizeVirtualPath, xi as openAnnotationAttachment, Tt as openToolsetOAuthPopup, Z as padTwoDigits, ua as parseExternalServiceUrl, sa as parseFeaturesData, ri as parseNewFolderVirtualPath, oe as parsePromptResourceUrl, xe as parseSkillManifest, rt as parseSkillManifestDocument, Ae as parseSkillResourceUrl, ci as prepareCopyItems, qi as prepareDownloadDestination, li as prepareMoveRenameItems, An as prepareScheduledTaskCreateBody, jn as prepareScheduledTaskUpdateBody, Pe as readSkillFileBytes, Fe as readSkillFilePreviewBytes, Ie as readSkillManifest, $e as reconcileFilterTopics, Ei as referenceAttachmentToPdfCanvasContent, tt as resolveCatalogPrimaryAction, Di as resolveCodeCanvasContent, ie as resolveDeploymentFolder, oi as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, zi as resolveExternalSourceContentType, Oi as resolveGroupedVisualizerCanvasContent, ki as resolveHtmlCanvasContent, Ai as resolveImageCanvasContent, ji as resolveJsonCanvasContent, J as resolveLocalizedText, Mi as resolveMarkdownCanvasContent, Ue as resolveMcpResourceKind, Ni as resolveOoxmlCanvasContent, ii as resolveOwnerCoords, Pi as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Le as resolveSkillFileDownloadPath, Re as resolveSkillManifestFileId, Fi as resolveTextCanvasContent, Ii as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Lt as sanitizeAnnouncementHtml, Rt as sanitizeAnnouncementMessageHtml, ir as sanitizeFileName, Gt as sanitizeFooterHtml, un as serializePromptExport, yr as shouldRerunGenerationOnEdit, Ut as shouldWatchForDisplayNameUpdate, Se as skillFileBytesToBlob, In as skillFileToAttachment, ar as splitFileNameExtension, Ce as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, vt as subscribeToolsetLoginSuccess, Y as toBaseLocale, en as toOverlayMessages, Je as toPublishEntityType, M as toPublishRuleDto, rn as toStage, or as trimFileNameToByteLimit, we as unpackSkillArchive, vi as updateEntry, Qn as useActiveConversationSync, kt as useApplicationCredentials, $n as useAsyncConfirmDialog, g as useAttachmentAction, sr as useAttachmentUpload, S as useAttachmentValidation, nt as useCatalogEditNavigation, at as useCatalogItemDetails, Ot as useCatalogToolsetCredentials, da as useChatSettingsFormConfig, fr as useConversationExport, wr as useConversationHandlers, Tr as useConversationImport, er as useConversationLookupMaps, nr as useConversationPanelItems, Er as useConversationScroll, jr as useConversationSources, Ar as useConversationStream, Ji as useDialFileListing, $i as useDialFileManager, ea as useDialFileManagerTabConfig, Yi as useDialFileMetadata, Xi as useDialFileMutations, Zi as useDialFileSharing, Qi as useDialFileUploadBatch, Mt as useFavoriteEntitiesState, ta as useFileAttachmentPicker, ka as useGridEditingScroll, rr as useImportFilePicker, Da as useMcpAppHostAdapter, Ea as useMcpAppHostContext, Ta as useMcpAppTools, sn as useOAuthCallbackCompletion, Oa as useOpenMcpAppCanvas, fa as usePageFileDrag, ma as usePanelMaxWidth, xn as usePromptsState, Nt as usePublishFolders, Pn as useScheduledTaskRuns, Nn as useScheduledTasks, ha as useShareLink, Xn as useShareRecipientsCount, Jn as useSkillArchiveImport, At as useSkillDetailsPanelData, Rn as useSkillEditorLoad, zn as useSkillEditorSubmit, Bn as useSkillFileActions, Hn as useSkillFilePreview, it as useSkillItemDetails, Un as useSkillsState, ga as useToolsMenu, Dt as useToolsetLogin, ur as useTranscribeAudio, Sa as useUsageData, pa as useViewportWidth, vn as validatePromptContent, yn as validatePromptDescription, bn as validatePromptName, Fn as validateSkillFileBatch, si as virtualPathToApiPath, bt as waitForToolsetOAuthResult };
|
|
@@ -2,8 +2,8 @@ import { getApiErrorMessage as e } from "../../api-error/api-error.js";
|
|
|
2
2
|
import { useMcpAppHostContext as t } from "../useMcpAppHostContext/useMcpAppHostContext.js";
|
|
3
3
|
import { useMemo as n } from "react";
|
|
4
4
|
//#region src/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.ts
|
|
5
|
-
var r = (r, i, a, o) => {
|
|
6
|
-
let
|
|
5
|
+
var r = (r, i, a, o, s) => {
|
|
6
|
+
let c = t(r, o), l = n(() => async (t, n, r, a) => {
|
|
7
7
|
try {
|
|
8
8
|
return await i.callTool(t, n, r, a);
|
|
9
9
|
} catch (t) {
|
|
@@ -11,15 +11,17 @@ var r = (r, i, a, o) => {
|
|
|
11
11
|
}
|
|
12
12
|
}, [i]);
|
|
13
13
|
return n(() => ({
|
|
14
|
-
hostContext:
|
|
14
|
+
hostContext: c,
|
|
15
|
+
hostInfo: s,
|
|
15
16
|
sandboxUrl: a,
|
|
16
17
|
fetchResourceHtml: i.fetchResourceHtml,
|
|
17
|
-
callTool:
|
|
18
|
+
callTool: l
|
|
18
19
|
}), [
|
|
20
|
+
c,
|
|
19
21
|
s,
|
|
20
22
|
a,
|
|
21
23
|
i.fetchResourceHtml,
|
|
22
|
-
|
|
24
|
+
l
|
|
23
25
|
]);
|
|
24
26
|
};
|
|
25
27
|
//#endregion
|
|
@@ -11,7 +11,7 @@ var t = /* @__PURE__ */ "--color-background-primary.--color-background-secondary
|
|
|
11
11
|
theme: i ?? r,
|
|
12
12
|
locale: a,
|
|
13
13
|
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
14
|
-
userAgent: o ??
|
|
14
|
+
userAgent: o ?? navigator.userAgent,
|
|
15
15
|
platform: "web",
|
|
16
16
|
displayMode: t,
|
|
17
17
|
availableDisplayModes: s ?? ["inline", "fullscreen"],
|
|
@@ -4,56 +4,58 @@ import { useCallback as i, useEffect as a, useRef as o } from "react";
|
|
|
4
4
|
import { computeMcpAppSeedKey as s, resolveMcpAppToolResult as c } from "@epam/ai-dial-mcp-apps";
|
|
5
5
|
//#region src/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.ts
|
|
6
6
|
var l = (l, u, d, f) => {
|
|
7
|
-
let { openCanvas: p, openCanvasLoading: m, closeCanvas: h } = r(), { hostContext: g,
|
|
8
|
-
if (
|
|
9
|
-
f?.(), m(
|
|
7
|
+
let { openCanvas: p, openCanvasLoading: m, closeCanvas: h } = r(), { hostContext: g, hostInfo: _, sandboxUrl: v, fetchResourceHtml: y, callTool: b } = u, x = i((e) => e === "inline" ? (h(), "inline") : "fullscreen", [h]), S = o(null), C = i(async (r, i, a, o = !1) => {
|
|
8
|
+
if (v == null) return !1;
|
|
9
|
+
f?.(), m(r.mcpToolName, i);
|
|
10
10
|
try {
|
|
11
11
|
let e = s(a), n = async () => {
|
|
12
|
-
let [e, t] = await Promise.all([
|
|
12
|
+
let [e, t] = await Promise.all([y(r.toolsetId, r.resourceUri), c(r, a, b)]);
|
|
13
13
|
return {
|
|
14
14
|
html: e,
|
|
15
15
|
toolResult: t
|
|
16
16
|
};
|
|
17
|
-
}, u,
|
|
18
|
-
return i != null && !o ? {html: u, toolResult:
|
|
17
|
+
}, u, d;
|
|
18
|
+
return i != null && !o ? {html: u, toolResult: d} = await l.getOrFetch(i, e, n) : ({html: u, toolResult: d} = await n(), i != null && l.set(i, {
|
|
19
19
|
html: u,
|
|
20
|
-
toolResult:
|
|
20
|
+
toolResult: d
|
|
21
21
|
}, e)), p({
|
|
22
22
|
type: t.McpApp,
|
|
23
23
|
html: u,
|
|
24
|
-
sandboxUrl:
|
|
24
|
+
sandboxUrl: v,
|
|
25
25
|
toolInput: a?.toolInput,
|
|
26
|
-
toolResult:
|
|
26
|
+
toolResult: d,
|
|
27
27
|
hostContext: g,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
hostInfo: _,
|
|
29
|
+
onToolCall: (e, t) => b(r.toolsetId, e, t, r.kind),
|
|
30
|
+
onRequestDisplayMode: x,
|
|
30
31
|
onReload: () => {
|
|
31
|
-
i != null && l.invalidate(i),
|
|
32
|
+
i != null && l.invalidate(i), S.current?.(r, i, a, !0);
|
|
32
33
|
}
|
|
33
|
-
},
|
|
34
|
-
} catch (
|
|
35
|
-
let
|
|
34
|
+
}, r.mcpToolName, i), !0;
|
|
35
|
+
} catch (a) {
|
|
36
|
+
let o = a instanceof e && a.status === 403;
|
|
36
37
|
return p({
|
|
37
38
|
type: t.Error,
|
|
38
|
-
errorType:
|
|
39
|
-
label:
|
|
40
|
-
},
|
|
39
|
+
errorType: o ? n.Forbidden : n.LoadFailed,
|
|
40
|
+
label: o ? d.forbiddenErrorLabel : d.loadErrorLabel
|
|
41
|
+
}, r.mcpToolName, i), !1;
|
|
41
42
|
}
|
|
42
43
|
}, [
|
|
43
44
|
p,
|
|
44
45
|
m,
|
|
45
46
|
f,
|
|
46
|
-
_,
|
|
47
|
-
g,
|
|
48
47
|
v,
|
|
48
|
+
g,
|
|
49
|
+
_,
|
|
49
50
|
y,
|
|
51
|
+
b,
|
|
50
52
|
l,
|
|
51
53
|
d,
|
|
52
|
-
|
|
54
|
+
x
|
|
53
55
|
]);
|
|
54
56
|
return a(() => {
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
+
S.current = C;
|
|
58
|
+
}, [C]), { openMcpAppCanvas: C };
|
|
57
59
|
};
|
|
58
60
|
//#endregion
|
|
59
61
|
export { l as useOpenMcpAppCanvas };
|
package/mcp-apps.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { DeploymentItemDto } from '@epam/ai-dial-chat-api-client';
|
|
3
3
|
import { DialToolsetDto } from '@epam/ai-dial-chat-api-client';
|
|
4
|
+
import { Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
4
5
|
import { McpAppToolSummaryDto } from '@epam/ai-dial-chat-api-client';
|
|
5
6
|
import { McpUiHostContext } from '@mcp-ui/client';
|
|
6
7
|
import { Message } from '@epam/ai-dial-chat-shared';
|
|
@@ -48,6 +49,8 @@ declare type McpAppDisplayMode = NonNullable<McpUiHostContext['displayMode']>;
|
|
|
48
49
|
declare interface McpAppHostAdapter {
|
|
49
50
|
/** `McpUiHostContext` to deliver to the mounted app's `ui/initialize` handshake. */
|
|
50
51
|
hostContext: McpUiHostContext;
|
|
52
|
+
/** Host identity (`name`/`version`) to deliver to the mounted app's `ui/initialize` handshake. */
|
|
53
|
+
hostInfo: Implementation;
|
|
51
54
|
/** Operator-configured MCP Apps sandbox-proxy URL, or `null` when unconfigured. */
|
|
52
55
|
sandboxUrl: string | null;
|
|
53
56
|
/** Fetches the matched tool's MCP Apps `ui://` resource. */
|
|
@@ -64,7 +67,7 @@ export declare interface McpAppHostContextParams {
|
|
|
64
67
|
mcpAppTheme?: string;
|
|
65
68
|
/** Host's current i18n locale (BCP 47). */
|
|
66
69
|
locale: string;
|
|
67
|
-
/** Operator-configured MCP App user-agent override. Defaults to `
|
|
70
|
+
/** Operator-configured MCP App user-agent override. Defaults to the browser's own `navigator.userAgent`. */
|
|
68
71
|
mcpAppUserAgent?: string;
|
|
69
72
|
/**
|
|
70
73
|
* Display modes the host can switch an app between via
|
|
@@ -180,10 +183,11 @@ declare type McpDeploymentKind = 'toolset' | 'application';
|
|
|
180
183
|
* Builds the `McpAppHostAdapter` a host injects into `@epam/ai-dial-mcp-apps`'s
|
|
181
184
|
* hooks/components, wiring the library's host-context/tool-call/resource-fetch
|
|
182
185
|
* contract to a configured `McpAppsApiClient` and this app's theme/locale/config
|
|
183
|
-
* values (`hostContextParams`, `sandboxUrl`)
|
|
184
|
-
*
|
|
186
|
+
* values (`hostContextParams`, `sandboxUrl`), plus the host's own identity
|
|
187
|
+
* (`hostInfo`) — this hook itself never reads app context, so a host builds
|
|
188
|
+
* those values wherever it already has them.
|
|
185
189
|
*/
|
|
186
|
-
export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams) => McpAppHostAdapter;
|
|
190
|
+
export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams, hostInfo: Implementation) => McpAppHostAdapter;
|
|
187
191
|
|
|
188
192
|
/**
|
|
189
193
|
* Builds the `McpUiHostContext` delivered to a mounted MCP App during its
|
|
@@ -243,8 +247,6 @@ export declare const useOpenMcpAppCanvas: (cache: McpAppResponseCache, hostAdapt
|
|
|
243
247
|
|
|
244
248
|
/** User-facing text `useOpenMcpAppCanvas` needs but cannot resolve itself — a lib must not call `t()`. */
|
|
245
249
|
export declare interface UseOpenMcpAppCanvasLabels {
|
|
246
|
-
/** Canvas panel title while an MCP App is loading or open. */
|
|
247
|
-
title: string;
|
|
248
250
|
/** Error label shown when the resource fetch is forbidden (HTTP 403). */
|
|
249
251
|
forbiddenErrorLabel: string;
|
|
250
252
|
/** Error label shown for any other resource-load/tool-call failure. */
|