@epam/ai-dial-chat-hooks 1.4.0-dev.8 → 1.4.0-dev.81

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.
Files changed (118) hide show
  1. package/attachment/useAttachmentAction/useAttachmentAction.d.ts +1 -1
  2. package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
  3. package/attachment/useAttachmentAction/useAttachmentAction.js +35 -44
  4. package/catalog/create-publish-api.d.ts +9 -1
  5. package/catalog/create-publish-api.d.ts.map +1 -1
  6. package/catalog/create-publish-api.js +8 -0
  7. package/catalog/entity-details.d.ts +5 -2
  8. package/catalog/entity-details.d.ts.map +1 -1
  9. package/catalog/map-entity-details-to-catalog.d.ts +4 -0
  10. package/catalog/map-entity-details-to-catalog.d.ts.map +1 -1
  11. package/catalog/map-entity-details-to-catalog.js +15 -13
  12. package/catalog/publish-dependency-icons.d.ts +22 -0
  13. package/catalog/publish-dependency-icons.d.ts.map +1 -0
  14. package/catalog/publish-dependency-icons.js +11 -0
  15. package/catalog/publish.d.ts +15 -2
  16. package/catalog/publish.d.ts.map +1 -1
  17. package/catalog/publish.js +15 -4
  18. package/catalog/use-publish-dependencies.d.ts +19 -0
  19. package/catalog/use-publish-dependencies.d.ts.map +1 -0
  20. package/catalog/use-publish-dependencies.js +25 -0
  21. package/catalog/useVersionHistory/useVersionHistory.d.ts +38 -0
  22. package/catalog/useVersionHistory/useVersionHistory.d.ts.map +1 -0
  23. package/catalog/useVersionHistory/useVersionHistory.js +49 -0
  24. package/catalog/useVersionHistory/useVersionHistorySection.d.ts +30 -0
  25. package/catalog/useVersionHistory/useVersionHistorySection.d.ts.map +1 -0
  26. package/catalog/useVersionHistory/useVersionHistorySection.js +31 -0
  27. package/catalog/version-history.d.ts +42 -0
  28. package/catalog/version-history.d.ts.map +1 -0
  29. package/catalog/version-history.js +27 -0
  30. package/catalog.js +36 -31
  31. package/conversation/announcement-message.d.ts +12 -0
  32. package/conversation/announcement-message.d.ts.map +1 -1
  33. package/conversation/announcement-message.js +16 -10
  34. package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
  35. package/conversation/useConversationStream/generation-resume.js +119 -96
  36. package/conversation.js +44 -44
  37. package/entry-points/catalog.d.ts +5 -0
  38. package/entry-points/catalog.d.ts.map +1 -1
  39. package/entry-points/file-manager.d.ts +1 -0
  40. package/entry-points/file-manager.d.ts.map +1 -1
  41. package/entry-points/project.d.ts +5 -0
  42. package/entry-points/project.d.ts.map +1 -1
  43. package/entry-points/scheduled-tasks.d.ts +1 -0
  44. package/entry-points/scheduled-tasks.d.ts.map +1 -1
  45. package/entry-points/utils.d.ts +3 -0
  46. package/entry-points/utils.d.ts.map +1 -1
  47. package/file-manager.js +33 -32
  48. package/files/annotation.d.ts +3 -3
  49. package/files/annotation.d.ts.map +1 -1
  50. package/files/annotation.js +12 -11
  51. package/files/attachment-canvas.d.ts +1 -1
  52. package/files/attachment-canvas.d.ts.map +1 -1
  53. package/files/attachment-canvas.js +135 -135
  54. package/files/attachment-type-labels.d.ts +3 -0
  55. package/files/attachment-type-labels.d.ts.map +1 -0
  56. package/files/attachment-type-labels.js +12 -0
  57. package/files/attachment-types.d.ts +0 -2
  58. package/files/attachment-types.d.ts.map +1 -1
  59. package/files/attachment-types.js +7 -14
  60. package/files/dial-file.d.ts +18 -0
  61. package/files/dial-file.d.ts.map +1 -1
  62. package/files/dial-file.js +30 -5
  63. package/index.d.ts +15 -0
  64. package/index.d.ts.map +1 -1
  65. package/index.js +255 -241
  66. package/org-units/models.d.ts +9 -0
  67. package/org-units/models.d.ts.map +1 -0
  68. package/org-units/types.d.ts +14 -0
  69. package/org-units/types.d.ts.map +1 -0
  70. package/org-units/types.js +6 -0
  71. package/org-units/useOrgUnits/useOrgUnits.d.ts +19 -0
  72. package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -0
  73. package/org-units/useOrgUnits/useOrgUnits.js +34 -0
  74. package/package.json +19 -19
  75. package/project/project-sharing-client.d.ts +8 -0
  76. package/project/project-sharing-client.d.ts.map +1 -0
  77. package/project/project-sharing-client.js +11 -0
  78. package/project/project-sharing.d.ts +28 -0
  79. package/project/project-sharing.d.ts.map +1 -0
  80. package/project/project-sharing.js +22 -0
  81. package/project/use-pinned-project-chats.d.ts +4 -2
  82. package/project/use-pinned-project-chats.d.ts.map +1 -1
  83. package/project/use-pinned-project-chats.js +152 -96
  84. package/project/use-project-conversations.d.ts.map +1 -1
  85. package/project/use-project-conversations.js +2 -2
  86. package/project/use-project-remove-from-list.d.ts +30 -0
  87. package/project/use-project-remove-from-list.d.ts.map +1 -0
  88. package/project/use-project-remove-from-list.js +39 -0
  89. package/project/use-project-revoke-access.d.ts +15 -0
  90. package/project/use-project-revoke-access.d.ts.map +1 -0
  91. package/project/use-project-revoke-access.js +32 -0
  92. package/project/use-project-share-recipients.d.ts +7 -0
  93. package/project/use-project-share-recipients.d.ts.map +1 -0
  94. package/project/use-project-share-recipients.js +36 -0
  95. package/project/use-projects.d.ts +1 -0
  96. package/project/use-projects.d.ts.map +1 -1
  97. package/project/use-projects.js +2 -1
  98. package/project.js +7 -2
  99. package/scheduled-task/scheduled-task-description.d.ts +19 -13
  100. package/scheduled-task/scheduled-task-description.d.ts.map +1 -1
  101. package/scheduled-task/scheduled-task-description.js +39 -55
  102. package/scheduled-task/scheduled-task-display.d.ts +19 -5
  103. package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
  104. package/scheduled-task/scheduled-task-display.js +43 -38
  105. package/scheduled-task/scheduled-task-next-occurrence.d.ts +7 -5
  106. package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
  107. package/scheduled-task/scheduled-task-next-occurrence.js +15 -15
  108. package/scheduled-task/scheduled-task-trigger.d.ts +6 -4
  109. package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
  110. package/scheduled-task/scheduled-task-trigger.js +92 -115
  111. package/scheduled-tasks.js +14 -13
  112. package/shared/timezones.d.ts +30 -0
  113. package/shared/timezones.d.ts.map +1 -0
  114. package/shared/timezones.js +102 -0
  115. package/utils.js +5 -3
  116. package/shared/cron-day-of-month.d.ts +0 -21
  117. package/shared/cron-day-of-month.d.ts.map +0 -1
  118. 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, mapPublishConversationResultDto as q, mapPublishHistoryEntryDto as J, toPublishEntityType as Y } from "./catalog/publish.js";
