@epam/ai-dial-chat-hooks 1.2.0-dev.20 → 1.2.0-dev.207
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/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- package/catalog/map-deployment-limits-to-input.js +81 -9
- package/catalog/map-deployment-to-catalog-item.js +34 -34
- package/catalog/map-entity-details-to-catalog.js +7 -0
- package/catalog/map-skill-to-catalog-item.js +30 -27
- package/catalog/publish.js +6 -5
- package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +17 -13
- package/catalog.d.ts +116 -20
- package/catalog.js +23 -22
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/create-chat-stream-api.js +85 -49
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +23 -0
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/useConversationHandlers.js +16 -5
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +2 -3
- package/conversation/useConversationScroll/useConversationScroll.js +68 -64
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/generation-resume.js +104 -63
- package/conversation/useConversationStream/useConversationStream.js +183 -108
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -0
- package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
- package/conversation-sources.d.ts +1 -1
- package/conversation-transfer.d.ts +2 -1
- package/conversation.d.ts +241 -13
- package/conversation.js +32 -30
- package/file-manager-canvas.d.ts +398 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +153 -350
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +40 -1
- package/files/attachment-types.js +14 -13
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +23 -1
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/useDialFileListing/useDialFileListing.js +157 -145
- package/files/useDialFileManager/useDialFileManager.js +132 -128
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
- package/files/useDialFileMutations/useDialFileMutations.js +33 -32
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
- package/index.d.ts +1068 -81
- package/index.js +136 -122
- 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/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +32 -0
- package/oauth.js +9 -9
- package/package.json +36 -21
- 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 +194 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +195 -3
- package/scheduled-tasks.js +7 -2
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +42 -27
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
- package/skill/useSkillEditorLoad.js +29 -28
- package/skill/useSkillEditorSubmit.js +108 -84
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +133 -3
- 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 +202 -0
- package/usage.d.ts +125 -0
- package/usage.js +3 -0
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +8 -6
package/index.js
CHANGED
|
@@ -12,125 +12,139 @@ import { EXPORT_APP_NAME as k } from "./conversation/conversation-transfer/expor
|
|
|
12
12
|
import { formatQuotedNameList as A } from "./conversation/conversation-transfer/import-conversation.js";
|
|
13
13
|
import { createPublishApiClient as j, toPublishRuleDto as M } from "./catalog/create-publish-api.js";
|
|
14
14
|
import { buildChatCompletionsUrl as N, buildDeploymentConnectApi as P, buildResponsesUrl as F } from "./catalog/deployment-endpoint-url.js";
|
|
15
|
-
import {
|
|
16
|
-
import { AuthenticationType as
|
|
17
|
-
import { mapDeploymentLimitsDtoToCatalogLimits as
|
|
18
|
-
import { mapDeploymentLimitsToInput as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
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
|
-
|
|
15
|
+
import { decodeDeploymentId as I, encodeDeploymentId as L, findDeploymentByIdOrReference as R, normalizeDeploymentId as z } from "./catalog/deployment-id.js";
|
|
16
|
+
import { AuthenticationType as B } from "./catalog/entity-details.js";
|
|
17
|
+
import { mapDeploymentLimitsDtoToCatalogLimits as V } from "./catalog/map-deployment-limits-to-catalog.js";
|
|
18
|
+
import { mapDeploymentLimitsToInput as H } from "./catalog/map-deployment-limits-to-input.js";
|
|
19
|
+
import { OAuthResourceKind as U, TOOLSET_REDIRECT_STATE_KEY as W, ToolsetAuthStatus as G, ToolsetAuthTypes as K, ToolsetCredentialsLevel as q, ToolsetOAuthCallbackQuery as J, ToolsetOAuthChannelControlType as Y, ToolsetOAuthFailureReason as X, ToolsetOAuthInitiationResultType as Z, ToolsetOAuthResultType as Q, WithLogin as $ } from "./oauth/types.js";
|
|
20
|
+
import { decodeToolsetId as ee, encodeToolsetId as te, isPublicToolsetId as ne, normalizeToolsetId as re, resolveToolsetCredentialsLevel as ie, selectToolsetAuthStatus as ae } from "./oauth/toolset-id.js";
|
|
21
|
+
import { appendLocaleCode as oe, buildAdditionalLocaleOptions as se, composeLocalePayload as ce, decomposeLocalizedFields as le, resolveLocalizedText as ue, toBaseLocale as de } from "./shared/locale.js";
|
|
22
|
+
import { formatCalendarDate as fe, padTwoDigits as pe } from "./shared/formatting.js";
|
|
23
|
+
import { mapDeploymentDetailsDtoToEntityDetails as me, mapEntityDetailsToCatalogDetails as he, mapToolsetCredentials as ge } from "./catalog/map-entity-details-to-catalog.js";
|
|
24
|
+
import { mapDeploymentToCatalogItem as _e, mapDeploymentToolsetCredentials as ve, mapToolsetToCatalogItem as ye, resolveDeploymentFolder as be } from "./catalog/map-deployment-to-catalog-item.js";
|
|
25
|
+
import { PromptSource as xe, parsePromptResourceUrl as Se } from "./prompt/prompt-resource.js";
|
|
26
|
+
import { buildPromptOverview as Ce, isOrganisationPromptItem as we, mapPromptToCatalogItem as Te } from "./catalog/map-prompt-to-catalog-item.js";
|
|
27
|
+
import { SKILL_FILE_UPLOAD_MAX_BYTES as Ee, SKILL_MANIFEST_FILE as De, SKILL_TEXT_FIELD_MAX_LENGTHS as Oe, SKILL_UPLOAD_MAX_FILES as ke, SKILL_UPLOAD_MAX_TOTAL_BYTES as Ae, buildSkillFilesPayload as je, buildSkillManifest as Me, buildSkillManifestForSubmit as Ne, buildSkillManifestFromFrontmatter as Pe, getSkillFieldLengthViolations as Fe, isValidSkillRelativePath as Ie, nameFromPath as Le, normalizeSkillName as Re, parseSkillManifest as ze, skillFileBytesToBlob as Be, startsWithFrontmatterBlock as Ve, unpackSkillArchive as He } from "./skill/skill.js";
|
|
28
|
+
import { PUBLIC_SKILL_BUCKET as Ue, SKILL_LISTING_MAX_PAGES as We, SKILL_LISTING_PAGE_SIZE as Ge, SKILL_MANIFEST_MAX_BYTES as Ke, SkillSource as qe, parseSkillResourceUrl as Je } from "./skill/skill-types.js";
|
|
29
|
+
import { buildSkillContentTree as Ye, buildSkillOverview as Xe, mapSkillToCatalogItem as Ze, readSkillFileBytes as Qe, readSkillFilePreviewBytes as $e, readSkillManifest as et, resolveSkillFileDownloadPath as tt, resolveSkillManifestFileId as nt } from "./catalog/map-skill-to-catalog-item.js";
|
|
30
|
+
import { McpResourceKind as rt, buildApplicationMcpUrl as it, buildConnectApi as at, buildToolsetMcpUrl as ot, resolveMcpResourceKind as st } from "./catalog/mcp-endpoint-url.js";
|
|
31
|
+
import { getPublicCatalogEntityFolderPath as ct, isPublicCatalogEntityId as lt, mapPublishConversationResultDto as ut, mapPublishHistoryEntryDto as dt, toPublishEntityType as ft } from "./catalog/publish.js";
|
|
32
|
+
import { deriveAvailableTabIds as pt, deriveFavoriteItems as mt, filterCatalogItemsBySelector as ht, filterHiddenOwnedItems as gt, reconcileFilterTopics as _t } from "./catalog/catalog-derivations.js";
|
|
33
|
+
import { CatalogPrimaryActionType as vt, resolveCatalogPrimaryAction as yt } from "./catalog/catalog-primary-action.js";
|
|
34
|
+
import { useCatalogEditNavigation as bt } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
35
|
+
import { parseSkillManifestDocument as xt } from "./skill/skill-manifest.js";
|
|
36
|
+
import { useSkillItemDetails as St } from "./catalog/useSkillItemDetails.js";
|
|
37
|
+
import { useCatalogItemDetails as Ct } from "./catalog/useCatalogItemDetails.js";
|
|
38
|
+
import { emitToolsetLoginSuccess as wt, subscribeToolsetLoginSuccess as Tt } from "./shared/toolset-login-events.js";
|
|
39
|
+
import { getToolsetOAuthChannelName as Et, waitForToolsetOAuthResult as Dt } from "./oauth/handshake.js";
|
|
40
|
+
import { buildToolsetAuthorizeUrl as Ot, getToolsetRedirectUri as kt } from "./oauth/authorize-url.js";
|
|
41
|
+
import { initiateOAuthLogin as At, navigateToolsetOAuthPopup as jt, openToolsetOAuthPopup as Mt } from "./oauth/popup.js";
|
|
42
|
+
import { ToolsetLoginOutcomeType as Nt, useToolsetLogin as Pt } from "./oauth/useToolsetLogin/useToolsetLogin.js";
|
|
43
|
+
import { useCatalogToolsetCredentials as Ft } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
44
|
+
import { useApplicationCredentials as It } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
|
|
45
|
+
import { useSkillDetailsPanelData as Lt } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
46
|
+
import { FavoriteEntityType as Rt, useFavoriteEntitiesState as zt } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
47
|
+
import { usePublishFolders as Bt } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
48
|
+
import { buildAnnouncementSignature as Vt, hasAnnouncementContent as Ht, hasStructuredAnnouncement as Ut, sanitizeAnnouncementHtml as Wt, sanitizeAnnouncementMessageHtml as Gt } from "./conversation/announcement-message.js";
|
|
49
|
+
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as Kt, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as qt, DEFAULT_STREAM_IDLE_TIMEOUT_MS as Jt, GenerationConflictError as Yt, GenerationPersistenceError as Xt, StreamInterruptedError as Zt, StreamUpstreamError as Qt, createChatStreamApi as $t } from "./conversation/create-chat-stream-api.js";
|
|
50
|
+
import { shouldWatchForDisplayNameUpdate as en } from "./conversation/display-name-watch.js";
|
|
51
|
+
import { formatAppVersion as tn, sanitizeFooterHtml as nn } from "./conversation/footer-message.js";
|
|
52
|
+
import { getModelIdFromConversationId as rn } from "./conversation/get-model-id-from-conversation-id.js";
|
|
53
|
+
import { getTimeOfDayGreeting as an } from "./conversation/greeting.js";
|
|
54
|
+
import { createDeploymentChangedMessage as on } from "./conversation/message-factory.js";
|
|
55
|
+
import { getFormSchemaToolSyncKey as sn, getLastDeploymentId as cn, getLastUserMessageToolConfiguration as ln, getLatestToolConfiguration as un, getToolConfigurationFromFormSchema as dn, isMessageStreaming as fn, messageHasStages as pn, normalizeResponseFormat as mn } from "./conversation/message-utils.js";
|
|
56
|
+
import { toOverlayMessages as hn } from "./conversation/overlay-messages.js";
|
|
57
|
+
import { getQuickAppConversationStarters as gn } from "./conversation/quick-app-conversation-starters.js";
|
|
58
|
+
import { mapStages as _n, toStage as vn } from "./conversation/stage.js";
|
|
59
|
+
import { getStarterPopulateText as yn, getStartersFromSchema as bn } from "./conversation/starter-option.js";
|
|
60
|
+
import { useOAuthCallbackCompletion as xn } from "./oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js";
|
|
61
|
+
import { buildPromptExportEnvelope as Sn, buildPromptExportFileName as Cn, serializePromptExport as wn } from "./prompt/export-prompt.js";
|
|
62
|
+
import { PROMPT_CONTENT_MAX_LENGTH as Tn, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as En, PROMPT_DESCRIPTION_MAX_LENGTH as Dn, PROMPT_NAME_MAX_LENGTH as On, PromptFieldError as kn, buildPromptPath as An, getRemainingCharacters as jn, validatePromptContent as Mn, validatePromptDescription as Nn, validatePromptName as Pn } from "./prompt/prompt.js";
|
|
63
|
+
import { usePromptsState as Fn } from "./prompt/usePromptsState/usePromptsState.js";
|
|
64
|
+
import { UnsupportedTriggerReason as In } from "./scheduled-task/scheduled-task-mapping.js";
|
|
65
|
+
import { ScheduledTaskTriggerDescriptionKind as Ln, describeScheduledTaskTrigger as Rn } from "./scheduled-task/scheduled-task-description.js";
|
|
66
|
+
import { apSchedulerDayToJsDay as zn, jsDayToApSchedulerDay as Bn } from "./shared/cron-weekday.js";
|
|
67
|
+
import { mapFormValuesToCreateBody as Vn, mapFormValuesToUpdateBody as Hn, mapScheduledTaskDtoToFormValues as Un } from "./scheduled-task/scheduled-task-trigger.js";
|
|
68
|
+
import { prepareScheduledTaskCreateBody as Wn, prepareScheduledTaskUpdateBody as Gn } from "./scheduled-task/scheduled-task-preparation.js";
|
|
69
|
+
import { createScheduledTasksApiClient as Kn } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
70
|
+
import { useScheduledTasks as qn } from "./scheduled-task/use-scheduled-tasks.js";
|
|
71
|
+
import { mergeRunsById as Jn, useScheduledTaskRuns as Yn } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
72
|
+
import { validateSkillFileBatch as Xn } from "./skill/skill-file-batch-validation.js";
|
|
73
|
+
import { skillFileToAttachment as Zn } from "./skill/skill-file-preview.js";
|
|
74
|
+
import { SkillEditorLoadState as Qn, useSkillEditorLoad as $n } from "./skill/useSkillEditorLoad.js";
|
|
75
|
+
import { useSkillEditorSubmit as er } from "./skill/useSkillEditorSubmit.js";
|
|
76
|
+
import { useSkillFileActions as tr } from "./skill/useSkillFileActions.js";
|
|
77
|
+
import { SkillPreviewErrorKind as nr, useSkillFilePreview as rr } from "./skill/useSkillFilePreview.js";
|
|
78
|
+
import { useSkillsState as ir } from "./skill/useSkillsState/useSkillsState.js";
|
|
79
|
+
import { SkillArchiveImportErrorKind as ar, SkillArchiveImportStatus as or, SkillArchiveSelectionRejectionReason as sr, classifySkillArchiveImportError as cr, useSkillArchiveImport as lr } from "./skill/useSkillArchiveImport/useSkillArchiveImport.js";
|
|
80
|
+
import { RecipientsCountStatus as ur, useShareRecipientsCount as dr } from "./useShareRecipientsCount/useShareRecipientsCount.js";
|
|
81
|
+
import { deriveConversationRowActionState as fr } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
82
|
+
import { useActiveConversationSync as pr } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
83
|
+
import { useAsyncConfirmDialog as mr } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
84
|
+
import { useConversationLookupMaps as hr } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
85
|
+
import { getConversationSource as gr, useConversationPanelItems as _r } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
86
|
+
import { useImportFilePicker as vr } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
87
|
+
import { useMessageSelectionReply as yr } from "./conversation/useMessageSelectionReply/useMessageSelectionReply.js";
|
|
88
|
+
import { sanitizeFileName as br, splitFileNameExtension as xr, trimFileNameToByteLimit as Sr } from "./files/file-name.js";
|
|
89
|
+
import { useAttachmentUpload as Cr } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
90
|
+
import { AudioTranscriptionError as wr, AudioTranscriptionErrorReason as Tr } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
91
|
+
import { useTranscribeAudio as Er } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
92
|
+
import { DEFAULT_MAX_ARCHIVE_BYTES as Dr, useConversationExport as Or } from "./conversation/useConversationExport/useConversationExport.js";
|
|
93
|
+
import { attachmentToDto as kr, attachmentsToDtos as Ar } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
94
|
+
import { createMessagePair as jr } from "./conversation/useConversationHandlers/message-factory.js";
|
|
95
|
+
import { hasActiveToolConfig as Mr, isAnswerIncomplete as Nr, isMessageChanged as Pr, shouldRerunGenerationOnEdit as Fr } from "./conversation/useConversationHandlers/message-utils.js";
|
|
96
|
+
import { getStarterConversationText as Ir, getStarterDisplayText as Lr, getStarterSubmitText as Rr } from "./conversation/useConversationHandlers/starter-option.js";
|
|
97
|
+
import { getConversationPath as zr } from "./conversation/useConversationStream/conversation-path.js";
|
|
98
|
+
import { useConversationHandlers as Br } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
99
|
+
import { useConversationImport as Vr } from "./conversation/useConversationImport/useConversationImport.js";
|
|
100
|
+
import { useConversationScroll as Hr } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
101
|
+
import { applyChunkToMessages as Ur, mergeStages as Wr } from "./conversation/useConversationStream/apply-chunk.js";
|
|
102
|
+
import { isAwaitingGenerationResume as Gr } from "./conversation/useConversationStream/generation-resume.js";
|
|
103
|
+
import { useConversationStream as Kr } from "./conversation/useConversationStream/useConversationStream.js";
|
|
104
|
+
import { useConversationSources as qr } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
|
105
|
+
import { DialFilesApiUploadMode as Jr } from "./files/dial-files-api.js";
|
|
106
|
+
import { FileManagerNotificationReason as Yr, FileNameValidationErrorReason as Xr, FileOperationKind as Zr } from "./files/dial-file-manager.types.js";
|
|
107
|
+
import { COLUMNS_WITHOUT_AUTHOR as Qr, COLUMNS_WITH_AUTHOR as $r, CORE_PERMISSION_MAP as ei, DATE_OPTIONS as ti, DIAL_FILE_MANAGER_SECTION_TABS as ni, PATH_SEPARATOR_REGEXP as ri, RESERVED_MARKER_NAME as ii, UPLOAD_CONCURRENCY as ai } from "./files/dial-file-manager.model.js";
|
|
108
|
+
import { DialFileManagerActionProfile as oi, DialFileManagerVariant as si, deriveActionProfile as ci } from "./files/file-manager-variant.js";
|
|
109
|
+
import { buildSharedItemVirtualPath as li, dialCorePathToRelative as ui, findDialFileByPath as di, findFolderByVirtualPath as fi, formatOperationFolderName as pi, getVirtualPathName as mi, hasDialFileWritePermission as hi, hasForbiddenNameSymbols as gi, hasSamePaths as _i, isCopyMoveDuplicateAllowed as vi, isShareActionsAllowed as yi, normalizeVirtualPath as bi, parseNewFolderVirtualPath as xi, resolveOwnerCoords as Si, resolveSectionByPath as Ci, unionPathSets as wi, withRoutableRootLabels as Ti } from "./files/dial-file-manager-path.util.js";
|
|
110
|
+
import { getParentFolderPath as Ei, resolveDialFileApiPath as Di, virtualPathToApiPath as Oi } from "./files/resolve-dial-file-api-path.js";
|
|
111
|
+
import { prepareCopyItems as ki, prepareMoveRenameItems as Ai } from "./files/dial-file-manager-copy-move.util.js";
|
|
112
|
+
import { buildFromCache as ji, fetchByTab as Mi, fetchForSearch as Ni, findFirstSuccessfulCopyMoveItem as Pi, mapCorePermissions as Fi, mapFileMetadataToDialFile as Ii, mapSearchItem as Li, mergeCreatedFolderIntoCache as Ri, updateEntry as zi } from "./files/dial-file-manager-mapping.util.js";
|
|
113
|
+
import { createFilesApiClient as Bi } from "./files/create-files-api.js";
|
|
114
|
+
import { createUploadFileWithProgress as Vi } from "./files/create-upload-file-with-progress.js";
|
|
115
|
+
import { openAnnotationAttachment as Hi } from "./files/annotation.js";
|
|
116
|
+
import { annotationToOoxmlCanvasContent as Ui, annotationToPdfCanvasContent as Wi, clearAttachmentCache as Gi, hasAttachmentTextSource as Ki, referenceAttachmentToPdfCanvasContent as qi, resolveCodeCanvasContent as Ji, resolveGroupedVisualizerCanvasContent as Yi, resolveHtmlCanvasContent as Xi, resolveImageCanvasContent as Zi, resolveJsonCanvasContent as Qi, resolveMarkdownCanvasContent as $i, resolveOoxmlCanvasContent as ea, resolvePdfCanvasContent as ta, resolveTextCanvasContent as na, resolveVisualizerCanvasContent as ra } from "./files/attachment-canvas.js";
|
|
117
|
+
import { getUrlFileName as ia, isExternalSourcePreviewable as aa, resolveExternalSourceContentType as oa } from "./files/source-content.js";
|
|
118
|
+
import { annotationToDisplayAttachment as sa, attachmentDtoToDisplayAttachment as ca, attachmentDtosToDisplayAttachments as la } from "./files/attachment-dto-to-display.js";
|
|
119
|
+
import { dialFileToAttachment as ua, dialFilesToAttachments as da, dialFolderPathToAttachment as fa } from "./files/dial-file-to-attachment.js";
|
|
120
|
+
import { DownloadDestinationType as pa } from "./files/download-destination.js";
|
|
121
|
+
import { prepareDownloadDestination as ma } from "./files/prepare-download-destination.js";
|
|
122
|
+
import { useDialFileListing as ha } from "./files/useDialFileListing/useDialFileListing.js";
|
|
123
|
+
import { useDialFileMetadata as ga } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
124
|
+
import { useDialFileMutations as _a } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
125
|
+
import { useDialFileSharing as va } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
126
|
+
import { useDialFileUploadBatch as ya } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
127
|
+
import { useDialFileManager as ba } from "./files/useDialFileManager/useDialFileManager.js";
|
|
128
|
+
import { useDialFileManagerSections as xa } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
129
|
+
import { useDialFileManagerTabConfig as Sa } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
130
|
+
import { useFileAttachmentPicker as Ca } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
131
|
+
import { isCustomAppSchema as wa, isQuickAppSchema as Ta } from "./shared/application-schema.js";
|
|
132
|
+
import { getBrowserTimezone as Ea } from "./shared/browser-timezone.js";
|
|
133
|
+
import { isValidAbsoluteUrl as Da, isValidFeaturesData as Oa, parseFeaturesData as ka } from "./shared/custom-apps.js";
|
|
134
|
+
import { buildExternalServiceScopeId as Aa, getExternalServiceFallbackName as ja, parseExternalServiceUrl as Ma } from "./shared/external-services.js";
|
|
135
|
+
import { useChatSettingsFormConfig as Na } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
136
|
+
import { usePageFileDrag as Pa } from "./usePageFileDrag/usePageFileDrag.js";
|
|
137
|
+
import { useViewportWidth as Fa } from "./useViewportWidth/useViewportWidth.js";
|
|
138
|
+
import { usePanelMaxWidth as Ia } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
139
|
+
import { useShareLink as La } from "./useShareLink/useShareLink.js";
|
|
140
|
+
import { useToolsMenu as Ra } from "./useToolsMenu/useToolsMenu.js";
|
|
141
|
+
import { USAGE_DATA_I18N_KEYS as za, mapUsageDataToDashboard as Ba } from "./usage/map-usage-data-to-dashboard.js";
|
|
142
|
+
import { USAGE_MODEL_LIMITS_I18N_KEYS as Va, mapOverallCostLimitsToPeriodStatuses as Ha, mapUserUsageToModelLimits as Ua } from "./usage/map-user-usage-to-model-limits.js";
|
|
143
|
+
import { useUsageData as Wa } from "./usage/useUsageData/useUsageData.js";
|
|
144
|
+
import { McpAppResourceFetchError as Ga, createMcpAppsApiClient as Ka } from "./mcp-apps/mcp-apps-api-client.js";
|
|
145
|
+
import { useMcpAppTools as qa } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
146
|
+
import { useMcpAppHostContext as Ja } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
147
|
+
import { useMcpAppHostAdapter as Ya } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
148
|
+
import { useOpenMcpAppCanvas as Xa } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
149
|
+
import { useGridEditingScroll as Za } from "@epam/ai-dial-chat-shared";
|
|
150
|
+
export { x as AttachmentValidationErrorReason, wr as AudioTranscriptionError, Tr as AudioTranscriptionErrorReason, B as AuthenticationType, Qr as COLUMNS_WITHOUT_AUTHOR, $r as COLUMNS_WITH_AUTHOR, ei as CORE_PERMISSION_MAP, vt as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, ti as DATE_OPTIONS, Kt as DEFAULT_GENERATION_CONFLICT_MESSAGE, qt as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, Dr as DEFAULT_MAX_ARCHIVE_BYTES, Jt as DEFAULT_STREAM_IDLE_TIMEOUT_MS, ni as DIAL_FILE_MANAGER_SECTION_TABS, oi as DialFileManagerActionProfile, si as DialFileManagerVariant, Jr as DialFilesApiUploadMode, pa as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, Rt as FavoriteEntityType, Yr as FileManagerNotificationReason, Xr as FileNameValidationErrorReason, Zr as FileOperationKind, Yt as GenerationConflictError, Xt as GenerationPersistenceError, Ga as McpAppResourceFetchError, rt as McpResourceKind, U as OAuthResourceKind, ri as PATH_SEPARATOR_REGEXP, Tn as PROMPT_CONTENT_MAX_LENGTH, En as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, Dn as PROMPT_DESCRIPTION_MAX_LENGTH, On as PROMPT_NAME_MAX_LENGTH, Ue as PUBLIC_SKILL_BUCKET, kn as PromptFieldError, xe as PromptSource, ii as RESERVED_MARKER_NAME, ur as RecipientsCountStatus, Ee as SKILL_FILE_UPLOAD_MAX_BYTES, We as SKILL_LISTING_MAX_PAGES, Ge as SKILL_LISTING_PAGE_SIZE, De as SKILL_MANIFEST_FILE, Ke as SKILL_MANIFEST_MAX_BYTES, Oe as SKILL_TEXT_FIELD_MAX_LENGTHS, ke as SKILL_UPLOAD_MAX_FILES, Ae as SKILL_UPLOAD_MAX_TOTAL_BYTES, Ln as ScheduledTaskTriggerDescriptionKind, ar as SkillArchiveImportErrorKind, or as SkillArchiveImportStatus, sr as SkillArchiveSelectionRejectionReason, Qn as SkillEditorLoadState, nr as SkillPreviewErrorKind, qe as SkillSource, Zt as StreamInterruptedError, Qt as StreamUpstreamError, W as TOOLSET_REDIRECT_STATE_KEY, G as ToolsetAuthStatus, K as ToolsetAuthTypes, q as ToolsetCredentialsLevel, Nt as ToolsetLoginOutcomeType, J as ToolsetOAuthCallbackQuery, Y as ToolsetOAuthChannelControlType, X as ToolsetOAuthFailureReason, Z as ToolsetOAuthInitiationResultType, Q as ToolsetOAuthResultType, ai as UPLOAD_CONCURRENCY, za as USAGE_DATA_I18N_KEYS, Va as USAGE_MODEL_LIMITS_I18N_KEYS, In as UnsupportedTriggerReason, $ as WithLogin, sa as annotationToDisplayAttachment, Ui as annotationToOoxmlCanvasContent, Wi as annotationToPdfCanvasContent, zn as apSchedulerDayToJsDay, oe as appendLocaleCode, Ur as applyChunkToMessages, ca as attachmentDtoToDisplayAttachment, la as attachmentDtosToDisplayAttachments, kr as attachmentToDto, Ar as attachmentsToDtos, se as buildAdditionalLocaleOptions, Vt as buildAnnouncementSignature, it as buildApplicationMcpUrl, N as buildChatCompletionsUrl, at as buildConnectApi, P as buildDeploymentConnectApi, Aa as buildExternalServiceScopeId, ji as buildFromCache, Sn as buildPromptExportEnvelope, Cn as buildPromptExportFileName, Ce as buildPromptOverview, An as buildPromptPath, F as buildResponsesUrl, li as buildSharedItemVirtualPath, Ye as buildSkillContentTree, je as buildSkillFilesPayload, Me as buildSkillManifest, Ne as buildSkillManifestForSubmit, Pe as buildSkillManifestFromFrontmatter, Xe as buildSkillOverview, Ot as buildToolsetAuthorizeUrl, ot as buildToolsetMcpUrl, cr as classifySkillArchiveImportError, Gi as clearAttachmentCache, ce as composeLocalePayload, $t as createChatStreamApi, i as createCsrfMiddleware, on as createDeploymentChangedMessage, Bi as createFilesApiClient, Ka as createMcpAppsApiClient, jr as createMessagePair, j as createPublishApiClient, Kn as createScheduledTasksApiClient, a as createUnauthorizedMiddleware, Vi as createUploadFileWithProgress, I as decodeDeploymentId, ee as decodeToolsetId, le as decomposeLocalizedFields, ci as deriveActionProfile, pt as deriveAvailableTabIds, fr as deriveConversationRowActionState, mt as deriveFavoriteItems, Rn as describeScheduledTaskTrigger, ui as dialCorePathToRelative, ua as dialFileToAttachment, da as dialFilesToAttachments, fa as dialFolderPathToAttachment, m as downloadAttachment, wt as emitToolsetLoginSuccess, L as encodeDeploymentId, te as encodeToolsetId, Mi as fetchByTab, Ni as fetchForSearch, ht as filterCatalogItemsBySelector, gt as filterHiddenOwnedItems, R as findDeploymentByIdOrReference, di as findDialFileByPath, Pi as findFirstSuccessfulCopyMoveItem, fi as findFolderByVirtualPath, tn as formatAppVersion, fe as formatCalendarDate, C as formatDateYM, w as formatDateYMD, pi as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Ea as getBrowserTimezone, zr as getConversationPath, gr as getConversationSource, ja as getExternalServiceFallbackName, sn as getFormSchemaToolSyncKey, cn as getLastDeploymentId, ln as getLastUserMessageToolConfiguration, un as getLatestToolConfiguration, rn as getModelIdFromConversationId, Ei as getParentFolderPath, ct as getPublicCatalogEntityFolderPath, gn as getQuickAppConversationStarters, jn as getRemainingCharacters, Fe as getSkillFieldLengthViolations, Ir as getStarterConversationText, Lr as getStarterDisplayText, yn as getStarterPopulateText, Rr as getStarterSubmitText, bn as getStartersFromSchema, an as getTimeOfDayGreeting, dn as getToolConfigurationFromFormSchema, Et as getToolsetOAuthChannelName, kt as getToolsetRedirectUri, ia as getUrlFileName, mi as getVirtualPathName, Mr as hasActiveToolConfig, Ht as hasAnnouncementContent, Ki as hasAttachmentTextSource, hi as hasDialFileWritePermission, gi as hasForbiddenNameSymbols, _i as hasSamePaths, Ut as hasStructuredAnnouncement, o as includesIgnoreCase, At as initiateOAuthLogin, Nr as isAnswerIncomplete, Gr as isAwaitingGenerationResume, r as isConversationNotFoundError, vi as isCopyMoveDuplicateAllowed, wa as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, aa as isExternalSourcePreviewable, Pr as isMessageChanged, fn as isMessageStreaming, we as isOrganisationPromptItem, lt as isPublicCatalogEntityId, ne as isPublicToolsetId, Ta as isQuickAppSchema, yi as isShareActionsAllowed, Da as isValidAbsoluteUrl, Oa as isValidFeaturesData, Ie as isValidSkillRelativePath, Bn as jsDayToApSchedulerDay, Fi as mapCorePermissions, me as mapDeploymentDetailsDtoToEntityDetails, V as mapDeploymentLimitsDtoToCatalogLimits, H as mapDeploymentLimitsToInput, _e as mapDeploymentToCatalogItem, ve as mapDeploymentToolsetCredentials, he as mapEntityDetailsToCatalogDetails, Ii as mapFileMetadataToDialFile, Vn as mapFormValuesToCreateBody, Hn as mapFormValuesToUpdateBody, Ha as mapOverallCostLimitsToPeriodStatuses, Te as mapPromptToCatalogItem, ut as mapPublishConversationResultDto, dt as mapPublishHistoryEntryDto, Un as mapScheduledTaskDtoToFormValues, Li as mapSearchItem, Ze as mapSkillToCatalogItem, _n as mapStages, ge as mapToolsetCredentials, ye as mapToolsetToCatalogItem, Ba as mapUsageDataToDashboard, Ua as mapUserUsageToModelLimits, Ri as mergeCreatedFolderIntoCache, Jn as mergeRunsById, Wr as mergeStages, pn as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, Le as nameFromPath, jt as navigateToolsetOAuthPopup, z as normalizeDeploymentId, mn as normalizeResponseFormat, Re as normalizeSkillName, re as normalizeToolsetId, bi as normalizeVirtualPath, Hi as openAnnotationAttachment, Mt as openToolsetOAuthPopup, pe as padTwoDigits, Ma as parseExternalServiceUrl, ka as parseFeaturesData, xi as parseNewFolderVirtualPath, Se as parsePromptResourceUrl, ze as parseSkillManifest, xt as parseSkillManifestDocument, Je as parseSkillResourceUrl, ki as prepareCopyItems, ma as prepareDownloadDestination, Ai as prepareMoveRenameItems, Wn as prepareScheduledTaskCreateBody, Gn as prepareScheduledTaskUpdateBody, Qe as readSkillFileBytes, $e as readSkillFilePreviewBytes, et as readSkillManifest, _t as reconcileFilterTopics, qi as referenceAttachmentToPdfCanvasContent, yt as resolveCatalogPrimaryAction, Ji as resolveCodeCanvasContent, be as resolveDeploymentFolder, Di as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, oa as resolveExternalSourceContentType, Yi as resolveGroupedVisualizerCanvasContent, Xi as resolveHtmlCanvasContent, Zi as resolveImageCanvasContent, Qi as resolveJsonCanvasContent, ue as resolveLocalizedText, $i as resolveMarkdownCanvasContent, st as resolveMcpResourceKind, ea as resolveOoxmlCanvasContent, Si as resolveOwnerCoords, ta as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Ci as resolveSectionByPath, tt as resolveSkillFileDownloadPath, nt as resolveSkillManifestFileId, na as resolveTextCanvasContent, ie as resolveToolsetCredentialsLevel, ra as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Wt as sanitizeAnnouncementHtml, Gt as sanitizeAnnouncementMessageHtml, br as sanitizeFileName, nn as sanitizeFooterHtml, ae as selectToolsetAuthStatus, wn as serializePromptExport, Fr as shouldRerunGenerationOnEdit, en as shouldWatchForDisplayNameUpdate, Be as skillFileBytesToBlob, Zn as skillFileToAttachment, xr as splitFileNameExtension, Ve as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, Tt as subscribeToolsetLoginSuccess, de as toBaseLocale, hn as toOverlayMessages, ft as toPublishEntityType, M as toPublishRuleDto, vn as toStage, Sr as trimFileNameToByteLimit, wi as unionPathSets, He as unpackSkillArchive, zi as updateEntry, pr as useActiveConversationSync, It as useApplicationCredentials, mr as useAsyncConfirmDialog, g as useAttachmentAction, Cr as useAttachmentUpload, S as useAttachmentValidation, bt as useCatalogEditNavigation, Ct as useCatalogItemDetails, Ft as useCatalogToolsetCredentials, Na as useChatSettingsFormConfig, Or as useConversationExport, Br as useConversationHandlers, Vr as useConversationImport, hr as useConversationLookupMaps, _r as useConversationPanelItems, Hr as useConversationScroll, qr as useConversationSources, Kr as useConversationStream, ha as useDialFileListing, ba as useDialFileManager, xa as useDialFileManagerSections, Sa as useDialFileManagerTabConfig, ga as useDialFileMetadata, _a as useDialFileMutations, va as useDialFileSharing, ya as useDialFileUploadBatch, zt as useFavoriteEntitiesState, Ca as useFileAttachmentPicker, Za as useGridEditingScroll, vr as useImportFilePicker, Ya as useMcpAppHostAdapter, Ja as useMcpAppHostContext, qa as useMcpAppTools, yr as useMessageSelectionReply, xn as useOAuthCallbackCompletion, Xa as useOpenMcpAppCanvas, Pa as usePageFileDrag, Ia as usePanelMaxWidth, Fn as usePromptsState, Bt as usePublishFolders, Yn as useScheduledTaskRuns, qn as useScheduledTasks, La as useShareLink, dr as useShareRecipientsCount, lr as useSkillArchiveImport, Lt as useSkillDetailsPanelData, $n as useSkillEditorLoad, er as useSkillEditorSubmit, tr as useSkillFileActions, rr as useSkillFilePreview, St as useSkillItemDetails, ir as useSkillsState, Ra as useToolsMenu, Pt as useToolsetLogin, Er as useTranscribeAudio, Wa as useUsageData, Fa as useViewportWidth, Mn as validatePromptContent, Nn as validatePromptDescription, Pn as validatePromptName, Xn as validateSkillFileBatch, Oi as virtualPathToApiPath, Dt as waitForToolsetOAuthResult, Ti as withRoutableRootLabels };
|
|
@@ -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. */
|
package/oauth/toolset-id.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { ToolsetCredentialsLevel as e } from "./types.js";
|
|
2
|
+
import { PUBLIC_BUCKET as t } from "@epam/ai-dial-chat-shared";
|
|
1
3
|
//#region src/oauth/toolset-id.ts
|
|
2
|
-
var
|
|
4
|
+
var n = "toolsets/", r = (e) => e.split("/").map((e) => encodeURIComponent(e)).join("/"), i = (e) => e.split("/").map((e) => {
|
|
3
5
|
try {
|
|
4
6
|
return decodeURIComponent(e);
|
|
5
7
|
} catch {
|
|
6
8
|
return e;
|
|
7
9
|
}
|
|
8
|
-
}).join("/"),
|
|
10
|
+
}).join("/"), a = (e) => e.startsWith(n) ? e.slice(9).split("/")[0] === t : !1, o = (e) => r(i(e)), s = (t) => a(t) ? e.User : e.Global, c = (t, n) => n === e.User ? t?.userLevelAuthStatus : t?.globalAuthStatus;
|
|
9
11
|
//#endregion
|
|
10
|
-
export {
|
|
12
|
+
export { i as decodeToolsetId, r as encodeToolsetId, a as isPublicToolsetId, o as normalizeToolsetId, s as resolveToolsetCredentialsLevel, c as selectToolsetAuthStatus };
|