@epam/ai-dial-chat-hooks 1.0.0 → 1.0.2
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.d.ts +18 -0
- package/api-error/api-error.d.ts.map +1 -0
- package/api-transport/create-csrf-middleware.d.ts +15 -0
- package/api-transport/create-csrf-middleware.d.ts.map +1 -0
- package/api-transport/create-unauthorized-middleware.d.ts +40 -0
- package/api-transport/create-unauthorized-middleware.d.ts.map +1 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -2
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +1 -1
- package/catalog/catalog-derivations.d.ts +27 -0
- package/catalog/catalog-derivations.d.ts.map +1 -0
- package/catalog/catalog-primary-action.d.ts +47 -0
- package/catalog/catalog-primary-action.d.ts.map +1 -0
- package/catalog/create-publish-api.d.ts +32 -0
- package/catalog/create-publish-api.d.ts.map +1 -0
- package/catalog/deployment-endpoint-url.d.ts +19 -0
- package/catalog/deployment-endpoint-url.d.ts.map +1 -0
- package/catalog/deployment-id.d.ts +21 -0
- package/catalog/deployment-id.d.ts.map +1 -0
- package/catalog/entity-details.d.ts +132 -0
- package/catalog/entity-details.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts +33 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.d.ts +15 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-to-catalog-item.d.ts +60 -0
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-entity-details-to-catalog.d.ts +23 -0
- package/catalog/map-entity-details-to-catalog.d.ts.map +1 -0
- package/catalog/map-prompt-to-catalog-item.d.ts +43 -0
- package/catalog/map-prompt-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-skill-to-catalog-item.d.ts +87 -0
- package/catalog/map-skill-to-catalog-item.d.ts.map +1 -0
- package/catalog/mcp-endpoint-url.d.ts +18 -0
- package/catalog/mcp-endpoint-url.d.ts.map +1 -0
- package/catalog/publish.d.ts +17 -0
- package/catalog/publish.d.ts.map +1 -0
- package/catalog/useCatalogItemDetails.d.ts +73 -0
- package/catalog/useCatalogItemDetails.d.ts.map +1 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +37 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +1 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts +71 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +34 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -1
- package/conversation/conversation-transfer/queue.d.ts +1 -1
- package/conversation/conversation-transfer/queue.d.ts.map +1 -1
- package/conversation/conversation-transfer/types.d.ts +0 -27
- package/conversation/conversation-transfer/types.d.ts.map +1 -1
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +39 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +1 -0
- package/conversation/display-name-watch.d.ts +4 -0
- package/conversation/display-name-watch.d.ts.map +1 -0
- package/conversation/footer-message.d.ts +10 -0
- package/conversation/footer-message.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.d.ts +27 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/greeting.d.ts +18 -0
- package/conversation/greeting.d.ts.map +1 -0
- package/conversation/message-factory.d.ts +7 -0
- package/conversation/message-factory.d.ts.map +1 -0
- package/conversation/message-utils.d.ts +27 -0
- package/conversation/message-utils.d.ts.map +1 -0
- package/conversation/overlay-messages.d.ts +5 -0
- package/conversation/overlay-messages.d.ts.map +1 -0
- package/conversation/quick-app-conversation-starters.d.ts +10 -0
- package/conversation/quick-app-conversation-starters.d.ts.map +1 -0
- package/conversation/starter-option.d.ts +21 -0
- package/conversation/starter-option.d.ts.map +1 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +34 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +37 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +1 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +2 -1
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +1 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +2 -1
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +58 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- package/conversation/useConversationStream/conversation-path.d.ts +0 -2
- package/conversation/useConversationStream/conversation-path.d.ts.map +1 -1
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts +32 -0
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +1 -0
- package/files/annotation.d.ts +10 -0
- package/files/annotation.d.ts.map +1 -0
- package/files/attachment-canvas.d.ts +90 -0
- package/files/attachment-canvas.d.ts.map +1 -0
- package/files/attachment-dto-to-display.d.ts +10 -0
- package/files/attachment-dto-to-display.d.ts.map +1 -0
- package/files/attachment-types.d.ts +14 -0
- package/files/attachment-types.d.ts.map +1 -0
- package/files/create-files-api.d.ts +52 -0
- package/files/create-files-api.d.ts.map +1 -0
- package/files/create-upload-file-with-progress.d.ts +24 -0
- package/files/create-upload-file-with-progress.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts +1 -1
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
- package/files/dial-file-manager-path.util.d.ts.map +1 -1
- package/files/dial-file-manager.types.d.ts +2 -5
- package/files/dial-file-manager.types.d.ts.map +1 -1
- package/files/dial-file-to-attachment.d.ts +26 -0
- package/files/dial-file-to-attachment.d.ts.map +1 -0
- package/files/dial-file.d.ts +17 -0
- package/files/dial-file.d.ts.map +1 -0
- package/files/file-manager-variant.d.ts +2 -20
- package/files/file-manager-variant.d.ts.map +1 -1
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/resolve-dial-file-api-path.d.ts +1 -5
- package/files/resolve-dial-file-api-path.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +1 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -1
- package/index.d.ts +82 -3
- package/index.d.ts.map +1 -1
- package/index.js +17933 -2128
- package/oauth/authorize-url.d.ts +16 -0
- package/oauth/authorize-url.d.ts.map +1 -0
- package/oauth/handshake.d.ts +30 -0
- package/oauth/handshake.d.ts.map +1 -0
- package/oauth/models.d.ts +74 -0
- package/oauth/models.d.ts.map +1 -0
- package/oauth/popup.d.ts +30 -0
- package/oauth/popup.d.ts.map +1 -0
- package/oauth/toolset-id.d.ts +23 -0
- package/oauth/toolset-id.d.ts.map +1 -0
- package/oauth/types.d.ts +84 -0
- package/oauth/types.d.ts.map +1 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +54 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +1 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +72 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/package.json +20 -9
- package/prompt/export-prompt.d.ts +31 -0
- package/prompt/export-prompt.d.ts.map +1 -0
- package/prompt/prompt-resource.d.ts +30 -0
- package/prompt/prompt-resource.d.ts.map +1 -0
- package/prompt/prompt.d.ts +34 -0
- package/prompt/prompt.d.ts.map +1 -0
- package/prompt/usePromptsState/usePromptsState.d.ts +34 -0
- package/prompt/usePromptsState/usePromptsState.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-mapping.d.ts +19 -0
- package/scheduled-task/scheduled-task-mapping.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-trigger.d.ts +27 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -0
- package/shared/application-schema.d.ts +10 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/browser-timezone.d.ts +7 -0
- package/shared/browser-timezone.d.ts.map +1 -0
- package/shared/cron-weekday.d.ts +5 -0
- package/shared/cron-weekday.d.ts.map +1 -0
- package/shared/custom-apps.d.ts +7 -0
- package/shared/custom-apps.d.ts.map +1 -0
- package/shared/external-services.d.ts +16 -0
- package/shared/external-services.d.ts.map +1 -0
- package/shared/formatting.d.ts +5 -0
- package/shared/formatting.d.ts.map +1 -0
- package/shared/locale.d.ts +45 -0
- package/shared/locale.d.ts.map +1 -0
- package/shared/string-utils.d.ts +9 -0
- package/shared/string-utils.d.ts.map +1 -0
- package/shared/toolset-login-events.d.ts +15 -0
- package/shared/toolset-login-events.d.ts.map +1 -0
- package/skill/skill-file-batch-validation.d.ts +70 -0
- package/skill/skill-file-batch-validation.d.ts.map +1 -0
- package/skill/skill-file-preview.d.ts +25 -0
- package/skill/skill-file-preview.d.ts.map +1 -0
- package/skill/skill-manifest.d.ts +28 -0
- package/skill/skill-manifest.d.ts.map +1 -0
- package/skill/skill-types.d.ts +42 -0
- package/skill/skill-types.d.ts.map +1 -0
- package/skill/skill.d.ts +114 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/useSkillEditorLoad.d.ts +74 -0
- package/skill/useSkillEditorLoad.d.ts.map +1 -0
- package/skill/useSkillEditorSubmit.d.ts +105 -0
- package/skill/useSkillEditorSubmit.d.ts.map +1 -0
- package/skill/useSkillFileActions.d.ts +53 -0
- package/skill/useSkillFileActions.d.ts.map +1 -0
- package/skill/useSkillFilePreview.d.ts +38 -0
- package/skill/useSkillFilePreview.d.ts.map +1 -0
- package/skill/useSkillsState/useSkillsState.d.ts +35 -0
- package/skill/useSkillsState/useSkillsState.d.ts.map +1 -0
- package/usage/useUsageData/useUsageData.d.ts +20 -0
- package/usage/useUsageData/useUsageData.d.ts.map +1 -0
- package/useShareLink/useShareLink.d.ts +2 -2
- package/useShareLink/useShareLink.d.ts.map +1 -1
- package/useToolsMenu/useToolsMenu.d.ts +7 -16
- package/useToolsMenu/useToolsMenu.d.ts.map +1 -1
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
- package/files/upload-batch.types.d.ts +0 -22
- package/files/upload-batch.types.d.ts.map +0 -1
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts +0 -27
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CatalogItemOverview, CatalogItem } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { PromptResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { PromptSource } from '../prompt/prompt-resource';
|
|
4
|
+
import { DeploymentFolderLabels } from './map-deployment-to-catalog-item';
|
|
5
|
+
/** Translated labels for the Overview tab's author/updated rows and section title. */
|
|
6
|
+
export interface PromptOverviewLabels {
|
|
7
|
+
authorLabel: string;
|
|
8
|
+
updatedLabel: string;
|
|
9
|
+
sectionTitle: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds the Overview tab data for a prompt: who authored it and when it last
|
|
13
|
+
* changed. The description is not repeated here — the Details tab already
|
|
14
|
+
* shows it above the body.
|
|
15
|
+
*/
|
|
16
|
+
export declare const buildPromptOverview: (prompt: PromptResponseDto, labels: PromptOverviewLabels) => CatalogItemOverview;
|
|
17
|
+
/**
|
|
18
|
+
* Whether a prompt item came from the organisation namespace, which the public
|
|
19
|
+
* prompt endpoints serve. Personal prompts resolve through the caller's own
|
|
20
|
+
* bucket, while shared prompts carry their owner's bucket in the resource URL.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isOrganisationPromptItem: (item: CatalogItem) => boolean;
|
|
23
|
+
/** Parameters for {@link mapPromptToCatalogItem}. */
|
|
24
|
+
export interface MapPromptToCatalogItemOptions {
|
|
25
|
+
/** Personal/Shared/Public folder labels; i18n stays at the app edge. */
|
|
26
|
+
folderLabels: DeploymentFolderLabels;
|
|
27
|
+
/** Author/updated/section-title labels for the Overview tab; i18n stays at the app edge. */
|
|
28
|
+
overviewLabels: PromptOverviewLabels;
|
|
29
|
+
/** Namespace the prompt came from; drives ownership flags and the folder prefix. */
|
|
30
|
+
source: PromptSource;
|
|
31
|
+
/** Favorited resource ids from the user config, keyed by prompt path. */
|
|
32
|
+
favoriteIds: ReadonlySet<string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Maps a prompt DTO into a catalog item.
|
|
36
|
+
*
|
|
37
|
+
* `prompt.id` is already the full `prompts/{bucket}/{path}` resource path —
|
|
38
|
+
* the owner bucket for a shared-with-me prompt, the caller's own bucket
|
|
39
|
+
* otherwise — the same shape every other resource type's `CatalogItem.id`
|
|
40
|
+
* carries, so no per-source qualification is needed here.
|
|
41
|
+
*/
|
|
42
|
+
export declare const mapPromptToCatalogItem: (prompt: PromptResponseDto, { folderLabels, overviewLabels, source, favoriteIds, }: MapPromptToCatalogItemOptions) => CatalogItem;
|
|
43
|
+
//# sourceMappingURL=map-prompt-to-catalog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-prompt-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-prompt-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAkB/E,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,iBAAiB,EACzB,QAAQ,oBAAoB,KAC3B,mBAaF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,WAAW,KAAG,OACxB,CAAC;AAEtC,qDAAqD;AACrD,MAAM,WAAW,6BAA6B;IAC5C,wEAAwE;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,4FAA4F;IAC5F,cAAc,EAAE,oBAAoB,CAAC;IACrC,oFAAoF;IACpF,MAAM,EAAE,YAAY,CAAC;IACrB,yEAAyE;IACzE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,iBAAiB,EACzB,wDAKG,6BAA6B,KAC/B,WAsCF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CatalogContentTreeNode, CatalogItem, CatalogItemOverview } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { SkillAboutDetails } from '../skill/skill-manifest';
|
|
4
|
+
import { SkillSource } from '../skill/skill-types';
|
|
5
|
+
import { DeploymentFolderLabels } from './map-deployment-to-catalog-item';
|
|
6
|
+
/** Parameters for {@link mapSkillToCatalogItem}. */
|
|
7
|
+
export interface MapSkillToCatalogItemOptions {
|
|
8
|
+
/** Personal/Shared/Public folder labels; i18n stays at the app edge. */
|
|
9
|
+
folderLabels: DeploymentFolderLabels;
|
|
10
|
+
/** Namespace the skill came from; drives ownership flags and the folder prefix. */
|
|
11
|
+
source: SkillSource;
|
|
12
|
+
/** Favorited resource ids from the user config, keyed by skill resource URL. */
|
|
13
|
+
favoriteIds: ReadonlySet<string>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Maps a skill's DIAL Core metadata into a catalog item. The full
|
|
17
|
+
* `skills/{bucket}/{path}` resource URL is used as `CatalogItem.id` rather
|
|
18
|
+
* than the bucket-relative path: the catalog lists two buckets, and the same
|
|
19
|
+
* relative path can exist in both.
|
|
20
|
+
*/
|
|
21
|
+
export declare const mapSkillToCatalogItem: (skill: SkillMetadataItemDto, { folderLabels, source, favoriteIds }: MapSkillToCatalogItemOptions) => CatalogItem;
|
|
22
|
+
/** Translated labels for the skill Overview tab's Specification/Details sections. */
|
|
23
|
+
export interface SkillOverviewLabels {
|
|
24
|
+
whenToUseLabel: string;
|
|
25
|
+
allowedToolsLabel: string;
|
|
26
|
+
bundledResourcesLabel: string;
|
|
27
|
+
specificationSectionTitle: string;
|
|
28
|
+
authorLabel: string;
|
|
29
|
+
updatedLabel: string;
|
|
30
|
+
fileCountLabel: string;
|
|
31
|
+
detailsSectionTitle: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolves the manifest file's opaque listing id across DIAL Core versions.
|
|
35
|
+
* Some return file-relative paths (`SKILL.md`), while others prefix the
|
|
36
|
+
* skill's path and its internal `files` directory. The returned id is kept
|
|
37
|
+
* verbatim so it matches the corresponding tree node exactly.
|
|
38
|
+
*/
|
|
39
|
+
export declare const resolveSkillManifestFileId: (files: SkillMetadataItemDto[], skillPath: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Converts an opaque file-listing id into the path expected by the single-file
|
|
42
|
+
* download endpoint. Core may prefix listing paths with the skill path and its
|
|
43
|
+
* internal `files` directory, while the endpoint accepts a path relative to
|
|
44
|
+
* that directory. File-relative ids are returned unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare const resolveSkillFileDownloadPath: (fileId: string, skillPath: string) => string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Builds the Overview tab data for a skill: a Specification section from its
|
|
49
|
+
* parsed manifest frontmatter, followed by a Details section covering who
|
|
50
|
+
* authored it, when it last changed, and its file inventory. Grouping folders
|
|
51
|
+
* in the file listing are excluded from both the count and the rows. Sizes are
|
|
52
|
+
* not shown — the skill metadata carries no content-length field.
|
|
53
|
+
*/
|
|
54
|
+
export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
|
|
55
|
+
/**
|
|
56
|
+
* Builds the Content tab's hierarchical file tree for a skill from
|
|
57
|
+
* `listSkillFiles({ recursive: true })`'s flat listing. Every entry's path is
|
|
58
|
+
* first stripped of the skill's own path prefix and its internal `files`
|
|
59
|
+
* storage directory (see `stripSkillPathPrefix`) — the skill's own root
|
|
60
|
+
* folder and that `files` directory are Core storage implementation details,
|
|
61
|
+
* not authored structure, so neither appears as a wrapping node. An entry
|
|
62
|
+
* that strips to nothing (the skill root, or the bare `files` directory
|
|
63
|
+
* itself) contributes no node. Every folder entry is attached under its own
|
|
64
|
+
* stripped path so an empty grouping folder still appears; every file entry
|
|
65
|
+
* attaches under the folder chain its stripped path implies, synthesizing
|
|
66
|
+
* any intermediate folder the listing never enumerated on its own. A file
|
|
67
|
+
* node's `id` is the listing entry's own (unstripped) path, so it round-trips
|
|
68
|
+
* back to `downloadSkillFile` without being re-derived; a folder node's `id`
|
|
69
|
+
* is the stripped path and only keys client-side expand/collapse state.
|
|
70
|
+
*/
|
|
71
|
+
export declare const buildSkillContentTree: (files: SkillMetadataItemDto[], skillPath: string) => CatalogContentTreeNode[];
|
|
72
|
+
/**
|
|
73
|
+
* Reads a skill file response as raw bytes, or `null` when the body is
|
|
74
|
+
* larger than `SKILL_MANIFEST_MAX_BYTES`. The declared `content-length` is
|
|
75
|
+
* checked first so an oversized body is never read into memory at all; the
|
|
76
|
+
* actual byte length is checked again after reading, for a response with no
|
|
77
|
+
* (or an inaccurate) declared length. Applies identically to every skill
|
|
78
|
+
* file, text or binary — not only `SKILL.md`.
|
|
79
|
+
*/
|
|
80
|
+
export declare const readSkillFileBytes: (response: Response) => Promise<Uint8Array | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Reads a skill manifest response as text, or `null` when the body is larger
|
|
83
|
+
* than `SKILL_MANIFEST_MAX_BYTES`. The size is checked before decoding, so an
|
|
84
|
+
* oversized manifest is never turned into a string.
|
|
85
|
+
*/
|
|
86
|
+
export declare const readSkillManifest: (response: Response) => Promise<string | null>;
|
|
87
|
+
//# sourceMappingURL=map-skill-to-catalog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-skill-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-skill-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EAGzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAQvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA4B,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAiB/E,oDAAoD;AACpD,MAAM,WAAW,4BAA4B;IAC3C,wEAAwE;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,mFAAmF;IACnF,MAAM,EAAE,WAAW,CAAC;IACpB,gFAAgF;IAChF,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,oBAAoB,EAC3B,uCAAuC,4BAA4B,KAClE,WA4BF,CAAC;AAKF,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AA2CD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,oBAAoB,EAAE,EAC7B,WAAW,MAAM,KAChB,MAeF,CAAC;AAuCF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,MAAM,GAAG,IAA+C,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,oBAAoB,GAAG,SAAS,EACvC,OAAO,oBAAoB,EAAE,EAC7B,OAAO,iBAAiB,GAAG,SAAS,EACpC,QAAQ,mBAAmB,KAC1B,mBAyBF,CAAC;AA4DF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,oBAAoB,EAAE,EAC7B,WAAW,MAAM,KAChB,sBAAsB,EA6BxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,QAAQ,KACjB,OAAO,CAAC,UAAU,GAAG,IAAI,CAa3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,QAAQ,KACjB,OAAO,CAAC,MAAM,GAAG,IAAI,CAKvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CatalogItemApiDetails } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/** Resource families that DIAL Core exposes an MCP endpoint for. */
|
|
4
|
+
export declare enum McpResourceKind {
|
|
5
|
+
/** Toolsets, served under `/v1/toolset/{id}/mcp`. */
|
|
6
|
+
Toolset = "toolset",
|
|
7
|
+
/** Application deployments, served under `/v1/deployments/{id}/mcp`. */
|
|
8
|
+
Application = "application"
|
|
9
|
+
}
|
|
10
|
+
/** Builds the MCP endpoint URL for a toolset resource. */
|
|
11
|
+
export declare const buildToolsetMcpUrl: (baseUrl: string, id: string) => string;
|
|
12
|
+
/** Builds the MCP endpoint URL for an application-deployment resource. */
|
|
13
|
+
export declare const buildApplicationMcpUrl: (baseUrl: string, id: string) => string;
|
|
14
|
+
/** Returns the MCP resource kind a catalog item's Connect endpoint belongs to, or `null` when the item exposes no MCP endpoint. */
|
|
15
|
+
export declare const resolveMcpResourceKind: (type: CatalogEntityType, supportsMcp?: boolean) => McpResourceKind | null;
|
|
16
|
+
/** Builds the "Connect" tab's resource/endpoint/snippet data for the MCP endpoint of the given resource kind. */
|
|
17
|
+
export declare const buildConnectApi: (baseUrl: string, id: string, kind: McpResourceKind) => CatalogItemApiDetails;
|
|
18
|
+
//# sourceMappingURL=mcp-endpoint-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-endpoint-url.d.ts","sourceRoot":"","sources":["../../src/catalog/mcp-endpoint-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,oEAAoE;AACpE,oBAAY,eAAe;IACzB,qDAAqD;IACrD,OAAO,YAAY;IACnB,wEAAwE;IACxE,WAAW,gBAAgB;CAC5B;AAmBD,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,KAAG,MACY,CAAC;AAE9E,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,KAAG,MACY,CAAC;AAUlF,mIAAmI;AACnI,eAAO,MAAM,sBAAsB,GACjC,MAAM,iBAAiB,EACvB,cAAc,OAAO,KACpB,eAAe,GAAG,IAMpB,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EACf,IAAI,MAAM,EACV,MAAM,eAAe,KACpB,qBAWF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PublishConversationResultDto, PublishHistoryEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
4
|
+
/**
|
|
5
|
+
* The publish API's entity-type path param values. Re-declared as a plain
|
|
6
|
+
* string-literal union rather than importing the generated
|
|
7
|
+
* `PublishCatalogEntityEntityTypeEnum`, so this module has no dependency on
|
|
8
|
+
* the app's own `server-api` layer.
|
|
9
|
+
*/
|
|
10
|
+
export type CatalogPublishEntityType = 'model' | 'toolset' | 'application' | 'prompt' | 'skill';
|
|
11
|
+
/** Maps a catalog item's entity type to the publish API's entity-type path param, or `undefined` if that type is not publishable. */
|
|
12
|
+
export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPublishEntityType | undefined;
|
|
13
|
+
/** Maps a publish-history API response entry to the catalog lib's `PublishHistoryEntry` model. */
|
|
14
|
+
export declare const mapPublishHistoryEntryDto: (dto: PublishHistoryEntryDto) => PublishHistoryEntry;
|
|
15
|
+
/** Maps a conversation publish-history API response entry to the publish panel's `PublishHistoryEntry` model. */
|
|
16
|
+
export declare const mapPublishConversationResultDto: (dto: PublishConversationResultDto) => PublishHistoryEntry;
|
|
17
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/catalog/publish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC,OAAO,GACP,SAAS,GACT,aAAa,GACb,QAAQ,GACR,OAAO,CAAC;AAYZ,qIAAqI;AACrI,eAAO,MAAM,mBAAmB,GAC9B,MAAM,iBAAiB,KACtB,wBAAwB,GAAG,SAA2C,CAAC;AAE1E,kGAAkG;AAClG,eAAO,MAAM,yBAAyB,GACpC,KAAK,sBAAsB,KAC1B,mBAID,CAAC;AAEH,iHAAiH;AACjH,eAAO,MAAM,+BAA+B,GAC1C,KAAK,4BAA4B,KAChC,mBAKD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CatalogItem, CatalogItemDetailsFetchResult } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { DeploymentDetailsDto, DeploymentLimitsResponseDto, PromptResponseDto, SkillFileListResponseDto, SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { SkillFileContent } from '../skill/skill-file-preview';
|
|
4
|
+
import { DeploymentLimitsLabels } from './map-deployment-limits-to-catalog';
|
|
5
|
+
import { PromptOverviewLabels } from './map-prompt-to-catalog-item';
|
|
6
|
+
import { SkillOverviewLabels } from './map-skill-to-catalog-item';
|
|
7
|
+
/** Injected API port for catalog item detail fetching. Mirrors exact server-api wrapper signatures. */
|
|
8
|
+
export interface CatalogDetailsApi {
|
|
9
|
+
/** Fetches deployment-level details for a model, agent, toolset, or application. */
|
|
10
|
+
getDeploymentDetails(deploymentId: string): Promise<DeploymentDetailsDto>;
|
|
11
|
+
/** Fetches rate-limit data for a deployment. */
|
|
12
|
+
getDeploymentLimits(deploymentId: string): Promise<DeploymentLimitsResponseDto>;
|
|
13
|
+
/** Fetches a personal or shared prompt by its full `prompts/{bucket}/{path}` resource id. */
|
|
14
|
+
getPrompt(id: string): Promise<PromptResponseDto>;
|
|
15
|
+
/** Fetches a public (organisation) prompt by its bucket-relative path. */
|
|
16
|
+
getPublicPrompt(path: string): Promise<PromptResponseDto>;
|
|
17
|
+
/** Downloads a raw skill file, returning the raw fetch `Response`. */
|
|
18
|
+
downloadSkillFile(bucket: string, path: string, filePath: string, signal?: AbortSignal): Promise<Response>;
|
|
19
|
+
/** Lists files inside a skill package. */
|
|
20
|
+
listSkillFiles(params: {
|
|
21
|
+
bucket: string;
|
|
22
|
+
filePath: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
recursive?: boolean;
|
|
27
|
+
}, signal?: AbortSignal): Promise<SkillFileListResponseDto>;
|
|
28
|
+
}
|
|
29
|
+
/** Options accepted by `useCatalogItemDetails`. */
|
|
30
|
+
export interface UseCatalogItemDetailsOptions {
|
|
31
|
+
/** Configured API adapter used for all network calls. */
|
|
32
|
+
api: CatalogDetailsApi;
|
|
33
|
+
/**
|
|
34
|
+
* Combined array of all skills visible to this user
|
|
35
|
+
* (personal + shared + public) for overview metadata lookup.
|
|
36
|
+
*/
|
|
37
|
+
skills: SkillMetadataItemDto[];
|
|
38
|
+
/** Whether the current user has admin privileges (affects toolset credential visibility). */
|
|
39
|
+
isAdmin: boolean;
|
|
40
|
+
/** DIAL Core external base URL used for Connect-tab endpoint construction. */
|
|
41
|
+
dialCoreExternalUrl: string | null | undefined;
|
|
42
|
+
/** Labels for skill overview section headers. */
|
|
43
|
+
skillOverviewLabels: SkillOverviewLabels;
|
|
44
|
+
/** Labels for prompt overview section headers. */
|
|
45
|
+
promptOverviewLabels: PromptOverviewLabels;
|
|
46
|
+
/** Labels for deployment limits table. */
|
|
47
|
+
deploymentLimitsLabels: DeploymentLimitsLabels;
|
|
48
|
+
}
|
|
49
|
+
/** Returned callbacks from `useCatalogItemDetails`. All callbacks are stable for stable inputs. */
|
|
50
|
+
export interface UseCatalogItemDetailsResult {
|
|
51
|
+
/**
|
|
52
|
+
* Fetches full detail data for a catalog item.
|
|
53
|
+
* Returns `undefined` on failure (error handled by caller).
|
|
54
|
+
*/
|
|
55
|
+
onFetchDetails(item: CatalogItem): Promise<CatalogItemDetailsFetchResult | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Loads the text content of a file inside the currently open skill's package.
|
|
58
|
+
* Returns `undefined` when the file cannot be read or is a directory.
|
|
59
|
+
*/
|
|
60
|
+
onLoadContentFile(fileId: string): Promise<string | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Downloads and returns preview bytes for a file inside the currently open skill's package.
|
|
63
|
+
* Throws on HTTP errors, unparseable ids, and size-limit violations.
|
|
64
|
+
*/
|
|
65
|
+
onLoadSkillDetailsFile(fileId: string): Promise<SkillFileContent>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Headless hook that encapsulates catalog item detail fetching.
|
|
69
|
+
* Extracts the inline dispatch logic from `CatalogView` into a reusable,
|
|
70
|
+
* library-isolated unit.
|
|
71
|
+
*/
|
|
72
|
+
export declare const useCatalogItemDetails: ({ api, skills, isAdmin, dialCoreExternalUrl, skillOverviewLabels, promptOverviewLabels, deploymentLimitsLabels, }: UseCatalogItemDetailsOptions) => UseCatalogItemDetailsResult;
|
|
73
|
+
//# sourceMappingURL=useCatalogItemDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCatalogItemDetails.d.ts","sourceRoot":"","sources":["../../src/catalog/useCatalogItemDetails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAKpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAWjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AASzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,uGAAuG;AACvG,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1E,gDAAgD;IAChD,mBAAmB,CACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,6FAA6F;IAC7F,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD,0EAA0E;IAC1E,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC1D,sEAAsE;IACtE,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrB,0CAA0C;IAC1C,cAAc,CACZ,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,EACD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACtC;AAED,mDAAmD;AACnD,MAAM,WAAW,4BAA4B;IAC3C,yDAAyD;IACzD,GAAG,EAAE,iBAAiB,CAAC;IACvB;;;OAGG;IACH,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,6FAA6F;IAC7F,OAAO,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,iDAAiD;IACjD,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,kDAAkD;IAClD,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,0CAA0C;IAC1C,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,mGAAmG;AACnG,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,cAAc,CACZ,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;IACtD;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/D;;;OAGG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACnE;AAiBD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,mHAQnC,4BAA4B,KAAG,2BA8MjC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Entity kind used to route a favorite toggle to the correct backend section. */
|
|
2
|
+
export declare enum FavoriteEntityType {
|
|
3
|
+
Deployment = "deployment",
|
|
4
|
+
Toolset = "toolset",
|
|
5
|
+
Prompt = "prompt",
|
|
6
|
+
Skill = "skill"
|
|
7
|
+
}
|
|
8
|
+
/** Raw favorites payload returned by `loadFavorites`. */
|
|
9
|
+
export interface FavoritesPayload {
|
|
10
|
+
deployments: string[];
|
|
11
|
+
toolsets: string[];
|
|
12
|
+
prompts: string[];
|
|
13
|
+
skills: string[];
|
|
14
|
+
}
|
|
15
|
+
/** Parameters for {@link useFavoriteEntitiesState}. */
|
|
16
|
+
export interface UseFavoriteEntitiesStateParams {
|
|
17
|
+
/** Fetches the initial set of favorite ids from the server. */
|
|
18
|
+
loadFavorites: () => Promise<FavoritesPayload>;
|
|
19
|
+
/** Persists a single favorite toggle for the given entity type. */
|
|
20
|
+
updateFavorite: (id: string, isFavorite: boolean, entityType: FavoriteEntityType) => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** Result returned by {@link useFavoriteEntitiesState}. */
|
|
23
|
+
export interface UseFavoriteEntitiesStateResult {
|
|
24
|
+
/** Union of all installed entity ids across every category. */
|
|
25
|
+
favoriteIds: ReadonlySet<string>;
|
|
26
|
+
/** True until the initial load has settled. */
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
/** Optimistically toggles a favorite and rolls back on persistence failure. */
|
|
29
|
+
toggleFavorite: (id: string, isFavorite: boolean, entityType?: FavoriteEntityType) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Manages the set of favorited entity ids: loads on mount, applies optimistic
|
|
33
|
+
* toggle with exact-inverse rollback on failure, and re-throws persistence
|
|
34
|
+
* errors so callers can react. Does not import any app context or server-api.
|
|
35
|
+
*/
|
|
36
|
+
export declare const useFavoriteEntitiesState: ({ loadFavorites, updateFavorite, }: UseFavoriteEntitiesStateParams) => UseFavoriteEntitiesStateResult;
|
|
37
|
+
//# sourceMappingURL=useFavoriteEntitiesState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFavoriteEntitiesState.d.ts","sourceRoot":"","sources":["../../../src/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,oBAAY,kBAAkB;IAC5B,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,uDAAuD;AACvD,MAAM,WAAW,8BAA8B;IAC7C,+DAA+D;IAC/D,aAAa,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/C,mEAAmE;IACnE,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,kBAAkB,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,2DAA2D;AAC3D,MAAM,WAAW,8BAA8B;IAC7C,+DAA+D;IAC/D,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,EACnB,UAAU,CAAC,EAAE,kBAAkB,KAC5B,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,oCAGtC,8BAA8B,KAAG,8BA4EnC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { PublishFolderNode } from '@epam/ai-dial-publish-panel';
|
|
3
|
+
/** Parameters for {@link usePublishFolders}. */
|
|
4
|
+
export interface UsePublishFoldersParams {
|
|
5
|
+
/** Lists one folder level of the Organization/public files bucket. */
|
|
6
|
+
listPublicFiles: (params: {
|
|
7
|
+
path?: string;
|
|
8
|
+
}) => Promise<ListFilesResponseDto>;
|
|
9
|
+
/**
|
|
10
|
+
* Folder path keys (`path.join('/')`) the user has published to before.
|
|
11
|
+
* Owned by the host, which is also what persists them — this hook never
|
|
12
|
+
* touches browser storage (library isolation).
|
|
13
|
+
*/
|
|
14
|
+
rememberedFolderKeys?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Called with the next remembered-key list when {@link
|
|
17
|
+
* UsePublishFoldersResult.rememberPublishFolder} records a destination.
|
|
18
|
+
* Omit it for a host that does not persist destinations.
|
|
19
|
+
*/
|
|
20
|
+
onRememberedFolderKeysChange?: (folderKeys: string[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/** Result returned by {@link usePublishFolders}. */
|
|
23
|
+
export interface UsePublishFoldersResult {
|
|
24
|
+
/** Folder tree loaded so far from the Organization/public bucket. */
|
|
25
|
+
folderItems: PublishFolderNode[];
|
|
26
|
+
/** Folder path keys currently expanded in the tree. */
|
|
27
|
+
expandedPaths: Set<string>;
|
|
28
|
+
/** Folder path keys whose children have already been fetched. */
|
|
29
|
+
loadedPaths: Set<string>;
|
|
30
|
+
/** Folder path keys currently being fetched. */
|
|
31
|
+
loadingPaths: Set<string>;
|
|
32
|
+
/** Called by the folder tree when the set of expanded folders changes. */
|
|
33
|
+
onExpandedPathsChange: (paths: Set<string>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Adds a folder under `parentPath` to the in-memory tree only — it is
|
|
36
|
+
* never created on the backend here. The path becomes real once the user
|
|
37
|
+
* actually publishes to it: the publish request writes to the nested
|
|
38
|
+
* `folderPath`, which DIAL Core storage creates implicitly, the same way
|
|
39
|
+
* writing a file to a new prefix does. This avoids leaving an orphaned
|
|
40
|
+
* empty folder behind when the user picks a new-folder name and then
|
|
41
|
+
* cancels the publish.
|
|
42
|
+
*/
|
|
43
|
+
onCreatePublishFolder: (parentPath: string[], name: string) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Records `folderPath` as a publish destination the user has actually used,
|
|
46
|
+
* so it keeps appearing in the tree on later publishes. Call it after a
|
|
47
|
+
* successful publish.
|
|
48
|
+
*/
|
|
49
|
+
rememberPublishFolder: (folderPath: string[]) => void;
|
|
50
|
+
/** Heuristic write-access check for a folder path (see the TODO above). */
|
|
51
|
+
hasPublishWriteAccess: (folderPath: string[]) => boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Loads the Organization/public bucket's folder tree lazily (one listing per
|
|
55
|
+
* expanded folder, cached by API path) for the Publish flow's folder picker,
|
|
56
|
+
* shared by catalog-entity publish and conversation publish. Scoped to folders
|
|
57
|
+
* only — unlike `useDialFileManager`, it does not list files, rename,
|
|
58
|
+
* copy/move, or upload.
|
|
59
|
+
*
|
|
60
|
+
* Destinations the user has already published to are merged into that tree
|
|
61
|
+
* from `rememberedFolderKeys`. Publishing creates a DIAL Core publication
|
|
62
|
+
* *request*, so a folder picked during publish is not a listable resource in
|
|
63
|
+
* the public files bucket this tree is built from — the remembered list is
|
|
64
|
+
* what keeps such a folder selectable for the next publish instead of
|
|
65
|
+
* vanishing when the panel is reopened.
|
|
66
|
+
*
|
|
67
|
+
* Takes `listPublicFiles` as a parameter and hands remembered destinations
|
|
68
|
+
* back through a callback, so it imports no app context and no storage API.
|
|
69
|
+
*/
|
|
70
|
+
export declare const usePublishFolders: ({ listPublicFiles, rememberedFolderKeys, onRememberedFolderKeysChange, }: UsePublishFoldersParams) => UsePublishFoldersResult;
|
|
71
|
+
//# sourceMappingURL=usePublishFolders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePublishFolders.d.ts","sourceRoot":"","sources":["../../../src/catalog/usePublishFolders/usePublishFolders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AA0CrC,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,eAAe,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9E;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/D;AAED,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,iEAAiE;IACjE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,gDAAgD;IAChD,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACpD;;;;;;;;OAQG;IACH,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E;;;;OAIG;IACH,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtD,2EAA2E;IAC3E,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,0EAI/B,uBAAuB,KAAG,uBAkI5B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Structured announcement banner content. */
|
|
2
|
+
export interface AnnouncementContent {
|
|
3
|
+
title: string | null;
|
|
4
|
+
description: string | null;
|
|
5
|
+
html: string | null;
|
|
6
|
+
}
|
|
7
|
+
/** Sanitizes announcement HTML to the allowed inline tag/attribute set. */
|
|
8
|
+
export declare const sanitizeAnnouncementHtml: (html: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Sanitizes the legacy `ANNOUNCEMENT_HTML_MESSAGE` banner, which permits the
|
|
11
|
+
* block-level markup the inline pass strips. See
|
|
12
|
+
* `ANNOUNCEMENT_MESSAGE_SANITIZE_OPTIONS` for why the two lists differ.
|
|
13
|
+
*/
|
|
14
|
+
export declare const sanitizeAnnouncementMessageHtml: (html: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the operator configured the structured banner (title and/or
|
|
17
|
+
* description) rather than only the legacy HTML message. Drives which of the
|
|
18
|
+
* two banner layouts renders.
|
|
19
|
+
*/
|
|
20
|
+
export declare const hasStructuredAnnouncement: ({ title, description, }: AnnouncementContent) => boolean;
|
|
21
|
+
/** True when the announcement has any renderable content (structured or legacy HTML). */
|
|
22
|
+
export declare const hasAnnouncementContent: (content: AnnouncementContent) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Builds the value persisted under `StorageKey.TextOfClosedAnnouncement` when
|
|
25
|
+
* the user dismisses the banner. Dismissal is content-keyed: the banner stays
|
|
26
|
+
* hidden only while the current announcement produces the same signature, so
|
|
27
|
+
* editing any part of it brings the banner back with no version counter.
|
|
28
|
+
*
|
|
29
|
+
* A legacy-only announcement returns the raw HTML string — byte-identical to
|
|
30
|
+
* what shipped before the structured fields existed — so dismissals recorded
|
|
31
|
+
* by older builds keep working without a storage migration.
|
|
32
|
+
*/
|
|
33
|
+
export declare const buildAnnouncementSignature: (content: AnnouncementContent) => string;
|
|
34
|
+
//# sourceMappingURL=announcement-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-message.d.ts","sourceRoot":"","sources":["../../src/conversation/announcement-message.ts"],"names":[],"mappings":"AA+BA,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAQD,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,MACgB,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAAI,MAAM,MAAM,KAAG,MACY,CAAC;AAK5E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,yBAGvC,mBAAmB,KAAG,OACqB,CAAC;AAE/C,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,KAAG,OACN,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,mBAAmB,KAC3B,MASF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-conversation.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/import-conversation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-conversation.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/import-conversation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EACb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAG7B,oFAAoF;AACpF,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,OAAO,EAAE,MAAM;CAI5B;AAOD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,YA2BlD,CAAC;AAeF,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,YAAY,EAAE,YAAY,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAgBD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAC/B,cAAc,YAAY,EAC1B,QAAQ,MAAM,KACb,qBA6CF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,cAAc,YAAY,KACzB,MAAM,GAAG,SAMX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,EAAE,KAAG,MACV,CAAC;AAE9C,qGAAqG;AACrG,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,YAAY,EAC1B,WAAW,GAAG,CAAC,MAAM,EAAE,yBAAyB,CAAC,KAChD,YAgCD,CAAC;AAEH,+FAA+F;AAC/F,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,MAChB,CAAC;AAEpC,0GAA0G;AAC1G,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,KAAK,EAAE,UAAU,CAAC;IAClB,+FAA+F;IAC/F,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,SAAS,EAAE,mBAAmB,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,YAAY,EAC1B,iBAAiB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,WAAW,mBAAmB,KAC7B;IAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CA2B3D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConversationTransferJob, ConversationTransferSubject } from '
|
|
1
|
+
import { ConversationTransferJob, ConversationTransferSubject } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
/** Shared job-queue primitive underlying both `useConversationExport` and `useConversationImport`. */
|
|
3
3
|
export interface ConversationTransferQueue {
|
|
4
4
|
/** Queued jobs, most recently added last. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/queue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AAGnC,sGAAsG;AACtG,MAAM,WAAW,yBAAyB;IACxC,6CAA6C;IAC7C,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,oEAAoE;IACpE,MAAM,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,MAAM,CAAC;IACzD,yDAAyD;IACzD,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAC;IAC5E,8EAA8E;IAC9E,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,oFAAoF;IACpF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uDAAuD;IACvD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAE,CACR,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,KACxC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,QAAO,yBAgF/C,CAAC"}
|
|
@@ -9,33 +9,6 @@ export declare enum ExportFileNameKind {
|
|
|
9
9
|
SingleConversationWithAttachments = "chat_with_attachments",
|
|
10
10
|
AllConversationsHistory = "chat_conversations_history"
|
|
11
11
|
}
|
|
12
|
-
/** Lifecycle status of a queued export/import job. */
|
|
13
|
-
export declare enum ConversationTransferJobStatus {
|
|
14
|
-
InProgress = "inProgress",
|
|
15
|
-
Success = "success",
|
|
16
|
-
Failed = "failed"
|
|
17
|
-
}
|
|
18
|
-
/** Whether a transfer job's subject is a single named conversation or the whole history. */
|
|
19
|
-
export declare enum ConversationTransferSubjectKind {
|
|
20
|
-
Single = "single",
|
|
21
|
-
All = "all"
|
|
22
|
-
}
|
|
23
|
-
/** What a transfer job operates on — structured data, never pre-rendered translated text. */
|
|
24
|
-
export type ConversationTransferSubject = {
|
|
25
|
-
kind: ConversationTransferSubjectKind.Single;
|
|
26
|
-
/** The conversation's own name. */
|
|
27
|
-
title: string;
|
|
28
|
-
/** Folder breadcrumb the conversation originated from, if nested. */
|
|
29
|
-
sourceBreadcrumb?: string;
|
|
30
|
-
} | {
|
|
31
|
-
kind: ConversationTransferSubjectKind.All;
|
|
32
|
-
};
|
|
33
|
-
/** A queued export or import job. */
|
|
34
|
-
export interface ConversationTransferJob {
|
|
35
|
-
id: string;
|
|
36
|
-
subject: ConversationTransferSubject;
|
|
37
|
-
status: ConversationTransferJobStatus;
|
|
38
|
-
}
|
|
39
12
|
/** Library-owned reason a transfer job failed. */
|
|
40
13
|
export declare enum ConversationTransferErrorCode {
|
|
41
14
|
Unauthorized = "unauthorized",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,sBAAsB;IAChC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED,8EAA8E;AAC9E,oBAAY,kBAAkB;IAC5B,kBAAkB,sBAAsB;IACxC,iCAAiC,0BAA0B;IAC3D,uBAAuB,+BAA+B;CACvD;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,sBAAsB;IAChC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED,8EAA8E;AAC9E,oBAAY,kBAAkB;IAC5B,kBAAkB,sBAAsB;IACxC,iCAAiC,0BAA0B;IAC3D,uBAAuB,+BAA+B;CACvD;AAED,kDAAkD;AAClD,oBAAY,6BAA6B;IACvC,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACpB;AAED,oEAAoE;AACpE,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,6BAA6B,CAAC;IACpC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uEAAuE;AACvE,oBAAY,+BAA+B;IACzC,iBAAiB,sBAAsB;CACxC;AAED,sEAAsE;AACtE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,+BAA+B,CAAC;IACtC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,sEAAsE;AACtE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { MessageCustomContent, StreamChunk } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/** Callbacks {@link streamCompletion} reports streamed completion events through. */
|
|
4
|
+
export interface ChatStreamCompletionOptions {
|
|
5
|
+
onChunk: (chunk: StreamChunk) => void;
|
|
6
|
+
onComplete: () => void;
|
|
7
|
+
onError: (error: Error) => void;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
/** Host capabilities {@link createChatStreamApi} needs to stream and stop completions. */
|
|
11
|
+
export interface CreateChatStreamApiDeps {
|
|
12
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
13
|
+
getCsrfToken: () => string | null;
|
|
14
|
+
/** Stores a CSRF token captured from a response header. */
|
|
15
|
+
setCsrfToken: (token: string | null) => void;
|
|
16
|
+
/** Base path for the completion/stop endpoints, e.g. `/api/v1/conversations`. */
|
|
17
|
+
completionsBasePath: string;
|
|
18
|
+
/** Resolves the caller's current timezone, attached as `X-Timezone` when non-empty. */
|
|
19
|
+
getTimezone?: () => string | undefined;
|
|
20
|
+
/** `fetch` implementation to issue requests through. Defaults to the global `fetch`. */
|
|
21
|
+
fetchImpl?: typeof fetch;
|
|
22
|
+
}
|
|
23
|
+
/** DIAL Core completion streaming transport produced by {@link createChatStreamApi}. */
|
|
24
|
+
export interface ChatStreamApi {
|
|
25
|
+
streamCompletion: (path: string, message: string | undefined, model: string, options: ChatStreamCompletionOptions, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum, messageIndex?: number, clientChannelId?: string) => void;
|
|
26
|
+
stopCompletion: (dto: {
|
|
27
|
+
generationId: string;
|
|
28
|
+
path: string;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Builds the streamed-completion transport `apps/chat/src/server-api/chat-stream.api.ts`
|
|
33
|
+
* exposes today: SSE parsing across partial chunks, CSRF header attachment
|
|
34
|
+
* and rotation, and an optional timezone header, backed by an injected
|
|
35
|
+
* `fetch` implementation and base path.
|
|
36
|
+
*/
|
|
37
|
+
export declare const createChatStreamApi: (deps: CreateChatStreamApiDeps) => ChatStreamApi;
|
|
38
|
+
//# sourceMappingURL=create-chat-stream-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-chat-stream-api.d.ts","sourceRoot":"","sources":["../../src/conversation/create-chat-stream-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAInC,qFAAqF;AACrF,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,0FAA0F;AAC1F,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,iFAAiF;IACjF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACvC,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AA0BD,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,EACpC,aAAa,CAAC,EAAE,oBAAoB,EACpC,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,yBAAyB,EAChC,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE,MAAM,KACrB,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,uBAAuB,KAC5B,aAuIF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ConversationListItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
3
|
+
import { RecipientsCountEntry } from '../../useShareRecipientsCount/useShareRecipientsCount';
|
|
4
|
+
/** Distilled row-action state for a single conversation item. */
|
|
5
|
+
export interface ConversationRowActionState {
|
|
6
|
+
/** `true` when the item is read-only (shared-with-me, published-with-me, or explicitly readonly). */
|
|
7
|
+
isReadonly: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Deduplicated list of folder paths (as joined slash-delimited strings)
|
|
10
|
+
* to which this conversation has been published. Empty when the conversation
|
|
11
|
+
* is unowned, readonly, or publish history is unavailable.
|
|
12
|
+
*/
|
|
13
|
+
publishedFolders: string[];
|
|
14
|
+
/**
|
|
15
|
+
* `true` when the revoke-access action should be shown: either the
|
|
16
|
+
* recipient count is unknown (lookup pending/failed) or at least one
|
|
17
|
+
* recipient exists.
|
|
18
|
+
*/
|
|
19
|
+
isRevokeVisible: boolean;
|
|
20
|
+
/** `true` when publish is applicable (no published folders yet). */
|
|
21
|
+
isPublishApplicable: boolean;
|
|
22
|
+
/** `true` when unpublish is applicable (at least one published folder exists). */
|
|
23
|
+
isUnpublishApplicable: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Derives the row-action visibility state for a single conversation item.
|
|
27
|
+
*
|
|
28
|
+
* Extracted from `getActions` in `ConversationPanelView` to isolate the
|
|
29
|
+
* readonly / publish / unpublish / revoke decision logic from the
|
|
30
|
+
* `DropdownItem` construction and `t()` calls that remain in the app.
|
|
31
|
+
*
|
|
32
|
+
* @param item - Conversation DTO fields relevant to ownership classification.
|
|
33
|
+
* @param publishHistory - Resolved publish-history entries, or `undefined`
|
|
34
|
+
* when history is unavailable or should be treated as empty (e.g. while
|
|
35
|
+
* loading or when the item is readonly).
|
|
36
|
+
* @param recipients - Current share-recipients count entry for this item.
|
|
37
|
+
*/
|
|
38
|
+
export declare const deriveConversationRowActionState: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe" | "isReadonly">, publishHistory: PublishHistoryEntry[] | undefined, recipients: RecipientsCountEntry) => ConversationRowActionState;
|
|
39
|
+
//# sourceMappingURL=deriveConversationRowActionState.d.ts.map
|
package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveConversationRowActionState.d.ts","sourceRoot":"","sources":["../../../src/conversation/deriveConversationRowActionState/deriveConversationRowActionState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,uDAAuD,CAAC;AAE/D,iEAAiE;AACjE,MAAM,WAAW,0BAA0B;IACzC,qGAAqG;IACrG,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,oEAAoE;IACpE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kFAAkF;IAClF,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gCAAgC,GAC3C,MAAM,IAAI,CACR,uBAAuB,EACvB,cAAc,GAAG,iBAAiB,GAAG,YAAY,CAClD,EACD,gBAAgB,mBAAmB,EAAE,GAAG,SAAS,EACjD,YAAY,oBAAoB,KAC/B,0BA6BF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Conversation } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/** True when the first user/assistant exchange is complete and LLM naming may still run. */
|
|
3
|
+
export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
|
|
4
|
+
//# sourceMappingURL=display-name-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-name-watch.d.ts","sourceRoot":"","sources":["../../src/conversation/display-name-watch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,4FAA4F;AAC5F,eAAO,MAAM,+BAA+B,GAC1C,cAAc,YAAY,KACzB,OAQF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Sanitizes footer message HTML to the allowed tag/attribute set. */
|
|
2
|
+
export declare const sanitizeFooterHtml: (html: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Normalises a version string for display. The server falls back to a bare
|
|
5
|
+
* `package.json` version (`0.45.0`), while a CI-supplied `CHAT_VERSION` is
|
|
6
|
+
* often already tagged (`v0.45.0`) — prefixing unconditionally would render
|
|
7
|
+
* `vv0.45.0`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatAppVersion: (version: string) => string;
|
|
10
|
+
//# sourceMappingURL=footer-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer-message.d.ts","sourceRoot":"","sources":["../../src/conversation/footer-message.ts"],"names":[],"mappings":"AAOA,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MACgB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAGlD,CAAC"}
|