@epam/ai-dial-chat-hooks 1.3.0-dev.253 → 1.3.0-dev.259

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.
@@ -31,6 +31,12 @@ export declare const decodeDeploymentId: (id: string) => string;
31
31
  * 404s on.
32
32
  */
33
33
  export declare const normalizeDeploymentId: (id: string) => string;
34
+ /**
35
+ * Indexes a deployment-list snapshot for repeated lookups. Rebuild when the
36
+ * list changes. Preserves the exact-id, exact-reference, normalized-id
37
+ * precedence and first-match behavior of `findDeploymentByIdOrReference`.
38
+ */
39
+ export declare const createDeploymentLookup: (deployments: DeploymentItemDto[]) => (idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
34
40
  /**
35
41
  * Finds a deployment matching `idOrReference` by `id` first, falling back to
36
42
  * `reference` when no `id` matches, and finally to an `id` match that ignores
@@ -1 +1 @@
1
- {"version":3,"file":"deployment-id.d.ts","sourceRoot":"","sources":["../../src/catalog/deployment-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG,MAIlC,CAAC;AAEf;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG,MAUlC,CAAC;AAEf;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG,MACP,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GACxC,aAAa,iBAAiB,EAAE,EAChC,eAAe,MAAM,GAAG,IAAI,GAAG,SAAS,KACvC,iBAAiB,GAAG,SAUtB,CAAC"}
1
+ {"version":3,"file":"deployment-id.d.ts","sourceRoot":"","sources":["../../src/catalog/deployment-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG,MAIlC,CAAC;AAEf;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG,MAUlC,CAAC;AAEf;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG,MACP,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,iBAAiB,EAAE,MAenE,eAAe,MAAM,GAAG,IAAI,GAAG,SAAS,KACvC,iBAAiB,GAAG,SAQxB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GACxC,aAAa,iBAAiB,EAAE,EAChC,eAAe,MAAM,GAAG,IAAI,GAAG,SAAS,KACvC,iBAAiB,GAAG,SAUtB,CAAC"}
@@ -5,7 +5,17 @@ var e = (e) => e.split("/").map((e) => encodeURIComponent(e)).join("/"), t = (e)
5
5
  } catch {
6
6
  return e;
7
7
  }
8
- }).join("/"), n = (n) => e(t(n)), r = (e, t) => {
8
+ }).join("/"), n = (n) => e(t(n)), r = (e) => {
9
+ let t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
10
+ for (let a of e) {
11
+ t.has(a.id) || t.set(a.id, a), a.reference && !r.has(a.reference) && r.set(a.reference, a);
12
+ let e = n(a.id);
13
+ i.has(e) || i.set(e, a);
14
+ }
15
+ return (e) => {
16
+ if (e) return t.get(e) ?? r.get(e) ?? i.get(n(e));
17
+ };
18
+ }, i = (e, t) => {
9
19
  if (!t) return;
10
20
  let r = e.find((e) => e.id === t) ?? e.find((e) => e.reference === t);
11
21
  if (r) return r;
@@ -13,4 +23,4 @@ var e = (e) => e.split("/").map((e) => encodeURIComponent(e)).join("/"), t = (e)
13
23
  return e.find((e) => n(e.id) === i);
14
24
  };
15
25
  //#endregion
16
- export { t as decodeDeploymentId, e as encodeDeploymentId, r as findDeploymentByIdOrReference, n as normalizeDeploymentId };
26
+ export { r as createDeploymentLookup, t as decodeDeploymentId, e as encodeDeploymentId, i as findDeploymentByIdOrReference, n as normalizeDeploymentId };
@@ -1,6 +1,7 @@
1
1
  import { CatalogItem, CatalogItemCredentials } from '@epam/ai-dial-catalog';
2
2
  import { DeploymentItemDto, DialToolsetAuthSettingsDto, DialToolsetDto } from '@epam/ai-dial-chat-api-client';
3
3
  import { EntitySpecificDetails } from './entity-details';
4
+ import { EntityDetailsLabels } from './map-entity-details-to-catalog';
4
5
  /**
5
6
  * Maps a toolset's auth settings (from a deployment listing row) into the
6
7
  * lib's credential-status shape, including both `USER` and `GLOBAL` sign-in
@@ -32,6 +33,8 @@ export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDt
32
33
  export interface MapDeploymentToCatalogItemOptions {
33
34
  favoriteIds?: ReadonlySet<string>;
34
35
  entityDetails?: EntitySpecificDetails;
36
+ /** Translated Overview labels for `entityDetails`. Unset fields fall back to the English defaults. */
37
+ entityDetailsLabels?: Partial<EntityDetailsLabels>;
35
38
  folderLabels: DeploymentFolderLabels;
36
39
  editableSchemaIds?: string[];
37
40
  isCustomAppsEditable?: boolean;
@@ -51,7 +54,7 @@ export interface MapDeploymentToCatalogItemOptions {
51
54
  */
52
55
  export declare const supportsChatInterface: (deployment: Pick<DeploymentItemDto, "interfaces">) => boolean;
53
56
  /** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
54
- export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, isToolsetTabEnabled, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
57
+ export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, entityDetailsLabels, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, isToolsetTabEnabled, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
55
58
  /** Parameters for {@link mapToolsetToCatalogItem}. */
56
59
  export interface MapToolsetToCatalogItemOptions {
57
60
  favoriteIds?: ReadonlySet<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"map-deployment-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-deployment-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,cAAc,EACf,MAAM,+BAA+B,CAAC;AASvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAkB9D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,+BAA+B,GAC1C,WAAW,MAAM,EACjB,cAAc,0BAA0B,GAAG,SAAS,EACpD,SAAS,OAAO,KACf,sBAAsB,GAAG,SA4B3B,CAAC;AAiBF,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,GAClC,YAAY,IAAI,CACd,iBAAiB,EACjB,MAAM,GAAG,cAAc,GAAG,mBAAmB,CAC9C,GACC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,EAC1C,QAAQ,sBAAsB,KAC7B,MAAM,EA2BR,CAAC;AAgCF,yDAAyD;AACzD,MAAM,WAAW,iCAAiC;IAChD,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,YAAY,EAAE,sBAAsB,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;IACpE,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AA+BD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,KAChD,OACsE,CAAC;AAE1E,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,GACrC,YAAY,iBAAiB,EAC7B,0JAUG,iCAAiC,KACnC,WAgDF,CAAC;AAEF,sDAAsD;AACtD,MAAM,WAAW,8BAA8B;IAC7C,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;CACrE;AAED,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,GAClC,SAAS,cAAc,EACvB,sFAOG,8BAA8B,KAChC,WA6CF,CAAC"}
1
+ {"version":3,"file":"map-deployment-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-deployment-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,cAAc,EACf,MAAM,+BAA+B,CAAC;AASvC,OAAO,KAAK,EAA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AAM,qBAAqB,GAChC,YAAY,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,KAChD,OACsE,CAAC;AAE1E,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,GACrC,YAAY,iBAAiB,EAC7B,+KAWG,iCAAiC,KACnC,WAgDF,CAAC;AAEF,sDAAsD;AACtD,MAAM,WAAW,8BAA8B;IAC7C,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;CACrE;AAED,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,GAClC,SAAS,cAAc,EACvB,sFAOG,8BAA8B,KAChC,WA6CF,CAAC"}
@@ -42,15 +42,15 @@ var l = {
42
42
  if (t !== "application" || e == null) return;
43
43
  let r = e.includes(y), a = [];
44
44
  return e.some((e) => v.includes(e)) && a.push(i.Agent), r && n && a.push(i.Toolset), a.length > 0 ? a : r ? [i.Agent] : void 0;
45
- }, x = (e) => e.interfaces == null || e.interfaces.includes("chat"), S = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: a, folderLabels: s, editableSchemaIds: c = [], isCustomAppsEditable: l = !1, activeLocale: u, primaryLocale: d, resolveIconUrl: p, isToolsetTabEnabled: m = !0 }) => {
46
- let h = n(e.displayName, u, d) || e.id, _ = (e.type ?? "").toLowerCase(), v = b(e.interfaces, _, m);
45
+ }, x = (e) => e.interfaces == null || e.interfaces.includes("chat"), S = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: a, entityDetailsLabels: s, folderLabels: c, editableSchemaIds: l = [], isCustomAppsEditable: u = !1, activeLocale: d, primaryLocale: p, resolveIconUrl: m, isToolsetTabEnabled: h = !0 }) => {
46
+ let _ = n(e.displayName, d, p) || e.id, v = (e.type ?? "").toLowerCase(), y = b(e.interfaces, v, h);
47
47
  return {
48
48
  id: e.id,
49
- type: f[_] ?? i.Model,
50
- ...v != null && { catalogTabs: v },
51
- name: h,
52
- description: n(e.description, u, d),
53
- iconUrl: p(e.iconUrl),
49
+ type: f[v] ?? i.Model,
50
+ ...y != null && { catalogTabs: y },
51
+ name: _,
52
+ description: n(e.description, d, p),
53
+ iconUrl: m(e.iconUrl),
54
54
  version: e.displayVersion ?? "",
55
55
  lastUsed: o(e.updatedAt),
56
56
  updatedAt: e.updatedAt,
@@ -62,9 +62,9 @@ var l = {
62
62
  isStarred: t.has(e.id),
63
63
  isMyApp: e.isMy ?? !1,
64
64
  sharedWithMe: e.sharedWithMe ?? !1,
65
- isEditable: (!!e.isMy || !!e.canEdit) && (c.length > 0 && c.includes(e.applicationTypeSchemaId ?? "") || l && !e.applicationTypeSchemaId && _ === "application"),
66
- folder: g(e, s),
67
- details: a == null ? void 0 : r(a),
65
+ isEditable: (!!e.isMy || !!e.canEdit) && (l.length > 0 && l.includes(e.applicationTypeSchemaId ?? "") || u && !e.applicationTypeSchemaId && v === "application"),
66
+ folder: g(e, c),
67
+ details: a == null ? void 0 : r(a, s),
68
68
  supportsMcp: e.features?.mcp === !0,
69
69
  supportsChat: x(e)
70
70
  };
package/catalog.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { createPublishApiClient as e, toPublishRuleDto as t } from "./catalog/create-publish-api.js";
2
2
  import { buildChatCompletionsUrl as n, buildDeploymentConnectApi as r, buildResponsesUrl as i } from "./catalog/deployment-endpoint-url.js";
3
- import { decodeDeploymentId as a, encodeDeploymentId as o, findDeploymentByIdOrReference as s, normalizeDeploymentId as c } from "./catalog/deployment-id.js";
4
- import { AuthenticationType as l } from "./catalog/entity-details.js";
5
- import { buildResetFields as u, mapDeploymentLimitsToInput as d } from "./catalog/map-deployment-limits-to-input.js";
6
- import { mapDeploymentLimitsDtoToCatalogLimits as f } from "./catalog/map-deployment-limits-to-catalog.js";
7
- import { DEFAULT_ENTITY_DETAILS_LABELS as p, mapDeploymentDetailsDtoToEntityDetails as m, mapEntityDetailsToCatalogDetails as h, mapToolsetCredentials as g } from "./catalog/map-entity-details-to-catalog.js";
8
- import { mapDeploymentToCatalogItem as _, mapDeploymentToolsetCredentials as v, mapToolsetToCatalogItem as y, resolveDeploymentFolder as b, supportsChatInterface as x } from "./catalog/map-deployment-to-catalog-item.js";
9
- import { buildPromptOverview as S, isOrganisationPromptItem as C, mapPromptToCatalogItem as w } from "./catalog/map-prompt-to-catalog-item.js";
10
- import { PUBLIC_SKILL_BUCKET as T, SKILL_LISTING_MAX_PAGES as E, SKILL_LISTING_PAGE_SIZE as D, SKILL_MANIFEST_MAX_BYTES as O, SkillSource as k, parseSkillResourceUrl as A } from "./skill/skill-types.js";
11
- import { buildSkillContentTree as j, buildSkillOverview as M, mapSkillToCatalogItem as N, readSkillFileBytes as P, readSkillFilePreviewBytes as F, readSkillManifest as I, resolveSkillFileDownloadPath as L, resolveSkillManifestFileId as R } from "./catalog/map-skill-to-catalog-item.js";
12
- import { McpResourceKind as z, buildApplicationMcpUrl as B, buildConnectApi as V, buildToolsetMcpUrl as H, resolveMcpResourceKind as U } from "./catalog/mcp-endpoint-url.js";
13
- import { getPublicCatalogEntityFolderPath as W, isPublicCatalogEntityId as G, mapPublishConversationResultDto as K, mapPublishHistoryEntryDto as q, toPublishEntityType as J } from "./catalog/publish.js";
14
- import { deriveAvailableTabIds as Y, deriveFavoriteItems as X, filterCatalogItemsBySelector as Z, filterHiddenOwnedItems as Q, reconcileFilterTopics as $ } from "./catalog/catalog-derivations.js";
15
- import { CatalogPrimaryActionType as ee, resolveCatalogPrimaryAction as te } from "./catalog/catalog-primary-action.js";
16
- import { useCatalogEditNavigation as ne } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
17
- import { useSkillItemDetails as re } from "./catalog/useSkillItemDetails.js";
18
- import { useCatalogItemDetails as ie } from "./catalog/useCatalogItemDetails.js";
19
- import { useCatalogToolsetCredentials as ae } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
- import { useApplicationCredentials as oe } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
21
- import { useSkillDetailsPanelData as se } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
22
- import { FavoriteEntityType as ce, useFavoriteEntitiesState as le } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
23
- import { usePublishFolders as ue } from "./catalog/usePublishFolders/usePublishFolders.js";
24
- import { SkillPreviewErrorKind as de, useSkillFilePreview as fe } from "./skill/useSkillFilePreview.js";
25
- export { l as AuthenticationType, ee as CatalogPrimaryActionType, p as DEFAULT_ENTITY_DETAILS_LABELS, ce as FavoriteEntityType, z as McpResourceKind, T as PUBLIC_SKILL_BUCKET, E as SKILL_LISTING_MAX_PAGES, D as SKILL_LISTING_PAGE_SIZE, O as SKILL_MANIFEST_MAX_BYTES, de as SkillPreviewErrorKind, k as SkillSource, B as buildApplicationMcpUrl, n as buildChatCompletionsUrl, V as buildConnectApi, r as buildDeploymentConnectApi, S as buildPromptOverview, u as buildResetFields, i as buildResponsesUrl, j as buildSkillContentTree, M as buildSkillOverview, H as buildToolsetMcpUrl, e as createPublishApiClient, a as decodeDeploymentId, Y as deriveAvailableTabIds, X as deriveFavoriteItems, o as encodeDeploymentId, Z as filterCatalogItemsBySelector, Q as filterHiddenOwnedItems, s as findDeploymentByIdOrReference, W as getPublicCatalogEntityFolderPath, C as isOrganisationPromptItem, G as isPublicCatalogEntityId, m as mapDeploymentDetailsDtoToEntityDetails, f as mapDeploymentLimitsDtoToCatalogLimits, d as mapDeploymentLimitsToInput, _ as mapDeploymentToCatalogItem, v as mapDeploymentToolsetCredentials, h as mapEntityDetailsToCatalogDetails, w as mapPromptToCatalogItem, K as mapPublishConversationResultDto, q as mapPublishHistoryEntryDto, N as mapSkillToCatalogItem, g as mapToolsetCredentials, y as mapToolsetToCatalogItem, c as normalizeDeploymentId, A as parseSkillResourceUrl, P as readSkillFileBytes, F as readSkillFilePreviewBytes, I as readSkillManifest, $ as reconcileFilterTopics, te as resolveCatalogPrimaryAction, b as resolveDeploymentFolder, U as resolveMcpResourceKind, L as resolveSkillFileDownloadPath, R as resolveSkillManifestFileId, x as supportsChatInterface, J as toPublishEntityType, t as toPublishRuleDto, oe as useApplicationCredentials, ne as useCatalogEditNavigation, ie as useCatalogItemDetails, ae as useCatalogToolsetCredentials, le as useFavoriteEntitiesState, ue as usePublishFolders, se as useSkillDetailsPanelData, fe as useSkillFilePreview, re as useSkillItemDetails };
3
+ import { createDeploymentLookup as a, decodeDeploymentId as o, encodeDeploymentId as s, findDeploymentByIdOrReference as c, normalizeDeploymentId as l } from "./catalog/deployment-id.js";
4
+ import { AuthenticationType as u } from "./catalog/entity-details.js";
5
+ import { buildResetFields as d, mapDeploymentLimitsToInput as f } from "./catalog/map-deployment-limits-to-input.js";
6
+ import { mapDeploymentLimitsDtoToCatalogLimits as p } from "./catalog/map-deployment-limits-to-catalog.js";
7
+ import { DEFAULT_ENTITY_DETAILS_LABELS as m, mapDeploymentDetailsDtoToEntityDetails as h, mapEntityDetailsToCatalogDetails as g, mapToolsetCredentials as _ } from "./catalog/map-entity-details-to-catalog.js";
8
+ import { mapDeploymentToCatalogItem as v, mapDeploymentToolsetCredentials as y, mapToolsetToCatalogItem as b, resolveDeploymentFolder as x, supportsChatInterface as S } from "./catalog/map-deployment-to-catalog-item.js";
9
+ import { buildPromptOverview as C, isOrganisationPromptItem as w, mapPromptToCatalogItem as T } from "./catalog/map-prompt-to-catalog-item.js";
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
+ 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
+ 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 { deriveAvailableTabIds as X, deriveFavoriteItems as Z, filterCatalogItemsBySelector as Q, filterHiddenOwnedItems as $, reconcileFilterTopics as ee } from "./catalog/catalog-derivations.js";
15
+ import { CatalogPrimaryActionType as te, resolveCatalogPrimaryAction as ne } from "./catalog/catalog-primary-action.js";
16
+ import { useCatalogEditNavigation as re } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
17
+ import { useSkillItemDetails as ie } from "./catalog/useSkillItemDetails.js";
18
+ import { useCatalogItemDetails as ae } from "./catalog/useCatalogItemDetails.js";
19
+ import { useCatalogToolsetCredentials as oe } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
+ import { useApplicationCredentials as se } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
21
+ import { useSkillDetailsPanelData as ce } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
22
+ import { FavoriteEntityType as le, useFavoriteEntitiesState as ue } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
23
+ import { usePublishFolders as de } from "./catalog/usePublishFolders/usePublishFolders.js";
24
+ import { SkillPreviewErrorKind as fe, useSkillFilePreview as pe } from "./skill/useSkillFilePreview.js";
25
+ export { u as AuthenticationType, te as CatalogPrimaryActionType, m as DEFAULT_ENTITY_DETAILS_LABELS, le as FavoriteEntityType, B as McpResourceKind, E as PUBLIC_SKILL_BUCKET, D as SKILL_LISTING_MAX_PAGES, O as SKILL_LISTING_PAGE_SIZE, k as SKILL_MANIFEST_MAX_BYTES, fe as SkillPreviewErrorKind, A as SkillSource, 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, a as createDeploymentLookup, e as createPublishApiClient, o as decodeDeploymentId, X as deriveAvailableTabIds, Z as deriveFavoriteItems, s as encodeDeploymentId, Q as filterCatalogItemsBySelector, $ as filterHiddenOwnedItems, c as findDeploymentByIdOrReference, G as getPublicCatalogEntityFolderPath, w as isOrganisationPromptItem, K as isPublicCatalogEntityId, 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, j as parseSkillResourceUrl, F as readSkillFileBytes, I as readSkillFilePreviewBytes, L as readSkillManifest, ee as reconcileFilterTopics, ne as resolveCatalogPrimaryAction, x as resolveDeploymentFolder, W as resolveMcpResourceKind, R as resolveSkillFileDownloadPath, z as resolveSkillManifestFileId, S as supportsChatInterface, Y as toPublishEntityType, t as toPublishRuleDto, se as useApplicationCredentials, re as useCatalogEditNavigation, ae as useCatalogItemDetails, oe as useCatalogToolsetCredentials, ue as useFavoriteEntitiesState, de as usePublishFolders, ce as useSkillDetailsPanelData, pe as useSkillFilePreview, ie as useSkillItemDetails };
@@ -1 +1 @@
1
- {"version":3,"file":"generation-resume.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/generation-resume.ts"],"names":[],"mappings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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;AAQxE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,OAAO,KAAG,OAWtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAC5C,cAAc,YAAY,KACzB,MAKA,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,YAAY,KACzB,OAUF,CAAC;AA6BF,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;AAUF,sGAAsG;AACtG,MAAM,WAAW,uBAAuB;IACtC,qIAAqI;IACrI,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oGAAoG;IACpG,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,2GAA2G;IAC3G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,sFAAsF;AACtF,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,2BAA2B,CAAC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7B,cAAc,YAAY,EAC1B,UAAS,uBAA4B,KACpC,IA6SJ,CAAC"}
@@ -1,83 +1,55 @@
1
1
  import { safeDecodeURI as e } from "../../shared/string-utils.js";
2
2
  import { DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as t, GenerationPersistenceError as n } from "../create-chat-stream-api.js";
3
- import { getConversationPath as r } from "./conversation-path.js";
4
- import { applyChunkToMessages as i } from "./apply-chunk.js";
5
- import { restoreBufferedMessage as a } from "./buffered-generation.js";
6
- import { BackgroundGenerationStatus as o, MessageRole as s } from "@epam/ai-dial-chat-shared";
3
+ import { readSseEvents as r } from "../../shared/read-sse-events.js";
4
+ import { getConversationPath as i } from "./conversation-path.js";
5
+ import { applyChunkToMessages as a } from "./apply-chunk.js";
6
+ import { restoreBufferedMessage as o } from "./buffered-generation.js";
7
+ import { BackgroundGenerationStatus as s, MessageRole as c } from "@epam/ai-dial-chat-shared";
7
8
  //#region src/conversation/useConversationStream/generation-resume.ts
8
- var c = (e) => {
9
+ var l = (e) => {
9
10
  let t = e.custom_content;
10
11
  return !!e.content || e.responseId != null || !!t?.attachments?.length || !!t?.stages?.length || !!t?.annotations?.length || !!t?.form_schema || t?.state != null;
11
- }, l = (e) => e.messages.findIndex((e) => e.backgroundGeneration?.status === o.Pending), u = (e) => {
12
- if (l(e) !== -1) return !0;
12
+ }, u = (e) => e.messages.findIndex((e) => e.backgroundGeneration?.status === s.Pending), d = (e) => {
13
+ if (u(e) !== -1) return !0;
13
14
  let t = e.messages[e.messages.length - 1];
14
- return !!t && t.role === s.Assistant && !c(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
15
- }, d = 3e5, f = "awaiting-resume", p = [
15
+ return !!t && t.role === c.Assistant && !l(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
16
+ }, f = 3e5, p = "awaiting-resume", m = [
16
17
  1e3,
17
18
  2e3,
18
19
  4e3,
19
20
  8e3,
20
21
  16e3
21
- ], m = (e) => new Promise((t) => {
22
+ ], h = (e) => new Promise((t) => {
22
23
  let n = typeof window < "u", r = () => {
23
24
  clearTimeout(i), n && window.removeEventListener("online", r), t();
24
25
  }, i = setTimeout(r, e);
25
26
  n && window.addEventListener("online", r);
26
- }), h = async (e, t, n) => {
27
- for (let r = 0; r <= p.length; r++) {
27
+ }), g = async (e, t, n) => {
28
+ for (let r = 0; r <= m.length; r++) {
28
29
  if (t()) return null;
29
30
  try {
30
31
  let t = await e();
31
32
  if (!n?.(t)) return t;
32
33
  } catch {}
33
- if (r === p.length) return null;
34
- await m(p[r]);
34
+ if (r === m.length) return null;
35
+ await h(m[r]);
35
36
  }
36
37
  return null;
37
- }, g = async (e, t) => {
38
- let n = e.getReader(), r = new TextDecoder(), i = "";
39
- try {
40
- for (;;) {
41
- let { done: e, value: a } = await n.read();
42
- if (e) break;
43
- i += r.decode(a, { stream: !0 });
44
- let o = i.split("\n");
45
- i = o.pop() ?? "";
46
- let s = !1;
47
- for (let e of o) {
48
- let n = e.trim();
49
- if (!n.startsWith("data:")) continue;
50
- let r = n.slice(5).trim(), i;
51
- try {
52
- i = JSON.parse(r);
53
- } catch {
54
- continue;
55
- }
56
- if (await t(i)) {
57
- s = !0;
58
- break;
59
- }
60
- }
61
- if (s) break;
62
- }
63
- } catch {} finally {
64
- n.releaseLock();
65
- }
66
- }, _ = ({ transport: o, setConversation: s, conversationRef: p, resumingPathsRef: m, bufferedGenerationsRef: h, addStreamingPath: _, removeStreamingPath: v, isPathDisplayed: y, generationPersistenceErrorMessage: b = t, frameScheduler: x, stoppedGenerationIdsRef: S, rememberResumedGenerationId: C, forgetResumedGenerationId: w, onReloadError: T, onReloadSuccess: E }) => (t, D, O = {}) => {
67
- if (!u(D)) {
38
+ }, _ = ({ transport: s, setConversation: c, conversationRef: m, resumingPathsRef: h, bufferedGenerationsRef: g, addStreamingPath: _, removeStreamingPath: v, isPathDisplayed: y, generationPersistenceErrorMessage: b = t, frameScheduler: x, stoppedGenerationIdsRef: S, rememberResumedGenerationId: C, forgetResumedGenerationId: w, onReloadError: T, onReloadSuccess: E }) => (t, D, O = {}) => {
39
+ if (!d(D)) {
68
40
  O.onSettled?.();
69
41
  return;
70
42
  }
71
- let k = r(t);
72
- if (!O.skipDedupe && m.current.has(k)) return;
73
- m.current.add(k), _(k);
74
- let A = l(D), j = A !== -1, M = j ? A : D.messages.length - 1, N = {
75
- generationId: f,
43
+ let k = i(t);
44
+ if (!O.skipDedupe && h.current.has(k)) return;
45
+ h.current.add(k), _(k);
46
+ let A = u(D), j = A !== -1, M = j ? A : D.messages.length - 1, N = {
47
+ generationId: p,
76
48
  messageIndex: M,
77
49
  message: O.seedMessage ?? D.messages[M]
78
50
  };
79
- h.current.set(k, N);
80
- let P = () => h.current.get(k) === N, F = j ? D.messages[M].backgroundGeneration?.generationId : void 0, I, L = () => {
51
+ g.current.set(k, N);
52
+ let P = () => g.current.get(k) === N, F = j ? D.messages[M].backgroundGeneration?.generationId : void 0, I, L = () => {
81
53
  let e = F ?? I;
82
54
  return e != null && (S?.current.has(e) ?? !1);
83
55
  }, R = (e) => {
@@ -88,88 +60,88 @@ var c = (e) => {
88
60
  I = void 0, S?.current.delete(e), w?.(k, e);
89
61
  }, B = (e, t = !1) => {
90
62
  if (x?.flush(k), F != null && S?.current.delete(F), z(), !P()) return;
91
- m.current.delete(k), v(k);
92
- let n = !j && e && e.messages.length - 1 === M && u(e) && c(N.message);
63
+ h.current.delete(k), v(k);
64
+ let n = !j && e && e.messages.length - 1 === M && d(e) && l(N.message);
93
65
  t || n ? (N.message = {
94
66
  ...N.message,
95
67
  streamErrorMessage: b
96
- }, y(k) && s((e) => {
68
+ }, y(k) && c((e) => {
97
69
  if (!e || !P() || !y(k)) return e;
98
- let t = a(e, N);
99
- return p.current = t, t;
100
- })) : (h.current.delete(k), e && y(k) && (s(e), p.current = e));
70
+ let t = o(e, N);
71
+ return m.current = t, t;
72
+ })) : (g.current.delete(k), e && y(k) && (c(e), m.current = e));
101
73
  }, V = async () => {
102
74
  if (P()) try {
103
- let n = await o.getConversation(e(t));
75
+ let n = await s.getConversation(e(t));
104
76
  if (!P()) return;
105
77
  E?.(k), B(n);
106
78
  } catch {
107
79
  if (!P()) return;
108
- x?.flush(k), m.current.delete(k), v(k), F != null && S?.current.delete(F), z(), T?.(k, V, P);
80
+ x?.flush(k), h.current.delete(k), v(k), F != null && S?.current.delete(F), z(), T?.(k, V, P);
109
81
  }
110
82
  }, H = (e) => {
111
- x?.cancel(k), P() && (N.message = e, y(k) && s((e) => {
83
+ x?.cancel(k), P() && (N.message = e, y(k) && c((e) => {
112
84
  if (!e || !P() || !y(k)) return e;
113
- let t = a(e, N);
114
- return p.current = t, t;
85
+ let t = o(e, N);
86
+ return m.current = t, t;
115
87
  }));
116
- }, U = () => s((e) => {
88
+ }, U = () => c((e) => {
117
89
  if (!e || !P() || !y(k)) return e;
118
- let t = a(e, N);
119
- return p.current = t, t;
90
+ let t = o(e, N);
91
+ return m.current = t, t;
120
92
  }), W = (e) => {
121
93
  if (!P() || L()) return;
122
- let t = i([N.message], 0, e);
94
+ let t = a([N.message], 0, e);
123
95
  t && (N.message = t[0]), y(k) && (x ? x.schedule(k, U) : U());
124
96
  }, G = async () => {
125
- let n = new AbortController(), r;
97
+ let n = new AbortController(), i;
126
98
  try {
127
- r = await o.watchConversation(k, n.signal);
99
+ i = await s.watchConversation(k, n.signal);
128
100
  } catch {
129
101
  await V();
130
102
  return;
131
103
  }
132
104
  try {
133
- let i = await o.getConversation(e(t));
134
- if (!u(i)) {
135
- n.abort(), r.cancel().catch(() => void 0), B(i);
105
+ let r = await s.getConversation(e(t));
106
+ if (!d(r)) {
107
+ n.abort(), i.cancel().catch(() => void 0), B(r);
136
108
  return;
137
109
  }
138
110
  } catch {}
139
- let i = !1, a = window.setTimeout(() => {
111
+ let a = !1, o = window.setTimeout(() => {
140
112
  n.abort();
141
- }, d);
113
+ }, f);
142
114
  try {
143
- await g(r, async (n) => {
115
+ await r(i, async (n) => {
144
116
  if (n?.action !== "UPDATE") return !1;
145
117
  try {
146
- let n = await o.getConversation(e(t));
147
- if (!u(n)) return B(n), i = !0, !0;
118
+ let n = await s.getConversation(e(t));
119
+ if (!d(n)) return B(n), a = !0, !0;
148
120
  } catch {}
149
121
  return !1;
150
122
  });
151
123
  } finally {
152
- clearTimeout(a);
124
+ clearTimeout(o);
153
125
  }
154
- i || await V();
126
+ a || await V();
155
127
  }, K = async () => {
156
128
  let e = new AbortController(), t;
157
129
  try {
158
- t = await o.attachToGeneration(k, e.signal);
130
+ t = await s.attachToGeneration(k, e.signal);
159
131
  } catch {
160
132
  return !1;
161
133
  }
162
- let r = !1, i = !1;
163
- return await g(t, (e) => {
134
+ let i = !1, a = !1;
135
+ return await r(t, (e) => {
164
136
  if (!P()) return !0;
165
137
  switch (e.type) {
166
138
  case "snapshot": return R(e.generationId), H(e.message), !1;
167
139
  case "chunk": return W(e.chunk), !1;
168
140
  case "done":
169
141
  case "error":
170
- case "stopped": return i = e.type === "error" && e.errorType === n.type, r = !0, !0;
142
+ case "stopped": return a = e.type === "error" && e.errorType === n.type, i = !0, !0;
171
143
  }
172
- }), r ? (i ? B(void 0, !0) : await V(), !0) : (z(), !P());
144
+ }), i ? (a ? B(void 0, !0) : await V(), !0) : (z(), !P());
173
145
  };
174
146
  (async () => {
175
147
  try {
@@ -180,4 +152,4 @@ var c = (e) => {
180
152
  })();
181
153
  };
182
154
  //#endregion
183
- export { p as RECOVERY_REFETCH_DELAYS_MS, _ as createResumeIfAwaitingGeneration, h as fetchConversationForRecovery, l as findPendingBackgroundMessageIndex, c as hasGeneratedPayload, u as isAwaitingGenerationResume };
155
+ export { m as RECOVERY_REFETCH_DELAYS_MS, _ as createResumeIfAwaitingGeneration, g as fetchConversationForRecovery, u as findPendingBackgroundMessageIndex, l as hasGeneratedPayload, d as isAwaitingGenerationResume };
@@ -1 +1 @@
1
- {"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"A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AAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iEAAiE;IACjE,0BAA0B,EAAE,OAAO,CAAC;IACpC,iDAAiD;IACjD,uBAAuB,EAAE,OAAO,CAAC;IACjC,yEAAyE;IACzE,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAkBD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,mQAYnC,2BAA2B,KAAG,2BAw9BhC,CAAC"}
1
+ {"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAEzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AA6Cf,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,6GAA6G;IAC7G,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uBAAuB,EAChC,aAAa,CAAC,EAAE,oBAAoB,EACpC,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,yBAAyB,EAChC,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CA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AE,MAAM,EACb,aAAa,CAAC,EAAE,oBAAoB,EACpC,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,yBAAyB,EAChC,OAAO,CAAC,EAAE,kBAAkB,KACzB,IAAI,CAAC;IACV,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,0BAA0B,EAAE,CAC1B,qBAAqB,EAAE,MAAM,EAC7B,YAAY,EAAE,YAAY,KACvB,IAAI,CAAC;IACV,+GAA+G;IAC/G,yBAAyB,EAAE,CACzB,qBAAqB,EAAE,MAAM,EAC7B,YAAY,EAAE,YAAY,KACvB,YAAY,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iEAAiE;IACjE,0BAA0B,EAAE,OAAO,CAAC;IACpC,iDAAiD;IACjD,uBAAuB,EAAE,OAAO,CAAC;IACjC,yEAAyE;IACzE,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAkBD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,mQAYnC,2BAA2B,KAAG,2BAo+BhC,CAAC"}
@@ -326,7 +326,9 @@ var se = 2e4, ce = 401, v = 404, y = 2e3, b = 100, le = (e, t, n) => e instanceo
326
326
  fe,
327
327
  E,
328
328
  w
329
- ]), ke = p((e, t) => Z(e, t, { trackAttachGenerationId: !0 }), [Z]), Ae = s != null && j.has(c(s)), Q = s == null ? null : c(s), je = Q != null && (P.has(Q) || Ae && x(C.current) != null), $ = Q ? U.get(Q) : void 0, Me = $?.isCurrent() ?? !1;
329
+ ]), ke = p((e, t) => {
330
+ F.current.has(c(e)) || Z(e, t, { trackAttachGenerationId: !0 });
331
+ }, [Z]), Ae = s != null && j.has(c(s)), Q = s == null ? null : c(s), je = Q != null && (P.has(Q) || Ae && x(C.current) != null), $ = Q ? U.get(Q) : void 0, Me = $?.isCurrent() ?? !1;
330
332
  return {
331
333
  hasConversationReloadError: Me,
332
334
  isReloadingConversation: !!$ && Me && ye.has($),
package/file-manager.js CHANGED
@@ -7,25 +7,25 @@ import { COLUMNS_MY_FILES as h, COLUMNS_ORGANIZATION as g, COLUMNS_SHARED as _,
7
7
  import { buildSharedItemVirtualPath as w, dialCorePathToRelative as T, findDialFileByPath as E, findFolderByVirtualPath as D, formatOperationFolderName as O, getVirtualPathName as k, hasDialFileWritePermission as A, hasForbiddenNameSymbols as j, hasSamePaths as M, isCopyMoveDuplicateAllowed as N, isShareActionsAllowed as P, normalizeVirtualPath as F, parseNewFolderVirtualPath as I, resolveOwnerCoords as L, resolveSectionByPath as R, unionPathSets as z, withRoutableRootLabels as B } from "./files/dial-file-manager-path.util.js";
8
8
  import { resolveDialFileApiPath as V, virtualPathToApiPath as H } from "./files/resolve-dial-file-api-path.js";
9
9
  import { prepareCopyItems as U, prepareMoveRenameItems as W } from "./files/dial-file-manager-copy-move.util.js";
10
- import { UploadNetworkError as G, createUploadFileWithProgress as K } from "./files/create-upload-file-with-progress.js";
11
- import { buildFromCache as q, buildSharedSearchScope as J, fetchByTab as Y, fetchForSearch as X, findFirstSuccessfulCopyMoveItem as Z, mapCorePermissions as Q, mapFileMetadataToDialFile as $, mapSearchItem as ee, mergeCreatedFolderIntoCache as te, resolveTransferFailureReason as ne, resolveUploadFailureReason as re, updateEntry as ie } from "./files/dial-file-manager-mapping.util.js";
12
- import { createFilesApiClient as ae } from "./files/create-files-api.js";
13
- import { openAnnotationAttachment as oe } from "./files/annotation.js";
14
- import { getUrlFileName as se, isExternalSourcePreviewable as ce, resolveExternalSourceContentType as le } from "./files/source-content.js";
15
- import { annotationToDisplayAttachment as ue, attachmentDtoToDisplayAttachment as de, attachmentDtosToDisplayAttachments as fe } from "./files/attachment-dto-to-display.js";
16
- import { dialFileToAttachment as pe, dialFilesToAttachments as me, dialFolderPathToAttachment as he } from "./files/dial-file-to-attachment.js";
17
- import { DownloadDestinationType as ge } from "./files/download-destination.js";
18
- import { prepareDownloadDestination as _e } from "./files/prepare-download-destination.js";
19
- import { deriveActionProfile as ve } from "./files/file-manager-variant.js";
20
- import { useDialFileListing as ye } from "./files/useDialFileListing/useDialFileListing.js";
21
- import { useDialFileMetadata as be } from "./files/useDialFileMetadata/useDialFileMetadata.js";
22
- import { useDialFileMutations as xe } from "./files/useDialFileMutations/useDialFileMutations.js";
23
- import { useDialFileSharing as Se } from "./files/useDialFileSharing/useDialFileSharing.js";
24
- import { useDialFileUploadBatch as Ce } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
25
- import { useDialFileManager as we } from "./files/useDialFileManager/useDialFileManager.js";
26
- import { useDialFileManagerSections as Te } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
27
- import { useDialFileManagerTabConfig as Ee } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
28
- import { useFileAttachmentPicker as De } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
29
- import { useFileAttachmentModalState as Oe } from "./files/useFileAttachmentModalState/useFileAttachmentModalState.js";
30
- import { useGridEditingScroll as ke } from "@epam/ai-dial-chat-shared";
31
- export { h as COLUMNS_MY_FILES, g as COLUMNS_ORGANIZATION, _ as COLUMNS_SHARED, v as CORE_PERMISSION_MAP, y as DATE_OPTIONS, b as DIAL_FILE_MANAGER_SECTION_TABS, d as DialFilesApiUploadMode, ge as DownloadDestinationType, f as FileManagerNotificationReason, p as FileNameValidationErrorReason, m as FileOperationKind, x as PATH_SEPARATOR_REGEXP, S as RESERVED_MARKER_NAME, C as UPLOAD_CONCURRENCY, G as UploadNetworkError, ue as annotationToDisplayAttachment, de as attachmentDtoToDisplayAttachment, fe as attachmentDtosToDisplayAttachments, q as buildFromCache, w as buildSharedItemVirtualPath, J as buildSharedSearchScope, ae as createFilesApiClient, K as createUploadFileWithProgress, ve as deriveActionProfile, T as dialCorePathToRelative, pe as dialFileToAttachment, me as dialFilesToAttachments, he as dialFolderPathToAttachment, Y as fetchByTab, X as fetchForSearch, E as findDialFileByPath, Z as findFirstSuccessfulCopyMoveItem, D as findFolderByVirtualPath, O as formatOperationFolderName, se as getUrlFileName, k as getVirtualPathName, A as hasDialFileWritePermission, j as hasForbiddenNameSymbols, M as hasSamePaths, N as isCopyMoveDuplicateAllowed, i as isDialFileAcceptType, e as isDialFileId, t as isDialFolderId, ce as isExternalSourcePreviewable, P as isShareActionsAllowed, Q as mapCorePermissions, $ as mapFileMetadataToDialFile, ee as mapSearchItem, te as mergeCreatedFolderIntoCache, a as mimeTypesToAttachmentExtensionLabels, o as mimeTypesToDialFileAcceptTypes, s as mimeTypesToFileAccept, F as normalizeVirtualPath, oe as openAnnotationAttachment, I as parseNewFolderVirtualPath, U as prepareCopyItems, _e as prepareDownloadDestination, W as prepareMoveRenameItems, V as resolveDialFileApiPath, n as resolveDialFileBucketAndPath, le as resolveExternalSourceContentType, L as resolveOwnerCoords, r as resolveRelativeDialFilePath, R as resolveSectionByPath, ne as resolveTransferFailureReason, re as resolveUploadFailureReason, c as sanitizeFileName, l as splitFileNameExtension, u as trimFileNameToByteLimit, z as unionPathSets, ie as updateEntry, ye as useDialFileListing, we as useDialFileManager, Te as useDialFileManagerSections, Ee as useDialFileManagerTabConfig, be as useDialFileMetadata, xe as useDialFileMutations, Se as useDialFileSharing, Ce as useDialFileUploadBatch, Oe as useFileAttachmentModalState, De as useFileAttachmentPicker, ke as useGridEditingScroll, H as virtualPathToApiPath, B as withRoutableRootLabels };
10
+ import { UploadBodyEncoding as G, UploadNetworkError as K, createUploadFileWithProgress as q } from "./files/create-upload-file-with-progress.js";
11
+ import { buildFromCache as J, buildSharedSearchScope as Y, fetchByTab as X, fetchForSearch as Z, findFirstSuccessfulCopyMoveItem as Q, mapCorePermissions as $, mapFileMetadataToDialFile as ee, mapSearchItem as te, mergeCreatedFolderIntoCache as ne, resolveTransferFailureReason as re, resolveUploadFailureReason as ie, updateEntry as ae } from "./files/dial-file-manager-mapping.util.js";
12
+ import { createFilesApiClient as oe } from "./files/create-files-api.js";
13
+ import { openAnnotationAttachment as se } from "./files/annotation.js";
14
+ import { getUrlFileName as ce, isExternalSourcePreviewable as le, resolveExternalSourceContentType as ue } from "./files/source-content.js";
15
+ import { annotationToDisplayAttachment as de, attachmentDtoToDisplayAttachment as fe, attachmentDtosToDisplayAttachments as pe } from "./files/attachment-dto-to-display.js";
16
+ import { dialFileToAttachment as me, dialFilesToAttachments as he, dialFolderPathToAttachment as ge } from "./files/dial-file-to-attachment.js";
17
+ import { DownloadDestinationType as _e } from "./files/download-destination.js";
18
+ import { prepareDownloadDestination as ve } from "./files/prepare-download-destination.js";
19
+ import { deriveActionProfile as ye } from "./files/file-manager-variant.js";
20
+ import { useDialFileListing as be } from "./files/useDialFileListing/useDialFileListing.js";
21
+ import { useDialFileMetadata as xe } from "./files/useDialFileMetadata/useDialFileMetadata.js";
22
+ import { useDialFileMutations as Se } from "./files/useDialFileMutations/useDialFileMutations.js";
23
+ import { useDialFileSharing as Ce } from "./files/useDialFileSharing/useDialFileSharing.js";
24
+ import { useDialFileUploadBatch as we } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
25
+ import { useDialFileManager as Te } from "./files/useDialFileManager/useDialFileManager.js";
26
+ import { useDialFileManagerSections as Ee } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
27
+ import { useDialFileManagerTabConfig as De } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
28
+ import { useFileAttachmentPicker as Oe } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
29
+ import { useFileAttachmentModalState as ke } from "./files/useFileAttachmentModalState/useFileAttachmentModalState.js";
30
+ import { useGridEditingScroll as Ae } from "@epam/ai-dial-chat-shared";
31
+ export { h as COLUMNS_MY_FILES, g as COLUMNS_ORGANIZATION, _ as COLUMNS_SHARED, v as CORE_PERMISSION_MAP, y as DATE_OPTIONS, b as DIAL_FILE_MANAGER_SECTION_TABS, d as DialFilesApiUploadMode, _e as DownloadDestinationType, f as FileManagerNotificationReason, p as FileNameValidationErrorReason, m as FileOperationKind, x as PATH_SEPARATOR_REGEXP, S as RESERVED_MARKER_NAME, C as UPLOAD_CONCURRENCY, G as UploadBodyEncoding, K as UploadNetworkError, de as annotationToDisplayAttachment, fe as attachmentDtoToDisplayAttachment, pe as attachmentDtosToDisplayAttachments, J as buildFromCache, w as buildSharedItemVirtualPath, Y as buildSharedSearchScope, oe as createFilesApiClient, q as createUploadFileWithProgress, ye as deriveActionProfile, T as dialCorePathToRelative, me as dialFileToAttachment, he as dialFilesToAttachments, ge as dialFolderPathToAttachment, X as fetchByTab, Z as fetchForSearch, E as findDialFileByPath, Q as findFirstSuccessfulCopyMoveItem, D as findFolderByVirtualPath, O as formatOperationFolderName, ce as getUrlFileName, k as getVirtualPathName, A as hasDialFileWritePermission, j as hasForbiddenNameSymbols, M as hasSamePaths, N as isCopyMoveDuplicateAllowed, i as isDialFileAcceptType, e as isDialFileId, t as isDialFolderId, le as isExternalSourcePreviewable, P as isShareActionsAllowed, $ as mapCorePermissions, ee as mapFileMetadataToDialFile, te as mapSearchItem, ne as mergeCreatedFolderIntoCache, a as mimeTypesToAttachmentExtensionLabels, o as mimeTypesToDialFileAcceptTypes, s as mimeTypesToFileAccept, F as normalizeVirtualPath, se as openAnnotationAttachment, I as parseNewFolderVirtualPath, U as prepareCopyItems, ve as prepareDownloadDestination, W as prepareMoveRenameItems, V as resolveDialFileApiPath, n as resolveDialFileBucketAndPath, ue as resolveExternalSourceContentType, L as resolveOwnerCoords, r as resolveRelativeDialFilePath, R as resolveSectionByPath, re as resolveTransferFailureReason, ie as resolveUploadFailureReason, c as sanitizeFileName, l as splitFileNameExtension, u as trimFileNameToByteLimit, z as unionPathSets, ae as updateEntry, be as useDialFileListing, Te as useDialFileManager, Ee as useDialFileManagerSections, De as useDialFileManagerTabConfig, xe as useDialFileMetadata, Se as useDialFileMutations, Ce as useDialFileSharing, we as useDialFileUploadBatch, ke as useFileAttachmentModalState, Oe as useFileAttachmentPicker, Ae as useGridEditingScroll, H as virtualPathToApiPath, B as withRoutableRootLabels };
@@ -3,6 +3,18 @@ import { UploadFileWithProgressFn } from './create-files-api';
3
3
  export declare class UploadNetworkError extends Error {
4
4
  constructor();
5
5
  }
6
+ /** How {@link createUploadFileWithProgress} encodes the upload request. */
7
+ export declare enum UploadBodyEncoding {
8
+ /** `POST` with a `FormData` body carrying `file`, `bucket`, `path` and `uploadMode`. */
9
+ Multipart = "multipart",
10
+ /**
11
+ * `PUT` with the `File` itself as the body (`Content-Type:
12
+ * application/octet-stream`) and `bucket`, `path`, `uploadMode` and
13
+ * `contentType` in the query string, so the server can stream the body
14
+ * without parsing it.
15
+ */
16
+ Raw = "raw"
17
+ }
6
18
  export interface CreateUploadFileWithProgressDeps {
7
19
  /** Returns the currently held CSRF token, or `null` when none is set. */
8
20
  getCsrfToken: () => string | null;
@@ -14,6 +26,11 @@ export interface CreateUploadFileWithProgressDeps {
14
26
  createUnauthorizedError: (url: string) => Error;
15
27
  /** The upload endpoint's URL. */
16
28
  uploadUrl: string;
29
+ /**
30
+ * How the request carries the file and its fields; must match what the
31
+ * endpoint at `uploadUrl` accepts. Defaults to {@link UploadBodyEncoding.Multipart}.
32
+ */
33
+ bodyEncoding?: UploadBodyEncoding;
17
34
  /** Builds the `XMLHttpRequest` instance to upload through. Defaults to `() => new XMLHttpRequest()`. */
18
35
  xhrFactory?: () => XMLHttpRequest;
19
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-upload-file-with-progress.d.ts","sourceRoot":"","sources":["../../src/files/create-upload-file-with-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AA2B5B,mFAAmF;AACnF,qBAAa,kBAAmB,SAAQ,KAAK;;CAK5C;AAED,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kEAAkE;IAClE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,oEAAoE;IACpE,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC;IAChD,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,cAAc,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,gCAAgC,KACrC,wBA8EF,CAAC"}
1
+ {"version":3,"file":"create-upload-file-with-progress.d.ts","sourceRoot":"","sources":["../../src/files/create-upload-file-with-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AA2B5B,mFAAmF;AACnF,qBAAa,kBAAmB,SAAQ,KAAK;;CAK5C;AAED,2EAA2E;AAC3E,oBAAY,kBAAkB;IAC5B,wFAAwF;IACxF,SAAS,cAAc;IACvB;;;;;OAKG;IACH,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kEAAkE;IAClE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,oEAAoE;IACpE,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC;IAChD,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,cAAc,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,gCAAgC,KACrC,wBA+FF,CAAC"}