@epam/ai-dial-chat-hooks 1.2.0-dev.148 → 1.2.0-dev.152
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.
|
@@ -4,7 +4,7 @@ import { getModelIdFromConversationId as n } from "../get-model-id-from-conversa
|
|
|
4
4
|
import { FilterTab as r } from "@epam/ai-dial-chat-shared";
|
|
5
5
|
import { useMemo as i } from "react";
|
|
6
6
|
//#region src/conversation/useConversationPanelItems/useConversationPanelItems.ts
|
|
7
|
-
var a = (e) => e.sharedWithMe ? r.Shared : e.publishedWithMe ? r.Organization : r.MyChats, o = ({ items: r, deployments: o, isDeploymentsLoading: s, toPanelConversationId: c, resolveIconUrl: l, resolveIconTooltip: u, resolveHref: d,
|
|
7
|
+
var a = (e) => e.sharedWithMe ? r.Shared : e.publishedWithMe ? r.Organization : r.MyChats, o = ({ items: r, deployments: o, isDeploymentsLoading: s, toPanelConversationId: c, resolveIconUrl: l, resolveIconTooltip: u, resolveHref: d, resolveTaskPresentation: f }) => i(() => r.map((r) => {
|
|
8
8
|
let i = c(r.id), p = n(r.id), m = p ? t(o, p) : void 0, h = p ? e(p.split("/").pop() ?? p) : "", g = f?.(r);
|
|
9
9
|
return {
|
|
10
10
|
id: i,
|
|
@@ -16,8 +16,7 @@ var a = (e) => e.sharedWithMe ? r.Shared : e.publishedWithMe ? r.Organization :
|
|
|
16
16
|
source: a(r),
|
|
17
17
|
href: d(i),
|
|
18
18
|
...g == null ? {} : {
|
|
19
|
-
|
|
20
|
-
taskBadgeLabel: g.label,
|
|
19
|
+
leadingIcon: g.leadingIcon,
|
|
21
20
|
isUnread: g.isUnread
|
|
22
21
|
}
|
|
23
22
|
};
|
package/conversation.d.ts
CHANGED
|
@@ -1006,9 +1006,8 @@ export declare interface UseConversationLookupMapsParams {
|
|
|
1006
1006
|
* panel's item contract. All app-specific concerns (icon URL resolution,
|
|
1007
1007
|
* route generation, id normalisation) are injected via resolver callbacks.
|
|
1008
1008
|
*/
|
|
1009
|
-
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref,
|
|
1010
|
-
|
|
1011
|
-
taskBadgeLabel?: string | undefined;
|
|
1009
|
+
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskPresentation, }: UseConversationPanelItemsParams) => {
|
|
1010
|
+
leadingIcon?: ReactNode;
|
|
1012
1011
|
isUnread?: boolean | undefined;
|
|
1013
1012
|
id: string;
|
|
1014
1013
|
title: string;
|
|
@@ -1044,11 +1043,12 @@ export declare interface UseConversationPanelItemsResolvers {
|
|
|
1044
1043
|
/** Resolves the href to navigate to when the conversation row is clicked. */
|
|
1045
1044
|
resolveHref: (panelConversationId: string) => string;
|
|
1046
1045
|
/**
|
|
1047
|
-
* Returns
|
|
1048
|
-
*
|
|
1046
|
+
* Returns the row presentation for a scheduled-task conversation — a
|
|
1047
|
+
* host-rendered leading icon that replaces the deployment avatar, and the
|
|
1048
|
+
* unread flag — or `undefined` for an ordinary conversation.
|
|
1049
1049
|
*/
|
|
1050
|
-
|
|
1051
|
-
|
|
1050
|
+
resolveTaskPresentation?: (item: ConversationListItemDto) => {
|
|
1051
|
+
leadingIcon?: ReactNode;
|
|
1052
1052
|
isUnread: boolean;
|
|
1053
1053
|
} | undefined;
|
|
1054
1054
|
}
|
package/index.d.ts
CHANGED
|
@@ -4900,9 +4900,8 @@ export declare interface UseConversationLookupMapsParams {
|
|
|
4900
4900
|
* panel's item contract. All app-specific concerns (icon URL resolution,
|
|
4901
4901
|
* route generation, id normalisation) are injected via resolver callbacks.
|
|
4902
4902
|
*/
|
|
4903
|
-
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref,
|
|
4904
|
-
|
|
4905
|
-
taskBadgeLabel?: string | undefined;
|
|
4903
|
+
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskPresentation, }: UseConversationPanelItemsParams) => {
|
|
4904
|
+
leadingIcon?: ReactNode;
|
|
4906
4905
|
isUnread?: boolean | undefined;
|
|
4907
4906
|
id: string;
|
|
4908
4907
|
title: string;
|
|
@@ -4938,11 +4937,12 @@ export declare interface UseConversationPanelItemsResolvers {
|
|
|
4938
4937
|
/** Resolves the href to navigate to when the conversation row is clicked. */
|
|
4939
4938
|
resolveHref: (panelConversationId: string) => string;
|
|
4940
4939
|
/**
|
|
4941
|
-
* Returns
|
|
4942
|
-
*
|
|
4940
|
+
* Returns the row presentation for a scheduled-task conversation — a
|
|
4941
|
+
* host-rendered leading icon that replaces the deployment avatar, and the
|
|
4942
|
+
* unread flag — or `undefined` for an ordinary conversation.
|
|
4943
4943
|
*/
|
|
4944
|
-
|
|
4945
|
-
|
|
4944
|
+
resolveTaskPresentation?: (item: ConversationListItemDto) => {
|
|
4945
|
+
leadingIcon?: ReactNode;
|
|
4946
4946
|
isUnread: boolean;
|
|
4947
4947
|
} | undefined;
|
|
4948
4948
|
}
|
|
@@ -6079,7 +6079,7 @@ export declare interface UseSkillEditorLoadResult {
|
|
|
6079
6079
|
* `client.createSkill`/`client.updateSkill`, and mapping the resulting
|
|
6080
6080
|
* success/error/conflict outcomes to presentable state.
|
|
6081
6081
|
*/
|
|
6082
|
-
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
6082
|
+
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, getCreateReturnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
6083
6083
|
|
|
6084
6084
|
/** Parameters accepted by {@link useSkillEditorSubmit}. */
|
|
6085
6085
|
export declare interface UseSkillEditorSubmitParams {
|
|
@@ -6099,6 +6099,8 @@ export declare interface UseSkillEditorSubmitParams {
|
|
|
6099
6099
|
etagRef: React.MutableRefObject<string | undefined>;
|
|
6100
6100
|
/** Where to navigate on a successful save. */
|
|
6101
6101
|
returnUrl: string;
|
|
6102
|
+
/** Resolves the destination after creation from the normalized skill path. Defaults to `returnUrl`. */
|
|
6103
|
+
getCreateReturnUrl?: (path: string) => string;
|
|
6102
6104
|
/** Refetches the host's skill listing after a successful save. */
|
|
6103
6105
|
refetchSkills: () => Promise<void>;
|
|
6104
6106
|
/** Already-configured create/update operations. */
|
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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.152",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@epam/ai-dial-chat-api-client": "1.2.0-dev.
|
|
114
|
+
"@epam/ai-dial-chat-api-client": "1.2.0-dev.152",
|
|
115
115
|
"dompurify": "3.4.15",
|
|
116
116
|
"fflate": "^0.8.3",
|
|
117
117
|
"lru-cache": "^10.4.3",
|
|
@@ -120,22 +120,22 @@
|
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"react": "^19.2.8",
|
|
123
|
-
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.
|
|
124
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
125
|
-
"@epam/ai-dial-builder-form": "1.2.0-dev.
|
|
126
|
-
"@epam/ai-dial-catalog": "1.2.0-dev.
|
|
127
|
-
"@epam/ai-dial-chat-overlay": "1.2.0-dev.
|
|
128
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
129
|
-
"@epam/ai-dial-mcp-apps": "1.2.0-dev.
|
|
130
|
-
"@epam/ai-dial-publish-panel": "1.2.0-dev.
|
|
131
|
-
"@epam/ai-dial-quotations": "1.2.0-dev.
|
|
132
|
-
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.
|
|
133
|
-
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.
|
|
134
|
-
"@epam/ai-dial-share": "1.2.0-dev.
|
|
135
|
-
"@epam/ai-dial-skill-editor": "1.2.0-dev.
|
|
136
|
-
"@epam/ai-dial-source-panel": "1.2.0-dev.
|
|
137
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
138
|
-
"@epam/ai-dial-usage-dashboard": "1.2.0-dev.
|
|
123
|
+
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.152",
|
|
124
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.152",
|
|
125
|
+
"@epam/ai-dial-builder-form": "1.2.0-dev.152",
|
|
126
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.152",
|
|
127
|
+
"@epam/ai-dial-chat-overlay": "1.2.0-dev.152",
|
|
128
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.152",
|
|
129
|
+
"@epam/ai-dial-mcp-apps": "1.2.0-dev.152",
|
|
130
|
+
"@epam/ai-dial-publish-panel": "1.2.0-dev.152",
|
|
131
|
+
"@epam/ai-dial-quotations": "1.2.0-dev.152",
|
|
132
|
+
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.7",
|
|
133
|
+
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.152",
|
|
134
|
+
"@epam/ai-dial-share": "1.2.0-dev.152",
|
|
135
|
+
"@epam/ai-dial-skill-editor": "1.2.0-dev.152",
|
|
136
|
+
"@epam/ai-dial-source-panel": "1.2.0-dev.152",
|
|
137
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.19",
|
|
138
|
+
"@epam/ai-dial-usage-dashboard": "1.2.0-dev.152",
|
|
139
139
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
140
140
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
141
141
|
"@mcp-ui/client": "^7.1.1"
|
|
@@ -6,43 +6,43 @@ import { NotificationVariant as u } from "@epam/ai-dial-ui-kit";
|
|
|
6
6
|
var d = (e, t) => JSON.stringify({
|
|
7
7
|
values: e,
|
|
8
8
|
files: [...t].sort((e, t) => e.path.localeCompare(t.path))
|
|
9
|
-
}), f = ({ bucket: f, isEditMode: p, files: m, filesContentRef: h, frontmatterRef: g, loadedPathRef: _, etagRef: v, returnUrl: y,
|
|
10
|
-
let [
|
|
9
|
+
}), f = ({ bucket: f, isEditMode: p, files: m, filesContentRef: h, frontmatterRef: g, loadedPathRef: _, etagRef: v, returnUrl: y, getCreateReturnUrl: b, refetchSkills: x, client: S, messages: C, onNavigate: w, onNotify: T }) => {
|
|
10
|
+
let [E, D] = l({}), [O, k] = l(), [A, j] = l(!1), [M, N] = l(), [P, F] = l("idle"), I = c(null), L = c(null), R = s(async (n) => {
|
|
11
11
|
switch (t(n)) {
|
|
12
12
|
case 409:
|
|
13
|
-
|
|
13
|
+
D({ name: C.nameConflict });
|
|
14
14
|
return;
|
|
15
15
|
case 412:
|
|
16
|
-
|
|
16
|
+
D({ name: C.nameConflict });
|
|
17
17
|
return;
|
|
18
18
|
case 413:
|
|
19
|
-
|
|
19
|
+
k(C.archiveTooLarge);
|
|
20
20
|
return;
|
|
21
21
|
case 503:
|
|
22
|
-
|
|
22
|
+
k(C.serviceUnavailable), j(!0);
|
|
23
23
|
return;
|
|
24
24
|
case 400: {
|
|
25
25
|
let { message: t } = await e(n);
|
|
26
|
-
|
|
26
|
+
k(t ?? C.pathInvalid);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
default: {
|
|
30
30
|
let { traceId: t } = await e(n);
|
|
31
|
-
|
|
31
|
+
k(C.saveError), T({
|
|
32
32
|
variant: u.Error,
|
|
33
|
-
message:
|
|
33
|
+
message: C.saveError,
|
|
34
34
|
requestId: t
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}, [
|
|
38
|
+
}, [C, T]), z = s(async (e) => {
|
|
39
39
|
let t = a(e.name);
|
|
40
40
|
if (!t || !i(t)) {
|
|
41
|
-
|
|
41
|
+
D({ name: C.nameInvalid });
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
let o = d(e, m), s =
|
|
45
|
-
c ? {skillManifest: p, filePaths: _, files: v} = s : (p = r(g.current, t, e.description, e.instructions), {filePaths: _, files: v} = n(m, h.current)),
|
|
44
|
+
let o = d(e, m), s = I.current, c = s != null && s.fingerprint === o, l = t, p, _, v;
|
|
45
|
+
c ? {skillManifest: p, filePaths: _, files: v} = s : (p = r(g.current, t, e.description, e.instructions), {filePaths: _, files: v} = n(m, h.current)), F("submitting"), I.current = {
|
|
46
46
|
fingerprint: o,
|
|
47
47
|
bucket: f,
|
|
48
48
|
path: l,
|
|
@@ -51,46 +51,47 @@ var d = (e, t) => JSON.stringify({
|
|
|
51
51
|
files: v
|
|
52
52
|
};
|
|
53
53
|
try {
|
|
54
|
-
await
|
|
54
|
+
await S.createSkill(f, l, p, _, v), await x(), F("success"), T({
|
|
55
55
|
variant: u.Success,
|
|
56
|
-
title:
|
|
57
|
-
message:
|
|
58
|
-
}),
|
|
56
|
+
title: C.saveSuccessTitle,
|
|
57
|
+
message: C.createSuccess(t)
|
|
58
|
+
}), w(b?.(l) ?? y);
|
|
59
59
|
} catch (e) {
|
|
60
|
-
|
|
60
|
+
F("failure"), await R(e);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
63
|
f,
|
|
64
64
|
m,
|
|
65
65
|
h,
|
|
66
66
|
g,
|
|
67
|
+
C,
|
|
67
68
|
S,
|
|
68
|
-
|
|
69
|
+
T,
|
|
69
70
|
w,
|
|
70
|
-
C,
|
|
71
71
|
y,
|
|
72
72
|
b,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
x,
|
|
74
|
+
R
|
|
75
|
+
]), B = s(async (e) => {
|
|
75
76
|
let i = _.current, a = v.current;
|
|
76
77
|
if (!i || !a) {
|
|
77
|
-
|
|
78
|
+
k(C.saveError);
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
let o = r(g.current, e.name, e.description, e.instructions), { filePaths: s, files: c } = n(m, h.current);
|
|
81
|
-
|
|
82
|
+
F("submitting");
|
|
82
83
|
try {
|
|
83
|
-
v.current = (await
|
|
84
|
+
v.current = (await S.updateSkill(f, i, o, s, c, a)).etag ?? a, await x(), F("success"), T({
|
|
84
85
|
variant: u.Success,
|
|
85
|
-
title:
|
|
86
|
-
message:
|
|
87
|
-
}),
|
|
86
|
+
title: C.updateSuccessTitle,
|
|
87
|
+
message: C.updateSuccess(e.name)
|
|
88
|
+
}), w(y);
|
|
88
89
|
} catch (e) {
|
|
89
|
-
if (
|
|
90
|
-
|
|
90
|
+
if (F("failure"), t(e) === 412) {
|
|
91
|
+
N({ message: C.conflictMessage });
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
await
|
|
94
|
+
await R(e);
|
|
94
95
|
}
|
|
95
96
|
}, [
|
|
96
97
|
f,
|
|
@@ -99,53 +100,53 @@ var d = (e, t) => JSON.stringify({
|
|
|
99
100
|
g,
|
|
100
101
|
_,
|
|
101
102
|
v,
|
|
103
|
+
C,
|
|
102
104
|
S,
|
|
103
|
-
|
|
105
|
+
T,
|
|
104
106
|
w,
|
|
105
|
-
C,
|
|
106
107
|
y,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
]),
|
|
108
|
+
x,
|
|
109
|
+
R
|
|
110
|
+
]), V = s((e) => {
|
|
110
111
|
let t = o(e.instructions);
|
|
111
|
-
|
|
112
|
-
if (t === (e.instructions ===
|
|
112
|
+
D((e) => {
|
|
113
|
+
if (t === (e.instructions === C.instructionsFrontmatter)) return e;
|
|
113
114
|
if (t) return {
|
|
114
115
|
...e,
|
|
115
|
-
instructions:
|
|
116
|
+
instructions: C.instructionsFrontmatter
|
|
116
117
|
};
|
|
117
118
|
let n = { ...e };
|
|
118
119
|
return delete n.instructions, n;
|
|
119
120
|
});
|
|
120
|
-
}, [
|
|
121
|
-
if (
|
|
121
|
+
}, [C]), H = s(async (e) => {
|
|
122
|
+
if (P === "submitting" || !f) return;
|
|
122
123
|
let t = {};
|
|
123
|
-
if (e.name.trim() || (t.name =
|
|
124
|
-
|
|
124
|
+
if (e.name.trim() || (t.name = C.required), e.description.trim() || (t.description = C.required), e.instructions.trim() ? o(e.instructions) && (t.instructions = C.instructionsFrontmatter) : t.instructions = C.required, Object.keys(t).length > 0) {
|
|
125
|
+
D(t);
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
+
D({}), k(void 0), j(!1), N(void 0), L.current = e, p ? await B(e) : await z(e);
|
|
128
129
|
}, [
|
|
129
|
-
|
|
130
|
+
P,
|
|
130
131
|
f,
|
|
131
|
-
|
|
132
|
+
C,
|
|
132
133
|
p,
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
B,
|
|
135
|
+
z
|
|
135
136
|
]);
|
|
136
137
|
return {
|
|
137
|
-
phase:
|
|
138
|
-
errors:
|
|
139
|
-
submitError:
|
|
140
|
-
isSubmitErrorRetryable:
|
|
138
|
+
phase: P,
|
|
139
|
+
errors: E,
|
|
140
|
+
submitError: O,
|
|
141
|
+
isSubmitErrorRetryable: A,
|
|
141
142
|
retrySubmit: s(() => {
|
|
142
|
-
let e =
|
|
143
|
-
e != null &&
|
|
144
|
-
}, [
|
|
145
|
-
conflict:
|
|
146
|
-
clearConflict: () =>
|
|
147
|
-
handleSubmit:
|
|
148
|
-
handleValuesChange:
|
|
143
|
+
let e = L.current;
|
|
144
|
+
e != null && H(e);
|
|
145
|
+
}, [H]),
|
|
146
|
+
conflict: M,
|
|
147
|
+
clearConflict: () => N(void 0),
|
|
148
|
+
handleSubmit: H,
|
|
149
|
+
handleValuesChange: V
|
|
149
150
|
};
|
|
150
151
|
};
|
|
151
152
|
//#endregion
|
package/skill-editor.d.ts
CHANGED
|
@@ -494,7 +494,7 @@ export declare interface UseSkillEditorLoadResult {
|
|
|
494
494
|
* `client.createSkill`/`client.updateSkill`, and mapping the resulting
|
|
495
495
|
* success/error/conflict outcomes to presentable state.
|
|
496
496
|
*/
|
|
497
|
-
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
497
|
+
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, getCreateReturnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
498
498
|
|
|
499
499
|
/** Parameters accepted by {@link useSkillEditorSubmit}. */
|
|
500
500
|
export declare interface UseSkillEditorSubmitParams {
|
|
@@ -514,6 +514,8 @@ export declare interface UseSkillEditorSubmitParams {
|
|
|
514
514
|
etagRef: React.MutableRefObject<string | undefined>;
|
|
515
515
|
/** Where to navigate on a successful save. */
|
|
516
516
|
returnUrl: string;
|
|
517
|
+
/** Resolves the destination after creation from the normalized skill path. Defaults to `returnUrl`. */
|
|
518
|
+
getCreateReturnUrl?: (path: string) => string;
|
|
517
519
|
/** Refetches the host's skill listing after a successful save. */
|
|
518
520
|
refetchSkills: () => Promise<void>;
|
|
519
521
|
/** Already-configured create/update operations. */
|