@epam/ai-dial-chat-hooks 1.2.0-dev.99 → 1.3.0-dev.5

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 (84) hide show
  1. package/api-error/api-error.js +7 -4
  2. package/catalog/catalog-derivations.js +1 -1
  3. package/catalog/deployment-id.js +8 -2
  4. package/catalog/map-deployment-limits-to-catalog.js +16 -24
  5. package/catalog/map-deployment-limits-to-input.js +81 -9
  6. package/catalog/map-deployment-to-catalog-item.js +34 -34
  7. package/catalog/map-entity-details-to-catalog.js +237 -192
  8. package/catalog/map-skill-to-catalog-item.js +61 -54
  9. package/catalog/publish.js +4 -4
  10. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
  11. package/catalog/useCatalogItemDetails.js +9 -8
  12. package/catalog/usePublishFolders/usePublishFolders.js +1 -1
  13. package/catalog.d.ts +171 -34
  14. package/catalog.js +23 -23
  15. package/conversation/conversation-transfer/export-conversation.js +24 -16
  16. package/conversation/conversation-transfer/import-conversation.js +80 -31
  17. package/conversation/create-chat-stream-api.js +89 -49
  18. package/conversation/get-model-id-from-conversation-id.js +15 -9
  19. package/conversation/message-utils.js +44 -2
  20. package/conversation/stage.js +6 -2
  21. package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
  22. package/conversation/useConversationExport/useConversationExport.js +9 -9
  23. package/conversation/useConversationHandlers/message-utils.js +8 -5
  24. package/conversation/useConversationHandlers/useConversationHandlers.js +181 -167
  25. package/conversation/useConversationImport/useConversationImport.js +123 -121
  26. package/conversation/useConversationPanelItems/useConversationPanelItems.js +49 -31
  27. package/conversation/useConversationStream/frame-scheduler.js +39 -0
  28. package/conversation/useConversationStream/generation-resume.js +122 -64
  29. package/conversation/useConversationStream/useConversationStream.js +298 -118
  30. package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
  31. package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
  32. package/conversation-sources.d.ts +1 -1
  33. package/conversation-transfer.d.ts +2 -1
  34. package/conversation.d.ts +218 -22
  35. package/conversation.js +32 -31
  36. package/file-manager-canvas.d.ts +27 -7
  37. package/file-manager.d.ts +87 -32
  38. package/file-manager.js +25 -24
  39. package/files/attachment-canvas.js +67 -44
  40. package/files/dial-file-manager-copy-move.util.js +9 -8
  41. package/files/dial-file-manager-mapping.util.js +2 -1
  42. package/files/dial-file-manager-path.util.js +24 -2
  43. package/files/dial-file-manager.model.js +23 -19
  44. package/files/dial-file-manager.types.js +3 -3
  45. package/files/file-manager-variant.js +1 -1
  46. package/files/resolve-dial-file-api-path.js +11 -12
  47. package/files/useDialFileListing/useDialFileListing.js +140 -127
  48. package/files/useDialFileManager/useDialFileManager.js +139 -135
  49. package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
  50. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -15
  51. package/files/useDialFileMutations/useDialFileMutations.js +65 -60
  52. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
  53. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +28 -23
  54. package/index.d.ts +643 -128
  55. package/index.js +136 -134
  56. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  57. package/oauth/authorize-url.js +3 -3
  58. package/oauth/toolset-id.js +5 -3
  59. package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
  60. package/oauth.d.ts +34 -2
  61. package/oauth.js +9 -9
  62. package/package.json +19 -23
  63. package/scheduled-task/scheduled-task-description.js +43 -39
  64. package/scheduled-task/scheduled-task-trigger.js +74 -71
  65. package/scheduled-task/use-scheduled-task-runs.js +162 -50
  66. package/scheduled-task/use-scheduled-tasks.js +52 -48
  67. package/scheduled-tasks.d.ts +27 -6
  68. package/scheduled-tasks.js +2 -2
  69. package/shared/application-schema.js +5 -2
  70. package/shared/cron-day-of-month.js +13 -0
  71. package/skill/skill-archive.js +19 -0
  72. package/skill/skill-types.js +8 -7
  73. package/skill/skill.js +52 -29
  74. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +38 -34
  75. package/skill/useSkillEditorLoad.js +65 -59
  76. package/skill/useSkillEditorSubmit.js +105 -93
  77. package/skill/useSkillFileActions.js +70 -58
  78. package/skill-editor.d.ts +62 -13
  79. package/skill-editor.js +9 -9
  80. package/usage/map-user-usage-to-model-limits.js +137 -95
  81. package/usage.d.ts +8 -3
  82. package/usePageFileDrag/usePageFileDrag.js +3 -3
  83. package/utils.d.ts +26 -6
  84. package/utils.js +10 -10
