@epam/ai-dial-chat-hooks 1.4.0-dev.95 → 1.4.0-rc.0

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 (115) hide show
  1. package/api-error/map-api-error.d.ts +10 -0
  2. package/api-error/map-api-error.d.ts.map +1 -0
  3. package/api-error/map-api-error.js +11 -0
  4. package/catalog/create-publish-api.d.ts +14 -10
  5. package/catalog/create-publish-api.d.ts.map +1 -1
  6. package/catalog/create-publish-api.js +8 -9
  7. package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -1
  8. package/catalog/map-deployment-to-catalog-item.js +1 -0
  9. package/catalog/publish-target-taken.d.ts +31 -0
  10. package/catalog/publish-target-taken.d.ts.map +1 -0
  11. package/catalog/publish-target-taken.js +14 -0
  12. package/catalog/resource-name-conflict.d.ts.map +1 -1
  13. package/catalog/resource-name-conflict.js +19 -22
  14. package/catalog/resource-save.d.ts +2 -4
  15. package/catalog/resource-save.d.ts.map +1 -1
  16. package/catalog/resource-save.js +38 -32
  17. package/catalog/use-publish-target-guard.d.ts +45 -0
  18. package/catalog/use-publish-target-guard.d.ts.map +1 -0
  19. package/catalog/use-publish-target-guard.js +18 -0
  20. package/catalog/usePublishFolders/usePublishFolders.d.ts +11 -3
  21. package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
  22. package/catalog/usePublishFolders/usePublishFolders.js +41 -31
  23. package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +27 -11
  24. package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
  25. package/catalog/useResourceSavePanel/useResourceSavePanel.js +163 -138
  26. package/catalog.js +51 -49
  27. package/conversation/conversation-list.d.ts +7 -1
  28. package/conversation/conversation-list.d.ts.map +1 -1
  29. package/conversation/conversation-list.js +11 -2
  30. package/conversation/conversation-transfer/zip-export.d.ts +1 -1
  31. package/conversation/conversation-transfer/zip-export.d.ts.map +1 -1
  32. package/conversation/conversation-transfer/zip-export.js +7 -8
  33. package/conversation/conversation-transfer/zip-import.d.ts.map +1 -1
  34. package/conversation/conversation-transfer/zip-import.js +8 -9
  35. package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
  36. package/conversation/useConversationExport/useConversationExport.js +3 -1
  37. package/conversation.js +3 -3
  38. package/entry-points/catalog.d.ts +2 -0
  39. package/entry-points/catalog.d.ts.map +1 -1
  40. package/entry-points/scheduled-tasks.d.ts +1 -0
  41. package/entry-points/scheduled-tasks.d.ts.map +1 -1
  42. package/entry-points/skill-editor.d.ts +1 -0
  43. package/entry-points/skill-editor.d.ts.map +1 -1
  44. package/entry-points/utils.d.ts +1 -0
  45. package/entry-points/utils.d.ts.map +1 -1
  46. package/file-manager.js +33 -33
  47. package/files/dial-file-manager.types.d.ts +4 -2
  48. package/files/dial-file-manager.types.d.ts.map +1 -1
  49. package/files/dial-file.d.ts +6 -0
  50. package/files/dial-file.d.ts.map +1 -1
  51. package/files/dial-file.js +17 -12
  52. package/files/useDialFileListing/useDialFileListing.d.ts +9 -1
  53. package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
  54. package/files/useDialFileListing/useDialFileListing.js +205 -183
  55. package/files/useDialFileManager/useDialFileManager.d.ts +1 -1
  56. package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -1
  57. package/files/useDialFileManager/useDialFileManager.js +114 -113
  58. package/files/useDialFileMutations/useDialFileMutations.d.ts +2 -1
  59. package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -1
  60. package/files/useDialFileMutations/useDialFileMutations.js +5 -5
  61. package/index.d.ts +5 -0
  62. package/index.d.ts.map +1 -1
  63. package/index.js +267 -262
  64. package/org-units/org-unit-guards.d.ts +95 -1
  65. package/org-units/org-unit-guards.d.ts.map +1 -1
  66. package/org-units/org-unit-guards.js +51 -16
  67. package/org-units/useOrgUnits/useOrgUnits.d.ts +12 -4
  68. package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -1
  69. package/org-units/useOrgUnits/useOrgUnits.js +44 -35
  70. package/package.json +20 -20
  71. package/project/project-conversation-data-source.js +4 -4
  72. package/project/project-refresh.d.ts +2 -0
  73. package/project/project-refresh.d.ts.map +1 -1
  74. package/project/project-refresh.js +1 -1
  75. package/project/use-project-actions.d.ts +3 -1
  76. package/project/use-project-actions.d.ts.map +1 -1
  77. package/project/use-project-actions.js +39 -38
  78. package/project/use-project.d.ts +3 -1
  79. package/project/use-project.d.ts.map +1 -1
  80. package/project/use-project.js +57 -44
  81. package/scheduled-task/scheduled-task-display.d.ts +51 -4
  82. package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
  83. package/scheduled-task/scheduled-task-display.js +53 -46
  84. package/scheduled-task/scheduled-task-next-occurrence.d.ts +2 -0
  85. package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
  86. package/scheduled-task/scheduled-task-next-occurrence.js +2 -2
  87. package/scheduled-task/scheduled-task-time-format.d.ts +36 -0
  88. package/scheduled-task/scheduled-task-time-format.d.ts.map +1 -0
  89. package/scheduled-task/scheduled-task-time-format.js +34 -0
  90. package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
  91. package/scheduled-task/scheduled-task-trigger.js +13 -14
  92. package/scheduled-tasks.js +14 -13
  93. package/skill/skill-archive.d.ts.map +1 -1
  94. package/skill/skill-archive.js +6 -7
  95. package/skill/skill-file-batch-validation.d.ts +6 -0
  96. package/skill/skill-file-batch-validation.d.ts.map +1 -1
  97. package/skill/skill-file-batch-validation.js +39 -37
  98. package/skill/skill-types.d.ts +0 -6
  99. package/skill/skill-types.d.ts.map +1 -1
  100. package/skill/skill-types.js +7 -8
  101. package/skill/skill.d.ts +2 -9
  102. package/skill/skill.d.ts.map +1 -1
  103. package/skill/skill.js +33 -34
  104. package/skill/types/skill-editor-submit.d.ts +8 -0
  105. package/skill/types/skill-editor-submit.d.ts.map +1 -0
  106. package/skill/types/skill-editor-submit.js +6 -0
  107. package/skill/useSkillEditorLoad.js +1 -1
  108. package/skill/useSkillEditorSubmit.d.ts +2 -3
  109. package/skill/useSkillEditorSubmit.d.ts.map +1 -1
  110. package/skill/useSkillEditorSubmit.js +103 -102
  111. package/skill/useSkillFileActions.d.ts +7 -1
  112. package/skill/useSkillFileActions.d.ts.map +1 -1
  113. package/skill/useSkillFileActions.js +55 -49
  114. package/skill-editor.js +7 -6
  115. package/utils.js +28 -27
