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