@epam/ai-dial-chat-hooks 1.4.0-dev.8 → 1.4.0-dev.82
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/attachment/useAttachmentAction/useAttachmentAction.d.ts +1 -1
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentAction/useAttachmentAction.js +35 -44
- package/catalog/create-publish-api.d.ts +9 -1
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +8 -0
- package/catalog/entity-details.d.ts +5 -2
- package/catalog/entity-details.d.ts.map +1 -1
- package/catalog/map-entity-details-to-catalog.d.ts +4 -0
- package/catalog/map-entity-details-to-catalog.d.ts.map +1 -1
- package/catalog/map-entity-details-to-catalog.js +15 -13
- package/catalog/publish-dependency-icons.d.ts +22 -0
- package/catalog/publish-dependency-icons.d.ts.map +1 -0
- package/catalog/publish-dependency-icons.js +11 -0
- package/catalog/publish.d.ts +15 -2
- package/catalog/publish.d.ts.map +1 -1
- package/catalog/publish.js +15 -4
- package/catalog/use-publish-dependencies.d.ts +19 -0
- package/catalog/use-publish-dependencies.d.ts.map +1 -0
- package/catalog/use-publish-dependencies.js +25 -0
- package/catalog/useVersionHistory/useVersionHistory.d.ts +38 -0
- package/catalog/useVersionHistory/useVersionHistory.d.ts.map +1 -0
- package/catalog/useVersionHistory/useVersionHistory.js +49 -0
- package/catalog/useVersionHistory/useVersionHistorySection.d.ts +30 -0
- package/catalog/useVersionHistory/useVersionHistorySection.d.ts.map +1 -0
- package/catalog/useVersionHistory/useVersionHistorySection.js +31 -0
- package/catalog/version-history.d.ts +42 -0
- package/catalog/version-history.d.ts.map +1 -0
- package/catalog/version-history.js +27 -0
- package/catalog.js +36 -31
- package/conversation/announcement-message.d.ts +12 -0
- package/conversation/announcement-message.d.ts.map +1 -1
- package/conversation/announcement-message.js +16 -10
- package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
- package/conversation/useConversationStream/generation-resume.js +119 -96
- package/conversation.js +44 -44
- package/entry-points/catalog.d.ts +5 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/file-manager.d.ts +1 -0
- package/entry-points/file-manager.d.ts.map +1 -1
- package/entry-points/project.d.ts +5 -0
- package/entry-points/project.d.ts.map +1 -1
- package/entry-points/scheduled-tasks.d.ts +1 -0
- package/entry-points/scheduled-tasks.d.ts.map +1 -1
- package/entry-points/utils.d.ts +3 -0
- package/entry-points/utils.d.ts.map +1 -1
- package/file-manager.js +33 -32
- package/files/annotation.d.ts +3 -3
- package/files/annotation.d.ts.map +1 -1
- package/files/annotation.js +12 -11
- package/files/attachment-canvas.d.ts +1 -1
- package/files/attachment-canvas.d.ts.map +1 -1
- package/files/attachment-canvas.js +135 -135
- package/files/attachment-type-labels.d.ts +3 -0
- package/files/attachment-type-labels.d.ts.map +1 -0
- package/files/attachment-type-labels.js +12 -0
- package/files/attachment-types.d.ts +0 -2
- package/files/attachment-types.d.ts.map +1 -1
- package/files/attachment-types.js +7 -14
- package/files/dial-file.d.ts +18 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +30 -5
- package/index.d.ts +15 -0
- package/index.d.ts.map +1 -1
- package/index.js +255 -241
- package/org-units/models.d.ts +9 -0
- package/org-units/models.d.ts.map +1 -0
- package/org-units/types.d.ts +14 -0
- package/org-units/types.d.ts.map +1 -0
- package/org-units/types.js +6 -0
- package/org-units/useOrgUnits/useOrgUnits.d.ts +19 -0
- package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -0
- package/org-units/useOrgUnits/useOrgUnits.js +34 -0
- package/package.json +19 -19
- package/project/project-sharing-client.d.ts +8 -0
- package/project/project-sharing-client.d.ts.map +1 -0
- package/project/project-sharing-client.js +11 -0
- package/project/project-sharing.d.ts +28 -0
- package/project/project-sharing.d.ts.map +1 -0
- package/project/project-sharing.js +22 -0
- package/project/use-pinned-project-chats.d.ts +4 -2
- package/project/use-pinned-project-chats.d.ts.map +1 -1
- package/project/use-pinned-project-chats.js +152 -96
- package/project/use-project-conversations.d.ts.map +1 -1
- package/project/use-project-conversations.js +2 -2
- package/project/use-project-remove-from-list.d.ts +30 -0
- package/project/use-project-remove-from-list.d.ts.map +1 -0
- package/project/use-project-remove-from-list.js +39 -0
- package/project/use-project-revoke-access.d.ts +15 -0
- package/project/use-project-revoke-access.d.ts.map +1 -0
- package/project/use-project-revoke-access.js +32 -0
- package/project/use-project-share-recipients.d.ts +7 -0
- package/project/use-project-share-recipients.d.ts.map +1 -0
- package/project/use-project-share-recipients.js +36 -0
- package/project/use-projects.d.ts +1 -0
- package/project/use-projects.d.ts.map +1 -1
- package/project/use-projects.js +2 -1
- package/project.js +7 -2
- package/scheduled-task/scheduled-task-description.d.ts +19 -13
- package/scheduled-task/scheduled-task-description.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-description.js +39 -55
- package/scheduled-task/scheduled-task-display.d.ts +19 -5
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +43 -38
- package/scheduled-task/scheduled-task-next-occurrence.d.ts +7 -5
- package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-next-occurrence.js +15 -15
- package/scheduled-task/scheduled-task-trigger.d.ts +6 -4
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-trigger.js +92 -115
- package/scheduled-tasks.js +14 -13
- package/shared/timezones.d.ts +30 -0
- package/shared/timezones.d.ts.map +1 -0
- package/shared/timezones.js +102 -0
- package/utils.js +5 -3
- package/shared/cron-day-of-month.d.ts +0 -21
- package/shared/cron-day-of-month.d.ts.map +0 -1
- package/shared/cron-day-of-month.js +0 -13
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isVersionedCatalogEntityType as e, toPublishEntityType as t } from "../publish.js";
|
|
2
|
+
import { useVersionHistory as n } from "./useVersionHistory.js";
|
|
3
|
+
import { useMemo as r } from "react";
|
|
4
|
+
//#region src/catalog/useVersionHistory/useVersionHistorySection.ts
|
|
5
|
+
var i = ({ resourceId: i, resourceType: a, isEnabled: o, applications: s, toolsets: c, client: l, labels: u, formatters: d }) => {
|
|
6
|
+
let f = e(a), p = t(a) ?? "application", { rows: m, hasVersions: h, isLoading: g, hasError: _, onRetry: v } = n({
|
|
7
|
+
items: p === "toolset" ? c : s,
|
|
8
|
+
resourceId: i,
|
|
9
|
+
entityType: p,
|
|
10
|
+
isEnabled: o && f,
|
|
11
|
+
client: l,
|
|
12
|
+
formatters: d
|
|
13
|
+
});
|
|
14
|
+
return r(() => f && h ? {
|
|
15
|
+
rows: m,
|
|
16
|
+
isLoading: g,
|
|
17
|
+
hasError: _,
|
|
18
|
+
onRetry: v,
|
|
19
|
+
labels: u
|
|
20
|
+
} : void 0, [
|
|
21
|
+
f,
|
|
22
|
+
h,
|
|
23
|
+
m,
|
|
24
|
+
g,
|
|
25
|
+
_,
|
|
26
|
+
v,
|
|
27
|
+
u
|
|
28
|
+
]);
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as useVersionHistorySection };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VersionStatusEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { VersionHistoryRow } from '@epam/ai-dial-publish-panel';
|
|
3
|
+
/** The fields of a deployments or toolsets listing item the Versions history reads. */
|
|
4
|
+
export interface VersionHistoryListingItem {
|
|
5
|
+
/** Resource id as the listing returns it. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Key shared by every version of one resource saved by one owner in one folder. */
|
|
8
|
+
versionGroupId?: string;
|
|
9
|
+
/** Display version of the item. */
|
|
10
|
+
displayVersion?: string;
|
|
11
|
+
/** Last modified time, epoch milliseconds. */
|
|
12
|
+
updatedAt?: number;
|
|
13
|
+
/** Original author of the resource. */
|
|
14
|
+
owner?: string;
|
|
15
|
+
/** Whether the item belongs to the caller. */
|
|
16
|
+
isMy?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Host-supplied text and date formatting for the Versions history rows. */
|
|
19
|
+
export interface VersionHistoryFormatters {
|
|
20
|
+
/** Translated label of the Personal root, the first part of every folder. */
|
|
21
|
+
rootLabel: string;
|
|
22
|
+
/** Formats a last-modified time given in epoch milliseconds. */
|
|
23
|
+
formatDate: (timestamp: number) => string;
|
|
24
|
+
/** Builds the author line of a published version, e.g. `Published by {name}`. */
|
|
25
|
+
formatPublishedBy: (name: string) => string;
|
|
26
|
+
/** Builds the author line of any other version, e.g. `by {name}`. */
|
|
27
|
+
formatOwner: (name: string) => string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Selects the other saved versions of `resourceId` from a listing: the caller's own items that share its `versionGroupId`, without the version itself.
|
|
31
|
+
* @param items - deployments or toolsets listing items
|
|
32
|
+
* @param resourceId - id of the resource being edited or published
|
|
33
|
+
*/
|
|
34
|
+
export declare const selectOtherVersions: <T extends VersionHistoryListingItem>(items: readonly T[], resourceId: string) => T[];
|
|
35
|
+
/**
|
|
36
|
+
* Builds the Versions history rows, newest first by last modified time.
|
|
37
|
+
* @param group - the other versions of the resource, from {@link selectOtherVersions}
|
|
38
|
+
* @param statuses - statuses by item id; omit while they load
|
|
39
|
+
* @param formatters - host text and date formatting
|
|
40
|
+
*/
|
|
41
|
+
export declare const buildVersionHistoryRows: (group: readonly VersionHistoryListingItem[], statuses: ReadonlyMap<string, VersionStatusEntryDto> | undefined, formatters: VersionHistoryFormatters) => VersionHistoryRow[];
|
|
42
|
+
//# sourceMappingURL=version-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-history.d.ts","sourceRoot":"","sources":["../../src/catalog/version-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAIrC,uFAAuF;AACvF,MAAM,WAAW,yBAAyB;IACxC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,iFAAiF;IACjF,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,qEAAqE;IACrE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC;AASD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,yBAAyB,EACrE,OAAO,SAAS,CAAC,EAAE,EACnB,YAAY,MAAM,KACjB,CAAC,EAaH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,SAAS,yBAAyB,EAAE,EAC3C,UAAU,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,SAAS,EAChE,YAAY,wBAAwB,KACnC,iBAAiB,EA2BnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
|
|
2
|
+
import { parseResourceFolderPath as t } from "./resource-folder.js";
|
|
3
|
+
import { VersionPublicationStatus as n } from "@epam/ai-dial-chat-api-client";
|
|
4
|
+
import { VersionHistoryStatus as r } from "@epam/ai-dial-publish-panel";
|
|
5
|
+
//#region src/catalog/version-history.ts
|
|
6
|
+
var i = {
|
|
7
|
+
[n.NotPublished]: r.NotPublished,
|
|
8
|
+
[n.InReview]: r.InReview,
|
|
9
|
+
[n.Published]: r.Published,
|
|
10
|
+
[n.Unknown]: r.Unknown
|
|
11
|
+
}, a = (t, n) => {
|
|
12
|
+
if (n === "") return [];
|
|
13
|
+
let r = e(n), i = t.find((t) => e(t.id) === r);
|
|
14
|
+
return i?.isMy !== !0 || i.versionGroupId == null ? [] : t.filter((e) => e !== i && e.isMy === !0 && e.versionGroupId === i.versionGroupId);
|
|
15
|
+
}, o = (n, a, o) => [...n].sort((e, t) => (t.updatedAt ?? 0) - (e.updatedAt ?? 0)).map((n) => {
|
|
16
|
+
let s = a?.get(e(n.id)), c = s ? i[s.status] : void 0, l;
|
|
17
|
+
return c === r.Published && s?.publishedBy ? l = o.formatPublishedBy(s.publishedBy) : n.owner && (l = o.formatOwner(n.owner)), {
|
|
18
|
+
id: n.id,
|
|
19
|
+
version: n.displayVersion ?? "",
|
|
20
|
+
status: c,
|
|
21
|
+
folder: [o.rootLabel, ...t(n.id)].join(" / "),
|
|
22
|
+
modifiedAt: n.updatedAt == null ? void 0 : o.formatDate(n.updatedAt),
|
|
23
|
+
author: l
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as buildVersionHistoryRows, a as selectOtherVersions };
|
package/catalog.js
CHANGED
|
@@ -10,34 +10,39 @@ import { buildPromptOverview as C, isOrganisationPromptItem as w, mapPromptToCat
|
|
|
10
10
|
import { PUBLIC_SKILL_BUCKET as E, SKILL_LISTING_MAX_PAGES as D, SKILL_LISTING_PAGE_SIZE as O, SKILL_MANIFEST_MAX_BYTES as k, SkillSource as A, parseSkillResourceUrl as j } from "./skill/skill-types.js";
|
|
11
11
|
import { buildSkillContentTree as M, buildSkillOverview as N, mapSkillToCatalogItem as P, readSkillFileBytes as F, readSkillFilePreviewBytes as I, readSkillManifest as L, resolveSkillFileDownloadPath as R, resolveSkillManifestFileId as z } from "./catalog/map-skill-to-catalog-item.js";
|
|
12
12
|
import { McpResourceKind as B, buildApplicationMcpUrl as V, buildConnectApi as H, buildToolsetMcpUrl as U, resolveMcpResourceKind as W } from "./catalog/mcp-endpoint-url.js";
|
|
13
|
-
import { getPublicCatalogEntityFolderPath as G, isPublicCatalogEntityId as K,
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
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
|
-
|
|
13
|
+
import { getPublicCatalogEntityFolderPath as G, isPublicCatalogEntityId as K, isVersionedCatalogEntityType as q, mapPublishConversationResultDto as J, mapPublishHistoryEntryDto as Y, mapResourceDependencyDto as X, toPublishEntityType as Z } from "./catalog/publish.js";
|
|
14
|
+
import { createPublishDependencyIconResolver as Q } from "./catalog/publish-dependency-icons.js";
|
|
15
|
+
import { usePublishHistory as $ } from "./catalog/use-publish-history.js";
|
|
16
|
+
import { usePublishDependencies as ee } from "./catalog/use-publish-dependencies.js";
|
|
17
|
+
import { resolveUnpublishableFolders as te } from "./catalog/unpublishable-folders.js";
|
|
18
|
+
import { useUnpublishableFolders as ne } from "./catalog/useUnpublishableFolders/useUnpublishableFolders.js";
|
|
19
|
+
import { useUnpublishConfirmation as re } from "./catalog/useUnpublishConfirmation/useUnpublishConfirmation.js";
|
|
20
|
+
import { canEditShareAccess as ie, deriveAvailableTabIds as ae, deriveFavoriteItems as oe, filterCatalogItemsBySelector as se, filterHiddenOwnedItems as ce, reconcileFilterTopics as le } from "./catalog/catalog-derivations.js";
|
|
21
|
+
import { CatalogEntityKind as ue, findSchemaDisplayName as de, resolveCatalogEntityKind as fe } from "./catalog/catalog-entity-kind.js";
|
|
22
|
+
import { FavoriteEntityType as pe, useFavoriteEntitiesState as me } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
23
|
+
import { resolveFavoriteEntityType as he } from "./catalog/favorite-entity-type.js";
|
|
24
|
+
import { parseCatalogFilterTopics as ge, resolveCatalogActiveTab as _e, resolveCatalogSortKey as ve } from "./catalog/catalog-preferences.js";
|
|
25
|
+
import { findWorstCappedRow as ye } from "./catalog/usage-limit-rows.js";
|
|
26
|
+
import { CatalogPrimaryActionType as be, resolveCatalogPrimaryAction as xe } from "./catalog/catalog-primary-action.js";
|
|
27
|
+
import { useCatalogItemDelete as Se } from "./catalog/useCatalogItemDelete/useCatalogItemDelete.js";
|
|
28
|
+
import { useCatalogEditNavigation as Ce } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
29
|
+
import { useSkillItemDetails as we } from "./catalog/useSkillItemDetails.js";
|
|
30
|
+
import { useCatalogItemDetails as Te } from "./catalog/useCatalogItemDetails.js";
|
|
31
|
+
import { useCatalogToolsetCredentials as Ee } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
32
|
+
import { buildApplicationCredentialLoginParams as De, mapApplicationCredentials as Oe } from "./catalog/application-credentials.js";
|
|
33
|
+
import { useApplicationCredentials as ke } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
|
|
34
|
+
import { DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS as Ae, useApplicationCredentialActions as je } from "./catalog/useApplicationCredentialActions/useApplicationCredentialActions.js";
|
|
35
|
+
import { useSkillDetailsPanelData as Me } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
36
|
+
import { hasPublishFolderWriteAccess as Ne, rememberPublishFolderKey as Pe, usePublishFolders as Fe } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
37
|
+
import { useResourceFolders as Ie } from "./catalog/useResourceFolders/useResourceFolders.js";
|
|
38
|
+
import { parseResourceFolderPath as Le } from "./catalog/resource-folder.js";
|
|
39
|
+
import { ResourceSaveError as Re, isResourceCreateAdapter as ze } from "./catalog/resource-save-adapter.js";
|
|
40
|
+
import { ResourceNameConflictKind as Be, getResourceNameConflictKind as Ve, withResourceNameConflictMessages as He } from "./catalog/resource-name-conflict.js";
|
|
41
|
+
import { ResourceSaveOutcome as Ue, ResourceSaveVersionError as We, SaveDestinationRoot as Ge, createPublishSavedResource as Ke, runResourceSave as qe } from "./catalog/resource-save.js";
|
|
42
|
+
import { createEmbeddedApplicationSaveAdapter as Je, createHostApplicationSaveAdapter as Ye, createPromptCreateAdapter as Xe, createPromptFolderLister as Ze, createPromptSaveAdapter as Qe, createSkillFolderLister as $e, createToolsetCreateAdapter as et, createToolsetSaveAdapter as tt } from "./catalog/resource-save-adapters.js";
|
|
43
|
+
import { useResourceSavePanel as nt } from "./catalog/useResourceSavePanel/useResourceSavePanel.js";
|
|
44
|
+
import { buildVersionHistoryRows as rt, selectOtherVersions as it } from "./catalog/version-history.js";
|
|
45
|
+
import { useVersionHistory as at } from "./catalog/useVersionHistory/useVersionHistory.js";
|
|
46
|
+
import { useVersionHistorySection as ot } from "./catalog/useVersionHistory/useVersionHistorySection.js";
|
|
47
|
+
import { SkillPreviewErrorKind as st, useSkillFilePreview as ct } from "./skill/useSkillFilePreview.js";
|
|
48
|
+
export { u as AuthenticationType, ue as CatalogEntityKind, be as CatalogPrimaryActionType, Ae as DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS, m as DEFAULT_ENTITY_DETAILS_LABELS, pe as FavoriteEntityType, B as McpResourceKind, E as PUBLIC_SKILL_BUCKET, Be as ResourceNameConflictKind, Re as ResourceSaveError, Ue as ResourceSaveOutcome, We as ResourceSaveVersionError, D as SKILL_LISTING_MAX_PAGES, O as SKILL_LISTING_PAGE_SIZE, k as SKILL_MANIFEST_MAX_BYTES, Ge as SaveDestinationRoot, st as SkillPreviewErrorKind, A as SkillSource, De as buildApplicationCredentialLoginParams, V as buildApplicationMcpUrl, n as buildChatCompletionsUrl, H as buildConnectApi, r as buildDeploymentConnectApi, C as buildPromptOverview, d as buildResetFields, i as buildResponsesUrl, M as buildSkillContentTree, N as buildSkillOverview, U as buildToolsetMcpUrl, rt as buildVersionHistoryRows, ie as canEditShareAccess, a as createDeploymentLookup, Je as createEmbeddedApplicationSaveAdapter, Ye as createHostApplicationSaveAdapter, Xe as createPromptCreateAdapter, Ze as createPromptFolderLister, Qe as createPromptSaveAdapter, e as createPublishApiClient, Q as createPublishDependencyIconResolver, Ke as createPublishSavedResource, $e as createSkillFolderLister, et as createToolsetCreateAdapter, tt as createToolsetSaveAdapter, o as decodeDeploymentId, ae as deriveAvailableTabIds, oe as deriveFavoriteItems, s as encodeDeploymentId, se as filterCatalogItemsBySelector, ce as filterHiddenOwnedItems, c as findDeploymentByIdOrReference, de as findSchemaDisplayName, ye as findWorstCappedRow, G as getPublicCatalogEntityFolderPath, Ve as getResourceNameConflictKind, Ne as hasPublishFolderWriteAccess, w as isOrganisationPromptItem, K as isPublicCatalogEntityId, ze as isResourceCreateAdapter, q as isVersionedCatalogEntityType, Oe as mapApplicationCredentials, h as mapDeploymentDetailsDtoToEntityDetails, p as mapDeploymentLimitsDtoToCatalogLimits, f as mapDeploymentLimitsToInput, v as mapDeploymentToCatalogItem, y as mapDeploymentToolsetCredentials, g as mapEntityDetailsToCatalogDetails, T as mapPromptToCatalogItem, J as mapPublishConversationResultDto, Y as mapPublishHistoryEntryDto, X as mapResourceDependencyDto, P as mapSkillToCatalogItem, _ as mapToolsetCredentials, b as mapToolsetToCatalogItem, l as normalizeDeploymentId, ge as parseCatalogFilterTopics, Le as parseResourceFolderPath, j as parseSkillResourceUrl, F as readSkillFileBytes, I as readSkillFilePreviewBytes, L as readSkillManifest, le as reconcileFilterTopics, Pe as rememberPublishFolderKey, _e as resolveCatalogActiveTab, fe as resolveCatalogEntityKind, xe as resolveCatalogPrimaryAction, ve as resolveCatalogSortKey, x as resolveDeploymentFolder, he as resolveFavoriteEntityType, W as resolveMcpResourceKind, R as resolveSkillFileDownloadPath, z as resolveSkillManifestFileId, te as resolveUnpublishableFolders, qe as runResourceSave, it as selectOtherVersions, S as supportsChatInterface, Z as toPublishEntityType, t as toPublishRuleDto, je as useApplicationCredentialActions, ke as useApplicationCredentials, Ce as useCatalogEditNavigation, Se as useCatalogItemDelete, Te as useCatalogItemDetails, Ee as useCatalogToolsetCredentials, me as useFavoriteEntitiesState, ee as usePublishDependencies, Fe as usePublishFolders, $ as usePublishHistory, Ie as useResourceFolders, nt as useResourceSavePanel, Me as useSkillDetailsPanelData, ct as useSkillFilePreview, we as useSkillItemDetails, re as useUnpublishConfirmation, ne as useUnpublishableFolders, at as useVersionHistory, ot as useVersionHistorySection, He as withResourceNameConflictMessages };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnnouncementSeverity as AnnouncementSeverityDto } from '@epam/ai-dial-chat-api-client';
|
|
1
2
|
/** A link rendered as the call to action of an announcements-popover entry. */
|
|
2
3
|
export interface AnnouncementListItemLink {
|
|
3
4
|
/** Visible text of the call to action. */
|
|
@@ -5,6 +6,13 @@ export interface AnnouncementListItemLink {
|
|
|
5
6
|
/** Absolute `http`/`https` target the call to action opens. */
|
|
6
7
|
href: string;
|
|
7
8
|
}
|
|
9
|
+
/** How urgent an announcements-popover entry is. */
|
|
10
|
+
export declare enum AnnouncementSeverity {
|
|
11
|
+
/** An ordinary news item. */
|
|
12
|
+
Info = "info",
|
|
13
|
+
/** A maintenance or outage notice a host may mark, for example with an icon. */
|
|
14
|
+
Warning = "warning"
|
|
15
|
+
}
|
|
8
16
|
/** One entry of the announcements popover behind the banner's `+N` pill. */
|
|
9
17
|
export interface AnnouncementListItem {
|
|
10
18
|
/** Plain-text heading of the entry. */
|
|
@@ -13,7 +21,11 @@ export interface AnnouncementListItem {
|
|
|
13
21
|
description?: string | null;
|
|
14
22
|
/** Optional call to action shown at the end of the entry. */
|
|
15
23
|
link?: AnnouncementListItemLink | null;
|
|
24
|
+
/** How urgent the entry is. Absent means `AnnouncementSeverity.Info`. */
|
|
25
|
+
severity?: AnnouncementSeverity;
|
|
16
26
|
}
|
|
27
|
+
/** Returns the `AnnouncementSeverity` for a generated-client severity, or `Info` when it is missing or unknown. */
|
|
28
|
+
export declare const mapAnnouncementSeverity: (severity: AnnouncementSeverityDto | null | undefined) => AnnouncementSeverity;
|
|
17
29
|
/** Structured announcement banner content. */
|
|
18
30
|
export interface AnnouncementContent {
|
|
19
31
|
title: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcement-message.d.ts","sourceRoot":"","sources":["../../src/conversation/announcement-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"announcement-message.d.ts","sourceRoot":"","sources":["../../src/conversation/announcement-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAgChG,+EAA+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oDAAoD;AACpD,oBAAY,oBAAoB;IAC9B,6BAA6B;IAC7B,IAAI,SAAS;IACb,gFAAgF;IAChF,OAAO,YAAY;CACpB;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACvC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAYD,mHAAmH;AACnH,eAAO,MAAM,uBAAuB,GAClC,UAAU,uBAAuB,GAAG,IAAI,GAAG,SAAS,KACnD,oBAGwB,CAAC;AAE5B,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;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACzC;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;AA+BjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,mBAAmB,KAC3B,MAgBF,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import { AnnouncementSeverity as e } from "@epam/ai-dial-chat-api-client";
|
|
2
|
+
import t from "dompurify";
|
|
2
3
|
//#region src/conversation/announcement-message.ts
|
|
3
|
-
var
|
|
4
|
+
var n = {
|
|
4
5
|
ALLOWED_TAGS: [
|
|
5
6
|
"a",
|
|
6
7
|
"b",
|
|
@@ -14,7 +15,7 @@ var t = {
|
|
|
14
15
|
"target",
|
|
15
16
|
"rel"
|
|
16
17
|
]
|
|
17
|
-
},
|
|
18
|
+
}, r = {
|
|
18
19
|
ALLOWED_TAGS: [
|
|
19
20
|
"a",
|
|
20
21
|
"b",
|
|
@@ -30,24 +31,29 @@ var t = {
|
|
|
30
31
|
"target",
|
|
31
32
|
"rel"
|
|
32
33
|
]
|
|
33
|
-
}
|
|
34
|
-
e.
|
|
34
|
+
}, i = /* @__PURE__ */ function(e) {
|
|
35
|
+
return e.Info = "info", e.Warning = "warning", e;
|
|
36
|
+
}({}), a = {
|
|
37
|
+
[e.Info]: "info",
|
|
38
|
+
[e.Warning]: "warning"
|
|
39
|
+
}, o = (e) => e != null && a[e] || "info";
|
|
40
|
+
t.addHook("afterSanitizeAttributes", (e) => {
|
|
35
41
|
e.tagName === "A" && e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer");
|
|
36
42
|
});
|
|
37
|
-
var
|
|
43
|
+
var s = (e) => t.sanitize(e, n), c = (e) => t.sanitize(e, r), l = (e) => typeof e == "string" && e.length > 0, u = ({ title: e, description: t }) => l(e) || l(t), d = (e) => u(e) || l(e.html), f = (e) => e.map((e) => ({
|
|
38
44
|
title: e.title,
|
|
39
45
|
description: e.description ?? "",
|
|
40
46
|
link: e.link ? {
|
|
41
47
|
label: e.link.label,
|
|
42
48
|
href: e.link.href
|
|
43
49
|
} : null
|
|
44
|
-
})),
|
|
45
|
-
if (!
|
|
50
|
+
})), p = (e) => {
|
|
51
|
+
if (!u(e)) return e.html ?? "";
|
|
46
52
|
let t = {
|
|
47
53
|
title: e.title ?? "",
|
|
48
54
|
description: e.description ?? ""
|
|
49
55
|
}, n = e.items ?? [];
|
|
50
|
-
return n.length > 0 && (t.items =
|
|
56
|
+
return n.length > 0 && (t.items = f(n)), JSON.stringify(t);
|
|
51
57
|
};
|
|
52
58
|
//#endregion
|
|
53
|
-
export {
|
|
59
|
+
export { i as AnnouncementSeverity, p as buildAnnouncementSignature, d as hasAnnouncementContent, u as hasStructuredAnnouncement, o as mapAnnouncementSeverity, s as sanitizeAnnouncementHtml, c as sanitizeAnnouncementMessageHtml };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation-resume.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/generation-resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,OAAO,EAEb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AASxE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,OAAO,KAAG,OAWtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAC5C,cAAc,YAAY,KACzB,MAKA,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,cAAc,YAAY,EAC1B,MAAK,MAAmB,KACvB,MAKA,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,YAAY,KACzB,OAWF,CAAC;
|
|
1
|
+
{"version":3,"file":"generation-resume.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/generation-resume.ts"],"names":[],"mappings":"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"}
|
|
@@ -13,165 +13,188 @@ var u = (e) => {
|
|
|
13
13
|
if (d(e) !== -1 || f(e) !== -1) return !0;
|
|
14
14
|
let t = e.messages[e.messages.length - 1];
|
|
15
15
|
return !!t && t.role === l.Assistant && !u(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
|
|
16
|
-
}, m = 3e5, h = "awaiting-resume",
|
|
16
|
+
}, m = 3e5, h = 1e3, g = "awaiting-resume", _ = [
|
|
17
17
|
1e3,
|
|
18
18
|
2e3,
|
|
19
19
|
4e3,
|
|
20
20
|
8e3,
|
|
21
21
|
16e3
|
|
22
|
-
],
|
|
22
|
+
], v = (e) => new Promise((t) => {
|
|
23
23
|
let n = typeof window < "u", r = () => {
|
|
24
24
|
clearTimeout(i), n && window.removeEventListener("online", r), t();
|
|
25
25
|
}, i = setTimeout(r, e);
|
|
26
26
|
n && window.addEventListener("online", r);
|
|
27
|
-
}),
|
|
28
|
-
for (let r = 0; r <=
|
|
27
|
+
}), y = async (e, t, n) => {
|
|
28
|
+
for (let r = 0; r <= _.length; r++) {
|
|
29
29
|
if (t()) return null;
|
|
30
30
|
try {
|
|
31
31
|
let t = await e();
|
|
32
32
|
if (!n?.(t)) return t;
|
|
33
33
|
} catch {}
|
|
34
|
-
if (r ===
|
|
35
|
-
await _
|
|
34
|
+
if (r === _.length) return null;
|
|
35
|
+
await v(_[r]);
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
|
-
},
|
|
38
|
+
}, b = ({ transport: c, setConversation: l, conversationRef: _, resumingPathsRef: v, bufferedGenerationsRef: y, addStreamingPath: b, removeStreamingPath: x, isPathDisplayed: S, generationPersistenceErrorMessage: C = n, generationInterruptedMessage: w = t, frameScheduler: T, stoppedGenerationIdsRef: E, rememberResumedGenerationId: D, forgetResumedGenerationId: O, onReloadError: k, onReloadSuccess: A }) => (t, n, j = {}) => {
|
|
39
39
|
if (!p(n)) {
|
|
40
|
-
|
|
40
|
+
j.onSettled?.();
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
if (!
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
generationId:
|
|
50
|
-
messageIndex:
|
|
51
|
-
message:
|
|
43
|
+
let M = a(t);
|
|
44
|
+
if (!j.skipDedupe && v.current.has(M)) return;
|
|
45
|
+
v.current.add(M), b(M);
|
|
46
|
+
let N = d(n), P = N !== -1, F = P ? -1 : f(n), I = n.messages.length - 1;
|
|
47
|
+
P ? I = N : F !== -1 && (I = F);
|
|
48
|
+
let L = {
|
|
49
|
+
generationId: g,
|
|
50
|
+
messageIndex: I,
|
|
51
|
+
message: j.seedMessage ?? n.messages[I]
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
let
|
|
55
|
-
let e =
|
|
56
|
-
return e != null && (
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
if (
|
|
61
|
-
let e =
|
|
62
|
-
|
|
53
|
+
y.current.set(M, L);
|
|
54
|
+
let R = () => y.current.get(M) === L, z = P ? n.messages[I].backgroundGeneration?.generationId : void 0, B, V = () => {
|
|
55
|
+
let e = z ?? B;
|
|
56
|
+
return e != null && (E?.current.has(e) ?? !1);
|
|
57
|
+
}, H = (e) => {
|
|
58
|
+
j.trackAttachGenerationId && !P && e != null && R() && (B = e, D?.(M, e));
|
|
59
|
+
}, U = () => {
|
|
60
|
+
if (B == null) return;
|
|
61
|
+
let e = B;
|
|
62
|
+
B = void 0, E?.current.delete(e), O?.(M, e);
|
|
63
63
|
};
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
...
|
|
68
|
-
streamErrorMessage:
|
|
64
|
+
F !== -1 && H(n.messages[F].foregroundGeneration?.generationId);
|
|
65
|
+
let W = (e) => !!j.shouldMarkOrphanedAsInterrupted && !P && !!e && e.messages.length - 1 === I && d(e) === -1 && f(e) === -1 && p(e) && !u(L.message), G = () => {
|
|
66
|
+
L.message = {
|
|
67
|
+
...L.message,
|
|
68
|
+
streamErrorMessage: w
|
|
69
69
|
};
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
if (!e || !
|
|
73
|
-
let t = s(e,
|
|
74
|
-
return
|
|
70
|
+
}, K = () => {
|
|
71
|
+
R() && (G(), v.current.delete(M), x(M), U(), S(M) && l((e) => {
|
|
72
|
+
if (!e || !R() || !S(M)) return e;
|
|
73
|
+
let t = s(e, L);
|
|
74
|
+
return _.current = t, t;
|
|
75
75
|
}));
|
|
76
|
-
},
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
let n = !
|
|
80
|
-
if (t || n)
|
|
81
|
-
...
|
|
82
|
-
streamErrorMessage:
|
|
83
|
-
},
|
|
84
|
-
if (!e || !
|
|
85
|
-
let t = s(e,
|
|
86
|
-
return
|
|
76
|
+
}, q = (e, t = !1) => {
|
|
77
|
+
if (T?.flush(M), z != null && E?.current.delete(z), U(), !R()) return;
|
|
78
|
+
v.current.delete(M), x(M);
|
|
79
|
+
let n = !P && e && e.messages.length - 1 === I && p(e) && u(L.message);
|
|
80
|
+
if (t || n) L.message = {
|
|
81
|
+
...L.message,
|
|
82
|
+
streamErrorMessage: C
|
|
83
|
+
}, S(M) && l((e) => {
|
|
84
|
+
if (!e || !R() || !S(M)) return e;
|
|
85
|
+
let t = s(e, L);
|
|
86
|
+
return _.current = t, t;
|
|
87
87
|
});
|
|
88
|
-
else if (
|
|
89
|
-
let t =
|
|
90
|
-
t &&
|
|
91
|
-
let n = t ? s(e,
|
|
92
|
-
l(n),
|
|
88
|
+
else if (y.current.delete(M), e && S(M)) {
|
|
89
|
+
let t = W(e);
|
|
90
|
+
t && G();
|
|
91
|
+
let n = t ? s(e, L) : e;
|
|
92
|
+
l(n), _.current = n;
|
|
93
93
|
}
|
|
94
|
-
},
|
|
95
|
-
if (
|
|
94
|
+
}, J = async () => {
|
|
95
|
+
if (R()) try {
|
|
96
96
|
let n = await c.getConversation(e(t));
|
|
97
|
-
if (!
|
|
98
|
-
|
|
97
|
+
if (!R()) return;
|
|
98
|
+
A?.(M), q(n);
|
|
99
99
|
} catch {
|
|
100
|
-
if (!
|
|
101
|
-
|
|
100
|
+
if (!R()) return;
|
|
101
|
+
T?.flush(M), v.current.delete(M), x(M), z != null && E?.current.delete(z), U(), k?.(M, J, R);
|
|
102
102
|
}
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
if (!e || !
|
|
106
|
-
let t = s(e,
|
|
107
|
-
return
|
|
103
|
+
}, Y = (e) => {
|
|
104
|
+
T?.cancel(M), R() && (L.message = e, S(M) && l((e) => {
|
|
105
|
+
if (!e || !R() || !S(M)) return e;
|
|
106
|
+
let t = s(e, L);
|
|
107
|
+
return _.current = t, t;
|
|
108
108
|
}));
|
|
109
|
-
},
|
|
110
|
-
if (!e || !
|
|
111
|
-
let t = s(e,
|
|
112
|
-
return
|
|
113
|
-
}),
|
|
114
|
-
if (!
|
|
115
|
-
let t = o([
|
|
116
|
-
t && (
|
|
117
|
-
},
|
|
118
|
-
let
|
|
109
|
+
}, X = () => l((e) => {
|
|
110
|
+
if (!e || !R() || !S(M)) return e;
|
|
111
|
+
let t = s(e, L);
|
|
112
|
+
return _.current = t, t;
|
|
113
|
+
}), Z = (e) => {
|
|
114
|
+
if (!R() || V()) return;
|
|
115
|
+
let t = o([L.message], 0, e);
|
|
116
|
+
t && (L.message = t[0]), S(M) && (T ? T.schedule(M, X) : X());
|
|
117
|
+
}, Q = async () => {
|
|
118
|
+
let r = new AbortController(), a;
|
|
119
119
|
try {
|
|
120
|
-
|
|
120
|
+
a = await c.watchConversation(M, r.signal);
|
|
121
121
|
} catch {
|
|
122
|
-
await
|
|
122
|
+
await J();
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
+
let o;
|
|
125
126
|
try {
|
|
126
|
-
let
|
|
127
|
-
if (!p(
|
|
128
|
-
|
|
127
|
+
let n = await c.getConversation(e(t));
|
|
128
|
+
if (!p(n)) {
|
|
129
|
+
r.abort(), a.cancel().catch(() => void 0), q(n);
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
+
W(n) && K(), o = n;
|
|
132
133
|
} catch {}
|
|
133
|
-
let
|
|
134
|
-
|
|
135
|
-
}, m)
|
|
134
|
+
let s = !1, l = window.setTimeout(() => {
|
|
135
|
+
r.abort();
|
|
136
|
+
}, m), u, d = 0, g = (n, i = !1) => {
|
|
137
|
+
i || window.clearTimeout(u);
|
|
138
|
+
let o = f(n);
|
|
139
|
+
if (o === -1) return;
|
|
140
|
+
let l = n.messages[o].foregroundGeneration?.expiresAt;
|
|
141
|
+
if (l == null || i && l <= d) return;
|
|
142
|
+
d = l, window.clearTimeout(u);
|
|
143
|
+
let m = Math.max(l - Date.now() + h, h);
|
|
144
|
+
u = window.setTimeout(async () => {
|
|
145
|
+
if (!s && R()) try {
|
|
146
|
+
let n = await c.getConversation(e(t));
|
|
147
|
+
if (s || !R()) return;
|
|
148
|
+
if (!p(n)) {
|
|
149
|
+
s = !0, r.abort(), a.cancel().catch(() => void 0), q(n);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
W(n) && K(), g(n, !0);
|
|
153
|
+
} catch {}
|
|
154
|
+
}, m);
|
|
155
|
+
};
|
|
156
|
+
o ? g(o) : F !== -1 && g(n);
|
|
136
157
|
try {
|
|
137
|
-
await i(
|
|
158
|
+
await i(a, async (n) => {
|
|
138
159
|
if (n?.action !== "UPDATE") return !1;
|
|
139
160
|
try {
|
|
140
161
|
let n = await c.getConversation(e(t));
|
|
141
|
-
if (
|
|
162
|
+
if (s) return !0;
|
|
163
|
+
if (!p(n)) return q(n), s = !0, !0;
|
|
164
|
+
g(n);
|
|
142
165
|
} catch {}
|
|
143
166
|
return !1;
|
|
144
167
|
});
|
|
145
168
|
} finally {
|
|
146
|
-
clearTimeout(
|
|
169
|
+
window.clearTimeout(l), window.clearTimeout(u);
|
|
147
170
|
}
|
|
148
|
-
|
|
149
|
-
},
|
|
171
|
+
s || await J();
|
|
172
|
+
}, $ = async () => {
|
|
150
173
|
let e = new AbortController(), t;
|
|
151
174
|
try {
|
|
152
|
-
t = await c.attachToGeneration(
|
|
175
|
+
t = await c.attachToGeneration(M, e.signal);
|
|
153
176
|
} catch {
|
|
154
177
|
return !1;
|
|
155
178
|
}
|
|
156
179
|
let n = !1, a = !1;
|
|
157
180
|
return await i(t, (e) => {
|
|
158
|
-
if (!
|
|
181
|
+
if (!R()) return !0;
|
|
159
182
|
switch (e.type) {
|
|
160
|
-
case "snapshot": return
|
|
161
|
-
case "chunk": return
|
|
183
|
+
case "snapshot": return H(e.generationId), Y(e.message), !1;
|
|
184
|
+
case "chunk": return Z(e.chunk), !1;
|
|
162
185
|
case "done":
|
|
163
186
|
case "error":
|
|
164
187
|
case "stopped": return a = e.type === "error" && e.errorType === r.type, n = !0, !0;
|
|
165
188
|
}
|
|
166
|
-
}), n ? (a ?
|
|
189
|
+
}), n ? (a ? q(void 0, !0) : await J(), !0) : (U(), !R());
|
|
167
190
|
};
|
|
168
191
|
(async () => {
|
|
169
192
|
try {
|
|
170
|
-
await
|
|
193
|
+
await $() || await Q();
|
|
171
194
|
} finally {
|
|
172
|
-
|
|
195
|
+
j.onSettled?.();
|
|
173
196
|
}
|
|
174
197
|
})();
|
|
175
198
|
};
|
|
176
199
|
//#endregion
|
|
177
|
-
export {
|
|
200
|
+
export { _ as RECOVERY_REFETCH_DELAYS_MS, b as createResumeIfAwaitingGeneration, y as fetchConversationForRecovery, f as findLiveForegroundMessageIndex, d as findPendingBackgroundMessageIndex, u as hasGeneratedPayload, p as isAwaitingGenerationResume };
|