@@ -1,24 +1,27 @@
1
- import { stripSurroundingSlashes as e } from "../shared/string-utils.js";
2
- import { formatCalendarDate as t } from "../shared/formatting.js";
3
- import "../skill/skill.js";
4
- import { SkillSource as n } from "../skill/skill-types.js";
5
- import { CatalogEntityType as r, formatLastUsed as i } from "@epam/ai-dial-chat-shared";
6
- import { CatalogContentNodeType as a } from "@epam/ai-dial-catalog";
7
- import { SkillMetadataItemDtoNodeTypeEnum as o } from "@epam/ai-dial-chat-api-client";
1
+ import { safeDecodeURIComponent as e, stripSurroundingSlashes as t } from "../shared/string-utils.js";
2
+ import { formatCalendarDate as n } from "../shared/formatting.js";
3
+ import { SKILL_FOLDER_MARKER as r } from "../skill/skill.js";
4
+ import { SkillSource as i } from "../skill/skill-types.js";
5
+ import { CatalogEntityType as a, formatLastUsed as o } from "@epam/ai-dial-chat-shared";
6
+ import { CatalogContentNodeType as s } from "@epam/ai-dial-catalog";
7
+ import { SkillMetadataItemDtoNodeTypeEnum as c } from "@epam/ai-dial-chat-api-client";
8
8
  //#region src/catalog/map-skill-to-catalog-item.ts
