@epam/ai-dial-chat-hooks 1.2.0-dev.99 → 1.3.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-error/api-error.js +7 -4
- package/catalog/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- package/catalog/map-deployment-limits-to-catalog.js +16 -24
- package/catalog/map-deployment-limits-to-input.js +81 -9
- package/catalog/map-deployment-to-catalog-item.js +34 -34
- package/catalog/map-entity-details-to-catalog.js +237 -192
- package/catalog/map-skill-to-catalog-item.js +61 -54
- package/catalog/publish.js +4 -4
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
- package/catalog/useCatalogItemDetails.js +9 -8
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog.d.ts +171 -34
- package/catalog.js +23 -23
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/create-chat-stream-api.js +89 -49
- package/conversation/get-model-id-from-conversation-id.js +15 -9
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +6 -2
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/message-utils.js +8 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +181 -167
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +49 -31
- package/conversation/useConversationStream/frame-scheduler.js +39 -0
- package/conversation/useConversationStream/generation-resume.js +122 -64
- package/conversation/useConversationStream/useConversationStream.js +298 -118
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
- package/conversation-sources.d.ts +1 -1
- package/conversation-transfer.d.ts +2 -1
- package/conversation.d.ts +218 -22
- package/conversation.js +32 -31
- package/file-manager-canvas.d.ts +27 -7
- package/file-manager.d.ts +87 -32
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +67 -44
- package/files/dial-file-manager-copy-move.util.js +9 -8
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +24 -2
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/file-manager-variant.js +1 -1
- package/files/resolve-dial-file-api-path.js +11 -12
- package/files/useDialFileListing/useDialFileListing.js +140 -127
- package/files/useDialFileManager/useDialFileManager.js +139 -135
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -15
- package/files/useDialFileMutations/useDialFileMutations.js +65 -60
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +28 -23
- package/index.d.ts +643 -128
- package/index.js +136 -134
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/oauth/authorize-url.js +3 -3
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +34 -2
- package/oauth.js +9 -9
- package/package.json +19 -23
- package/scheduled-task/scheduled-task-description.js +43 -39
- package/scheduled-task/scheduled-task-trigger.js +74 -71
- package/scheduled-task/use-scheduled-task-runs.js +162 -50
- package/scheduled-task/use-scheduled-tasks.js +52 -48
- package/scheduled-tasks.d.ts +27 -6
- package/scheduled-tasks.js +2 -2
- package/shared/application-schema.js +5 -2
- package/shared/cron-day-of-month.js +13 -0
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +52 -29
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +38 -34
- package/skill/useSkillEditorLoad.js +65 -59
- package/skill/useSkillEditorSubmit.js +105 -93
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +62 -13
- package/skill-editor.js +9 -9
- package/usage/map-user-usage-to-model-limits.js +137 -95
- package/usage.d.ts +8 -3
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +26 -6
- package/utils.js +10 -10
|
@@ -3,242 +3,283 @@ import { isPublicToolsetId as t } from "../oauth/toolset-id.js";
|
|
|
3
3
|
import { formatCalendarDate as n } from "../shared/formatting.js";
|
|
4
4
|
import { formatUnitPrice as r } from "@epam/ai-dial-chat-shared";
|
|
5
5
|
import { mimeTypesToExtensionLabels as i } from "@epam/ai-dial-attachment-input";
|
|
6
|
-
import {
|
|
6
|
+
import { CatalogPricingUnit as a, CredentialStatus as o, ToolsetAuthenticationType as s } from "@epam/ai-dial-catalog";
|
|
7
7
|
//#region src/catalog/map-entity-details-to-catalog.ts
|
|
8
|
-
var
|
|
8
|
+
var c = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens` : `${e} tokens`, l = (e) => {
|
|
9
9
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
10
10
|
if (t == null) return e;
|
|
11
11
|
let [, r, i, a] = t, o = Number(r), s = Number(i) - 1, c = Number(a), l = new Date(o, s, c);
|
|
12
12
|
return l.getFullYear() !== o || l.getMonth() !== s || l.getDate() !== c ? e : n(l.getTime());
|
|
13
|
-
},
|
|
14
|
-
|
|
13
|
+
}, u = "unit", d = {
|
|
14
|
+
capabilitiesTitle: "Capabilities",
|
|
15
|
+
specificationTitle: "Specification",
|
|
16
|
+
configurationTitle: "Configuration",
|
|
17
|
+
tools: "Tools",
|
|
18
|
+
parallelToolCalls: "Parallel tool calls",
|
|
19
|
+
reasoningEfforts: "Reasoning efforts",
|
|
20
|
+
skills: "Skills",
|
|
21
|
+
provider: "Provider",
|
|
22
|
+
vendor: "Vendor",
|
|
23
|
+
license: "License",
|
|
24
|
+
knowledgeCutoffDate: "Knowledge cutoff date",
|
|
25
|
+
parameters: "Parameters",
|
|
26
|
+
hostedBy: "Hosted by",
|
|
27
|
+
releaseDate: "Release date",
|
|
28
|
+
contextWindow: "Context window",
|
|
29
|
+
maxOutputTokens: "Max output tokens",
|
|
30
|
+
inputModalities: "Input modalities",
|
|
31
|
+
inputAttachments: "Input attachments",
|
|
32
|
+
routes: "Routes",
|
|
33
|
+
configurationSchema: "Configuration schema",
|
|
34
|
+
authentication: "Authentication",
|
|
35
|
+
authorizationEndpoint: "Authorization endpoint",
|
|
36
|
+
tokenEndpoint: "Token endpoint",
|
|
37
|
+
oauthScopes: "OAuth scopes"
|
|
38
|
+
}, f = (e, t) => {
|
|
39
|
+
let r = [];
|
|
15
40
|
if (e.capabilities != null) {
|
|
16
|
-
let { capabilities: n } = e,
|
|
17
|
-
n.hasTools != null &&
|
|
18
|
-
label:
|
|
41
|
+
let { capabilities: n } = e, i = [];
|
|
42
|
+
n.hasTools != null && i.push({
|
|
43
|
+
label: t.tools,
|
|
19
44
|
value: n.hasTools
|
|
20
|
-
}), n.hasParallelToolCalls != null &&
|
|
21
|
-
label:
|
|
45
|
+
}), n.hasParallelToolCalls != null && i.push({
|
|
46
|
+
label: t.parallelToolCalls,
|
|
22
47
|
value: n.hasParallelToolCalls
|
|
23
|
-
}), n.reasoningEfforts?.length &&
|
|
24
|
-
label:
|
|
48
|
+
}), n.reasoningEfforts?.length && i.push({
|
|
49
|
+
label: t.reasoningEfforts,
|
|
25
50
|
value: n.reasoningEfforts.join(" · ")
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
}), n.hasSkills != null && i.push({
|
|
52
|
+
label: t.skills,
|
|
53
|
+
value: n.hasSkills
|
|
54
|
+
}), i.length > 0 && r.push({
|
|
55
|
+
title: t.capabilitiesTitle,
|
|
56
|
+
specs: i
|
|
29
57
|
});
|
|
30
58
|
}
|
|
31
59
|
if (e.specification != null) {
|
|
32
|
-
let { specification:
|
|
33
|
-
|
|
34
|
-
label:
|
|
35
|
-
value:
|
|
36
|
-
}),
|
|
37
|
-
label:
|
|
38
|
-
value:
|
|
39
|
-
}),
|
|
40
|
-
label:
|
|
41
|
-
value:
|
|
42
|
-
}),
|
|
43
|
-
label:
|
|
44
|
-
value:
|
|
45
|
-
}),
|
|
46
|
-
label:
|
|
47
|
-
value:
|
|
48
|
-
}),
|
|
49
|
-
label:
|
|
50
|
-
value:
|
|
51
|
-
}),
|
|
52
|
-
label:
|
|
53
|
-
value: n(
|
|
54
|
-
}),
|
|
55
|
-
label:
|
|
56
|
-
value:
|
|
57
|
-
}),
|
|
58
|
-
label:
|
|
59
|
-
value:
|
|
60
|
-
}),
|
|
61
|
-
label:
|
|
62
|
-
value: i(
|
|
63
|
-
}),
|
|
64
|
-
title:
|
|
65
|
-
specs:
|
|
60
|
+
let { specification: a } = e, o = [];
|
|
61
|
+
a.provider != null && o.push({
|
|
62
|
+
label: t.provider,
|
|
63
|
+
value: a.provider
|
|
64
|
+
}), a.vendor != null && o.push({
|
|
65
|
+
label: t.vendor,
|
|
66
|
+
value: a.vendor
|
|
67
|
+
}), a.license != null && o.push({
|
|
68
|
+
label: t.license,
|
|
69
|
+
value: a.license
|
|
70
|
+
}), a.knowledgeCutoffDate != null && o.push({
|
|
71
|
+
label: t.knowledgeCutoffDate,
|
|
72
|
+
value: l(a.knowledgeCutoffDate)
|
|
73
|
+
}), a.parameters != null && o.push({
|
|
74
|
+
label: t.parameters,
|
|
75
|
+
value: a.parameters
|
|
76
|
+
}), a.hostedBy != null && o.push({
|
|
77
|
+
label: t.hostedBy,
|
|
78
|
+
value: a.hostedBy
|
|
79
|
+
}), a.createdAt != null && o.push({
|
|
80
|
+
label: t.releaseDate,
|
|
81
|
+
value: n(a.createdAt)
|
|
82
|
+
}), a.contextWindowTokens != null && o.push({
|
|
83
|
+
label: t.contextWindow,
|
|
84
|
+
value: c(a.contextWindowTokens)
|
|
85
|
+
}), a.maxOutputTokens != null && o.push({
|
|
86
|
+
label: t.maxOutputTokens,
|
|
87
|
+
value: c(a.maxOutputTokens)
|
|
88
|
+
}), a.inputTypes?.length && o.push({
|
|
89
|
+
label: t.inputModalities,
|
|
90
|
+
value: i(a.inputTypes)
|
|
91
|
+
}), o.length > 0 && r.push({
|
|
92
|
+
title: t.specificationTitle,
|
|
93
|
+
specs: o
|
|
66
94
|
});
|
|
67
95
|
}
|
|
68
|
-
let
|
|
96
|
+
let a = y(e.pricing), o = b(e);
|
|
69
97
|
return {
|
|
70
|
-
overview:
|
|
71
|
-
pricing:
|
|
72
|
-
api:
|
|
98
|
+
overview: r.length > 0 ? { sections: r } : void 0,
|
|
99
|
+
pricing: a,
|
|
100
|
+
api: o
|
|
73
101
|
};
|
|
74
|
-
},
|
|
102
|
+
}, p = {
|
|
75
103
|
prompt: "Input tokens",
|
|
76
104
|
completion: "Output tokens",
|
|
77
105
|
cache_read: "Cached input",
|
|
78
106
|
cacheRead: "Cached input",
|
|
79
107
|
cache_write: "Cached write",
|
|
80
108
|
cacheWrite: "Cached write"
|
|
81
|
-
},
|
|
109
|
+
}, m = {
|
|
110
|
+
prompt: "Input characters",
|
|
111
|
+
completion: "Output characters"
|
|
112
|
+
}, h = "char_without_whitespace", g = [
|
|
82
113
|
"prompt",
|
|
83
114
|
"completion",
|
|
84
115
|
"cache_read",
|
|
85
116
|
"cacheRead",
|
|
86
117
|
"cache_write",
|
|
87
118
|
"cacheWrite"
|
|
88
|
-
],
|
|
89
|
-
let t =
|
|
90
|
-
return t === -1 ?
|
|
91
|
-
},
|
|
92
|
-
let
|
|
93
|
-
if (
|
|
94
|
-
let
|
|
95
|
-
return
|
|
96
|
-
},
|
|
119
|
+
], _ = (e) => {
|
|
120
|
+
let t = g.indexOf(e);
|
|
121
|
+
return t === -1 ? g.length : t;
|
|
122
|
+
}, v = (e, t) => {
|
|
123
|
+
let n = (t === a.Character ? m[e] : void 0) ?? p[e];
|
|
124
|
+
if (n != null) return n;
|
|
125
|
+
let r = e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
126
|
+
return r === "" ? e : ` ${r.charAt(0).toUpperCase()}${r.slice(1)}`;
|
|
127
|
+
}, y = (e) => {
|
|
97
128
|
if (e == null) return;
|
|
98
|
-
let t = [...e.prices ?? []].sort((e, t) =>
|
|
99
|
-
label:
|
|
100
|
-
price:
|
|
129
|
+
let t = e.unit?.toLowerCase() === h ? a.Character : a.Token, n = [...e.prices ?? []].sort((e, t) => _(e.key) - _(t.key)).map(({ key: e, price: n }) => ({
|
|
130
|
+
label: v(e, t),
|
|
131
|
+
price: n
|
|
101
132
|
}));
|
|
102
|
-
if (
|
|
103
|
-
|
|
133
|
+
if (n.length !== 0) return t === a.Character ? {
|
|
134
|
+
prices: n,
|
|
135
|
+
unit: t
|
|
136
|
+
} : { prices: n };
|
|
137
|
+
}, b = (e) => {
|
|
104
138
|
let { api: t } = e;
|
|
105
139
|
if (t?.modelId != null) return { resource: { modelId: t.modelId } };
|
|
106
|
-
},
|
|
107
|
-
let
|
|
140
|
+
}, x = (e, t) => {
|
|
141
|
+
let r = [];
|
|
108
142
|
if (e.specification != null) {
|
|
109
|
-
let { specification:
|
|
110
|
-
|
|
111
|
-
label:
|
|
112
|
-
value:
|
|
113
|
-
}),
|
|
114
|
-
label:
|
|
115
|
-
value:
|
|
116
|
-
}),
|
|
117
|
-
label:
|
|
118
|
-
value:
|
|
119
|
-
}),
|
|
120
|
-
label:
|
|
121
|
-
value:
|
|
122
|
-
}),
|
|
123
|
-
label:
|
|
124
|
-
value:
|
|
125
|
-
}),
|
|
126
|
-
label:
|
|
127
|
-
value:
|
|
128
|
-
}),
|
|
129
|
-
label:
|
|
130
|
-
value: n(
|
|
131
|
-
}),
|
|
132
|
-
label:
|
|
133
|
-
value:
|
|
134
|
-
}),
|
|
135
|
-
title:
|
|
136
|
-
specs:
|
|
143
|
+
let { specification: i } = e, a = [];
|
|
144
|
+
i.provider != null && a.push({
|
|
145
|
+
label: t.provider,
|
|
146
|
+
value: i.provider
|
|
147
|
+
}), i.vendor != null && a.push({
|
|
148
|
+
label: t.vendor,
|
|
149
|
+
value: i.vendor
|
|
150
|
+
}), i.license != null && a.push({
|
|
151
|
+
label: t.license,
|
|
152
|
+
value: i.license
|
|
153
|
+
}), i.knowledgeCutoffDate != null && a.push({
|
|
154
|
+
label: t.knowledgeCutoffDate,
|
|
155
|
+
value: l(i.knowledgeCutoffDate)
|
|
156
|
+
}), i.parameters != null && a.push({
|
|
157
|
+
label: t.parameters,
|
|
158
|
+
value: i.parameters
|
|
159
|
+
}), i.hostedBy != null && a.push({
|
|
160
|
+
label: t.hostedBy,
|
|
161
|
+
value: i.hostedBy
|
|
162
|
+
}), i.createdAt != null && a.push({
|
|
163
|
+
label: t.releaseDate,
|
|
164
|
+
value: n(i.createdAt)
|
|
165
|
+
}), i.routes?.length && a.push({
|
|
166
|
+
label: t.routes,
|
|
167
|
+
value: i.routes.join(" · ")
|
|
168
|
+
}), a.length > 0 && r.push({
|
|
169
|
+
title: t.specificationTitle,
|
|
170
|
+
specs: a
|
|
137
171
|
});
|
|
138
172
|
}
|
|
139
173
|
if (e.capabilities != null) {
|
|
140
|
-
let { capabilities: n } = e,
|
|
141
|
-
n.hasTools != null &&
|
|
142
|
-
label:
|
|
174
|
+
let { capabilities: n } = e, i = [];
|
|
175
|
+
n.hasTools != null && i.push({
|
|
176
|
+
label: t.tools,
|
|
143
177
|
value: n.hasTools
|
|
144
|
-
}), n.hasParallelToolCalls != null &&
|
|
145
|
-
label:
|
|
178
|
+
}), n.hasParallelToolCalls != null && i.push({
|
|
179
|
+
label: t.parallelToolCalls,
|
|
146
180
|
value: n.hasParallelToolCalls
|
|
147
|
-
}), n.hasConfiguration != null &&
|
|
148
|
-
label:
|
|
181
|
+
}), n.hasConfiguration != null && i.push({
|
|
182
|
+
label: t.configurationSchema,
|
|
149
183
|
value: n.hasConfiguration
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
|
|
184
|
+
}), n.hasSkills != null && i.push({
|
|
185
|
+
label: t.skills,
|
|
186
|
+
value: n.hasSkills
|
|
187
|
+
}), i.length > 0 && r.push({
|
|
188
|
+
title: t.capabilitiesTitle,
|
|
189
|
+
specs: i
|
|
153
190
|
});
|
|
154
191
|
}
|
|
155
192
|
if (e.configuration != null) {
|
|
156
|
-
let { configuration: n } = e,
|
|
157
|
-
n.inputAttachmentTypes?.length &&
|
|
158
|
-
label:
|
|
193
|
+
let { configuration: n } = e, a = [];
|
|
194
|
+
n.inputAttachmentTypes?.length && a.push({
|
|
195
|
+
label: t.inputAttachments,
|
|
159
196
|
value: i(n.inputAttachmentTypes)
|
|
160
|
-
}),
|
|
161
|
-
title:
|
|
162
|
-
specs:
|
|
197
|
+
}), a.length > 0 && r.push({
|
|
198
|
+
title: t.configurationTitle,
|
|
199
|
+
specs: a
|
|
163
200
|
});
|
|
164
201
|
}
|
|
165
|
-
return { overview:
|
|
166
|
-
},
|
|
167
|
-
[e.None]:
|
|
168
|
-
[e.ApiKey]:
|
|
169
|
-
[e.OAuth]:
|
|
170
|
-
},
|
|
171
|
-
SIGNED_IN:
|
|
172
|
-
SIGNED_OUT:
|
|
173
|
-
FAILED:
|
|
174
|
-
},
|
|
175
|
-
let a =
|
|
202
|
+
return { overview: r.length > 0 ? { sections: r } : void 0 };
|
|
203
|
+
}, S = {
|
|
204
|
+
[e.None]: s.None,
|
|
205
|
+
[e.ApiKey]: s.ApiKey,
|
|
206
|
+
[e.OAuth]: s.OAuth
|
|
207
|
+
}, C = {
|
|
208
|
+
SIGNED_IN: o.SignedIn,
|
|
209
|
+
SIGNED_OUT: o.SignedOut,
|
|
210
|
+
FAILED: o.Failed
|
|
211
|
+
}, w = (n, r, i) => {
|
|
212
|
+
let a = S[r.specification?.authentication ?? e.None];
|
|
176
213
|
if (a == null) return;
|
|
177
214
|
let { userLevel: o, global: s } = r.specification?.authStatus ?? {}, c = t(n);
|
|
178
215
|
return {
|
|
179
216
|
authenticationType: a,
|
|
180
|
-
userStatus: o ?
|
|
181
|
-
globalStatus: s ?
|
|
217
|
+
userStatus: o ? C[o] : void 0,
|
|
218
|
+
globalStatus: s ? C[s] : void 0,
|
|
182
219
|
isPublic: c,
|
|
183
220
|
isManageableByAdmin: i && c,
|
|
184
221
|
apiKeyHeader: r.specification?.authStatus?.apiKeyHeader
|
|
185
222
|
};
|
|
186
|
-
},
|
|
223
|
+
}, T = (e) => {
|
|
187
224
|
let t = e?.permissions?.length ? e.permissions : e?.allTools;
|
|
188
225
|
if (t?.length) return { tools: t.map((e) => ({ name: e })) };
|
|
189
|
-
},
|
|
190
|
-
let
|
|
226
|
+
}, E = (e, t) => {
|
|
227
|
+
let r = [];
|
|
191
228
|
if (e.specification != null) {
|
|
192
|
-
let { specification:
|
|
193
|
-
|
|
194
|
-
label:
|
|
195
|
-
value:
|
|
196
|
-
}),
|
|
197
|
-
label:
|
|
198
|
-
value:
|
|
199
|
-
}),
|
|
200
|
-
label:
|
|
201
|
-
value:
|
|
202
|
-
}),
|
|
203
|
-
label:
|
|
204
|
-
value:
|
|
205
|
-
}),
|
|
206
|
-
label:
|
|
207
|
-
value:
|
|
208
|
-
}),
|
|
209
|
-
label:
|
|
210
|
-
value:
|
|
211
|
-
}),
|
|
212
|
-
label:
|
|
213
|
-
value:
|
|
214
|
-
}),
|
|
215
|
-
label:
|
|
216
|
-
value: n(
|
|
217
|
-
}),
|
|
218
|
-
label:
|
|
219
|
-
value:
|
|
220
|
-
}),
|
|
221
|
-
label:
|
|
222
|
-
value:
|
|
223
|
-
}),
|
|
224
|
-
label:
|
|
225
|
-
value:
|
|
226
|
-
}),
|
|
227
|
-
title:
|
|
228
|
-
specs:
|
|
229
|
+
let { specification: i } = e, a = [];
|
|
230
|
+
i.authentication != null && a.push({
|
|
231
|
+
label: t.authentication,
|
|
232
|
+
value: i.authentication
|
|
233
|
+
}), i.provider != null && a.push({
|
|
234
|
+
label: t.provider,
|
|
235
|
+
value: i.provider
|
|
236
|
+
}), i.vendor != null && a.push({
|
|
237
|
+
label: t.vendor,
|
|
238
|
+
value: i.vendor
|
|
239
|
+
}), i.license != null && a.push({
|
|
240
|
+
label: t.license,
|
|
241
|
+
value: i.license
|
|
242
|
+
}), i.knowledgeCutoffDate != null && a.push({
|
|
243
|
+
label: t.knowledgeCutoffDate,
|
|
244
|
+
value: l(i.knowledgeCutoffDate)
|
|
245
|
+
}), i.parameters != null && a.push({
|
|
246
|
+
label: t.parameters,
|
|
247
|
+
value: i.parameters
|
|
248
|
+
}), i.hostedBy != null && a.push({
|
|
249
|
+
label: t.hostedBy,
|
|
250
|
+
value: i.hostedBy
|
|
251
|
+
}), i.createdAt != null && a.push({
|
|
252
|
+
label: t.releaseDate,
|
|
253
|
+
value: n(i.createdAt)
|
|
254
|
+
}), i.authStatus?.scopesSupported?.length && a.push({
|
|
255
|
+
label: t.oauthScopes,
|
|
256
|
+
value: i.authStatus.scopesSupported.join(" · ")
|
|
257
|
+
}), i.authStatus?.authorizationEndpoint != null && a.push({
|
|
258
|
+
label: t.authorizationEndpoint,
|
|
259
|
+
value: i.authStatus.authorizationEndpoint
|
|
260
|
+
}), i.authStatus?.tokenEndpoint != null && a.push({
|
|
261
|
+
label: t.tokenEndpoint,
|
|
262
|
+
value: i.authStatus.tokenEndpoint
|
|
263
|
+
}), a.length > 0 && r.push({
|
|
264
|
+
title: t.specificationTitle,
|
|
265
|
+
specs: a
|
|
229
266
|
});
|
|
230
267
|
}
|
|
231
268
|
return {
|
|
232
|
-
overview:
|
|
233
|
-
tools:
|
|
269
|
+
overview: r.length > 0 ? { sections: r } : void 0,
|
|
270
|
+
tools: T(e.specification)
|
|
271
|
+
};
|
|
272
|
+
}, D = (e, t) => {
|
|
273
|
+
let n = {
|
|
274
|
+
...d,
|
|
275
|
+
...t
|
|
234
276
|
};
|
|
235
|
-
}, C = (e) => {
|
|
236
277
|
switch (e.type) {
|
|
237
|
-
case "MODEL": return
|
|
238
|
-
case "AGENT": return
|
|
239
|
-
case "TOOLSET": return
|
|
278
|
+
case "MODEL": return f(e.data, n);
|
|
279
|
+
case "AGENT": return x(e.data, n);
|
|
280
|
+
case "TOOLSET": return E(e.data, n);
|
|
240
281
|
}
|
|
241
|
-
},
|
|
282
|
+
}, O = (e) => {
|
|
242
283
|
if (e != null) return {
|
|
243
284
|
hasTools: e.tools,
|
|
244
285
|
hasMcp: e.mcp,
|
|
@@ -252,25 +293,29 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
252
293
|
hasConfiguration: e.hasConfigurationSchema,
|
|
253
294
|
hasChatCompletion: e.chatCompletion,
|
|
254
295
|
hasResponsesApi: e.responsesApi,
|
|
296
|
+
hasSkills: e.skillsSupported,
|
|
255
297
|
reasoningEfforts: e.reasoningEfforts
|
|
256
298
|
};
|
|
257
|
-
},
|
|
299
|
+
}, k = (e) => {
|
|
258
300
|
if (e == null) return;
|
|
259
301
|
let t = typeof e.unit == "string" ? e.unit : void 0, n = Object.entries(e).flatMap(([e, n]) => {
|
|
260
|
-
if (e ===
|
|
302
|
+
if (e === u || typeof n != "string" || n.trim() === "") return [];
|
|
261
303
|
let i = r(n, t);
|
|
262
304
|
return i == null ? [] : [{
|
|
263
305
|
key: e,
|
|
264
306
|
price: i
|
|
265
307
|
}];
|
|
266
308
|
});
|
|
267
|
-
return n.length > 0 ? {
|
|
268
|
-
|
|
309
|
+
return n.length > 0 ? {
|
|
310
|
+
prices: n,
|
|
311
|
+
unit: t
|
|
312
|
+
} : void 0;
|
|
313
|
+
}, A = (e) => {
|
|
269
314
|
let { limits: t, pricing: n, features: r, catalogProperties: i, owner: a, inputAttachmentTypes: o, defaultMaxTokens: s, createdAt: c } = e.modelDetails ?? {}, l = t != null || i != null || a != null || c != null || (o?.length ?? 0) > 0;
|
|
270
315
|
return {
|
|
271
316
|
type: "MODEL",
|
|
272
317
|
data: {
|
|
273
|
-
capabilities:
|
|
318
|
+
capabilities: O(r),
|
|
274
319
|
specification: l ? {
|
|
275
320
|
provider: i?.provider,
|
|
276
321
|
vendor: i?.vendor,
|
|
@@ -283,16 +328,16 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
283
328
|
hostedBy: a,
|
|
284
329
|
createdAt: c
|
|
285
330
|
} : void 0,
|
|
286
|
-
pricing:
|
|
331
|
+
pricing: k(n),
|
|
287
332
|
api: { modelId: e.id }
|
|
288
333
|
}
|
|
289
334
|
};
|
|
290
|
-
},
|
|
335
|
+
}, j = (e) => {
|
|
291
336
|
let { routes: t, owner: n, inputAttachmentTypes: r, features: i, catalogProperties: a, createdAt: o } = e.applicationDetails ?? {}, s = a != null || n != null || o != null || (t?.length ?? 0) > 0;
|
|
292
337
|
return {
|
|
293
338
|
type: "AGENT",
|
|
294
339
|
data: {
|
|
295
|
-
capabilities:
|
|
340
|
+
capabilities: O(i),
|
|
296
341
|
specification: s ? {
|
|
297
342
|
provider: a?.provider,
|
|
298
343
|
vendor: a?.vendor,
|
|
@@ -306,7 +351,7 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
306
351
|
configuration: r?.length ? { inputAttachmentTypes: r } : void 0
|
|
307
352
|
}
|
|
308
353
|
};
|
|
309
|
-
},
|
|
354
|
+
}, M = (t) => t === e.None || t === e.ApiKey || t === e.OAuth, N = (e) => {
|
|
310
355
|
if (e == null) return;
|
|
311
356
|
let { globalAuthStatus: t, appLevelAuthStatus: n, userLevelAuthStatus: r, scopesSupported: i, authorizationEndpoint: a, tokenEndpoint: o, apiKeyHeader: s } = e;
|
|
312
357
|
if (!(t == null && n == null && r == null && a == null && o == null && s == null && !i?.length)) return {
|
|
@@ -318,14 +363,14 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
318
363
|
tokenEndpoint: o,
|
|
319
364
|
apiKeyHeader: s
|
|
320
365
|
};
|
|
321
|
-
},
|
|
366
|
+
}, P = (e) => {
|
|
322
367
|
let t = e.toolsetDetails, n = t?.authSettings?.authenticationType;
|
|
323
368
|
return {
|
|
324
369
|
type: "TOOLSET",
|
|
325
370
|
data: {
|
|
326
|
-
capabilities:
|
|
371
|
+
capabilities: O(t?.features),
|
|
327
372
|
specification: t == null ? void 0 : {
|
|
328
|
-
authentication:
|
|
373
|
+
authentication: M(n) ? n : void 0,
|
|
329
374
|
provider: t.catalogProperties?.provider,
|
|
330
375
|
vendor: t.catalogProperties?.vendor,
|
|
331
376
|
license: t.catalogProperties?.license,
|
|
@@ -335,16 +380,16 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
|
|
|
335
380
|
allTools: t.allToolNames,
|
|
336
381
|
hostedBy: t.owner,
|
|
337
382
|
createdAt: t.createdAt,
|
|
338
|
-
authStatus:
|
|
383
|
+
authStatus: N(t.authSettings)
|
|
339
384
|
}
|
|
340
385
|
}
|
|
341
386
|
};
|
|
342
|
-
},
|
|
387
|
+
}, F = (e) => {
|
|
343
388
|
switch (e.type) {
|
|
344
|
-
case "model": return
|
|
345
|
-
case "application": return
|
|
346
|
-
case "toolset": return
|
|
389
|
+
case "model": return A(e);
|
|
390
|
+
case "application": return j(e);
|
|
391
|
+
case "toolset": return P(e);
|
|
347
392
|
}
|
|
348
393
|
};
|
|
349
394
|
//#endregion
|
|
350
|
-
export {
|
|
395
|
+
export { d as DEFAULT_ENTITY_DETAILS_LABELS, F as mapDeploymentDetailsDtoToEntityDetails, D as mapEntityDetailsToCatalogDetails, w as mapToolsetCredentials };
|