@epam/ai-dial-chat-hooks 1.1.0-dev.411 → 1.1.0-dev.418
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.js +1 -1
- package/conversation-transfer.js +1 -1
- package/file-manager.d.ts +7 -3
- package/file-manager.js +1 -1
- package/index.d.ts +7 -3
- package/index.js +5 -5
- package/package.json +15 -15
- package/skill-editor.js +2 -2
- package/{skill-manifest-CCX8s4nn.js → skill-manifest-CeG6-WSK.js} +374 -353
- package/{useConversationImport-C2h1GBY4.js → useConversationImport-M6p86dtf.js} +108 -90
- package/{useDialFileManagerTabConfig-CljXkfhP.js → useDialFileManagerTabConfig-CjI46lMo.js} +534 -532
- package/{useSkillFileActions-BU5PzZ_8.js → useSkillFileActions-B-VaGD20.js} +1 -1
- package/{useSkillFilePreview-Dkx9F4D-.js → useSkillFilePreview-B5o1n_0F.js} +255 -255
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as e } from "./api-error-DuLNy43N.js";
|
|
2
|
-
import { i as t, n
|
|
3
|
-
import { n as
|
|
4
|
-
import { T as
|
|
5
|
-
import { n as
|
|
6
|
-
import { t as
|
|
7
|
-
import { r as
|
|
8
|
-
import { CatalogEntityType as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { mimeTypesToExtensionLabels as
|
|
2
|
+
import { i as t, r as n } from "./string-utils-iBi2Y55C.js";
|
|
3
|
+
import { n as r } from "./deployment-id-CxWgJTs9.js";
|
|
4
|
+
import { T as i, g as a, h as o, n as s, t as c } from "./useToolsetLogin-B05m134e.js";
|
|
5
|
+
import { n as l, s as u, t as d } from "./prompt-resource-Bt1I-8ri.js";
|
|
6
|
+
import { t as f } from "./formatting-CZyyxBG3.js";
|
|
7
|
+
import { r as p, t as m } from "./skill-manifest-CeG6-WSK.js";
|
|
8
|
+
import { CatalogEntityType as h, extractPromptParams as g, formatCost as _, formatLastUsed as v, formatUnitPrice as y } from "@epam/ai-dial-chat-shared";
|
|
9
|
+
import { useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
10
|
+
import { mimeTypesToExtensionLabels as T } from "@epam/ai-dial-attachment-input";
|
|
11
11
|
import { CatalogContentNodeType as E, CatalogLimitStatus as D, CodeLanguage as O, CredentialStatus as k, CredentialsLevel as A, ToolsetAuthenticationType as j } from "@epam/ai-dial-catalog";
|
|
12
|
-
import { ListFilesItemDtoNodeTypeEnum as
|
|
13
|
-
import { NotificationVariant as
|
|
12
|
+
import { ListFilesItemDtoNodeTypeEnum as ee, SkillMetadataItemDtoNodeTypeEnum as te } from "@epam/ai-dial-chat-api-client";
|
|
13
|
+
import { NotificationVariant as M } from "@epam/ai-dial-ui-kit";
|
|
14
14
|
import { fromFolderPathKey as ne, mergeFolderPaths as re, toFolderPathKey as ie } from "@epam/ai-dial-publish-panel";
|
|
15
15
|
//#region src/catalog/create-publish-api.ts
|
|
16
16
|
var ae = (e) => ({
|
|
@@ -36,7 +36,7 @@ var ae = (e) => ({
|
|
|
36
36
|
...t,
|
|
37
37
|
function: e
|
|
38
38
|
}))
|
|
39
|
-
}), se = (e) => e.endsWith("/") ? e.slice(0, -1) : e, ce = (e) => e.split("/").map((e) => encodeURIComponent(
|
|
39
|
+
}), se = (e) => e.endsWith("/") ? e.slice(0, -1) : e, ce = (e) => e.split("/").map((e) => encodeURIComponent(n(e))).join("/"), le = (e) => e.split("/").map(n).join("/"), ue = (e, t) => `${se(e)}/openai/deployments/${ce(t)}/chat/completions`, de = (e) => `${se(e)}/openai/v1/responses`, fe = (e, t, { hasChatCompletion: n, hasResponsesApi: r }) => {
|
|
40
40
|
let i = [];
|
|
41
41
|
if (n) {
|
|
42
42
|
let n = ue(e, t);
|
|
@@ -64,7 +64,7 @@ var ae = (e) => ({
|
|
|
64
64
|
resource: { modelId: le(t) },
|
|
65
65
|
endpoints: i
|
|
66
66
|
};
|
|
67
|
-
},
|
|
67
|
+
}, N = /* @__PURE__ */ function(e) {
|
|
68
68
|
return e.None = "NONE", e.ApiKey = "API_KEY", e.OAuth = "OAUTH", e;
|
|
69
69
|
}({}), pe = [
|
|
70
70
|
{
|
|
@@ -82,16 +82,16 @@ var ae = (e) => ({
|
|
|
82
82
|
labelField: "tokensPerMonth",
|
|
83
83
|
costKey: "monthCostStats"
|
|
84
84
|
}
|
|
85
|
-
], me = 2 ** 53 - 1, he = .75, ge = [1e6, 1e3],
|
|
85
|
+
], me = 2 ** 53 - 1, he = .75, ge = [1e6, 1e3], P = new Intl.NumberFormat(void 0, {
|
|
86
86
|
notation: "compact",
|
|
87
87
|
maximumFractionDigits: 1
|
|
88
|
-
}),
|
|
88
|
+
}), F = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), _e = (e) => {
|
|
89
89
|
let t = ge.find((t) => Math.abs(e) >= t);
|
|
90
90
|
return t == null ? e : Math.trunc(e / t * 10) / 10 * t;
|
|
91
|
-
}, ve = (e) => e != null && Number.isFinite(e.total) && Number.isFinite(e.used) && e.total > 0,
|
|
92
|
-
if (ye(e)) return t.formatSpentCaption(
|
|
91
|
+
}, ve = (e) => e != null && Number.isFinite(e.total) && Number.isFinite(e.used) && e.total > 0, I = (e) => e >= me, ye = (e) => e != null && Number.isFinite(e.total) && Number.isFinite(e.used), be = (e, t) => {
|
|
92
|
+
if (ye(e)) return t.formatSpentCaption(_(Math.max(0, e.used)));
|
|
93
93
|
}, xe = (e, t, n, r) => {
|
|
94
|
-
let i = Math.max(0, e.used), a = e.total, o =
|
|
94
|
+
let i = Math.max(0, e.used), a = e.total, o = P.format(_e(i)), s = P.format(a), c = F.format(i), l = F.format(a), u = I(a);
|
|
95
95
|
return {
|
|
96
96
|
label: t,
|
|
97
97
|
used: i,
|
|
@@ -114,10 +114,10 @@ var ae = (e) => ({
|
|
|
114
114
|
total: l
|
|
115
115
|
})
|
|
116
116
|
};
|
|
117
|
-
}, Se = (e) =>
|
|
117
|
+
}, Se = (e) => I(e.total) ? 0 : Math.max(e.used, 0) / e.total, Ce = (e) => e.reduce((e, t) => {
|
|
118
118
|
let n = Se(t);
|
|
119
119
|
return n >= 1 ? D.LimitReached : n >= he && e !== D.LimitReached ? D.RunningLow : e;
|
|
120
|
-
}, void 0),
|
|
120
|
+
}, void 0), L = (e, t) => {
|
|
121
121
|
if (e == null) return;
|
|
122
122
|
let n = [], r = pe.flatMap((r) => {
|
|
123
123
|
let i = e[r.key];
|
|
@@ -143,11 +143,11 @@ var ae = (e) => ({
|
|
|
143
143
|
remaining: Math.max(0, t.total - n),
|
|
144
144
|
usedPercent: Math.min(100, Math.round(n / t.total * 100))
|
|
145
145
|
};
|
|
146
|
-
},
|
|
146
|
+
}, R = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens` : `${e} tokens`, z = (e) => {
|
|
147
147
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
148
148
|
if (t == null) return e;
|
|
149
149
|
let [, n, r, i] = t, a = Number(n), o = Number(r) - 1, s = Number(i), c = new Date(a, o, s);
|
|
150
|
-
return c.getFullYear() !== a || c.getMonth() !== o || c.getDate() !== s ? e :
|
|
150
|
+
return c.getFullYear() !== a || c.getMonth() !== o || c.getDate() !== s ? e : f(c.getTime());
|
|
151
151
|
}, Te = "unit", Ee = (e) => {
|
|
152
152
|
let t = [];
|
|
153
153
|
if (e.capabilities != null) {
|
|
@@ -179,7 +179,7 @@ var ae = (e) => ({
|
|
|
179
179
|
value: n.license
|
|
180
180
|
}), n.knowledgeCutoffDate != null && r.push({
|
|
181
181
|
label: "Knowledge cutoff date",
|
|
182
|
-
value:
|
|
182
|
+
value: z(n.knowledgeCutoffDate)
|
|
183
183
|
}), n.parameters != null && r.push({
|
|
184
184
|
label: "Parameters",
|
|
185
185
|
value: n.parameters
|
|
@@ -188,16 +188,16 @@ var ae = (e) => ({
|
|
|
188
188
|
value: n.hostedBy
|
|
189
189
|
}), n.createdAt != null && r.push({
|
|
190
190
|
label: "Release date",
|
|
191
|
-
value:
|
|
191
|
+
value: f(n.createdAt)
|
|
192
192
|
}), n.contextWindowTokens != null && r.push({
|
|
193
193
|
label: "Context window",
|
|
194
|
-
value:
|
|
194
|
+
value: R(n.contextWindowTokens)
|
|
195
195
|
}), n.maxOutputTokens != null && r.push({
|
|
196
196
|
label: "Max output tokens",
|
|
197
|
-
value:
|
|
197
|
+
value: R(n.maxOutputTokens)
|
|
198
198
|
}), n.inputTypes?.length && r.push({
|
|
199
199
|
label: "Input modalities",
|
|
200
|
-
value:
|
|
200
|
+
value: T(n.inputTypes)
|
|
201
201
|
}), r.length > 0 && t.push({
|
|
202
202
|
title: "Specification",
|
|
203
203
|
specs: r
|
|
@@ -216,16 +216,16 @@ var ae = (e) => ({
|
|
|
216
216
|
cacheRead: "Cached input",
|
|
217
217
|
cache_write: "Cached write",
|
|
218
218
|
cacheWrite: "Cached write"
|
|
219
|
-
},
|
|
219
|
+
}, B = [
|
|
220
220
|
"prompt",
|
|
221
221
|
"completion",
|
|
222
222
|
"cache_read",
|
|
223
223
|
"cacheRead",
|
|
224
224
|
"cache_write",
|
|
225
225
|
"cacheWrite"
|
|
226
|
-
],
|
|
227
|
-
let t =
|
|
228
|
-
return t === -1 ?
|
|
226
|
+
], V = (e) => {
|
|
227
|
+
let t = B.indexOf(e);
|
|
228
|
+
return t === -1 ? B.length : t;
|
|
229
229
|
}, Oe = (e) => {
|
|
230
230
|
let t = De[e];
|
|
231
231
|
if (t != null) return t;
|
|
@@ -233,7 +233,7 @@ var ae = (e) => ({
|
|
|
233
233
|
return n === "" ? e : ` ${n.charAt(0).toUpperCase()}${n.slice(1)}`;
|
|
234
234
|
}, ke = (e) => {
|
|
235
235
|
if (e == null) return;
|
|
236
|
-
let t = [...e.prices ?? []].sort((e, t) =>
|
|
236
|
+
let t = [...e.prices ?? []].sort((e, t) => V(e.key) - V(t.key)).map(({ key: e, price: t }) => ({
|
|
237
237
|
label: Oe(e),
|
|
238
238
|
price: t
|
|
239
239
|
}));
|
|
@@ -256,7 +256,7 @@ var ae = (e) => ({
|
|
|
256
256
|
value: n.license
|
|
257
257
|
}), n.knowledgeCutoffDate != null && r.push({
|
|
258
258
|
label: "Knowledge cutoff date",
|
|
259
|
-
value:
|
|
259
|
+
value: z(n.knowledgeCutoffDate)
|
|
260
260
|
}), n.parameters != null && r.push({
|
|
261
261
|
label: "Parameters",
|
|
262
262
|
value: n.parameters
|
|
@@ -265,7 +265,7 @@ var ae = (e) => ({
|
|
|
265
265
|
value: n.hostedBy
|
|
266
266
|
}), n.createdAt != null && r.push({
|
|
267
267
|
label: "Release date",
|
|
268
|
-
value:
|
|
268
|
+
value: f(n.createdAt)
|
|
269
269
|
}), n.routes?.length && r.push({
|
|
270
270
|
label: "Routes",
|
|
271
271
|
value: n.routes.join(" · ")
|
|
@@ -294,7 +294,7 @@ var ae = (e) => ({
|
|
|
294
294
|
let { configuration: n } = e, r = [];
|
|
295
295
|
n.inputAttachmentTypes?.length && r.push({
|
|
296
296
|
label: "Input attachments",
|
|
297
|
-
value:
|
|
297
|
+
value: T(n.inputAttachmentTypes)
|
|
298
298
|
}), r.length > 0 && t.push({
|
|
299
299
|
title: "Configuration",
|
|
300
300
|
specs: r
|
|
@@ -302,29 +302,29 @@ var ae = (e) => ({
|
|
|
302
302
|
}
|
|
303
303
|
return { overview: t.length > 0 ? { sections: t } : void 0 };
|
|
304
304
|
}, Me = {
|
|
305
|
-
[
|
|
306
|
-
[
|
|
307
|
-
[
|
|
308
|
-
},
|
|
305
|
+
[N.None]: j.None,
|
|
306
|
+
[N.ApiKey]: j.ApiKey,
|
|
307
|
+
[N.OAuth]: j.OAuth
|
|
308
|
+
}, H = {
|
|
309
309
|
SIGNED_IN: k.SignedIn,
|
|
310
310
|
SIGNED_OUT: k.SignedOut,
|
|
311
311
|
FAILED: k.Failed
|
|
312
|
-
},
|
|
313
|
-
let r = Me[t.specification?.authentication ??
|
|
312
|
+
}, Ne = (e, t, n) => {
|
|
313
|
+
let r = Me[t.specification?.authentication ?? N.None];
|
|
314
314
|
if (r == null) return;
|
|
315
|
-
let { userLevel:
|
|
315
|
+
let { userLevel: a, global: o } = t.specification?.authStatus ?? {}, s = i(e);
|
|
316
316
|
return {
|
|
317
317
|
authenticationType: r,
|
|
318
|
-
userStatus:
|
|
319
|
-
globalStatus: o ?
|
|
318
|
+
userStatus: a ? H[a] : void 0,
|
|
319
|
+
globalStatus: o ? H[o] : void 0,
|
|
320
320
|
isPublic: s,
|
|
321
321
|
isManageableByAdmin: n && s,
|
|
322
322
|
apiKeyHeader: t.specification?.authStatus?.apiKeyHeader
|
|
323
323
|
};
|
|
324
|
-
},
|
|
324
|
+
}, Pe = (e) => {
|
|
325
325
|
let t = e?.permissions?.length ? e.permissions : e?.allTools;
|
|
326
326
|
if (t?.length) return { tools: t.map((e) => ({ name: e })) };
|
|
327
|
-
},
|
|
327
|
+
}, Fe = (e) => {
|
|
328
328
|
let t = [];
|
|
329
329
|
if (e.specification != null) {
|
|
330
330
|
let { specification: n } = e, r = [];
|
|
@@ -342,7 +342,7 @@ var ae = (e) => ({
|
|
|
342
342
|
value: n.license
|
|
343
343
|
}), n.knowledgeCutoffDate != null && r.push({
|
|
344
344
|
label: "Knowledge cutoff date",
|
|
345
|
-
value:
|
|
345
|
+
value: z(n.knowledgeCutoffDate)
|
|
346
346
|
}), n.parameters != null && r.push({
|
|
347
347
|
label: "Parameters",
|
|
348
348
|
value: n.parameters
|
|
@@ -351,7 +351,7 @@ var ae = (e) => ({
|
|
|
351
351
|
value: n.hostedBy
|
|
352
352
|
}), n.createdAt != null && r.push({
|
|
353
353
|
label: "Release date",
|
|
354
|
-
value:
|
|
354
|
+
value: f(n.createdAt)
|
|
355
355
|
}), n.authStatus?.scopesSupported?.length && r.push({
|
|
356
356
|
label: "OAuth scopes",
|
|
357
357
|
value: n.authStatus.scopesSupported.join(" · ")
|
|
@@ -368,13 +368,13 @@ var ae = (e) => ({
|
|
|
368
368
|
}
|
|
369
369
|
return {
|
|
370
370
|
overview: t.length > 0 ? { sections: t } : void 0,
|
|
371
|
-
tools:
|
|
371
|
+
tools: Pe(e.specification)
|
|
372
372
|
};
|
|
373
373
|
}, U = (e) => {
|
|
374
374
|
switch (e.type) {
|
|
375
375
|
case "MODEL": return Ee(e.data);
|
|
376
376
|
case "AGENT": return je(e.data);
|
|
377
|
-
case "TOOLSET": return
|
|
377
|
+
case "TOOLSET": return Fe(e.data);
|
|
378
378
|
}
|
|
379
379
|
}, W = (e) => {
|
|
380
380
|
if (e != null) return {
|
|
@@ -392,18 +392,18 @@ var ae = (e) => ({
|
|
|
392
392
|
hasResponsesApi: e.responsesApi,
|
|
393
393
|
reasoningEfforts: e.reasoningEfforts
|
|
394
394
|
};
|
|
395
|
-
},
|
|
395
|
+
}, Ie = (e) => {
|
|
396
396
|
if (e == null) return;
|
|
397
397
|
let { unit: t } = e, n = Object.entries(e).flatMap(([e, n]) => {
|
|
398
398
|
if (e === Te || typeof n != "string" || n.trim() === "") return [];
|
|
399
|
-
let r =
|
|
399
|
+
let r = y(n, t);
|
|
400
400
|
return r == null ? [] : [{
|
|
401
401
|
key: e,
|
|
402
402
|
price: r
|
|
403
403
|
}];
|
|
404
404
|
});
|
|
405
405
|
return n.length > 0 ? { prices: n } : void 0;
|
|
406
|
-
},
|
|
406
|
+
}, Le = (e) => {
|
|
407
407
|
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;
|
|
408
408
|
return {
|
|
409
409
|
type: "MODEL",
|
|
@@ -421,11 +421,11 @@ var ae = (e) => ({
|
|
|
421
421
|
hostedBy: a,
|
|
422
422
|
createdAt: c
|
|
423
423
|
} : void 0,
|
|
424
|
-
pricing:
|
|
424
|
+
pricing: Ie(n),
|
|
425
425
|
api: { modelId: e.id }
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
|
-
},
|
|
428
|
+
}, Re = (e) => {
|
|
429
429
|
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;
|
|
430
430
|
return {
|
|
431
431
|
type: "AGENT",
|
|
@@ -444,7 +444,7 @@ var ae = (e) => ({
|
|
|
444
444
|
configuration: r?.length ? { inputAttachmentTypes: r } : void 0
|
|
445
445
|
}
|
|
446
446
|
};
|
|
447
|
-
},
|
|
447
|
+
}, ze = (e) => e === N.None || e === N.ApiKey || e === N.OAuth, Be = (e) => {
|
|
448
448
|
if (e == null) return;
|
|
449
449
|
let { globalAuthStatus: t, appLevelAuthStatus: n, userLevelAuthStatus: r, scopesSupported: i, authorizationEndpoint: a, tokenEndpoint: o, apiKeyHeader: s } = e;
|
|
450
450
|
if (!(t == null && n == null && r == null && a == null && o == null && s == null && !i?.length)) return {
|
|
@@ -456,14 +456,14 @@ var ae = (e) => ({
|
|
|
456
456
|
tokenEndpoint: o,
|
|
457
457
|
apiKeyHeader: s
|
|
458
458
|
};
|
|
459
|
-
},
|
|
459
|
+
}, Ve = (e) => {
|
|
460
460
|
let t = e.toolsetDetails, n = t?.authSettings?.authenticationType;
|
|
461
461
|
return {
|
|
462
462
|
type: "TOOLSET",
|
|
463
463
|
data: {
|
|
464
464
|
capabilities: W(t?.features),
|
|
465
465
|
specification: t == null ? void 0 : {
|
|
466
|
-
authentication:
|
|
466
|
+
authentication: ze(n) ? n : void 0,
|
|
467
467
|
provider: t.catalogProperties?.provider,
|
|
468
468
|
vendor: t.catalogProperties?.vendor,
|
|
469
469
|
license: t.catalogProperties?.license,
|
|
@@ -473,59 +473,59 @@ var ae = (e) => ({
|
|
|
473
473
|
allTools: t.allToolNames,
|
|
474
474
|
hostedBy: t.owner,
|
|
475
475
|
createdAt: t.createdAt,
|
|
476
|
-
authStatus:
|
|
476
|
+
authStatus: Be(t.authSettings)
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
|
-
},
|
|
480
|
+
}, He = (e) => {
|
|
481
481
|
switch (e.type) {
|
|
482
|
-
case "model": return
|
|
483
|
-
case "application": return
|
|
484
|
-
case "toolset": return
|
|
482
|
+
case "model": return Le(e);
|
|
483
|
+
case "application": return Re(e);
|
|
484
|
+
case "toolset": return Ve(e);
|
|
485
485
|
}
|
|
486
|
-
},
|
|
486
|
+
}, Ue = {
|
|
487
487
|
NONE: j.None,
|
|
488
488
|
API_KEY: j.ApiKey,
|
|
489
489
|
OAUTH: j.OAuth
|
|
490
|
-
},
|
|
490
|
+
}, We = {
|
|
491
491
|
SIGNED_IN: k.SignedIn,
|
|
492
492
|
SIGNED_OUT: k.SignedOut,
|
|
493
493
|
FAILED: k.Failed
|
|
494
|
-
},
|
|
494
|
+
}, Ge = (e, t, n) => {
|
|
495
495
|
if (t == null) return;
|
|
496
|
-
let r =
|
|
496
|
+
let r = i(e), a = t.userLevelAuthStatus ? We[t.userLevelAuthStatus] : void 0, o = t.globalAuthStatus ? We[t.globalAuthStatus] : void 0;
|
|
497
497
|
return {
|
|
498
|
-
authenticationType: !n && r &&
|
|
499
|
-
userStatus:
|
|
498
|
+
authenticationType: !n && r && a !== k.SignedIn && o === k.SignedIn ? j.None : Ue[t.authenticationType],
|
|
499
|
+
userStatus: a,
|
|
500
500
|
globalStatus: o,
|
|
501
501
|
isPublic: r,
|
|
502
502
|
isManageableByAdmin: n && r,
|
|
503
503
|
apiKeyHeader: t.apiKeyHeader
|
|
504
504
|
};
|
|
505
|
-
},
|
|
506
|
-
model:
|
|
507
|
-
toolset:
|
|
508
|
-
application:
|
|
509
|
-
},
|
|
505
|
+
}, Ke = {
|
|
506
|
+
model: h.Model,
|
|
507
|
+
toolset: h.Toolset,
|
|
508
|
+
application: h.Agent
|
|
509
|
+
}, qe = "applications/", Je = "toolsets/", G = "public", Ye = (e, t) => (e.startsWith(t) ? e.slice(t.length) : e).split("/").filter(Boolean).map(n), Xe = (e, t) => {
|
|
510
510
|
if (e.isMy) return [t.personal];
|
|
511
|
-
let n =
|
|
512
|
-
return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n[0]?.toLowerCase() ===
|
|
513
|
-
},
|
|
511
|
+
let n = Ye(e.applicationFolder ?? "", qe);
|
|
512
|
+
return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n[0]?.toLowerCase() === G ? [t.public, ...n.slice(1)] : n;
|
|
513
|
+
}, Ze = (e, t) => {
|
|
514
514
|
if (e.isMy && t != null) return [t.personal];
|
|
515
515
|
let n = e.toolset || e.id;
|
|
516
|
-
if (!n.startsWith(
|
|
517
|
-
let r =
|
|
518
|
-
return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() ===
|
|
519
|
-
},
|
|
520
|
-
let l =
|
|
516
|
+
if (!n.startsWith(Je)) return [];
|
|
517
|
+
let r = Ye(n, Je).slice(0, -1);
|
|
518
|
+
return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() === G && t != null ? [t.public, ...r.slice(1)] : r.slice(1);
|
|
519
|
+
}, Qe = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: n, folderLabels: r, editableSchemaIds: i = [], isCustomAppsEditable: a = !1, activeLocale: o, primaryLocale: s, resolveIconUrl: c }) => {
|
|
520
|
+
let l = u(e.displayName, o, s) || e.id, d = (e.type ?? "").toLowerCase();
|
|
521
521
|
return {
|
|
522
522
|
id: e.id,
|
|
523
|
-
type:
|
|
523
|
+
type: Ke[d] ?? h.Model,
|
|
524
524
|
name: l,
|
|
525
|
-
description:
|
|
525
|
+
description: u(e.description, o, s),
|
|
526
526
|
iconUrl: c(e.iconUrl),
|
|
527
527
|
version: e.displayVersion ?? "",
|
|
528
|
-
lastUsed:
|
|
528
|
+
lastUsed: v(e.updatedAt),
|
|
529
529
|
updatedAt: e.updatedAt,
|
|
530
530
|
createdAt: e.createdAt,
|
|
531
531
|
isFeatured: e.isFeatured ?? !1,
|
|
@@ -535,22 +535,22 @@ var ae = (e) => ({
|
|
|
535
535
|
isStarred: t.has(e.id),
|
|
536
536
|
isMyApp: e.isMy ?? !1,
|
|
537
537
|
sharedWithMe: e.sharedWithMe ?? !1,
|
|
538
|
-
isEditable: (!!e.isMy || !!e.canEdit) && (i.length > 0 && i.includes(e.applicationTypeSchemaId ?? "") || a && !e.applicationTypeSchemaId &&
|
|
539
|
-
folder:
|
|
538
|
+
isEditable: (!!e.isMy || !!e.canEdit) && (i.length > 0 && i.includes(e.applicationTypeSchemaId ?? "") || a && !e.applicationTypeSchemaId && d === "application"),
|
|
539
|
+
folder: Xe(e, r),
|
|
540
540
|
details: n == null ? void 0 : U(n),
|
|
541
541
|
supportsMcp: e.features?.mcp === !0,
|
|
542
542
|
supportsChat: e.interfaces == null || e.interfaces.includes("chat")
|
|
543
543
|
};
|
|
544
|
-
},
|
|
545
|
-
let s =
|
|
544
|
+
}, $e = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), isAdmin: n = !1, folderLabels: r, activeLocale: i, primaryLocale: a, resolveIconUrl: o }) => {
|
|
545
|
+
let s = u(e.displayName, i, a) || e.toolset || e.reference || e.id, c = e.allowedTools ?? [];
|
|
546
546
|
return {
|
|
547
547
|
id: e.id,
|
|
548
|
-
type:
|
|
548
|
+
type: h.Toolset,
|
|
549
549
|
name: s,
|
|
550
|
-
description:
|
|
550
|
+
description: u(e.description, i, a),
|
|
551
551
|
iconUrl: o(e.iconUrl),
|
|
552
552
|
version: e.displayVersion ?? "",
|
|
553
|
-
lastUsed:
|
|
553
|
+
lastUsed: v(e.updatedAt),
|
|
554
554
|
updatedAt: e.updatedAt,
|
|
555
555
|
createdAt: e.createdAt,
|
|
556
556
|
isFeatured: !1,
|
|
@@ -561,35 +561,35 @@ var ae = (e) => ({
|
|
|
561
561
|
isMyApp: e.isMy ?? !1,
|
|
562
562
|
sharedWithMe: e.sharedWithMe ?? !1,
|
|
563
563
|
isEditable: !!(e.isMy || e.canEdit),
|
|
564
|
-
folder:
|
|
565
|
-
credentials:
|
|
564
|
+
folder: Ze(e, r),
|
|
565
|
+
credentials: Ge(e.id, e.authSettings, n),
|
|
566
566
|
details: c.length > 0 ? { tools: { tools: c.map((e) => ({ name: e })) } } : void 0
|
|
567
567
|
};
|
|
568
|
-
},
|
|
569
|
-
[
|
|
570
|
-
[
|
|
571
|
-
[
|
|
572
|
-
},
|
|
568
|
+
}, et = {
|
|
569
|
+
[d.Personal]: "personal",
|
|
570
|
+
[d.SharedWithMe]: "shared",
|
|
571
|
+
[d.Public]: "public"
|
|
572
|
+
}, tt = (e, t, r) => [r[et[t]], ...e.split("/").filter(Boolean).map(n)], K = (e, t) => {
|
|
573
573
|
let n = [];
|
|
574
574
|
return e.author && n.push({
|
|
575
575
|
label: t.authorLabel,
|
|
576
576
|
value: e.author
|
|
577
577
|
}), n.push({
|
|
578
578
|
label: t.updatedLabel,
|
|
579
|
-
value:
|
|
579
|
+
value: f(e.updatedAt)
|
|
580
580
|
}), { sections: [{
|
|
581
581
|
title: t.sectionTitle,
|
|
582
582
|
specs: n
|
|
583
583
|
}] };
|
|
584
|
-
},
|
|
585
|
-
let a = r ===
|
|
584
|
+
}, nt = (e) => !e.isMyApp && !e.sharedWithMe, rt = (e, { folderLabels: t, overviewLabels: n, source: r, favoriteIds: i }) => {
|
|
585
|
+
let a = r === d.Personal, o = e.id, s = i.has(o);
|
|
586
586
|
return {
|
|
587
587
|
id: o,
|
|
588
|
-
type:
|
|
588
|
+
type: h.Prompt,
|
|
589
589
|
name: e.name,
|
|
590
590
|
description: e.description ?? "",
|
|
591
591
|
version: "",
|
|
592
|
-
lastUsed:
|
|
592
|
+
lastUsed: v(e.updatedAt),
|
|
593
593
|
createdAt: e.createdAt,
|
|
594
594
|
updatedAt: e.updatedAt,
|
|
595
595
|
isFeatured: !1,
|
|
@@ -598,9 +598,9 @@ var ae = (e) => ({
|
|
|
598
598
|
isUserFavorite: s,
|
|
599
599
|
isStarred: s,
|
|
600
600
|
isMyApp: e.isMy ?? a,
|
|
601
|
-
sharedWithMe: e.sharedWithMe ?? r ===
|
|
602
|
-
isEditable: r !==
|
|
603
|
-
folder:
|
|
601
|
+
sharedWithMe: e.sharedWithMe ?? r === d.SharedWithMe,
|
|
602
|
+
isEditable: r !== d.Public && (e.canEdit ?? a),
|
|
603
|
+
folder: tt(e.folderId, r, t),
|
|
604
604
|
details: {
|
|
605
605
|
...e.content ? { promptContent: { content: e.content } } : void 0,
|
|
606
606
|
overview: K(e, n)
|
|
@@ -608,8 +608,8 @@ var ae = (e) => ({
|
|
|
608
608
|
};
|
|
609
609
|
}, q = /* @__PURE__ */ function(e) {
|
|
610
610
|
return e.Personal = "personal", e.SharedWithMe = "sharedWithMe", e.Public = "public", e;
|
|
611
|
-
}({}),
|
|
612
|
-
if (!e.startsWith(
|
|
611
|
+
}({}), it = "public", at = "skills/", ot = 256 * 1024, st = 1e3, ct = 10, J = (e) => {
|
|
612
|
+
if (!e.startsWith(at)) return null;
|
|
613
613
|
let t = e.slice(7), n = t.indexOf("/");
|
|
614
614
|
if (n <= 0) return null;
|
|
615
615
|
let r = t.slice(0, n), i = t.slice(n + 1);
|
|
@@ -617,19 +617,19 @@ var ae = (e) => ({
|
|
|
617
617
|
bucket: r,
|
|
618
618
|
path: i
|
|
619
619
|
};
|
|
620
|
-
},
|
|
620
|
+
}, lt = {
|
|
621
621
|
[q.Personal]: "personal",
|
|
622
622
|
[q.SharedWithMe]: "shared",
|
|
623
623
|
[q.Public]: "public"
|
|
624
|
-
},
|
|
624
|
+
}, ut = (e, t, r) => [r[lt[t]], ...(e ?? "").split("/").filter(Boolean).map(n)], dt = (e, { folderLabels: t, source: n, favoriteIds: r }) => {
|
|
625
625
|
let i = r.has(e.url), a = n === q.Public, o = n === q.Personal;
|
|
626
626
|
return {
|
|
627
627
|
id: e.url,
|
|
628
|
-
type:
|
|
628
|
+
type: h.Skill,
|
|
629
629
|
name: e.name,
|
|
630
630
|
description: "",
|
|
631
631
|
version: "",
|
|
632
|
-
lastUsed:
|
|
632
|
+
lastUsed: v(e.updatedAt),
|
|
633
633
|
createdAt: e.createdAt,
|
|
634
634
|
updatedAt: e.updatedAt,
|
|
635
635
|
isFeatured: !1,
|
|
@@ -640,9 +640,9 @@ var ae = (e) => ({
|
|
|
640
640
|
isMyApp: o && (e.isMy ?? !0),
|
|
641
641
|
sharedWithMe: e.sharedWithMe ?? n === q.SharedWithMe,
|
|
642
642
|
isEditable: !a && (e.canEdit ?? o),
|
|
643
|
-
folder:
|
|
643
|
+
folder: ut(e.parentPath, n, t)
|
|
644
644
|
};
|
|
645
|
-
},
|
|
645
|
+
}, ft = (e) => e.join(" · "), pt = (e, t) => {
|
|
646
646
|
if (e == null) return null;
|
|
647
647
|
let n = [];
|
|
648
648
|
return e.whenToUse != null && n.push({
|
|
@@ -650,25 +650,25 @@ var ae = (e) => ({
|
|
|
650
650
|
value: e.whenToUse
|
|
651
651
|
}), e.allowedTools?.length && n.push({
|
|
652
652
|
label: t.allowedToolsLabel,
|
|
653
|
-
value:
|
|
653
|
+
value: ft(e.allowedTools)
|
|
654
654
|
}), e.bundledResources?.length && n.push({
|
|
655
655
|
label: t.bundledResourcesLabel,
|
|
656
|
-
value:
|
|
656
|
+
value: ft(e.bundledResources)
|
|
657
657
|
}), n.length === 0 ? null : {
|
|
658
658
|
title: t.specificationSectionTitle,
|
|
659
659
|
specs: n
|
|
660
660
|
};
|
|
661
|
-
},
|
|
661
|
+
}, mt = (e) => e.filter((e) => e.nodeType === te.Item), ht = (e, n) => {
|
|
662
662
|
let r = t(n), i = r ? `${r}/files` : "files";
|
|
663
|
-
return
|
|
663
|
+
return mt(e).find((e) => {
|
|
664
664
|
let n = t(e.path);
|
|
665
665
|
return n === "SKILL.md" || n === "files/SKILL.md" || n === `${i}/SKILL.md`;
|
|
666
666
|
})?.path ?? "SKILL.md";
|
|
667
|
-
},
|
|
667
|
+
}, gt = (e, n) => {
|
|
668
668
|
let r = t(e), i = t(n), a = i ? `${i}/files` : "files";
|
|
669
669
|
return r === "" || r === "files" || r === a ? null : r.startsWith(`${a}/`) ? r.slice(a.length + 1) : r.startsWith("files/") ? r.slice(6) : r;
|
|
670
|
-
}, Y = (e, t) =>
|
|
671
|
-
let i = [], a =
|
|
670
|
+
}, Y = (e, t) => gt(e, t), _t = (e, t, n, r) => {
|
|
671
|
+
let i = [], a = pt(n, r);
|
|
672
672
|
a != null && i.push(a);
|
|
673
673
|
let o = [];
|
|
674
674
|
return e?.author && o.push({
|
|
@@ -676,10 +676,10 @@ var ae = (e) => ({
|
|
|
676
676
|
value: e.author
|
|
677
677
|
}), o.push({
|
|
678
678
|
label: r.updatedLabel,
|
|
679
|
-
value: e?.updatedAt ?
|
|
679
|
+
value: e?.updatedAt ? f(e.updatedAt) : ""
|
|
680
680
|
}), o.push({
|
|
681
681
|
label: r.fileCountLabel,
|
|
682
|
-
value: String(
|
|
682
|
+
value: String(mt(t).length)
|
|
683
683
|
}), i.push({
|
|
684
684
|
title: r.detailsSectionTitle,
|
|
685
685
|
specs: o
|
|
@@ -695,7 +695,7 @@ var ae = (e) => ({
|
|
|
695
695
|
items: []
|
|
696
696
|
};
|
|
697
697
|
return t.set(e, o), a.push(o), o.items;
|
|
698
|
-
},
|
|
698
|
+
}, vt = (e, t) => {
|
|
699
699
|
e.sort((e, n) => {
|
|
700
700
|
if (t) {
|
|
701
701
|
if (e.name === "SKILL.md") return -1;
|
|
@@ -703,13 +703,13 @@ var ae = (e) => ({
|
|
|
703
703
|
}
|
|
704
704
|
return e.name.localeCompare(n.name);
|
|
705
705
|
});
|
|
706
|
-
for (let t of e) t.type === E.Folder &&
|
|
707
|
-
},
|
|
706
|
+
for (let t of e) t.type === E.Folder && vt(t.items, !1);
|
|
707
|
+
}, yt = (e, t) => {
|
|
708
708
|
let n = /* @__PURE__ */ new Map(), r = [];
|
|
709
709
|
for (let i of e) {
|
|
710
|
-
let e =
|
|
710
|
+
let e = gt(i.path, t);
|
|
711
711
|
if (e == null) continue;
|
|
712
|
-
if (i.nodeType ===
|
|
712
|
+
if (i.nodeType === te.Folder) {
|
|
713
713
|
X(e, n, r);
|
|
714
714
|
continue;
|
|
715
715
|
}
|
|
@@ -720,7 +720,7 @@ var ae = (e) => ({
|
|
|
720
720
|
name: i.name
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
|
-
return
|
|
723
|
+
return vt(r, !0), r;
|
|
724
724
|
}, Z = async (e) => {
|
|
725
725
|
let t = Number(e.headers.get("content-length"));
|
|
726
726
|
if (Number.isFinite(t) && t > 262144) return null;
|
|
@@ -729,19 +729,19 @@ var ae = (e) => ({
|
|
|
729
729
|
}, Q = async (e) => {
|
|
730
730
|
let t = await Z(e);
|
|
731
731
|
return t == null ? null : new TextDecoder().decode(t);
|
|
732
|
-
},
|
|
732
|
+
}, bt = /* @__PURE__ */ function(e) {
|
|
733
733
|
return e.Toolset = "toolset", e.Application = "application", e;
|
|
734
|
-
}({}),
|
|
734
|
+
}({}), xt = (e) => {
|
|
735
735
|
try {
|
|
736
736
|
return decodeURIComponent(e);
|
|
737
737
|
} catch {
|
|
738
738
|
return e;
|
|
739
739
|
}
|
|
740
|
-
},
|
|
741
|
-
toolset:
|
|
742
|
-
application:
|
|
743
|
-
},
|
|
744
|
-
let r =
|
|
740
|
+
}, St = (e) => e.split("/").map((e) => encodeURIComponent(xt(e))).join("/"), Ct = (e) => e.endsWith("/") ? e.slice(0, -1) : e, wt = (e, t) => `${Ct(e)}/v1/toolset/${St(t)}/mcp`, Tt = (e, t) => `${Ct(e)}/v1/deployments/${St(t)}/mcp`, Et = {
|
|
741
|
+
toolset: wt,
|
|
742
|
+
application: Tt
|
|
743
|
+
}, Dt = (e, t) => e === h.Toolset ? "toolset" : e === h.Agent && t === !0 ? "application" : null, Ot = (e, t, n) => {
|
|
744
|
+
let r = Et[n](e, t);
|
|
745
745
|
return {
|
|
746
746
|
resource: { endpointUrl: r },
|
|
747
747
|
snippets: [{
|
|
@@ -749,29 +749,29 @@ var ae = (e) => ({
|
|
|
749
749
|
code: `curl -X POST ${r} \\\n -H 'Content-Type: application/json' \\\n -H 'Api-Key: <key>' \\\n -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`
|
|
750
750
|
}]
|
|
751
751
|
};
|
|
752
|
-
},
|
|
753
|
-
[
|
|
754
|
-
[
|
|
755
|
-
[
|
|
756
|
-
[
|
|
757
|
-
[
|
|
758
|
-
},
|
|
752
|
+
}, kt = {
|
|
753
|
+
[h.Model]: "model",
|
|
754
|
+
[h.Toolset]: "toolset",
|
|
755
|
+
[h.Agent]: "application",
|
|
756
|
+
[h.Prompt]: "prompt",
|
|
757
|
+
[h.Skill]: "skill"
|
|
758
|
+
}, At = (e) => kt[e], jt = (e) => ({
|
|
759
759
|
version: e.version,
|
|
760
760
|
publishedAt: Date.parse(e.publishedAt),
|
|
761
761
|
folderPath: e.folderPath.split("/").filter(Boolean)
|
|
762
|
-
}),
|
|
762
|
+
}), Mt = (e) => ({
|
|
763
763
|
publishedAt: Date.parse(e.publishedAt),
|
|
764
764
|
folderPath: e.folderPath.split("/").filter(Boolean)
|
|
765
|
-
}),
|
|
765
|
+
}), Nt = (e, t) => e.filter((e) => t.has(e.type)), Pt = (e, t) => t ? e.filter((e) => !e.isMyApp) : [...e], Ft = (e) => e.filter((e) => e.isUserFavorite), It = (e, t) => {
|
|
766
766
|
let n = new Set(e.map((e) => e.type));
|
|
767
767
|
return t.filter((e) => n.has(e));
|
|
768
|
-
},
|
|
768
|
+
}, Lt = (e, t) => {
|
|
769
769
|
let n = new Set(t.flatMap((e) => e.topics));
|
|
770
770
|
return new Set(Array.from(e).filter((e) => n.has(e)));
|
|
771
|
-
},
|
|
771
|
+
}, Rt = /* @__PURE__ */ function(e) {
|
|
772
772
|
return e.Deployment = "deployment", e.Prompt = "prompt", e;
|
|
773
|
-
}({}),
|
|
774
|
-
if (e.type !==
|
|
773
|
+
}({}), zt = async (e, t) => {
|
|
774
|
+
if (e.type !== h.Prompt) return {
|
|
775
775
|
kind: "deployment",
|
|
776
776
|
id: e.id
|
|
777
777
|
};
|
|
@@ -782,24 +782,24 @@ var ae = (e) => ({
|
|
|
782
782
|
name: e.name,
|
|
783
783
|
description: e.description,
|
|
784
784
|
content: n,
|
|
785
|
-
hasParameters:
|
|
785
|
+
hasParameters: g(n).length > 0
|
|
786
786
|
};
|
|
787
|
-
},
|
|
788
|
-
handleEdit:
|
|
789
|
-
if (e.type ===
|
|
787
|
+
}, Bt = ({ deployments: t, isCustomAppsEnabled: n, isSchemaAppsEnabled: i, isHideCustomAppCreationEnabled: a, isToolsetsEnabled: o, isPromptsEnabled: s, quickAppSchemaId: c, urls: l, onNavigate: u, deletePrompt: d, deleteToolset: f, deleteSkill: p, deleteApplication: m, refetchPrompts: g, refetchToolsets: _, refetchSkills: v, refetchDeployments: y, onDeleteSuccess: x, labels: C, onNotify: w, triggerSkillArchivePicker: T }) => ({
|
|
788
|
+
handleEdit: b((e) => {
|
|
789
|
+
if (e.type === h.Prompt) {
|
|
790
790
|
u(l.buildPromptEditUrl(e.id));
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
|
-
if (e.type ===
|
|
793
|
+
if (e.type === h.Skill) {
|
|
794
794
|
u(l.buildSkillEditUrl(e.id));
|
|
795
795
|
return;
|
|
796
796
|
}
|
|
797
|
-
if (e.type ===
|
|
797
|
+
if (e.type === h.Toolset) {
|
|
798
798
|
u(l.buildToolsetEditUrl(e.id));
|
|
799
799
|
return;
|
|
800
800
|
}
|
|
801
|
-
let
|
|
802
|
-
if (n &&
|
|
801
|
+
let i = r(t, e.id);
|
|
802
|
+
if (n && i != null && !i.applicationTypeSchemaId) {
|
|
803
803
|
u(l.buildCustomAppEditUrl(e.id));
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
@@ -811,20 +811,20 @@ var ae = (e) => ({
|
|
|
811
811
|
u,
|
|
812
812
|
l
|
|
813
813
|
]),
|
|
814
|
-
handleDelete:
|
|
814
|
+
handleDelete: b(async (t) => {
|
|
815
815
|
try {
|
|
816
|
-
if (t.type ===
|
|
817
|
-
else if (t.type ===
|
|
818
|
-
else if (t.type ===
|
|
816
|
+
if (t.type === h.Prompt) await d(t.id), await g();
|
|
817
|
+
else if (t.type === h.Toolset) await f(t.id), await _();
|
|
818
|
+
else if (t.type === h.Skill) {
|
|
819
819
|
let e = J(t.id);
|
|
820
820
|
if (e == null) throw Error(`Invalid skill resource url: ${t.id}`);
|
|
821
821
|
await p(e.bucket, e.path), await v();
|
|
822
822
|
} else await m(t.id), await y();
|
|
823
|
-
|
|
823
|
+
x(t);
|
|
824
824
|
} catch (t) {
|
|
825
825
|
let { traceId: n } = await e(t);
|
|
826
826
|
throw w({
|
|
827
|
-
message:
|
|
827
|
+
message: C.deleteError,
|
|
828
828
|
requestId: n
|
|
829
829
|
}), t;
|
|
830
830
|
}
|
|
@@ -835,41 +835,41 @@ var ae = (e) => ({
|
|
|
835
835
|
m,
|
|
836
836
|
_,
|
|
837
837
|
y,
|
|
838
|
-
|
|
838
|
+
g,
|
|
839
839
|
v,
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
x,
|
|
841
|
+
C,
|
|
842
842
|
w
|
|
843
843
|
]),
|
|
844
|
-
createOptions:
|
|
844
|
+
createOptions: S(() => {
|
|
845
845
|
let e = [];
|
|
846
|
-
return c &&
|
|
846
|
+
return c && i && !a && e.push({
|
|
847
847
|
key: "quick-app",
|
|
848
|
-
label:
|
|
848
|
+
label: C.createQuickApp,
|
|
849
849
|
onClick: () => u(l.buildQuickAppCreateUrl(c))
|
|
850
850
|
}), o && e.push({
|
|
851
851
|
key: "toolset",
|
|
852
|
-
label:
|
|
852
|
+
label: C.createToolset,
|
|
853
853
|
onClick: () => u(l.buildToolsetCreateUrl())
|
|
854
854
|
}), n && !a && e.push({
|
|
855
855
|
key: "custom-app",
|
|
856
|
-
label:
|
|
856
|
+
label: C.createCustomApp,
|
|
857
857
|
onClick: () => u(l.buildCustomAppCreateUrl())
|
|
858
858
|
}), e.push({
|
|
859
859
|
key: "skill",
|
|
860
|
-
label:
|
|
860
|
+
label: C.createSkill,
|
|
861
861
|
children: [{
|
|
862
862
|
key: "skill-write-instructions",
|
|
863
|
-
label:
|
|
863
|
+
label: C.createSkillWriteInstructions,
|
|
864
864
|
onClick: () => u(l.buildSkillCreateUrl())
|
|
865
865
|
}, {
|
|
866
866
|
key: "skill-upload",
|
|
867
|
-
label:
|
|
867
|
+
label: C.createSkillUpload,
|
|
868
868
|
onClick: T
|
|
869
869
|
}]
|
|
870
870
|
}), s && e.push({
|
|
871
871
|
key: "prompt",
|
|
872
|
-
label:
|
|
872
|
+
label: C.createPrompt,
|
|
873
873
|
onClick: () => u(l.buildPromptCreateUrl())
|
|
874
874
|
}), e;
|
|
875
875
|
}, [
|
|
@@ -877,23 +877,23 @@ var ae = (e) => ({
|
|
|
877
877
|
u,
|
|
878
878
|
l,
|
|
879
879
|
s,
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
C,
|
|
881
|
+
i,
|
|
882
882
|
a,
|
|
883
883
|
o,
|
|
884
884
|
n,
|
|
885
885
|
T
|
|
886
886
|
])
|
|
887
|
-
}),
|
|
888
|
-
if (!
|
|
889
|
-
let n =
|
|
887
|
+
}), Vt = (e) => (t) => {
|
|
888
|
+
if (!nt(t)) return e.getPrompt(t.id);
|
|
889
|
+
let n = l(t.id);
|
|
890
890
|
return e.getPublicPrompt(n?.path ?? t.id);
|
|
891
|
-
},
|
|
892
|
-
let s =
|
|
891
|
+
}, Ht = ({ api: e, skills: t, isAdmin: n, dialCoreExternalUrl: r, skillOverviewLabels: i, promptOverviewLabels: a, deploymentLimitsLabels: o }) => {
|
|
892
|
+
let s = C(null);
|
|
893
893
|
return {
|
|
894
|
-
onFetchDetails:
|
|
895
|
-
if (c.type ===
|
|
896
|
-
let t = await
|
|
894
|
+
onFetchDetails: b(async (c) => {
|
|
895
|
+
if (c.type === h.Prompt) try {
|
|
896
|
+
let t = await Vt(e)(c);
|
|
897
897
|
return {
|
|
898
898
|
promptContent: { content: t.content },
|
|
899
899
|
overview: K(t, a)
|
|
@@ -901,37 +901,37 @@ var ae = (e) => ({
|
|
|
901
901
|
} catch {
|
|
902
902
|
return;
|
|
903
903
|
}
|
|
904
|
-
if (c.type ===
|
|
904
|
+
if (c.type === h.Skill) {
|
|
905
905
|
let n = J(c.id);
|
|
906
906
|
if (n == null) return;
|
|
907
907
|
let { bucket: r, path: a } = n;
|
|
908
908
|
s.current = n;
|
|
909
|
-
let [o, l] = await Promise.allSettled([e.downloadSkillFile(r, a,
|
|
909
|
+
let [o, l] = await Promise.allSettled([e.downloadSkillFile(r, a, p).then(Q), e.listSkillFiles({
|
|
910
910
|
bucket: r,
|
|
911
911
|
path: a,
|
|
912
912
|
filePath: "",
|
|
913
913
|
recursive: !0
|
|
914
|
-
})]), u = o.status === "fulfilled" && o.value != null ?
|
|
914
|
+
})]), u = o.status === "fulfilled" && o.value != null ? m(o.value) : void 0, d = t.find((e) => e.url === c.id), f = l.status === "fulfilled" ? _t(d, l.value.items, u?.about, i) : void 0, h = l.status === "fulfilled" ? yt(l.value.items, a) : [], g = l.status === "fulfilled" ? ht(l.value.items, a) : p;
|
|
915
915
|
return u == null && f == null ? void 0 : {
|
|
916
916
|
...u == null ? {} : { promptContent: {
|
|
917
917
|
content: u.body,
|
|
918
918
|
...u.description == null ? {} : { description: u.description },
|
|
919
|
-
files:
|
|
919
|
+
files: h,
|
|
920
920
|
selectedFileId: g
|
|
921
921
|
} },
|
|
922
922
|
...f == null ? {} : { overview: f }
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
925
|
try {
|
|
926
|
-
let t = c.type ===
|
|
926
|
+
let t = c.type === h.Model ? e.getDeploymentLimits(c.id).catch(() => void 0) : Promise.resolve(void 0), [i, a] = await Promise.all([e.getDeploymentDetails(c.id), t]), s = He(i), l = U(s), u = Dt(c.type, c.supportsMcp), d = s.type === "MODEL" || s.type === "AGENT" ? fe(r ?? "", c.id, {
|
|
927
927
|
hasChatCompletion: s.data.capabilities?.hasChatCompletion,
|
|
928
928
|
hasResponsesApi: s.data.capabilities?.hasResponsesApi
|
|
929
929
|
}) : void 0;
|
|
930
930
|
return {
|
|
931
931
|
...l,
|
|
932
|
-
api: u == null ? d ?? l.api :
|
|
933
|
-
limits:
|
|
934
|
-
credentials: s.type === "TOOLSET" ?
|
|
932
|
+
api: u == null ? d ?? l.api : Ot(r ?? "", c.id, u),
|
|
933
|
+
limits: L(a, o),
|
|
934
|
+
credentials: s.type === "TOOLSET" ? Ne(c.id, s.data, n) : void 0
|
|
935
935
|
};
|
|
936
936
|
} catch {
|
|
937
937
|
return;
|
|
@@ -945,15 +945,15 @@ var ae = (e) => ({
|
|
|
945
945
|
a,
|
|
946
946
|
i
|
|
947
947
|
]),
|
|
948
|
-
onLoadContentFile:
|
|
948
|
+
onLoadContentFile: b(async (t) => {
|
|
949
949
|
let n = s.current;
|
|
950
950
|
if (n == null) return;
|
|
951
951
|
let r = Y(t, n.path);
|
|
952
952
|
if (r == null) return;
|
|
953
953
|
let i = await Q(await e.downloadSkillFile(n.bucket, n.path, r));
|
|
954
|
-
if (i != null) return r === "SKILL.md" ?
|
|
954
|
+
if (i != null) return r === "SKILL.md" ? m(i).body : i;
|
|
955
955
|
}, [e]),
|
|
956
|
-
onLoadSkillDetailsFile:
|
|
956
|
+
onLoadSkillDetailsFile: b(async (t) => {
|
|
957
957
|
let n = s.current;
|
|
958
958
|
if (n == null) throw Error("No skill details are open");
|
|
959
959
|
let r = Y(t, n.path);
|
|
@@ -969,20 +969,20 @@ var ae = (e) => ({
|
|
|
969
969
|
};
|
|
970
970
|
}, [e])
|
|
971
971
|
};
|
|
972
|
-
}, $ = (e, t, n) => e === A.User ? n.user : t ? n.org : n.global,
|
|
972
|
+
}, $ = (e, t, n) => e === A.User ? n.user : t ? n.org : n.global, Ut = (e) => {
|
|
973
973
|
switch (e) {
|
|
974
|
-
case j.ApiKey: return
|
|
975
|
-
case j.OAuth: return
|
|
974
|
+
case j.ApiKey: return o.ApiKey;
|
|
975
|
+
case j.OAuth: return o.OAuth;
|
|
976
976
|
case j.None:
|
|
977
|
-
case void 0: return
|
|
977
|
+
case void 0: return o.None;
|
|
978
978
|
}
|
|
979
|
-
},
|
|
980
|
-
let p =
|
|
979
|
+
}, Wt = ({ isAdmin: t, toolsets: n, refetchToolsets: r, callbackPath: i, loginToolset: o, logoutToolset: l, getToolset: u, labels: d, onNotify: f }) => {
|
|
980
|
+
let p = b((e, t) => t === A.User ? e.credentials?.userStatus : e.credentials?.globalStatus, []), m = b((e, n) => {
|
|
981
981
|
let r = t && !!e.credentials?.isPublic;
|
|
982
982
|
if (e.credentials?.authenticationType === j.ApiKey) {
|
|
983
983
|
let t = $(n, r, d.apiKeyAddedSuccess);
|
|
984
984
|
f({
|
|
985
|
-
variant:
|
|
985
|
+
variant: M.Success,
|
|
986
986
|
title: d.apiKeyAddedSuccessTitle,
|
|
987
987
|
message: t({
|
|
988
988
|
name: e.name,
|
|
@@ -993,7 +993,7 @@ var ae = (e) => ({
|
|
|
993
993
|
}
|
|
994
994
|
let i = $(n, r, d.loginSuccess);
|
|
995
995
|
f({
|
|
996
|
-
variant:
|
|
996
|
+
variant: M.Success,
|
|
997
997
|
title: d.loginSuccessTitle,
|
|
998
998
|
message: i({
|
|
999
999
|
name: e.name,
|
|
@@ -1004,12 +1004,12 @@ var ae = (e) => ({
|
|
|
1004
1004
|
t,
|
|
1005
1005
|
d,
|
|
1006
1006
|
f
|
|
1007
|
-
]), h =
|
|
1007
|
+
]), h = b((e, n) => {
|
|
1008
1008
|
let r = t && !!e.credentials?.isPublic;
|
|
1009
1009
|
if (e.credentials?.authenticationType === j.ApiKey) {
|
|
1010
1010
|
let t = $(n, r, d.apiKeyDeletedSuccess);
|
|
1011
1011
|
f({
|
|
1012
|
-
variant:
|
|
1012
|
+
variant: M.Success,
|
|
1013
1013
|
title: d.apiKeyDeletedSuccessTitle,
|
|
1014
1014
|
message: t({
|
|
1015
1015
|
name: e.name,
|
|
@@ -1020,7 +1020,7 @@ var ae = (e) => ({
|
|
|
1020
1020
|
}
|
|
1021
1021
|
let i = $(n, r, d.logoutSuccess);
|
|
1022
1022
|
f({
|
|
1023
|
-
variant:
|
|
1023
|
+
variant: M.Success,
|
|
1024
1024
|
title: d.logoutSuccessTitle,
|
|
1025
1025
|
message: i({
|
|
1026
1026
|
name: e.name,
|
|
@@ -1031,19 +1031,19 @@ var ae = (e) => ({
|
|
|
1031
1031
|
t,
|
|
1032
1032
|
d,
|
|
1033
1033
|
f
|
|
1034
|
-
]), { login: g } =
|
|
1034
|
+
]), { login: g } = s({
|
|
1035
1035
|
callbackPath: i,
|
|
1036
|
-
loginToolset:
|
|
1037
|
-
logoutToolset:
|
|
1036
|
+
loginToolset: o,
|
|
1037
|
+
logoutToolset: l,
|
|
1038
1038
|
getToolset: u
|
|
1039
1039
|
});
|
|
1040
1040
|
return {
|
|
1041
|
-
handleLogin:
|
|
1042
|
-
let i = e.credentials?.authenticationType,
|
|
1041
|
+
handleLogin: b(async (e, t) => {
|
|
1042
|
+
let i = e.credentials?.authenticationType, o = t.level === A.User ? a.User : a.Global, s = n.find((t) => t.id === e.id);
|
|
1043
1043
|
switch ((await g({
|
|
1044
1044
|
toolsetId: e.id,
|
|
1045
|
-
credentialsLevel:
|
|
1046
|
-
authenticationType:
|
|
1045
|
+
credentialsLevel: o,
|
|
1046
|
+
authenticationType: Ut(i),
|
|
1047
1047
|
apiKey: t.apiKey,
|
|
1048
1048
|
oauthSettings: {
|
|
1049
1049
|
clientId: s?.authSettings?.clientId,
|
|
@@ -1054,22 +1054,22 @@ var ae = (e) => ({
|
|
|
1054
1054
|
},
|
|
1055
1055
|
isCurrentlyFailed: p(e, t.level) === k.Failed
|
|
1056
1056
|
})).type) {
|
|
1057
|
-
case
|
|
1057
|
+
case c.Success:
|
|
1058
1058
|
m(e, t.level), await r();
|
|
1059
1059
|
return;
|
|
1060
|
-
case
|
|
1060
|
+
case c.PopupBlocked:
|
|
1061
1061
|
f({
|
|
1062
|
-
variant:
|
|
1062
|
+
variant: M.Error,
|
|
1063
1063
|
message: d.popupBlockedError
|
|
1064
1064
|
});
|
|
1065
1065
|
return;
|
|
1066
|
-
case
|
|
1066
|
+
case c.Failure:
|
|
1067
1067
|
f({
|
|
1068
|
-
variant:
|
|
1068
|
+
variant: M.Error,
|
|
1069
1069
|
message: d.loginFailedError
|
|
1070
1070
|
});
|
|
1071
1071
|
return;
|
|
1072
|
-
case
|
|
1072
|
+
case c.Cancelled: return;
|
|
1073
1073
|
}
|
|
1074
1074
|
}, [
|
|
1075
1075
|
n,
|
|
@@ -1080,36 +1080,36 @@ var ae = (e) => ({
|
|
|
1080
1080
|
r,
|
|
1081
1081
|
g
|
|
1082
1082
|
]),
|
|
1083
|
-
handleLogout:
|
|
1084
|
-
let i = n.level === A.User ?
|
|
1083
|
+
handleLogout: b(async (t, n) => {
|
|
1084
|
+
let i = n.level === A.User ? a.User : a.Global;
|
|
1085
1085
|
try {
|
|
1086
1086
|
let e = {
|
|
1087
1087
|
url: t.id,
|
|
1088
1088
|
credentialsLevel: i,
|
|
1089
1089
|
authenticationType: t.credentials?.authenticationType
|
|
1090
1090
|
};
|
|
1091
|
-
await
|
|
1091
|
+
await l(t.id, e), h(t, n.level), await r();
|
|
1092
1092
|
} catch (t) {
|
|
1093
1093
|
let { traceId: n } = await e(t);
|
|
1094
1094
|
f({
|
|
1095
|
-
variant:
|
|
1095
|
+
variant: M.Error,
|
|
1096
1096
|
message: d.logoutFailedError,
|
|
1097
1097
|
requestId: n
|
|
1098
1098
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
}, [
|
|
1101
|
-
|
|
1101
|
+
l,
|
|
1102
1102
|
d,
|
|
1103
1103
|
f,
|
|
1104
1104
|
h,
|
|
1105
1105
|
r
|
|
1106
1106
|
])
|
|
1107
1107
|
};
|
|
1108
|
-
},
|
|
1108
|
+
}, Gt = /* @__PURE__ */ function(e) {
|
|
1109
1109
|
return e.Deployment = "deployment", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e;
|
|
1110
|
-
}({}),
|
|
1111
|
-
let [n, r] =
|
|
1112
|
-
|
|
1110
|
+
}({}), Kt = ({ loadFavorites: e, updateFavorite: t }) => {
|
|
1111
|
+
let [n, r] = w(/* @__PURE__ */ new Set()), [i, a] = w(!0);
|
|
1112
|
+
x(() => {
|
|
1113
1113
|
let t = { value: !1 };
|
|
1114
1114
|
return (async () => {
|
|
1115
1115
|
try {
|
|
@@ -1127,7 +1127,7 @@ var ae = (e) => ({
|
|
|
1127
1127
|
t.value = !0;
|
|
1128
1128
|
};
|
|
1129
1129
|
}, [e]);
|
|
1130
|
-
let o =
|
|
1130
|
+
let o = b(async (e, n, i = "deployment") => {
|
|
1131
1131
|
r((t) => {
|
|
1132
1132
|
let r = new Set(t);
|
|
1133
1133
|
return n ? r.add(e) : r.delete(e), r;
|
|
@@ -1141,7 +1141,7 @@ var ae = (e) => ({
|
|
|
1141
1141
|
}), t;
|
|
1142
1142
|
}
|
|
1143
1143
|
}, [t]);
|
|
1144
|
-
return
|
|
1144
|
+
return S(() => ({
|
|
1145
1145
|
favoriteIds: n,
|
|
1146
1146
|
isLoading: i,
|
|
1147
1147
|
toggleFavorite: o
|
|
@@ -1150,24 +1150,24 @@ var ae = (e) => ({
|
|
|
1150
1150
|
i,
|
|
1151
1151
|
o
|
|
1152
1152
|
]);
|
|
1153
|
-
},
|
|
1154
|
-
let
|
|
1155
|
-
return
|
|
1156
|
-
let
|
|
1153
|
+
}, qt = "Production", Jt = 50, Yt = (e, t, n) => {
|
|
1154
|
+
let r = e.get(t);
|
|
1155
|
+
return r == null ? [] : r.filter((e) => e.nodeType === ee.Folder).map((r) => {
|
|
1156
|
+
let i = r.name, a = [...n, i], o = `${t}${r.name}/`;
|
|
1157
1157
|
return {
|
|
1158
|
-
path:
|
|
1159
|
-
name:
|
|
1160
|
-
children: e.has(
|
|
1158
|
+
path: a,
|
|
1159
|
+
name: i,
|
|
1160
|
+
children: e.has(o) ? Yt(e, o, a) : void 0
|
|
1161
1161
|
};
|
|
1162
1162
|
});
|
|
1163
|
-
},
|
|
1164
|
-
let [r, i] =
|
|
1163
|
+
}, Xt = ({ listPublicFiles: e, rememberedFolderKeys: t, onRememberedFolderKeysChange: n }) => {
|
|
1164
|
+
let [r, i] = w(() => /* @__PURE__ */ new Map()), [a, o] = w(() => /* @__PURE__ */ new Set()), [s, c] = w(() => /* @__PURE__ */ new Set()), [l, u] = w([]), d = S(() => {
|
|
1165
1165
|
let e = /* @__PURE__ */ new Set();
|
|
1166
1166
|
return a.forEach((t) => {
|
|
1167
1167
|
let n = t ? `${t}/` : "";
|
|
1168
1168
|
r.has(n) && e.add(t);
|
|
1169
1169
|
}), e;
|
|
1170
|
-
}, [a, r]), f =
|
|
1170
|
+
}, [a, r]), f = b(async (t) => {
|
|
1171
1171
|
c((e) => new Set(e).add(t));
|
|
1172
1172
|
try {
|
|
1173
1173
|
let { items: n } = await e({ path: t || void 0 });
|
|
@@ -1179,10 +1179,10 @@ var ae = (e) => ({
|
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
1181
|
}, [e]);
|
|
1182
|
-
|
|
1182
|
+
x(() => {
|
|
1183
1183
|
f("");
|
|
1184
1184
|
}, []);
|
|
1185
|
-
let p =
|
|
1185
|
+
let p = b((e) => {
|
|
1186
1186
|
o(e), e.forEach((e) => {
|
|
1187
1187
|
let t = `${e}/`;
|
|
1188
1188
|
!r.has(t) && !s.has(t) && f(t);
|
|
@@ -1191,17 +1191,17 @@ var ae = (e) => ({
|
|
|
1191
1191
|
r,
|
|
1192
1192
|
s,
|
|
1193
1193
|
f
|
|
1194
|
-
]), m =
|
|
1194
|
+
]), m = b((e, t) => {
|
|
1195
1195
|
let n = ie([...e, t]);
|
|
1196
1196
|
return u((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
|
|
1197
|
-
}, []), h =
|
|
1197
|
+
}, []), h = b((e) => {
|
|
1198
1198
|
let r = ie(e), i = Array.isArray(t) ? t : [];
|
|
1199
|
-
!r || i.includes(r) || n?.([r, ...i].slice(0,
|
|
1200
|
-
}, [t, n]), g =
|
|
1199
|
+
!r || i.includes(r) || n?.([r, ...i].slice(0, Jt));
|
|
1200
|
+
}, [t, n]), g = b((e) => !e.includes(qt), []);
|
|
1201
1201
|
return {
|
|
1202
|
-
folderItems:
|
|
1202
|
+
folderItems: S(() => {
|
|
1203
1203
|
let e = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
1204
|
-
return re(
|
|
1204
|
+
return re(Yt(r, "", []), [...e.map(ne), ...l.map(ne)]);
|
|
1205
1205
|
}, [
|
|
1206
1206
|
r,
|
|
1207
1207
|
t,
|
|
@@ -1215,11 +1215,11 @@ var ae = (e) => ({
|
|
|
1215
1215
|
rememberPublishFolder: h,
|
|
1216
1216
|
hasPublishWriteAccess: g
|
|
1217
1217
|
};
|
|
1218
|
-
},
|
|
1218
|
+
}, Zt = /* @__PURE__ */ function(e) {
|
|
1219
1219
|
return e.Forbidden = "forbidden", e.Generic = "generic", e;
|
|
1220
|
-
}({}),
|
|
1221
|
-
let [n, r] =
|
|
1222
|
-
return
|
|
1220
|
+
}({}), Qt = ({ fileId: e, onLoadFile: t }) => {
|
|
1221
|
+
let [n, r] = w(!1), [i, a] = w(null), [o, s] = w(null);
|
|
1222
|
+
return x(() => {
|
|
1223
1223
|
let n = !1;
|
|
1224
1224
|
return r(!0), a(null), s(null), (async () => {
|
|
1225
1225
|
try {
|
|
@@ -1241,4 +1241,4 @@ var ae = (e) => ({
|
|
|
1241
1241
|
};
|
|
1242
1242
|
};
|
|
1243
1243
|
//#endregion
|
|
1244
|
-
export { oe as $,
|
|
1244
|
+
export { oe as $, ht as A, Qe as B, Dt as C, Z as D, dt as E, q as F, U as G, $e as H, J as I, L as J, Ne as K, K as L, ct as M, st as N, Q as O, ot as P, de as Q, nt as R, wt as S, _t as T, Xe as U, Ge as V, He as W, ue as X, N as Y, fe as Z, jt as _, Kt as a, Tt as b, Bt as c, It as d, ae as et, Ft as f, Mt as g, Lt as h, Gt as i, it as j, Y as k, Rt as l, Pt as m, Qt as n, Wt as o, Nt as p, we as q, Xt as r, Ht as s, Zt as t, zt as u, At as v, yt as w, Ot as x, bt as y, rt as z };
|