@@ -1,5 +1,6 @@
1
1
  import { ResourceFoldersResponseDto } from '@epam/ai-dial-chat-api-client';
2
- import { PublishAccessRulesLabels, StandaloneSaveToFolderPanelProps } from '@epam/ai-dial-publish-panel';
2
+ import { OrgUnitNamespace } from '@epam/ai-dial-chat-shared';
3
+ import { PublishDependency, StandaloneSaveToFolderPanelProps } from '@epam/ai-dial-publish-panel';
3
4
  import { PublishApiClient } from '../create-publish-api';
4
5
  import { ResourceSaveVersionError, SaveDestinationRoot, ResourceSaveAdapter, ResourceSaveChoice, ResourceSaveResult } from '../resource-save';
5
6
  import { UsePublishFoldersResult } from '../usePublishFolders/usePublishFolders';
@@ -15,8 +16,6 @@ export interface UseResourceSavePanelLabels {
15
16
  saveError: string;
16
17
  /** Returns the error shown under the new version input for `error` and the typed `version`. */
17
18
  getVersionError: (error: ResourceSaveVersionError, version: string) => string;
18
- /** Text overrides for the access-rules section. */
19
- accessRules?: PublishAccessRulesLabels;
20
19
  }
21
20
  /** Parameters for {@link useResourceSavePanel}. */
