@epam/ai-dial-chat-hooks 1.3.0-dev.296 → 1.3.0-dev.305
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/application-credentials.d.ts.map +1 -1
- package/catalog/application-credentials.js +20 -25
- package/catalog/use-publish-history.d.ts +19 -0
- package/catalog/use-publish-history.d.ts.map +1 -0
- package/catalog/use-publish-history.js +25 -0
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.d.ts.map +1 -1
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +72 -77
- package/catalog.js +19 -18
- package/conversation/conversation-data-source.d.ts +47 -0
- package/conversation/conversation-data-source.d.ts.map +1 -0
- package/conversation/conversation-data-source.js +11 -0
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationExport/useConversationExport.js +76 -84
- package/conversation/useConversationScroll/useConversationScroll.d.ts.map +1 -1
- package/conversation/useConversationScroll/useConversationScroll.js +64 -63
- package/conversation.js +33 -32
- package/entry-points/catalog.d.ts +1 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/conversation.d.ts +1 -0
- package/entry-points/conversation.d.ts.map +1 -1
- package/entry-points/project.d.ts +5 -0
- package/entry-points/project.d.ts.map +1 -1
- package/external-services/useExternalServiceLogin.d.ts +3 -13
- package/external-services/useExternalServiceLogin.d.ts.map +1 -1
- package/external-services/useExternalServiceLogin.js +49 -58
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -1
- package/index.js +189 -182
- package/mcp-apps/useMcpAppTools/useMcpAppTools.d.ts.map +1 -1
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +42 -39
- package/oauth/authorize-url.d.ts +7 -1
- package/oauth/authorize-url.d.ts.map +1 -1
- package/oauth/authorize-url.js +13 -3
- package/oauth/models.d.ts +25 -0
- package/oauth/models.d.ts.map +1 -1
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -1
- package/oauth/useToolsetLogin/useToolsetLogin.js +45 -56
- package/oauth.js +7 -7
- package/package.json +17 -17
- package/project/create-project-chat.d.ts +34 -0
- package/project/create-project-chat.d.ts.map +1 -0
- package/project/create-project-chat.js +27 -0
- package/project/project-conversation-data-source.d.ts +36 -0
- package/project/project-conversation-data-source.d.ts.map +1 -0
- package/project/project-conversation-data-source.js +67 -0
- package/project/project-file-preview.d.ts +28 -0
- package/project/project-file-preview.d.ts.map +1 -0
- package/project/project-file-preview.js +20 -0
- package/project/use-project-draft.d.ts +46 -0
- package/project/use-project-draft.d.ts.map +1 -0
- package/project/use-project-draft.js +54 -0
- package/project/use-project-file-preview.d.ts +42 -0
- package/project/use-project-file-preview.d.ts.map +1 -0
- package/project/use-project-file-preview.js +46 -0
- package/project.js +15 -10
- package/shared/sleep.d.ts +3 -0
- package/shared/sleep.d.ts.map +1 -0
- package/shared/sleep.js +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-credentials.d.ts","sourceRoot":"","sources":["../../src/catalog/application-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"application-credentials.d.ts","sourceRoot":"","sources":["../../src/catalog/application-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,8CAA8C,CAAC;AAGtD,2DAA2D;AAC3D,MAAM,WAAW,gCAAgC;IAC/C,oGAAoG;IACpG,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,GACpC,UAAU,SAAS,6BAA6B,EAAE,EAClD,wCAAwC,gCAAgC,KACvE,qBAAqB,EA8BpB,CAAC;AAEL,gHAAgH;AAChH,eAAO,MAAM,qCAAqC,GAChD,OAAO,MAAM,EACb,SAAS,6BAA6B,EACtC,QAAQ,gCAAgC,KACvC,0BASD,CAAC"}
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toToolsetOAuthSettings as e } from "../oauth/authorize-url.js";
|
|
2
|
+
import { ExternalServiceAuthStatus as t, ExternalServiceAuthType as n, ExternalServiceCredentialsLevel as r } from "../external-services/useExternalServiceLogin.js";
|
|
3
|
+
import { CredentialStatus as i, ToolsetAuthenticationType as a } from "@epam/ai-dial-catalog";
|
|
3
4
|
//#region src/catalog/application-credentials.ts
|
|
4
|
-
var
|
|
5
|
-
let s =
|
|
5
|
+
var o = (e, { isOfflineConnected: r, dialNativeHint: o }) => e.map((e) => {
|
|
6
|
+
let s = e.authenticationType === n.DialNative, c = s ? r && e.appLevelAuthStatus === t.SignedIn : e.userLevelAuthStatus === t.SignedIn;
|
|
6
7
|
return {
|
|
7
|
-
id:
|
|
8
|
-
name:
|
|
9
|
-
description:
|
|
10
|
-
authenticationType:
|
|
11
|
-
status: c ?
|
|
12
|
-
hasSharedCredentials: !s && !c && (
|
|
8
|
+
id: e.id,
|
|
9
|
+
name: e.displayName || e.id,
|
|
10
|
+
description: e.description,
|
|
11
|
+
authenticationType: e.authenticationType === n.ApiKey ? a.ApiKey : a.OAuth,
|
|
12
|
+
status: c ? i.SignedIn : i.SignedOut,
|
|
13
|
+
hasSharedCredentials: !s && !c && (e.globalAuthStatus === t.SignedIn || e.appLevelAuthStatus === t.SignedIn),
|
|
13
14
|
canLogout: !s,
|
|
14
15
|
canConsentToOfflineUsage: !s,
|
|
15
16
|
hint: s ? o : void 0
|
|
16
17
|
};
|
|
17
|
-
}),
|
|
18
|
-
appId:
|
|
19
|
-
serviceId:
|
|
20
|
-
...
|
|
21
|
-
credentialsLevel:
|
|
22
|
-
authenticationType:
|
|
23
|
-
oauthSettings:
|
|
24
|
-
|
|
25
|
-
authorizationEndpoint: r.authorizationEndpoint,
|
|
26
|
-
scopes: r.scopesSupported,
|
|
27
|
-
codeChallenge: r.codeChallenge,
|
|
28
|
-
codeChallengeMethod: r.codeChallengeMethod
|
|
29
|
-
},
|
|
30
|
-
forceStale: r.userLevelAuthStatus === e.Failed
|
|
18
|
+
}), s = (n, i, a) => ({
|
|
19
|
+
appId: n,
|
|
20
|
+
serviceId: i.id,
|
|
21
|
+
...a,
|
|
22
|
+
credentialsLevel: r.User,
|
|
23
|
+
authenticationType: i.authenticationType,
|
|
24
|
+
oauthSettings: e(i),
|
|
25
|
+
forceStale: i.userLevelAuthStatus === t.Failed
|
|
31
26
|
});
|
|
32
27
|
//#endregion
|
|
33
|
-
export {
|
|
28
|
+
export { s as buildApplicationCredentialLoginParams, o as mapApplicationCredentials };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
2
|
+
/** Host inputs of {@link usePublishHistory}. */
|
|
3
|
+
export interface UsePublishHistoryOptions {
|
|
4
|
+
/** Whether the publish panel is open; the history is read each time it opens. */
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/** Id of the entity being published; a change reads its history again. */
|
|
7
|
+
entityId: string;
|
|
8
|
+
/** Reads the entity's publication history, already mapped to the panel's entries; the host owns the request. */
|
|
9
|
+
loadHistory: (entityId: string) => Promise<PublishHistoryEntry[]>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the publication history of an entity for a publish panel, read again
|
|
13
|
+
* on every open so a publication requested since the last one already blocks its
|
|
14
|
+
* folder. A failed read leaves the history empty (the backend still refuses a
|
|
15
|
+
* duplicate publication), a read that finishes after the panel closed or the
|
|
16
|
+
* entity changed is ignored, and another entity's history is never returned.
|
|
17
|
+
*/
|
|
18
|
+
export declare const usePublishHistory: ({ isOpen, entityId, loadHistory, }: UsePublishHistoryOptions) => PublishHistoryEntry[];
|
|
19
|
+
//# sourceMappingURL=use-publish-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-publish-history.d.ts","sourceRoot":"","sources":["../../src/catalog/use-publish-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAKvE,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,gHAAgH;IAChH,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CACnE;AASD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,oCAI/B,wBAAwB,KAAG,mBAAmB,EA2BhD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
//#region src/catalog/use-publish-history.ts
|
|
3
|
+
var r = [], i = ({ isOpen: i, entityId: a, loadHistory: o }) => {
|
|
4
|
+
let [s, c] = n(), l = t(o);
|
|
5
|
+
return e(() => {
|
|
6
|
+
l.current = o;
|
|
7
|
+
}, [o]), e(() => {
|
|
8
|
+
if (!i) return;
|
|
9
|
+
let e = !1;
|
|
10
|
+
return (async () => {
|
|
11
|
+
let t = r;
|
|
12
|
+
try {
|
|
13
|
+
t = await l.current(a);
|
|
14
|
+
} catch {}
|
|
15
|
+
e || c({
|
|
16
|
+
entityId: a,
|
|
17
|
+
entries: t
|
|
18
|
+
});
|
|
19
|
+
})(), () => {
|
|
20
|
+
e = !0;
|
|
21
|
+
};
|
|
22
|
+
}, [i, a]), s?.entityId === a ? s.entries : r;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as usePublishHistory };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCatalogToolsetCredentials.d.ts","sourceRoot":"","sources":["../../../src/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useCatalogToolsetCredentials.d.ts","sourceRoot":"","sources":["../../../src/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { getApiErrorDetails as e } from "../../api-error/api-error.js";
|
|
2
2
|
import { ToolsetAuthTypes as t, ToolsetCredentialsLevel as n } from "../../oauth/types.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { toToolsetOAuthSettings as r } from "../../oauth/authorize-url.js";
|
|
4
|
+
import { ToolsetLoginOutcomeType as i, useToolsetLogin as a } from "../../oauth/useToolsetLogin/useToolsetLogin.js";
|
|
5
|
+
import { useCallback as o } from "react";
|
|
6
|
+
import { NotificationVariant as s } from "@epam/ai-dial-ui-kit";
|
|
7
|
+
import { CredentialStatus as c, CredentialsLevel as l, ToolsetAuthenticationType as u } from "@epam/ai-dial-catalog";
|
|
7
8
|
//#region src/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.ts
|
|
8
|
-
var
|
|
9
|
+
var d = (e, t, n) => e === l.User ? n.user : t ? n.org : n.global, f = (e) => {
|
|
9
10
|
switch (e) {
|
|
10
|
-
case
|
|
11
|
-
case
|
|
12
|
-
case
|
|
11
|
+
case u.ApiKey: return t.ApiKey;
|
|
12
|
+
case u.OAuth: return t.OAuth;
|
|
13
|
+
case u.None:
|
|
13
14
|
case void 0: return t.None;
|
|
14
15
|
}
|
|
15
|
-
},
|
|
16
|
-
let
|
|
16
|
+
}, p = ({ isAdmin: t, toolsets: p, refetchToolsets: m, callbackPath: h, loginToolset: g, logoutToolset: _, getToolset: v, labels: y, onNotify: b }) => {
|
|
17
|
+
let x = o((e, t) => t === l.User ? e.credentials?.userStatus : e.credentials?.globalStatus, []), S = o((e, n) => {
|
|
17
18
|
let r = t && !!e.credentials?.isPublic;
|
|
18
|
-
if (e.credentials?.authenticationType ===
|
|
19
|
-
let t =
|
|
20
|
-
|
|
21
|
-
variant:
|
|
22
|
-
title:
|
|
19
|
+
if (e.credentials?.authenticationType === u.ApiKey) {
|
|
20
|
+
let t = d(n, r, y.apiKeyAddedSuccess);
|
|
21
|
+
b({
|
|
22
|
+
variant: s.Success,
|
|
23
|
+
title: y.apiKeyAddedSuccessTitle,
|
|
23
24
|
message: t({
|
|
24
25
|
name: e.name,
|
|
25
26
|
version: e.version
|
|
@@ -27,10 +28,10 @@ var u = (e, t, n) => e === c.User ? n.user : t ? n.org : n.global, d = (e) => {
|
|
|
27
28
|
});
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
let i =
|
|
31
|
-
|
|
32
|
-
variant:
|
|
33
|
-
title:
|
|
31
|
+
let i = d(n, r, y.loginSuccess);
|
|
32
|
+
b({
|
|
33
|
+
variant: s.Success,
|
|
34
|
+
title: y.loginSuccessTitle,
|
|
34
35
|
message: i({
|
|
35
36
|
name: e.name,
|
|
36
37
|
version: e.version
|
|
@@ -38,15 +39,15 @@ var u = (e, t, n) => e === c.User ? n.user : t ? n.org : n.global, d = (e) => {
|
|
|
38
39
|
});
|
|
39
40
|
}, [
|
|
40
41
|
t,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
]),
|
|
42
|
+
y,
|
|
43
|
+
b
|
|
44
|
+
]), C = o((e, n) => {
|
|
44
45
|
let r = t && !!e.credentials?.isPublic;
|
|
45
|
-
if (e.credentials?.authenticationType ===
|
|
46
|
-
let t =
|
|
47
|
-
|
|
48
|
-
variant:
|
|
49
|
-
title:
|
|
46
|
+
if (e.credentials?.authenticationType === u.ApiKey) {
|
|
47
|
+
let t = d(n, r, y.apiKeyDeletedSuccess);
|
|
48
|
+
b({
|
|
49
|
+
variant: s.Success,
|
|
50
|
+
title: y.apiKeyDeletedSuccessTitle,
|
|
50
51
|
message: t({
|
|
51
52
|
name: e.name,
|
|
52
53
|
version: e.version
|
|
@@ -54,10 +55,10 @@ var u = (e, t, n) => e === c.User ? n.user : t ? n.org : n.global, d = (e) => {
|
|
|
54
55
|
});
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
let i =
|
|
58
|
-
|
|
59
|
-
variant:
|
|
60
|
-
title:
|
|
58
|
+
let i = d(n, r, y.logoutSuccess);
|
|
59
|
+
b({
|
|
60
|
+
variant: s.Success,
|
|
61
|
+
title: y.logoutSuccessTitle,
|
|
61
62
|
message: i({
|
|
62
63
|
name: e.name,
|
|
63
64
|
version: e.version
|
|
@@ -65,82 +66,76 @@ var u = (e, t, n) => e === c.User ? n.user : t ? n.org : n.global, d = (e) => {
|
|
|
65
66
|
});
|
|
66
67
|
}, [
|
|
67
68
|
t,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]), { login:
|
|
71
|
-
callbackPath:
|
|
72
|
-
loginToolset:
|
|
73
|
-
logoutToolset:
|
|
74
|
-
getToolset:
|
|
69
|
+
y,
|
|
70
|
+
b
|
|
71
|
+
]), { login: w } = a({
|
|
72
|
+
callbackPath: h,
|
|
73
|
+
loginToolset: g,
|
|
74
|
+
logoutToolset: _,
|
|
75
|
+
getToolset: v
|
|
75
76
|
});
|
|
76
77
|
return {
|
|
77
|
-
handleLogin:
|
|
78
|
-
let
|
|
79
|
-
switch ((await
|
|
78
|
+
handleLogin: o(async (e, t) => {
|
|
79
|
+
let a = e.credentials?.authenticationType, o = t.level === l.User ? n.User : n.Global, u = p.find((t) => t.id === e.id);
|
|
80
|
+
switch ((await w({
|
|
80
81
|
toolsetId: e.id,
|
|
81
|
-
credentialsLevel:
|
|
82
|
-
authenticationType:
|
|
82
|
+
credentialsLevel: o,
|
|
83
|
+
authenticationType: f(a),
|
|
83
84
|
apiKey: t.apiKey,
|
|
84
|
-
oauthSettings:
|
|
85
|
-
|
|
86
|
-
authorizationEndpoint: l?.authSettings?.authorizationEndpoint,
|
|
87
|
-
scopes: l?.authSettings?.scopesSupported,
|
|
88
|
-
codeChallenge: l?.authSettings?.codeChallenge,
|
|
89
|
-
codeChallengeMethod: l?.authSettings?.codeChallengeMethod
|
|
90
|
-
},
|
|
91
|
-
isCurrentlyFailed: b(e, t.level) === s.Failed
|
|
85
|
+
oauthSettings: r(u?.authSettings),
|
|
86
|
+
isCurrentlyFailed: x(e, t.level) === c.Failed
|
|
92
87
|
})).type) {
|
|
93
|
-
case
|
|
94
|
-
|
|
88
|
+
case i.Success:
|
|
89
|
+
S(e, t.level), await m();
|
|
95
90
|
return;
|
|
96
|
-
case
|
|
97
|
-
|
|
98
|
-
variant:
|
|
99
|
-
message:
|
|
91
|
+
case i.PopupBlocked:
|
|
92
|
+
b({
|
|
93
|
+
variant: s.Error,
|
|
94
|
+
message: y.popupBlockedError
|
|
100
95
|
});
|
|
101
96
|
return;
|
|
102
|
-
case
|
|
103
|
-
|
|
104
|
-
variant:
|
|
105
|
-
message:
|
|
97
|
+
case i.Failure:
|
|
98
|
+
b({
|
|
99
|
+
variant: s.Error,
|
|
100
|
+
message: y.loginFailedError
|
|
106
101
|
});
|
|
107
102
|
return;
|
|
108
|
-
case
|
|
103
|
+
case i.Cancelled: return;
|
|
109
104
|
}
|
|
110
105
|
}, [
|
|
111
|
-
|
|
112
|
-
v,
|
|
106
|
+
p,
|
|
113
107
|
y,
|
|
114
108
|
b,
|
|
115
109
|
x,
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
S,
|
|
111
|
+
m,
|
|
112
|
+
w
|
|
118
113
|
]),
|
|
119
|
-
handleLogout:
|
|
120
|
-
let i = r.level ===
|
|
114
|
+
handleLogout: o(async (t, r) => {
|
|
115
|
+
let i = r.level === l.User ? n.User : n.Global;
|
|
121
116
|
try {
|
|
122
117
|
let e = {
|
|
123
118
|
url: t.id,
|
|
124
119
|
credentialsLevel: i,
|
|
125
120
|
authenticationType: t.credentials?.authenticationType
|
|
126
121
|
};
|
|
127
|
-
await
|
|
122
|
+
await _(t.id, e), C(t, r.level), await m();
|
|
128
123
|
} catch (t) {
|
|
129
124
|
let { traceId: n } = await e(t);
|
|
130
|
-
|
|
131
|
-
variant:
|
|
132
|
-
message:
|
|
125
|
+
b({
|
|
126
|
+
variant: s.Error,
|
|
127
|
+
message: y.logoutFailedError,
|
|
133
128
|
requestId: n
|
|
134
129
|
});
|
|
135
130
|
}
|
|
136
131
|
}, [
|
|
137
|
-
|
|
138
|
-
v,
|
|
132
|
+
_,
|
|
139
133
|
y,
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
b,
|
|
135
|
+
C,
|
|
136
|
+
m
|
|
142
137
|
])
|
|
143
138
|
};
|
|
144
139
|
};
|
|
145
140
|
//#endregion
|
|
146
|
-
export {
|
|
141
|
+
export { p as useCatalogToolsetCredentials };
|
package/catalog.js
CHANGED
|
@@ -11,21 +11,22 @@ import { PUBLIC_SKILL_BUCKET as E, SKILL_LISTING_MAX_PAGES as D, SKILL_LISTING_P
|
|
|
11
11
|
import { buildSkillContentTree as M, buildSkillOverview as N, mapSkillToCatalogItem as P, readSkillFileBytes as F, readSkillFilePreviewBytes as I, readSkillManifest as L, resolveSkillFileDownloadPath as R, resolveSkillManifestFileId as z } from "./catalog/map-skill-to-catalog-item.js";
|
|
12
12
|
import { McpResourceKind as B, buildApplicationMcpUrl as V, buildConnectApi as H, buildToolsetMcpUrl as U, resolveMcpResourceKind as W } from "./catalog/mcp-endpoint-url.js";
|
|
13
13
|
import { getPublicCatalogEntityFolderPath as G, isPublicCatalogEntityId as K, mapPublishConversationResultDto as q, mapPublishHistoryEntryDto as J, toPublishEntityType as Y } from "./catalog/publish.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
14
|
+
import { usePublishHistory as X } from "./catalog/use-publish-history.js";
|
|
15
|
+
import { canEditShareAccess as Z, deriveAvailableTabIds as Q, deriveFavoriteItems as $, filterCatalogItemsBySelector as ee, filterHiddenOwnedItems as te, reconcileFilterTopics as ne } from "./catalog/catalog-derivations.js";
|
|
16
|
+
import { CatalogEntityKind as re, findSchemaDisplayName as ie, resolveCatalogEntityKind as ae } from "./catalog/catalog-entity-kind.js";
|
|
17
|
+
import { FavoriteEntityType as oe, useFavoriteEntitiesState as se } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
18
|
+
import { resolveFavoriteEntityType as ce } from "./catalog/favorite-entity-type.js";
|
|
19
|
+
import { parseCatalogFilterTopics as le, resolveCatalogActiveTab as ue, resolveCatalogSortKey as de } from "./catalog/catalog-preferences.js";
|
|
20
|
+
import { findWorstCappedRow as fe } from "./catalog/usage-limit-rows.js";
|
|
21
|
+
import { CatalogPrimaryActionType as pe, resolveCatalogPrimaryAction as me } from "./catalog/catalog-primary-action.js";
|
|
22
|
+
import { useCatalogItemDelete as he } from "./catalog/useCatalogItemDelete/useCatalogItemDelete.js";
|
|
23
|
+
import { useCatalogEditNavigation as ge } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
24
|
+
import { useSkillItemDetails as _e } from "./catalog/useSkillItemDetails.js";
|
|
25
|
+
import { useCatalogItemDetails as ve } from "./catalog/useCatalogItemDetails.js";
|
|
26
|
+
import { useCatalogToolsetCredentials as ye } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
27
|
+
import { buildApplicationCredentialLoginParams as be, mapApplicationCredentials as xe } from "./catalog/application-credentials.js";
|
|
28
|
+
import { useApplicationCredentials as Se } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
|
|
29
|
+
import { useSkillDetailsPanelData as Ce } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
30
|
+
import { hasPublishFolderWriteAccess as we, rememberPublishFolderKey as Te, usePublishFolders as Ee } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
31
|
+
import { SkillPreviewErrorKind as De, useSkillFilePreview as Oe } from "./skill/useSkillFilePreview.js";
|
|
32
|
+
export { u as AuthenticationType, re as CatalogEntityKind, pe as CatalogPrimaryActionType, m as DEFAULT_ENTITY_DETAILS_LABELS, oe as FavoriteEntityType, B as McpResourceKind, E as PUBLIC_SKILL_BUCKET, D as SKILL_LISTING_MAX_PAGES, O as SKILL_LISTING_PAGE_SIZE, k as SKILL_MANIFEST_MAX_BYTES, De as SkillPreviewErrorKind, A as SkillSource, be as buildApplicationCredentialLoginParams, V as buildApplicationMcpUrl, n as buildChatCompletionsUrl, H as buildConnectApi, r as buildDeploymentConnectApi, C as buildPromptOverview, d as buildResetFields, i as buildResponsesUrl, M as buildSkillContentTree, N as buildSkillOverview, U as buildToolsetMcpUrl, Z as canEditShareAccess, a as createDeploymentLookup, e as createPublishApiClient, o as decodeDeploymentId, Q as deriveAvailableTabIds, $ as deriveFavoriteItems, s as encodeDeploymentId, ee as filterCatalogItemsBySelector, te as filterHiddenOwnedItems, c as findDeploymentByIdOrReference, ie as findSchemaDisplayName, fe as findWorstCappedRow, G as getPublicCatalogEntityFolderPath, we as hasPublishFolderWriteAccess, w as isOrganisationPromptItem, K as isPublicCatalogEntityId, xe as mapApplicationCredentials, h as mapDeploymentDetailsDtoToEntityDetails, p as mapDeploymentLimitsDtoToCatalogLimits, f as mapDeploymentLimitsToInput, v as mapDeploymentToCatalogItem, y as mapDeploymentToolsetCredentials, g as mapEntityDetailsToCatalogDetails, T as mapPromptToCatalogItem, q as mapPublishConversationResultDto, J as mapPublishHistoryEntryDto, P as mapSkillToCatalogItem, _ as mapToolsetCredentials, b as mapToolsetToCatalogItem, l as normalizeDeploymentId, le as parseCatalogFilterTopics, j as parseSkillResourceUrl, F as readSkillFileBytes, I as readSkillFilePreviewBytes, L as readSkillManifest, ne as reconcileFilterTopics, Te as rememberPublishFolderKey, ue as resolveCatalogActiveTab, ae as resolveCatalogEntityKind, me as resolveCatalogPrimaryAction, de as resolveCatalogSortKey, x as resolveDeploymentFolder, ce as resolveFavoriteEntityType, W as resolveMcpResourceKind, R as resolveSkillFileDownloadPath, z as resolveSkillManifestFileId, S as supportsChatInterface, Y as toPublishEntityType, t as toPublishRuleDto, Se as useApplicationCredentials, ge as useCatalogEditNavigation, he as useCatalogItemDelete, ve as useCatalogItemDetails, ye as useCatalogToolsetCredentials, se as useFavoriteEntitiesState, Ee as usePublishFolders, X as usePublishHistory, Ce as useSkillDetailsPanelData, Oe as useSkillFilePreview, _e as useSkillItemDetails };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ConversationResponseDto, ConversationsApi } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { ConversationStreamTransport } from './useConversationStream/useConversationStream';
|
|
3
|
+
/** The sidebar list side effects of a conversation page; a conversation outside the sidebar has none. */
|
|
4
|
+
export interface ConversationListSync {
|
|
5
|
+
/** Shows a new title on the conversation's row. */
|
|
6
|
+
updateTitle: (id: string, title: string) => void;
|
|
7
|
+
/** Moves the conversation's row up after activity. */
|
|
8
|
+
bumpActivity: (id: string) => void;
|
|
9
|
+
/** Shows the unread indicator until the conversation is viewed. */
|
|
10
|
+
markUnread: (id: string) => void;
|
|
11
|
+
/** Records that the conversation was seen and clears its unread indicator. */
|
|
12
|
+
markViewed: (id: string) => Promise<void>;
|
|
13
|
+
/** Removes the conversation's row. */
|
|
14
|
+
remove: (id: string) => void;
|
|
15
|
+
/** Re-reads the list, optionally waiting until the given ids appear in it. */
|
|
16
|
+
refresh: (expectedIds?: readonly string[]) => Promise<void>;
|
|
17
|
+
/** The open chat is marked viewed without a sidebar row saying it is unread; a project chat has no row. */
|
|
18
|
+
shouldMarkOpenChatViewed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Where a conversation page reads and writes its conversation, and where it navigates. */
|
|
21
|
+
export interface ConversationDataSource {
|
|
22
|
+
/** Stream, stop, attach, get and save for `useConversationStream`. */
|
|
23
|
+
transport: ConversationStreamTransport;
|
|
24
|
+
/** Loads a conversation by its id (also the custom-viewer reload). */
|
|
25
|
+
getConversation: (id: string, signal?: AbortSignal) => Promise<ConversationResponseDto>;
|
|
26
|
+
/** Saves a conversation by its stream path (model changes, status messages). */
|
|
27
|
+
saveConversation: (path: string, conversation: ConversationResponseDto) => Promise<ConversationResponseDto>;
|
|
28
|
+
/** Save and delete for `useConversationHandlers`. */
|
|
29
|
+
handlersApi: Pick<ConversationsApi, 'saveConversation' | 'deleteConversation'>;
|
|
30
|
+
/** Watches for the title the first reply produces; returns a cleanup. */
|
|
31
|
+
watchTitle: (id: string, previousName: string, onUpdated: (title: string) => void) => () => void;
|
|
32
|
+
/** The route of a conversation (after duplicate or a custom-viewer create). */
|
|
33
|
+
getConversationRoute: (id: string) => string;
|
|
34
|
+
/** Where a deleted or missing conversation navigates. */
|
|
35
|
+
getExitRoute: () => string;
|
|
36
|
+
/** Whether the conversation opens read-only. */
|
|
37
|
+
isReadOnly: (id: string) => boolean;
|
|
38
|
+
/** Sidebar list side effects; {@link NO_CONVERSATION_LIST_SYNC} when the conversation is not in the sidebar. */
|
|
39
|
+
listSync: ConversationListSync;
|
|
40
|
+
/** Whether a read-only conversation offers Duplicate. */
|
|
41
|
+
canDuplicate: boolean;
|
|
42
|
+
/** Translation key of the toast shown when the conversation cannot be loaded; the page's own when unset. The host resolves it. */
|
|
43
|
+
notFoundMessageKey?: string;
|
|
44
|
+
}
|
|
45
|
+
/** List side effects of a conversation that is not in the sidebar: each one does nothing. */
|
|
46
|
+
export declare const NO_CONVERSATION_LIST_SYNC: ConversationListSync;
|
|
47
|
+
//# sourceMappingURL=conversation-data-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-data-source.d.ts","sourceRoot":"","sources":["../../src/conversation/conversation-data-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAEjG,yGAAyG;AACzG,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,sDAAsD;IACtD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mEAAmE;IACnE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,8EAA8E;IAC9E,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,sCAAsC;IACtC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,8EAA8E;IAC9E,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,2GAA2G;IAC3G,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,SAAS,EAAE,2BAA2B,CAAC;IACvC,sEAAsE;IACtE,eAAe,EAAE,CACf,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,gFAAgF;IAChF,gBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,uBAAuB,KAClC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,qDAAqD;IACrD,WAAW,EAAE,IAAI,CACf,gBAAgB,EAChB,kBAAkB,GAAG,oBAAoB,CAC1C,CAAC;IACF,yEAAyE;IACzE,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAC/B,MAAM,IAAI,CAAC;IAChB,+EAA+E;IAC/E,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,yDAAyD;IACzD,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,gDAAgD;IAChD,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,gHAAgH;IAChH,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAC;IACtB,kIAAkI;IAClI,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,6FAA6F;AAC7F,eAAO,MAAM,yBAAyB,EAAE,oBAOvC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/conversation/conversation-data-source.ts
|
|
2
|
+
var e = {
|
|
3
|
+
updateTitle: () => void 0,
|
|
4
|
+
bumpActivity: () => void 0,
|
|
5
|
+
markUnread: () => void 0,
|
|
6
|
+
markViewed: async () => void 0,
|
|
7
|
+
remove: () => void 0,
|
|
8
|
+
refresh: async () => void 0
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as NO_CONVERSATION_LIST_SYNC };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationExport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationExport/useConversationExport.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,KAAK,uBAAuB,EAI7B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"useConversationExport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationExport/useConversationExport.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,KAAK,uBAAuB,EAI7B,MAAM,2BAA2B,CAAC;AAsBnC,OAAO,EACL,sBAAsB,EACtB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAEtC,MAAM,gCAAgC,CAAC;AASxC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAyD3D,UAAU,yBAAyB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAsBD,oDAAoD;AACpD,MAAM,WAAW,2BAA2B;IAC1C,+EAA+E;IAC/E,gBAAgB,EAAE,IAAI,CACpB,gBAAgB,EAChB,iBAAiB,GAAG,mBAAmB,CACxC,CAAC;IACF,iFAAiF;IACjF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC5C,yFAAyF;IACzF,yBAAyB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,2GAA2G;IAC3G,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC;IACtE,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtE;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,6FAA6F;IAC7F,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,+BAA+B;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;CAC3D;AAED,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,4FAA4F;IAC5F,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,2EAA2E;IAC3E,YAAY,EAAE,CACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,sBAAsB,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,sFAAsF;IACtF,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,oFAAoF;IACpF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,wJAUnC,2BAA2B,KAAG,2BAuchC,CAAC"}
|