14
- import { usePublishHistory as X } from "./catalog/use-publish-history.js";
15
- import { resolveUnpublishableFolders as Z } from "./catalog/unpublishable-folders.js";
16
- import { useUnpublishableFolders as Q } from "./catalog/useUnpublishableFolders/useUnpublishableFolders.js";
17
- import { useUnpublishConfirmation as $ } from "./catalog/useUnpublishConfirmation/useUnpublishConfirmation.js";
18
- import { canEditShareAccess as ee, deriveAvailableTabIds as te, deriveFavoriteItems as ne, filterCatalogItemsBySelector as re, filterHiddenOwnedItems as ie, reconcileFilterTopics as ae } from "./catalog/catalog-derivations.js";
19
- import { CatalogEntityKind as oe, findSchemaDisplayName as se, resolveCatalogEntityKind as ce } from "./catalog/catalog-entity-kind.js";
20
- import { FavoriteEntityType as le, useFavoriteEntitiesState as ue } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
21
- import { resolveFavoriteEntityType as de } from "./catalog/favorite-entity-type.js";
22
- import { parseCatalogFilterTopics as fe, resolveCatalogActiveTab as pe, resolveCatalogSortKey as me } from "./catalog/catalog-preferences.js";
23
- import { findWorstCappedRow as he } from "./catalog/usage-limit-rows.js";
24
- import { CatalogPrimaryActionType as ge, resolveCatalogPrimaryAction as _e } from "./catalog/catalog-primary-action.js";
25
- import { useCatalogItemDelete as ve } from "./catalog/useCatalogItemDelete/useCatalogItemDelete.js";
26
- import { useCatalogEditNavigation as ye } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
27
- import { useSkillItemDetails as be } from "./catalog/useSkillItemDetails.js";
28
- import { useCatalogItemDetails as xe } from "./catalog/useCatalogItemDetails.js";
29
- import { useCatalogToolsetCredentials as Se } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
30
- import { buildApplicationCredentialLoginParams as Ce, mapApplicationCredentials as we } from "./catalog/application-credentials.js";
31
- import { useApplicationCredentials as Te } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
32
- import { DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS as Ee, useApplicationCredentialActions as De } from "./catalog/useApplicationCredentialActions/useApplicationCredentialActions.js";
33
- import { useSkillDetailsPanelData as Oe } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
34
- import { hasPublishFolderWriteAccess as ke, rememberPublishFolderKey as Ae, usePublishFolders as je } from "./catalog/usePublishFolders/usePublishFolders.js";
35
- import { useResourceFolders as Me } from "./catalog/useResourceFolders/useResourceFolders.js";
36
- import { parseResourceFolderPath as Ne } from "./catalog/resource-folder.js";
37
- import { ResourceSaveError as Pe, isResourceCreateAdapter as Fe } from "./catalog/resource-save-adapter.js";
38
- import { ResourceNameConflictKind as Ie, getResourceNameConflictKind as Le, withResourceNameConflictMessages as Re } from "./catalog/resource-name-conflict.js";
39
- import { ResourceSaveOutcome as ze, ResourceSaveVersionError as Be, SaveDestinationRoot as Ve, createPublishSavedResource as He, runResourceSave as Ue } from "./catalog/resource-save.js";
40
- import { createEmbeddedApplicationSaveAdapter as We, createHostApplicationSaveAdapter as Ge, createPromptCreateAdapter as Ke, createPromptFolderLister as qe, createPromptSaveAdapter as Je, createSkillFolderLister as Ye, createToolsetCreateAdapter as Xe, createToolsetSaveAdapter as Ze } from "./catalog/resource-save-adapters.js";
41
- import { useResourceSavePanel as Qe } from "./catalog/useResourceSavePanel/useResourceSavePanel.js";
42
- import { SkillPreviewErrorKind as $e, useSkillFilePreview as et } from "./skill/useSkillFilePreview.js";
43
- export { u as AuthenticationType, oe as CatalogEntityKind, ge as CatalogPrimaryActionType, Ee as DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS, m as DEFAULT_ENTITY_DETAILS_LABELS, le as FavoriteEntityType, B as McpResourceKind, E as PUBLIC_SKILL_BUCKET, Ie as ResourceNameConflictKind, Pe as ResourceSaveError, ze as ResourceSaveOutcome, Be as ResourceSaveVersionError, D as SKILL_LISTING_MAX_PAGES, O as SKILL_LISTING_PAGE_SIZE, k as SKILL_MANIFEST_MAX_BYTES, Ve as SaveDestinationRoot, $e as SkillPreviewErrorKind, A as SkillSource, Ce 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, ee as canEditShareAccess, a as createDeploymentLookup, We as createEmbeddedApplicationSaveAdapter, Ge as createHostApplicationSaveAdapter, Ke as createPromptCreateAdapter, qe as createPromptFolderLister, Je as createPromptSaveAdapter, e as createPublishApiClient, He as createPublishSavedResource, Ye as createSkillFolderLister, Xe as createToolsetCreateAdapter, Ze as createToolsetSaveAdapter, o as decodeDeploymentId, te as deriveAvailableTabIds, ne as deriveFavoriteItems, s as encodeDeploymentId, re as filterCatalogItemsBySelector, ie as filterHiddenOwnedItems, c as findDeploymentByIdOrReference, se as findSchemaDisplayName, he as findWorstCappedRow, G as getPublicCatalogEntityFolderPath, Le as getResourceNameConflictKind, ke as hasPublishFolderWriteAccess, w as isOrganisationPromptItem, K as isPublicCatalogEntityId, Fe as isResourceCreateAdapter, we as mapApplicationCredentials, h as mapDeploymentDetailsDtoToEntityDetails, p as mapDeploymentLimitsDtoToCatalogLimits, f as mapDeploymentLimitsToInput, v as mapDeploymentToCatalogItem, y as mapDeploymentToolsetCredentials, g as mapEntityDetailsToCatalogDetails, T as mapPromptToCatalogItem, q as mapPublishConversationResultDto, J as mapPublishHistoryEntryDto, P as mapSkillToCatalogItem, _ as mapToolsetCredentials, b as mapToolsetToCatalogItem, l as normalizeDeploymentId, fe as parseCatalogFilterTopics, Ne as parseResourceFolderPath, j as parseSkillResourceUrl, F as readSkillFileBytes, I as readSkillFilePreviewBytes, L as readSkillManifest, ae as reconcileFilterTopics, Ae as rememberPublishFolderKey, pe as resolveCatalogActiveTab, ce as resolveCatalogEntityKind, _e as resolveCatalogPrimaryAction, me as resolveCatalogSortKey, x as resolveDeploymentFolder, de as resolveFavoriteEntityType, W as resolveMcpResourceKind, R as resolveSkillFileDownloadPath, z as resolveSkillManifestFileId, Z as resolveUnpublishableFolders, Ue as runResourceSave, S as supportsChatInterface, Y as toPublishEntityType, t as toPublishRuleDto, De as useApplicationCredentialActions, Te as useApplicationCredentials, ye as useCatalogEditNavigation, ve as useCatalogItemDelete, xe as useCatalogItemDetails, Se as useCatalogToolsetCredentials, ue as useFavoriteEntitiesState, je as usePublishFolders, X as usePublishHistory, Me as useResourceFolders, Qe as useResourceSavePanel, Oe as useSkillDetailsPanelData, et as useSkillFilePreview, be as useSkillItemDetails, $ as useUnpublishConfirmation, Q as useUnpublishableFolders, Re as withResourceNameConflictMessages };
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":"AA+BA,+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,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;CACxC;AAED,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;AA2BjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,mBAAmB,KAC3B,MAgBF,CAAC"}
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 "dompurify";
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 t = {
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
- }, n = {
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.addHook("afterSanitizeAttributes", (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 r = (n) => e.sanitize(n, t), i = (t) => e.sanitize(t, n), a = (e) => typeof e == "string" && e.length > 0, o = ({ title: e, description: t }) => a(e) || a(t), s = (e) => o(e) || a(e.html), c = (e) => e.map((e) => ({
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
- })), l = (e) => {
45
- if (!o(e)) return e.html ?? "";
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 = c(n)), JSON.stringify(t);
56
+ return n.length > 0 && (t.items = f(n)), JSON.stringify(t);
51
57
  };
52
58
  //#endregion
53
- export { l as buildAnnouncementSignature, s as hasAnnouncementContent, o as hasStructuredAnnouncement, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml };
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/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E,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1E;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,GAAI,sVAiB9C,8BAA8B,MAE7B,uBAAuB,MAAM,EAC7B,cAAc,YAAY,EAC1B,UAAS,uBAA4B,KACpC,IA2WJ,CAAC"}
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;AAqCF,eAAO,MAAM,0BAA0B,UAAkC,CAAC;AAe1E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,OAAO,CAAC,YAAY,CAAC,EACjC,YAAY,MAAM,OAAO,EACzB,YAAY,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,KAClD,OAAO,CAAC,YAAY,GAAG,IAAI,CAiB7B,CAAC;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Ac,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,kGAAkG;IAClG,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E;;;OAGG;IACH,yBAAyB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1E;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,GAAI,sVAiB9C,8BAA8B,MAE7B,uBAAuB,MAAM,EAC7B,cAAc,YAAY,EAC1B,UAAS,uBAA4B,KACpC,IA0aJ,CAAC"}
@@ -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", g = [
16
+ }, m = 3e5, h = 1e3, g = "awaiting-resume", _ = [
17
17
  1e3,
18
18
  2e3,
19
19
  4e3,
20
20
  8e3,
21
21
  16e3
22
- ], _ = (e) => new Promise((t) => {
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
- }), v = async (e, t, n) => {
28
- for (let r = 0; r <= g.length; 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 === g.length) return null;
35
- await _(g[r]);
34
+ if (r === _.length) return null;
35
+ await v(_[r]);
36
36
  }
37
37
  return null;
38
- }, y = ({ transport: c, setConversation: l, conversationRef: g, resumingPathsRef: _, bufferedGenerationsRef: v, addStreamingPath: y, removeStreamingPath: b, isPathDisplayed: x, generationPersistenceErrorMessage: S = n, generationInterruptedMessage: C = t, frameScheduler: w, stoppedGenerationIdsRef: T, rememberResumedGenerationId: E, forgetResumedGenerationId: D, onReloadError: O, onReloadSuccess: k }) => (t, n, A = {}) => {
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
- A.onSettled?.();
40
+ j.onSettled?.();
41
41
  return;
42
42
  }
