@epam/ai-dial-chat-hooks 1.1.0-dev.445 → 1.1.0-dev.456

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.
@@ -1,12 +1,12 @@
1
1
  import { MessageRole as e } from "@epam/ai-dial-chat-shared";
2
2
  //#region src/conversation/useConversationHandlers/message-utils.ts
3
- var t = (e) => e != null && Object.keys(e).length > 0, n = (e, t, n, r) => {
4
- if (t !== e.content || r.length > 0) return !0;
5
- let i = e.custom_content?.attachments?.length ?? 0;
6
- return n.length !== i;
7
- }, r = (t) => t == null || t.role !== e.Assistant || !!t.wasStoppedByUser || t.streamErrorMessage != null, i = (e, t, i, a, o) => {
8
- let s = e[t];
9
- return s ? n(s, i, a, o) || r(e[t + 1]) : !1;
3
+ var t = (e) => e != null && Object.keys(e).length > 0, n = (e, t) => (e?.length ?? 0) === (t?.length ?? 0) ? (e ?? []).some((e, n) => e.url !== t?.[n]?.url) : !0, r = (e, t, r, i, a) => {
4
+ if (t !== e.content || i.length > 0) return !0;
5
+ let o = e.custom_content?.attachments?.length ?? 0;
6
+ return r.length === o ? a != null && n(e.custom_content?.skills, a) : !0;
7
+ }, i = (t) => t == null || t.role !== e.Assistant || !!t.wasStoppedByUser || t.streamErrorMessage != null, a = (e, t, n, a, o, s) => {
8
+ let c = e[t];
9
+ return c ? r(c, n, a, o, s) || i(e[t + 1]) : !1;
10
10
  };
11
11
  //#endregion
12
- export { t as hasActiveToolConfig, r as isAnswerIncomplete, n as isMessageChanged, i as shouldRerunGenerationOnEdit };
12
+ export { t as hasActiveToolConfig, i as isAnswerIncomplete, r as isMessageChanged, a as shouldRerunGenerationOnEdit };
@@ -13,24 +13,25 @@ var p = ({ conversation: p, conversationId: m, bucket: h, isStreaming: g, startS
13
13
  filesApi: b,
14
14
  bucket: h,
15
15
  onNetworkError: T
16
- }), P = u(async (e, i) => {
16
+ }), P = u(async (e, i, a) => {
17
17
  if (!m || !p) return;
18
- let a = t(i), o = r(E), s = a?.length || o ? {
19
- ...a?.length ? { attachments: a } : {},
20
- ...o ? { configuration_value: E } : {}
21
- } : void 0, c = C(), { userMessage: u, assistantMessage: d } = n(e, s, c);
18
+ let o = t(i), s = r(E), c = o?.length || s || a?.length ? {
19
+ ...o?.length ? { attachments: o } : {},
20
+ ...s ? { configuration_value: E } : {},
21
+ ...a?.length ? { skills: a } : {}
22
+ } : void 0, u = C(), { userMessage: d, assistantMessage: h } = n(e, c, u);
22
23
  v((e) => {
23
24
  if (!e) return e;
24
25
  let t = {
25
26
  ...e,
26
27
  messages: [
27
28
  ...e.messages,
28
- u,
29
- d
29
+ d,
30
+ h
30
31
  ]
31
32
  };
32
33
  return y.current = t, t;
33
- }), _(m, e, p.messages.length + 1, c, s, l(), f.Append);
34
+ }), _(m, e, p.messages.length + 1, u, c, l(), f.Append);
34
35
  }, [
35
36
  p,
36
37
  m,
@@ -206,43 +207,46 @@ var p = ({ conversation: p, conversationId: m, bucket: h, isStreaming: g, startS
206
207
  return n.delete(e), n;
207
208
  });
208
209
  }, []),