9
- var s = {
10
- [n.Personal]: "personal",
11
- [n.SharedWithMe]: "shared",
12
- [n.Public]: "public"
13
- }, c = (e, t, n) => [n[s[t]], ...(e ?? "").split("/").filter(Boolean)], l = (e, { folderLabels: t, source: a, favoriteIds: o }) => {
14
- let s = o.has(e.url), l = a === n.Public, u = a === n.Personal;
9
+ var l = {
10
+ [i.Personal]: "personal",
11
+ [i.SharedWithMe]: "shared",
12
+ [i.Public]: "public"
13
+ }, u = (t, n) => {
14
+ let r = (n ?? "").split("/").filter(Boolean), i = t.split("/").filter(Boolean).slice(2, -1);
15
+ return i.length === r.length ? i.map(e) : r;
16
+ }, d = (e, t, n) => [n[l[t]], ...u(e.url, e.parentPath)], f = (e, { folderLabels: t, source: n, favoriteIds: r }) => {
17
+ let s = r.has(e.url), c = n === i.Public, l = n === i.Personal;
15
18
  return {
16
19
  id: e.url,
17
- type: r.Skill,
20
+ type: a.Skill,
18
21
  name: e.name,
19
22
  description: e.description ?? "",
20
23
  version: "",
21
- lastUsed: i(e.updatedAt),
24
+ lastUsed: o(e.updatedAt),
22
25
  createdAt: e.createdAt,
23
26
  updatedAt: e.updatedAt,
24
27
  isFeatured: !1,
@@ -26,12 +29,12 @@ var s = {
26
29
  topics: [],
27
30
  isUserFavorite: s,
28
31
  isStarred: s,
29
- isMyApp: u && (e.isMy ?? !0),
30
- sharedWithMe: e.sharedWithMe ?? a === n.SharedWithMe,
31
- isEditable: !l && (e.canEdit ?? u),
32
- folder: c(e.parentPath, a, t)
32
+ isMyApp: l && (e.isMy ?? !0),
33
+ sharedWithMe: e.sharedWithMe ?? n === i.SharedWithMe,
34
+ isEditable: !c && (e.canEdit ?? l),
35
+ folder: d(e, n, t)
33
36
  };
34
- }, u = (e) => e.join(" · "), d = (e, t) => {
37
+ }, p = (e) => e.join(" · "), m = (e, t) => {
35
38
  if (e == null) return null;
36
39
  let n = [];
37
40
  return e.whenToUse != null && n.push({
@@ -39,25 +42,25 @@ var s = {
39
42
  value: e.whenToUse
40
43
  }), e.allowedTools?.length && n.push({
41
44
  label: t.allowedToolsLabel,
42
- value: u(e.allowedTools)
45
+ value: p(e.allowedTools)
43
46
  }), e.bundledResources?.length && n.push({
44
47
  label: t.bundledResourcesLabel,
45
- value: u(e.bundledResources)
48
+ value: p(e.bundledResources)
46
49
  }), n.length === 0 ? null : {
47
50
  title: t.specificationSectionTitle,
48
51
  specs: n
49
52
  };
50
- }, f = (e) => e.filter((e) => e.nodeType === o.Item), p = (t, n) => {
51
- let r = e(n), i = r ? `${r}/files` : "files";
52
- return f(t).find((t) => {
53
- let n = e(t.path);
53
+ }, h = (e) => e.filter((e) => e.nodeType === c.Item), g = (e, n) => {
54
+ let r = t(n), i = r ? `${r}/files` : "files";
55
+ return h(e).find((e) => {
56
+ let n = t(e.path);
54
57
  return n === "SKILL.md" || n === "files/SKILL.md" || n === `${i}/SKILL.md`;
55
58
  })?.path ?? "SKILL.md";
56
- }, m = (t, n) => {
57
- let r = e(t), i = e(n), a = i ? `${i}/files` : "files";
59
+ }, _ = (e, n) => {
60
+ let r = t(e), i = t(n), a = i ? `${i}/files` : "files";
58
61
  return r === "" || r === "files" || r === a ? null : r.startsWith(`${a}/`) ? r.slice(a.length + 1) : r.startsWith("files/") ? r.slice(6) : r;
59
- }, h = (e, t) => m(e, t), g = (e, n, r, i) => {
60
- let a = [], o = d(r, i);
62
+ }, v = (e, t) => _(e, t), y = (e, t, r, i) => {
63
+ let a = [], o = m(r, i);
61
64
  o != null && a.push(o);
62
65
  let s = [];
63
66
  return e?.author && s.push({
@@ -65,26 +68,26 @@ var s = {
65
68
  value: e.author
66
69
  }), s.push({
67
70
  label: i.updatedLabel,
68
- value: e?.updatedAt ? t(e.updatedAt) : ""
71
+ value: e?.updatedAt ? n(e.updatedAt) : ""
69
72
  }), s.push({
70
73
  label: i.fileCountLabel,
71
- value: String(f(n).length)
74
+ value: String(h(t).length)
72
75
  }), a.push({
73
76
  title: i.detailsSectionTitle,
74
77
  specs: s
75
78
  }), { sections: a };
76
- }, _ = (e, t, n) => {
79
+ }, b = (e, t, n) => {
77
80
  if (e === "") return n;
78
81
  let r = t.get(e);
79
82
  if (r != null) return r.items;
80
- let i = e.split("/"), o = _(i.slice(0, -1).join("/"), t, n), s = {
81
- type: a.Folder,
83
+ let i = e.split("/"), a = b(i.slice(0, -1).join("/"), t, n), o = {
84
+ type: s.Folder,
82
85
  id: e,
83
86
  name: i[i.length - 1],
84
87
  items: []
85
88
  };
86
- return t.set(e, s), o.push(s), s.items;
87
- }, v = (e, t) => {
89
+ return t.set(e, o), a.push(o), o.items;
90
+ }, x = (e, t) => {
88
91
  e.sort((e, n) => {
89
92
  if (t) {
90
93
  if (e.name === "SKILL.md") return -1;
@@ -92,32 +95,36 @@ var s = {
92
95
  }
93
96
  return e.name.localeCompare(n.name);
94
97
  });
95
- for (let t of e) t.type === a.Folder && v(t.items, !1);
96
- }, y = (e, t) => {
97
- let n = /* @__PURE__ */ new Map(), r = [];
98
- for (let i of e) {
99
- let e = m(i.path, t);
98
+ for (let t of e) t.type === s.Folder && x(t.items, !1);
99
+ }, S = (e, t) => {
100
+ let n = /* @__PURE__ */ new Map(), i = [];
101
+ for (let a of e) {
102
+ let e = _(a.path, t);
100
103
  if (e == null) continue;
101
- if (i.nodeType === o.Folder) {
102
- _(e, n, r);
104
+ if (a.nodeType === c.Folder) {
105
+ b(e, n, i);
103
106
  continue;
104
107
  }
105
- let s = e.lastIndexOf("/");
106
- _(s === -1 ? "" : e.slice(0, s), n, r).push({
107
- type: a.File,
108
- id: i.path,
109
- name: i.name
108
+ let o = e.lastIndexOf("/"), l = o === -1 ? "" : e.slice(0, o);
109
+ if (a.name === r) {
110
+ b(l, n, i);
111
+ continue;
112
+ }
113
+ b(l, n, i).push({
114
+ type: s.File,
115
+ id: a.path,
116
+ name: a.name
110
117
  });
111
118
  }
112
- return v(r, !0), r;
113
- }, b = async (e) => {
119
+ return x(i, !0), i;
120
+ }, C = async (e) => {
114
121
  let t = Number(e.headers.get("content-length"));
115
122
  if (Number.isFinite(t) && t > 262144) return null;
116
123
  let n = await e.arrayBuffer();
117
124
  return n.byteLength > 262144 ? null : new Uint8Array(n);
118
- }, x = async (e) => new Uint8Array(await e.arrayBuffer()), S = async (e) => {
119
- let t = await b(e);
125
+ }, w = async (e) => new Uint8Array(await e.arrayBuffer()), T = async (e) => {
126
+ let t = await C(e);
120
127
  return t == null ? null : new TextDecoder().decode(t);
121
128
  };
122
129
  //#endregion
123
- export { y as buildSkillContentTree, g as buildSkillOverview, l as mapSkillToCatalogItem, b as readSkillFileBytes, x as readSkillFilePreviewBytes, S as readSkillManifest, h as resolveSkillFileDownloadPath, p as resolveSkillManifestFileId };
130
+ export { S as buildSkillContentTree, y as buildSkillOverview, f as mapSkillToCatalogItem, C as readSkillFileBytes, w as readSkillFilePreviewBytes, T as readSkillManifest, v as resolveSkillFileDownloadPath, g as resolveSkillManifestFileId };
@@ -1,13 +1,13 @@
1
1
  import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
- import { CatalogEntityType as t } from "@epam/ai-dial-chat-shared";
2
+ import { CatalogEntityType as t, PUBLIC_BUCKET as n } from "@epam/ai-dial-chat-shared";
3
3
  //#region src/catalog/publish.ts
4
- var n = {
4
+ var r = {
5
5
  [t.Model]: "model",
6
6
  [t.Toolset]: "toolset",
7
7
  [t.Agent]: "application",
8
8
  [t.Prompt]: "prompt",
9
9
  [t.Skill]: "skill"
10
- }, r = (e) => n[e], i = "public", a = (e) => e.split("/")[1] === i, o = (t) => a(t) ? t.split("/").slice(2, -1).map(e) : [], s = (e) => ({
10
+ }, i = (e) => r[e], a = (e) => e.split("/")[1] === n, o = (t) => a(t) ? t.split("/").slice(2, -1).map(e) : [], s = (e) => ({
11
11
  version: e.version,
12
12
  publishedAt: Date.parse(e.publishedAt),
13
13
  folderPath: e.folderPath.split("/").filter(Boolean),
@@ -17,4 +17,4 @@ var n = {
17
17
  folderPath: e.folderPath.split("/").filter(Boolean)
18
18
  });
19
19
  //#endregion
20
- export { o as getPublicCatalogEntityFolderPath, a as isPublicCatalogEntityId, c as mapPublishConversationResultDto, s as mapPublishHistoryEntryDto, r as toPublishEntityType };
20
+ export { o as getPublicCatalogEntityFolderPath, a as isPublicCatalogEntityId, c as mapPublishConversationResultDto, s as mapPublishHistoryEntryDto, i as toPublishEntityType };
@@ -1,109 +1,130 @@
1
1
  import { getApiErrorDetails as e } from "../../api-error/api-error.js";
2
2
  import { findDeploymentByIdOrReference as t } from "../deployment-id.js";
3
3
  import { parseSkillResourceUrl as n } from "../../skill/skill-types.js";
4
- import { CatalogEntityType as r } from "@epam/ai-dial-chat-shared";
5
- import { useCallback as i, useMemo as a } from "react";
4
+ import { getRunnerSchemas as r, isQuickAppSchema as i } from "../../shared/application-schema.js";
5
+ import { CatalogEntityType as a } from "@epam/ai-dial-chat-shared";
6
+ import { useCallback as o, useMemo as s, useState as c } from "react";
6
7
  //#region src/catalog/useCatalogEditNavigation/useCatalogEditNavigation.ts
7
- var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHideCustomAppCreationEnabled: l, isToolsetsEnabled: u, isPromptsEnabled: d, quickAppSchemaId: f, urls: p, onNavigate: m, deletePrompt: h, deleteToolset: g, deleteSkill: _, deleteApplication: v, refetchPrompts: y, refetchToolsets: b, refetchSkills: x, refetchDeployments: S, onDeleteSuccess: C, labels: w, onNotify: T, onSkillUploadClick: E }) => ({
8
- handleEdit: i((e) => {
9
- if (e.type === r.Prompt) {
10
- m(p.buildPromptEditUrl(e.id));
11
- return;
12
- }
13
- if (e.type === r.Skill) {
14
- m(p.buildSkillEditUrl(e.id));
15
- return;
16
- }
17
- if (e.type === r.Toolset) {
18
- m(p.buildToolsetEditUrl(e.id));
19
- return;
20
- }
21
- let n = t(o, e.id);
22
- if (s && n != null && !n.applicationTypeSchemaId) {
23
- m(p.buildCustomAppEditUrl(e.id));
24
- return;
25
- }
26
- f && m(p.buildQuickAppEditUrl(f, e.id));
27
- }, [
28
- o,
29
- s,
30
- f,
31
- m,
32
- p
33
- ]),
34
- handleDelete: i(async (t) => {
35
- try {
36
- if (t.type === r.Prompt) await h(t.id), await y();
37
- else if (t.type === r.Toolset) await g(t.id), await b();
38
- else if (t.type === r.Skill) {
39
- let e = n(t.id);
40
- if (e == null) throw Error(`Invalid skill resource url: ${t.id}`);
41
- await _(e.bucket, e.path), await x();
42
- } else await v(t.id), await S();
43
- C(t);
44
- } catch (t) {
45
- let { traceId: n } = await e(t);
46
- throw T({
47
- message: w.deleteError,
48
- requestId: n
49
- }), t;
50
- }
51
- }, [
52
- h,
53
- g,
54
- _,
55
- v,
56
- b,
57
- S,
58
- y,
59
- x,
60
- C,
61
- w,
62
- T
63
- ]),
64
- createOptions: a(() => {
65
- let e = [];
66
- return f && c && !l && e.push({
67
- key: "quick-app",
68
- label: w.createQuickApp,
69
- onClick: () => m(p.buildQuickAppCreateUrl(f))
70
- }), u && e.push({
71
- key: "toolset",
72
- label: w.createToolset,
73
- onClick: () => m(p.buildToolsetCreateUrl())
74
- }), s && !l && e.push({
75
- key: "custom-app",
76
- label: w.createCustomApp,
77
- onClick: () => m(p.buildCustomAppCreateUrl())
78
- }), e.push({
79
- key: "skill",
80
- label: w.createSkill,
81
- children: [{
8
+ var l = ({ deployments: l, isCustomAppsEnabled: u, isSchemaAppsEnabled: d, isHideCustomAppCreationEnabled: f, isToolsetsEnabled: p, isPromptsEnabled: m, schemas: h, urls: g, onNavigate: _, deletePrompt: v, deleteToolset: y, deleteSkill: b, deleteApplication: x, refetchPrompts: S, refetchToolsets: C, refetchSkills: w, refetchDeployments: T, onDeleteSuccess: E, labels: D, onNotify: O, onSkillUploadClick: k }) => {
9
+ let A = s(() => r(h), [h]), [j, M] = c(""), N = d && !f;
10
+ return {
11
+ handleEdit: o((e) => {
12
+ if (e.type === a.Prompt) {
13
+ _(g.buildPromptEditUrl(e.id));
14
+ return;
15
+ }
16
+ if (e.type === a.Skill) {
17
+ _(g.buildSkillEditUrl(e.id));
18
+ return;
19
+ }
20
+ if (e.type === a.Toolset) {
21
+ _(g.buildToolsetEditUrl(e.id));
22
+ return;
23
+ }
24
+ let n = t(l, e.id);
25
+ if (u && n != null && !n.applicationTypeSchemaId) {
26
+ _(g.buildCustomAppEditUrl(e.id));
27
+ return;
28
+ }
29
+ let r = A.find((e) => e.id === n?.applicationTypeSchemaId)?.id ?? A.find((e) => i(e))?.id;
30
+ r && _(g.buildQuickAppEditUrl(r, e.id));
31
+ }, [
32
+ l,
33
+ u,
34
+ A,
35
+ _,
36
+ g
37
+ ]),
38
+ handleDelete: o(async (t) => {
39
+ try {
40
+ if (t.type === a.Prompt) await v(t.id), await S();
41
+ else if (t.type === a.Toolset) await y(t.id), await C();
42
+ else if (t.type === a.Skill) {
43
+ let e = n(t.id);
44
+ if (e == null) throw Error(`Invalid skill resource url: ${t.id}`);
45
+ await b(e.bucket, e.path), await w();
46
+ } else await x(t.id), await T();
47
+ E(t);
48
+ } catch (t) {
49
+ let { traceId: n } = await e(t);
50
+ throw O({
51
+ message: D.deleteError,
52
+ requestId: n
53
+ }), t;
54
+ }
55
+ }, [
56
+ v,
57
+ y,
58
+ b,
59
+ x,
60
+ C,
61
+ T,
62
+ S,
63
+ w,
64
+ E,
65
+ D,
66
+ O
67
+ ]),
68
+ createOptions: s(() => {
69
+ let e = j.trim().toLocaleLowerCase(), t = (t) => !e || t.toLocaleLowerCase().includes(e), n = [];
70
+ N && A.map((e) => ({
71
+ id: e.id,
72
+ label: e.displayName || e.id
73
+ })).filter((e) => t(e.label)).forEach((e) => {
74
+ n.push({
75
+ key: `runner:${e.id}`,
76
+ label: e.label,
77
+ onClick: () => _(g.buildQuickAppCreateUrl(e.id))
78
+ });
79
+ }), p && t(D.createToolset) && n.push({
80
+ key: "toolset",
81
+ label: D.createToolset,
82
+ onClick: () => _(g.buildToolsetCreateUrl())
83
+ }), u && !f && t(D.createCustomApp) && n.push({
84
+ key: "custom-app",
85
+ label: D.createCustomApp,
86
+ onClick: () => _(g.buildCustomAppCreateUrl())
87
+ });
88
+ let r = [{
82
89
  key: "skill-write-instructions",
83
- label: w.createSkillWriteInstructions,
84
- onClick: () => m(p.buildSkillCreateUrl())
90
+ label: D.createSkillWriteInstructions,
91
+ onClick: () => _(g.buildSkillCreateUrl())
85
92
  }, {
86
93
  key: "skill-upload",
87
- label: w.createSkillUpload,
88
- onClick: E
89
- }]
90
- }), d && e.push({
91
- key: "prompt",
92
- label: w.createPrompt,
93
- onClick: () => m(p.buildPromptCreateUrl())
94
- }), e;
95
- }, [
96
- f,
97
- m,
98
- p,
99
- d,
100
- w,
101
- c,
102
- l,
103
- u,
104
- s,
105
- E
106
- ])
107
- });
94
+ label: D.createSkillUpload,
95
+ onClick: k
96
+ }], i = t(D.createSkill) ? r : r.filter((e) => t(String(e.label)));
97
+ return i.length > 0 && n.push({
98
+ key: "skill",
99
+ label: D.createSkill,
100
+ children: i
101
+ }), m && t(D.createPrompt) && n.push({
102
+ key: "prompt",
103
+ label: D.createPrompt,
104
+ onClick: () => _(g.buildPromptCreateUrl())
105
+ }), n.sort((e, t) => String(e.label ?? "").localeCompare(String(t.label ?? ""), void 0, { sensitivity: "base" }));
106
+ }, [
107
+ j,
108
+ N,
109
+ A,
110
+ _,
111
+ g,
112
+ m,
113
+ D,
114
+ f,
115
+ p,
116
+ u,
117
+ k
118
+ ]),
119
+ createSearch: s(() => N && A.length > 0 ? {
120
+ value: j,
121
+ onChange: M
122
+ } : void 0, [
123
+ N,
124
+ A.length,
125
+ j
126
+ ])
127
+ };
128
+ };
108
129
  //#endregion
109
- export { o as useCatalogEditNavigation };
130
+ export { l as useCatalogEditNavigation };
@@ -12,8 +12,8 @@ var p = (e) => (t) => {
12
12
  if (!s(t)) return e.getPrompt(t.id);
13
13
  let n = a(t.id);
14
14
  return e.getPublicPrompt(n?.path ?? t.id);
15
- }, m = ({ api: a, skills: s, isAdmin: m, dialCoreExternalUrl: h, skillOverviewLabels: g, promptOverviewLabels: _, deploymentLimitsLabels: v }) => {
16
- let { onFetchSkillDetails: y, onLoadContentFile: b, onLoadSkillDetailsFile: x } = u({
15
+ }, m = ({ api: a, skills: s, isAdmin: m, dialCoreExternalUrl: h, skillOverviewLabels: g, promptOverviewLabels: _, deploymentLimitsLabels: v, entityDetailsLabels: y }) => {
16
+ let { onFetchSkillDetails: b, onLoadContentFile: x, onLoadSkillDetailsFile: S } = u({
17
17
  api: a,
18
18
  skills: s,
19
19
  skillOverviewLabels: g
@@ -29,15 +29,15 @@ var p = (e) => (t) => {
29
29
  } catch {
30
30
  return;
31
31
  }
32
- if (s.type === d.Skill) return y(s);
32
+ if (s.type === d.Skill) return b(s);
33
33
  try {
34
- let o = s.type === d.Model ? a.getDeploymentLimits(s.id).catch(() => void 0) : Promise.resolve(void 0), [u, f] = await Promise.all([a.getDeploymentDetails(s.id), o]), p = n(u), g = r(p), _ = l(s.type, s.supportsMcp), y = p.type === "MODEL" || p.type === "AGENT" ? e(h ?? "", s.id, {
34
+ let o = s.type === d.Model ? a.getDeploymentLimits(s.id).catch(() => void 0) : Promise.resolve(void 0), [u, f] = await Promise.all([a.getDeploymentDetails(s.id), o]), p = n(u), g = r(p, y), _ = l(s.type, s.supportsMcp), b = p.type === "MODEL" || p.type === "AGENT" ? e(h ?? "", s.id, {
35
35
  hasChatCompletion: p.data.capabilities?.hasChatCompletion,
36
36
  hasResponsesApi: p.data.capabilities?.hasResponsesApi
37
37
  }) : void 0;
38
38
  return {
39
39
  ...g,
40
- api: _ == null ? y ?? g.api : c(h ?? "", s.id, _),
40
+ api: _ == null ? b ?? g.api : c(h ?? "", s.id, _),
41
41
  limits: t(f, v),
42
42
  credentials: p.type === "TOOLSET" ? i(s.id, p.data, m) : void 0
43
43
  };
@@ -49,11 +49,12 @@ var p = (e) => (t) => {
49
49
  m,
50
50
  v,
51
51
  h,
52
+ y,
52
53
  _,
53
- y
54
+ b
54
55
  ]),
55
- onLoadContentFile: b,
56
- onLoadSkillDetailsFile: x
56
+ onLoadContentFile: x,
57
+ onLoadSkillDetailsFile: S
57
58
  };
58
59
  };
59
60
  //#endregion
@@ -48,7 +48,7 @@ var c = "Production", l = 50, u = (e, t, n) => {
48
48
  return b((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
49
49
  }, []), T = e((e) => {
50
50
  let t = s(e), n = Array.isArray(d) ? d : [];
51
- !t || n.includes(t) || f?.([t, ...n].slice(0, l));
51
+ !t || n[0] === t || f?.([t, ...n.filter((e) => e !== t)].slice(0, l));
52
52
  }, [d, f]), E = e((e) => !e.includes(c), []);
53
53
  return {
54
54
  folderItems: n(() => {