@epam/ai-dial-chat-hooks 1.1.0-dev.432 → 1.1.0-dev.435
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.
- package/catalog/map-entity-details-to-catalog.js +1 -1
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +1 -1
- package/catalog.d.ts +3 -3
- package/conversation/useConversationHandlers/message-utils.js +6 -2
- package/conversation/useConversationHandlers/useConversationHandlers.js +3 -3
- package/conversation/useConversationStream/useConversationStream.js +35 -35
- package/conversation.d.ts +17 -0
- package/conversation.js +9 -9
- package/file-manager.d.ts +90 -0
- package/file-manager.js +16 -16
- package/files/attachment-canvas.js +111 -61
- package/files/dial-file-manager.model.js +4 -1
- package/index.d.ts +110 -3
- package/index.js +52 -52
- package/package.json +15 -15
|
@@ -256,7 +256,7 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
256
256
|
};
|
|
257
257
|
}, T = (e) => {
|
|
258
258
|
if (e == null) return;
|
|
259
|
-
let
|
|
259
|
+
let t = typeof e.unit == "string" ? e.unit : void 0, n = Object.entries(e).flatMap(([e, n]) => {
|
|
260
260
|
if (e === l || typeof n != "string" || n.trim() === "") return [];
|
|
261
261
|
let i = r(n, t);
|
|
262
262
|
return i == null ? [] : [{
|
|
@@ -4,7 +4,7 @@ import { parseSkillResourceUrl as n } from "../../skill/skill-types.js";
|
|
|
4
4
|
import { CatalogEntityType as r } from "@epam/ai-dial-chat-shared";
|
|
5
5
|
import { useCallback as i, useMemo as a } from "react";
|
|
6
6
|
//#region src/catalog/useCatalogEditNavigation/useCatalogEditNavigation.ts
|
|
7
|
-
var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHideCustomAppCreationEnabled: l, isToolsetsEnabled: u, isPromptsEnabled: d, quickAppSchemaId: f, urls: p, onNavigate: m, deletePrompt: h, deleteToolset: g, deleteSkill: _, deleteApplication: v, refetchPrompts: y, refetchToolsets: b, refetchSkills: x, refetchDeployments: S, onDeleteSuccess: C, labels: w, onNotify: T,
|
|
7
|
+
var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHideCustomAppCreationEnabled: l, isToolsetsEnabled: u, isPromptsEnabled: d, quickAppSchemaId: f, urls: p, onNavigate: m, deletePrompt: h, deleteToolset: g, deleteSkill: _, deleteApplication: v, refetchPrompts: y, refetchToolsets: b, refetchSkills: x, refetchDeployments: S, onDeleteSuccess: C, labels: w, onNotify: T, onSkillUploadClick: E }) => ({
|
|
8
8
|
handleEdit: i((e) => {
|
|
9
9
|
if (e.type === r.Prompt) {
|
|
10
10
|
m(p.buildPromptEditUrl(e.id));
|
package/catalog.d.ts
CHANGED
|
@@ -895,7 +895,7 @@ export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto
|
|
|
895
895
|
* item through the endpoint its type owns and refetching/notifying on
|
|
896
896
|
* completion, and building the Create dropdown's options.
|
|
897
897
|
*/
|
|
898
|
-
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, quickAppSchemaId, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify,
|
|
898
|
+
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, quickAppSchemaId, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify, onSkillUploadClick, }: UseCatalogEditNavigationParams) => UseCatalogEditNavigationResult;
|
|
899
899
|
|
|
900
900
|
/** Parameters accepted by {@link useCatalogEditNavigation}. */
|
|
901
901
|
export declare interface UseCatalogEditNavigationParams {
|
|
@@ -929,8 +929,8 @@ export declare interface UseCatalogEditNavigationParams {
|
|
|
929
929
|
labels: CatalogEditNavigationLabels;
|
|
930
930
|
/** Called to surface a host notification when a delete fails. */
|
|
931
931
|
onNotify: (notification: CatalogEditNavigationNotification) => void;
|
|
932
|
-
/**
|
|
933
|
-
|
|
932
|
+
/** Called when the Create menu's Skill → Upload option is picked. */
|
|
933
|
+
onSkillUploadClick: () => void;
|
|
934
934
|
}
|
|
935
935
|
|
|
936
936
|
/** Return value of {@link useCatalogEditNavigation}. */
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { MessageRole as e } from "@epam/ai-dial-chat-shared";
|
|
1
2
|
//#region src/conversation/useConversationHandlers/message-utils.ts
|
|
2
|
-
var
|
|
3
|
+
var t = (e) => e != null && Object.keys(e).length > 0, n = (e, t, n, r) => {
|
|
3
4
|
if (t !== e.content || r.length > 0) return !0;
|
|
4
5
|
let i = e.custom_content?.attachments?.length ?? 0;
|
|
5
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;
|
|
6
10
|
};
|
|
7
11
|
//#endregion
|
|
8
|
-
export {
|
|
12
|
+
export { t as hasActiveToolConfig, r as isAnswerIncomplete, n as isMessageChanged, i as shouldRerunGenerationOnEdit };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAttachmentUpload as e } from "../useAttachmentUpload/useAttachmentUpload.js";
|
|
2
2
|
import { attachmentsToDtos as t } from "./attachment-to-dto.js";
|
|
3
3
|
import { createMessagePair as n } from "./message-factory.js";
|
|
4
|
-
import { hasActiveToolConfig as r,
|
|
4
|
+
import { hasActiveToolConfig as r, shouldRerunGenerationOnEdit as i } from "./message-utils.js";
|
|
5
5
|
import { getStarterSubmitText as a } from "./starter-option.js";
|
|
6
6
|
import { getConversationPath as o } from "../useConversationStream/conversation-path.js";
|
|
7
7
|
import { MessageRole as s, generateUUID as c } from "@epam/ai-dial-chat-shared";
|
|
@@ -211,7 +211,7 @@ var f = ({ conversation: f, conversationId: p, bucket: m, isStreaming: h, startS
|
|
|
211
211
|
let o = e;
|
|
212
212
|
if (o === -1 || f.messages[o].role !== s.User) return;
|
|
213
213
|
let l = f.messages[o];
|
|
214
|
-
if (!i(
|
|
214
|
+
if (!i(f.messages, o, n, r, a)) {
|
|
215
215
|
k((e) => {
|
|
216
216
|
let t = new Set(e);
|
|
217
217
|
return t.delete(o), t;
|
|
@@ -240,7 +240,7 @@ var f = ({ conversation: f, conversationId: p, bucket: m, isStreaming: h, startS
|
|
|
240
240
|
...f,
|
|
241
241
|
messages: D
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
v.current = O, _(O);
|
|
244
244
|
let A = S();
|
|
245
245
|
g(p, n, D.length - 1, A, C, c(), d.Edit), k(/* @__PURE__ */ new Set());
|
|
246
246
|
}, [
|
|
@@ -8,35 +8,35 @@ import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState a
|
|
|
8
8
|
import { SendCompletionDtoModeEnum as d } from "@epam/ai-dial-chat-api-client";
|
|
9
9
|
//#region src/conversation/useConversationStream/useConversationStream.ts
|
|
10
10
|
var f = 2e4, p = ({ conversationId: p, state: { setConversation: m, conversationRef: h }, transport: g, generation: { startGeneration: _, completeGeneration: v }, channel: y, overlay: b, onStopError: x }) => {
|
|
11
|
-
let [S, C] = u(() => /* @__PURE__ */ new Set()), [w, T] = u(null), E = l(null), D = l(null), O = l(/* @__PURE__ */ new Set()), k = l(/* @__PURE__ */ new Map()), A = l(/* @__PURE__ */ new Set()), j = l(p);
|
|
11
|
+
let [S, C] = u(() => /* @__PURE__ */ new Set()), [w, T] = u(null), E = l(null), D = l(null), O = l(/* @__PURE__ */ new Set()), k = l(/* @__PURE__ */ new Map()), A = l(/* @__PURE__ */ new Set()), j = l(/* @__PURE__ */ new Map()), M = l(p);
|
|
12
12
|
s(() => {
|
|
13
|
-
|
|
13
|
+
M.current = p;
|
|
14
14
|
}, [p]);
|
|
15
|
-
let
|
|
15
|
+
let N = o((e) => t(M.current ?? "") === e, []), P = o((e) => {
|
|
16
16
|
C((t) => {
|
|
17
17
|
if (t.has(e)) return t;
|
|
18
18
|
let n = new Set(t);
|
|
19
19
|
return n.add(e), n;
|
|
20
20
|
});
|
|
21
|
-
}, []),
|
|
21
|
+
}, []), F = o((e) => {
|
|
22
22
|
C((t) => {
|
|
23
23
|
if (!t.has(e)) return t;
|
|
24
24
|
let n = new Set(t);
|
|
25
25
|
return n.delete(e), n;
|
|
26
26
|
});
|
|
27
|
-
}, []),
|
|
27
|
+
}, []), I = o((i, o, s, c, l, u, p = d.Append) => {
|
|
28
28
|
let x = u ?? a(), S = t(i);
|
|
29
|
-
E.current = x, D.current = S, T(S);
|
|
29
|
+
E.current = x, D.current = S, j.current.set(S, x), T(S);
|
|
30
30
|
let C;
|
|
31
31
|
p === d.Regenerate ? C = s : p === d.Edit && (C = s - 1);
|
|
32
|
-
let w = _(S, x),
|
|
33
|
-
|
|
32
|
+
let w = () => j.current.get(S) !== x, O = _(S, x), M = h.current?.messages[s];
|
|
33
|
+
M ? k.current.set(S, {
|
|
34
34
|
generationId: x,
|
|
35
35
|
messageIndex: s,
|
|
36
|
-
message:
|
|
37
|
-
}) : k.current.delete(S),
|
|
38
|
-
let
|
|
39
|
-
signal:
|
|
36
|
+
message: M
|
|
37
|
+
}) : k.current.delete(S), P(S), b?.notifyGenerationStart?.(), y?.ensureConnected();
|
|
38
|
+
let I = {
|
|
39
|
+
signal: O.signal,
|
|
40
40
|
onChunk: (e) => {
|
|
41
41
|
if (E.current !== x) return;
|
|
42
42
|
let t = k.current.get(S);
|
|
@@ -44,7 +44,7 @@ var f = 2e4, p = ({ conversationId: p, state: { setConversation: m, conversation
|
|
|
44
44
|
let r = n([t.message], 0, e);
|
|
45
45
|
r && (t.message = r[0]);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
N(S) && m((t) => {
|
|
48
48
|
if (!t) return t;
|
|
49
49
|
let i = k.current.get(S), a;
|
|
50
50
|
if (i?.generationId === x) a = r(t, i);
|
|
@@ -60,15 +60,15 @@ var f = 2e4, p = ({ conversationId: p, state: { setConversation: m, conversation
|
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
onComplete: async () => {
|
|
63
|
-
if (k.current.get(S)?.generationId === x && k.current.delete(S),
|
|
63
|
+
if (k.current.get(S)?.generationId === x && k.current.delete(S), w() || F(S), E.current === x && (E.current = null, D.current = null, T(null)), v(S, x), y?.notifyGenerationSettled?.(), A.current.has(x) ? A.current.delete(x) : w() || b?.notifyGenerationEnd?.(), !w() && N(S)) try {
|
|
64
64
|
let t = await g.getConversation(e(i));
|
|
65
|
-
if (!
|
|
65
|
+
if (w() || !N(S)) return;
|
|
66
66
|
m(t), h.current = t;
|
|
67
67
|
} catch {}
|
|
68
68
|
},
|
|
69
69
|
onError: (e) => {
|
|
70
70
|
let t = k.current.get(S), n = t?.generationId === x ? t : void 0;
|
|
71
|
-
n && k.current.delete(S),
|
|
71
|
+
n && k.current.delete(S), w() || F(S), E.current === x && (E.current = null, D.current = null, T(null)), v(S, x), y?.notifyGenerationSettled?.(), !(w() || !N(S)) && m((t) => {
|
|
72
72
|
if (!t) return t;
|
|
73
73
|
let i = n?.generationId === x ? r(t, n) : t, a = {
|
|
74
74
|
...i,
|
|
@@ -84,27 +84,27 @@ var f = 2e4, p = ({ conversationId: p, state: { setConversation: m, conversation
|
|
|
84
84
|
(async () => {
|
|
85
85
|
try {
|
|
86
86
|
let e = y?.channelId ?? await y?.waitForChannel(f) ?? void 0;
|
|
87
|
-
g.streamCompletion(S, o, c,
|
|
87
|
+
g.streamCompletion(S, o, c, I, l, x, p, C, e);
|
|
88
88
|
} catch (e) {
|
|
89
|
-
|
|
89
|
+
I.onError(e instanceof Error ? e : Error(String(e)));
|
|
90
90
|
}
|
|
91
91
|
})();
|
|
92
92
|
}, [
|
|
93
93
|
_,
|
|
94
94
|
v,
|
|
95
|
-
N,
|
|
96
95
|
P,
|
|
97
|
-
|
|
96
|
+
F,
|
|
97
|
+
N,
|
|
98
98
|
y?.channelId,
|
|
99
99
|
y?.ensureConnected,
|
|
100
100
|
y?.waitForChannel,
|
|
101
101
|
y?.notifyGenerationSettled,
|
|
102
102
|
b,
|
|
103
103
|
g
|
|
104
|
-
]),
|
|
104
|
+
]), L = o((e, n) => {
|
|
105
105
|
let i = t(e), a = k.current.get(i);
|
|
106
106
|
return a ? r(n, a) : n;
|
|
107
|
-
}, []),
|
|
107
|
+
}, []), R = o(() => {
|
|
108
108
|
let e = E.current;
|
|
109
109
|
if (!e || !p) return;
|
|
110
110
|
let n = t(p);
|
|
@@ -120,28 +120,28 @@ var f = 2e4, p = ({ conversationId: p, state: { setConversation: m, conversation
|
|
|
120
120
|
x,
|
|
121
121
|
b,
|
|
122
122
|
g
|
|
123
|
-
]),
|
|
123
|
+
]), z = c(() => i({
|
|
124
124
|
transport: g,
|
|
125
125
|
setConversation: m,
|
|
126
126
|
conversationRef: h,
|
|
127
127
|
resumingPathsRef: O,
|
|
128
128
|
bufferedGenerationsRef: k,
|
|
129
|
-
addStreamingPath:
|
|
130
|
-
removeStreamingPath:
|
|
131
|
-
isPathDisplayed:
|
|
129
|
+
addStreamingPath: P,
|
|
130
|
+
removeStreamingPath: F,
|
|
131
|
+
isPathDisplayed: N
|
|
132
132
|
}), [
|
|
133
|
-
N,
|
|
134
133
|
P,
|
|
135
|
-
|
|
134
|
+
F,
|
|
135
|
+
N,
|
|
136
136
|
g
|
|
137
|
-
]),
|
|
137
|
+
]), B = p != null && S.has(t(p)), V = p == null ? null : t(p);
|
|
138
138
|
return {
|
|
139
|
-
startStream:
|
|
140
|
-
handleStop:
|
|
141
|
-
resumeIfAwaitingGeneration:
|
|
142
|
-
restoreBufferedGeneration:
|
|
143
|
-
isStreaming:
|
|
144
|
-
canStopStreaming:
|
|
139
|
+
startStream: I,
|
|
140
|
+
handleStop: R,
|
|
141
|
+
resumeIfAwaitingGeneration: z,
|
|
142
|
+
restoreBufferedGeneration: L,
|
|
143
|
+
isStreaming: B,
|
|
144
|
+
canStopStreaming: V != null && w === V
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
147
|
//#endregion
|
package/conversation.d.ts
CHANGED
|
@@ -453,6 +453,13 @@ export declare const hasAnnouncementContent: (content: AnnouncementContent) => b
|
|
|
453
453
|
*/
|
|
454
454
|
export declare const hasStructuredAnnouncement: ({ title, description, }: AnnouncementContent) => boolean;
|
|
455
455
|
|
|
456
|
+
/**
|
|
457
|
+
* Whether the assistant answer that follows an edited user message is missing
|
|
458
|
+
* or incomplete: no message at all, a non-assistant message, an answer the
|
|
459
|
+
* user stopped, or one that ended with a stream error.
|
|
460
|
+
*/
|
|
461
|
+
export declare const isAnswerIncomplete: (answer: Message | undefined) => boolean;
|
|
462
|
+
|
|
456
463
|
/**
|
|
457
464
|
* True when the conversation's last message is an unresolved assistant
|
|
458
465
|
* placeholder: the backend only persists a conversation at generation start
|
|
@@ -561,6 +568,16 @@ export declare const sanitizeAnnouncementMessageHtml: (html: string) => string;
|
|
|
561
568
|
/** Sanitizes footer message HTML to the allowed tag/attribute set. */
|
|
562
569
|
export declare const sanitizeFooterHtml: (html: string) => string;
|
|
563
570
|
|
|
571
|
+
/**
|
|
572
|
+
* Whether submitting an edit has to re-run the generation.
|
|
573
|
+
*
|
|
574
|
+
* True whenever the message itself changed, and also when it is unchanged but
|
|
575
|
+
* its answer never completed — after stopping a generation the user submits
|
|
576
|
+
* the same message precisely to get a full answer, so treating that as "no
|
|
577
|
+
* change" would leave the conversation stuck with the partial one.
|
|
578
|
+
*/
|
|
579
|
+
export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
|
|
580
|
+
|
|
564
581
|
/** True when the first user/assistant exchange is complete and LLM naming may still run. */
|
|
565
582
|
export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
|
|
566
583
|
|
package/conversation.js
CHANGED
|
@@ -20,12 +20,12 @@ import { AudioTranscriptionError as k, AudioTranscriptionErrorReason as A } from
|
|
|
20
20
|
import { useTranscribeAudio as j } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
21
21
|
import { attachmentToDto as M, attachmentsToDtos as N } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
22
22
|
import { createMessagePair as P } from "./conversation/useConversationHandlers/message-factory.js";
|
|
23
|
-
import { hasActiveToolConfig as F,
|
|
24
|
-
import { getStarterConversationText as
|
|
25
|
-
import { getConversationPath as
|
|
26
|
-
import { useConversationHandlers as
|
|
27
|
-
import { isAwaitingGenerationResume as
|
|
28
|
-
import { useConversationStream as
|
|
29
|
-
import { useChatSettingsFormConfig as
|
|
30
|
-
import { useToolsMenu as
|
|
31
|
-
export { k as AudioTranscriptionError, A as AudioTranscriptionErrorReason, M as attachmentToDto, N as attachmentsToDtos, e as buildAnnouncementSignature, a as createChatStreamApi, d as createDeploymentChangedMessage, P as createMessagePair, x as deriveConversationRowActionState, s as formatAppVersion,
|
|
23
|
+
import { hasActiveToolConfig as F, isAnswerIncomplete as I, isMessageChanged as L, shouldRerunGenerationOnEdit as R } from "./conversation/useConversationHandlers/message-utils.js";
|
|
24
|
+
import { getStarterConversationText as z, getStarterSubmitText as B } from "./conversation/useConversationHandlers/starter-option.js";
|
|
25
|
+
import { getConversationPath as V } from "./conversation/useConversationStream/conversation-path.js";
|
|
26
|
+
import { useConversationHandlers as H } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
27
|
+
import { isAwaitingGenerationResume as U } from "./conversation/useConversationStream/generation-resume.js";
|
|
28
|
+
import { useConversationStream as W } from "./conversation/useConversationStream/useConversationStream.js";
|
|
29
|
+
import { useChatSettingsFormConfig as G } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
30
|
+
import { useToolsMenu as K } from "./useToolsMenu/useToolsMenu.js";
|
|
31
|
+
export { k as AudioTranscriptionError, A as AudioTranscriptionErrorReason, M as attachmentToDto, N as attachmentsToDtos, e as buildAnnouncementSignature, a as createChatStreamApi, d as createDeploymentChangedMessage, P as createMessagePair, x as deriveConversationRowActionState, s as formatAppVersion, V as getConversationPath, T as getConversationSource, f as getLastDeploymentId, p as getLastUserMessageToolConfiguration, l as getModelIdFromConversationId, v as getQuickAppConversationStarters, z as getStarterConversationText, y as getStarterPopulateText, B as getStarterSubmitText, b as getStartersFromSchema, u as getTimeOfDayGreeting, F as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, I as isAnswerIncomplete, U as isAwaitingGenerationResume, L as isMessageChanged, m as isMessageStreaming, h as messageHasStages, g as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, c as sanitizeFooterHtml, R as shouldRerunGenerationOnEdit, o as shouldWatchForDisplayNameUpdate, _ as toOverlayMessages, S as useActiveConversationSync, C as useAsyncConfirmDialog, O as useAttachmentUpload, G as useChatSettingsFormConfig, H as useConversationHandlers, w as useConversationLookupMaps, E as useConversationPanelItems, W as useConversationStream, D as useImportFilePicker, K as useToolsMenu, j as useTranscribeAudio };
|
package/file-manager.d.ts
CHANGED
|
@@ -58,6 +58,16 @@ import { UseGridEditingScrollResult } from '@epam/ai-dial-chat-shared';
|
|
|
58
58
|
/** Maps an annotation's source attachment to the display-only attachment model. */
|
|
59
59
|
export declare const annotationToDisplayAttachment: (annotation: Annotation) => DisplayAttachment | null;
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Builds an `OoxmlCanvasContent` for a DOCX/PPTX/XLSX citation annotation,
|
|
63
|
+
* including highlights for every annotation sharing the clicked one's source
|
|
64
|
+
* document. Returns `null` when the annotation has no source attachment,
|
|
65
|
+
* the source is not a format `@silurus/ooxml` renders as DOCX/XLSX/PPTX (a
|
|
66
|
+
* CSV source returns `null` — citation highlighting targets Office documents
|
|
67
|
+
* only), or no URL resolves.
|
|
68
|
+
*/
|
|
69
|
+
export declare const annotationToOoxmlCanvasContent: (annotation: Annotation, annotations: Annotation[], resolvers: AttachmentCanvasUrlResolvers) => OoxmlCanvasContent | null;
|
|
70
|
+
|
|
61
71
|
/**
|
|
62
72
|
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
63
73
|
* for the clicked annotation's document within its citation group.
|
|
@@ -657,6 +667,34 @@ declare interface OoxmlCanvasContent {
|
|
|
657
667
|
url: string;
|
|
658
668
|
/** The document format used to select and configure the format-specific renderer. */
|
|
659
669
|
format: OoxmlFileType;
|
|
670
|
+
/** Cited locations to draw over the document. Omitted, never `[]`, when there is nothing to highlight. */
|
|
671
|
+
highlights?: OoxmlHighlight[];
|
|
672
|
+
/** Id of the highlight to navigate to and emphasise. Omitted when the clicked citation resolved to no location. */
|
|
673
|
+
selectedHighlightId?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/** A 1-based cell address, matching `@silurus/ooxml`'s own `CellAddress`. */
|
|
677
|
+
declare interface OoxmlCellAddress {
|
|
678
|
+
/** 1-based row number. */
|
|
679
|
+
row: number;
|
|
680
|
+
/** 1-based column number. */
|
|
681
|
+
col: number;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/** A cited character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
685
|
+
declare interface OoxmlDocxHighlightLocation {
|
|
686
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
687
|
+
kind: OoxmlHighlightKind.DocxTextRange;
|
|
688
|
+
/** Name of the DOCX story the range lives in, as an opaque string (only `'body'` is confirmed upstream). */
|
|
689
|
+
story: string;
|
|
690
|
+
/** Source-tree element indices identifying the paragraph, matched element-wise. */
|
|
691
|
+
path: number[];
|
|
692
|
+
/** Inclusive start character offset within the story's matched text. */
|
|
693
|
+
start: number;
|
|
694
|
+
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
695
|
+
endExclusive: number;
|
|
696
|
+
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
697
|
+
text: string;
|
|
660
698
|
}
|
|
661
699
|
|
|
662
700
|
/** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
|
|
@@ -667,6 +705,58 @@ declare enum OoxmlFileType {
|
|
|
667
705
|
Csv = 'csv',
|
|
668
706
|
}
|
|
669
707
|
|
|
708
|
+
/** One citation's highlight: the locations it resolved to, under a stable id. */
|
|
709
|
+
declare interface OoxmlHighlight {
|
|
710
|
+
/** Stable id, used to mark exactly one highlight selected. */
|
|
711
|
+
id: string;
|
|
712
|
+
/** One or more locations — a single citation may carry several selectors. */
|
|
713
|
+
locations: OoxmlHighlightLocation[];
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/** Discriminates the Office highlight location descriptors an `OoxmlCanvasContent` can carry. */
|
|
717
|
+
declare enum OoxmlHighlightKind {
|
|
718
|
+
/** A character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
719
|
+
DocxTextRange = 'docxTextRange',
|
|
720
|
+
/** A character range inside a single PPTX shape on one slide. */
|
|
721
|
+
PptxTextRange = 'pptxTextRange',
|
|
722
|
+
/** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
|
|
723
|
+
XlsxCellRange = 'xlsxCellRange',
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/** A cited location inside an Office document, in document coordinates. */
|
|
727
|
+
declare type OoxmlHighlightLocation =
|
|
728
|
+
| OoxmlDocxHighlightLocation
|
|
729
|
+
| OoxmlPptxHighlightLocation
|
|
730
|
+
| OoxmlXlsxHighlightLocation;
|
|
731
|
+
|
|
732
|
+
/** A cited character range inside a single shape on one PPTX slide. */
|
|
733
|
+
declare interface OoxmlPptxHighlightLocation {
|
|
734
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
735
|
+
kind: OoxmlHighlightKind.PptxTextRange;
|
|
736
|
+
/** 1-based slide number. */
|
|
737
|
+
slide: number;
|
|
738
|
+
/** Shape identifier, compared as a string against the run's own `shapeId`. */
|
|
739
|
+
shapeId: string;
|
|
740
|
+
/** Inclusive start character offset within the shape's matched text. */
|
|
741
|
+
start: number;
|
|
742
|
+
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
743
|
+
endExclusive: number;
|
|
744
|
+
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
745
|
+
text: string;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
|
|
749
|
+
declare interface OoxmlXlsxHighlightLocation {
|
|
750
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
751
|
+
kind: OoxmlHighlightKind.XlsxCellRange;
|
|
752
|
+
/** Sheet name, matched exactly against the workbook's own sheet names. */
|
|
753
|
+
sheet: string;
|
|
754
|
+
/** First cell of the range. 1-based, passed to the viewer unconverted. */
|
|
755
|
+
start: OoxmlCellAddress;
|
|
756
|
+
/** Last cell of the range, on the same row as `start`. Omitted for a single cell. */
|
|
757
|
+
end?: OoxmlCellAddress;
|
|
758
|
+
}
|
|
759
|
+
|
|
670
760
|
/**
|
|
671
761
|
* Opens a cited/referenced attachment: triggers a browser download for
|
|
672
762
|
* DIAL-hosted files (`files/...` ids) via the injected `resolveDownloadUrl`,
|
package/file-manager.js
CHANGED
|
@@ -11,19 +11,19 @@ import { buildFromCache as z, fetchByTab as B, fetchForSearch as V, findFirstSuc
|
|
|
11
11
|
import { createFilesApiClient as J } from "./files/create-files-api.js";
|
|
12
12
|
import { createUploadFileWithProgress as Y } from "./files/create-upload-file-with-progress.js";
|
|
13
13
|
import { openAnnotationAttachment as X } from "./files/annotation.js";
|
|
14
|
-
import {
|
|
15
|
-
import { getUrlFileName as
|
|
16
|
-
import { annotationToDisplayAttachment as
|
|
17
|
-
import { dialFileToAttachment as
|
|
18
|
-
import { DownloadDestinationType as
|
|
19
|
-
import { prepareDownloadDestination as
|
|
20
|
-
import { sanitizeFileName as
|
|
21
|
-
import { useDialFileListing as
|
|
22
|
-
import { useDialFileMetadata as
|
|
23
|
-
import { useDialFileMutations as
|
|
24
|
-
import { useDialFileSharing as
|
|
25
|
-
import { useDialFileUploadBatch as
|
|
26
|
-
import { useDialFileManager as
|
|
27
|
-
import { useDialFileManagerTabConfig as
|
|
28
|
-
import { useGridEditingScroll as
|
|
29
|
-
export { d as COLUMNS_WITHOUT_AUTHOR, f as COLUMNS_WITH_AUTHOR, p as CORE_PERMISSION_MAP, m as DATE_OPTIONS, v as DialFileManagerActionProfile, y as DialFileManagerVariant, s as DialFilesApiUploadMode,
|
|
14
|
+
import { annotationToOoxmlCanvasContent as Z, annotationToPdfCanvasContent as Q, clearAttachmentCache as $, hasAttachmentTextSource as ee, referenceAttachmentToPdfCanvasContent as te, resolveCodeCanvasContent as ne, resolveHtmlCanvasContent as re, resolveImageCanvasContent as ie, resolveJsonCanvasContent as ae, resolveMarkdownCanvasContent as oe, resolveOoxmlCanvasContent as se, resolvePdfCanvasContent as ce, resolveTextCanvasContent as le, resolveVisualizerCanvasContent as ue } from "./files/attachment-canvas.js";
|
|
15
|
+
import { getUrlFileName as de, isExternalSourcePreviewable as fe, resolveExternalSourceContentType as pe } from "./files/source-content.js";
|
|
16
|
+
import { annotationToDisplayAttachment as me, attachmentDtoToDisplayAttachment as he, attachmentDtosToDisplayAttachments as ge } from "./files/attachment-dto-to-display.js";
|
|
17
|
+
import { dialFileToAttachment as _e, dialFilesToAttachments as ve, dialFolderPathToAttachment as ye } from "./files/dial-file-to-attachment.js";
|
|
18
|
+
import { DownloadDestinationType as be } from "./files/download-destination.js";
|
|
19
|
+
import { prepareDownloadDestination as xe } from "./files/prepare-download-destination.js";
|
|
20
|
+
import { sanitizeFileName as Se, splitFileNameExtension as Ce, trimFileNameToByteLimit as we } from "./files/file-name.js";
|
|
21
|
+
import { useDialFileListing as Te } from "./files/useDialFileListing/useDialFileListing.js";
|
|
22
|
+
import { useDialFileMetadata as Ee } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
23
|
+
import { useDialFileMutations as De } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
24
|
+
import { useDialFileSharing as Oe } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
25
|
+
import { useDialFileUploadBatch as ke } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
26
|
+
import { useDialFileManager as Ae } from "./files/useDialFileManager/useDialFileManager.js";
|
|
27
|
+
import { useDialFileManagerTabConfig as je } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
28
|
+
import { useGridEditingScroll as Me } from "@epam/ai-dial-chat-shared";
|
|
29
|
+
export { d as COLUMNS_WITHOUT_AUTHOR, f as COLUMNS_WITH_AUTHOR, p as CORE_PERMISSION_MAP, m as DATE_OPTIONS, v as DialFileManagerActionProfile, y as DialFileManagerVariant, s as DialFilesApiUploadMode, be as DownloadDestinationType, c as FileManagerNotificationReason, l as FileNameValidationErrorReason, u as FileOperationKind, h as PATH_SEPARATOR_REGEXP, g as RESERVED_MARKER_NAME, _ as UPLOAD_CONCURRENCY, me as annotationToDisplayAttachment, Z as annotationToOoxmlCanvasContent, Q as annotationToPdfCanvasContent, he as attachmentDtoToDisplayAttachment, ge as attachmentDtosToDisplayAttachments, z as buildFromCache, x as buildSharedItemVirtualPath, $ as clearAttachmentCache, J as createFilesApiClient, Y as createUploadFileWithProgress, b as deriveActionProfile, S as dialCorePathToRelative, _e as dialFileToAttachment, ve as dialFilesToAttachments, ye as dialFolderPathToAttachment, B as fetchByTab, V as fetchForSearch, C as findDialFileByPath, H as findFirstSuccessfulCopyMoveItem, w as findFolderByVirtualPath, T as formatOperationFolderName, P as getParentFolderPath, de as getUrlFileName, E as getVirtualPathName, ee as hasAttachmentTextSource, D as hasDialFileWritePermission, O as hasForbiddenNameSymbols, k as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, fe as isExternalSourcePreviewable, A as isShareActionsAllowed, U as mapCorePermissions, W as mapFileMetadataToDialFile, G as mapSearchItem, K as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, j as normalizeVirtualPath, X as openAnnotationAttachment, M as parseNewFolderVirtualPath, L as prepareCopyItems, xe as prepareDownloadDestination, R as prepareMoveRenameItems, te as referenceAttachmentToPdfCanvasContent, ne as resolveCodeCanvasContent, F as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, pe as resolveExternalSourceContentType, re as resolveHtmlCanvasContent, ie as resolveImageCanvasContent, ae as resolveJsonCanvasContent, oe as resolveMarkdownCanvasContent, se as resolveOoxmlCanvasContent, N as resolveOwnerCoords, ce as resolvePdfCanvasContent, n as resolveRelativeDialFilePath, le as resolveTextCanvasContent, ue as resolveVisualizerCanvasContent, Se as sanitizeFileName, Ce as splitFileNameExtension, we as trimFileNameToByteLimit, q as updateEntry, Te as useDialFileListing, Ae as useDialFileManager, je as useDialFileManagerTabConfig, Ee as useDialFileMetadata, De as useDialFileMutations, Oe as useDialFileSharing, ke as useDialFileUploadBatch, Me as useGridEditingScroll, I as virtualPathToApiPath };
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { isDialFileId as e } from "./dial-file.js";
|
|
2
|
-
import { AttachmentContentType as t, AttachmentErrorType as n } from "@epam/ai-dial-attachment-canvas";
|
|
3
|
-
import { MIMEType as
|
|
4
|
-
import { annotationHighlightId as
|
|
5
|
-
import { LRUCache as
|
|
2
|
+
import { AttachmentContentType as t, AttachmentErrorType as n, OoxmlFileType as r, OoxmlHighlightKind as i, getOoxmlFileType as a } from "@epam/ai-dial-attachment-canvas";
|
|
3
|
+
import { MIMEType as o, base64ToBlob as s, tryBase64ToBytes as c } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { annotationHighlightId as l, annotationToOfficeHighlightLocations as u, annotationsToPdfHighlights as d, gatherSameSourceAnnotations as f, getAnnotationPdfPage as p, parsePdfPageReference as m } from "@epam/ai-dial-quotations";
|
|
5
|
+
import { LRUCache as h } from "lru-cache";
|
|
6
6
|
//#region src/files/attachment-canvas.ts
|
|
7
|
-
var
|
|
8
|
-
let t =
|
|
7
|
+
var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
8
|
+
let t = c(e);
|
|
9
9
|
return t == null ? e : new TextDecoder().decode(t);
|
|
10
|
-
},
|
|
10
|
+
}, v = (e, r) => ({
|
|
11
11
|
type: t.Error,
|
|
12
12
|
errorType: e === 403 ? n.Forbidden : n.LoadFailed,
|
|
13
13
|
url: r
|
|
14
|
-
}),
|
|
14
|
+
}), y = (e) => ({
|
|
15
15
|
type: t.Error,
|
|
16
16
|
errorType: n.LoadFailed,
|
|
17
17
|
url: e
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
let t =
|
|
18
|
+
}), b = new h({ max: 10 }), x = new h({ max: 50 }), S = () => {
|
|
19
|
+
b.clear(), x.clear();
|
|
20
|
+
}, C = (e) => {
|
|
21
|
+
let t = b.get(e);
|
|
22
22
|
return t ?? (t = fetch(e).then((e) => {
|
|
23
23
|
if (!e.ok) throw Object.assign(/* @__PURE__ */ Error(`HTTP ${e.status}`), { status: e.status });
|
|
24
24
|
return e.blob();
|
|
25
25
|
}).catch((t) => {
|
|
26
|
-
throw
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
let t =
|
|
26
|
+
throw b.delete(e), t;
|
|
27
|
+
}), b.set(e, t)), t;
|
|
28
|
+
}, w = (e) => {
|
|
29
|
+
let t = x.get(e);
|
|
30
30
|
return t ?? (t = fetch(e).then((e) => {
|
|
31
31
|
if (!e.ok) throw Object.assign(/* @__PURE__ */ Error(`HTTP ${e.status}`), { status: e.status });
|
|
32
32
|
return e.text();
|
|
33
33
|
}).catch((t) => {
|
|
34
|
-
throw
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
34
|
+
throw x.delete(e), t;
|
|
35
|
+
}), x.set(e, t)), t;
|
|
36
|
+
}, T = async (e, t) => {
|
|
37
37
|
if ("file" in e) return URL.createObjectURL(e.file);
|
|
38
38
|
let n = t.resolveDialUrl(e);
|
|
39
39
|
if (n != null) try {
|
|
40
|
-
let e = await
|
|
40
|
+
let e = await C(n);
|
|
41
41
|
return URL.createObjectURL(e);
|
|
42
42
|
} catch (e) {
|
|
43
43
|
let t = e.status;
|
|
44
|
-
return t == null ?
|
|
44
|
+
return t == null ? y(n) : v(t, n);
|
|
45
45
|
}
|
|
46
46
|
if (e.previewUrl != null) return e.previewUrl;
|
|
47
|
-
if (e.data != null) return
|
|
48
|
-
},
|
|
49
|
-
if (e.data != null) return
|
|
47
|
+
if (e.data != null) return g(e.data, e.contentType);
|
|
48
|
+
}, E = async (e, t) => {
|
|
49
|
+
if (e.data != null) return _(e.data);
|
|
50
50
|
let n = t.resolveDialUrl(e);
|
|
51
51
|
if (n != null) try {
|
|
52
|
-
return await
|
|
52
|
+
return await w(n);
|
|
53
53
|
} catch (e) {
|
|
54
54
|
let t = e.status;
|
|
55
|
-
return t == null ?
|
|
55
|
+
return t == null ? y(n) : v(t, n);
|
|
56
56
|
}
|
|
57
57
|
if ("file" in e) return e.file.text();
|
|
58
|
-
},
|
|
58
|
+
}, D = (e, t) => e.data != null || t.resolveDialUrl(e) != null || "file" in e, O = (e, n) => {
|
|
59
59
|
if ("file" in e) return {
|
|
60
60
|
type: t.Image,
|
|
61
61
|
url: URL.createObjectURL(e.file)
|
|
@@ -63,7 +63,7 @@ var d = (e, t) => URL.createObjectURL(i(e, t)), f = (e) => {
|
|
|
63
63
|
let r = n.resolveDialUrl(e);
|
|
64
64
|
return r == null ? e.previewUrl == null ? e.data == null ? null : {
|
|
65
65
|
type: t.Image,
|
|
66
|
-
url:
|
|
66
|
+
url: g(e.data, e.contentType)
|
|
67
67
|
} : {
|
|
68
68
|
type: t.Image,
|
|
69
69
|
url: e.previewUrl
|
|
@@ -71,51 +71,101 @@ var d = (e, t) => URL.createObjectURL(i(e, t)), f = (e) => {
|
|
|
71
71
|
type: t.Image,
|
|
72
72
|
url: r
|
|
73
73
|
};
|
|
74
|
-
},
|
|
75
|
-
let r = await
|
|
74
|
+
}, k = async (e, n) => {
|
|
75
|
+
let r = await E(e, n);
|
|
76
76
|
return r == null ? null : typeof r == "string" ? {
|
|
77
77
|
type: t.PlainText,
|
|
78
78
|
text: r
|
|
79
79
|
} : r;
|
|
80
|
-
},
|
|
81
|
-
let r = await
|
|
80
|
+
}, A = async (e, n) => {
|
|
81
|
+
let r = await E(e, n);
|
|
82
82
|
return r == null ? null : typeof r == "string" ? {
|
|
83
83
|
type: t.Markdown,
|
|
84
84
|
text: r
|
|
85
85
|
} : r;
|
|
86
|
-
},
|
|
87
|
-
let i = await
|
|
86
|
+
}, j = 1048576, M = async (e, n, r) => {
|
|
87
|
+
let i = await E(e, n);
|
|
88
88
|
return i == null ? null : typeof i == "string" ? {
|
|
89
89
|
type: t.Code,
|
|
90
90
|
text: i,
|
|
91
91
|
language: r
|
|
92
92
|
} : i;
|
|
93
|
-
},
|
|
94
|
-
let r = await
|
|
93
|
+
}, N = async (e, n) => {
|
|
94
|
+
let r = await E(e, n);
|
|
95
95
|
if (r == null) return null;
|
|
96
96
|
if (typeof r != "string") return r;
|
|
97
|
-
if (r.length >
|
|
97
|
+
if (r.length > j) return null;
|
|
98
98
|
let i = n.resolveDialUrl(e) ?? void 0;
|
|
99
99
|
return {
|
|
100
100
|
type: t.Html,
|
|
101
101
|
srcdoc: r,
|
|
102
102
|
url: i
|
|
103
103
|
};
|
|
104
|
-
},
|
|
105
|
-
let
|
|
106
|
-
if (
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
109
|
-
let
|
|
104
|
+
}, P = (n, r, i) => {
|
|
105
|
+
let a = n.body?.source?.attachment;
|
|
106
|
+
if (a?.type !== o.PDF) return null;
|
|
107
|
+
let s = e(a.url) ? i.resolveDialFileDownloadUrl(a.url) : a.url;
|
|
108
|
+
if (s == null) return null;
|
|
109
|
+
let c = (r.find((e) => e.annotations.includes(n))?.annotations ?? [n]).filter((e) => e.body?.source?.attachment?.url === a.url), u = c.indexOf(n), f = d(c), m = l(n, u);
|
|
110
110
|
return {
|
|
111
111
|
type: t.Pdf,
|
|
112
|
-
url:
|
|
113
|
-
highlights:
|
|
114
|
-
selectedHighlightId:
|
|
115
|
-
page:
|
|
112
|
+
url: s,
|
|
113
|
+
highlights: f,
|
|
114
|
+
selectedHighlightId: f.some((e) => e.id === m) ? m : void 0,
|
|
115
|
+
page: p(n)
|
|
116
116
|
};
|
|
117
|
-
},
|
|
118
|
-
|
|
117
|
+
}, F = (e) => {
|
|
118
|
+
switch (e.type) {
|
|
119
|
+
case "docx_text_range": return {
|
|
120
|
+
kind: i.DocxTextRange,
|
|
121
|
+
story: e.story,
|
|
122
|
+
path: e.path,
|
|
123
|
+
start: e.start,
|
|
124
|
+
endExclusive: e.endExclusive,
|
|
125
|
+
text: e.text
|
|
126
|
+
};
|
|
127
|
+
case "pptx_text_range": return {
|
|
128
|
+
kind: i.PptxTextRange,
|
|
129
|
+
slide: e.slide,
|
|
130
|
+
shapeId: e.shapeId,
|
|
131
|
+
start: e.start,
|
|
132
|
+
endExclusive: e.endExclusive,
|
|
133
|
+
text: e.text
|
|
134
|
+
};
|
|
135
|
+
case "excel_rc_range": return {
|
|
136
|
+
kind: i.XlsxCellRange,
|
|
137
|
+
sheet: e.sheet,
|
|
138
|
+
start: e.start,
|
|
139
|
+
end: e.end
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}, I = (n, i, o) => {
|
|
143
|
+
let s = n.body?.source?.attachment;
|
|
144
|
+
if (s?.url == null) return null;
|
|
145
|
+
let c = a(s.title ?? s.url, s.type);
|
|
146
|
+
if (c !== r.Docx && c !== r.Xlsx && c !== r.Pptx) return null;
|
|
147
|
+
let d = e(s.url) ? o.resolveDialFileDownloadUrl(s.url) : s.url;
|
|
148
|
+
if (d == null) return null;
|
|
149
|
+
let p = f(n, i), m = [], h;
|
|
150
|
+
return p.forEach((e, t) => {
|
|
151
|
+
let r = u(e);
|
|
152
|
+
if (r.length === 0) return;
|
|
153
|
+
let i = l(e, t);
|
|
154
|
+
m.push({
|
|
155
|
+
id: i,
|
|
156
|
+
locations: r.map(F)
|
|
157
|
+
}), e === n && (h = i);
|
|
158
|
+
}), {
|
|
159
|
+
type: t.Ooxml,
|
|
160
|
+
url: d,
|
|
161
|
+
format: c,
|
|
162
|
+
...m.length > 0 ? {
|
|
163
|
+
highlights: m,
|
|
164
|
+
selectedHighlightId: h
|
|
165
|
+
} : {}
|
|
166
|
+
};
|
|
167
|
+
}, L = (n, r) => {
|
|
168
|
+
let i = m(n.url);
|
|
119
169
|
if (i == null) return null;
|
|
120
170
|
let a = e(i.baseUrl) ? r.resolveDialFileDownloadUrl(i.baseUrl) : i.baseUrl;
|
|
121
171
|
if (a == null) return null;
|
|
@@ -144,39 +194,39 @@ var d = (e, t) => URL.createObjectURL(i(e, t)), f = (e) => {
|
|
|
144
194
|
selectedHighlightId: o,
|
|
145
195
|
page: i.page
|
|
146
196
|
};
|
|
147
|
-
},
|
|
197
|
+
}, R = (e) => {
|
|
148
198
|
try {
|
|
149
199
|
let t = new URL(e).protocol;
|
|
150
200
|
return t === "http:" || t === "https:" || t === "blob:";
|
|
151
201
|
} catch {
|
|
152
202
|
return !1;
|
|
153
203
|
}
|
|
154
|
-
},
|
|
155
|
-
let r = await
|
|
204
|
+
}, z = (t) => t.url != null && !e(t.url) && R(t.url) ? t.url : void 0, B = async (e, n) => {
|
|
205
|
+
let r = await T(e, n);
|
|
156
206
|
if (r != null) return typeof r == "string" ? {
|
|
157
207
|
type: t.Pdf,
|
|
158
208
|
url: r
|
|
159
209
|
} : r;
|
|
160
|
-
let i =
|
|
210
|
+
let i = z(e);
|
|
161
211
|
return i == null ? null : {
|
|
162
212
|
type: t.Pdf,
|
|
163
213
|
url: i
|
|
164
214
|
};
|
|
165
|
-
},
|
|
166
|
-
let i = await
|
|
215
|
+
}, V = async (e, n, r) => {
|
|
216
|
+
let i = await T(e, n);
|
|
167
217
|
if (i != null) return typeof i == "string" ? {
|
|
168
218
|
type: t.Ooxml,
|
|
169
219
|
url: i,
|
|
170
220
|
format: r
|
|
171
221
|
} : i;
|
|
172
|
-
let a =
|
|
222
|
+
let a = z(e);
|
|
173
223
|
return a == null ? null : {
|
|
174
224
|
type: t.Ooxml,
|
|
175
225
|
url: a,
|
|
176
226
|
format: r
|
|
177
227
|
};
|
|
178
|
-
},
|
|
179
|
-
let r = await
|
|
228
|
+
}, H = async (e, n) => {
|
|
229
|
+
let r = await E(e, n);
|
|
180
230
|
if (r == null) return null;
|
|
181
231
|
if (typeof r != "string") return r;
|
|
182
232
|
try {
|
|
@@ -191,8 +241,8 @@ var d = (e, t) => URL.createObjectURL(i(e, t)), f = (e) => {
|
|
|
191
241
|
text: r
|
|
192
242
|
};
|
|
193
243
|
}
|
|
194
|
-
},
|
|
195
|
-
let a = await
|
|
244
|
+
}, U = async (e, n, r, i) => {
|
|
245
|
+
let a = await E(e, n);
|
|
196
246
|
if (a == null || typeof a != "string") return null;
|
|
197
247
|
let o = {};
|
|
198
248
|
try {
|
|
@@ -215,4 +265,4 @@ var d = (e, t) => URL.createObjectURL(i(e, t)), f = (e) => {
|
|
|
215
265
|
};
|
|
216
266
|
};
|
|
217
267
|
//#endregion
|
|
218
|
-
export {
|
|
268
|
+
export { I as annotationToOoxmlCanvasContent, P as annotationToPdfCanvasContent, S as clearAttachmentCache, D as hasAttachmentTextSource, L as referenceAttachmentToPdfCanvasContent, M as resolveCodeCanvasContent, N as resolveHtmlCanvasContent, O as resolveImageCanvasContent, H as resolveJsonCanvasContent, A as resolveMarkdownCanvasContent, V as resolveOoxmlCanvasContent, B as resolvePdfCanvasContent, k as resolveTextCanvasContent, U as resolveVisualizerCanvasContent };
|
|
@@ -4,7 +4,10 @@ import { DialFilePermission as t, FileManagerColumnKey as n } from "@epam/ai-dia
|
|
|
4
4
|
var r = 3, i = e, a = /[/\\]/, o = {
|
|
5
5
|
year: "numeric",
|
|
6
6
|
month: "short",
|
|
7
|
-
day: "2-digit"
|
|
7
|
+
day: "2-digit",
|
|
8
|
+
hour: "2-digit",
|
|
9
|
+
minute: "2-digit",
|
|
10
|
+
hour12: !1
|
|
8
11
|
}, s = [
|
|
9
12
|
n.Name,
|
|
10
13
|
n.UpdatedAt,
|
package/index.d.ts
CHANGED
|
@@ -188,6 +188,16 @@ export declare interface AgentSpecification {
|
|
|
188
188
|
/** Maps an annotation's source attachment to the display-only attachment model. */
|
|
189
189
|
export declare const annotationToDisplayAttachment: (annotation: Annotation) => DisplayAttachment | null;
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Builds an `OoxmlCanvasContent` for a DOCX/PPTX/XLSX citation annotation,
|
|
193
|
+
* including highlights for every annotation sharing the clicked one's source
|
|
194
|
+
* document. Returns `null` when the annotation has no source attachment,
|
|
195
|
+
* the source is not a format `@silurus/ooxml` renders as DOCX/XLSX/PPTX (a
|
|
196
|
+
* CSV source returns `null` — citation highlighting targets Office documents
|
|
197
|
+
* only), or no URL resolves.
|
|
198
|
+
*/
|
|
199
|
+
export declare const annotationToOoxmlCanvasContent: (annotation: Annotation, annotations: Annotation[], resolvers: AttachmentCanvasUrlResolvers) => OoxmlCanvasContent | null;
|
|
200
|
+
|
|
191
201
|
/**
|
|
192
202
|
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
193
203
|
* for the clicked annotation's document within its citation group.
|
|
@@ -1827,6 +1837,13 @@ export declare const includesIgnoreCase: (str: string, query: string) => boolean
|
|
|
1827
1837
|
*/
|
|
1828
1838
|
export declare const initiateOAuthLogin: (auth: ToolsetOAuthSettings, toolsetId: string, callbackPath: string, credentialsLevel?: ToolsetCredentialsLevel, offlineUsageConsent?: boolean) => ToolsetOAuthInitiationResult;
|
|
1829
1839
|
|
|
1840
|
+
/**
|
|
1841
|
+
* Whether the assistant answer that follows an edited user message is missing
|
|
1842
|
+
* or incomplete: no message at all, a non-assistant message, an answer the
|
|
1843
|
+
* user stopped, or one that ended with a stream error.
|
|
1844
|
+
*/
|
|
1845
|
+
export declare const isAnswerIncomplete: (answer: Message | undefined) => boolean;
|
|
1846
|
+
|
|
1830
1847
|
/**
|
|
1831
1848
|
* True when the conversation's last message is an unresolved assistant
|
|
1832
1849
|
* placeholder: the backend only persists a conversation at generation start
|
|
@@ -2424,6 +2441,34 @@ declare interface OoxmlCanvasContent {
|
|
|
2424
2441
|
url: string;
|
|
2425
2442
|
/** The document format used to select and configure the format-specific renderer. */
|
|
2426
2443
|
format: OoxmlFileType;
|
|
2444
|
+
/** Cited locations to draw over the document. Omitted, never `[]`, when there is nothing to highlight. */
|
|
2445
|
+
highlights?: OoxmlHighlight[];
|
|
2446
|
+
/** Id of the highlight to navigate to and emphasise. Omitted when the clicked citation resolved to no location. */
|
|
2447
|
+
selectedHighlightId?: string;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
/** A 1-based cell address, matching `@silurus/ooxml`'s own `CellAddress`. */
|
|
2451
|
+
declare interface OoxmlCellAddress {
|
|
2452
|
+
/** 1-based row number. */
|
|
2453
|
+
row: number;
|
|
2454
|
+
/** 1-based column number. */
|
|
2455
|
+
col: number;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
/** A cited character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
2459
|
+
declare interface OoxmlDocxHighlightLocation {
|
|
2460
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
2461
|
+
kind: OoxmlHighlightKind.DocxTextRange;
|
|
2462
|
+
/** Name of the DOCX story the range lives in, as an opaque string (only `'body'` is confirmed upstream). */
|
|
2463
|
+
story: string;
|
|
2464
|
+
/** Source-tree element indices identifying the paragraph, matched element-wise. */
|
|
2465
|
+
path: number[];
|
|
2466
|
+
/** Inclusive start character offset within the story's matched text. */
|
|
2467
|
+
start: number;
|
|
2468
|
+
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
2469
|
+
endExclusive: number;
|
|
2470
|
+
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
2471
|
+
text: string;
|
|
2427
2472
|
}
|
|
2428
2473
|
|
|
2429
2474
|
/** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
|
|
@@ -2434,6 +2479,58 @@ declare enum OoxmlFileType {
|
|
|
2434
2479
|
Csv = 'csv',
|
|
2435
2480
|
}
|
|
2436
2481
|
|
|
2482
|
+
/** One citation's highlight: the locations it resolved to, under a stable id. */
|
|
2483
|
+
declare interface OoxmlHighlight {
|
|
2484
|
+
/** Stable id, used to mark exactly one highlight selected. */
|
|
2485
|
+
id: string;
|
|
2486
|
+
/** One or more locations — a single citation may carry several selectors. */
|
|
2487
|
+
locations: OoxmlHighlightLocation[];
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
/** Discriminates the Office highlight location descriptors an `OoxmlCanvasContent` can carry. */
|
|
2491
|
+
declare enum OoxmlHighlightKind {
|
|
2492
|
+
/** A character range inside a DOCX story, addressed by story name and source-tree path. */
|
|
2493
|
+
DocxTextRange = 'docxTextRange',
|
|
2494
|
+
/** A character range inside a single PPTX shape on one slide. */
|
|
2495
|
+
PptxTextRange = 'pptxTextRange',
|
|
2496
|
+
/** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
|
|
2497
|
+
XlsxCellRange = 'xlsxCellRange',
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
/** A cited location inside an Office document, in document coordinates. */
|
|
2501
|
+
declare type OoxmlHighlightLocation =
|
|
2502
|
+
| OoxmlDocxHighlightLocation
|
|
2503
|
+
| OoxmlPptxHighlightLocation
|
|
2504
|
+
| OoxmlXlsxHighlightLocation;
|
|
2505
|
+
|
|
2506
|
+
/** A cited character range inside a single shape on one PPTX slide. */
|
|
2507
|
+
declare interface OoxmlPptxHighlightLocation {
|
|
2508
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
2509
|
+
kind: OoxmlHighlightKind.PptxTextRange;
|
|
2510
|
+
/** 1-based slide number. */
|
|
2511
|
+
slide: number;
|
|
2512
|
+
/** Shape identifier, compared as a string against the run's own `shapeId`. */
|
|
2513
|
+
shapeId: string;
|
|
2514
|
+
/** Inclusive start character offset within the shape's matched text. */
|
|
2515
|
+
start: number;
|
|
2516
|
+
/** Exclusive end character offset, already converted from the wire's inclusive `end`. */
|
|
2517
|
+
endExclusive: number;
|
|
2518
|
+
/** The cited text, compared against the text resolved over `[start, endExclusive)`. */
|
|
2519
|
+
text: string;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
/** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
|
|
2523
|
+
declare interface OoxmlXlsxHighlightLocation {
|
|
2524
|
+
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
2525
|
+
kind: OoxmlHighlightKind.XlsxCellRange;
|
|
2526
|
+
/** Sheet name, matched exactly against the workbook's own sheet names. */
|
|
2527
|
+
sheet: string;
|
|
2528
|
+
/** First cell of the range. 1-based, passed to the viewer unconverted. */
|
|
2529
|
+
start: OoxmlCellAddress;
|
|
2530
|
+
/** Last cell of the range, on the same row as `start`. Omitted for a single cell. */
|
|
2531
|
+
end?: OoxmlCellAddress;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2437
2534
|
/**
|
|
2438
2535
|
* Opens a cited/referenced attachment: triggers a browser download for
|
|
2439
2536
|
* DIAL-hosted files (`files/...` ids) via the injected `resolveDownloadUrl`,
|
|
@@ -2927,6 +3024,16 @@ export declare interface SharedRootMeta {
|
|
|
2927
3024
|
dialCorePath: string;
|
|
2928
3025
|
}
|
|
2929
3026
|
|
|
3027
|
+
/**
|
|
3028
|
+
* Whether submitting an edit has to re-run the generation.
|
|
3029
|
+
*
|
|
3030
|
+
* True whenever the message itself changed, and also when it is unchanged but
|
|
3031
|
+
* its answer never completed — after stopping a generation the user submits
|
|
3032
|
+
* the same message precisely to get a full answer, so treating that as "no
|
|
3033
|
+
* change" would leave the conversation stuck with the partial one.
|
|
3034
|
+
*/
|
|
3035
|
+
export declare const shouldRerunGenerationOnEdit: (messages: Message[], messageIndex: number, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
|
|
3036
|
+
|
|
2930
3037
|
/** True when the first user/assistant exchange is complete and LLM naming may still run. */
|
|
2931
3038
|
export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
|
|
2932
3039
|
|
|
@@ -3756,7 +3863,7 @@ export declare interface UseAttachmentValidationResult {
|
|
|
3756
3863
|
* item through the endpoint its type owns and refetching/notifying on
|
|
3757
3864
|
* completion, and building the Create dropdown's options.
|
|
3758
3865
|
*/
|
|
3759
|
-
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, quickAppSchemaId, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify,
|
|
3866
|
+
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, quickAppSchemaId, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify, onSkillUploadClick, }: UseCatalogEditNavigationParams) => UseCatalogEditNavigationResult;
|
|
3760
3867
|
|
|
3761
3868
|
/** Parameters accepted by {@link useCatalogEditNavigation}. */
|
|
3762
3869
|
export declare interface UseCatalogEditNavigationParams {
|
|
@@ -3790,8 +3897,8 @@ export declare interface UseCatalogEditNavigationParams {
|
|
|
3790
3897
|
labels: CatalogEditNavigationLabels;
|
|
3791
3898
|
/** Called to surface a host notification when a delete fails. */
|
|
3792
3899
|
onNotify: (notification: CatalogEditNavigationNotification) => void;
|
|
3793
|
-
/**
|
|
3794
|
-
|
|
3900
|
+
/** Called when the Create menu's Skill → Upload option is picked. */
|
|
3901
|
+
onSkillUploadClick: () => void;
|
|
3795
3902
|
}
|
|
3796
3903
|
|
|
3797
3904
|
/** Return value of {@link useCatalogEditNavigation}. */
|
package/index.js
CHANGED
|
@@ -82,55 +82,55 @@ import { useTranscribeAudio as Vn } from "./conversation/useTranscribeAudio/useT
|
|
|
82
82
|
import { DEFAULT_MAX_ARCHIVE_BYTES as Hn, useConversationExport as Un } from "./conversation/useConversationExport/useConversationExport.js";
|
|
83
83
|
import { attachmentToDto as Wn, attachmentsToDtos as Gn } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
84
84
|
import { createMessagePair as Kn } from "./conversation/useConversationHandlers/message-factory.js";
|
|
85
|
-
import { hasActiveToolConfig as qn,
|
|
86
|
-
import { getStarterConversationText as
|
|
87
|
-
import { getConversationPath as
|
|
88
|
-
import { useConversationHandlers as
|
|
89
|
-
import { useConversationImport as
|
|
90
|
-
import { useConversationScroll as
|
|
91
|
-
import { isAwaitingGenerationResume as
|
|
92
|
-
import { useConversationStream as
|
|
93
|
-
import { useConversationSources as
|
|
94
|
-
import { DialFilesApiUploadMode as
|
|
95
|
-
import { FileManagerNotificationReason as
|
|
96
|
-
import { COLUMNS_WITHOUT_AUTHOR as
|
|
97
|
-
import { DialFileManagerActionProfile as
|
|
98
|
-
import { buildSharedItemVirtualPath as
|
|
99
|
-
import { getParentFolderPath as
|
|
100
|
-
import { prepareCopyItems as
|
|
101
|
-
import { buildFromCache as
|
|
102
|
-
import { createFilesApiClient as
|
|
103
|
-
import { createUploadFileWithProgress as
|
|
104
|
-
import { openAnnotationAttachment as
|
|
105
|
-
import { annotationToPdfCanvasContent as
|
|
106
|
-
import { getUrlFileName as
|
|
107
|
-
import { annotationToDisplayAttachment as
|
|
108
|
-
import { dialFileToAttachment as
|
|
109
|
-
import { DownloadDestinationType as
|
|
110
|
-
import { prepareDownloadDestination as
|
|
111
|
-
import { sanitizeFileName as
|
|
112
|
-
import { useDialFileListing as
|
|
113
|
-
import { useDialFileMetadata as
|
|
114
|
-
import { useDialFileMutations as
|
|
115
|
-
import { useDialFileSharing as
|
|
116
|
-
import { useDialFileUploadBatch as
|
|
117
|
-
import { useDialFileManager as
|
|
118
|
-
import { useDialFileManagerTabConfig as
|
|
119
|
-
import { isCustomAppSchema as
|
|
120
|
-
import { getBrowserTimezone as
|
|
121
|
-
import { isValidAbsoluteUrl as
|
|
122
|
-
import { buildExternalServiceScopeId as
|
|
123
|
-
import { useChatSettingsFormConfig as
|
|
124
|
-
import { usePageFileDrag as
|
|
125
|
-
import { useViewportWidth as
|
|
126
|
-
import { usePanelMaxWidth as
|
|
127
|
-
import { useShareLink as
|
|
128
|
-
import { useToolsMenu as
|
|
129
|
-
import { useUsageData as
|
|
130
|
-
import { McpAppResourceFetchError as
|
|
131
|
-
import { useMcpAppTools as
|
|
132
|
-
import { useMcpAppHostContext as
|
|
133
|
-
import { useMcpAppHostAdapter as
|
|
134
|
-
import { useOpenMcpAppCanvas as
|
|
135
|
-
import { useGridEditingScroll as
|
|
136
|
-
export { b as AttachmentValidationErrorReason, zn as AudioTranscriptionError, Bn as AudioTranscriptionErrorReason, L as AuthenticationType,
|
|
85
|
+
import { hasActiveToolConfig as qn, isAnswerIncomplete as Jn, isMessageChanged as Yn, shouldRerunGenerationOnEdit as Xn } from "./conversation/useConversationHandlers/message-utils.js";
|
|
86
|
+
import { getStarterConversationText as Zn, getStarterSubmitText as Qn } from "./conversation/useConversationHandlers/starter-option.js";
|
|
87
|
+
import { getConversationPath as $n } from "./conversation/useConversationStream/conversation-path.js";
|
|
88
|
+
import { useConversationHandlers as er } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
89
|
+
import { useConversationImport as tr } from "./conversation/useConversationImport/useConversationImport.js";
|
|
90
|
+
import { useConversationScroll as nr } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
91
|
+
import { isAwaitingGenerationResume as rr } from "./conversation/useConversationStream/generation-resume.js";
|
|
92
|
+
import { useConversationStream as ir } from "./conversation/useConversationStream/useConversationStream.js";
|
|
93
|
+
import { useConversationSources as ar } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
|
94
|
+
import { DialFilesApiUploadMode as or } from "./files/dial-files-api.js";
|
|
95
|
+
import { FileManagerNotificationReason as sr, FileNameValidationErrorReason as cr, FileOperationKind as lr } from "./files/dial-file-manager.types.js";
|
|
96
|
+
import { COLUMNS_WITHOUT_AUTHOR as ur, COLUMNS_WITH_AUTHOR as dr, CORE_PERMISSION_MAP as fr, DATE_OPTIONS as pr, PATH_SEPARATOR_REGEXP as mr, RESERVED_MARKER_NAME as hr, UPLOAD_CONCURRENCY as gr } from "./files/dial-file-manager.model.js";
|
|
97
|
+
import { DialFileManagerActionProfile as _r, DialFileManagerVariant as vr, deriveActionProfile as yr } from "./files/file-manager-variant.js";
|
|
98
|
+
import { buildSharedItemVirtualPath as br, dialCorePathToRelative as xr, findDialFileByPath as Sr, findFolderByVirtualPath as Cr, formatOperationFolderName as wr, getVirtualPathName as Tr, hasDialFileWritePermission as Er, hasForbiddenNameSymbols as Dr, isCopyMoveDuplicateAllowed as Or, isShareActionsAllowed as kr, normalizeVirtualPath as Ar, parseNewFolderVirtualPath as jr, resolveOwnerCoords as Mr } from "./files/dial-file-manager-path.util.js";
|
|
99
|
+
import { getParentFolderPath as Nr, resolveDialFileApiPath as Pr, virtualPathToApiPath as Fr } from "./files/resolve-dial-file-api-path.js";
|
|
100
|
+
import { prepareCopyItems as Ir, prepareMoveRenameItems as Lr } from "./files/dial-file-manager-copy-move.util.js";
|
|
101
|
+
import { buildFromCache as Rr, fetchByTab as zr, fetchForSearch as Br, findFirstSuccessfulCopyMoveItem as Vr, mapCorePermissions as Hr, mapFileMetadataToDialFile as Ur, mapSearchItem as Wr, mergeCreatedFolderIntoCache as Gr, updateEntry as Kr } from "./files/dial-file-manager-mapping.util.js";
|
|
102
|
+
import { createFilesApiClient as qr } from "./files/create-files-api.js";
|
|
103
|
+
import { createUploadFileWithProgress as Jr } from "./files/create-upload-file-with-progress.js";
|
|
104
|
+
import { openAnnotationAttachment as Yr } from "./files/annotation.js";
|
|
105
|
+
import { annotationToOoxmlCanvasContent as Xr, annotationToPdfCanvasContent as Zr, clearAttachmentCache as Qr, hasAttachmentTextSource as $r, referenceAttachmentToPdfCanvasContent as ei, resolveCodeCanvasContent as ti, resolveHtmlCanvasContent as ni, resolveImageCanvasContent as ri, resolveJsonCanvasContent as ii, resolveMarkdownCanvasContent as ai, resolveOoxmlCanvasContent as oi, resolvePdfCanvasContent as si, resolveTextCanvasContent as ci, resolveVisualizerCanvasContent as li } from "./files/attachment-canvas.js";
|
|
106
|
+
import { getUrlFileName as ui, isExternalSourcePreviewable as di, resolveExternalSourceContentType as fi } from "./files/source-content.js";
|
|
107
|
+
import { annotationToDisplayAttachment as pi, attachmentDtoToDisplayAttachment as mi, attachmentDtosToDisplayAttachments as hi } from "./files/attachment-dto-to-display.js";
|
|
108
|
+
import { dialFileToAttachment as gi, dialFilesToAttachments as _i, dialFolderPathToAttachment as vi } from "./files/dial-file-to-attachment.js";
|
|
109
|
+
import { DownloadDestinationType as yi } from "./files/download-destination.js";
|
|
110
|
+
import { prepareDownloadDestination as bi } from "./files/prepare-download-destination.js";
|
|
111
|
+
import { sanitizeFileName as xi, splitFileNameExtension as Si, trimFileNameToByteLimit as Ci } from "./files/file-name.js";
|
|
112
|
+
import { useDialFileListing as wi } from "./files/useDialFileListing/useDialFileListing.js";
|
|
113
|
+
import { useDialFileMetadata as Ti } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
114
|
+
import { useDialFileMutations as Ei } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
115
|
+
import { useDialFileSharing as Di } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
116
|
+
import { useDialFileUploadBatch as Oi } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
117
|
+
import { useDialFileManager as ki } from "./files/useDialFileManager/useDialFileManager.js";
|
|
118
|
+
import { useDialFileManagerTabConfig as Ai } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
119
|
+
import { isCustomAppSchema as ji, isQuickAppSchema as Mi } from "./shared/application-schema.js";
|
|
120
|
+
import { getBrowserTimezone as Ni } from "./shared/browser-timezone.js";
|
|
121
|
+
import { isValidAbsoluteUrl as Pi, isValidFeaturesData as Fi, parseFeaturesData as Ii } from "./shared/custom-apps.js";
|
|
122
|
+
import { buildExternalServiceScopeId as Li, getExternalServiceFallbackName as Ri, parseExternalServiceUrl as zi } from "./shared/external-services.js";
|
|
123
|
+
import { useChatSettingsFormConfig as Bi } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
124
|
+
import { usePageFileDrag as Vi } from "./usePageFileDrag/usePageFileDrag.js";
|
|
125
|
+
import { useViewportWidth as Hi } from "./useViewportWidth/useViewportWidth.js";
|
|
126
|
+
import { usePanelMaxWidth as Ui } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
127
|
+
import { useShareLink as Wi } from "./useShareLink/useShareLink.js";
|
|
128
|
+
import { useToolsMenu as Gi } from "./useToolsMenu/useToolsMenu.js";
|
|
129
|
+
import { useUsageData as Ki } from "./usage/useUsageData/useUsageData.js";
|
|
130
|
+
import { McpAppResourceFetchError as qi, createMcpAppsApiClient as Ji } from "./mcp-apps/mcp-apps-api-client.js";
|
|
131
|
+
import { useMcpAppTools as Yi } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
132
|
+
import { useMcpAppHostContext as Xi } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
133
|
+
import { useMcpAppHostAdapter as Zi } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
134
|
+
import { useOpenMcpAppCanvas as Qi } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
135
|
+
import { useGridEditingScroll as $i } from "@epam/ai-dial-chat-shared";
|
|
136
|
+
export { b as AttachmentValidationErrorReason, zn as AudioTranscriptionError, Bn as AudioTranscriptionErrorReason, L as AuthenticationType, ur as COLUMNS_WITHOUT_AUTHOR, dr as COLUMNS_WITH_AUTHOR, fr as CORE_PERMISSION_MAP, Ze as CatalogPrimaryActionType, w as ConversationExportMode, T as ConversationTransferErrorCode, E as ConversationTransferWarningCode, pr as DATE_OPTIONS, Hn as DEFAULT_MAX_ARCHIVE_BYTES, _r as DialFileManagerActionProfile, vr as DialFileManagerVariant, or as DialFilesApiUploadMode, yi as DownloadDestinationType, O as EXPORT_APP_NAME, D as ExportFileNameKind, Ot as FavoriteEntityType, sr as FileManagerNotificationReason, cr as FileNameValidationErrorReason, lr as FileOperationKind, qi as McpAppResourceFetchError, Ie as McpResourceKind, it as OAuthResourceKind, mr as PATH_SEPARATOR_REGEXP, nn as PROMPT_CONTENT_MAX_LENGTH, rn as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, an as PROMPT_DESCRIPTION_MAX_LENGTH, on as PROMPT_NAME_MAX_LENGTH, Ce as PUBLIC_SKILL_BUCKET, sn as PromptFieldError, ie as PromptSource, hr as RESERVED_MARKER_NAME, kn 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, Sn as SkillEditorLoadState, En 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, gr as UPLOAD_CONCURRENCY, mn as UnsupportedTriggerReason, mt as WithLogin, pi as annotationToDisplayAttachment, Xr as annotationToOoxmlCanvasContent, Zr as annotationToPdfCanvasContent, hn as apSchedulerDayToJsDay, U as appendLocaleCode, mi as attachmentDtoToDisplayAttachment, hi as attachmentDtosToDisplayAttachments, Wn as attachmentToDto, Gn as attachmentsToDtos, W as buildAdditionalLocaleOptions, jt as buildAnnouncementSignature, Le as buildApplicationMcpUrl, M as buildChatCompletionsUrl, Re as buildConnectApi, N as buildDeploymentConnectApi, Li as buildExternalServiceScopeId, Rr as buildFromCache, $t as buildPromptExportEnvelope, en as buildPromptExportFileName, oe as buildPromptOverview, cn as buildPromptPath, P as buildResponsesUrl, br 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, Qr as clearAttachmentCache, G as composeLocalePayload, It as createChatStreamApi, i as createCsrfMiddleware, Ht as createDeploymentChangedMessage, qr as createFilesApiClient, Ji as createMcpAppsApiClient, Kn as createMessagePair, A as createPublishApiClient, a as createUnauthorizedMiddleware, Jr as createUploadFileWithProgress, B as decodeToolsetId, K as decomposeLocalizedFields, yr as deriveActionProfile, Ke as deriveAvailableTabIds, jn as deriveConversationRowActionState, qe as deriveFavoriteItems, xr as dialCorePathToRelative, gi as dialFileToAttachment, _i as dialFilesToAttachments, vi as dialFolderPathToAttachment, p as downloadAttachment, ht as emitToolsetLoginSuccess, F as encodeDeploymentId, V as encodeToolsetId, zr as fetchByTab, Br as fetchForSearch, tt as fetchSkillDescription, Je as filterCatalogItemsBySelector, Ye as filterHiddenOwnedItems, I as findDeploymentByIdOrReference, Sr as findDialFileByPath, Vr as findFirstSuccessfulCopyMoveItem, Cr as findFolderByVirtualPath, Rt as formatAppVersion, Y as formatCalendarDate, S as formatDateYM, C as formatDateYMD, wr as formatOperationFolderName, k as formatQuotedNameList, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Ni as getBrowserTimezone, $n as getConversationPath, Fn as getConversationSource, Ri as getExternalServiceFallbackName, Ut as getLastDeploymentId, Wt as getLastUserMessageToolConfiguration, Bt as getModelIdFromConversationId, Nr as getParentFolderPath, Ve as getPublicCatalogEntityFolderPath, Yt as getQuickAppConversationStarters, ln as getRemainingCharacters, Zn as getStarterConversationText, Xt as getStarterPopulateText, Qn as getStarterSubmitText, Zt as getStartersFromSchema, Vt as getTimeOfDayGreeting, _t as getToolsetOAuthChannelName, bt as getToolsetRedirectUri, ui as getUrlFileName, Tr as getVirtualPathName, qn as hasActiveToolConfig, Mt as hasAnnouncementContent, $r as hasAttachmentTextSource, Er as hasDialFileWritePermission, Dr as hasForbiddenNameSymbols, Nt as hasStructuredAnnouncement, o as includesIgnoreCase, xt as initiateOAuthLogin, Jn as isAnswerIncomplete, rr as isAwaitingGenerationResume, r as isConversationNotFoundError, Or as isCopyMoveDuplicateAllowed, ji as isCustomAppSchema, g as isDialFileAcceptType, u as isDialFileId, m as isDownloadableAttachment, di as isExternalSourcePreviewable, Yn as isMessageChanged, Gt as isMessageStreaming, se as isOrganisationPromptItem, He as isPublicCatalogEntityId, H as isPublicToolsetId, Mi as isQuickAppSchema, kr as isShareActionsAllowed, Pi as isValidAbsoluteUrl, Fi as isValidFeaturesData, _e as isValidSkillRelativePath, gn as jsDayToApSchedulerDay, Hr as mapCorePermissions, Z as mapDeploymentDetailsDtoToEntityDetails, R as mapDeploymentLimitsDtoToCatalogLimits, z as mapDeploymentLimitsToInput, ee as mapDeploymentToCatalogItem, te as mapDeploymentToolsetCredentials, Q as mapEntityDetailsToCatalogDetails, Ur as mapFileMetadataToDialFile, _n as mapFormValuesToCreateBody, vn as mapFormValuesToUpdateBody, ce as mapPromptToCatalogItem, Ue as mapPublishConversationResultDto, We as mapPublishHistoryEntryDto, yn as mapScheduledTaskDtoToFormValues, Wr as mapSearchItem, je as mapSkillToCatalogItem, $ as mapToolsetCredentials, ne as mapToolsetToCatalogItem, Gr as mergeCreatedFolderIntoCache, Kt as messageHasStages, _ as mimeTypesToAttachmentExtensionLabels, v as mimeTypesToDialFileAcceptTypes, y as mimeTypesToFileAccept, ve as nameFromPath, St as navigateToolsetOAuthPopup, qt as normalizeResponseFormat, ye as normalizeSkillName, Ar as normalizeVirtualPath, Yr as openAnnotationAttachment, Ct as openToolsetOAuthPopup, X as padTwoDigits, zi as parseExternalServiceUrl, Ii as parseFeaturesData, jr as parseNewFolderVirtualPath, ae as parsePromptResourceUrl, be as parseSkillManifest, et as parseSkillManifestDocument, Oe as parseSkillResourceUrl, Ir as prepareCopyItems, bi as prepareDownloadDestination, Lr as prepareMoveRenameItems, Me as readSkillFileBytes, Ne as readSkillManifest, Xe as reconcileFilterTopics, ei as referenceAttachmentToPdfCanvasContent, Qe as resolveCatalogPrimaryAction, ti as resolveCodeCanvasContent, re as resolveDeploymentFolder, Pr as resolveDialFileApiPath, d as resolveDialFileBucketAndPath, fi as resolveExternalSourceContentType, ni as resolveHtmlCanvasContent, ri as resolveImageCanvasContent, ii as resolveJsonCanvasContent, q as resolveLocalizedText, ai as resolveMarkdownCanvasContent, Be as resolveMcpResourceKind, oi as resolveOoxmlCanvasContent, Mr as resolveOwnerCoords, si as resolvePdfCanvasContent, f as resolveRelativeDialFilePath, Pe as resolveSkillFileDownloadPath, Fe as resolveSkillManifestFileId, ci as resolveTextCanvasContent, li as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, Pt as sanitizeAnnouncementHtml, Ft as sanitizeAnnouncementMessageHtml, xi as sanitizeFileName, zt as sanitizeFooterHtml, tn as serializePromptExport, Xn as shouldRerunGenerationOnEdit, Lt as shouldWatchForDisplayNameUpdate, xe as skillFileBytesToBlob, xn as skillFileToAttachment, Si as splitFileNameExtension, l as stripSurroundingSlashes, gt as subscribeToolsetLoginSuccess, J as toBaseLocale, Jt as toOverlayMessages, Ge as toPublishEntityType, j as toPublishRuleDto, Ci as trimFileNameToByteLimit, Se as unpackSkillArchive, Kr as updateEntry, Mn as useActiveConversationSync, Nn as useAsyncConfirmDialog, h as useAttachmentAction, Rn as useAttachmentUpload, x as useAttachmentValidation, $e as useCatalogEditNavigation, rt as useCatalogItemDetails, Et as useCatalogToolsetCredentials, Bi as useChatSettingsFormConfig, Un as useConversationExport, er as useConversationHandlers, tr as useConversationImport, Pn as useConversationLookupMaps, In as useConversationPanelItems, nr as useConversationScroll, ar as useConversationSources, ir as useConversationStream, wi as useDialFileListing, ki as useDialFileManager, Ai as useDialFileManagerTabConfig, Ti as useDialFileMetadata, Ei as useDialFileMutations, Di as useDialFileSharing, Oi as useDialFileUploadBatch, kt as useFavoriteEntitiesState, $i as useGridEditingScroll, Ln as useImportFilePicker, Zi as useMcpAppHostAdapter, Xi as useMcpAppHostContext, Yi as useMcpAppTools, Qt as useOAuthCallbackCompletion, Qi as useOpenMcpAppCanvas, Vi as usePageFileDrag, Ui as usePanelMaxWidth, pn as usePromptsState, At as usePublishFolders, Wi as useShareLink, An as useShareRecipientsCount, Dt as useSkillDetailsPanelData, Cn as useSkillEditorLoad, wn as useSkillEditorSubmit, Tn as useSkillFileActions, Dn as useSkillFilePreview, nt as useSkillItemDetails, On as useSkillsState, Gi as useToolsMenu, Tt as useToolsetLogin, Vn as useTranscribeAudio, Ki as useUsageData, Hi as useViewportWidth, un as validatePromptContent, dn as validatePromptDescription, fn as validatePromptName, bn as validateSkillFileBatch, Fr as virtualPathToApiPath, vt 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.
|
|
4
|
+
"version": "1.1.0-dev.435",
|
|
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.
|
|
108
|
-
"@epam/ai-dial-attachment-input": "1.1.0-dev.
|
|
109
|
-
"@epam/ai-dial-catalog": "1.1.0-dev.
|
|
110
|
-
"@epam/ai-dial-chat-api-client": "1.1.0-dev.
|
|
111
|
-
"@epam/ai-dial-chat-overlay": "1.1.0-dev.
|
|
112
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
113
|
-
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.
|
|
114
|
-
"@epam/ai-dial-mcp-apps": "1.1.0-dev.
|
|
115
|
-
"@epam/ai-dial-publish-panel": "1.1.0-dev.
|
|
116
|
-
"@epam/ai-dial-quotations": "1.1.0-dev.
|
|
107
|
+
"@epam/ai-dial-attachment-canvas": "1.1.0-dev.435",
|
|
108
|
+
"@epam/ai-dial-attachment-input": "1.1.0-dev.435",
|
|
109
|
+
"@epam/ai-dial-catalog": "1.1.0-dev.435",
|
|
110
|
+
"@epam/ai-dial-chat-api-client": "1.1.0-dev.435",
|
|
111
|
+
"@epam/ai-dial-chat-overlay": "1.1.0-dev.435",
|
|
112
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.435",
|
|
113
|
+
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.435",
|
|
114
|
+
"@epam/ai-dial-mcp-apps": "1.1.0-dev.435",
|
|
115
|
+
"@epam/ai-dial-publish-panel": "1.1.0-dev.435",
|
|
116
|
+
"@epam/ai-dial-quotations": "1.1.0-dev.435",
|
|
117
117
|
"@epam/ai-dial-react-file-manager": "*",
|
|
118
|
-
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.
|
|
119
|
-
"@epam/ai-dial-share": "1.1.0-dev.
|
|
120
|
-
"@epam/ai-dial-skill-editor": "1.1.0-dev.
|
|
121
|
-
"@epam/ai-dial-source-panel": "1.1.0-dev.
|
|
118
|
+
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.435",
|
|
119
|
+
"@epam/ai-dial-share": "1.1.0-dev.435",
|
|
120
|
+
"@epam/ai-dial-skill-editor": "1.1.0-dev.435",
|
|
121
|
+
"@epam/ai-dial-source-panel": "1.1.0-dev.435",
|
|
122
122
|
"@epam/ai-dial-ui-kit": "*",
|
|
123
123
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
124
124
|
"@epam/pdf-highlighter-kit": ">=0.0.14",
|