209
- handleEditMessage: u(async (e, n, r, a) => {
210
+ handleEditMessage: u(async (e, n, r, a, o) => {
210
211
  if (g || !m || !p) return;
211
- let o = e;
212
- if (o === -1 || p.messages[o].role !== c.User) return;
213
- let s = p.messages[o];
214
- if (!i(p.messages, o, n, r, a)) {
212
+ let s = e;
213
+ if (s === -1 || p.messages[s].role !== c.User) return;
214
+ let u = p.messages[s];
215
+ if (!i(p.messages, s, n, r, a, o)) {
215
216
  A((e) => {
216
217
  let t = new Set(e);
217
- return t.delete(o), t;
218
+ return t.delete(s), t;
218
219
  });
219
220
  return;
220
221
  }
221
- let u = t(a), d = new Set(r.map((e) => e.id)), h = [...(s.custom_content?.attachments ?? []).filter((e) => {
222
+ let d = t(a), h = new Set(r.map((e) => e.id)), b = [...(u.custom_content?.attachments ?? []).filter((e) => {
222
223
  let t = e.url ?? e.data ?? e.title;
223
- return d.has(t);
224
- }), ...u ?? []], { attachments: b, ...x } = s.custom_content ?? {}, S = h.length > 0 ? {
225
- ...x,
226
- attachments: h
227
- } : Object.keys(x).length > 0 ? x : void 0, w = {
228
- ...s,
224
+ return h.has(t);
225
+ }), ...d ?? []], { attachments: x, skills: S, ...w } = u.custom_content ?? {}, T = o ?? S, E;
226
+ E = b.length > 0 || T?.length ? {
227
+ ...w,
228
+ ...b.length > 0 ? { attachments: b } : {},
229
+ ...T?.length ? { skills: T } : {}
230
+ } : Object.keys(w).length > 0 ? w : void 0;
231
+ let D = {
232
+ ...u,
229
233
  content: n,
230
- custom_content: S
231
- }, T = Date.now(), E = {
234
+ custom_content: E
235
+ }, O = Date.now(), k = {
232
236
  role: c.Assistant,
233
237
  content: "",
234
- timestamp: new Date(T).toISOString()
235
- }, D = [
236
- ...p.messages.slice(0, o),
237
- w,
238
- E
239
- ], O = {
238
+ timestamp: new Date(O).toISOString()
239
+ }, j = [
240
+ ...p.messages.slice(0, s),
241
+ D,
242
+ k
243
+ ], M = {
240
244
  ...p,
241
- messages: D
245
+ messages: j
242
246
  };
243
- y.current = O, v(O);
244
- let k = C();
245
- _(m, n, D.length - 1, k, S, l(), f.Edit), A(/* @__PURE__ */ new Set());
247
+ y.current = M, v(M);
248
+ let N = C();
249
+ _(m, n, j.length - 1, N, E, l(), f.Edit), A(/* @__PURE__ */ new Set());
246
250
  }, [
247
251
  p,
248
252
  m,
package/conversation.d.ts CHANGED
@@ -20,6 +20,7 @@ import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
20
20
  import { RateApi } from '@epam/ai-dial-chat-api-client';
21
21
  import { ReactNode } from 'react';
22
22
  import { RefObject } from 'react';
23
+ import { RequestSkill } from '@epam/ai-dial-chat-shared';
23
24
  import { ResponseFormat } from '@epam/ai-dial-chat-shared';
24
25
  import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
25
26
  import { SetStateAction } from 'react';
@@ -506,15 +507,20 @@ export declare const isAnswerIncomplete: (answer: Message | undefined) => boolea
506
507
  export declare const isAwaitingGenerationResume: (conversation: Conversation) => boolean;
507
508
 
508
509
  /**
509
- * Returns `true` when the edited text or attachment list differs from the
510
- * original message, meaning a regeneration is needed.
510
+ * Returns `true` when the edited text, attachment list, or skills list differs
511
+ * from the original message, meaning a regeneration is needed.
512
+ *
513
+ * `skills` is the skills state the edit will write: `undefined` leaves the
514
+ * original skills out of the comparison (nothing about them changes), while an
515
+ * array — including an empty one — is compared against the original.
511
516
  *
512
517
  * @param originalMessage - The unmodified message stored in the conversation.
513
518
  * @param newText - The text the user submitted from the edit area.
514
519
  * @param keptDisplayAttachments - Attachments the user kept (not removed).
515
520
  * @param newAttachments - Brand-new attachments the user added during editing.
521
+ * @param skills - The skills the edited message will carry, or `undefined` to leave them unchanged.
516
522
  */
517
- export declare const isMessageChanged: (originalMessage: Message, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
523
+ export declare const isMessageChanged: (originalMessage: Message, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => boolean;
518
524
 
519
525
  /**
520
526
  * Returns `true` when `message` is the actively-streaming assistant response.
@@ -611,8 +617,10 @@ export declare const sanitizeFooterHtml: (html: string) => string;
611
617
  * its answer never completed — after stopping a generation the user submits
612
618
  * the same message precisely to get a full answer, so treating that as "no
613
619
  * change" would leave the conversation stuck with the partial one.
620
+ *
621
+ * @param skills - The skills the edited message will carry, or `undefined` to leave them unchanged — see {@link isMessageChanged}.
614
622
  */
615
- export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
623
+ export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => boolean;
616
624
 
617
625
  /** True when the first user/assistant exchange is complete and LLM naming may still run. */
618
626
  export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
@@ -795,7 +803,7 @@ export declare interface UseConversationHandlersParams {
795
803
 
796
804
  /** Return value of {@link useConversationHandlers}. */
797
805
  export declare interface UseConversationHandlersResult {
798
- handleSend: (message: string, attachments: Attachment[]) => Promise<void>;
806
+ handleSend: (message: string, attachments: Attachment[], skills?: RequestSkill[]) => Promise<void>;
799
807
  handleUploadAttachment: (attachment: Attachment) => Promise<UploadedAttachmentResult>;
800
808
  handleRegenerateMessage: (messageIndex: number) => void;
801
809
  handleDeleteMessage: (messageIndex: number) => void;
@@ -805,7 +813,7 @@ export declare interface UseConversationHandlersResult {
805
813
  handleConfirmStarter: () => void;
806
814
  handleStartEdit: (messageIndex: number) => void;
807
815
  handleCancelEdit: (messageIndex: number) => void;
808
- handleEditMessage: (messageIndex: number, text: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => Promise<void>;
816
+ handleEditMessage: (messageIndex: number, text: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => Promise<void>;
809
817
  editingMessageIndexes: Set<number>;
810
818
  pendingDeleteIndex: number | null;
811
819
  setPendingDeleteIndex: (index: number | null) => void;
@@ -1,39 +1,39 @@
1
- import { safeDecodeURI as e } from "../shared/string-utils.js";
2
- import { PATH_SEPARATOR_REGEXP as t } from "./dial-file-manager.model.js";
3
- import { DialFileManagerActionProfile as n } from "./file-manager-variant.js";
4
- import { DialFileNodeType as r, DialFilePermission as i } from "@epam/ai-dial-react-file-manager";
1
+ import { safeDecodeURI as e, stripTrailingSlashes as t } from "../shared/string-utils.js";
2
+ import { PATH_SEPARATOR_REGEXP as n } from "./dial-file-manager.model.js";
3
+ import { DialFileManagerActionProfile as r } from "./file-manager-variant.js";
4
+ import { DialFileNodeType as i, DialFilePermission as a } from "@epam/ai-dial-react-file-manager";
5
5
  //#region src/files/dial-file-manager-path.util.ts
6
- var a = (e, n) => {
7
- if (t.test(e)) return !0;
8
- if (n == null) return !1;
9
- n.lastIndex = 0;
10
- let r = n.test(e);
11
- return n.lastIndex = 0, r;
12
- }, o = (e) => e.replace(/\/+$/, "") || "/", s = (e, t) => {
6
+ var o = (e, t) => {
7
+ if (n.test(e)) return !0;
8
+ if (t == null) return !1;
9
+ t.lastIndex = 0;
10
+ let r = t.test(e);
11
+ return t.lastIndex = 0, r;
12
+ }, s = (e) => t(e) || "/", c = (e, t) => {
13
13
  let n = e.split("/").filter(Boolean);
14
14
  return n[n.length - 1] ?? t;
15
- }, c = (e, t) => o(e || `/${t}`).replace(/^\/+/, "") || t, l = (e, t) => {
16
- let n = o(t);
17
- for (let i of e) {
18
- if (i.nodeType !== r.FOLDER) continue;
19
- if (o(i.path) === n) return i;
20
- let e = l(i.items ?? [], t);
15
+ }, l = (e, t) => s(e || `/${t}`).replace(/^\/+/, "") || t, u = (e, t) => {
16
+ let n = s(t);
17
+ for (let r of e) {
18
+ if (r.nodeType !== i.FOLDER) continue;
19
+ if (s(r.path) === n) return r;
20
+ let e = u(r.items ?? [], t);
21
21
  if (e) return e;
22
22
  }
23
- }, u = (e) => e?.permissions?.includes(i.WRITE) ?? !1, d = (e, t) => {
23
+ }, d = (e) => e?.permissions?.includes(a.WRITE) ?? !1, f = (e, t) => {
24
24
  for (let n of e) {
25
25
  if (n.path === t || n.id === t) return n;
26
- let e = d(n.items ?? [], t);
26
+ let e = f(n.items ?? [], t);
27
27
  if (e) return e;
28
28
  }
29
- }, f = (e) => {
29
+ }, p = (e) => {
30
30
  switch (e) {
31
- case n.Attach: return !1;
32
- case n.Browse:
33
- case n.Full: return !0;
31
+ case r.Attach: return !1;
32
+ case r.Browse:
33
+ case r.Full: return !0;
34
34
  default: throw Error(`Unhandled actionProfile: ${String(e)}`);
35
35
  }
36
- }, p = (e) => e === n.Full, m = (e, t) => {
36
+ }, m = (e) => e === r.Full, h = (e, t) => {
37
37
  let n = e.replace(/\/$/, ""), r = n.lastIndexOf("/");
38
38
  if (r <= 0) {
39
39
  let e = r === 0 ? n.slice(1) : n;
@@ -46,13 +46,13 @@ var a = (e, n) => {
46
46
  parentVirtualPath: n.slice(0, r),
47
47
  name: n.slice(r + 1)
48
48
  };
49
- }, h = (e, t) => {
49
+ }, g = (e, t) => {
50
50
  let n = `files/${t}/`;
51
51
  return e.startsWith(n) ? e.slice(n.length) : e;
52
- }, g = (t, n, r) => {
53
- let i = t.replace(/\/+$/, "").split("/").filter(Boolean).map(e).join("/"), a = i ? `/${n}/${i}` : `/${n}`;
52
+ }, _ = (t, n, r) => {
53
+ let i = t.split("/").filter(Boolean).map(e).join("/"), a = i ? `/${n}/${i}` : `/${n}`;
54
54
  return r ? `${a}/` : a;
55
- }, _ = (e, t, n) => {
55
+ }, v = (e, t, n) => {
56
56
  if (!e) return {
57
57
  bucket: n,
58
58
  path: e
@@ -62,11 +62,11 @@ var a = (e, n) => {
62
62
  bucket: n,
63
63
  path: e
64
64
  };
65
- let o = h(a.dialCorePath, a.bucket), s = r === -1 ? "" : e.slice(r + 1);
65
+ let o = g(a.dialCorePath, a.bucket), s = r === -1 ? "" : e.slice(r + 1);
66
66
  return {
67
67
  bucket: a.bucket,
68
68
  path: o + s
69
69
  };
70
70
  };
71
71
  //#endregion
72
- export { g as buildSharedItemVirtualPath, h as dialCorePathToRelative, d as findDialFileByPath, l as findFolderByVirtualPath, c as formatOperationFolderName, s as getVirtualPathName, u as hasDialFileWritePermission, a as hasForbiddenNameSymbols, f as isCopyMoveDuplicateAllowed, p as isShareActionsAllowed, o as normalizeVirtualPath, m as parseNewFolderVirtualPath, _ as resolveOwnerCoords };
72
+ export { _ as buildSharedItemVirtualPath, g as dialCorePathToRelative, f as findDialFileByPath, u as findFolderByVirtualPath, l as formatOperationFolderName, c as getVirtualPathName, d as hasDialFileWritePermission, o as hasForbiddenNameSymbols, p as isCopyMoveDuplicateAllowed, m as isShareActionsAllowed, s as normalizeVirtualPath, h as parseNewFolderVirtualPath, v as resolveOwnerCoords };
@@ -11,9 +11,13 @@ var r = (e) => {
11
11
  if (e(n) <= i) return n;
12
12
  let { base: a, extension: o } = r(n), s = i - e(o);
13
13
  return s <= 0 ? t(n, i) : `${t(a, s)}${o}`;
14
- }, a = (e) => {
15
- let { base: t, extension: a } = r(e), o = t.replace(new RegExp(n.source, "g"), "_").replace(/[.\s]+$/, "");
16
- return o === "" ? e : i(`${o}${a}`);
14
+ }, a = /[.\s]/, o = (e) => {
15
+ let t = e.length;
16
+ for (; t > 0 && a.test(e[t - 1]);) --t;
17
+ return e.slice(0, t);
18
+ }, s = (e) => {
19
+ let { base: t, extension: a } = r(e), s = o(t.replace(new RegExp(n.source, "g"), "_"));
20
+ return s === "" ? e : i(`${s}${a}`);
17
21
  };
18
22
  //#endregion
19
- export { a as sanitizeFileName, r as splitFileNameExtension, i as trimFileNameToByteLimit };
23
+ export { s as sanitizeFileName, r as splitFileNameExtension, i as trimFileNameToByteLimit };
package/index.d.ts CHANGED
@@ -105,6 +105,7 @@ import { ReactNode } from 'react';
105
105
  import { RefObject } from 'react';
106
106
  import { RenameFilesResponseDto } from '@epam/ai-dial-chat-api-client';
107
107
  import { RenameItemDto } from '@epam/ai-dial-chat-api-client';
108
+ import { RequestSkill } from '@epam/ai-dial-chat-shared';
108
109
  import { ResponseFormat } from '@epam/ai-dial-chat-shared';
109
110
  import { RevokeAccessItemDto } from '@epam/ai-dial-chat-api-client';
110
111
  import { RevokeAccessResponseDto } from '@epam/ai-dial-chat-api-client';
@@ -1911,15 +1912,20 @@ export declare const isDownloadableAttachment: (attachment: DisplayAttachment) =
1911
1912
  export declare const isExternalSourcePreviewable: (contentType: string, url: string) => boolean;
1912
1913
 
1913
1914
  /**
1914
- * Returns `true` when the edited text or attachment list differs from the
1915
- * original message, meaning a regeneration is needed.
1915
+ * Returns `true` when the edited text, attachment list, or skills list differs
1916
+ * from the original message, meaning a regeneration is needed.
1917
+ *
1918
+ * `skills` is the skills state the edit will write: `undefined` leaves the
1919
+ * original skills out of the comparison (nothing about them changes), while an
1920
+ * array — including an empty one — is compared against the original.
1916
1921
  *
1917
1922
  * @param originalMessage - The unmodified message stored in the conversation.
1918
1923
  * @param newText - The text the user submitted from the edit area.
1919
1924
  * @param keptDisplayAttachments - Attachments the user kept (not removed).
1920
1925
  * @param newAttachments - Brand-new attachments the user added during editing.
1926
+ * @param skills - The skills the edited message will carry, or `undefined` to leave them unchanged.
1921
1927
  */
1922
- export declare const isMessageChanged: (originalMessage: Message, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
1928
+ export declare const isMessageChanged: (originalMessage: Message, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => boolean;
1923
1929
 
1924
1930
  /**
1925
1931
  * Returns `true` when `message` is the actively-streaming assistant response.
@@ -3067,8 +3073,10 @@ export declare interface SharedRootMeta {
3067
3073
  * its answer never completed — after stopping a generation the user submits
3068
3074
  * the same message precisely to get a full answer, so treating that as "no
3069
3075
  * change" would leave the conversation stuck with the partial one.
3076
+ *
3077
+ * @param skills - The skills the edited message will carry, or `undefined` to leave them unchanged — see {@link isMessageChanged}.
3070
3078
  */
3071
- export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
3079
+ export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => boolean;
3072
3080
 
3073
3081
  /** True when the first user/assistant exchange is complete and LLM naming may still run. */
3074
3082
  export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
@@ -3396,6 +3404,9 @@ export declare interface StreamCompletionOptions {
3396
3404
  /** Strips leading and trailing slashes from a path segment. */
3397
3405
  export declare const stripSurroundingSlashes: (path: string) => string;
3398
3406
 
3407
+ /** Strips trailing slashes from a path segment. */
3408
+ export declare const stripTrailingSlashes: (path: string) => string;
3409
+
3399
3410
  declare type SubmitPhase = 'idle' | 'submitting' | 'success' | 'failure';
3400
3411
 
3401
3412
  export declare const subscribeToolsetLoginSuccess: <T>(listener: (detail: ToolsetLoginSuccessDetail<T>) => void) => (() => void);
@@ -4173,7 +4184,7 @@ export declare interface UseConversationHandlersParams {
4173
4184
 
4174
4185
  /** Return value of {@link useConversationHandlers}. */
4175
4186
  export declare interface UseConversationHandlersResult {
4176
- handleSend: (message: string, attachments: Attachment[]) => Promise<void>;
4187
+ handleSend: (message: string, attachments: Attachment[], skills?: RequestSkill[]) => Promise<void>;
4177
4188
  handleUploadAttachment: (attachment: Attachment) => Promise<UploadedAttachmentResult>;
4178
4189
  handleRegenerateMessage: (messageIndex: number) => void;
4179
4190
  handleDeleteMessage: (messageIndex: number) => void;
@@ -4183,7 +4194,7 @@ export declare interface UseConversationHandlersResult {
4183
4194
  handleConfirmStarter: () => void;
4184
4195
  handleStartEdit: (messageIndex: number) => void;
4185
4196
  handleCancelEdit: (messageIndex: number) => void;
4186
- handleEditMessage: (messageIndex: number, text: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => Promise<void>;
4197
+ handleEditMessage: (messageIndex: number, text: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[], skills?: RequestSkill[]) => Promise<void>;
4187
4198
  editingMessageIndexes: Set<number>;
4188
4199
  pendingDeleteIndex: number | null;
4189
4200
  setPendingDeleteIndex: (index: number | null) => void;
package/index.js CHANGED
@@ -1,136 +1,136 @@
1
1
  import { getApiErrorDetails as e, getApiErrorMessage as t, getApiErrorStatus as n, isConversationNotFoundError as r } from "./api-error/api-error.js";
2
2
  import { createCsrfMiddleware as i } from "./api-transport/create-csrf-middleware.js";
3
3
  import { createUnauthorizedMiddleware as a } from "./api-transport/create-unauthorized-middleware.js";
4
- import { includesIgnoreCase as o, safeDecodeURI as s, safeDecodeURIComponent as c, stripSurroundingSlashes as l } from "./shared/string-utils.js";
5
- import { isDialFileId as u, resolveDialFileBucketAndPath as d, resolveRelativeDialFilePath as f } from "./files/dial-file.js";
6
- import { downloadAttachment as p, isDownloadableAttachment as m, useAttachmentAction as h } from "./attachment/useAttachmentAction/useAttachmentAction.js";
7
- import { isDialFileAcceptType as g, mimeTypesToAttachmentExtensionLabels as _, mimeTypesToDialFileAcceptTypes as v, mimeTypesToFileAccept as y } from "./files/attachment-types.js";
8
- import { AttachmentValidationErrorReason as b, useAttachmentValidation as x } from "./attachment/useAttachmentValidation/useAttachmentValidation.js";
9
- import { formatDateYM as S, formatDateYMD as C } from "./conversation/conversation-transfer/date.js";
10
- import { ConversationExportMode as w, ConversationTransferErrorCode as T, ConversationTransferWarningCode as E, ExportFileNameKind as D } from "./conversation/conversation-transfer/types.js";
11
- import { EXPORT_APP_NAME as O } from "./conversation/conversation-transfer/export-conversation.js";
12
- import { formatQuotedNameList as k } from "./conversation/conversation-transfer/import-conversation.js";
13
- import { createPublishApiClient as A, toPublishRuleDto as j } from "./catalog/create-publish-api.js";
14
- import { buildChatCompletionsUrl as M, buildDeploymentConnectApi as N, buildResponsesUrl as P } from "./catalog/deployment-endpoint-url.js";
15
- import { encodeDeploymentId as F, findDeploymentByIdOrReference as I } from "./catalog/deployment-id.js";
16
- import { AuthenticationType as L } from "./catalog/entity-details.js";
17
- import { mapDeploymentLimitsDtoToCatalogLimits as R } from "./catalog/map-deployment-limits-to-catalog.js";
18
- import { mapDeploymentLimitsToInput as z } from "./catalog/map-deployment-limits-to-input.js";
19
- import { decodeToolsetId as B, encodeToolsetId as V, isPublicToolsetId as H } from "./oauth/toolset-id.js";
20
- import { appendLocaleCode as U, buildAdditionalLocaleOptions as W, composeLocalePayload as G, decomposeLocalizedFields as K, resolveLocalizedText as q, toBaseLocale as J } from "./shared/locale.js";
21
- import { formatCalendarDate as Y, padTwoDigits as X } from "./shared/formatting.js";
22
- import { mapDeploymentDetailsDtoToEntityDetails as Z, mapEntityDetailsToCatalogDetails as Q, mapToolsetCredentials as $ } from "./catalog/map-entity-details-to-catalog.js";
23
- import { mapDeploymentToCatalogItem as ee, mapDeploymentToolsetCredentials as te, mapToolsetToCatalogItem as ne, resolveDeploymentFolder as re } from "./catalog/map-deployment-to-catalog-item.js";
24
- import { PromptSource as ie, parsePromptResourceUrl as ae } from "./prompt/prompt-resource.js";
25
- import { buildPromptOverview as oe, isOrganisationPromptItem as se, mapPromptToCatalogItem as ce } from "./catalog/map-prompt-to-catalog-item.js";
26
- import { SKILL_FILE_UPLOAD_MAX_BYTES as le, SKILL_MANIFEST_FILE as ue, SKILL_UPLOAD_MAX_FILES as de, SKILL_UPLOAD_MAX_TOTAL_BYTES as fe, buildSkillFilesPayload as pe, buildSkillManifest as me, buildSkillManifestForSubmit as he, buildSkillManifestFromFrontmatter as ge, isValidSkillRelativePath as _e, nameFromPath as ve, normalizeSkillName as ye, parseSkillManifest as be, skillFileBytesToBlob as xe, unpackSkillArchive as Se } from "./skill/skill.js";
27
- import { PUBLIC_SKILL_BUCKET as Ce, SKILL_LISTING_MAX_PAGES as we, SKILL_LISTING_PAGE_SIZE as Te, SKILL_MANIFEST_MAX_BYTES as Ee, SkillSource as De, parseSkillResourceUrl as Oe } from "./skill/skill-types.js";
28
- import { buildSkillContentTree as ke, buildSkillOverview as Ae, mapSkillToCatalogItem as je, readSkillFileBytes as Me, readSkillManifest as Ne, resolveSkillFileDownloadPath as Pe, resolveSkillManifestFileId as Fe } from "./catalog/map-skill-to-catalog-item.js";
29
- import { McpResourceKind as Ie, buildApplicationMcpUrl as Le, buildConnectApi as Re, buildToolsetMcpUrl as ze, resolveMcpResourceKind as Be } from "./catalog/mcp-endpoint-url.js";
30
- import { getPublicCatalogEntityFolderPath as Ve, isPublicCatalogEntityId as He, mapPublishConversationResultDto as Ue, mapPublishHistoryEntryDto as We, toPublishEntityType as Ge } from "./catalog/publish.js";
31
- import { deriveAvailableTabIds as Ke, deriveFavoriteItems as qe, filterCatalogItemsBySelector as Je, filterHiddenOwnedItems as Ye, reconcileFilterTopics as Xe } from "./catalog/catalog-derivations.js";
32
- import { CatalogPrimaryActionType as Ze, resolveCatalogPrimaryAction as Qe } from "./catalog/catalog-primary-action.js";
33
- import { useCatalogEditNavigation as $e } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
34
- import { parseSkillManifestDocument as et } from "./skill/skill-manifest.js";
35
- import { fetchSkillDescription as tt, useSkillItemDetails as nt } from "./catalog/useSkillItemDetails.js";
36
- import { useCatalogItemDetails as rt } from "./catalog/useCatalogItemDetails.js";
37
- import { OAuthResourceKind as it, TOOLSET_REDIRECT_STATE_KEY as at, ToolsetAuthStatus as ot, ToolsetAuthTypes as st, ToolsetCredentialsLevel as ct, ToolsetOAuthCallbackQuery as lt, ToolsetOAuthChannelControlType as ut, ToolsetOAuthFailureReason as dt, ToolsetOAuthInitiationResultType as ft, ToolsetOAuthResultType as pt, WithLogin as mt } from "./oauth/types.js";
38
- import { emitToolsetLoginSuccess as ht, subscribeToolsetLoginSuccess as gt } from "./shared/toolset-login-events.js";
39
- import { getToolsetOAuthChannelName as _t, waitForToolsetOAuthResult as vt } from "./oauth/handshake.js";
40
- import { buildToolsetAuthorizeUrl as yt, getToolsetRedirectUri as bt } from "./oauth/authorize-url.js";
41
- import { initiateOAuthLogin as xt, navigateToolsetOAuthPopup as St, openToolsetOAuthPopup as Ct } from "./oauth/popup.js";
42
- import { ToolsetLoginOutcomeType as wt, useToolsetLogin as Tt } from "./oauth/useToolsetLogin/useToolsetLogin.js";
43
- import { useCatalogToolsetCredentials as Et } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
44
- import { useSkillDetailsPanelData as Dt } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
45
- import { FavoriteEntityType as Ot, useFavoriteEntitiesState as kt } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
46
- import { usePublishFolders as At } from "./catalog/usePublishFolders/usePublishFolders.js";
47
- import { buildAnnouncementSignature as jt, hasAnnouncementContent as Mt, hasStructuredAnnouncement as Nt, sanitizeAnnouncementHtml as Pt, sanitizeAnnouncementMessageHtml as Ft } from "./conversation/announcement-message.js";
48
- import { DEFAULT_GENERATION_CONFLICT_MESSAGE as It, GenerationConflictError as Lt, createChatStreamApi as Rt } from "./conversation/create-chat-stream-api.js";
49
- import { shouldWatchForDisplayNameUpdate as zt } from "./conversation/display-name-watch.js";
50
- import { formatAppVersion as Bt, sanitizeFooterHtml as Vt } from "./conversation/footer-message.js";
51
- import { getModelIdFromConversationId as Ht } from "./conversation/get-model-id-from-conversation-id.js";
52
- import { getTimeOfDayGreeting as Ut } from "./conversation/greeting.js";
53
- import { createDeploymentChangedMessage as Wt } from "./conversation/message-factory.js";
54
- import { getLastDeploymentId as Gt, getLastUserMessageToolConfiguration as Kt, isMessageStreaming as qt, messageHasStages as Jt, normalizeResponseFormat as Yt } from "./conversation/message-utils.js";
55
- import { toOverlayMessages as Xt } from "./conversation/overlay-messages.js";
56
- import { getQuickAppConversationStarters as Zt } from "./conversation/quick-app-conversation-starters.js";
57
- import { getStarterPopulateText as Qt, getStartersFromSchema as $t } from "./conversation/starter-option.js";
58
- import { useOAuthCallbackCompletion as en } from "./oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js";
59
- import { buildPromptExportEnvelope as tn, buildPromptExportFileName as nn, serializePromptExport as rn } from "./prompt/export-prompt.js";
60
- import { PROMPT_CONTENT_MAX_LENGTH as an, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as on, PROMPT_DESCRIPTION_MAX_LENGTH as sn, PROMPT_NAME_MAX_LENGTH as cn, PromptFieldError as ln, buildPromptPath as un, getRemainingCharacters as dn, validatePromptContent as fn, validatePromptDescription as pn, validatePromptName as mn } from "./prompt/prompt.js";
61
- import { usePromptsState as hn } from "./prompt/usePromptsState/usePromptsState.js";
62
- import { UnsupportedTriggerReason as gn } from "./scheduled-task/scheduled-task-mapping.js";
63
- import { apSchedulerDayToJsDay as _n, jsDayToApSchedulerDay as vn } from "./shared/cron-weekday.js";
64
- import { mapFormValuesToCreateBody as yn, mapFormValuesToUpdateBody as bn, mapScheduledTaskDtoToFormValues as xn } from "./scheduled-task/scheduled-task-trigger.js";
65
- import { validateSkillFileBatch as Sn } from "./skill/skill-file-batch-validation.js";
66
- import { skillFileToAttachment as Cn } from "./skill/skill-file-preview.js";
67
- import { SkillEditorLoadState as wn, useSkillEditorLoad as Tn } from "./skill/useSkillEditorLoad.js";
68
- import { useSkillEditorSubmit as En } from "./skill/useSkillEditorSubmit.js";
69
- import { useSkillFileActions as Dn } from "./skill/useSkillFileActions.js";
70
- import { SkillPreviewErrorKind as On, useSkillFilePreview as kn } from "./skill/useSkillFilePreview.js";
71
- import { useSkillsState as An } from "./skill/useSkillsState/useSkillsState.js";
72
- import { RecipientsCountStatus as jn, useShareRecipientsCount as Mn } from "./useShareRecipientsCount/useShareRecipientsCount.js";
73
- import { deriveConversationRowActionState as Nn } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
74
- import { useActiveConversationSync as Pn } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
75
- import { useAsyncConfirmDialog as Fn } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
76
- import { useConversationLookupMaps as In } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
77
- import { getConversationSource as Ln, useConversationPanelItems as Rn } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
78
- import { useImportFilePicker as zn } from "./conversation/useImportFilePicker/useImportFilePicker.js";
79
- import { sanitizeFileName as Bn, splitFileNameExtension as Vn, trimFileNameToByteLimit as Hn } from "./files/file-name.js";
80
- import { useAttachmentUpload as Un } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
81
- import { AudioTranscriptionError as Wn, AudioTranscriptionErrorReason as Gn } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
82
- import { useTranscribeAudio as Kn } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
83
- import { DEFAULT_MAX_ARCHIVE_BYTES as qn, useConversationExport as Jn } from "./conversation/useConversationExport/useConversationExport.js";
84
- import { attachmentToDto as Yn, attachmentsToDtos as Xn } from "./conversation/useConversationHandlers/attachment-to-dto.js";
85
- import { createMessagePair as Zn } from "./conversation/useConversationHandlers/message-factory.js";
86
- import { hasActiveToolConfig as Qn, isAnswerIncomplete as $n, isMessageChanged as er, shouldRerunGenerationOnEdit as tr } from "./conversation/useConversationHandlers/message-utils.js";
87
- import { getStarterConversationText as nr, getStarterDisplayText as rr, getStarterSubmitText as ir } from "./conversation/useConversationHandlers/starter-option.js";
88
- import { getConversationPath as ar } from "./conversation/useConversationStream/conversation-path.js";
89
- import { useConversationHandlers as or } from "./conversation/useConversationHandlers/useConversationHandlers.js";
90
- import { useConversationImport as sr } from "./conversation/useConversationImport/useConversationImport.js";
91
- import { useConversationScroll as cr } from "./conversation/useConversationScroll/useConversationScroll.js";
92
- import { isAwaitingGenerationResume as lr } from "./conversation/useConversationStream/generation-resume.js";
93
- import { useConversationStream as ur } from "./conversation/useConversationStream/useConversationStream.js";
94
- import { useConversationSources as dr } from "./conversation-sources/useConversationSources/useConversationSources.js";
95
- import { DialFilesApiUploadMode as fr } from "./files/dial-files-api.js";
96
- import { FileManagerNotificationReason as pr, FileNameValidationErrorReason as mr, FileOperationKind as hr } from "./files/dial-file-manager.types.js";
97
- import { COLUMNS_WITHOUT_AUTHOR as gr, COLUMNS_WITH_AUTHOR as _r, CORE_PERMISSION_MAP as vr, DATE_OPTIONS as yr, PATH_SEPARATOR_REGEXP as br, RESERVED_MARKER_NAME as xr, UPLOAD_CONCURRENCY as Sr } from "./files/dial-file-manager.model.js";
98
- import { DialFileManagerActionProfile as Cr, DialFileManagerVariant as wr, deriveActionProfile as Tr } from "./files/file-manager-variant.js";
99
- import { buildSharedItemVirtualPath as Er, dialCorePathToRelative as Dr, findDialFileByPath as Or, findFolderByVirtualPath as kr, formatOperationFolderName as Ar, getVirtualPathName as jr, hasDialFileWritePermission as Mr, hasForbiddenNameSymbols as Nr, isCopyMoveDuplicateAllowed as Pr, isShareActionsAllowed as Fr, normalizeVirtualPath as Ir, parseNewFolderVirtualPath as Lr, resolveOwnerCoords as Rr } from "./files/dial-file-manager-path.util.js";
100
- import { getParentFolderPath as zr, resolveDialFileApiPath as Br, virtualPathToApiPath as Vr } from "./files/resolve-dial-file-api-path.js";
101
- import { prepareCopyItems as Hr, prepareMoveRenameItems as Ur } from "./files/dial-file-manager-copy-move.util.js";
102
- import { buildFromCache as Wr, fetchByTab as Gr, fetchForSearch as Kr, findFirstSuccessfulCopyMoveItem as qr, mapCorePermissions as Jr, mapFileMetadataToDialFile as Yr, mapSearchItem as Xr, mergeCreatedFolderIntoCache as Zr, updateEntry as Qr } from "./files/dial-file-manager-mapping.util.js";
103
- import { createFilesApiClient as $r } from "./files/create-files-api.js";
104
- import { createUploadFileWithProgress as ei } from "./files/create-upload-file-with-progress.js";
105
- import { openAnnotationAttachment as ti } from "./files/annotation.js";
106
- import { annotationToOoxmlCanvasContent as ni, annotationToPdfCanvasContent as ri, clearAttachmentCache as ii, hasAttachmentTextSource as ai, referenceAttachmentToPdfCanvasContent as oi, resolveCodeCanvasContent as si, resolveHtmlCanvasContent as ci, resolveImageCanvasContent as li, resolveJsonCanvasContent as ui, resolveMarkdownCanvasContent as di, resolveOoxmlCanvasContent as fi, resolvePdfCanvasContent as pi, resolveTextCanvasContent as mi, resolveVisualizerCanvasContent as hi } from "./files/attachment-canvas.js";
107
- import { getUrlFileName as gi, isExternalSourcePreviewable as _i, resolveExternalSourceContentType as vi } from "./files/source-content.js";
108
- import { annotationToDisplayAttachment as yi, attachmentDtoToDisplayAttachment as bi, attachmentDtosToDisplayAttachments as xi } from "./files/attachment-dto-to-display.js";
109
- import { dialFileToAttachment as Si, dialFilesToAttachments as Ci, dialFolderPathToAttachment as wi } from "./files/dial-file-to-attachment.js";
110
- import { DownloadDestinationType as Ti } from "./files/download-destination.js";
111
- import { prepareDownloadDestination as Ei } from "./files/prepare-download-destination.js";
112
- import { useDialFileListing as Di } from "./files/useDialFileListing/useDialFileListing.js";
113
- import { useDialFileMetadata as Oi } from "./files/useDialFileMetadata/useDialFileMetadata.js";
114
- import { useDialFileMutations as ki } from "./files/useDialFileMutations/useDialFileMutations.js";
115
- import { useDialFileSharing as Ai } from "./files/useDialFileSharing/useDialFileSharing.js";
116
- import { useDialFileUploadBatch as ji } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
117
- import { useDialFileManager as Mi } from "./files/useDialFileManager/useDialFileManager.js";
118
- import { useDialFileManagerTabConfig as Ni } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
119
- import { isCustomAppSchema as Pi, isQuickAppSchema as Fi } from "./shared/application-schema.js";
120
- import { getBrowserTimezone as Ii } from "./shared/browser-timezone.js";
121
- import { isValidAbsoluteUrl as Li, isValidFeaturesData as Ri, parseFeaturesData as zi } from "./shared/custom-apps.js";
122
- import { buildExternalServiceScopeId as Bi, getExternalServiceFallbackName as Vi, parseExternalServiceUrl as Hi } from "./shared/external-services.js";
123
- import { useChatSettingsFormConfig as Ui } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
124
- import { usePageFileDrag as Wi } from "./usePageFileDrag/usePageFileDrag.js";
125
- import { useViewportWidth as Gi } from "./useViewportWidth/useViewportWidth.js";
126
- import { usePanelMaxWidth as Ki } from "./usePanelMaxWidth/usePanelMaxWidth.js";
127
- import { useShareLink as qi } from "./useShareLink/useShareLink.js";
128
- import { useToolsMenu as Ji } from "./useToolsMenu/useToolsMenu.js";
129
- import { useUsageData as Yi } from "./usage/useUsageData/useUsageData.js";
130
- import { McpAppResourceFetchError as Xi, createMcpAppsApiClient as Zi } from "./mcp-apps/mcp-apps-api-client.js";
131
- import { useMcpAppTools as Qi } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
132
- import { useMcpAppHostContext as $i } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
133
- import { useMcpAppHostAdapter as ea } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
134
- import { useOpenMcpAppCanvas as ta } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
135
- import { useGridEditingScroll as na } from "@epam/ai-dial-chat-shared";
136
- export { b as AttachmentValidationErrorReason, Wn as AudioTranscriptionError, Gn as AudioTranscriptionErrorReason, L as AuthenticationType, gr as COLUMNS_WITHOUT_AUTHOR, _r as COLUMNS_WITH_AUTHOR, vr as CORE_PERMISSION_MAP, Ze as CatalogPrimaryActionType, w as ConversationExportMode, T as ConversationTransferErrorCode, E as ConversationTransferWarningCode, yr as DATE_OPTIONS, It as DEFAULT_GENERATION_CONFLICT_MESSAGE, qn as DEFAULT_MAX_ARCHIVE_BYTES, Cr as DialFileManagerActionProfile, wr as DialFileManagerVariant, fr as DialFilesApiUploadMode, Ti as DownloadDestinationType, O as EXPORT_APP_NAME, D as ExportFileNameKind, Ot as FavoriteEntityType, pr as FileManagerNotificationReason, mr as FileNameValidationErrorReason, hr as FileOperationKind, Lt as GenerationConflictError, Xi as McpAppResourceFetchError, Ie as McpResourceKind, it as OAuthResourceKind, br as PATH_SEPARATOR_REGEXP, an as PROMPT_CONTENT_MAX_LENGTH, on as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, sn as PROMPT_DESCRIPTION_MAX_LENGTH, cn as PROMPT_NAME_MAX_LENGTH, Ce as PUBLIC_SKILL_BUCKET, ln as PromptFieldError, ie as PromptSource, xr as RESERVED_MARKER_NAME, jn as RecipientsCountStatus, le as SKILL_FILE_UPLOAD_MAX_BYTES, we as SKILL_LISTING_MAX_PAGES, Te as SKILL_LISTING_PAGE_SIZE, ue as SKILL_MANIFEST_FILE, Ee as SKILL_MANIFEST_MAX_BYTES, de as SKILL_UPLOAD_MAX_FILES, fe as SKILL_UPLOAD_MAX_TOTAL_BYTES, wn as SkillEditorLoadState, On as SkillPreviewErrorKind, De as SkillSource, at as TOOLSET_REDIRECT_STATE_KEY, ot as ToolsetAuthStatus, st as ToolsetAuthTypes, ct as ToolsetCredentialsLevel, wt as ToolsetLoginOutcomeType, lt as ToolsetOAuthCallbackQuery, ut as ToolsetOAuthChannelControlType, dt as ToolsetOAuthFailureReason, ft as ToolsetOAuthInitiationResultType, pt as ToolsetOAuthResultType, Sr as UPLOAD_CONCURRENCY, gn as UnsupportedTriggerReason, mt as WithLogin, yi as annotationToDisplayAttachment, ni as annotationToOoxmlCanvasContent, ri as annotationToPdfCanvasContent, _n as apSchedulerDayToJsDay, U as appendLocaleCode, bi as attachmentDtoToDisplayAttachment, xi as attachmentDtosToDisplayAttachments, Yn as attachmentToDto, Xn as attachmentsToDtos, W as buildAdditionalLocaleOptions, jt as buildAnnouncementSignature, Le as buildApplicationMcpUrl, M as buildChatCompletionsUrl, Re as buildConnectApi, N as buildDeploymentConnectApi, Bi as buildExternalServiceScopeId, Wr as buildFromCache, tn as buildPromptExportEnvelope, nn as buildPromptExportFileName, oe as buildPromptOverview, un as buildPromptPath, P as buildResponsesUrl, Er as buildSharedItemVirtualPath, ke as buildSkillContentTree, pe as buildSkillFilesPayload, me as buildSkillManifest, he as buildSkillManifestForSubmit, ge as buildSkillManifestFromFrontmatter, Ae as buildSkillOverview, yt as buildToolsetAuthorizeUrl, ze as buildToolsetMcpUrl, ii as clearAttachmentCache, G as composeLocalePayload, Rt as createChatStreamApi, i as createCsrfMiddleware, Wt as createDeploymentChangedMessage, $r as createFilesApiClient, Zi as createMcpAppsApiClient, Zn as createMessagePair, A as createPublishApiClient, a as createUnauthorizedMiddleware, ei as createUploadFileWithProgress, B as decodeToolsetId, K as decomposeLocalizedFields, Tr as deriveActionProfile, Ke as deriveAvailableTabIds, Nn as deriveConversationRowActionState, qe as deriveFavoriteItems, Dr as dialCorePathToRelative, Si as dialFileToAttachment, Ci as dialFilesToAttachments, wi as dialFolderPathToAttachment, p as downloadAttachment, ht as emitToolsetLoginSuccess, F as encodeDeploymentId, V as encodeToolsetId, Gr as fetchByTab, Kr as fetchForSearch, tt as fetchSkillDescription, Je as filterCatalogItemsBySelector, Ye as filterHiddenOwnedItems, I as findDeploymentByIdOrReference, Or as findDialFileByPath, qr as findFirstSuccessfulCopyMoveItem, kr as findFolderByVirtualPath, Bt as formatAppVersion, Y as formatCalendarDate, S as formatDateYM, C as formatDateYMD, Ar as formatOperationFolderName, k as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Ii as getBrowserTimezone, ar as getConversationPath, Ln as getConversationSource, Vi as getExternalServiceFallbackName, Gt as getLastDeploymentId, Kt as getLastUserMessageToolConfiguration, Ht as getModelIdFromConversationId, zr as getParentFolderPath, Ve as getPublicCatalogEntityFolderPath, Zt as getQuickAppConversationStarters, dn as getRemainingCharacters, nr as getStarterConversationText, rr as getStarterDisplayText, Qt as getStarterPopulateText, ir as getStarterSubmitText, $t as getStartersFromSchema, Ut as getTimeOfDayGreeting, _t as getToolsetOAuthChannelName, bt as getToolsetRedirectUri, gi as getUrlFileName, jr as getVirtualPathName, Qn as hasActiveToolConfig, Mt as hasAnnouncementContent, ai as hasAttachmentTextSource, Mr as hasDialFileWritePermission, Nr as hasForbiddenNameSymbols, Nt as hasStructuredAnnouncement, o as includesIgnoreCase, xt as initiateOAuthLogin, $n as isAnswerIncomplete, lr as isAwaitingGenerationResume, r as isConversationNotFoundError, Pr as isCopyMoveDuplicateAllowed, Pi as isCustomAppSchema, g as isDialFileAcceptType, u as isDialFileId, m as isDownloadableAttachment, _i as isExternalSourcePreviewable, er as isMessageChanged, qt as isMessageStreaming, se as isOrganisationPromptItem, He as isPublicCatalogEntityId, H as isPublicToolsetId, Fi as isQuickAppSchema, Fr as isShareActionsAllowed, Li as isValidAbsoluteUrl, Ri as isValidFeaturesData, _e as isValidSkillRelativePath, vn as jsDayToApSchedulerDay, Jr as mapCorePermissions, Z as mapDeploymentDetailsDtoToEntityDetails, R as mapDeploymentLimitsDtoToCatalogLimits, z as mapDeploymentLimitsToInput, ee as mapDeploymentToCatalogItem, te as mapDeploymentToolsetCredentials, Q as mapEntityDetailsToCatalogDetails, Yr as mapFileMetadataToDialFile, yn as mapFormValuesToCreateBody, bn as mapFormValuesToUpdateBody, ce as mapPromptToCatalogItem, Ue as mapPublishConversationResultDto, We as mapPublishHistoryEntryDto, xn as mapScheduledTaskDtoToFormValues, Xr as mapSearchItem, je as mapSkillToCatalogItem, $ as mapToolsetCredentials, ne as mapToolsetToCatalogItem, Zr as mergeCreatedFolderIntoCache, Jt as messageHasStages, _ as mimeTypesToAttachmentExtensionLabels, v as mimeTypesToDialFileAcceptTypes, y as mimeTypesToFileAccept, ve as nameFromPath, St as navigateToolsetOAuthPopup, Yt as normalizeResponseFormat, ye as normalizeSkillName, Ir as normalizeVirtualPath, ti as openAnnotationAttachment, Ct as openToolsetOAuthPopup, X as padTwoDigits, Hi as parseExternalServiceUrl, zi as parseFeaturesData, Lr as parseNewFolderVirtualPath, ae as parsePromptResourceUrl, be as parseSkillManifest, et as parseSkillManifestDocument, Oe as parseSkillResourceUrl, Hr as prepareCopyItems, Ei as prepareDownloadDestination, Ur as prepareMoveRenameItems, Me as readSkillFileBytes, Ne as readSkillManifest, Xe as reconcileFilterTopics, oi as referenceAttachmentToPdfCanvasContent, Qe as resolveCatalogPrimaryAction, si as resolveCodeCanvasContent, re as resolveDeploymentFolder, Br as resolveDialFileApiPath, d as resolveDialFileBucketAndPath, vi as resolveExternalSourceContentType, ci as resolveHtmlCanvasContent, li as resolveImageCanvasContent, ui as resolveJsonCanvasContent, q as resolveLocalizedText, di as resolveMarkdownCanvasContent, Be as resolveMcpResourceKind, fi as resolveOoxmlCanvasContent, Rr as resolveOwnerCoords, pi as resolvePdfCanvasContent, f as resolveRelativeDialFilePath, Pe as resolveSkillFileDownloadPath, Fe as resolveSkillManifestFileId, mi as resolveTextCanvasContent, hi as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Pt as sanitizeAnnouncementHtml, Ft as sanitizeAnnouncementMessageHtml, Bn as sanitizeFileName, Vt as sanitizeFooterHtml, rn as serializePromptExport, tr as shouldRerunGenerationOnEdit, zt as shouldWatchForDisplayNameUpdate, xe as skillFileBytesToBlob, Cn as skillFileToAttachment, Vn as splitFileNameExtension, l as stripSurroundingSlashes, gt as subscribeToolsetLoginSuccess, J as toBaseLocale, Xt as toOverlayMessages, Ge as toPublishEntityType, j as toPublishRuleDto, Hn as trimFileNameToByteLimit, Se as unpackSkillArchive, Qr as updateEntry, Pn as useActiveConversationSync, Fn as useAsyncConfirmDialog, h as useAttachmentAction, Un as useAttachmentUpload, x as useAttachmentValidation, $e as useCatalogEditNavigation, rt as useCatalogItemDetails, Et as useCatalogToolsetCredentials, Ui as useChatSettingsFormConfig, Jn as useConversationExport, or as useConversationHandlers, sr as useConversationImport, In as useConversationLookupMaps, Rn as useConversationPanelItems, cr as useConversationScroll, dr as useConversationSources, ur as useConversationStream, Di as useDialFileListing, Mi as useDialFileManager, Ni as useDialFileManagerTabConfig, Oi as useDialFileMetadata, ki as useDialFileMutations, Ai as useDialFileSharing, ji as useDialFileUploadBatch, kt as useFavoriteEntitiesState, na as useGridEditingScroll, zn as useImportFilePicker, ea as useMcpAppHostAdapter, $i as useMcpAppHostContext, Qi as useMcpAppTools, en as useOAuthCallbackCompletion, ta as useOpenMcpAppCanvas, Wi as usePageFileDrag, Ki as usePanelMaxWidth, hn as usePromptsState, At as usePublishFolders, qi as useShareLink, Mn as useShareRecipientsCount, Dt as useSkillDetailsPanelData, Tn as useSkillEditorLoad, En as useSkillEditorSubmit, Dn as useSkillFileActions, kn as useSkillFilePreview, nt as useSkillItemDetails, An as useSkillsState, Ji as useToolsMenu, Tt as useToolsetLogin, Kn as useTranscribeAudio, Yi as useUsageData, Gi as useViewportWidth, fn as validatePromptContent, pn as validatePromptDescription, mn as validatePromptName, Sn as validateSkillFileBatch, Vr as virtualPathToApiPath, vt as waitForToolsetOAuthResult };
4
+ import { includesIgnoreCase as o, safeDecodeURI as s, safeDecodeURIComponent as c, stripSurroundingSlashes as l, stripTrailingSlashes as u } from "./shared/string-utils.js";
5
+ import { isDialFileId as d, resolveDialFileBucketAndPath as f, resolveRelativeDialFilePath as p } from "./files/dial-file.js";
6
+ import { downloadAttachment as m, isDownloadableAttachment as h, useAttachmentAction as g } from "./attachment/useAttachmentAction/useAttachmentAction.js";
7
+ import { isDialFileAcceptType as _, mimeTypesToAttachmentExtensionLabels as v, mimeTypesToDialFileAcceptTypes as y, mimeTypesToFileAccept as b } from "./files/attachment-types.js";
8
+ import { AttachmentValidationErrorReason as x, useAttachmentValidation as S } from "./attachment/useAttachmentValidation/useAttachmentValidation.js";
9
+ import { formatDateYM as C, formatDateYMD as w } from "./conversation/conversation-transfer/date.js";
10
+ import { ConversationExportMode as T, ConversationTransferErrorCode as E, ConversationTransferWarningCode as D, ExportFileNameKind as O } from "./conversation/conversation-transfer/types.js";
11
+ import { EXPORT_APP_NAME as k } from "./conversation/conversation-transfer/export-conversation.js";
12
+ import { formatQuotedNameList as A } from "./conversation/conversation-transfer/import-conversation.js";
13
+ import { createPublishApiClient as j, toPublishRuleDto as M } from "./catalog/create-publish-api.js";
14
+ import { buildChatCompletionsUrl as N, buildDeploymentConnectApi as P, buildResponsesUrl as F } from "./catalog/deployment-endpoint-url.js";
15
+ import { encodeDeploymentId as I, findDeploymentByIdOrReference as L } from "./catalog/deployment-id.js";
16
+ import { AuthenticationType as R } from "./catalog/entity-details.js";
17
+ import { mapDeploymentLimitsDtoToCatalogLimits as z } from "./catalog/map-deployment-limits-to-catalog.js";
18
+ import { mapDeploymentLimitsToInput as B } from "./catalog/map-deployment-limits-to-input.js";
19
+ import { decodeToolsetId as V, encodeToolsetId as H, isPublicToolsetId as U } from "./oauth/toolset-id.js";
20
+ import { appendLocaleCode as W, buildAdditionalLocaleOptions as G, composeLocalePayload as K, decomposeLocalizedFields as q, resolveLocalizedText as J, toBaseLocale as Y } from "./shared/locale.js";
21
+ import { formatCalendarDate as X, padTwoDigits as Z } from "./shared/formatting.js";
22
+ import { mapDeploymentDetailsDtoToEntityDetails as Q, mapEntityDetailsToCatalogDetails as $, mapToolsetCredentials as ee } from "./catalog/map-entity-details-to-catalog.js";
23
+ import { mapDeploymentToCatalogItem as te, mapDeploymentToolsetCredentials as ne, mapToolsetToCatalogItem as re, resolveDeploymentFolder as ie } from "./catalog/map-deployment-to-catalog-item.js";
24
+ import { PromptSource as ae, parsePromptResourceUrl as oe } from "./prompt/prompt-resource.js";
25
+ import { buildPromptOverview as se, isOrganisationPromptItem as ce, mapPromptToCatalogItem as le } from "./catalog/map-prompt-to-catalog-item.js";
26
+ import { SKILL_FILE_UPLOAD_MAX_BYTES as ue, SKILL_MANIFEST_FILE as de, SKILL_UPLOAD_MAX_FILES as fe, SKILL_UPLOAD_MAX_TOTAL_BYTES as pe, buildSkillFilesPayload as me, buildSkillManifest as he, buildSkillManifestForSubmit as ge, buildSkillManifestFromFrontmatter as _e, isValidSkillRelativePath as ve, nameFromPath as ye, normalizeSkillName as be, parseSkillManifest as xe, skillFileBytesToBlob as Se, unpackSkillArchive as Ce } from "./skill/skill.js";
27
+ import { PUBLIC_SKILL_BUCKET as we, SKILL_LISTING_MAX_PAGES as Te, SKILL_LISTING_PAGE_SIZE as Ee, SKILL_MANIFEST_MAX_BYTES as De, SkillSource as Oe, parseSkillResourceUrl as ke } from "./skill/skill-types.js";
28
+ import { buildSkillContentTree as Ae, buildSkillOverview as je, mapSkillToCatalogItem as Me, readSkillFileBytes as Ne, readSkillManifest as Pe, resolveSkillFileDownloadPath as Fe, resolveSkillManifestFileId as Ie } from "./catalog/map-skill-to-catalog-item.js";
29
+ import { McpResourceKind as Le, buildApplicationMcpUrl as Re, buildConnectApi as ze, buildToolsetMcpUrl as Be, resolveMcpResourceKind as Ve } from "./catalog/mcp-endpoint-url.js";
30
+ import { getPublicCatalogEntityFolderPath as He, isPublicCatalogEntityId as Ue, mapPublishConversationResultDto as We, mapPublishHistoryEntryDto as Ge, toPublishEntityType as Ke } from "./catalog/publish.js";
31
+ import { deriveAvailableTabIds as qe, deriveFavoriteItems as Je, filterCatalogItemsBySelector as Ye, filterHiddenOwnedItems as Xe, reconcileFilterTopics as Ze } from "./catalog/catalog-derivations.js";
32
+ import { CatalogPrimaryActionType as Qe, resolveCatalogPrimaryAction as $e } from "./catalog/catalog-primary-action.js";
33
+ import { useCatalogEditNavigation as et } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
34
+ import { parseSkillManifestDocument as tt } from "./skill/skill-manifest.js";
35
+ import { fetchSkillDescription as nt, useSkillItemDetails as rt } from "./catalog/useSkillItemDetails.js";
36
+ import { useCatalogItemDetails as it } from "./catalog/useCatalogItemDetails.js";
37
+ import { OAuthResourceKind as at, TOOLSET_REDIRECT_STATE_KEY as ot, ToolsetAuthStatus as st, ToolsetAuthTypes as ct, ToolsetCredentialsLevel as lt, ToolsetOAuthCallbackQuery as ut, ToolsetOAuthChannelControlType as dt, ToolsetOAuthFailureReason as ft, ToolsetOAuthInitiationResultType as pt, ToolsetOAuthResultType as mt, WithLogin as ht } from "./oauth/types.js";
38
+ import { emitToolsetLoginSuccess as gt, subscribeToolsetLoginSuccess as _t } from "./shared/toolset-login-events.js";
39
+ import { getToolsetOAuthChannelName as vt, waitForToolsetOAuthResult as yt } from "./oauth/handshake.js";
40
+ import { buildToolsetAuthorizeUrl as bt, getToolsetRedirectUri as xt } from "./oauth/authorize-url.js";
41
+ import { initiateOAuthLogin as St, navigateToolsetOAuthPopup as Ct, openToolsetOAuthPopup as wt } from "./oauth/popup.js";
42
+ import { ToolsetLoginOutcomeType as Tt, useToolsetLogin as Et } from "./oauth/useToolsetLogin/useToolsetLogin.js";
43
+ import { useCatalogToolsetCredentials as Dt } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
44
+ import { useSkillDetailsPanelData as Ot } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
45
+ import { FavoriteEntityType as kt, useFavoriteEntitiesState as At } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
46
+ import { usePublishFolders as jt } from "./catalog/usePublishFolders/usePublishFolders.js";
47
+ import { buildAnnouncementSignature as Mt, hasAnnouncementContent as Nt, hasStructuredAnnouncement as Pt, sanitizeAnnouncementHtml as Ft, sanitizeAnnouncementMessageHtml as It } from "./conversation/announcement-message.js";
48
+ import { DEFAULT_GENERATION_CONFLICT_MESSAGE as Lt, GenerationConflictError as Rt, createChatStreamApi as zt } from "./conversation/create-chat-stream-api.js";
49
+ import { shouldWatchForDisplayNameUpdate as Bt } from "./conversation/display-name-watch.js";
50
+ import { formatAppVersion as Vt, sanitizeFooterHtml as Ht } from "./conversation/footer-message.js";
51
+ import { getModelIdFromConversationId as Ut } from "./conversation/get-model-id-from-conversation-id.js";
52
+ import { getTimeOfDayGreeting as Wt } from "./conversation/greeting.js";
53
+ import { createDeploymentChangedMessage as Gt } from "./conversation/message-factory.js";
54
+ import { getLastDeploymentId as Kt, getLastUserMessageToolConfiguration as qt, isMessageStreaming as Jt, messageHasStages as Yt, normalizeResponseFormat as Xt } from "./conversation/message-utils.js";
55
+ import { toOverlayMessages as Zt } from "./conversation/overlay-messages.js";
56
+ import { getQuickAppConversationStarters as Qt } from "./conversation/quick-app-conversation-starters.js";
57
+ import { getStarterPopulateText as $t, getStartersFromSchema as en } from "./conversation/starter-option.js";
58
+ import { useOAuthCallbackCompletion as tn } from "./oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js";
59
+ import { buildPromptExportEnvelope as nn, buildPromptExportFileName as rn, serializePromptExport as an } from "./prompt/export-prompt.js";
60
+ import { PROMPT_CONTENT_MAX_LENGTH as on, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as sn, PROMPT_DESCRIPTION_MAX_LENGTH as cn, PROMPT_NAME_MAX_LENGTH as ln, PromptFieldError as un, buildPromptPath as dn, getRemainingCharacters as fn, validatePromptContent as pn, validatePromptDescription as mn, validatePromptName as hn } from "./prompt/prompt.js";
61
+ import { usePromptsState as gn } from "./prompt/usePromptsState/usePromptsState.js";
62
+ import { UnsupportedTriggerReason as _n } from "./scheduled-task/scheduled-task-mapping.js";
63
+ import { apSchedulerDayToJsDay as vn, jsDayToApSchedulerDay as yn } from "./shared/cron-weekday.js";
64
+ import { mapFormValuesToCreateBody as bn, mapFormValuesToUpdateBody as xn, mapScheduledTaskDtoToFormValues as Sn } from "./scheduled-task/scheduled-task-trigger.js";
65
+ import { validateSkillFileBatch as Cn } from "./skill/skill-file-batch-validation.js";
66
+ import { skillFileToAttachment as wn } from "./skill/skill-file-preview.js";
67
+ import { SkillEditorLoadState as Tn, useSkillEditorLoad as En } from "./skill/useSkillEditorLoad.js";
68
+ import { useSkillEditorSubmit as Dn } from "./skill/useSkillEditorSubmit.js";
69
+ import { useSkillFileActions as On } from "./skill/useSkillFileActions.js";
70
+ import { SkillPreviewErrorKind as kn, useSkillFilePreview as An } from "./skill/useSkillFilePreview.js";
71
+ import { useSkillsState as jn } from "./skill/useSkillsState/useSkillsState.js";
72
+ import { RecipientsCountStatus as Mn, useShareRecipientsCount as Nn } from "./useShareRecipientsCount/useShareRecipientsCount.js";
73
+ import { deriveConversationRowActionState as Pn } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
74
+ import { useActiveConversationSync as Fn } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
75
+ import { useAsyncConfirmDialog as In } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
76
+ import { useConversationLookupMaps as Ln } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
77
+ import { getConversationSource as Rn, useConversationPanelItems as zn } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
78
+ import { useImportFilePicker as Bn } from "./conversation/useImportFilePicker/useImportFilePicker.js";
79
+ import { sanitizeFileName as Vn, splitFileNameExtension as Hn, trimFileNameToByteLimit as Un } from "./files/file-name.js";
80
+ import { useAttachmentUpload as Wn } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
81
+ import { AudioTranscriptionError as Gn, AudioTranscriptionErrorReason as Kn } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
82
+ import { useTranscribeAudio as qn } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
83
+ import { DEFAULT_MAX_ARCHIVE_BYTES as Jn, useConversationExport as Yn } from "./conversation/useConversationExport/useConversationExport.js";
84
+ import { attachmentToDto as Xn, attachmentsToDtos as Zn } from "./conversation/useConversationHandlers/attachment-to-dto.js";
85
+ import { createMessagePair as Qn } from "./conversation/useConversationHandlers/message-factory.js";
86
+ import { hasActiveToolConfig as $n, isAnswerIncomplete as er, isMessageChanged as tr, shouldRerunGenerationOnEdit as nr } from "./conversation/useConversationHandlers/message-utils.js";
87
+ import { getStarterConversationText as rr, getStarterDisplayText as ir, getStarterSubmitText as ar } from "./conversation/useConversationHandlers/starter-option.js";
88
+ import { getConversationPath as or } from "./conversation/useConversationStream/conversation-path.js";
89
+ import { useConversationHandlers as sr } from "./conversation/useConversationHandlers/useConversationHandlers.js";
90
+ import { useConversationImport as cr } from "./conversation/useConversationImport/useConversationImport.js";
91
+ import { useConversationScroll as lr } from "./conversation/useConversationScroll/useConversationScroll.js";
92
+ import { isAwaitingGenerationResume as ur } from "./conversation/useConversationStream/generation-resume.js";
93
+ import { useConversationStream as dr } from "./conversation/useConversationStream/useConversationStream.js";
94
+ import { useConversationSources as fr } from "./conversation-sources/useConversationSources/useConversationSources.js";
95
+ import { DialFilesApiUploadMode as pr } from "./files/dial-files-api.js";
96
+ import { FileManagerNotificationReason as mr, FileNameValidationErrorReason as hr, FileOperationKind as gr } from "./files/dial-file-manager.types.js";
97
+ import { COLUMNS_WITHOUT_AUTHOR as _r, COLUMNS_WITH_AUTHOR as vr, CORE_PERMISSION_MAP as yr, DATE_OPTIONS as br, PATH_SEPARATOR_REGEXP as xr, RESERVED_MARKER_NAME as Sr, UPLOAD_CONCURRENCY as Cr } from "./files/dial-file-manager.model.js";
98
+ import { DialFileManagerActionProfile as wr, DialFileManagerVariant as Tr, deriveActionProfile as Er } from "./files/file-manager-variant.js";
99
+ import { buildSharedItemVirtualPath as Dr, dialCorePathToRelative as Or, findDialFileByPath as kr, findFolderByVirtualPath as Ar, formatOperationFolderName as jr, getVirtualPathName as Mr, hasDialFileWritePermission as Nr, hasForbiddenNameSymbols as Pr, isCopyMoveDuplicateAllowed as Fr, isShareActionsAllowed as Ir, normalizeVirtualPath as Lr, parseNewFolderVirtualPath as Rr, resolveOwnerCoords as zr } from "./files/dial-file-manager-path.util.js";
100
+ import { getParentFolderPath as Br, resolveDialFileApiPath as Vr, virtualPathToApiPath as Hr } from "./files/resolve-dial-file-api-path.js";
101
+ import { prepareCopyItems as Ur, prepareMoveRenameItems as Wr } from "./files/dial-file-manager-copy-move.util.js";
102
+ import { buildFromCache as Gr, fetchByTab as Kr, fetchForSearch as qr, findFirstSuccessfulCopyMoveItem as Jr, mapCorePermissions as Yr, mapFileMetadataToDialFile as Xr, mapSearchItem as Zr, mergeCreatedFolderIntoCache as Qr, updateEntry as $r } from "./files/dial-file-manager-mapping.util.js";
103
+ import { createFilesApiClient as ei } from "./files/create-files-api.js";
104
+ import { createUploadFileWithProgress as ti } from "./files/create-upload-file-with-progress.js";
105
+ import { openAnnotationAttachment as ni } from "./files/annotation.js";
106
+ import { annotationToOoxmlCanvasContent as ri, annotationToPdfCanvasContent as ii, clearAttachmentCache as ai, hasAttachmentTextSource as oi, referenceAttachmentToPdfCanvasContent as si, resolveCodeCanvasContent as ci, resolveHtmlCanvasContent as li, resolveImageCanvasContent as ui, resolveJsonCanvasContent as di, resolveMarkdownCanvasContent as fi, resolveOoxmlCanvasContent as pi, resolvePdfCanvasContent as mi, resolveTextCanvasContent as hi, resolveVisualizerCanvasContent as gi } from "./files/attachment-canvas.js";
107
+ import { getUrlFileName as _i, isExternalSourcePreviewable as vi, resolveExternalSourceContentType as yi } from "./files/source-content.js";
108
+ import { annotationToDisplayAttachment as bi, attachmentDtoToDisplayAttachment as xi, attachmentDtosToDisplayAttachments as Si } from "./files/attachment-dto-to-display.js";
109
+ import { dialFileToAttachment as Ci, dialFilesToAttachments as wi, dialFolderPathToAttachment as Ti } from "./files/dial-file-to-attachment.js";
110
+ import { DownloadDestinationType as Ei } from "./files/download-destination.js";
111
+ import { prepareDownloadDestination as Di } from "./files/prepare-download-destination.js";
112
+ import { useDialFileListing as Oi } from "./files/useDialFileListing/useDialFileListing.js";
113
+ import { useDialFileMetadata as ki } from "./files/useDialFileMetadata/useDialFileMetadata.js";
114
+ import { useDialFileMutations as Ai } from "./files/useDialFileMutations/useDialFileMutations.js";
115
+ import { useDialFileSharing as ji } from "./files/useDialFileSharing/useDialFileSharing.js";
116
+ import { useDialFileUploadBatch as Mi } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
117
+ import { useDialFileManager as Ni } from "./files/useDialFileManager/useDialFileManager.js";
118
+ import { useDialFileManagerTabConfig as Pi } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
119
+ import { isCustomAppSchema as Fi, isQuickAppSchema as Ii } from "./shared/application-schema.js";
120
+ import { getBrowserTimezone as Li } from "./shared/browser-timezone.js";
121
+ import { isValidAbsoluteUrl as Ri, isValidFeaturesData as zi, parseFeaturesData as Bi } from "./shared/custom-apps.js";
122
+ import { buildExternalServiceScopeId as Vi, getExternalServiceFallbackName as Hi, parseExternalServiceUrl as Ui } from "./shared/external-services.js";
123
+ import { useChatSettingsFormConfig as Wi } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
124
+ import { usePageFileDrag as Gi } from "./usePageFileDrag/usePageFileDrag.js";
125
+ import { useViewportWidth as Ki } from "./useViewportWidth/useViewportWidth.js";
126
+ import { usePanelMaxWidth as qi } from "./usePanelMaxWidth/usePanelMaxWidth.js";
127
+ import { useShareLink as Ji } from "./useShareLink/useShareLink.js";
128
+ import { useToolsMenu as Yi } from "./useToolsMenu/useToolsMenu.js";
129
+ import { useUsageData as Xi } from "./usage/useUsageData/useUsageData.js";
130
+ import { McpAppResourceFetchError as Zi, createMcpAppsApiClient as Qi } from "./mcp-apps/mcp-apps-api-client.js";
131
+ import { useMcpAppTools as $i } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
132
+ import { useMcpAppHostContext as ea } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
133
+ import { useMcpAppHostAdapter as ta } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
134
+ import { useOpenMcpAppCanvas as na } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
135
+ import { useGridEditingScroll as ra } from "@epam/ai-dial-chat-shared";
136
+ export { x as AttachmentValidationErrorReason, Gn as AudioTranscriptionError, Kn as AudioTranscriptionErrorReason, R as AuthenticationType, _r as COLUMNS_WITHOUT_AUTHOR, vr as COLUMNS_WITH_AUTHOR, yr as CORE_PERMISSION_MAP, Qe as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, br as DATE_OPTIONS, Lt as DEFAULT_GENERATION_CONFLICT_MESSAGE, Jn as DEFAULT_MAX_ARCHIVE_BYTES, wr as DialFileManagerActionProfile, Tr as DialFileManagerVariant, pr as DialFilesApiUploadMode, Ei as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, kt as FavoriteEntityType, mr as FileManagerNotificationReason, hr as FileNameValidationErrorReason, gr as FileOperationKind, Rt as GenerationConflictError, Zi as McpAppResourceFetchError, Le as McpResourceKind, at as OAuthResourceKind, xr as PATH_SEPARATOR_REGEXP, on as PROMPT_CONTENT_MAX_LENGTH, sn as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, cn as PROMPT_DESCRIPTION_MAX_LENGTH, ln as PROMPT_NAME_MAX_LENGTH, we as PUBLIC_SKILL_BUCKET, un as PromptFieldError, ae as PromptSource, Sr as RESERVED_MARKER_NAME, Mn as RecipientsCountStatus, ue as SKILL_FILE_UPLOAD_MAX_BYTES, Te as SKILL_LISTING_MAX_PAGES, Ee as SKILL_LISTING_PAGE_SIZE, de as SKILL_MANIFEST_FILE, De as SKILL_MANIFEST_MAX_BYTES, fe as SKILL_UPLOAD_MAX_FILES, pe as SKILL_UPLOAD_MAX_TOTAL_BYTES, Tn as SkillEditorLoadState, kn as SkillPreviewErrorKind, Oe as SkillSource, ot as TOOLSET_REDIRECT_STATE_KEY, st as ToolsetAuthStatus, ct as ToolsetAuthTypes, lt as ToolsetCredentialsLevel, Tt as ToolsetLoginOutcomeType, ut as ToolsetOAuthCallbackQuery, dt as ToolsetOAuthChannelControlType, ft as ToolsetOAuthFailureReason, pt as ToolsetOAuthInitiationResultType, mt as ToolsetOAuthResultType, Cr as UPLOAD_CONCURRENCY, _n as UnsupportedTriggerReason, ht as WithLogin, bi as annotationToDisplayAttachment, ri as annotationToOoxmlCanvasContent, ii as annotationToPdfCanvasContent, vn as apSchedulerDayToJsDay, W as appendLocaleCode, xi as attachmentDtoToDisplayAttachment, Si as attachmentDtosToDisplayAttachments, Xn as attachmentToDto, Zn as attachmentsToDtos, G as buildAdditionalLocaleOptions, Mt as buildAnnouncementSignature, Re as buildApplicationMcpUrl, N as buildChatCompletionsUrl, ze as buildConnectApi, P as buildDeploymentConnectApi, Vi as buildExternalServiceScopeId, Gr as buildFromCache, nn as buildPromptExportEnvelope, rn as buildPromptExportFileName, se as buildPromptOverview, dn as buildPromptPath, F as buildResponsesUrl, Dr as buildSharedItemVirtualPath, Ae as buildSkillContentTree, me as buildSkillFilesPayload, he as buildSkillManifest, ge as buildSkillManifestForSubmit, _e as buildSkillManifestFromFrontmatter, je as buildSkillOverview, bt as buildToolsetAuthorizeUrl, Be as buildToolsetMcpUrl, ai as clearAttachmentCache, K as composeLocalePayload, zt as createChatStreamApi, i as createCsrfMiddleware, Gt as createDeploymentChangedMessage, ei as createFilesApiClient, Qi as createMcpAppsApiClient, Qn as createMessagePair, j as createPublishApiClient, a as createUnauthorizedMiddleware, ti as createUploadFileWithProgress, V as decodeToolsetId, q as decomposeLocalizedFields, Er as deriveActionProfile, qe as deriveAvailableTabIds, Pn as deriveConversationRowActionState, Je as deriveFavoriteItems, Or as dialCorePathToRelative, Ci as dialFileToAttachment, wi as dialFilesToAttachments, Ti as dialFolderPathToAttachment, m as downloadAttachment, gt as emitToolsetLoginSuccess, I as encodeDeploymentId, H as encodeToolsetId, Kr as fetchByTab, qr as fetchForSearch, nt as fetchSkillDescription, Ye as filterCatalogItemsBySelector, Xe as filterHiddenOwnedItems, L as findDeploymentByIdOrReference, kr as findDialFileByPath, Jr as findFirstSuccessfulCopyMoveItem, Ar as findFolderByVirtualPath, Vt as formatAppVersion, X as formatCalendarDate, C as formatDateYM, w as formatDateYMD, jr as formatOperationFolderName, A as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Li as getBrowserTimezone, or as getConversationPath, Rn as getConversationSource, Hi as getExternalServiceFallbackName, Kt as getLastDeploymentId, qt as getLastUserMessageToolConfiguration, Ut as getModelIdFromConversationId, Br as getParentFolderPath, He as getPublicCatalogEntityFolderPath, Qt as getQuickAppConversationStarters, fn as getRemainingCharacters, rr as getStarterConversationText, ir as getStarterDisplayText, $t as getStarterPopulateText, ar as getStarterSubmitText, en as getStartersFromSchema, Wt as getTimeOfDayGreeting, vt as getToolsetOAuthChannelName, xt as getToolsetRedirectUri, _i as getUrlFileName, Mr as getVirtualPathName, $n as hasActiveToolConfig, Nt as hasAnnouncementContent, oi as hasAttachmentTextSource, Nr as hasDialFileWritePermission, Pr as hasForbiddenNameSymbols, Pt as hasStructuredAnnouncement, o as includesIgnoreCase, St as initiateOAuthLogin, er as isAnswerIncomplete, ur as isAwaitingGenerationResume, r as isConversationNotFoundError, Fr as isCopyMoveDuplicateAllowed, Fi as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, vi as isExternalSourcePreviewable, tr as isMessageChanged, Jt as isMessageStreaming, ce as isOrganisationPromptItem, Ue as isPublicCatalogEntityId, U as isPublicToolsetId, Ii as isQuickAppSchema, Ir as isShareActionsAllowed, Ri as isValidAbsoluteUrl, zi as isValidFeaturesData, ve as isValidSkillRelativePath, yn as jsDayToApSchedulerDay, Yr as mapCorePermissions, Q as mapDeploymentDetailsDtoToEntityDetails, z as mapDeploymentLimitsDtoToCatalogLimits, B as mapDeploymentLimitsToInput, te as mapDeploymentToCatalogItem, ne as mapDeploymentToolsetCredentials, $ as mapEntityDetailsToCatalogDetails, Xr as mapFileMetadataToDialFile, bn as mapFormValuesToCreateBody, xn as mapFormValuesToUpdateBody, le as mapPromptToCatalogItem, We as mapPublishConversationResultDto, Ge as mapPublishHistoryEntryDto, Sn as mapScheduledTaskDtoToFormValues, Zr as mapSearchItem, Me as mapSkillToCatalogItem, ee as mapToolsetCredentials, re as mapToolsetToCatalogItem, Qr as mergeCreatedFolderIntoCache, Yt as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, ye as nameFromPath, Ct as navigateToolsetOAuthPopup, Xt as normalizeResponseFormat, be as normalizeSkillName, Lr as normalizeVirtualPath, ni as openAnnotationAttachment, wt as openToolsetOAuthPopup, Z as padTwoDigits, Ui as parseExternalServiceUrl, Bi as parseFeaturesData, Rr as parseNewFolderVirtualPath, oe as parsePromptResourceUrl, xe as parseSkillManifest, tt as parseSkillManifestDocument, ke as parseSkillResourceUrl, Ur as prepareCopyItems, Di as prepareDownloadDestination, Wr as prepareMoveRenameItems, Ne as readSkillFileBytes, Pe as readSkillManifest, Ze as reconcileFilterTopics, si as referenceAttachmentToPdfCanvasContent, $e as resolveCatalogPrimaryAction, ci as resolveCodeCanvasContent, ie as resolveDeploymentFolder, Vr as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, yi as resolveExternalSourceContentType, li as resolveHtmlCanvasContent, ui as resolveImageCanvasContent, di as resolveJsonCanvasContent, J as resolveLocalizedText, fi as resolveMarkdownCanvasContent, Ve as resolveMcpResourceKind, pi as resolveOoxmlCanvasContent, zr as resolveOwnerCoords, mi as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Fe as resolveSkillFileDownloadPath, Ie as resolveSkillManifestFileId, hi as resolveTextCanvasContent, gi as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Ft as sanitizeAnnouncementHtml, It as sanitizeAnnouncementMessageHtml, Vn as sanitizeFileName, Ht as sanitizeFooterHtml, an as serializePromptExport, nr as shouldRerunGenerationOnEdit, Bt as shouldWatchForDisplayNameUpdate, Se as skillFileBytesToBlob, wn as skillFileToAttachment, Hn as splitFileNameExtension, l as stripSurroundingSlashes, u as stripTrailingSlashes, _t as subscribeToolsetLoginSuccess, Y as toBaseLocale, Zt as toOverlayMessages, Ke as toPublishEntityType, M as toPublishRuleDto, Un as trimFileNameToByteLimit, Ce as unpackSkillArchive, $r as updateEntry, Fn as useActiveConversationSync, In as useAsyncConfirmDialog, g as useAttachmentAction, Wn as useAttachmentUpload, S as useAttachmentValidation, et as useCatalogEditNavigation, it as useCatalogItemDetails, Dt as useCatalogToolsetCredentials, Wi as useChatSettingsFormConfig, Yn as useConversationExport, sr as useConversationHandlers, cr as useConversationImport, Ln as useConversationLookupMaps, zn as useConversationPanelItems, lr as useConversationScroll, fr as useConversationSources, dr as useConversationStream, Oi as useDialFileListing, Ni as useDialFileManager, Pi as useDialFileManagerTabConfig, ki as useDialFileMetadata, Ai as useDialFileMutations, ji as useDialFileSharing, Mi as useDialFileUploadBatch, At as useFavoriteEntitiesState, ra as useGridEditingScroll, Bn as useImportFilePicker, ta as useMcpAppHostAdapter, ea as useMcpAppHostContext, $i as useMcpAppTools, tn as useOAuthCallbackCompletion, na as useOpenMcpAppCanvas, Gi as usePageFileDrag, qi as usePanelMaxWidth, gn as usePromptsState, jt as usePublishFolders, Ji as useShareLink, Nn as useShareRecipientsCount, Ot as useSkillDetailsPanelData, En as useSkillEditorLoad, Dn as useSkillEditorSubmit, On as useSkillFileActions, An as useSkillFilePreview, rt as useSkillItemDetails, jn as useSkillsState, Yi as useToolsMenu, Et as useToolsetLogin, qn as useTranscribeAudio, Xi as useUsageData, Ki as useViewportWidth, pn as validatePromptContent, mn as validatePromptDescription, hn as validatePromptName, Cn as validateSkillFileBatch, Hr as virtualPathToApiPath, yt as waitForToolsetOAuthResult };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-hooks",
3
3
  "description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
4
- "version": "1.1.0-dev.445",
4
+ "version": "1.1.0-dev.456",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -104,21 +104,21 @@
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": "^19.2.6",
107
- "@epam/ai-dial-attachment-canvas": "1.1.0-dev.445",
108
- "@epam/ai-dial-attachment-input": "1.1.0-dev.445",
109
- "@epam/ai-dial-catalog": "1.1.0-dev.445",
110
- "@epam/ai-dial-chat-api-client": "1.1.0-dev.445",
111
- "@epam/ai-dial-chat-overlay": "1.1.0-dev.445",
112
- "@epam/ai-dial-chat-shared": "1.1.0-dev.445",
113
- "@epam/ai-dial-deployment-creation-form": "1.1.0-dev.445",
114
- "@epam/ai-dial-mcp-apps": "1.1.0-dev.445",
115
- "@epam/ai-dial-publish-panel": "1.1.0-dev.445",
116
- "@epam/ai-dial-quotations": "1.1.0-dev.445",
107
+ "@epam/ai-dial-attachment-canvas": "1.1.0-dev.456",
108
+ "@epam/ai-dial-attachment-input": "1.1.0-dev.456",
109
+ "@epam/ai-dial-catalog": "1.1.0-dev.456",
110
+ "@epam/ai-dial-chat-api-client": "1.1.0-dev.456",
111
+ "@epam/ai-dial-chat-overlay": "1.1.0-dev.456",
112
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.456",
113
+ "@epam/ai-dial-deployment-creation-form": "1.1.0-dev.456",
114
+ "@epam/ai-dial-mcp-apps": "1.1.0-dev.456",
115
+ "@epam/ai-dial-publish-panel": "1.1.0-dev.456",
116
+ "@epam/ai-dial-quotations": "1.1.0-dev.456",
117
117
  "@epam/ai-dial-react-file-manager": "*",
118
- "@epam/ai-dial-scheduled-tasks": "1.1.0-dev.445",
119
- "@epam/ai-dial-share": "1.1.0-dev.445",
120
- "@epam/ai-dial-skill-editor": "1.1.0-dev.445",
121
- "@epam/ai-dial-source-panel": "1.1.0-dev.445",
118
+ "@epam/ai-dial-scheduled-tasks": "1.1.0-dev.456",
119
+ "@epam/ai-dial-share": "1.1.0-dev.456",
120
+ "@epam/ai-dial-skill-editor": "1.1.0-dev.456",
121
+ "@epam/ai-dial-source-panel": "1.1.0-dev.456",
122
122
  "@epam/ai-dial-ui-kit": "*",
123
123
  "@modelcontextprotocol/sdk": "^1.27.1",
124
124
  "@epam/pdf-highlighter-kit": ">=0.0.14",
@@ -5,6 +5,15 @@ var e = (e, t) => e.toLowerCase().includes(t.toLowerCase()), t = (e) => {
5
5
  } catch {
6
6
  return e;
7
7
  }
8
- }, n = t, r = (e) => e.replace(/^\/+|\/+$/g, "");
8
+ }, n = t, r = (e) => {
9
+ let t = e.length;
10
+ for (; t > 0 && e[t - 1] === "/";) --t;
11
+ return e.slice(0, t);
12
+ }, i = (e) => {
13
+ let t = 0, n = e.length;
14
+ for (; t < n && e[t] === "/";) t += 1;
15
+ for (; n > t && e[n - 1] === "/";) --n;
16
+ return e.slice(t, n);
17
+ };
9
18
  //#endregion
10
- export { e as includesIgnoreCase, t as safeDecodeURI, n as safeDecodeURIComponent, r as stripSurroundingSlashes };
19
+ export { e as includesIgnoreCase, t as safeDecodeURI, n as safeDecodeURIComponent, i as stripSurroundingSlashes, r as stripTrailingSlashes };
package/skill/skill.js CHANGED
@@ -6,7 +6,7 @@ var i = "SKILL.md", a = 1048576, o = 16777216, s = 100, c = new Set([".dial-reso
6
6
  if (e === "" || e.startsWith("/") || u.test(e) || e.includes("\\") || d.test(e)) return !1;
7
7
  let t = e.split("/");
8
8
  return !(t.some((e) => e === "" || e === "." || e === "..") || t.some((e) => c.has(e)) || l.has(t[0]));
9
- }, p = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), m = ({ name: e, description: t, instructions: n }) => `---\n${r({
9
+ }, p = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-/, "").replace(/-$/, ""), m = ({ name: e, description: t, instructions: n }) => `---\n${r({
10
10
  name: e,
11
11
  description: t
12
12
  }).trimEnd()}\n---\n\n${n}`, h = (e, t, n, i) => `---\n${r({
@@ -1,93 +1,93 @@
1
1
  import { getApiErrorStatus as e } from "../api-error/api-error.js";
2
- import { stripSurroundingSlashes as t } from "../shared/string-utils.js";
3
- import { SKILL_MANIFEST_FILE as n, nameFromPath as r, parseSkillManifest as i, unpackSkillArchive as a } from "./skill.js";
4
- import { useEffect as o, useRef as s, useState as c } from "react";
5
- import { SkillFileNodeKind as l } from "@epam/ai-dial-skill-editor";
2
+ import { stripSurroundingSlashes as t, stripTrailingSlashes as n } from "../shared/string-utils.js";
3
+ import { SKILL_MANIFEST_FILE as r, nameFromPath as i, parseSkillManifest as a, unpackSkillArchive as o } from "./skill.js";
4
+ import { useEffect as s, useRef as c, useState as l } from "react";
5
+ import { SkillFileNodeKind as u } from "@epam/ai-dial-skill-editor";
6
6
  //#region src/skill/useSkillEditorLoad.ts
7
- var u = /* @__PURE__ */ function(e) {
7
+ var d = /* @__PURE__ */ function(e) {
8
8
  return e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e.Forbidden = "forbidden", e.NotFound = "not-found", e;
9
- }({}), d = class extends Error {}, f = (e, n) => {
10
- let r = e.parentPath ? t(e.parentPath) : "", i = `${n.replace(/\/+$/g, "")}/files`;
11
- return r === i ? e.name : r.startsWith(`${i}/`) ? `${r.slice(i.length + 1)}/${e.name}` : r === "files" ? e.name : r.startsWith("files/") ? `${r.slice(6)}/${e.name}` : null;
12
- }, p = async (e, t, n) => {
9
+ }({}), f = class extends Error {}, p = (e, r) => {
10
+ let i = e.parentPath ? t(e.parentPath) : "", a = `${n(r)}/files`;
11
+ return i === a ? e.name : i.startsWith(`${a}/`) ? `${i.slice(a.length + 1)}/${e.name}` : i === "files" ? e.name : i.startsWith("files/") ? `${i.slice(6)}/${e.name}` : null;
12
+ }, m = async (e, t, n) => {
13
13
  let r = await e.downloadSkill(t, n), i = r.headers.get("etag");
14
- if (!i) throw new d("Skill ETag is missing");
14
+ if (!i) throw new f("Skill ETag is missing");
15
15
  try {
16
- let e = await r.arrayBuffer(), { manifestText: t, files: n } = a(new Uint8Array(e));
16
+ let e = await r.arrayBuffer(), { manifestText: t, files: n } = o(new Uint8Array(e));
17
17
  return {
18
18
  etag: i,
19
19
  manifestText: t,
20
20
  files: n
21
21
  };
22
22
  } catch {
23
- throw new d("Skill ZIP is invalid");
23
+ throw new f("Skill ZIP is invalid");
24
24
  }
25
- }, m = async (e, t, r) => {
26
- let [i, a] = await Promise.all([e.downloadSkillFile(t, r, n), e.listSkillFiles({
25
+ }, h = async (e, t, n) => {
26
+ let [i, a] = await Promise.all([e.downloadSkillFile(t, n, r), e.listSkillFiles({
27
27
  bucket: t,
28
- path: r,
28
+ path: n,
29
29
  filePath: "",
30
30
  recursive: !0
31
- })]), o = a.items.find((e) => e.nodeType === "item" && f(e, r) === "SKILL.md"), s = i.headers.get("etag") ?? o?.etag;
31
+ })]), o = a.items.find((e) => e.nodeType === "item" && p(e, n) === "SKILL.md"), s = i.headers.get("etag") ?? o?.etag;
32
32
  if (!s) throw Error("Skill ETag is missing");
33
33
  let c = a.items.filter((e) => e.nodeType === "item").map((e) => ({
34
34
  item: e,
35
- path: f(e, r)
36
- })).filter((e) => e.path != null && e.path !== "SKILL.md"), l = await Promise.all(c.map(async ({ path: n }) => {
37
- let i = await e.downloadSkillFile(t, r, n);
38
- return [n, new Uint8Array(await i.arrayBuffer())];
35
+ path: p(e, n)
36
+ })).filter((e) => e.path != null && e.path !== "SKILL.md"), l = await Promise.all(c.map(async ({ path: r }) => {
37
+ let i = await e.downloadSkillFile(t, n, r);
38
+ return [r, new Uint8Array(await i.arrayBuffer())];
39
39
  }));
40
40
  return {
41
41
  etag: s,
42
42
  manifestText: await i.text(),
43
43
  files: new Map(l)
44
44
  };
45
- }, h = ({ isEditMode: t, bucket: n, skillPath: a, client: u }) => {
46
- let [f, h] = c(t ? "loading" : "loaded"), [g, _] = c(0), [v, y] = c(), b = s(void 0), x = s({}), S = s(void 0), [C, w] = c([]), T = s(/* @__PURE__ */ new Map());
47
- return o(() => {
45
+ }, g = ({ isEditMode: t, bucket: n, skillPath: r, client: o }) => {
46
+ let [d, p] = l(t ? "loading" : "loaded"), [g, _] = l(0), [v, y] = l(), b = c(void 0), x = c({}), S = c(void 0), [C, w] = l([]), T = c(/* @__PURE__ */ new Map());
47
+ return s(() => {
48
48
  if (!t || !n) return;
49
- if (a == null) {
50
- h("error");
49
+ if (r == null) {
50
+ p("error");
51
51
  return;
52
52
  }
53
- let o = !1;
54
- return h("loading"), (async () => {
55
- if (await Promise.resolve(), !o) try {
53
+ let s = !1;
54
+ return p("loading"), (async () => {
55
+ if (await Promise.resolve(), !s) try {
56
56
  let t;
57
57
  try {
58
- t = await p(u, n, a);
59
- } catch (r) {
60
- let i = e(r);
61
- if (!(r instanceof d) && i !== 400) throw r;
62
- t = await m(u, n, a);
58
+ t = await m(o, n, r);
59
+ } catch (i) {
60
+ let a = e(i);
61
+ if (!(i instanceof f) && a !== 400) throw i;
62
+ t = await h(o, n, r);
63
63
  }
64
- let { frontmatter: s, instructions: c } = i(t.manifestText);
65
- if (o) return;
66
- b.current = t.etag, x.current = s, S.current = a, T.current = new Map([...t.files].map(([e, t]) => [e, { bytes: t }])), w([...t.files.keys()].map((e) => ({
64
+ let { frontmatter: c, instructions: l } = a(t.manifestText);
65
+ if (s) return;
66
+ b.current = t.etag, x.current = c, S.current = r, T.current = new Map([...t.files].map(([e, t]) => [e, { bytes: t }])), w([...t.files.keys()].map((e) => ({
67
67
  path: e,
68
- name: r(e),
69
- kind: l.File
68
+ name: i(e),
69
+ kind: u.File
70
70
  }))), y({
71
- name: typeof s.name == "string" ? s.name : "",
72
- description: typeof s.description == "string" ? s.description : "",
73
- instructions: c
74
- }), h("loaded");
71
+ name: typeof c.name == "string" ? c.name : "",
72
+ description: typeof c.description == "string" ? c.description : "",
73
+ instructions: l
74
+ }), p("loaded");
75
75
  } catch (t) {
76
- if (o) return;
76
+ if (s) return;
77
77
  let n = e(t);
78
- h(n === 403 ? "forbidden" : n === 404 ? "not-found" : "error");
78
+ p(n === 403 ? "forbidden" : n === 404 ? "not-found" : "error");
79
79
  }
80
80
  })(), () => {
81
- o = !0;
81
+ s = !0;
82
82
  };
83
83
  }, [
84
84
  t,
85
85
  n,
86
- a,
86
+ r,
87
87
  g,
88
- u
88
+ o
89
89
  ]), {
90
- loadState: f,
90
+ loadState: d,
91
91
  loadedValues: v,
92
92
  setLoadedValues: y,
93
93
  files: C,
@@ -100,4 +100,4 @@ var u = /* @__PURE__ */ function(e) {
100
100
  };
101
101
  };
102
102
  //#endregion
103
- export { u as SkillEditorLoadState, h as useSkillEditorLoad };
103
+ export { d as SkillEditorLoadState, g as useSkillEditorLoad };
package/utils.d.ts CHANGED
@@ -297,6 +297,9 @@ export declare const serializePromptExport: (envelope: PromptExportFormat) => Bl
297
297
  /** Strips leading and trailing slashes from a path segment. */
298
298
  export declare const stripSurroundingSlashes: (path: string) => string;
299
299
 
300
+ /** Strips trailing slashes from a path segment. */
301
+ export declare const stripTrailingSlashes: (path: string) => string;
302
+
300
303
  /** Lowercased base language of a BCP-47 tag, e.g. `'en-US'` -> `'en'`. */
301
304
  export declare const toBaseLocale: (locale: string) => string;
302
305
 
package/utils.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { getApiErrorDetails as e, getApiErrorMessage as t, getApiErrorStatus as n, isConversationNotFoundError as r } from "./api-error/api-error.js";
2
2
  import { createCsrfMiddleware as i } from "./api-transport/create-csrf-middleware.js";
3
3
  import { createUnauthorizedMiddleware as a } from "./api-transport/create-unauthorized-middleware.js";
4
- import { includesIgnoreCase as o, safeDecodeURI as s, safeDecodeURIComponent as c, stripSurroundingSlashes as l } from "./shared/string-utils.js";
5
- import { appendLocaleCode as u, buildAdditionalLocaleOptions as d, composeLocalePayload as f, decomposeLocalizedFields as p, resolveLocalizedText as m, toBaseLocale as h } from "./shared/locale.js";
6
- import { formatCalendarDate as g, padTwoDigits as _ } from "./shared/formatting.js";
7
- import { PromptSource as v, parsePromptResourceUrl as y } from "./prompt/prompt-resource.js";
8
- import { buildPromptExportEnvelope as b, buildPromptExportFileName as x, serializePromptExport as S } from "./prompt/export-prompt.js";
9
- import { PROMPT_CONTENT_MAX_LENGTH as C, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as w, PROMPT_DESCRIPTION_MAX_LENGTH as T, PROMPT_NAME_MAX_LENGTH as E, PromptFieldError as D, buildPromptPath as O, getRemainingCharacters as k, validatePromptContent as A, validatePromptDescription as j, validatePromptName as M } from "./prompt/prompt.js";
10
- import { usePromptsState as N } from "./prompt/usePromptsState/usePromptsState.js";
11
- import { apSchedulerDayToJsDay as P, jsDayToApSchedulerDay as F } from "./shared/cron-weekday.js";
12
- import { isCustomAppSchema as I, isQuickAppSchema as L } from "./shared/application-schema.js";
13
- import { getBrowserTimezone as R } from "./shared/browser-timezone.js";
14
- import { isValidAbsoluteUrl as z, isValidFeaturesData as B, parseFeaturesData as V } from "./shared/custom-apps.js";
15
- import { buildExternalServiceScopeId as H, getExternalServiceFallbackName as U, parseExternalServiceUrl as W } from "./shared/external-services.js";
16
- import { useUsageData as G } from "./usage/useUsageData/useUsageData.js";
17
- export { C as PROMPT_CONTENT_MAX_LENGTH, w as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, T as PROMPT_DESCRIPTION_MAX_LENGTH, E as PROMPT_NAME_MAX_LENGTH, D as PromptFieldError, v as PromptSource, P as apSchedulerDayToJsDay, u as appendLocaleCode, d as buildAdditionalLocaleOptions, H as buildExternalServiceScopeId, b as buildPromptExportEnvelope, x as buildPromptExportFileName, O as buildPromptPath, f as composeLocalePayload, i as createCsrfMiddleware, a as createUnauthorizedMiddleware, p as decomposeLocalizedFields, g as formatCalendarDate, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, R as getBrowserTimezone, U as getExternalServiceFallbackName, k as getRemainingCharacters, o as includesIgnoreCase, r as isConversationNotFoundError, I as isCustomAppSchema, L as isQuickAppSchema, z as isValidAbsoluteUrl, B as isValidFeaturesData, F as jsDayToApSchedulerDay, _ as padTwoDigits, W as parseExternalServiceUrl, V as parseFeaturesData, y as parsePromptResourceUrl, m as resolveLocalizedText, s as safeDecodeURI, c as safeDecodeURIComponent, S as serializePromptExport, l as stripSurroundingSlashes, h as toBaseLocale, N as usePromptsState, G as useUsageData, A as validatePromptContent, j as validatePromptDescription, M as validatePromptName };
4
+ import { includesIgnoreCase as o, safeDecodeURI as s, safeDecodeURIComponent as c, stripSurroundingSlashes as l, stripTrailingSlashes as u } from "./shared/string-utils.js";
5
+ import { appendLocaleCode as d, buildAdditionalLocaleOptions as f, composeLocalePayload as p, decomposeLocalizedFields as m, resolveLocalizedText as h, toBaseLocale as g } from "./shared/locale.js";
6
+ import { formatCalendarDate as _, padTwoDigits as v } from "./shared/formatting.js";
7
+ import { PromptSource as y, parsePromptResourceUrl as b } from "./prompt/prompt-resource.js";
8
+ import { buildPromptExportEnvelope as x, buildPromptExportFileName as S, serializePromptExport as C } from "./prompt/export-prompt.js";
9
+ import { PROMPT_CONTENT_MAX_LENGTH as w, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as T, PROMPT_DESCRIPTION_MAX_LENGTH as E, PROMPT_NAME_MAX_LENGTH as D, PromptFieldError as O, buildPromptPath as k, getRemainingCharacters as A, validatePromptContent as j, validatePromptDescription as M, validatePromptName as N } from "./prompt/prompt.js";
10
+ import { usePromptsState as P } from "./prompt/usePromptsState/usePromptsState.js";
11
+ import { apSchedulerDayToJsDay as F, jsDayToApSchedulerDay as I } from "./shared/cron-weekday.js";
12
+ import { isCustomAppSchema as L, isQuickAppSchema as R } from "./shared/application-schema.js";
13
+ import { getBrowserTimezone as z } from "./shared/browser-timezone.js";
14
+ import { isValidAbsoluteUrl as B, isValidFeaturesData as V, parseFeaturesData as H } from "./shared/custom-apps.js";
15
+ import { buildExternalServiceScopeId as U, getExternalServiceFallbackName as W, parseExternalServiceUrl as G } from "./shared/external-services.js";
16
+ import { useUsageData as K } from "./usage/useUsageData/useUsageData.js";
17
+ export { w as PROMPT_CONTENT_MAX_LENGTH, T as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, E as PROMPT_DESCRIPTION_MAX_LENGTH, D as PROMPT_NAME_MAX_LENGTH, O as PromptFieldError, y as PromptSource, F as apSchedulerDayToJsDay, d as appendLocaleCode, f as buildAdditionalLocaleOptions, U as buildExternalServiceScopeId, x as buildPromptExportEnvelope, S as buildPromptExportFileName, k as buildPromptPath, p as composeLocalePayload, i as createCsrfMiddleware, a as createUnauthorizedMiddleware, m as decomposeLocalizedFields, _ as formatCalendarDate, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, z as getBrowserTimezone, W as getExternalServiceFallbackName, A as getRemainingCharacters, o as includesIgnoreCase, r as isConversationNotFoundError, L as isCustomAppSchema, R as isQuickAppSchema, B as isValidAbsoluteUrl, V as isValidFeaturesData, I as jsDayToApSchedulerDay, v as padTwoDigits, G as parseExternalServiceUrl, H as parseFeaturesData, b as parsePromptResourceUrl, h as resolveLocalizedText, s as safeDecodeURI, c as safeDecodeURIComponent, C as serializePromptExport, l as stripSurroundingSlashes, u as stripTrailingSlashes, g as toBaseLocale, P as usePromptsState, K as useUsageData, j as validatePromptContent, M as validatePromptDescription, N as validatePromptName };