43
- let j = a(t);
44
- if (!A.skipDedupe && _.current.has(j)) return;
45
- _.current.add(j), y(j);
46
- let M = d(n), N = M !== -1, P = N ? -1 : f(n), F = n.messages.length - 1;
47
- N ? F = M : P !== -1 && (F = P);
48
- let I = {
49
- generationId: h,
50
- messageIndex: F,
51
- message: A.seedMessage ?? n.messages[F]
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
- v.current.set(j, I);
54
- let L = () => v.current.get(j) === I, R = N ? n.messages[F].backgroundGeneration?.generationId : void 0, z, B = () => {
55
- let e = R ?? z;
56
- return e != null && (T?.current.has(e) ?? !1);
57
- }, V = (e) => {
58
- A.trackAttachGenerationId && !N && e != null && L() && (z = e, E?.(j, e));
59
- }, H = () => {
60
- if (z == null) return;
61
- let e = z;
62
- z = void 0, T?.current.delete(e), D?.(j, e);
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
- P !== -1 && V(n.messages[P].foregroundGeneration?.generationId);
65
- let U = (e) => !!A.shouldMarkOrphanedAsInterrupted && !N && !!e && e.messages.length - 1 === F && d(e) === -1 && f(e) === -1 && p(e) && !u(I.message), W = () => {
66
- I.message = {
67
- ...I.message,
68
- streamErrorMessage: C
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
- }, G = () => {
71
- L() && (W(), _.current.delete(j), b(j), H(), x(j) && l((e) => {
72
- if (!e || !L() || !x(j)) return e;
73
- let t = s(e, I);
74
- return g.current = t, t;
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
- }, K = (e, t = !1) => {
77
- if (w?.flush(j), R != null && T?.current.delete(R), H(), !L()) return;
78
- _.current.delete(j), b(j);
79
- let n = !N && e && e.messages.length - 1 === F && p(e) && u(I.message);
80
- if (t || n) I.message = {
81
- ...I.message,
82
- streamErrorMessage: S
83
- }, x(j) && l((e) => {
84
- if (!e || !L() || !x(j)) return e;
85
- let t = s(e, I);
86
- return g.current = t, t;
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 (v.current.delete(j), e && x(j)) {
89
- let t = U(e);
90
- t && W();
91
- let n = t ? s(e, I) : e;
92
- l(n), g.current = 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
- }, q = async () => {
95
- if (L()) try {
94
+ }, J = async () => {
95
+ if (R()) try {
96
96
  let n = await c.getConversation(e(t));
97
- if (!L()) return;
98
- k?.(j), K(n);
97
+ if (!R()) return;
98
+ A?.(M), q(n);
99
99
  } catch {
100
- if (!L()) return;
101
- w?.flush(j), _.current.delete(j), b(j), R != null && T?.current.delete(R), H(), O?.(j, q, L);
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
- }, J = (e) => {
104
- w?.cancel(j), L() && (I.message = e, x(j) && l((e) => {
105
- if (!e || !L() || !x(j)) return e;
106
- let t = s(e, I);
107
- return g.current = t, t;
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
- }, Y = () => l((e) => {
110
- if (!e || !L() || !x(j)) return e;
111
- let t = s(e, I);
112
- return g.current = t, t;
113
- }), X = (e) => {
114
- if (!L() || B()) return;
115
- let t = o([I.message], 0, e);
116
- t && (I.message = t[0]), x(j) && (w ? w.schedule(j, Y) : Y());
117
- }, Z = async () => {
118
- let n = new AbortController(), r;
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
- r = await c.watchConversation(j, n.signal);
120
+ a = await c.watchConversation(M, r.signal);
121
121
  } catch {
122
- await q();
122
+ await J();
123
123
  return;
124
124
  }
125
+ let o;
125
126
  try {
126
- let i = await c.getConversation(e(t));
127
- if (!p(i)) {
128
- n.abort(), r.cancel().catch(() => void 0), K(i);
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
- U(i) && G();
132
+ W(n) && K(), o = n;
132
133
  } catch {}
133
- let a = !1, o = window.setTimeout(() => {
134
- n.abort();
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(r, async (n) => {
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 (!p(n)) return K(n), a = !0, !0;
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(o);
169
+ window.clearTimeout(l), window.clearTimeout(u);
147
170
  }
148
- a || await q();
149
- }, Q = async () => {
171
+ s || await J();
172
+ }, $ = async () => {
150
173
  let e = new AbortController(), t;
151
174
  try {
152
- t = await c.attachToGeneration(j, e.signal);
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 (!L()) return !0;
181
+ if (!R()) return !0;
159
182
  switch (e.type) {
160
- case "snapshot": return V(e.generationId), J(e.message), !1;
161
- case "chunk": return X(e.chunk), !1;
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 ? K(void 0, !0) : await q(), !0) : (H(), !L());
189
+ }), n ? (a ? q(void 0, !0) : await J(), !0) : (U(), !R());
167
190
  };
168
191
  (async () => {
169
192
  try {
170
- await Q() || await Z();
193
+ await $() || await Q();
171
194
  } finally {
172
- A.onSettled?.();
195
+ j.onSettled?.();
173
196
  }
174
197
  })();
175
198
  };
176
199
  //#endregion
177
- export { g as RECOVERY_REFETCH_DELAYS_MS, y as createResumeIfAwaitingGeneration, v as fetchConversationForRecovery, f as findLiveForegroundMessageIndex, d as findPendingBackgroundMessageIndex, u as hasGeneratedPayload, p as isAwaitingGenerationResume };
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 };