22
21
  export interface UseResourceSavePanelParams {
@@ -37,20 +36,36 @@ export interface UseResourceSavePanelParams {
37
36
  /** The Organization folder tree state; omit when the user may not publish, which hides that root. */
38
37
  organizationFolders?: UsePublishFoldersResult;
39
38
  /** Publish operations used for an Organization destination. */
40
- publishClient: Pick<PublishApiClient, 'publishCatalogEntity' | 'getPublishRules'>;
39
+ publishClient: Pick<PublishApiClient, 'publishCatalogEntity'> & Partial<Pick<PublishApiClient, 'checkPublishTarget'>>;
41
40
  /** Whether an Organization destination takes a direct write into an org unit (the user may write there); omit while the org-unit rule does not apply, which keeps every Organization destination on the publish path. */
42
41
  canSaveDirectlyTo?: (folderPath: string[], root: SaveDestinationRoot) => boolean;
43
42
  /** Reason a folder is unavailable as a destination in the given root, or `undefined` when usable; omit while the org-unit rule does not apply. A committed destination with a reason shows it and disables Save. */
44
43
  getDisabledReason?: (folderPath: string[], root: SaveDestinationRoot) => string | undefined;
45
- /** Options offered in the access-rules editor's source picker. */
46
- ruleSourceOptions: string[];
44
+ /**
45
+ * Reads the private dependencies of what is being saved, already mapped to the panel's model; omit for a resource that has none to list. Called when the panel is open and the destination is under the Organization root, whichever way the save then goes (a publication request or a direct write); the list is advisory, so a failed read leaves it empty. The host reads the values it saves when called, so it should return the form's state at that moment.
46
+ */
47
+ loadDependencies?: () => Promise<PublishDependency[]>;
48
+ /** The namespaces, among those asked, in which the user may not write straight into the unit that owns the folder; omit while the org-unit rule does not apply. Used for the dependencies the panel lists and for the icon's `files` namespace, on a destination that takes a direct write. */
49
+ getMissingNamespaces?: (folderPath: string[], namespaces: OrgUnitNamespace[]) => OrgUnitNamespace[];
50
+ /** Reason shown for a folder where the dependencies' namespaces are missing; receives the missing namespaces. Without it a missing namespace disables nothing. */
51
+ getMissingNamespacesReason?: (missing: OrgUnitNamespace[]) => string;
52
+ /** One sentence for the dependencies section while the panel cannot list them (an application whose form state is inside an embedded editor); passed through only under the Organization root. */
53
+ dependenciesNote?: string;
54
+ /** Whether the user is a DIAL admin, the only caller DIAL Core lets copy an application that refers to a folder of files; omit while the org-unit rule does not apply, which leaves the direct-write decision as it is. With it, a listed folder dependency of a user who is not a DIAL admin takes an Organization destination off the direct write and onto the publication request. */
55
+ hasAdminAccess?: boolean;
56
+ /** One sentence shown under the committed destination, instead of the icon notice, when a direct-write folder takes the publication request because the application refers to a folder of files; without it nothing is shown. */
57
+ folderReferenceNote?: string;
58
+ /** Notice about the application's uploaded icon, shown under the committed destination when it is a unit folder where the user may not write `files`; pass it only when the saved resource has an uploaded icon. */
59
+ iconNote?: string;
60
+ /** Reason shown, and Save disabled, while the committed direct-write folder already holds the name this save would write; receives that folder and, for "Save as new version", the typed version. It is returned through `getDisabledReason`, so it needs that parameter too; without it, or without `publishClient.checkPublishTarget`, no target check is made. */
61
+ getTargetTakenReason?: (folderPath: string[], version?: string) => string;
47
62
  /** Translated copy. */
48
63
  labels: UseResourceSavePanelLabels;
49
64
  /** Called once a save whose first step succeeded has finished, with the choice it ran. */
50
65
  onSaved: (result: ResourceSaveResult, choice: ResourceSaveChoice) => void;
51
66
  }
52
67
  /** The {@link StandaloneSaveToFolderPanelProps} the Save flow owns; the host adds the open state, resource summary and labels. */
53
- export type ResourceSavePanelStateProps = Pick<StandaloneSaveToFolderPanelProps, 'onSubmit' | 'isSubmitDisabled' | 'isSubmitting' | 'submitError' | 'roots' | 'destination' | 'onDestinationChange' | 'onCreateFolder' | 'getDisabledReason' | 'version' | 'accessRules' | 'onPendingDestinationChange' | 'foldersError' | 'onRetryFolders'>;
68
+ export type ResourceSavePanelStateProps = Pick<StandaloneSaveToFolderPanelProps, 'onSubmit' | 'isSubmitDisabled' | 'isSubmitting' | 'submitError' | 'roots' | 'destination' | 'onDestinationChange' | 'onCreateFolder' | 'getDisabledReason' | 'version' | 'onPendingDestinationChange' | 'foldersError' | 'onRetryFolders' | 'dependencies' | 'dependenciesNote' | 'destinationNote'>;
54
69
  /** Result of {@link useResourceSavePanel}. */
55
70
  export interface UseResourceSavePanelResult {
56
71
  /** Props to spread on `StandaloneSaveToFolderPanel`. */
@@ -60,9 +75,10 @@ export interface UseResourceSavePanelResult {
60
75
  }
61
76
  /**
62
77
  * Owns the Save panel's flow for one resource — the Personal and
63
- * Organization destination tree, the version choice, the Organization
64
- * folder's access rules — and runs the choice through the resource's
65
- * adapter. Notifications stay with the host through `onSaved`.
78
+ * Organization destination tree, and the version choice — and runs the choice through the resource's
79
+ * adapter. Notifications stay with the host through `onSaved`. For a resource
80
+ * with private dependencies it also reads them while an Organization
81
+ * destination is chosen and returns them as `panelProps.dependencies`.
66
82
  */
67
- export declare const useResourceSavePanel: ({ isOpen, adapter, resourceId, currentFolderPath, currentVersion, versionPattern, listPersonalFolders, organizationFolders, publishClient, canSaveDirectlyTo, getDisabledReason: getFolderDisabledReason, ruleSourceOptions, labels, onSaved, }: UseResourceSavePanelParams) => UseResourceSavePanelResult;
83
+ export declare const useResourceSavePanel: ({ isOpen, adapter, resourceId, currentFolderPath, currentVersion, versionPattern, listPersonalFolders, organizationFolders, publishClient, canSaveDirectlyTo, getDisabledReason: getFolderDisabledReason, loadDependencies, getMissingNamespaces, getMissingNamespacesReason, dependenciesNote, hasAdminAccess, folderReferenceNote, iconNote, getTargetTakenReason, labels, onSaved, }: UseResourceSavePanelParams) => UseResourceSavePanelResult;
68
84
  //# sourceMappingURL=useResourceSavePanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useResourceSavePanel.d.ts","sourceRoot":"","sources":["../../../src/catalog/useResourceSavePanel/useResourceSavePanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAML,KAAK,wBAAwB,EAG7B,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAGL,wBAAwB,EAExB,mBAAmB,EAEnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGtF,4GAA4G;AAC5G,MAAM,WAAW,0BAA0B;IACzC,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,eAAe,EAAE,CAAC,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9E,mDAAmD;IACnD,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA0B;IACzC,wGAAwG;IACxG,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC3E,qGAAqG;IACrG,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,+DAA+D;IAC/D,aAAa,EAAE,IAAI,CACjB,gBAAgB,EAChB,sBAAsB,GAAG,iBAAiB,CAC3C,CAAC;IACF,yNAAyN;IACzN,iBAAiB,CAAC,EAAE,CAClB,UAAU,EAAE,MAAM,EAAE,EACpB,IAAI,EAAE,mBAAmB,KACtB,OAAO,CAAC;IACb,oNAAoN;IACpN,iBAAiB,CAAC,EAAE,CAClB,UAAU,EAAE,MAAM,EAAE,EACpB,IAAI,EAAE,mBAAmB,KACtB,MAAM,GAAG,SAAS,CAAC;IACxB,kEAAkE;IAClE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB;IACvB,MAAM,EAAE,0BAA0B,CAAC;IACnC,0FAA0F;IAC1F,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC3E;AAED,kIAAkI;AAClI,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,gCAAgC,EAC9B,UAAU,GACV,kBAAkB,GAClB,cAAc,GACd,aAAa,GACb,OAAO,GACP,aAAa,GACb,qBAAqB,GACrB,gBAAgB,GAChB,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,4BAA4B,GAC5B,cAAc,GACd,gBAAgB,CACnB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,UAAU,EAAE,2BAA2B,CAAC;IACxC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,iPAelC,0BAA0B,KAAG,0BAuT/B,CAAC"}
1
+ {"version":3,"file":"useResourceSavePanel.d.ts","sourceRoot":"","sources":["../../../src/catalog/useResourceSavePanel/useResourceSavePanel.ts"],"names":[],"mappings":"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"}
@@ -1,182 +1,207 @@
1
1
  import { getApiErrorDetails as e } from "../../api-error/api-error.js";
2
2
  import { useResourceFolders as t } from "../useResourceFolders/useResourceFolders.js";
3
- import { ResourceSaveError as n } from "../resource-save-adapter.js";
4
- import { SaveDestinationRoot as r } from "../save-destination-root.js";
5
- import { ResourceSaveVersionError as i, createPublishSavedResource as ee, runResourceSave as te, toSaveDestinationRoot as ne } from "../resource-save.js";
6
- import { useCallback as a, useEffect as re, useMemo as o, useRef as ie, useState as s } from "react";
7
- import { SaveVersionMode as c, toFolderPathKey as ae } from "@epam/ai-dial-publish-panel";
3
+ import { ResourceSaveError as n, isResourceCreateAdapter as r } from "../resource-save-adapter.js";
4
+ import { SaveDestinationRoot as i } from "../save-destination-root.js";
5
+ import { ResourceSaveVersionError as a, createPublishSavedResource as ee, runResourceSave as te, toSaveDestinationRoot as ne } from "../resource-save.js";
6
+ import { getDependencyOrgUnitNamespaces as re, getOrgUnitNamespace as ie, hasBlockingFolderReference as ae } from "../../org-units/org-unit-guards.js";
7
+ import { OrgUnitNamespace as oe } from "@epam/ai-dial-chat-shared";
8
+ import { useCallback as o, useEffect as s, useMemo as c, useRef as se, useState as l } from "react";
9
+ import { SaveVersionMode as u } from "@epam/ai-dial-publish-panel";
8
10
  //#region src/catalog/useResourceSavePanel/useResourceSavePanel.ts
9
- var l = ({ isOpen: l, adapter: u, resourceId: d, currentFolderPath: f, currentVersion: p, versionPattern: oe, listPersonalFolders: se, organizationFolders: m, publishClient: h, canSaveDirectlyTo: g, getDisabledReason: _, ruleSourceOptions: v, labels: y, onSaved: b }) => {
10
- let x = t({
11
- listFolders: se,
12
- isEnabled: l
13
- }), { getPublishRules: S } = h, C = o(() => ee(h), [h]), w = o(() => ({
14
- rootKey: r.Personal,
15
- path: f
16
- }), [f]), [T, E] = s(w), [D, O] = s(c.Keep), [k, ce] = s(""), [le, A] = s(!1), [j, M] = s(), [ue, N] = s(!1), [de, P] = s(), [F, I] = s([]), [L, R] = s(!1), [z, B] = s(!1), V = ie(void 0), H = a((e) => e.rootKey === r.Organization && u.saveIntoOrgUnit != null && g?.(e.path, r.Organization) === !0, [u.saveIntoOrgUnit, g]), fe = a((e) => {
17
- if (e?.rootKey !== r.Organization || H(e)) return;
18
- let t = ae(e.path);
19
- t !== V.current && (V.current = t, I([]), B(!1), R(!0), (async () => {
11
+ var d = [], ce = 400, f = ({ isOpen: f, adapter: p, resourceId: m, currentFolderPath: h, currentVersion: g, versionPattern: _, listPersonalFolders: le, organizationFolders: v, publishClient: y, canSaveDirectlyTo: b, getDisabledReason: x, loadDependencies: S, getMissingNamespaces: C, getMissingNamespacesReason: w, dependenciesNote: ue, hasAdminAccess: de, folderReferenceNote: fe, iconNote: pe, getTargetTakenReason: T, labels: E, onSaved: me }) => {
12
+ let D = t({
13
+ listFolders: le,
14
+ isEnabled: f
15
+ }), { checkPublishTarget: O } = y, he = c(() => ee(y), [y]), ge = c(() => ({
16
+ rootKey: i.Personal,
17
+ path: h
18
+ }), [h]), [k, _e] = l(ge), [A, ve] = l(u.Keep), [j, M] = l(""), [N, P] = l(!1), [F, I] = l(), [ye, be] = l(!1), [xe, L] = l(), [Se, Ce] = l(!1), [we, Te] = l(), R = se(/* @__PURE__ */ new Set()), [z, Ee] = l(d), De = ie(p.publishEntityType), B = de != null && De != null && ae(De, z, de), V = o((e) => e.rootKey === i.Organization && p.saveIntoOrgUnit != null && b?.(e.path, i.Organization) === !0, [p.saveIntoOrgUnit, b]), H = o((e) => !B && V(e), [B, V]), Oe = o((e) => {
19
+ Ce(e?.rootKey === i.Organization);
20
+ }, []);
21
+ s(() => {
22
+ f && (Ce(!1), Te(void 0), R.current.clear(), _e(ge), ve(u.Keep), M(""), P(!1), I(void 0), L(void 0));
23
+ }, [f]);
24
+ let ke = se(S);
25
+ s(() => {
26
+ ke.current = S;
27
+ }, [S]);
28
+ let Ae = f && S != null && (k.rootKey === i.Organization || Se);
29
+ s(() => {
30
+ if (Ee(d), !Ae) return;
31
+ let e = !1;
32
+ return (async () => {
20
33
  try {
21
- let n = await S(e.path.join("/"));
22
- V.current === t && I(n);
23
- } catch {
24
- V.current === t && B(!0);
25
- } finally {
26
- V.current === t && R(!1);
27
- }
28
- })());
29
- }, [S, H]);
30
- re(() => {
31
- l && (V.current = void 0, I([]), R(!1), B(!1), E(w), O(c.Keep), ce(""), A(!1), M(void 0), P(void 0));
32
- }, [l]);
33
- let U = u.isVersioned && D === c.New, W = k.trim(), G = o(() => {
34
+ let t = await ke.current?.();
35
+ !e && t && Ee(t);
36
+ } catch {}
37
+ })(), () => {
38
+ e = !0;
39
+ };
40
+ }, [Ae]);
41
+ let U = p.isVersioned && A === u.New, W = j.trim(), G = c(() => {
34
42
  if (U) {
35
- if (!oe.test(W)) return i.Invalid;
36
- if (W === p) return i.Unchanged;
37
- if (W === j) return i.Exists;
43
+ if (!_.test(W)) return a.Invalid;
44
+ if (W === g) return a.Unchanged;
45
+ if (W === F) return a.Exists;
38
46
  }
39
47
  }, [
40
48
  U,
41
- oe,
49
+ _,
42
50
  W,
43
- p,
44
- j
45
- ]), K = o(() => _ && ((e) => {
46
- let t = ne(e.rootKey);
47
- return t ? _(e.path, t) : void 0;
48
- }), [_]), q = K?.(T), J = H(T), Y = T.rootKey === r.Organization && !J && (L || z), X = a((e) => {
49
- ce(e), P(void 0);
50
- }, []), pe = a(() => A(!0), []), me = m?.rememberPublishFolder, { saveError: he } = y, Z = a(async () => {
51
- if (A(!0), G || Y || q) return;
52
- N(!0), P(void 0);
51
+ g,
52
+ F
53
+ ]), je = r(p), K = k.path.join("/"), Me = [...R.current].some((e) => K === e || K.startsWith(`${e}/`)), Ne = _.test(W) && W !== g, q = U ? W : void 0, J = T != null && x != null && O != null && !je && H(k) && !Me && (!U || Ne) ? `${K}\u0000${q ?? ""}` : void 0, Pe = p.publishEntityType;
54
+ s(() => {
55
+ if (J == null || O == null) return;
56
+ let e = !1, t = async () => {
57
+ try {
58
+ let { taken: t } = await O(Pe, m, K, q);
59
+ if (e) return;
60
+ Te((e) => t ? J : e === J ? void 0 : e);
61
+ } catch {}
62
+ }, n = setTimeout(() => void t(), q == null ? 0 : ce);
63
+ return () => {
64
+ e = !0, clearTimeout(n);
65
+ };
66
+ }, [J]);
67
+ let Fe = J != null && we === J, Y = c(() => re(z), [z]), Ie = c(() => {
68
+ if (x) return (e) => {
69
+ let t = ne(e.rootKey);
70
+ if (!t) return;
71
+ let n = x(e.path, t);
72
+ if (n != null) return n;
73
+ let r = e.rootKey === k.rootKey && e.path.join("/") === K;
74
+ if (Fe && r && T) return T(e.path, q);
75
+ if (!C || !w || Y.length === 0 || !H(e)) return;
76
+ let i = C(e.path, Y);
77
+ return i.length > 0 ? w(i) : void 0;
78
+ };
79
+ }, [
80
+ Y,
81
+ k.rootKey,
82
+ x,
83
+ C,
84
+ w,
85
+ T,
86
+ H,
87
+ Fe,
88
+ K,
89
+ q
90
+ ]), X = Ie?.(k), Z = H(k), Le = k.rootKey === i.Organization, Re = pe != null && Z && C?.(k.path, [oe.Files]).length ? pe : void 0, ze = B && V(k) ? fe : Re, Be = o((e) => {
91
+ M(e), L(void 0);
92
+ }, []), Ve = o(() => P(!0), []), He = v?.rememberPublishFolder, { saveError: Q } = E, $ = o(async () => {
93
+ if (P(!0), G || X) return;
94
+ be(!0), L(void 0);
53
95
  let t = {
54
- resourceId: d,
55
- currentFolderPath: f,
56
- currentVersion: p,
57
- destination: T,
58
- versionMode: D,
96
+ resourceId: m,
97
+ currentFolderPath: h,
98
+ currentVersion: g,
99
+ destination: k,
100
+ versionMode: A,
59
101
  newVersion: W,
60
- rules: F,
61
- isDirectWrite: J
102
+ isDirectWrite: Z
62
103
  };
63
104
  try {
64
- let e = await te(u, t, C);
65
- e.isPublished && me?.(T.path), b(e, t);
105
+ let e = await te(p, t, he);
106
+ e.isPublished && He?.(k.path), me(e, t);
66
107
  } catch (t) {
67
108
  if (t instanceof n) {
68
- P(t.message);
109
+ L(t.message);
69
110
  return;
70
111
  }
71
112
  let { message: r, status: i } = await e(t);
72
113
  if (U && i === 409) {
73
- M(W);
114
+ I(W);
74
115
  return;
75
116
  }
76
- P(r ?? he);
117
+ L(r ?? Q);
77
118
  } finally {
78
- N(!1);
119
+ be(!1);
79
120
  }
80
121
  }, [
81
- u,
82
- f,
83
122
  p,
84
- T,
123
+ h,
124
+ g,
125
+ k,
85
126
  U,
86
- J,
87
- Y,
88
- q,
89
- b,
90
- C,
127
+ Z,
128
+ X,
91
129
  me,
92
- d,
93
- F,
94
130
  he,
131
+ He,
132
+ m,
133
+ Q,
95
134
  W,
96
- D,
135
+ A,
97
136
  G
98
- ]), ge = a(() => void Z(), [Z]), { personalRoot: _e, organizationRoot: Q } = y, ve = o(() => {
137
+ ]), Ue = o(() => void $(), [$]), { personalRoot: We, organizationRoot: Ge } = E, Ke = c(() => {
99
138
  let e = {
100
- key: r.Personal,
101
- label: _e,
102
- items: x.folderItems,
103
- expandedPaths: x.expandedPaths,
104
- onExpandedPathsChange: x.onExpandedPathsChange,
105
- loadingPaths: x.loadingPaths
139
+ key: i.Personal,
140
+ label: We,
141
+ items: D.folderItems,
142
+ expandedPaths: D.expandedPaths,
143
+ onExpandedPathsChange: D.onExpandedPathsChange,
144
+ loadingPaths: D.loadingPaths
106
145
  };
107
- return m ? [e, {
108
- key: r.Organization,
109
- label: Q,
110
- items: m.folderItems,
111
- expandedPaths: m.expandedPaths,
112
- onExpandedPathsChange: m.onExpandedPathsChange,
113
- loadingPaths: m.loadingPaths,
114
- hasAccessRules: !0
146
+ return v ? [e, {
147
+ key: i.Organization,
148
+ label: Ge,
149
+ items: v.folderItems,
150
+ expandedPaths: v.expandedPaths,
151
+ onExpandedPathsChange: v.onExpandedPathsChange,
152
+ loadingPaths: v.loadingPaths
115
153
  }] : [e];
116
154
  }, [
117
- m,
118
- Q,
119
- x.expandedPaths,
120
- x.folderItems,
121
- x.loadingPaths,
122
- x.onExpandedPathsChange,
123
- _e
124
- ]), { onCreateFolder: ye } = x, be = m?.onCreatePublishFolder, xe = a(async (e, t, n) => {
125
- e === r.Organization ? await be?.(t, n) : await ye(t, n);
126
- }, [ye, be]), { getVersionError: Se } = y, Ce = o(() => u.isVersioned && p != null ? {
127
- versionMode: D,
128
- onVersionModeChange: O,
129
- currentVersion: p,
130
- newVersion: k,
131
- onNewVersionChange: X,
132
- onNewVersionBlur: pe,
133
- newVersionError: le && G ? Se(G, W) : void 0
155
+ v,
156
+ Ge,
157
+ D.expandedPaths,
158
+ D.folderItems,
159
+ D.loadingPaths,
160
+ D.onExpandedPathsChange,
161
+ We
162
+ ]), { onCreateFolder: qe } = D, Je = v?.onCreatePublishFolder, Ye = o(async (e, t, n) => {
163
+ e === i.Organization ? (R.current.add([...t, n].join("/")), await Je?.(t, n)) : await qe(t, n);
164
+ }, [qe, Je]), { getVersionError: Xe } = E, Ze = c(() => p.isVersioned && g != null ? {
165
+ versionMode: A,
166
+ onVersionModeChange: ve,
167
+ currentVersion: g,
168
+ newVersion: j,
169
+ onNewVersionChange: Be,
170
+ onNewVersionBlur: Ve,
171
+ newVersionError: N && G ? Xe(G, W) : void 0
134
172
  } : void 0, [
135
- u.isVersioned,
136
- p,
137
- Se,
138
- le,
139
- pe,
140
- k,
141
- X,
173
+ p.isVersioned,
174
+ g,
175
+ Xe,
176
+ N,
177
+ Ve,
178
+ j,
179
+ Be,
142
180
  W,
143
181
  G,
144
- D
145
- ]), { accessRules: $ } = y, we = o(() => ({
146
- rules: F,
147
- onRulesChange: I,
148
- sourceOptions: v,
149
- isLoading: L,
150
- hasLoadError: z,
151
- labels: $,
152
- isHiddenFor: H
153
- }), [
154
- $,
155
- z,
156
- H,
157
- L,
158
- v,
159
- F
182
+ A
160
183
  ]);
161
184
  return {
162
185
  panelProps: {
163
- onSubmit: ge,
164
- isSubmitDisabled: U && !!G || Y || q != null,
165
- isSubmitting: ue,
166
- submitError: de,
167
- roots: ve,
168
- destination: T,
169
- onDestinationChange: E,
170
- onCreateFolder: xe,
171
- getDisabledReason: K,
172
- version: Ce,
173
- accessRules: we,
174
- onPendingDestinationChange: fe,
175
- foldersError: x.hasError ? y.foldersLoadError : void 0,
176
- onRetryFolders: x.retry
186
+ onSubmit: Ue,
187
+ isSubmitDisabled: U && !!G || X != null,
188
+ isSubmitting: ye,
189
+ submitError: xe,
190
+ roots: Ke,
191
+ destination: k,
192
+ onDestinationChange: _e,
193
+ onCreateFolder: Ye,
194
+ getDisabledReason: Ie,
195
+ version: Ze,
196
+ onPendingDestinationChange: Oe,
197
+ foldersError: D.hasError ? E.foldersLoadError : void 0,
198
+ onRetryFolders: D.retry,
199
+ dependencies: Le ? z : d,
200
+ dependenciesNote: Le ? ue : void 0,
201
+ destinationNote: ze
177
202
  },
178
- submit: Z
203
+ submit: $
179
204
  };
180
205
  };
181
206
  //#endregion
182
- export { l as useResourceSavePanel };
207
+ export { f as useResourceSavePanel };
package/catalog.js CHANGED
@@ -1,49 +1,51 @@
1
- import { createPublishApiClient as e, toPublishRuleDto as t } from "./catalog/create-publish-api.js";
2
- import { buildChatCompletionsUrl as n, buildDeploymentConnectApi as r, buildResponsesUrl as i } from "./catalog/deployment-endpoint-url.js";
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, 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 { SaveDestinationRoot as Ue } from "./catalog/save-destination-root.js";
42
- import { ResourceSaveOutcome as We, ResourceSaveVersionError as Ge, createPublishSavedResource as Ke, runResourceSave as qe, toSaveDestinationRoot as Je } from "./catalog/resource-save.js";
43
- import { createEmbeddedApplicationSaveAdapter as Ye, createHostApplicationSaveAdapter as Xe, createOrgUnitWriter as Ze, createPromptCreateAdapter as Qe, createPromptFolderLister as $e, createPromptSaveAdapter as et, createSkillFolderLister as tt, createToolsetCreateAdapter as nt, createToolsetSaveAdapter as rt } from "./catalog/resource-save-adapters.js";
44
- import { useResourceSavePanel as it } from "./catalog/useResourceSavePanel/useResourceSavePanel.js";
45
- import { buildVersionHistoryRows as at, selectOtherVersions as ot } from "./catalog/version-history.js";
46
- import { useVersionHistory as st } from "./catalog/useVersionHistory/useVersionHistory.js";
47
- import { useVersionHistorySection as ct } from "./catalog/useVersionHistory/useVersionHistorySection.js";
48
- import { SkillPreviewErrorKind as lt, useSkillFilePreview as ut } from "./skill/useSkillFilePreview.js";
49
- 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, We as ResourceSaveOutcome, Ge as ResourceSaveVersionError, D as SKILL_LISTING_MAX_PAGES, O as SKILL_LISTING_PAGE_SIZE, k as SKILL_MANIFEST_MAX_BYTES, Ue as SaveDestinationRoot, lt 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, at as buildVersionHistoryRows, ie as canEditShareAccess, a as createDeploymentLookup, Ye as createEmbeddedApplicationSaveAdapter, Xe as createHostApplicationSaveAdapter, Ze as createOrgUnitWriter, Qe as createPromptCreateAdapter, $e as createPromptFolderLister, et as createPromptSaveAdapter, e as createPublishApiClient, Q as createPublishDependencyIconResolver, Ke as createPublishSavedResource, tt as createSkillFolderLister, nt as createToolsetCreateAdapter, rt 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, ot as selectOtherVersions, S as supportsChatInterface, Z as toPublishEntityType, t as toPublishRuleDto, Je as toSaveDestinationRoot, 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, it as useResourceSavePanel, Me as useSkillDetailsPanelData, ut as useSkillFilePreview, we as useSkillItemDetails, re as useUnpublishConfirmation, ne as useUnpublishableFolders, st as useVersionHistory, ct as useVersionHistorySection, He as withResourceNameConflictMessages };
1
+ import { createPublishApiClient as e } from "./catalog/create-publish-api.js";
2
+ import { buildChatCompletionsUrl as t, buildDeploymentConnectApi as n, buildResponsesUrl as r } from "./catalog/deployment-endpoint-url.js";
3
+ import { createDeploymentLookup as i, 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 { SKILL_LISTING_MAX_PAGES as T, SKILL_LISTING_PAGE_SIZE as E, SKILL_MANIFEST_MAX_BYTES as D, SkillSource as O, parseSkillResourceUrl as k } from "./skill/skill-types.js";
11
+ import { buildSkillContentTree as A, buildSkillOverview as j, mapSkillToCatalogItem as M, readSkillFileBytes as N, readSkillFilePreviewBytes as P, readSkillManifest as F, resolveSkillFileDownloadPath as I, resolveSkillManifestFileId as L } from "./catalog/map-skill-to-catalog-item.js";
12
+ import { McpResourceKind as R, buildApplicationMcpUrl as z, buildConnectApi as B, buildToolsetMcpUrl as V, resolveMcpResourceKind as H } from "./catalog/mcp-endpoint-url.js";
13
+ import { getPublicCatalogEntityFolderPath as U, isPublicCatalogEntityId as W, isVersionedCatalogEntityType as G, mapPublishConversationResultDto as K, mapPublishHistoryEntryDto as q, mapResourceDependencyDto as J, toPublishEntityType as Y } from "./catalog/publish.js";
14
+ import { createPublishDependencyIconResolver as X } from "./catalog/publish-dependency-icons.js";
15
+ import { usePublishHistory as Z } from "./catalog/use-publish-history.js";
16
+ import { PublishTargetTakenError as Q, isPublishInProgressDetails as $, isPublishTargetTakenResponse as ee, wrapPublishTargetTaken as te } from "./catalog/publish-target-taken.js";
17
+ import { usePublishTargetGuard as ne } from "./catalog/use-publish-target-guard.js";
18
+ import { usePublishDependencies as re } from "./catalog/use-publish-dependencies.js";
19
+ import { resolveUnpublishableFolders as ie } from "./catalog/unpublishable-folders.js";
20
+ import { useUnpublishableFolders as ae } from "./catalog/useUnpublishableFolders/useUnpublishableFolders.js";
21
+ import { useUnpublishConfirmation as oe } from "./catalog/useUnpublishConfirmation/useUnpublishConfirmation.js";
22
+ import { canEditShareAccess as se, deriveAvailableTabIds as ce, deriveFavoriteItems as le, filterCatalogItemsBySelector as ue, filterHiddenOwnedItems as de, reconcileFilterTopics as fe } from "./catalog/catalog-derivations.js";
23
+ import { CatalogEntityKind as pe, findSchemaDisplayName as me, resolveCatalogEntityKind as he } from "./catalog/catalog-entity-kind.js";
24
+ import { FavoriteEntityType as ge, useFavoriteEntitiesState as _e } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
25
+ import { resolveFavoriteEntityType as ve } from "./catalog/favorite-entity-type.js";
26
+ import { parseCatalogFilterTopics as ye, resolveCatalogActiveTab as be, resolveCatalogSortKey as xe } from "./catalog/catalog-preferences.js";
27
+ import { findWorstCappedRow as Se } from "./catalog/usage-limit-rows.js";
28
+ import { CatalogPrimaryActionType as Ce, resolveCatalogPrimaryAction as we } from "./catalog/catalog-primary-action.js";
29
+ import { useCatalogItemDelete as Te } from "./catalog/useCatalogItemDelete/useCatalogItemDelete.js";
30
+ import { useCatalogEditNavigation as Ee } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
31
+ import { useSkillItemDetails as De } from "./catalog/useSkillItemDetails.js";
32
+ import { useCatalogItemDetails as Oe } from "./catalog/useCatalogItemDetails.js";
33
+ import { useCatalogToolsetCredentials as ke } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
34
+ import { buildApplicationCredentialLoginParams as Ae, mapApplicationCredentials as je } from "./catalog/application-credentials.js";
35
+ import { useApplicationCredentials as Me } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
36
+ import { DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS as Ne, useApplicationCredentialActions as Pe } from "./catalog/useApplicationCredentialActions/useApplicationCredentialActions.js";
37
+ import { useSkillDetailsPanelData as Fe } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
38
+ import { hasPublishFolderWriteAccess as Ie, rememberPublishFolderKey as Le, usePublishFolders as Re } from "./catalog/usePublishFolders/usePublishFolders.js";
39
+ import { useResourceFolders as ze } from "./catalog/useResourceFolders/useResourceFolders.js";
40
+ import { parseResourceFolderPath as Be } from "./catalog/resource-folder.js";
41
+ import { ResourceSaveError as Ve, isResourceCreateAdapter as He } from "./catalog/resource-save-adapter.js";
42
+ import { ResourceNameConflictKind as Ue, getResourceNameConflictKind as We, withResourceNameConflictMessages as Ge } from "./catalog/resource-name-conflict.js";
43
+ import { SaveDestinationRoot as Ke } from "./catalog/save-destination-root.js";
44
+ import { ResourceSaveOutcome as qe, ResourceSaveVersionError as Je, createPublishSavedResource as Ye, runResourceSave as Xe, toSaveDestinationRoot as Ze } from "./catalog/resource-save.js";
45
+ import { createEmbeddedApplicationSaveAdapter as Qe, createHostApplicationSaveAdapter as $e, createOrgUnitWriter as et, createPromptCreateAdapter as tt, createPromptFolderLister as nt, createPromptSaveAdapter as rt, createSkillFolderLister as it, createToolsetCreateAdapter as at, createToolsetSaveAdapter as ot } from "./catalog/resource-save-adapters.js";
46
+ import { useResourceSavePanel as st } from "./catalog/useResourceSavePanel/useResourceSavePanel.js";
47
+ import { buildVersionHistoryRows as ct, selectOtherVersions as lt } from "./catalog/version-history.js";
48
+ import { useVersionHistory as ut } from "./catalog/useVersionHistory/useVersionHistory.js";
49
+ import { useVersionHistorySection as dt } from "./catalog/useVersionHistory/useVersionHistorySection.js";
50
+ import { SkillPreviewErrorKind as ft, useSkillFilePreview as pt } from "./skill/useSkillFilePreview.js";
51
+ export { l as AuthenticationType, pe as CatalogEntityKind, Ce as CatalogPrimaryActionType, Ne as DEFAULT_APPLICATION_CREDENTIAL_ACTIONS_LABELS, p as DEFAULT_ENTITY_DETAILS_LABELS, ge as FavoriteEntityType, R as McpResourceKind, Q as PublishTargetTakenError, Ue as ResourceNameConflictKind, Ve as ResourceSaveError, qe as ResourceSaveOutcome, Je as ResourceSaveVersionError, T as SKILL_LISTING_MAX_PAGES, E as SKILL_LISTING_PAGE_SIZE, D as SKILL_MANIFEST_MAX_BYTES, Ke as SaveDestinationRoot, ft as SkillPreviewErrorKind, O as SkillSource, Ae as buildApplicationCredentialLoginParams, z as buildApplicationMcpUrl, t as buildChatCompletionsUrl, B as buildConnectApi, n as buildDeploymentConnectApi, S as buildPromptOverview, u as buildResetFields, r as buildResponsesUrl, A as buildSkillContentTree, j as buildSkillOverview, V as buildToolsetMcpUrl, ct as buildVersionHistoryRows, se as canEditShareAccess, i as createDeploymentLookup, Qe as createEmbeddedApplicationSaveAdapter, $e as createHostApplicationSaveAdapter, et as createOrgUnitWriter, tt as createPromptCreateAdapter, nt as createPromptFolderLister, rt as createPromptSaveAdapter, e as createPublishApiClient, X as createPublishDependencyIconResolver, Ye as createPublishSavedResource, it as createSkillFolderLister, at as createToolsetCreateAdapter, ot as createToolsetSaveAdapter, a as decodeDeploymentId, ce as deriveAvailableTabIds, le as deriveFavoriteItems, o as encodeDeploymentId, ue as filterCatalogItemsBySelector, de as filterHiddenOwnedItems, s as findDeploymentByIdOrReference, me as findSchemaDisplayName, Se as findWorstCappedRow, U as getPublicCatalogEntityFolderPath, We as getResourceNameConflictKind, Ie as hasPublishFolderWriteAccess, C as isOrganisationPromptItem, W as isPublicCatalogEntityId, $ as isPublishInProgressDetails, ee as isPublishTargetTakenResponse, He as isResourceCreateAdapter, G as isVersionedCatalogEntityType, je as mapApplicationCredentials, 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, J as mapResourceDependencyDto, M as mapSkillToCatalogItem, g as mapToolsetCredentials, y as mapToolsetToCatalogItem, c as normalizeDeploymentId, ye as parseCatalogFilterTopics, Be as parseResourceFolderPath, k as parseSkillResourceUrl, N as readSkillFileBytes, P as readSkillFilePreviewBytes, F as readSkillManifest, fe as reconcileFilterTopics, Le as rememberPublishFolderKey, be as resolveCatalogActiveTab, he as resolveCatalogEntityKind, we as resolveCatalogPrimaryAction, xe as resolveCatalogSortKey, b as resolveDeploymentFolder, ve as resolveFavoriteEntityType, H as resolveMcpResourceKind, I as resolveSkillFileDownloadPath, L as resolveSkillManifestFileId, ie as resolveUnpublishableFolders, Xe as runResourceSave, lt as selectOtherVersions, x as supportsChatInterface, Y as toPublishEntityType, Ze as toSaveDestinationRoot, Pe as useApplicationCredentialActions, Me as useApplicationCredentials, Ee as useCatalogEditNavigation, Te as useCatalogItemDelete, Oe as useCatalogItemDetails, ke as useCatalogToolsetCredentials, _e as useFavoriteEntitiesState, re as usePublishDependencies, Re as usePublishFolders, Z as usePublishHistory, ne as usePublishTargetGuard, ze as useResourceFolders, st as useResourceSavePanel, Fe as useSkillDetailsPanelData, pt as useSkillFilePreview, De as useSkillItemDetails, oe as useUnpublishConfirmation, ae as useUnpublishableFolders, ut as useVersionHistory, dt as useVersionHistorySection, Ge as withResourceNameConflictMessages, te as wrapPublishTargetTaken };
@@ -1,4 +1,10 @@
1
- import { ConversationDeletionResultDto } from '@epam/ai-dial-chat-api-client';
1
+ import { ConversationDeletionResultDto, ConversationListItemDto, ConversationResponseDto } from '@epam/ai-dial-chat-api-client';
2
+ /** Returns the list endpoint's id (`conversations/<bucket>/<encoded path>`) for a decoded `<bucket>/<path>` conversation id. */
3
+ export declare const toConversationListId: (conversationId: string) => string;
4
+ /** Returns whether a decoded `<bucket>/<path>` conversation id lives in `bucket`. */
5
+ export declare const isConversationInBucket: (conversationId: string, bucket: string | undefined) => boolean;
6
+ /** Returns the list row for a conversation in the user's own bucket, titled `title`. */
7
+ export declare const toOwnConversationListItem: (conversationId: string, conversation: Pick<ConversationResponseDto, "updatedAt">, title: string) => ConversationListItemDto;
2
8
  /** Returns `true` when a delete-all request removed nothing: some conversations failed and none was deleted or already gone. */
3
9
  export declare const isTotalDeletionFailure: (result: Pick<ConversationDeletionResultDto, "failed" | "deleted" | "alreadyAbsent">) => boolean;
4
10
  /** Returns the pin state a dragged conversation takes in its target group: `true` to pin, `false` to unpin, `undefined` to leave it. */
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-list.d.ts","sourceRoot":"","sources":["../../src/conversation/conversation-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAGnF,gIAAgI;AAChI,eAAO,MAAM,sBAAsB,GACjC,QAAQ,IAAI,CACV,6BAA6B,EAC7B,QAAQ,GAAG,SAAS,GAAG,eAAe,CACvC,KACA,OAGyB,CAAC;AAE7B,wIAAwI;AACxI,eAAO,MAAM,4BAA4B,GACvC,gBAAgB,MAAM,EACtB,UAAU,OAAO,GAAG,SAAS,KAC5B,OAAO,GAAG,SAIZ,CAAC"}
1
+ {"version":3,"file":"conversation-list.d.ts","sourceRoot":"","sources":["../../src/conversation/conversation-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAGvC,gIAAgI;AAChI,eAAO,MAAM,oBAAoB,GAAI,gBAAgB,MAAM,KAAG,MAI9C,CAAC;AAEjB,qFAAqF;AACrF,eAAO,MAAM,sBAAsB,GACjC,gBAAgB,MAAM,EACtB,QAAQ,MAAM,GAAG,SAAS,KACzB,OAA8D,CAAC;AAElE,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,GACpC,gBAAgB,MAAM,EACtB,cAAc,IAAI,CAAC,uBAAuB,EAAE,WAAW,CAAC,EACxD,OAAO,MAAM,KACZ,uBASD,CAAC;AAEH,gIAAgI;AAChI,eAAO,MAAM,sBAAsB,GACjC,QAAQ,IAAI,CACV,6BAA6B,EAC7B,QAAQ,GAAG,SAAS,GAAG,eAAe,CACvC,KACA,OAGyB,CAAC;AAE7B,wIAAwI;AACxI,eAAO,MAAM,4BAA4B,GACvC,gBAAgB,MAAM,EACtB,UAAU,OAAO,GAAG,SAAS,KAC5B,OAAO,GAAG,SAIZ,CAAC"}
@@ -1,5 +1,14 @@
1
1
  import { FilterTab as e } from "@epam/ai-dial-chat-shared";
2
2
  //#region src/conversation/conversation-list.ts
3
- var t = (e) => e.failed.length > 0 && e.deleted === 0 && e.alreadyAbsent === 0, n = (t, n) => t === e.Pinned || !n && void 0;
3
+ var t = (e) => `conversations/${e.split("/").map((e) => encodeURIComponent(e)).join("/")}`, n = (e, t) => !!t && e.startsWith(`${t}/`), r = (e, n, r) => ({
4
+ id: t(e),
5
+ title: r,
6
+ updatedAt: n.updatedAt || Date.now(),
7
+ sharedWithMe: !1,
8
+ publishedWithMe: !1,
9
+ isPinned: !1,
10
+ isReadonly: !1,
11
+ isScheduledTask: !1
12
+ }), i = (e) => e.failed.length > 0 && e.deleted === 0 && e.alreadyAbsent === 0, a = (t, n) => t === e.Pinned || !n && void 0;
4
13
  //#endregion
5
- export { t as isTotalDeletionFailure, n as resolveConversationPinChange };
14
+ export { n as isConversationInBucket, i as isTotalDeletionFailure, a as resolveConversationPinChange, t as toConversationListId, r as toOwnConversationListItem };