@mohou/shell 1.0.20 → 1.0.22
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/dist/panel.html +3 -0
- package/dist/panel.js +690 -471
- package/package.json +5 -5
- package/skill/mohou-mini-app/SKILL.md +1 -1
- package/src/clients.ts +1 -0
- package/src/http-client.ts +27 -0
package/dist/panel.js
CHANGED
|
@@ -23964,6 +23964,13 @@ var en = {
|
|
|
23964
23964
|
"delete-failed": "Delete failed",
|
|
23965
23965
|
"unsaved-confirm": "Discard unsaved changes?",
|
|
23966
23966
|
"port-invalid": "Port must be from 1024 to 65535",
|
|
23967
|
+
"update-registry": "Update registry",
|
|
23968
|
+
"update-registry-default": "Packaged default",
|
|
23969
|
+
"update-registry-npmmirror": "Alibaba npmmirror",
|
|
23970
|
+
"update-registry-tencent": "Tencent Cloud",
|
|
23971
|
+
"update-registry-custom": "Custom\u2026",
|
|
23972
|
+
"update-registry-hint": "Only this product's own update check and install use it. Your npm config, and an app's own dependency installs, are untouched.",
|
|
23973
|
+
"update-registry-invalid": "Use an https url without a username or password.",
|
|
23967
23974
|
"save-failed": "Save failed",
|
|
23968
23975
|
"update-failed": "Update check failed",
|
|
23969
23976
|
"storage-failed": "Storage failed to load",
|
|
@@ -24154,6 +24161,9 @@ var en = {
|
|
|
24154
24161
|
update: "Check for updates",
|
|
24155
24162
|
"update-install": "Install update",
|
|
24156
24163
|
"update-install-failed": "The update could not be installed.",
|
|
24164
|
+
"update-source": "Update source",
|
|
24165
|
+
"update-source-tarball": "Local packages",
|
|
24166
|
+
"update-source-none": "No install prefix (source tree)",
|
|
24157
24167
|
"update-card-title": "Update available",
|
|
24158
24168
|
"update-card-current": "Current",
|
|
24159
24169
|
"update-card-latest": "Latest",
|
|
@@ -24215,6 +24225,13 @@ var zhCN = {
|
|
|
24215
24225
|
"delete-failed": "\u5220\u9664\u5931\u8D25",
|
|
24216
24226
|
"unsaved-confirm": "\u653E\u5F03\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF1F",
|
|
24217
24227
|
"port-invalid": "\u7AEF\u53E3\u5FC5\u987B\u5728 1024 \u5230 65535 \u4E4B\u95F4",
|
|
24228
|
+
"update-registry": "\u66F4\u65B0\u6E90 registry",
|
|
24229
|
+
"update-registry-default": "\u5B89\u88C5\u5305\u9ED8\u8BA4",
|
|
24230
|
+
"update-registry-npmmirror": "\u963F\u91CC npmmirror",
|
|
24231
|
+
"update-registry-tencent": "\u817E\u8BAF\u4E91",
|
|
24232
|
+
"update-registry-custom": "\u81EA\u5B9A\u4E49\u2026",
|
|
24233
|
+
"update-registry-hint": "\u53EA\u6709 Mohou \u81EA\u5DF1\u7684\u201C\u68C0\u67E5\u66F4\u65B0/\u5B89\u88C5\u66F4\u65B0\u201D\u7528\u5B83\uFF1B\u4E0D\u52A8\u4F60\u7684 npm \u914D\u7F6E\uFF0C\u4E5F\u4E0D\u5F71\u54CD\u5C0F\u7A0B\u5E8F\u81EA\u8EAB\u7684\u4F9D\u8D56\u5B89\u88C5\u3002",
|
|
24234
|
+
"update-registry-invalid": "\u8BF7\u586B https \u5730\u5740\uFF0C\u4E14\u4E0D\u8981\u5E26\u7528\u6237\u540D\u5BC6\u7801\u3002",
|
|
24218
24235
|
"save-failed": "\u4FDD\u5B58\u5931\u8D25",
|
|
24219
24236
|
"update-failed": "\u66F4\u65B0\u68C0\u67E5\u5931\u8D25",
|
|
24220
24237
|
"storage-failed": "\u5B58\u50A8\u52A0\u8F7D\u5931\u8D25",
|
|
@@ -24405,6 +24422,9 @@ var zhCN = {
|
|
|
24405
24422
|
update: "\u68C0\u67E5\u66F4\u65B0",
|
|
24406
24423
|
"update-install": "\u5B89\u88C5\u66F4\u65B0",
|
|
24407
24424
|
"update-install-failed": "\u66F4\u65B0\u6CA1\u80FD\u88C5\u4E0A\u3002",
|
|
24425
|
+
"update-source": "\u66F4\u65B0\u6E90",
|
|
24426
|
+
"update-source-tarball": "\u672C\u5730\u5305",
|
|
24427
|
+
"update-source-none": "\u65E0\u5B89\u88C5\u524D\u7F00\uFF08\u6E90\u7801\u6811\uFF09",
|
|
24408
24428
|
"update-card-title": "\u6709\u65B0\u7248\u672C",
|
|
24409
24429
|
"update-card-current": "\u5F53\u524D",
|
|
24410
24430
|
"update-card-latest": "\u6700\u65B0",
|
|
@@ -24456,6 +24476,32 @@ function isPanelLocale(value) {
|
|
|
24456
24476
|
}
|
|
24457
24477
|
|
|
24458
24478
|
// ../../panel/src/settings/form.ts
|
|
24479
|
+
var updateRegistryPresets = {
|
|
24480
|
+
npmmirror: "https://registry.npmmirror.com",
|
|
24481
|
+
tencent: "https://mirrors.cloud.tencent.com/npm/"
|
|
24482
|
+
};
|
|
24483
|
+
function registryChoice(registry) {
|
|
24484
|
+
const value = registry.trim();
|
|
24485
|
+
if (value.length === 0) return "default";
|
|
24486
|
+
for (const [name, url] of Object.entries(updateRegistryPresets)) {
|
|
24487
|
+
if (value === url) return name;
|
|
24488
|
+
}
|
|
24489
|
+
return "custom";
|
|
24490
|
+
}
|
|
24491
|
+
function admitUpdateRegistry(value) {
|
|
24492
|
+
const registry = value.trim();
|
|
24493
|
+
if (registry.length === 0) return { ok: true, registry: "" };
|
|
24494
|
+
let url;
|
|
24495
|
+
try {
|
|
24496
|
+
url = new URL(registry);
|
|
24497
|
+
} catch {
|
|
24498
|
+
return { ok: false, key: "registry-invalid" };
|
|
24499
|
+
}
|
|
24500
|
+
if (url.protocol !== "https:" || url.hostname.length === 0 || url.username.length > 0 || url.password.length > 0) {
|
|
24501
|
+
return { ok: false, key: "registry-invalid" };
|
|
24502
|
+
}
|
|
24503
|
+
return { ok: true, registry };
|
|
24504
|
+
}
|
|
24459
24505
|
var panelPortBound = { min: 1024, max: 65535 };
|
|
24460
24506
|
function admitPanelPort(value) {
|
|
24461
24507
|
if (typeof value !== "number" || !Number.isInteger(value)) return { ok: false, key: "port-invalid" };
|
|
@@ -25186,8 +25232,31 @@ var __iconNode5 = [
|
|
|
25186
25232
|
];
|
|
25187
25233
|
var ExternalLink = createLucideIcon("external-link", __iconNode5);
|
|
25188
25234
|
|
|
25189
|
-
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/
|
|
25235
|
+
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/globe.js
|
|
25190
25236
|
var __iconNode6 = [
|
|
25237
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
25238
|
+
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
25239
|
+
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
25240
|
+
];
|
|
25241
|
+
var Globe = createLucideIcon("globe", __iconNode6);
|
|
25242
|
+
|
|
25243
|
+
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/hard-drive.js
|
|
25244
|
+
var __iconNode7 = [
|
|
25245
|
+
["line", { x1: "22", x2: "2", y1: "12", y2: "12", key: "1y58io" }],
|
|
25246
|
+
[
|
|
25247
|
+
"path",
|
|
25248
|
+
{
|
|
25249
|
+
d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",
|
|
25250
|
+
key: "oot6mr"
|
|
25251
|
+
}
|
|
25252
|
+
],
|
|
25253
|
+
["line", { x1: "6", x2: "6.01", y1: "16", y2: "16", key: "sgf278" }],
|
|
25254
|
+
["line", { x1: "10", x2: "10.01", y1: "16", y2: "16", key: "1l4acy" }]
|
|
25255
|
+
];
|
|
25256
|
+
var HardDrive = createLucideIcon("hard-drive", __iconNode7);
|
|
25257
|
+
|
|
25258
|
+
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/key-round.js
|
|
25259
|
+
var __iconNode8 = [
|
|
25191
25260
|
[
|
|
25192
25261
|
"path",
|
|
25193
25262
|
{
|
|
@@ -25197,23 +25266,23 @@ var __iconNode6 = [
|
|
|
25197
25266
|
],
|
|
25198
25267
|
["circle", { cx: "16.5", cy: "7.5", r: ".5", fill: "currentColor", key: "w0ekpg" }]
|
|
25199
25268
|
];
|
|
25200
|
-
var KeyRound = createLucideIcon("key-round",
|
|
25269
|
+
var KeyRound = createLucideIcon("key-round", __iconNode8);
|
|
25201
25270
|
|
|
25202
25271
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/layout-grid.js
|
|
25203
|
-
var
|
|
25272
|
+
var __iconNode9 = [
|
|
25204
25273
|
["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
|
|
25205
25274
|
["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
|
|
25206
25275
|
["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
|
|
25207
25276
|
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
|
|
25208
25277
|
];
|
|
25209
|
-
var LayoutGrid = createLucideIcon("layout-grid",
|
|
25278
|
+
var LayoutGrid = createLucideIcon("layout-grid", __iconNode9);
|
|
25210
25279
|
|
|
25211
25280
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js
|
|
25212
|
-
var
|
|
25213
|
-
var LoaderCircle = createLucideIcon("loader-circle",
|
|
25281
|
+
var __iconNode10 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
25282
|
+
var LoaderCircle = createLucideIcon("loader-circle", __iconNode10);
|
|
25214
25283
|
|
|
25215
25284
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/palette.js
|
|
25216
|
-
var
|
|
25285
|
+
var __iconNode11 = [
|
|
25217
25286
|
[
|
|
25218
25287
|
"path",
|
|
25219
25288
|
{
|
|
@@ -25226,10 +25295,10 @@ var __iconNode9 = [
|
|
|
25226
25295
|
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
25227
25296
|
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
25228
25297
|
];
|
|
25229
|
-
var Palette = createLucideIcon("palette",
|
|
25298
|
+
var Palette = createLucideIcon("palette", __iconNode11);
|
|
25230
25299
|
|
|
25231
25300
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/pencil.js
|
|
25232
|
-
var
|
|
25301
|
+
var __iconNode12 = [
|
|
25233
25302
|
[
|
|
25234
25303
|
"path",
|
|
25235
25304
|
{
|
|
@@ -25239,10 +25308,10 @@ var __iconNode10 = [
|
|
|
25239
25308
|
],
|
|
25240
25309
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
25241
25310
|
];
|
|
25242
|
-
var Pencil = createLucideIcon("pencil",
|
|
25311
|
+
var Pencil = createLucideIcon("pencil", __iconNode12);
|
|
25243
25312
|
|
|
25244
25313
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/pin.js
|
|
25245
|
-
var
|
|
25314
|
+
var __iconNode13 = [
|
|
25246
25315
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
25247
25316
|
[
|
|
25248
25317
|
"path",
|
|
@@ -25252,26 +25321,26 @@ var __iconNode11 = [
|
|
|
25252
25321
|
}
|
|
25253
25322
|
]
|
|
25254
25323
|
];
|
|
25255
|
-
var Pin = createLucideIcon("pin",
|
|
25324
|
+
var Pin = createLucideIcon("pin", __iconNode13);
|
|
25256
25325
|
|
|
25257
25326
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js
|
|
25258
|
-
var
|
|
25327
|
+
var __iconNode14 = [
|
|
25259
25328
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
25260
25329
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
25261
25330
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
25262
25331
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
25263
25332
|
];
|
|
25264
|
-
var RefreshCw = createLucideIcon("refresh-cw",
|
|
25333
|
+
var RefreshCw = createLucideIcon("refresh-cw", __iconNode14);
|
|
25265
25334
|
|
|
25266
25335
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/search.js
|
|
25267
|
-
var
|
|
25336
|
+
var __iconNode15 = [
|
|
25268
25337
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
25269
25338
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
25270
25339
|
];
|
|
25271
|
-
var Search = createLucideIcon("search",
|
|
25340
|
+
var Search = createLucideIcon("search", __iconNode15);
|
|
25272
25341
|
|
|
25273
25342
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/settings.js
|
|
25274
|
-
var
|
|
25343
|
+
var __iconNode16 = [
|
|
25275
25344
|
[
|
|
25276
25345
|
"path",
|
|
25277
25346
|
{
|
|
@@ -25281,17 +25350,24 @@ var __iconNode14 = [
|
|
|
25281
25350
|
],
|
|
25282
25351
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
25283
25352
|
];
|
|
25284
|
-
var Settings = createLucideIcon("settings",
|
|
25353
|
+
var Settings = createLucideIcon("settings", __iconNode16);
|
|
25354
|
+
|
|
25355
|
+
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/terminal.js
|
|
25356
|
+
var __iconNode17 = [
|
|
25357
|
+
["path", { d: "M12 19h8", key: "baeox8" }],
|
|
25358
|
+
["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
|
|
25359
|
+
];
|
|
25360
|
+
var Terminal = createLucideIcon("terminal", __iconNode17);
|
|
25285
25361
|
|
|
25286
25362
|
// ../../../node_modules/.pnpm/lucide-react@0.544.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/trash-2.js
|
|
25287
|
-
var
|
|
25363
|
+
var __iconNode18 = [
|
|
25288
25364
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
25289
25365
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
25290
25366
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
25291
25367
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
25292
25368
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
25293
25369
|
];
|
|
25294
|
-
var Trash2 = createLucideIcon("trash-2",
|
|
25370
|
+
var Trash2 = createLucideIcon("trash-2", __iconNode18);
|
|
25295
25371
|
|
|
25296
25372
|
// ../../panel/src/gallery/view.tsx
|
|
25297
25373
|
var import_react4 = __toESM(require_react(), 1);
|
|
@@ -25742,12 +25818,14 @@ function settingsState() {
|
|
|
25742
25818
|
palette: "",
|
|
25743
25819
|
locale: "en",
|
|
25744
25820
|
port: "",
|
|
25821
|
+
registry: "",
|
|
25745
25822
|
providerId: "",
|
|
25746
25823
|
modelProvider: "",
|
|
25747
25824
|
model: "",
|
|
25748
25825
|
workbenchId: "default",
|
|
25749
25826
|
dirty: false,
|
|
25750
25827
|
portError: false,
|
|
25828
|
+
registryError: false,
|
|
25751
25829
|
saveError: false,
|
|
25752
25830
|
closed: false,
|
|
25753
25831
|
restartRequired: false,
|
|
@@ -25767,6 +25845,8 @@ function reduceSettings(state, action) {
|
|
|
25767
25845
|
return { ...state, locale: action.locale, dirty: true, saveError: false };
|
|
25768
25846
|
case "edit-port":
|
|
25769
25847
|
return { ...state, port: action.port, dirty: true, portError: false, saveError: false };
|
|
25848
|
+
case "edit-registry":
|
|
25849
|
+
return { ...state, registry: action.registry, dirty: true, registryError: false, saveError: false };
|
|
25770
25850
|
case "edit-provider":
|
|
25771
25851
|
return { ...state, providerId: action.providerId, dirty: true, saveError: false };
|
|
25772
25852
|
case "edit-model":
|
|
@@ -25804,6 +25884,10 @@ function reduceSettings(state, action) {
|
|
|
25804
25884
|
}
|
|
25805
25885
|
case "port-invalid":
|
|
25806
25886
|
return { ...state, portError: true, dirty: true };
|
|
25887
|
+
case "registry-invalid":
|
|
25888
|
+
return { ...state, registryError: true, dirty: true };
|
|
25889
|
+
case "save-blocked":
|
|
25890
|
+
return { ...omitSaveMessage(state), saveError: true, dirty: true };
|
|
25807
25891
|
case "save-failed":
|
|
25808
25892
|
return {
|
|
25809
25893
|
...omitSaveMessage(state),
|
|
@@ -25836,12 +25920,14 @@ function reduceSettings(state, action) {
|
|
|
25836
25920
|
}
|
|
25837
25921
|
function settingsDraft(state) {
|
|
25838
25922
|
const port = admitPanelPort(Number(state.port));
|
|
25839
|
-
if (!port.ok) return { ok: false };
|
|
25923
|
+
if (!port.ok) return { ok: false, key: "port-invalid" };
|
|
25924
|
+
const registry = admitUpdateRegistry(state.registry);
|
|
25925
|
+
if (!registry.ok) return { ok: false, key: "registry-invalid" };
|
|
25840
25926
|
let language;
|
|
25841
25927
|
try {
|
|
25842
25928
|
language = panelLanguageFields(state.locale);
|
|
25843
25929
|
} catch {
|
|
25844
|
-
return { ok: false };
|
|
25930
|
+
return { ok: false, key: "save-blocked" };
|
|
25845
25931
|
}
|
|
25846
25932
|
return {
|
|
25847
25933
|
ok: true,
|
|
@@ -25853,6 +25939,7 @@ function settingsDraft(state) {
|
|
|
25853
25939
|
hostPort: port.port,
|
|
25854
25940
|
llm: state.modelProvider === "" && state.model === "" ? null : { provider: state.modelProvider, model: state.model },
|
|
25855
25941
|
runtimeProvider: { id: state.providerId },
|
|
25942
|
+
updateRegistry: registry.registry,
|
|
25856
25943
|
...state.workbenchId === "default" ? {} : { defaultWorkbenchId: state.workbenchId }
|
|
25857
25944
|
}
|
|
25858
25945
|
};
|
|
@@ -25867,12 +25954,14 @@ function fromPolicy(policy2) {
|
|
|
25867
25954
|
palette: policy2.palette,
|
|
25868
25955
|
locale: policy2.locale,
|
|
25869
25956
|
port: String(policy2.hostPort),
|
|
25957
|
+
registry: policy2.updateRegistry ?? "",
|
|
25870
25958
|
providerId: policy2.runtimeProvider.id,
|
|
25871
25959
|
modelProvider: policy2.llm?.provider ?? "",
|
|
25872
25960
|
model: policy2.llm?.model ?? "",
|
|
25873
25961
|
workbenchId: policy2.defaultWorkbenchId ?? "default",
|
|
25874
25962
|
dirty: false,
|
|
25875
25963
|
portError: false,
|
|
25964
|
+
registryError: false,
|
|
25876
25965
|
saveError: false,
|
|
25877
25966
|
closed: false,
|
|
25878
25967
|
restartRequired: false,
|
|
@@ -26263,9 +26352,50 @@ function authoringSnippet(url, token, description) {
|
|
|
26263
26352
|
`;
|
|
26264
26353
|
}
|
|
26265
26354
|
|
|
26355
|
+
// ../../panel/src/settings/update-source.tsx
|
|
26356
|
+
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
26357
|
+
function checkSource(check) {
|
|
26358
|
+
if (check.channel === "registry") return { channel: "registry", registry: check.registry ?? "https://registry.npmjs.org" };
|
|
26359
|
+
if (check.channel === "tarball" && check.tarballDir !== void 0) {
|
|
26360
|
+
return { channel: "tarball", tarballDir: check.tarballDir };
|
|
26361
|
+
}
|
|
26362
|
+
return void 0;
|
|
26363
|
+
}
|
|
26364
|
+
function UpdateSourceChip(props) {
|
|
26365
|
+
const Icon2 = props.source.channel === "registry" ? Globe : props.source.channel === "tarball" ? HardDrive : Terminal;
|
|
26366
|
+
const title = sourceTitle(props.source);
|
|
26367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
26368
|
+
"span",
|
|
26369
|
+
{
|
|
26370
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] leading-none text-muted-foreground",
|
|
26371
|
+
...title.length === 0 ? {} : { title },
|
|
26372
|
+
children: [
|
|
26373
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { size: 12, className: "shrink-0", "aria-hidden": true }),
|
|
26374
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "shrink-0", children: props.label("update-source") }),
|
|
26375
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "truncate font-mono", children: sourceText(props.source, props.label) })
|
|
26376
|
+
]
|
|
26377
|
+
}
|
|
26378
|
+
);
|
|
26379
|
+
}
|
|
26380
|
+
function sourceText(source, label) {
|
|
26381
|
+
if (source.channel === "registry") return hostOf(source.registry);
|
|
26382
|
+
if (source.channel === "tarball") return `${label("update-source-tarball")} \xB7 ${collapseHome(source.tarballDir)}`;
|
|
26383
|
+
return label("update-source-none");
|
|
26384
|
+
}
|
|
26385
|
+
function sourceTitle(source) {
|
|
26386
|
+
if (source.channel === "registry") return source.registry;
|
|
26387
|
+
return source.channel === "tarball" ? source.tarballDir : "";
|
|
26388
|
+
}
|
|
26389
|
+
function hostOf(registry) {
|
|
26390
|
+
return registry.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
26391
|
+
}
|
|
26392
|
+
function collapseHome(path) {
|
|
26393
|
+
return path.replace(/^\/(?:Users|home)\/[^/]+\//, "~/");
|
|
26394
|
+
}
|
|
26395
|
+
|
|
26266
26396
|
// ../../panel/src/settings/credentials-view.tsx
|
|
26267
26397
|
var import_react7 = __toESM(require_react(), 1);
|
|
26268
|
-
var
|
|
26398
|
+
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
26269
26399
|
var emptyDraft = { name: "", description: "", secret: "", editing: void 0 };
|
|
26270
26400
|
function CredentialSettings(props) {
|
|
26271
26401
|
const label = (key) => panelText(props.locale, key, props.mode);
|
|
@@ -26287,7 +26417,7 @@ function CredentialSettings(props) {
|
|
|
26287
26417
|
setWritable(next.writable);
|
|
26288
26418
|
}, () => setFailed(label("credentials-load-failed")));
|
|
26289
26419
|
}, [read, props.client, label]);
|
|
26290
|
-
if (read === void 0) return /* @__PURE__ */ (0,
|
|
26420
|
+
if (read === void 0) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-muted-foreground", children: label("credentials-empty") });
|
|
26291
26421
|
const refresh = async () => {
|
|
26292
26422
|
const next = await read.call(props.client);
|
|
26293
26423
|
setRows(next.credentials);
|
|
@@ -26326,41 +26456,41 @@ function CredentialSettings(props) {
|
|
|
26326
26456
|
setBusy(false);
|
|
26327
26457
|
}
|
|
26328
26458
|
};
|
|
26329
|
-
return /* @__PURE__ */ (0,
|
|
26330
|
-
/* @__PURE__ */ (0,
|
|
26331
|
-
/* @__PURE__ */ (0,
|
|
26332
|
-
/* @__PURE__ */ (0,
|
|
26333
|
-
rows.length === 0 ? /* @__PURE__ */ (0,
|
|
26334
|
-
/* @__PURE__ */ (0,
|
|
26459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
26460
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
26461
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
26462
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h4", { className: "m-0", children: label("section-credentials") }),
|
|
26463
|
+
rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: label("credentials-empty") }) : null,
|
|
26464
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: label("mcp-reference-hint") })
|
|
26335
26465
|
] }),
|
|
26336
|
-
writable ? /* @__PURE__ */ (0,
|
|
26466
|
+
writable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-8 shrink-0 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: () => setDraft(emptyDraft), children: label("credentials-add") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground", children: label("credentials-read-only") })
|
|
26337
26467
|
] }),
|
|
26338
|
-
/* @__PURE__ */ (0,
|
|
26339
|
-
/* @__PURE__ */ (0,
|
|
26340
|
-
/* @__PURE__ */ (0,
|
|
26341
|
-
/* @__PURE__ */ (0,
|
|
26342
|
-
/* @__PURE__ */ (0,
|
|
26343
|
-
/* @__PURE__ */ (0,
|
|
26468
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "flex flex-col gap-2", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("li", { className: "flex items-start gap-3 rounded-xl border bg-card px-3 py-2", children: [
|
|
26469
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "mt-0.5 inline-flex size-7 shrink-0 items-center justify-center rounded-lg border text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(KeyRound, { size: 14 }) }),
|
|
26470
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
26471
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "m-0 truncate text-sm font-medium", children: row.name }),
|
|
26472
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "m-0 truncate text-xs text-muted-foreground", children: row.description }),
|
|
26473
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "m-0 mt-1 font-mono text-[11px] text-muted-foreground", children: label("credentials-reference").replace("{reference}", `\${credential:${row.name}}`) })
|
|
26344
26474
|
] }),
|
|
26345
|
-
writable ? /* @__PURE__ */ (0,
|
|
26346
|
-
/* @__PURE__ */ (0,
|
|
26347
|
-
/* @__PURE__ */ (0,
|
|
26475
|
+
writable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex shrink-0 gap-1", children: [
|
|
26476
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-7 rounded-md px-2 text-xs hover:bg-muted", onClick: () => setDraft({ name: row.name, description: row.description, secret: "", editing: row.name }), children: label("credentials-edit") }),
|
|
26477
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-7 rounded-md px-2 text-xs text-destructive hover:bg-muted", onClick: () => setRemoving(row.name), children: label("delete") })
|
|
26348
26478
|
] }) : null
|
|
26349
26479
|
] }, row.name)) }),
|
|
26350
|
-
notice.length > 0 ? /* @__PURE__ */ (0,
|
|
26351
|
-
failed.length > 0 ? /* @__PURE__ */ (0,
|
|
26352
|
-
draft === void 0 ? null : /* @__PURE__ */ (0,
|
|
26353
|
-
/* @__PURE__ */ (0,
|
|
26354
|
-
/* @__PURE__ */ (0,
|
|
26355
|
-
/* @__PURE__ */ (0,
|
|
26356
|
-
/* @__PURE__ */ (0,
|
|
26357
|
-
/* @__PURE__ */ (0,
|
|
26358
|
-
draft.editing === void 0 ? null : /* @__PURE__ */ (0,
|
|
26480
|
+
notice.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-xs text-muted-foreground", children: notice }) : null,
|
|
26481
|
+
failed.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-xs text-destructive", children: failed }) : null,
|
|
26482
|
+
draft === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Dialog, { onClose: () => setDraft(void 0), children: [
|
|
26483
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h4", { className: "m-0", children: label(draft.editing === void 0 ? "credentials-new" : "credentials-edit") }),
|
|
26484
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mt-4 flex flex-col gap-3", children: [
|
|
26485
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { label: label("credentials-name"), hint: label("credentials-name-hint"), value: draft.name, disabled: draft.editing !== void 0, onChange: (name) => setDraft({ ...draft, name }) }),
|
|
26486
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { label: label("credentials-description"), hint: label("credentials-desc-hint"), value: draft.description, onChange: (description) => setDraft({ ...draft, description }) }),
|
|
26487
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { label: label("credentials-secret"), hint: label("credentials-secret-hint"), value: draft.secret, password: true, onChange: (secret) => setDraft({ ...draft, secret }) }),
|
|
26488
|
+
draft.editing === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "m-0 text-xs text-muted-foreground", children: label("credentials-replace-hint") })
|
|
26359
26489
|
] }),
|
|
26360
|
-
/* @__PURE__ */ (0,
|
|
26361
|
-
draft.name.trim().length === 0 ? /* @__PURE__ */ (0,
|
|
26362
|
-
/* @__PURE__ */ (0,
|
|
26363
|
-
/* @__PURE__ */ (0,
|
|
26490
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
26491
|
+
draft.name.trim().length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "mr-auto text-xs text-muted-foreground", children: label("credentials-need-name") }) : draft.editing === void 0 && draft.secret.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "mr-auto text-xs text-muted-foreground", children: label("credentials-need-secret") }) : null,
|
|
26492
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: () => setDraft(void 0), children: label("cancel") }),
|
|
26493
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
26364
26494
|
"button",
|
|
26365
26495
|
{
|
|
26366
26496
|
type: "button",
|
|
@@ -26374,11 +26504,11 @@ function CredentialSettings(props) {
|
|
|
26374
26504
|
)
|
|
26375
26505
|
] })
|
|
26376
26506
|
] }),
|
|
26377
|
-
removing === void 0 ? null : /* @__PURE__ */ (0,
|
|
26378
|
-
/* @__PURE__ */ (0,
|
|
26379
|
-
/* @__PURE__ */ (0,
|
|
26380
|
-
/* @__PURE__ */ (0,
|
|
26381
|
-
/* @__PURE__ */ (0,
|
|
26507
|
+
removing === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Dialog, { width: "sm", onClose: () => setRemoving(void 0), children: [
|
|
26508
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "m-0 text-sm", children: label("credentials-delete-confirm") }),
|
|
26509
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
26510
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: () => setRemoving(void 0), children: label("cancel") }),
|
|
26511
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-destructive px-3 text-sm font-semibold text-destructive-foreground", onClick: () => {
|
|
26382
26512
|
void remove(removing);
|
|
26383
26513
|
}, children: label("delete") })
|
|
26384
26514
|
] })
|
|
@@ -26386,9 +26516,9 @@ function CredentialSettings(props) {
|
|
|
26386
26516
|
] });
|
|
26387
26517
|
}
|
|
26388
26518
|
function Field(props) {
|
|
26389
|
-
return /* @__PURE__ */ (0,
|
|
26390
|
-
/* @__PURE__ */ (0,
|
|
26391
|
-
/* @__PURE__ */ (0,
|
|
26519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
|
|
26520
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-muted-foreground", children: props.label }),
|
|
26521
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
26392
26522
|
"input",
|
|
26393
26523
|
{
|
|
26394
26524
|
type: props.password === true ? "password" : "text",
|
|
@@ -26404,7 +26534,7 @@ function Field(props) {
|
|
|
26404
26534
|
|
|
26405
26535
|
// ../../panel/src/settings/mcp-view.tsx
|
|
26406
26536
|
var import_react8 = __toESM(require_react(), 1);
|
|
26407
|
-
var
|
|
26537
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
26408
26538
|
var emptyDraft2 = {
|
|
26409
26539
|
id: "",
|
|
26410
26540
|
description: "",
|
|
@@ -26443,30 +26573,30 @@ function McpSettings(props) {
|
|
|
26443
26573
|
() => setLoadFailed(true)
|
|
26444
26574
|
);
|
|
26445
26575
|
}, [props.client.listMcp]);
|
|
26446
|
-
if (props.client.listMcp === void 0) return /* @__PURE__ */ (0,
|
|
26576
|
+
if (props.client.listMcp === void 0) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm text-muted-foreground", children: label("mcp-empty") });
|
|
26447
26577
|
const write = (next) => commit(props.client, next, setServers, setUnresolved, setAlert, setNotice, label);
|
|
26448
|
-
return /* @__PURE__ */ (0,
|
|
26449
|
-
/* @__PURE__ */ (0,
|
|
26450
|
-
/* @__PURE__ */ (0,
|
|
26451
|
-
/* @__PURE__ */ (0,
|
|
26452
|
-
servers.length === 0 ? /* @__PURE__ */ (0,
|
|
26453
|
-
unresolved.length === 0 ? null : /* @__PURE__ */ (0,
|
|
26578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
26579
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
26580
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
26581
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h4", { className: "m-0", children: label("section-mcp") }),
|
|
26582
|
+
servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: label("mcp-empty") }) : null,
|
|
26583
|
+
unresolved.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-destructive", children: label("mcp-unresolved-hint") })
|
|
26454
26584
|
] }),
|
|
26455
|
-
/* @__PURE__ */ (0,
|
|
26456
|
-
/* @__PURE__ */ (0,
|
|
26457
|
-
/* @__PURE__ */ (0,
|
|
26585
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex shrink-0 flex-wrap justify-end gap-2", children: [
|
|
26586
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border bg-card px-3 text-sm", onClick: () => setPaste(true), children: label("mcp-paste") }),
|
|
26587
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border bg-card px-3 text-sm", onClick: () => {
|
|
26458
26588
|
void pullSource(props.client, "pi", setCandidates, setAlert);
|
|
26459
26589
|
}, children: label("mcp-from-pi") }),
|
|
26460
|
-
/* @__PURE__ */ (0,
|
|
26590
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "inline-flex h-8 cursor-pointer items-center rounded-lg border bg-card px-3 text-sm", children: [
|
|
26461
26591
|
label("mcp-from-file"),
|
|
26462
|
-
/* @__PURE__ */ (0,
|
|
26592
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "file", accept: "application/json,.json", className: "sr-only", onChange: (event) => {
|
|
26463
26593
|
void readChosen(event.target.files?.[0], props.client, setCandidates, setAlert);
|
|
26464
26594
|
} })
|
|
26465
26595
|
] }),
|
|
26466
|
-
/* @__PURE__ */ (0,
|
|
26596
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: () => setDraft(emptyDraft2), children: label("mcp-add") })
|
|
26467
26597
|
] })
|
|
26468
26598
|
] }),
|
|
26469
|
-
/* @__PURE__ */ (0,
|
|
26599
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "grid grid-cols-1 gap-2 min-[720px]:grid-cols-2", children: servers.map((server) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26470
26600
|
ServerCard,
|
|
26471
26601
|
{
|
|
26472
26602
|
server,
|
|
@@ -26486,9 +26616,9 @@ function McpSettings(props) {
|
|
|
26486
26616
|
},
|
|
26487
26617
|
server.id
|
|
26488
26618
|
)) }),
|
|
26489
|
-
loadFailed ? /* @__PURE__ */ (0,
|
|
26490
|
-
notice.length > 0 ? /* @__PURE__ */ (0,
|
|
26491
|
-
draft === void 0 ? null : /* @__PURE__ */ (0,
|
|
26619
|
+
loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm text-muted-foreground", children: label("mcp-load-failed") }) : null,
|
|
26620
|
+
notice.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-muted-foreground", children: notice }) : null,
|
|
26621
|
+
draft === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26492
26622
|
EditorDialog,
|
|
26493
26623
|
{
|
|
26494
26624
|
draft,
|
|
@@ -26509,7 +26639,7 @@ function McpSettings(props) {
|
|
|
26509
26639
|
...props.client.checkMcp === void 0 ? {} : { onCheck: props.client.checkMcp }
|
|
26510
26640
|
}
|
|
26511
26641
|
),
|
|
26512
|
-
paste ? /* @__PURE__ */ (0,
|
|
26642
|
+
paste ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26513
26643
|
PasteDialog,
|
|
26514
26644
|
{
|
|
26515
26645
|
label,
|
|
@@ -26521,7 +26651,7 @@ function McpSettings(props) {
|
|
|
26521
26651
|
...props.client.admitMcp === void 0 ? {} : { admit: props.client.admitMcp }
|
|
26522
26652
|
}
|
|
26523
26653
|
) : null,
|
|
26524
|
-
candidates === void 0 ? null : /* @__PURE__ */ (0,
|
|
26654
|
+
candidates === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26525
26655
|
PickDialog,
|
|
26526
26656
|
{
|
|
26527
26657
|
servers: candidates,
|
|
@@ -26535,11 +26665,11 @@ function McpSettings(props) {
|
|
|
26535
26665
|
}
|
|
26536
26666
|
}
|
|
26537
26667
|
),
|
|
26538
|
-
alert === void 0 ? null : /* @__PURE__ */ (0,
|
|
26539
|
-
/* @__PURE__ */ (0,
|
|
26540
|
-
/* @__PURE__ */ (0,
|
|
26668
|
+
alert === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Dialog, { width: "sm", onClose: () => setAlert(void 0), children: [
|
|
26669
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-sm", children: label(alert === "import" ? "mcp-import-none" : "save-failed") }),
|
|
26670
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: () => setAlert(void 0), children: label("confirm") }) })
|
|
26541
26671
|
] }),
|
|
26542
|
-
removing === void 0 ? null : /* @__PURE__ */ (0,
|
|
26672
|
+
removing === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26543
26673
|
ConfirmDialog,
|
|
26544
26674
|
{
|
|
26545
26675
|
label,
|
|
@@ -26562,34 +26692,34 @@ function ServerCard(props) {
|
|
|
26562
26692
|
const shown = tools.slice(0, 4);
|
|
26563
26693
|
const extra = tools.length - shown.length;
|
|
26564
26694
|
const [openTool, setOpenTool] = (0, import_react8.useState)(void 0);
|
|
26565
|
-
return /* @__PURE__ */ (0,
|
|
26566
|
-
/* @__PURE__ */ (0,
|
|
26567
|
-
/* @__PURE__ */ (0,
|
|
26568
|
-
/* @__PURE__ */ (0,
|
|
26569
|
-
/* @__PURE__ */ (0,
|
|
26570
|
-
/* @__PURE__ */ (0,
|
|
26695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { className: "flex flex-col gap-2 rounded-2xl border bg-card px-3 py-3", children: [
|
|
26696
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
26697
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "min-w-0 truncate text-sm font-semibold", children: props.server.id }),
|
|
26698
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
26699
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Switch, { on: enabled, label: props.label("section-mcp"), onClick: props.onToggle }),
|
|
26700
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "inline-flex size-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground", "aria-label": props.label("mcp-edit"), onClick: props.onEdit, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Settings, { size: 16, strokeWidth: 2 }) })
|
|
26571
26701
|
] })
|
|
26572
26702
|
] }),
|
|
26573
|
-
/* @__PURE__ */ (0,
|
|
26574
|
-
/* @__PURE__ */ (0,
|
|
26575
|
-
/* @__PURE__ */ (0,
|
|
26703
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
26704
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Status, { running, label: props.label(running ? "mcp-running" : "mcp-stopped") }),
|
|
26705
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inline-flex h-6 items-center rounded-full bg-muted px-2 text-[11px] leading-none text-muted-foreground", children: props.label(transportKey(kind)) })
|
|
26576
26706
|
] }),
|
|
26577
|
-
props.server.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
26578
|
-
shown.length === 0 ? null : /* @__PURE__ */ (0,
|
|
26579
|
-
shown.map((tool) => /* @__PURE__ */ (0,
|
|
26580
|
-
extra > 0 ? /* @__PURE__ */ (0,
|
|
26707
|
+
props.server.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: props.server.description }),
|
|
26708
|
+
shown.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
26709
|
+
shown.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "inline-flex h-6 items-center rounded-full border px-2 text-[11px] leading-none hover:bg-muted", onClick: () => setOpenTool(tool.name), children: tool.name }, tool.name)),
|
|
26710
|
+
extra > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "inline-flex h-6 items-center rounded-full px-2 text-[11px] leading-none text-muted-foreground hover:bg-muted", onClick: () => setOpenTool(tools[shown.length]?.name ?? tools[0]?.name), children: countLabel(props.label("mcp-more"), extra) }) : null
|
|
26581
26711
|
] }),
|
|
26582
|
-
/* @__PURE__ */ (0,
|
|
26583
|
-
/* @__PURE__ */ (0,
|
|
26584
|
-
/* @__PURE__ */ (0,
|
|
26712
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex gap-2", children: [
|
|
26713
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-7 rounded-md px-2 text-xs hover:bg-muted", onClick: props.onCheck, children: props.busy ? "\u2026" : props.label("mcp-check") }),
|
|
26714
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-7 rounded-md px-2 text-xs text-destructive hover:bg-muted", onClick: props.onRemove, children: props.label("delete") })
|
|
26585
26715
|
] }),
|
|
26586
|
-
props.failure === void 0 ? null : /* @__PURE__ */ (0,
|
|
26716
|
+
props.failure === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "m-0 text-xs text-destructive", children: [
|
|
26587
26717
|
props.label("mcp-unstarted"),
|
|
26588
26718
|
": ",
|
|
26589
26719
|
props.failure.message
|
|
26590
26720
|
] }),
|
|
26591
|
-
props.check !== void 0 && props.check.ok !== true ? /* @__PURE__ */ (0,
|
|
26592
|
-
openTool === void 0 ? null : /* @__PURE__ */ (0,
|
|
26721
|
+
props.check !== void 0 && props.check.ok !== true ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-destructive", children: props.check.message ?? props.label("mcp-offline") }) : null,
|
|
26722
|
+
openTool === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26593
26723
|
ToolsDialog,
|
|
26594
26724
|
{
|
|
26595
26725
|
title: props.server.id,
|
|
@@ -26604,13 +26734,13 @@ function ServerCard(props) {
|
|
|
26604
26734
|
}
|
|
26605
26735
|
function ToolsDialog(props) {
|
|
26606
26736
|
const tool = props.tools.find((item) => item.name === props.selected) ?? props.tools[0];
|
|
26607
|
-
return /* @__PURE__ */ (0,
|
|
26608
|
-
/* @__PURE__ */ (0,
|
|
26609
|
-
/* @__PURE__ */ (0,
|
|
26610
|
-
/* @__PURE__ */ (0,
|
|
26737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Dialog, { width: "wide", onClose: props.onClose, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex h-[min(70vh,36rem)] min-h-[24rem] flex-col", children: [
|
|
26738
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
26739
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h5", { className: "m-0 text-base font-semibold", children: props.title }),
|
|
26740
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: `${props.tools.length} ${props.label("mcp-tools")}` })
|
|
26611
26741
|
] }),
|
|
26612
|
-
/* @__PURE__ */ (0,
|
|
26613
|
-
/* @__PURE__ */ (0,
|
|
26742
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 grid min-h-0 flex-1 grid-cols-1 overflow-hidden rounded-2xl border min-[720px]:grid-cols-[16rem_minmax(0,1fr)]", children: [
|
|
26743
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "max-h-48 overflow-auto border-b bg-muted/40 p-2 min-[720px]:max-h-none min-[720px]:border-r min-[720px]:border-b-0", children: props.tools.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
26614
26744
|
"button",
|
|
26615
26745
|
{
|
|
26616
26746
|
type: "button",
|
|
@@ -26619,29 +26749,29 @@ function ToolsDialog(props) {
|
|
|
26619
26749
|
children: item.name
|
|
26620
26750
|
}
|
|
26621
26751
|
) }, item.name)) }),
|
|
26622
|
-
/* @__PURE__ */ (0,
|
|
26623
|
-
/* @__PURE__ */ (0,
|
|
26624
|
-
/* @__PURE__ */ (0,
|
|
26625
|
-
/* @__PURE__ */ (0,
|
|
26626
|
-
tool.inputSchema === void 0 ? null : /* @__PURE__ */ (0,
|
|
26627
|
-
tool.outputSchema === void 0 ? null : /* @__PURE__ */ (0,
|
|
26752
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { className: "overflow-auto p-6", children: tool === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
26753
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-xs text-muted-foreground", children: props.label("mcp-tools") }),
|
|
26754
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h6", { className: "mt-2 text-xl font-semibold tracking-tight", children: tool.name }),
|
|
26755
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-4 text-sm leading-7 whitespace-pre-wrap text-muted-foreground", children: tool.description ?? props.label("mcp-tool-empty") }),
|
|
26756
|
+
tool.inputSchema === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SchemaBlock, { caption: props.label("mcp-schema-input"), schema: tool.inputSchema, label: props.label }),
|
|
26757
|
+
tool.outputSchema === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SchemaBlock, { caption: props.label("mcp-schema-output"), schema: tool.outputSchema, label: props.label })
|
|
26628
26758
|
] }) })
|
|
26629
26759
|
] })
|
|
26630
26760
|
] }) });
|
|
26631
26761
|
}
|
|
26632
26762
|
function SchemaBlock(props) {
|
|
26633
26763
|
const fields = schemaFields(props.schema);
|
|
26634
|
-
return /* @__PURE__ */ (0,
|
|
26635
|
-
/* @__PURE__ */ (0,
|
|
26636
|
-
fields.length === 0 ? /* @__PURE__ */ (0,
|
|
26637
|
-
/* @__PURE__ */ (0,
|
|
26638
|
-
/* @__PURE__ */ (0,
|
|
26639
|
-
/* @__PURE__ */ (0,
|
|
26640
|
-
field.required ? /* @__PURE__ */ (0,
|
|
26764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "mt-6", children: [
|
|
26765
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-xs text-muted-foreground", children: props.caption }),
|
|
26766
|
+
fields.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-2 text-sm text-muted-foreground", children: props.label("mcp-schema-no-fields") }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "mt-2 list-none space-y-2 p-0", children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { className: "rounded-lg border p-3", children: [
|
|
26767
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
26768
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-mono text-sm", children: field.name }),
|
|
26769
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-[11px] text-muted-foreground", children: field.type }),
|
|
26770
|
+
field.required ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rounded-full border px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground", children: props.label("mcp-schema-required") }) : null
|
|
26641
26771
|
] }),
|
|
26642
|
-
field.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
26772
|
+
field.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1.5 mb-0 text-xs leading-6 text-muted-foreground", children: field.description })
|
|
26643
26773
|
] }, field.name)) }),
|
|
26644
|
-
/* @__PURE__ */ (0,
|
|
26774
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("pre", { className: "mt-3 max-h-64 overflow-auto rounded-lg border bg-muted/40 p-3 font-mono text-[11px] leading-5 break-all whitespace-pre-wrap", children: JSON.stringify(props.schema, null, 2) })
|
|
26645
26775
|
] });
|
|
26646
26776
|
}
|
|
26647
26777
|
function schemaFields(schema) {
|
|
@@ -26677,39 +26807,39 @@ function EditorDialog(props) {
|
|
|
26677
26807
|
const set = (patch) => props.onChange({ ...props.draft, ...patch });
|
|
26678
26808
|
const [busy, setBusy] = (0, import_react8.useState)(false);
|
|
26679
26809
|
const [check, setCheck] = (0, import_react8.useState)(void 0);
|
|
26680
|
-
return /* @__PURE__ */ (0,
|
|
26681
|
-
/* @__PURE__ */ (0,
|
|
26682
|
-
/* @__PURE__ */ (0,
|
|
26683
|
-
/* @__PURE__ */ (0,
|
|
26684
|
-
/* @__PURE__ */ (0,
|
|
26685
|
-
/* @__PURE__ */ (0,
|
|
26686
|
-
/* @__PURE__ */ (0,
|
|
26810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Dialog, { onClose: props.onCancel, children: [
|
|
26811
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h5", { className: "m-0 text-sm font-semibold", children: props.draft.editing === void 0 ? props.label("mcp-new") : props.label("mcp-edit") }),
|
|
26812
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-4 mb-2 text-xs text-muted-foreground", children: props.label("mcp-transport") }),
|
|
26813
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "inline-flex rounded-lg bg-muted p-0.5", children: ["stdio", "sse", "http"].map((kind) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-7 rounded-md px-3 text-xs data-[on=1]:bg-foreground data-[on=1]:text-background", "data-on": props.draft.transport === kind ? "1" : "0", onClick: () => set({ transport: kind }), children: props.label(transportKey(kind)) }, kind)) }),
|
|
26814
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 grid gap-3 min-[720px]:grid-cols-2", children: [
|
|
26815
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field2, { label: props.label("mcp-name"), value: props.draft.id, hint: props.label("mcp-name-hint"), onChange: (id) => set({ id }) }),
|
|
26816
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field2, { label: props.label("mcp-description"), value: props.draft.description, hint: props.label("mcp-desc-hint"), onChange: (description) => set({ description }) })
|
|
26687
26817
|
] }),
|
|
26688
|
-
props.draft.transport === "stdio" ? /* @__PURE__ */ (0,
|
|
26689
|
-
/* @__PURE__ */ (0,
|
|
26690
|
-
/* @__PURE__ */ (0,
|
|
26691
|
-
] }) : /* @__PURE__ */ (0,
|
|
26692
|
-
props.draft.transport === "stdio" ? /* @__PURE__ */ (0,
|
|
26818
|
+
props.draft.transport === "stdio" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-3 grid gap-3 min-[720px]:grid-cols-2", children: [
|
|
26819
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field2, { label: props.label("mcp-command"), value: props.draft.command, hint: props.label("mcp-command-hint"), onChange: (command) => set({ command }) }),
|
|
26820
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field2, { label: props.label("mcp-args"), value: props.draft.args, hint: props.label("mcp-args-hint"), onChange: (args) => set({ args }) })
|
|
26821
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field2, { label: props.label("mcp-url"), value: props.draft.url, hint: props.label("mcp-url-hint"), onChange: (url) => set({ url }) }) }),
|
|
26822
|
+
props.draft.transport === "stdio" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "mt-3 flex flex-col gap-1.5 text-xs text-muted-foreground", children: [
|
|
26693
26823
|
props.label("mcp-env"),
|
|
26694
|
-
/* @__PURE__ */ (0,
|
|
26695
|
-
/* @__PURE__ */ (0,
|
|
26696
|
-
] }) : /* @__PURE__ */ (0,
|
|
26824
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { className: "min-h-24 rounded-lg border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none", placeholder: props.label("mcp-env-hint"), value: props.draft.env, onChange: (event) => set({ env: event.target.value }) }),
|
|
26825
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-sans text-muted-foreground", children: props.label("mcp-reference-hint") })
|
|
26826
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "mt-3 flex flex-col gap-1.5 text-xs text-muted-foreground", children: [
|
|
26697
26827
|
props.label("mcp-headers"),
|
|
26698
|
-
/* @__PURE__ */ (0,
|
|
26699
|
-
/* @__PURE__ */ (0,
|
|
26828
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { className: "min-h-24 rounded-lg border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none", placeholder: props.label("mcp-headers-hint"), value: props.draft.headers, onChange: (event) => set({ headers: event.target.value }) }),
|
|
26829
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-sans text-muted-foreground", children: props.label("mcp-reference-hint") })
|
|
26700
26830
|
] }),
|
|
26701
|
-
check === void 0 ? null : /* @__PURE__ */ (0,
|
|
26702
|
-
/* @__PURE__ */ (0,
|
|
26703
|
-
check.tools.length === 0 ? null : /* @__PURE__ */ (0,
|
|
26704
|
-
] }) : /* @__PURE__ */ (0,
|
|
26705
|
-
/* @__PURE__ */ (0,
|
|
26706
|
-
props.onCheck === void 0 ? null : /* @__PURE__ */ (0,
|
|
26831
|
+
check === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-3", children: check.ok ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
26832
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-sm text-primary", children: countLabel(props.label("mcp-check-ok"), check.tools.length) }),
|
|
26833
|
+
check.tools.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-2 flex flex-wrap gap-1", children: check.tools.slice(0, 8).map((tool) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rounded-full border px-2 py-0.5 text-[11px]", children: tool.name }, tool.name)) })
|
|
26834
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-sm text-destructive", children: check.message ?? props.label("mcp-offline") }) }),
|
|
26835
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
26836
|
+
props.onCheck === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "mr-auto h-8 rounded-lg border px-3 text-sm disabled:opacity-60", disabled: busy, onClick: () => {
|
|
26707
26837
|
const checkMcp = props.onCheck;
|
|
26708
26838
|
if (checkMcp === void 0) return;
|
|
26709
26839
|
void testDraft(props.draft, checkMcp, setBusy, setCheck, props.label);
|
|
26710
26840
|
}, children: busy ? "\u2026" : props.label("mcp-check") }),
|
|
26711
|
-
/* @__PURE__ */ (0,
|
|
26712
|
-
/* @__PURE__ */ (0,
|
|
26841
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onCancel, children: props.label("cancel") }),
|
|
26842
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: props.onSubmit, children: props.draft.editing === void 0 ? props.label("mcp-add") : props.label("save") })
|
|
26713
26843
|
] })
|
|
26714
26844
|
] });
|
|
26715
26845
|
}
|
|
@@ -26718,17 +26848,17 @@ function PasteDialog(props) {
|
|
|
26718
26848
|
const [found, setFound] = (0, import_react8.useState)(void 0);
|
|
26719
26849
|
const [failed, setFailed] = (0, import_react8.useState)("");
|
|
26720
26850
|
const [busy, setBusy] = (0, import_react8.useState)(false);
|
|
26721
|
-
return /* @__PURE__ */ (0,
|
|
26722
|
-
/* @__PURE__ */ (0,
|
|
26723
|
-
/* @__PURE__ */ (0,
|
|
26724
|
-
failed.length > 0 ? /* @__PURE__ */ (0,
|
|
26725
|
-
found === void 0 ? null : /* @__PURE__ */ (0,
|
|
26726
|
-
/* @__PURE__ */ (0,
|
|
26727
|
-
/* @__PURE__ */ (0,
|
|
26851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Dialog, { onClose: props.onCancel, children: [
|
|
26852
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h5", { className: "m-0 text-sm font-semibold", children: props.label("mcp-paste") }),
|
|
26853
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { className: "mt-3 min-h-36 w-full rounded-lg border bg-background px-3 py-2 font-mono text-xs text-foreground outline-none", value: text2, onChange: (event) => setText(event.target.value) }),
|
|
26854
|
+
failed.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-2 text-sm text-destructive", children: failed }) : null,
|
|
26855
|
+
found === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "mt-3 flex max-h-48 flex-col gap-1 overflow-auto", children: found.map((server) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: "flex w-full items-baseline gap-2 rounded-lg px-2 py-2 text-left text-sm hover:bg-muted", onClick: () => props.onPick(server), children: [
|
|
26856
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium", children: server.id }),
|
|
26857
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs text-muted-foreground", children: props.label(transportKey(transportOf(server))) })
|
|
26728
26858
|
] }) }, server.id)) }),
|
|
26729
|
-
/* @__PURE__ */ (0,
|
|
26730
|
-
/* @__PURE__ */ (0,
|
|
26731
|
-
/* @__PURE__ */ (0,
|
|
26859
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
26860
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onCancel, children: props.label("cancel") }),
|
|
26861
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground disabled:opacity-60", disabled: busy || props.admit === void 0, onClick: () => {
|
|
26732
26862
|
const admit2 = props.admit;
|
|
26733
26863
|
if (admit2 === void 0) return;
|
|
26734
26864
|
void recognizePaste(text2, admit2, setBusy, setFailed, setFound, props.onPick, props.label);
|
|
@@ -26739,39 +26869,39 @@ function PasteDialog(props) {
|
|
|
26739
26869
|
function PickDialog(props) {
|
|
26740
26870
|
const [picked, setPicked] = (0, import_react8.useState)(() => new Set(props.servers.map((server) => server.id)));
|
|
26741
26871
|
const chosen = props.servers.filter((server) => picked.has(server.id));
|
|
26742
|
-
return /* @__PURE__ */ (0,
|
|
26743
|
-
/* @__PURE__ */ (0,
|
|
26744
|
-
/* @__PURE__ */ (0,
|
|
26745
|
-
/* @__PURE__ */ (0,
|
|
26746
|
-
/* @__PURE__ */ (0,
|
|
26747
|
-
/* @__PURE__ */ (0,
|
|
26748
|
-
/* @__PURE__ */ (0,
|
|
26749
|
-
/* @__PURE__ */ (0,
|
|
26872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Dialog, { width: "wide", onClose: props.onCancel, children: [
|
|
26873
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h5", { className: "m-0 text-base font-semibold", children: props.label("mcp-pick") }),
|
|
26874
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "mt-4 grid max-h-[60vh] grid-cols-1 gap-2 overflow-auto min-[720px]:grid-cols-2", children: props.servers.map((server) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "flex h-full items-start gap-3 rounded-xl border px-3 py-3 text-sm hover:bg-muted", children: [
|
|
26875
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { className: "mt-1", type: "checkbox", checked: picked.has(server.id), onChange: () => setPicked(toggleSet(picked, server.id)) }),
|
|
26876
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "min-w-0", children: [
|
|
26877
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex items-baseline gap-2", children: [
|
|
26878
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate font-medium", children: server.id }),
|
|
26879
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground", children: props.label(transportKey(transportOf(server))) })
|
|
26750
26880
|
] }),
|
|
26751
|
-
server.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
26881
|
+
server.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "mt-1 block text-xs leading-5 text-muted-foreground", children: server.description })
|
|
26752
26882
|
] })
|
|
26753
26883
|
] }) }, server.id)) }),
|
|
26754
|
-
/* @__PURE__ */ (0,
|
|
26755
|
-
/* @__PURE__ */ (0,
|
|
26756
|
-
/* @__PURE__ */ (0,
|
|
26884
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
26885
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onCancel, children: props.label("cancel") }),
|
|
26886
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: () => props.onConfirm(chosen), children: props.label("mcp-add") })
|
|
26757
26887
|
] })
|
|
26758
26888
|
] });
|
|
26759
26889
|
}
|
|
26760
26890
|
function ConfirmDialog(props) {
|
|
26761
|
-
return /* @__PURE__ */ (0,
|
|
26762
|
-
/* @__PURE__ */ (0,
|
|
26763
|
-
/* @__PURE__ */ (0,
|
|
26764
|
-
/* @__PURE__ */ (0,
|
|
26765
|
-
/* @__PURE__ */ (0,
|
|
26891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Dialog, { onClose: props.onCancel, children: [
|
|
26892
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "m-0 text-sm", children: props.title }),
|
|
26893
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
26894
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onCancel, children: props.label("cancel") }),
|
|
26895
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-destructive px-3 text-sm font-semibold text-destructive-foreground", onClick: props.onConfirm, children: props.label("delete") })
|
|
26766
26896
|
] })
|
|
26767
26897
|
] });
|
|
26768
26898
|
}
|
|
26769
26899
|
function Switch(props) {
|
|
26770
|
-
return /* @__PURE__ */ (0,
|
|
26900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", role: "switch", "aria-checked": props.on, "aria-label": props.label, className: props.on ? "relative h-5 w-9 rounded-full bg-foreground" : "relative h-5 w-9 rounded-full bg-muted", onClick: props.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: props.on ? "absolute top-0.5 left-4 size-4 rounded-full bg-background" : "absolute top-0.5 left-0.5 size-4 rounded-full bg-background" }) });
|
|
26771
26901
|
}
|
|
26772
26902
|
function Status(props) {
|
|
26773
|
-
return /* @__PURE__ */ (0,
|
|
26774
|
-
/* @__PURE__ */ (0,
|
|
26903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: props.running ? "inline-flex h-6 items-center gap-1.5 rounded-full bg-primary/15 px-2 text-[11px] leading-none font-medium text-primary" : "inline-flex h-6 items-center gap-1.5 rounded-full bg-muted px-2 text-[11px] leading-none text-muted-foreground", children: [
|
|
26904
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: props.running ? "size-1.5 rounded-full bg-primary" : "size-1.5 rounded-full bg-muted-foreground" }),
|
|
26775
26905
|
props.label
|
|
26776
26906
|
] });
|
|
26777
26907
|
}
|
|
@@ -26779,9 +26909,9 @@ function countLabel(template, count) {
|
|
|
26779
26909
|
return template.replace("{n}", String(count));
|
|
26780
26910
|
}
|
|
26781
26911
|
function Field2(props) {
|
|
26782
|
-
return /* @__PURE__ */ (0,
|
|
26912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "flex flex-col gap-1.5 text-xs text-muted-foreground", children: [
|
|
26783
26913
|
props.label,
|
|
26784
|
-
/* @__PURE__ */ (0,
|
|
26914
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { className: "h-9 rounded-lg border bg-background px-3 text-sm text-foreground outline-none", placeholder: props.hint, value: props.value, onChange: (event) => props.onChange(event.target.value) })
|
|
26785
26915
|
] });
|
|
26786
26916
|
}
|
|
26787
26917
|
function transportOf(server) {
|
|
@@ -26995,7 +27125,7 @@ function writeList(key, dirs) {
|
|
|
26995
27125
|
}
|
|
26996
27126
|
|
|
26997
27127
|
// ../../panel/src/settings/skill-install.tsx
|
|
26998
|
-
var
|
|
27128
|
+
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
26999
27129
|
function SkillInstall(props) {
|
|
27000
27130
|
const [skill, setSkill] = (0, import_react9.useState)(void 0);
|
|
27001
27131
|
const [busy, setBusy] = (0, import_react9.useState)(false);
|
|
@@ -27014,35 +27144,35 @@ function SkillInstall(props) {
|
|
|
27014
27144
|
}, () => setSkill(void 0));
|
|
27015
27145
|
}, [props.readSkill, customDirs]);
|
|
27016
27146
|
if (props.readSkill === void 0) return null;
|
|
27017
|
-
return /* @__PURE__ */ (0,
|
|
27018
|
-
/* @__PURE__ */ (0,
|
|
27019
|
-
/* @__PURE__ */ (0,
|
|
27147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "rounded-2xl border bg-card px-4 py-3", children: [
|
|
27148
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "m-0 text-sm font-medium", children: props.label("skill-install") }),
|
|
27149
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "mt-1 mb-3 text-xs text-muted-foreground", children: [
|
|
27020
27150
|
props.label("skill-help"),
|
|
27021
27151
|
skill?.version === null || skill?.version === void 0 ? null : ` ${props.label("skill-version").replace("{n}", skill.version)}`
|
|
27022
27152
|
] }),
|
|
27023
|
-
/* @__PURE__ */ (0,
|
|
27024
|
-
/* @__PURE__ */ (0,
|
|
27153
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: (skill?.agents ?? []).map((agent) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { className: agent.homePresent ? "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-muted" : "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 opacity-50 hover:bg-muted", children: [
|
|
27154
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { type: "checkbox", checked: picked.has(agent.id), onChange: () => {
|
|
27025
27155
|
const next = toggleId(picked, agent.id);
|
|
27026
27156
|
setPicked(next);
|
|
27027
27157
|
writeSkillAgentIds([...next]);
|
|
27028
27158
|
} }),
|
|
27029
|
-
/* @__PURE__ */ (0,
|
|
27030
|
-
/* @__PURE__ */ (0,
|
|
27031
|
-
agent.homePresent ? null : /* @__PURE__ */ (0,
|
|
27159
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm", children: agent.label }),
|
|
27160
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ml-4 flex min-w-0 items-center gap-2", children: [
|
|
27161
|
+
agent.homePresent ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px] text-muted-foreground", children: props.label("skill-missing-home") }),
|
|
27032
27162
|
busy && picked.has(agent.id) ? installingCaption(props.label) : skillCopyCaption(agent, props.label),
|
|
27033
|
-
agent.installed && props.revealSkill !== void 0 ? /* @__PURE__ */ (0,
|
|
27163
|
+
agent.installed && props.revealSkill !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tooltip, { text: agent.dest, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "max-w-[28rem] truncate font-mono text-[11px] text-muted-foreground underline-offset-2 hover:underline", onClick: () => {
|
|
27034
27164
|
void props.revealSkill?.(agent.dest);
|
|
27035
27165
|
}, children: shortHomePath(agent.dest) }) }) : null
|
|
27036
27166
|
] })
|
|
27037
27167
|
] }, agent.id)) }),
|
|
27038
|
-
/* @__PURE__ */ (0,
|
|
27039
|
-
/* @__PURE__ */ (0,
|
|
27040
|
-
/* @__PURE__ */ (0,
|
|
27041
|
-
/* @__PURE__ */ (0,
|
|
27168
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-3", children: [
|
|
27169
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "mb-1 text-xs text-muted-foreground", children: props.label("skill-custom") }),
|
|
27170
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex gap-2", children: [
|
|
27171
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "h-9 min-w-0 flex-1 rounded-lg border bg-background px-3 text-sm outline-none", placeholder: props.label("skill-custom-hint"), value: customDraft, onChange: (event) => {
|
|
27042
27172
|
setCustomDraft(event.target.value);
|
|
27043
27173
|
setCustomError(false);
|
|
27044
27174
|
} }),
|
|
27045
|
-
/* @__PURE__ */ (0,
|
|
27175
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "h-9 rounded-lg border px-3 text-sm", onClick: () => {
|
|
27046
27176
|
const dir = customDraft.trim();
|
|
27047
27177
|
if (!endsWithSkills(dir)) {
|
|
27048
27178
|
setCustomError(true);
|
|
@@ -27059,16 +27189,16 @@ function SkillInstall(props) {
|
|
|
27059
27189
|
setCustomError(false);
|
|
27060
27190
|
}, children: props.label("skill-add-dir") })
|
|
27061
27191
|
] }),
|
|
27062
|
-
customError ? /* @__PURE__ */ (0,
|
|
27063
|
-
/* @__PURE__ */ (0,
|
|
27192
|
+
customError ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "mt-1 mb-0 text-xs text-destructive", children: props.label("skill-custom-format") }) : null,
|
|
27193
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "mt-2 flex list-none flex-col gap-1 p-0", children: customDirs.map((dir) => {
|
|
27064
27194
|
const row = skill?.customs.find((item) => item.dir === dir || item.dir.endsWith(dir.replace(/^~/, "")));
|
|
27065
|
-
return /* @__PURE__ */ (0,
|
|
27066
|
-
/* @__PURE__ */ (0,
|
|
27195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { className: "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm hover:bg-muted", children: [
|
|
27196
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "max-w-[28rem] truncate font-mono text-xs", children: dir }),
|
|
27067
27197
|
busy ? installingCaption(props.label) : row === void 0 ? null : skillCopyCaption(row, props.label),
|
|
27068
|
-
row?.installed === true && props.revealSkill !== void 0 ? /* @__PURE__ */ (0,
|
|
27198
|
+
row?.installed === true && props.revealSkill !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tooltip, { text: row.dest, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "max-w-[28rem] truncate font-mono text-[11px] text-muted-foreground underline-offset-2 hover:underline", onClick: () => {
|
|
27069
27199
|
void props.revealSkill?.(row.dest);
|
|
27070
27200
|
}, children: shortHomePath(row.dest) }) }) : null,
|
|
27071
|
-
/* @__PURE__ */ (0,
|
|
27201
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "text-[11px] text-muted-foreground", onClick: () => {
|
|
27072
27202
|
const next = customDirs.filter((item) => item !== dir);
|
|
27073
27203
|
setCustomDirs(next);
|
|
27074
27204
|
writeSkillCustomDirs(next);
|
|
@@ -27076,21 +27206,21 @@ function SkillInstall(props) {
|
|
|
27076
27206
|
] }, dir);
|
|
27077
27207
|
}) })
|
|
27078
27208
|
] }),
|
|
27079
|
-
/* @__PURE__ */ (0,
|
|
27209
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "mt-3 h-8 rounded-lg border px-3 text-sm hover:bg-muted disabled:opacity-60", disabled: busy || props.installSkill === void 0, onClick: () => {
|
|
27080
27210
|
const install = props.installSkill;
|
|
27081
27211
|
if (install === void 0) return;
|
|
27082
27212
|
setBusy(true);
|
|
27083
27213
|
setFailed(false);
|
|
27084
27214
|
void install([...picked], customDirs).then(setSkill, () => setFailed(true)).finally(() => setBusy(false));
|
|
27085
27215
|
}, children: busy ? "\u2026" : props.label(skillNeedsUpdate(skill, picked, customDirs) ? "skill-update-install" : "skill-install") }),
|
|
27086
|
-
failed ? /* @__PURE__ */ (0,
|
|
27216
|
+
failed ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "mt-2 mb-0 text-xs text-destructive", children: props.label("skill-failed") }) : null
|
|
27087
27217
|
] });
|
|
27088
27218
|
}
|
|
27089
27219
|
function skillCopyCaption(row, label) {
|
|
27090
27220
|
if (!row.installed) return null;
|
|
27091
|
-
return /* @__PURE__ */ (0,
|
|
27092
|
-
/* @__PURE__ */ (0,
|
|
27093
|
-
row.version === null ? null : /* @__PURE__ */ (0,
|
|
27221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
27222
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: row.updateAvailable ? "text-[11px] text-primary" : "text-[11px] text-muted-foreground", children: label(row.updateAvailable ? "skill-update" : "skill-installed") }),
|
|
27223
|
+
row.version === null ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px] text-muted-foreground", children: row.version })
|
|
27094
27224
|
] });
|
|
27095
27225
|
}
|
|
27096
27226
|
function skillNeedsUpdate(skill, picked, customDirs) {
|
|
@@ -27103,7 +27233,7 @@ function skillNeedsUpdate(skill, picked, customDirs) {
|
|
|
27103
27233
|
}
|
|
27104
27234
|
|
|
27105
27235
|
// ../../panel/src/settings/view.tsx
|
|
27106
|
-
var
|
|
27236
|
+
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
27107
27237
|
function sections(props) {
|
|
27108
27238
|
return props.client?.readCredentials === void 0 ? ["appearance", "network", "agent", "mcp", "about"] : ["appearance", "network", "agent", "mcp", "credentials", "about"];
|
|
27109
27239
|
}
|
|
@@ -27114,6 +27244,7 @@ function PanelSettings(props) {
|
|
|
27114
27244
|
const [runtimes, setRuntimes] = (0, import_react10.useState)([]);
|
|
27115
27245
|
const [runtimeBusy, setRuntimeBusy] = (0, import_react10.useState)(false);
|
|
27116
27246
|
const [update, setUpdate] = (0, import_react10.useState)(void 0);
|
|
27247
|
+
const [about2, setAbout] = (0, import_react10.useState)(void 0);
|
|
27117
27248
|
const [restarting, setRestarting] = (0, import_react10.useState)(false);
|
|
27118
27249
|
const [portUnlocked, setPortUnlocked] = (0, import_react10.useState)(false);
|
|
27119
27250
|
(0, import_react10.useEffect)(() => {
|
|
@@ -27127,6 +27258,12 @@ function PanelSettings(props) {
|
|
|
27127
27258
|
if (props.hostPolicy === void 0) return;
|
|
27128
27259
|
dispatch({ type: "host-policy", policy: props.hostPolicy });
|
|
27129
27260
|
}, [props.hostPolicy]);
|
|
27261
|
+
(0, import_react10.useEffect)(() => {
|
|
27262
|
+
if (section !== "about" || about2 !== void 0) return;
|
|
27263
|
+
const read = props.client?.readAbout;
|
|
27264
|
+
if (read === void 0) return;
|
|
27265
|
+
void read().then(setAbout, () => void 0);
|
|
27266
|
+
}, [section, about2, props.client]);
|
|
27130
27267
|
(0, import_react10.useEffect)(() => {
|
|
27131
27268
|
if (state.closed) props.onClose?.();
|
|
27132
27269
|
}, [state.closed]);
|
|
@@ -27160,10 +27297,11 @@ function PanelSettings(props) {
|
|
|
27160
27297
|
return;
|
|
27161
27298
|
}
|
|
27162
27299
|
props.onPolicy?.(written);
|
|
27300
|
+
setAbout(void 0);
|
|
27163
27301
|
setSaveFeedback("saved");
|
|
27164
27302
|
window.setTimeout(() => setSaveFeedback("idle"), 2e3);
|
|
27165
27303
|
};
|
|
27166
|
-
return /* @__PURE__ */ (0,
|
|
27304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
27167
27305
|
"form",
|
|
27168
27306
|
{
|
|
27169
27307
|
className: "flex h-full flex-col bg-background text-foreground",
|
|
@@ -27173,60 +27311,60 @@ function PanelSettings(props) {
|
|
|
27173
27311
|
if (event.key === "Escape") dispatch({ type: "escape" });
|
|
27174
27312
|
},
|
|
27175
27313
|
children: [
|
|
27176
|
-
/* @__PURE__ */ (0,
|
|
27177
|
-
/* @__PURE__ */ (0,
|
|
27178
|
-
/* @__PURE__ */ (0,
|
|
27314
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "flex items-center justify-between border-b bg-card px-4 py-3", children: [
|
|
27315
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { children: label("settings") }) }),
|
|
27316
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "inline-flex h-8 items-center rounded-lg px-3 text-sm hover:bg-muted", onClick: () => dispatch({ type: "escape" }), children: label("settings-close") }) })
|
|
27179
27317
|
] }),
|
|
27180
|
-
/* @__PURE__ */ (0,
|
|
27181
|
-
/* @__PURE__ */ (0,
|
|
27182
|
-
/* @__PURE__ */ (0,
|
|
27183
|
-
section === "mcp" ? /* @__PURE__ */ (0,
|
|
27184
|
-
section === "credentials" ? /* @__PURE__ */ (0,
|
|
27185
|
-
section === "appearance" ? /* @__PURE__ */ (0,
|
|
27186
|
-
/* @__PURE__ */ (0,
|
|
27187
|
-
/* @__PURE__ */ (0,
|
|
27188
|
-
/* @__PURE__ */ (0,
|
|
27189
|
-
/* @__PURE__ */ (0,
|
|
27190
|
-
/* @__PURE__ */ (0,
|
|
27191
|
-
/* @__PURE__ */ (0,
|
|
27318
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex min-h-0 flex-1", children: [
|
|
27319
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { className: "flex w-36 shrink-0 flex-col gap-1 border-r bg-card p-3", children: sections(props).map((id) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "rounded-lg px-2 py-1.5 text-left text-sm data-[on=1]:bg-muted data-[on=1]:font-medium", "data-nav": id, "data-on": section === id ? "1" : "0", onClick: () => setSection(id), children: label(`section-${id}`) }, id)) }),
|
|
27320
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "min-h-0 flex-1 overflow-auto px-6 py-5", children: [
|
|
27321
|
+
section === "mcp" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(McpSettings, { client, locale: labelLocale, mode: props.mode }) : null,
|
|
27322
|
+
section === "credentials" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CredentialSettings, { client, locale: labelLocale, mode: props.mode }) : null,
|
|
27323
|
+
section === "appearance" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "mb-6", children: [
|
|
27324
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { children: label("section-appearance") }),
|
|
27325
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-4 flex flex-col gap-2", children: [
|
|
27326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: label("language") }),
|
|
27327
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex max-w-xs gap-1 rounded-lg bg-muted p-1", children: [
|
|
27328
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-7 flex-1 rounded-md text-xs data-[on=1]:bg-card data-[on=1]:font-semibold data-[on=1]:shadow-sm", "data-on": state.locale === "zh-CN" ? "1" : "0", onClick: () => dispatch({ type: "edit-locale", locale: "zh-CN" }), children: label("lang-zh") }),
|
|
27329
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-7 flex-1 rounded-md text-xs data-[on=1]:bg-card data-[on=1]:font-semibold data-[on=1]:shadow-sm", "data-on": state.locale === "en" ? "1" : "0", onClick: () => dispatch({ type: "edit-locale", locale: "en" }), children: label("lang-en") })
|
|
27192
27330
|
] })
|
|
27193
27331
|
] }),
|
|
27194
|
-
/* @__PURE__ */ (0,
|
|
27195
|
-
/* @__PURE__ */ (0,
|
|
27196
|
-
/* @__PURE__ */ (0,
|
|
27197
|
-
/* @__PURE__ */ (0,
|
|
27198
|
-
/* @__PURE__ */ (0,
|
|
27332
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-4 flex flex-col gap-2", children: [
|
|
27333
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: label("appearance") }),
|
|
27334
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "grid grid-cols-3 gap-2", children: ["system", "light", "dark"].map((theme) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: choiceCardClass, "data-on": state.theme === theme ? "1" : "0", onClick: () => dispatch({ type: "edit-theme", theme }), children: [
|
|
27335
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: theme === "dark" ? "block h-10 rounded-lg bg-foreground/80" : theme === "light" ? "block h-10 rounded-lg border bg-background" : "block h-10 rounded-lg bg-gradient-to-r from-background to-foreground/80" }),
|
|
27336
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs data-[on=1]:font-semibold", children: label(themeLabel(theme)) })
|
|
27199
27337
|
] }, theme)) })
|
|
27200
27338
|
] }),
|
|
27201
|
-
/* @__PURE__ */ (0,
|
|
27202
|
-
/* @__PURE__ */ (0,
|
|
27203
|
-
/* @__PURE__ */ (0,
|
|
27204
|
-
/* @__PURE__ */ (0,
|
|
27339
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-4 flex flex-col gap-2", children: [
|
|
27340
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: label("palette") }),
|
|
27341
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { className: "sr-only", value: state.palette, onChange: (event) => dispatch({ type: "edit-palette", palette: event.target.value }) }),
|
|
27342
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-2 grid grid-cols-2 gap-2 sm:grid-cols-4", children: (props.palettes ?? []).map((palette) => {
|
|
27205
27343
|
const chip = palettePreview(palette);
|
|
27206
|
-
return /* @__PURE__ */ (0,
|
|
27207
|
-
/* @__PURE__ */ (0,
|
|
27208
|
-
/* @__PURE__ */ (0,
|
|
27209
|
-
/* @__PURE__ */ (0,
|
|
27210
|
-
/* @__PURE__ */ (0,
|
|
27344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: choiceCardClass, "data-on": state.palette === palette.id ? "1" : "0", onClick: () => dispatch({ type: "edit-palette", palette: palette.id }), children: [
|
|
27345
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "flex h-10 items-end gap-1 rounded-lg border border-border/60 px-2 pb-2", style: { background: chip.surface }, children: [
|
|
27346
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "h-5 flex-1 rounded-sm", style: { background: chip.primary } }),
|
|
27347
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "h-3 flex-1 rounded-sm", style: { background: chip.muted } }),
|
|
27348
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "h-4 w-3 rounded-sm border border-border/50", style: { background: chip.card } })
|
|
27211
27349
|
] }),
|
|
27212
|
-
/* @__PURE__ */ (0,
|
|
27350
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs", children: paletteLabel2(labelLocale, palette) })
|
|
27213
27351
|
] }, palette.id);
|
|
27214
27352
|
}) })
|
|
27215
27353
|
] }),
|
|
27216
|
-
props.onCardStyle === void 0 || props.cardStyle === void 0 ? null : /* @__PURE__ */ (0,
|
|
27217
|
-
/* @__PURE__ */ (0,
|
|
27218
|
-
/* @__PURE__ */ (0,
|
|
27219
|
-
/* @__PURE__ */ (0,
|
|
27220
|
-
/* @__PURE__ */ (0,
|
|
27354
|
+
props.onCardStyle === void 0 || props.cardStyle === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-4 flex flex-col gap-2", children: [
|
|
27355
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: label("card-style") }),
|
|
27356
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-2 grid grid-cols-2 gap-2 sm:grid-cols-4", children: galleryCardStyles.map((style) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: choiceCardClass, "aria-pressed": props.cardStyle === style, "data-on": props.cardStyle === style ? "1" : "0", onClick: () => props.onCardStyle?.(style), children: [
|
|
27357
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CardStylePreview, { style }),
|
|
27358
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs", children: label(cardKey(style)) })
|
|
27221
27359
|
] }, style)) })
|
|
27222
27360
|
] })
|
|
27223
27361
|
] }) }) : null,
|
|
27224
|
-
section === "network" ? /* @__PURE__ */ (0,
|
|
27225
|
-
/* @__PURE__ */ (0,
|
|
27226
|
-
/* @__PURE__ */ (0,
|
|
27227
|
-
/* @__PURE__ */ (0,
|
|
27228
|
-
/* @__PURE__ */ (0,
|
|
27229
|
-
/* @__PURE__ */ (0,
|
|
27362
|
+
section === "network" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "mb-6", children: [
|
|
27363
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { children: label("section-network") }),
|
|
27364
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: state.portError ? "mb-4 flex flex-col gap-2 text-destructive" : "mb-4 flex flex-col gap-2", children: [
|
|
27365
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
27366
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "text-sm text-muted-foreground", htmlFor: "settings-host-port", children: label("port") }),
|
|
27367
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27230
27368
|
"button",
|
|
27231
27369
|
{
|
|
27232
27370
|
type: "button",
|
|
@@ -27236,16 +27374,16 @@ function PanelSettings(props) {
|
|
|
27236
27374
|
onClick: () => {
|
|
27237
27375
|
setPortUnlocked((open) => !open);
|
|
27238
27376
|
},
|
|
27239
|
-
children: /* @__PURE__ */ (0,
|
|
27377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Pencil, { size: 14, className: portUnlocked ? "text-primary" : "opacity-60" })
|
|
27240
27378
|
}
|
|
27241
27379
|
)
|
|
27242
27380
|
] }),
|
|
27243
|
-
/* @__PURE__ */ (0,
|
|
27244
|
-
/* @__PURE__ */ (0,
|
|
27245
|
-
/* @__PURE__ */ (0,
|
|
27246
|
-
/* @__PURE__ */ (0,
|
|
27247
|
-
/* @__PURE__ */ (0,
|
|
27248
|
-
/* @__PURE__ */ (0,
|
|
27381
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 max-w-xl text-xs leading-5 text-muted-foreground", children: label("port-help") }),
|
|
27382
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
27383
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-0", children: [
|
|
27384
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex h-9 items-center rounded-l-lg border bg-muted px-2 font-mono text-sm text-muted-foreground", children: "127.0.0.1" }),
|
|
27385
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex h-9 items-center border border-l-0 bg-muted px-1 font-mono text-sm text-muted-foreground", children: ":" }),
|
|
27386
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27249
27387
|
"input",
|
|
27250
27388
|
{
|
|
27251
27389
|
id: "settings-host-port",
|
|
@@ -27260,7 +27398,7 @@ function PanelSettings(props) {
|
|
|
27260
27398
|
}
|
|
27261
27399
|
)
|
|
27262
27400
|
] }),
|
|
27263
|
-
hostOrigin(state.port) === void 0 ? null : /* @__PURE__ */ (0,
|
|
27401
|
+
hostOrigin(state.port) === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
27264
27402
|
"a",
|
|
27265
27403
|
{
|
|
27266
27404
|
className: "inline-flex h-9 items-center gap-1.5 rounded-lg border px-3 text-sm text-primary hover:bg-muted",
|
|
@@ -27268,26 +27406,27 @@ function PanelSettings(props) {
|
|
|
27268
27406
|
target: "_blank",
|
|
27269
27407
|
rel: "noreferrer",
|
|
27270
27408
|
children: [
|
|
27271
|
-
/* @__PURE__ */ (0,
|
|
27409
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ExternalLink, { size: 14 }),
|
|
27272
27410
|
label("port-open-panel")
|
|
27273
27411
|
]
|
|
27274
27412
|
}
|
|
27275
27413
|
)
|
|
27276
27414
|
] }),
|
|
27277
|
-
hostOrigin(state.port) === void 0 ? null : /* @__PURE__ */ (0,
|
|
27278
|
-
/* @__PURE__ */ (0,
|
|
27279
|
-
/* @__PURE__ */ (0,
|
|
27280
|
-
/* @__PURE__ */ (0,
|
|
27415
|
+
hostOrigin(state.port) === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mt-1 grid max-w-xl gap-1 text-xs text-muted-foreground", children: [
|
|
27416
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "m-0 flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
27417
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: label("port-panel-url") }),
|
|
27418
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: "font-mono text-foreground underline-offset-2 hover:underline", href: hostOrigin(state.port), target: "_blank", rel: "noreferrer", children: hostOrigin(state.port) })
|
|
27281
27419
|
] }),
|
|
27282
|
-
/* @__PURE__ */ (0,
|
|
27283
|
-
/* @__PURE__ */ (0,
|
|
27284
|
-
/* @__PURE__ */ (0,
|
|
27420
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "m-0 flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
27421
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: label("port-mcp-url") }),
|
|
27422
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("code", { className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground", children: `${hostOrigin(state.port)}/mcp` })
|
|
27285
27423
|
] })
|
|
27286
27424
|
] }),
|
|
27287
|
-
state.portError ? /* @__PURE__ */ (0,
|
|
27425
|
+
state.portError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-muted-foreground", children: label("port-invalid") }) : null,
|
|
27426
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RegistryField, { state, dispatch, label })
|
|
27288
27427
|
] })
|
|
27289
27428
|
] }) : null,
|
|
27290
|
-
section === "agent" ? /* @__PURE__ */ (0,
|
|
27429
|
+
section === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27291
27430
|
AgentSection,
|
|
27292
27431
|
{
|
|
27293
27432
|
state,
|
|
@@ -27324,41 +27463,42 @@ function PanelSettings(props) {
|
|
|
27324
27463
|
...client.revealAuthorMcp === void 0 ? {} : { revealAuthorMcp: client.revealAuthorMcp }
|
|
27325
27464
|
}
|
|
27326
27465
|
) : null,
|
|
27327
|
-
section === "about" ? /* @__PURE__ */ (0,
|
|
27466
|
+
section === "about" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27328
27467
|
AboutSection,
|
|
27329
27468
|
{
|
|
27330
27469
|
update,
|
|
27331
27470
|
label,
|
|
27471
|
+
...about2?.source === void 0 ? {} : { source: about2.source },
|
|
27332
27472
|
...props.versions === void 0 ? {} : { versions: props.versions },
|
|
27333
27473
|
...client.checkUpdate === void 0 ? {} : { onCheck: () => {
|
|
27334
27474
|
void readUpdate(client, setUpdate, props.onUpdateOffer);
|
|
27335
27475
|
} }
|
|
27336
27476
|
}
|
|
27337
27477
|
) : null,
|
|
27338
|
-
section === "mcp" || section === "about" ? null : state.saveError ? /* @__PURE__ */ (0,
|
|
27339
|
-
section === "mcp" || section === "about" || section === "agent" || !state.restartRequired ? null : /* @__PURE__ */ (0,
|
|
27340
|
-
/* @__PURE__ */ (0,
|
|
27341
|
-
/* @__PURE__ */ (0,
|
|
27342
|
-
client.restartHost === void 0 ? null : /* @__PURE__ */ (0,
|
|
27478
|
+
section === "mcp" || section === "about" ? null : state.saveError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-destructive", children: state.saveMessage !== void 0 && state.saveMessage.length > 0 ? state.saveMessage : label("save-failed") }) : null,
|
|
27479
|
+
section === "mcp" || section === "about" || section === "agent" || !state.restartRequired ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mt-3 space-y-2", children: [
|
|
27480
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
27481
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 text-sm text-primary", children: label("restart-required") }),
|
|
27482
|
+
client.restartHost === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground disabled:opacity-60", disabled: restarting, onClick: () => {
|
|
27343
27483
|
void rebootHost(client, setRestarting, label, dispatch, hostOrigin(String(state.saved?.hostPort ?? state.port)));
|
|
27344
27484
|
}, children: restarting ? label("restart-wait") : label("restart-host") })
|
|
27345
27485
|
] }),
|
|
27346
|
-
state.restartPort ? /* @__PURE__ */ (0,
|
|
27347
|
-
state.restartRuntime ? /* @__PURE__ */ (0,
|
|
27486
|
+
state.restartPort ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 text-sm text-muted-foreground", children: label("restart-mcp-hint") }) : null,
|
|
27487
|
+
state.restartRuntime ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 text-sm text-muted-foreground", children: label("restart-runtime-hint") }) : null
|
|
27348
27488
|
] }),
|
|
27349
|
-
state.pending === void 0 ? null : /* @__PURE__ */ (0,
|
|
27350
|
-
/* @__PURE__ */ (0,
|
|
27351
|
-
/* @__PURE__ */ (0,
|
|
27352
|
-
/* @__PURE__ */ (0,
|
|
27353
|
-
/* @__PURE__ */ (0,
|
|
27489
|
+
state.pending === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Dialog, { width: "sm", onClose: () => dispatch({ type: "escape" }), children: [
|
|
27490
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: label("unsaved-confirm") }),
|
|
27491
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
27492
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => dispatch({ type: "escape" }), children: label("cancel") }),
|
|
27493
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "go", onClick: () => dispatch({ type: "confirm" }), children: label("confirm") })
|
|
27354
27494
|
] })
|
|
27355
27495
|
] })
|
|
27356
27496
|
] })
|
|
27357
27497
|
] }),
|
|
27358
|
-
section === "mcp" || section === "about" ? null : /* @__PURE__ */ (0,
|
|
27359
|
-
/* @__PURE__ */ (0,
|
|
27360
|
-
/* @__PURE__ */ (0,
|
|
27361
|
-
/* @__PURE__ */ (0,
|
|
27498
|
+
section === "mcp" || section === "about" ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { className: "flex items-center justify-between border-t bg-card px-4 py-3", children: [
|
|
27499
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm hover:bg-muted", onClick: () => dispatch({ type: "restore" }), children: label("restore") }) }),
|
|
27500
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
27501
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
27362
27502
|
"span",
|
|
27363
27503
|
{
|
|
27364
27504
|
className: [
|
|
@@ -27369,14 +27509,14 @@ function PanelSettings(props) {
|
|
|
27369
27509
|
].filter(Boolean).join(" "),
|
|
27370
27510
|
"aria-live": "polite",
|
|
27371
27511
|
children: [
|
|
27372
|
-
saveFeedback === "saving" ? /* @__PURE__ */ (0,
|
|
27373
|
-
saveFeedback === "saved" ? /* @__PURE__ */ (0,
|
|
27512
|
+
saveFeedback === "saving" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoaderCircle, { size: 14, className: "shrink-0 animate-spin", "aria-hidden": true }) : null,
|
|
27513
|
+
saveFeedback === "saved" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Check, { size: 14, className: "shrink-0 animate-in zoom-in-95 fade-in-0 duration-300", "aria-hidden": true }) : null,
|
|
27374
27514
|
saveFeedback === "saving" ? label("saving") : null,
|
|
27375
27515
|
saveFeedback === "saved" ? label("saved") : null
|
|
27376
27516
|
]
|
|
27377
27517
|
}
|
|
27378
27518
|
),
|
|
27379
|
-
/* @__PURE__ */ (0,
|
|
27519
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
27380
27520
|
"button",
|
|
27381
27521
|
{
|
|
27382
27522
|
type: "button",
|
|
@@ -27386,7 +27526,7 @@ function PanelSettings(props) {
|
|
|
27386
27526
|
void onSave();
|
|
27387
27527
|
},
|
|
27388
27528
|
children: [
|
|
27389
|
-
saveFeedback === "saving" ? /* @__PURE__ */ (0,
|
|
27529
|
+
saveFeedback === "saving" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": true }) : null,
|
|
27390
27530
|
saveFeedback === "saving" ? label("saving") : label("save")
|
|
27391
27531
|
]
|
|
27392
27532
|
}
|
|
@@ -27410,41 +27550,41 @@ function AgentSection(props) {
|
|
|
27410
27550
|
if (vendorId === props.state.modelProvider && modelId === props.state.model) return;
|
|
27411
27551
|
props.onModel(vendorId, modelId);
|
|
27412
27552
|
}, [vendorId, modelId, props.state.modelProvider, props.state.model, props.onModel]);
|
|
27413
|
-
return /* @__PURE__ */ (0,
|
|
27414
|
-
/* @__PURE__ */ (0,
|
|
27415
|
-
/* @__PURE__ */ (0,
|
|
27416
|
-
/* @__PURE__ */ (0,
|
|
27417
|
-
runtimes.length === 0 ? /* @__PURE__ */ (0,
|
|
27418
|
-
/* @__PURE__ */ (0,
|
|
27419
|
-
/* @__PURE__ */ (0,
|
|
27420
|
-
/* @__PURE__ */ (0,
|
|
27421
|
-
/* @__PURE__ */ (0,
|
|
27422
|
-
/* @__PURE__ */ (0,
|
|
27553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
27554
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
|
|
27555
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { className: "m-0", children: props.label("section-model") }),
|
|
27556
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-1 mb-4 text-sm text-muted-foreground", children: props.label("agent-apps-help") }),
|
|
27557
|
+
runtimes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-muted-foreground", children: props.label("runtime-missing") }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
27558
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-4 flex items-center gap-3", children: [
|
|
27559
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex w-full max-w-md shrink-0 items-center gap-2", children: [
|
|
27560
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { className: "h-9 min-w-0 flex-1 rounded-lg border bg-card px-3 text-sm outline-none", value: props.state.providerId, onChange: (event) => props.onRuntime(event.target.value), children: runtimes.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: item.id, children: item.label ?? item.id }, item.id)) }),
|
|
27561
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "inline-flex size-9 items-center justify-center rounded-lg border hover:bg-muted", "aria-label": props.label("refresh"), onClick: props.onRefresh, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RefreshCw, { size: 14, className: props.busy ? "animate-spin" : "" }) }),
|
|
27562
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-9 shrink-0 rounded-lg border px-3 text-sm hover:bg-muted", onClick: props.onProbe, children: props.label("probe") })
|
|
27423
27563
|
] }),
|
|
27424
|
-
props.state.probe === void 0 ? null : /* @__PURE__ */ (0,
|
|
27564
|
+
props.state.probe === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "min-w-0 text-sm leading-5 text-muted-foreground", children: probeText(props.state.probe, props.label) })
|
|
27425
27565
|
] }),
|
|
27426
27566
|
runtimeRestartNote(props)
|
|
27427
27567
|
] }),
|
|
27428
|
-
vendors.length === 0 ? /* @__PURE__ */ (0,
|
|
27429
|
-
/* @__PURE__ */ (0,
|
|
27430
|
-
/* @__PURE__ */ (0,
|
|
27431
|
-
/* @__PURE__ */ (0,
|
|
27568
|
+
vendors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-muted-foreground", children: props.label("model-empty") }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "grid max-w-md gap-3 min-[720px]:grid-cols-2", children: [
|
|
27569
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-2", children: [
|
|
27570
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: props.label("provider") }),
|
|
27571
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { className: "h-9 rounded-lg border bg-card px-3 text-sm outline-none", value: vendorId, onChange: (event) => {
|
|
27432
27572
|
const provider = event.target.value;
|
|
27433
27573
|
const next = vendors.find((item) => item.provider === provider)?.models ?? [];
|
|
27434
27574
|
props.onModel(provider, next.includes(props.state.model) ? props.state.model : next[0] ?? "");
|
|
27435
|
-
}, children: vendors.map((item) => /* @__PURE__ */ (0,
|
|
27575
|
+
}, children: vendors.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: item.provider, children: item.provider }, item.provider)) })
|
|
27436
27576
|
] }),
|
|
27437
|
-
/* @__PURE__ */ (0,
|
|
27438
|
-
/* @__PURE__ */ (0,
|
|
27439
|
-
/* @__PURE__ */ (0,
|
|
27577
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-2", children: [
|
|
27578
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm text-muted-foreground", children: props.label("model") }),
|
|
27579
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { className: "h-9 rounded-lg border bg-card px-3 text-sm outline-none", value: modelId, onChange: (event) => props.onModel(vendorId, event.target.value), children: models.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: name, children: name }, name)) })
|
|
27440
27580
|
] })
|
|
27441
27581
|
] })
|
|
27442
27582
|
] }),
|
|
27443
|
-
/* @__PURE__ */ (0,
|
|
27444
|
-
/* @__PURE__ */ (0,
|
|
27445
|
-
/* @__PURE__ */ (0,
|
|
27446
|
-
/* @__PURE__ */ (0,
|
|
27447
|
-
/* @__PURE__ */ (0,
|
|
27583
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
|
|
27584
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { className: "m-0", children: props.label("agent-others") }),
|
|
27585
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-1 mb-4 text-sm text-muted-foreground", children: props.label("agent-others-help") }),
|
|
27586
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
27587
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27448
27588
|
AuthorMcpInstall,
|
|
27449
27589
|
{
|
|
27450
27590
|
label: props.label,
|
|
@@ -27454,7 +27594,7 @@ function AgentSection(props) {
|
|
|
27454
27594
|
...props.revealAuthorMcp === void 0 ? {} : { revealAuthorMcp: props.revealAuthorMcp }
|
|
27455
27595
|
}
|
|
27456
27596
|
),
|
|
27457
|
-
/* @__PURE__ */ (0,
|
|
27597
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27458
27598
|
SkillInstall,
|
|
27459
27599
|
{
|
|
27460
27600
|
label: props.label,
|
|
@@ -27469,13 +27609,14 @@ function AgentSection(props) {
|
|
|
27469
27609
|
}
|
|
27470
27610
|
function AboutSection(props) {
|
|
27471
27611
|
const lines = (props.versions ?? "").split("\n").filter((line) => line.length > 0);
|
|
27472
|
-
return /* @__PURE__ */ (0,
|
|
27473
|
-
/* @__PURE__ */ (0,
|
|
27474
|
-
/* @__PURE__ */ (0,
|
|
27475
|
-
/* @__PURE__ */ (0,
|
|
27476
|
-
lines.length === 0 ? null : /* @__PURE__ */ (0,
|
|
27477
|
-
props.
|
|
27478
|
-
props.
|
|
27612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "mb-6", children: [
|
|
27613
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { children: props.label("section-about") }),
|
|
27614
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "mt-2 text-base font-semibold", children: props.label("product-name") }),
|
|
27615
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-2 mb-4 max-w-2xl space-y-2 text-sm leading-6 text-muted-foreground", children: props.label("product-meaning").split("\n").filter((line) => line.length > 0).map((line) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0", children: line }, line.slice(0, 24))) }),
|
|
27616
|
+
lines.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "mb-4 font-mono text-sm text-muted-foreground", children: lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: line }, line)) }),
|
|
27617
|
+
props.source === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(UpdateSourceChip, { source: props.source, label: props.label }) }),
|
|
27618
|
+
props.onCheck === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm hover:bg-muted", onClick: props.onCheck, children: props.label("update") }),
|
|
27619
|
+
props.update === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-3 text-sm", children: updateText(props.update, props.label) })
|
|
27479
27620
|
] });
|
|
27480
27621
|
}
|
|
27481
27622
|
function themeLabel(theme) {
|
|
@@ -27485,35 +27626,35 @@ function themeLabel(theme) {
|
|
|
27485
27626
|
}
|
|
27486
27627
|
function CardStylePreview(props) {
|
|
27487
27628
|
if (props.style === "stamp") {
|
|
27488
|
-
return /* @__PURE__ */ (0,
|
|
27489
|
-
/* @__PURE__ */ (0,
|
|
27490
|
-
/* @__PURE__ */ (0,
|
|
27629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "relative block h-10 overflow-hidden rounded-lg border bg-card", children: [
|
|
27630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute top-1.5 right-1.5 flex size-5 items-center justify-center rounded border text-[8px] font-extrabold", children: "Ab" }),
|
|
27631
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute bottom-2 left-2 h-1 w-8 rounded-full bg-foreground/70" })
|
|
27491
27632
|
] });
|
|
27492
27633
|
}
|
|
27493
27634
|
if (props.style === "etch") {
|
|
27494
|
-
return /* @__PURE__ */ (0,
|
|
27635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex h-10 items-end rounded-lg border bg-card px-2 pb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { viewBox: "0 0 52 28", className: "h-7 w-12", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("text", { x: "1", y: "22", fill: "var(--card)", stroke: "currentColor", strokeWidth: "3.2", paintOrder: "stroke fill", fontSize: "20", fontWeight: "800", fontFamily: "ui-sans-serif, system-ui, sans-serif", children: "Ab" }) }) });
|
|
27495
27636
|
}
|
|
27496
27637
|
if (props.style === "pulse") {
|
|
27497
|
-
return /* @__PURE__ */ (0,
|
|
27498
|
-
/* @__PURE__ */ (0,
|
|
27499
|
-
/* @__PURE__ */ (0,
|
|
27638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "relative flex h-10 items-center rounded-[14px] border bg-card px-2 shadow-[inset_1px_1px_2px_#fff,0_6px_8px_#00000014]", children: [
|
|
27639
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm font-extrabold text-primary", children: "Ab" }),
|
|
27640
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute top-2 right-2 size-2 rounded-full bg-primary shadow-[0_0_8px_var(--primary)]" })
|
|
27500
27641
|
] });
|
|
27501
27642
|
}
|
|
27502
27643
|
if (props.style === "list") {
|
|
27503
|
-
return /* @__PURE__ */ (0,
|
|
27504
|
-
/* @__PURE__ */ (0,
|
|
27505
|
-
/* @__PURE__ */ (0,
|
|
27644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "relative block h-10 overflow-hidden rounded-lg border bg-card", children: [
|
|
27645
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute inset-1 rounded-md rounded-tr-[18px] bg-foreground/10" }),
|
|
27646
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute inset-y-1.5 left-1.5 w-7 rounded-md bg-card/70" })
|
|
27506
27647
|
] });
|
|
27507
27648
|
}
|
|
27508
27649
|
if (props.style === "glass") {
|
|
27509
|
-
return /* @__PURE__ */ (0,
|
|
27510
|
-
/* @__PURE__ */ (0,
|
|
27511
|
-
/* @__PURE__ */ (0,
|
|
27650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "relative block h-10 overflow-hidden rounded-lg border bg-card/60", children: [
|
|
27651
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute top-1.5 left-2 text-sm font-extrabold tracking-tight text-foreground/80", children: "Ab" }),
|
|
27652
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute right-2 bottom-1.5 h-1 w-8 rounded-full bg-foreground/15" })
|
|
27512
27653
|
] });
|
|
27513
27654
|
}
|
|
27514
|
-
return /* @__PURE__ */ (0,
|
|
27515
|
-
/* @__PURE__ */ (0,
|
|
27516
|
-
/* @__PURE__ */ (0,
|
|
27655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "relative block h-10 overflow-hidden rounded-lg border bg-card", children: [
|
|
27656
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute -top-3 -right-2 size-10 rounded-full bg-primary/25" }),
|
|
27657
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute bottom-1.5 left-2 text-sm leading-none font-extrabold text-primary", children: "Ab" })
|
|
27517
27658
|
] });
|
|
27518
27659
|
}
|
|
27519
27660
|
function cardKey(style) {
|
|
@@ -27524,10 +27665,59 @@ function cardKey(style) {
|
|
|
27524
27665
|
if (style === "glass") return "card-glass";
|
|
27525
27666
|
return "card-hero";
|
|
27526
27667
|
}
|
|
27668
|
+
function RegistryField(props) {
|
|
27669
|
+
const choice = registryChoice(props.state.registry);
|
|
27670
|
+
const [custom, setCustom] = (0, import_react10.useState)(choice === "custom");
|
|
27671
|
+
const seen = (0, import_react10.useRef)(props.state.registry);
|
|
27672
|
+
(0, import_react10.useEffect)(() => {
|
|
27673
|
+
if (seen.current === props.state.registry) return;
|
|
27674
|
+
seen.current = props.state.registry;
|
|
27675
|
+
if (choice !== "custom") setCustom(false);
|
|
27676
|
+
}, [choice, props.state.registry]);
|
|
27677
|
+
const shown = custom ? "custom" : choice;
|
|
27678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
27679
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "text-sm text-muted-foreground", htmlFor: "settings-update-registry", children: props.label("update-registry") }),
|
|
27680
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 max-w-xl text-xs leading-5 text-muted-foreground", children: props.label("update-registry-hint") }),
|
|
27681
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
27682
|
+
"select",
|
|
27683
|
+
{
|
|
27684
|
+
id: "settings-update-registry",
|
|
27685
|
+
"data-field": "update-registry",
|
|
27686
|
+
className: "h-9 max-w-md rounded-lg border bg-card px-3 text-sm outline-none",
|
|
27687
|
+
value: shown,
|
|
27688
|
+
onChange: (event) => {
|
|
27689
|
+
const picked = event.target.value;
|
|
27690
|
+
setCustom(picked === "custom");
|
|
27691
|
+
props.dispatch({
|
|
27692
|
+
type: "edit-registry",
|
|
27693
|
+
registry: picked === "default" ? "" : picked === "custom" ? props.state.registry : updateRegistryPresets[picked]
|
|
27694
|
+
});
|
|
27695
|
+
},
|
|
27696
|
+
children: [
|
|
27697
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "default", children: props.label("update-registry-default") }),
|
|
27698
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "npmmirror", children: `${props.label("update-registry-npmmirror")} \xB7 ${updateRegistryPresets.npmmirror}` }),
|
|
27699
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "tencent", children: `${props.label("update-registry-tencent")} \xB7 ${updateRegistryPresets.tencent}` }),
|
|
27700
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "custom", children: props.label("update-registry-custom") })
|
|
27701
|
+
]
|
|
27702
|
+
}
|
|
27703
|
+
),
|
|
27704
|
+
shown !== "custom" ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27705
|
+
"input",
|
|
27706
|
+
{
|
|
27707
|
+
"data-field": "update-registry-custom",
|
|
27708
|
+
className: "h-9 max-w-md rounded-lg border bg-card px-3 font-mono text-sm outline-none",
|
|
27709
|
+
placeholder: "https://registry.example.com/",
|
|
27710
|
+
value: props.state.registry,
|
|
27711
|
+
onChange: (event) => props.dispatch({ type: "edit-registry", registry: event.target.value })
|
|
27712
|
+
}
|
|
27713
|
+
),
|
|
27714
|
+
props.state.registryError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 text-xs text-destructive", children: props.label("update-registry-invalid") }) : null
|
|
27715
|
+
] });
|
|
27716
|
+
}
|
|
27527
27717
|
async function saveSettings(client, state, dispatch) {
|
|
27528
27718
|
const draft = settingsDraft(state);
|
|
27529
27719
|
if (!draft.ok) {
|
|
27530
|
-
dispatch({ type:
|
|
27720
|
+
dispatch({ type: draft.key });
|
|
27531
27721
|
return void 0;
|
|
27532
27722
|
}
|
|
27533
27723
|
try {
|
|
@@ -27544,9 +27734,9 @@ function runtimeRestartNote(props) {
|
|
|
27544
27734
|
const savedId = props.state.saved?.runtimeProvider.id;
|
|
27545
27735
|
const dirtyRuntime = props.state.dirty && savedId !== void 0 && savedId !== props.state.providerId;
|
|
27546
27736
|
if (props.state.restartRequired && props.state.restartRuntime) {
|
|
27547
|
-
return /* @__PURE__ */ (0,
|
|
27548
|
-
/* @__PURE__ */ (0,
|
|
27549
|
-
props.onRestart === void 0 ? null : /* @__PURE__ */ (0,
|
|
27737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-3 py-2", children: [
|
|
27738
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 min-w-0 flex-1 text-sm text-primary", children: props.label("restart-runtime-hint") }),
|
|
27739
|
+
props.onRestart === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
27550
27740
|
"button",
|
|
27551
27741
|
{
|
|
27552
27742
|
type: "button",
|
|
@@ -27559,7 +27749,7 @@ function runtimeRestartNote(props) {
|
|
|
27559
27749
|
] });
|
|
27560
27750
|
}
|
|
27561
27751
|
if (dirtyRuntime) {
|
|
27562
|
-
return /* @__PURE__ */ (0,
|
|
27752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "m-0 text-sm text-muted-foreground", children: props.label("restart-runtime-pending") });
|
|
27563
27753
|
}
|
|
27564
27754
|
return null;
|
|
27565
27755
|
}
|
|
@@ -27714,7 +27904,7 @@ function omitDetailError(state) {
|
|
|
27714
27904
|
|
|
27715
27905
|
// ../../panel/src/history/view.tsx
|
|
27716
27906
|
var import_react11 = __toESM(require_react(), 1);
|
|
27717
|
-
var
|
|
27907
|
+
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
27718
27908
|
function PanelHistory(props) {
|
|
27719
27909
|
const [state, dispatch] = (0, import_react11.useReducer)(reduceHistory, void 0, historyState);
|
|
27720
27910
|
(0, import_react11.useEffect)(() => {
|
|
@@ -27724,16 +27914,16 @@ function PanelHistory(props) {
|
|
|
27724
27914
|
if (props.client === void 0) return null;
|
|
27725
27915
|
const label = (key) => panelText(props.locale, key, props.mode);
|
|
27726
27916
|
const client = props.client;
|
|
27727
|
-
return /* @__PURE__ */ (0,
|
|
27728
|
-
/* @__PURE__ */ (0,
|
|
27729
|
-
/* @__PURE__ */ (0,
|
|
27730
|
-
/* @__PURE__ */ (0,
|
|
27917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "flex min-h-0 flex-1 flex-col bg-background text-foreground", children: [
|
|
27918
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "flex items-center justify-between gap-3 border-b bg-card px-4 py-3", children: [
|
|
27919
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: "text-[15px] font-semibold", children: label("history") }),
|
|
27920
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PaneClose, { label: label("pane-close"), onClose: props.onClose })
|
|
27731
27921
|
] }),
|
|
27732
|
-
/* @__PURE__ */ (0,
|
|
27733
|
-
/* @__PURE__ */ (0,
|
|
27734
|
-
state.failed ? /* @__PURE__ */ (0,
|
|
27735
|
-
!state.failed && state.commits.length === 0 ? /* @__PURE__ */ (0,
|
|
27736
|
-
/* @__PURE__ */ (0,
|
|
27922
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid min-h-0 flex-1 grid-cols-1 min-[720px]:grid-cols-[17rem_minmax(0,1fr)]", children: [
|
|
27923
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "min-h-0 overflow-auto border-b p-3 min-[720px]:border-r min-[720px]:border-b-0", children: [
|
|
27924
|
+
state.failed ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-destructive", children: state.error !== void 0 && state.error.length > 0 ? state.error : label("history-failed") }) : null,
|
|
27925
|
+
!state.failed && state.commits.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-muted-foreground", children: label("history-empty") }) : null,
|
|
27926
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "flex flex-col gap-2", children: state.commits.map((commit2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
27737
27927
|
CommitRow,
|
|
27738
27928
|
{
|
|
27739
27929
|
commit: commit2,
|
|
@@ -27744,22 +27934,22 @@ function PanelHistory(props) {
|
|
|
27744
27934
|
}
|
|
27745
27935
|
) }, commit2.id)) })
|
|
27746
27936
|
] }),
|
|
27747
|
-
/* @__PURE__ */ (0,
|
|
27748
|
-
state.detailFailed ? /* @__PURE__ */ (0,
|
|
27749
|
-
state.detail === void 0 ? /* @__PURE__ */ (0,
|
|
27750
|
-
/* @__PURE__ */ (0,
|
|
27751
|
-
/* @__PURE__ */ (0,
|
|
27752
|
-
/* @__PURE__ */ (0,
|
|
27753
|
-
/* @__PURE__ */ (0,
|
|
27937
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "min-h-0 overflow-auto p-4", children: [
|
|
27938
|
+
state.detailFailed ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-destructive", children: state.detailError !== void 0 && state.detailError.length > 0 ? state.detailError : label("history-failed") }) : null,
|
|
27939
|
+
state.detail === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-muted-foreground", children: label("history-pick") }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
27940
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
|
|
27941
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { className: "text-sm font-semibold", children: state.detail.message }),
|
|
27942
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mt-1 font-mono text-[11px] text-muted-foreground", children: state.selected }),
|
|
27943
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { className: "mt-1 block text-[11px] text-muted-foreground", children: clock(state.detail.time) })
|
|
27754
27944
|
] }),
|
|
27755
|
-
state.detail.files.map((file) => /* @__PURE__ */ (0,
|
|
27945
|
+
state.detail.files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilePreview, { file }, file.path))
|
|
27756
27946
|
] })
|
|
27757
27947
|
] })
|
|
27758
27948
|
] })
|
|
27759
27949
|
] });
|
|
27760
27950
|
}
|
|
27761
27951
|
function CommitRow(props) {
|
|
27762
|
-
return /* @__PURE__ */ (0,
|
|
27952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip, { text: props.commit.id, className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
27763
27953
|
"button",
|
|
27764
27954
|
{
|
|
27765
27955
|
type: "button",
|
|
@@ -27769,28 +27959,28 @@ function CommitRow(props) {
|
|
|
27769
27959
|
"data-commit": props.commit.id,
|
|
27770
27960
|
onClick: props.onSelect,
|
|
27771
27961
|
children: [
|
|
27772
|
-
/* @__PURE__ */ (0,
|
|
27773
|
-
/* @__PURE__ */ (0,
|
|
27774
|
-
/* @__PURE__ */ (0,
|
|
27962
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "flex items-baseline justify-between gap-2", children: [
|
|
27963
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "min-w-0 truncate text-sm font-semibold", children: props.commit.message.length > 0 ? props.commit.message : props.commit.id.slice(0, 7) }),
|
|
27964
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { className: "shrink-0 text-[11px] text-muted-foreground", children: clock(props.commit.time) })
|
|
27775
27965
|
] }),
|
|
27776
|
-
/* @__PURE__ */ (0,
|
|
27966
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "mt-1 block font-mono text-[11px] text-muted-foreground", children: props.commit.id.slice(0, 7) })
|
|
27777
27967
|
]
|
|
27778
27968
|
}
|
|
27779
27969
|
) });
|
|
27780
27970
|
}
|
|
27781
27971
|
function FilePreview(props) {
|
|
27782
27972
|
const lines = props.file.preview.length === 0 ? [] : props.file.preview.split("\n");
|
|
27783
|
-
return /* @__PURE__ */ (0,
|
|
27784
|
-
/* @__PURE__ */ (0,
|
|
27785
|
-
/* @__PURE__ */ (0,
|
|
27786
|
-
/* @__PURE__ */ (0,
|
|
27973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { className: "overflow-hidden rounded-xl border bg-card", children: [
|
|
27974
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "flex items-center justify-between gap-3 border-b px-3 py-2", children: [
|
|
27975
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "min-w-0 truncate font-mono text-xs", children: props.file.path }),
|
|
27976
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shrink-0 font-mono text-[11px] text-muted-foreground", children: `+${props.file.add} \u2212${props.file.del}` })
|
|
27787
27977
|
] }),
|
|
27788
|
-
lines.length === 0 ? null : /* @__PURE__ */ (0,
|
|
27978
|
+
lines.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "max-h-80 overflow-auto p-3 font-mono text-[12px] leading-5", children: lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: lineClass(line), children: line.length === 0 ? " " : line }, `${props.file.path}:${index}`)) })
|
|
27789
27979
|
] });
|
|
27790
27980
|
}
|
|
27791
27981
|
function PaneClose(props) {
|
|
27792
27982
|
if (props.onClose === void 0) return null;
|
|
27793
|
-
return /* @__PURE__ */ (0,
|
|
27983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "h-8 rounded-lg border bg-background px-3 text-sm hover:bg-muted", onClick: props.onClose, children: props.label });
|
|
27794
27984
|
}
|
|
27795
27985
|
function lineClass(line) {
|
|
27796
27986
|
if (line.startsWith("+")) return "block text-primary";
|
|
@@ -27858,7 +28048,7 @@ function omitTableError(state) {
|
|
|
27858
28048
|
|
|
27859
28049
|
// ../../panel/src/storage/view.tsx
|
|
27860
28050
|
var import_react12 = __toESM(require_react(), 1);
|
|
27861
|
-
var
|
|
28051
|
+
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
27862
28052
|
function PanelStorage(props) {
|
|
27863
28053
|
const [state, dispatch] = (0, import_react12.useReducer)(reduceStorage, void 0, storageState);
|
|
27864
28054
|
(0, import_react12.useEffect)(() => {
|
|
@@ -27871,25 +28061,25 @@ function PanelStorage(props) {
|
|
|
27871
28061
|
const rows = state.rows?.rows;
|
|
27872
28062
|
const [raw, setRaw] = (0, import_react12.useState)(false);
|
|
27873
28063
|
const [askRestore, setAskRestore] = (0, import_react12.useState)(false);
|
|
27874
|
-
return /* @__PURE__ */ (0,
|
|
27875
|
-
/* @__PURE__ */ (0,
|
|
27876
|
-
/* @__PURE__ */ (0,
|
|
27877
|
-
/* @__PURE__ */ (0,
|
|
27878
|
-
state.summary === void 0 ? null : /* @__PURE__ */ (0,
|
|
28064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { className: "flex min-h-0 flex-1 flex-col bg-background text-foreground", children: [
|
|
28065
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { className: "flex items-center justify-between gap-3 border-b bg-card px-4 py-3", children: [
|
|
28066
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0", children: [
|
|
28067
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { className: "text-[15px] font-semibold", children: label("storage") }),
|
|
28068
|
+
state.summary === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground", children: `${formatBytes(state.summary.bytes)} \xB7 ${state.summary.tables.length}` })
|
|
27879
28069
|
] }),
|
|
27880
|
-
/* @__PURE__ */ (0,
|
|
27881
|
-
state.summary === void 0 || client.restoreStorage === void 0 ? null : /* @__PURE__ */ (0,
|
|
27882
|
-
/* @__PURE__ */ (0,
|
|
28070
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
28071
|
+
state.summary === void 0 || client.restoreStorage === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm hover:bg-muted", onClick: () => setAskRestore(true), children: label("restore-storage") }),
|
|
28072
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PaneClose2, { label: label("pane-close"), onClose: props.onClose })
|
|
27883
28073
|
] })
|
|
27884
28074
|
] }),
|
|
27885
|
-
/* @__PURE__ */ (0,
|
|
27886
|
-
props.notice !== void 0 && !state.noticeDismissed ? /* @__PURE__ */ (0,
|
|
27887
|
-
/* @__PURE__ */ (0,
|
|
27888
|
-
/* @__PURE__ */ (0,
|
|
28075
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-h-0 flex-1 overflow-auto", children: [
|
|
28076
|
+
props.notice !== void 0 && !state.noticeDismissed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mx-4 mt-4 flex items-start justify-between gap-3 rounded-xl border border-amber-500/40 bg-amber-500/10 px-3 py-2", children: [
|
|
28077
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "min-w-0 flex-1 text-sm", children: props.notice }),
|
|
28078
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-8 shrink-0 rounded-lg px-2 text-sm hover:bg-muted", onClick: () => dispatch({ type: "dismiss-notice" }), children: label("dismiss") })
|
|
27889
28079
|
] }) : null,
|
|
27890
|
-
state.failed ? /* @__PURE__ */ (0,
|
|
27891
|
-
/* @__PURE__ */ (0,
|
|
27892
|
-
/* @__PURE__ */ (0,
|
|
28080
|
+
state.failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "px-4 py-3 text-sm text-destructive", children: state.error !== void 0 && state.error.length > 0 ? state.error : label("storage-failed") }) : null,
|
|
28081
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid min-h-0 grid-cols-1 min-[720px]:grid-cols-[14rem_minmax(0,1fr)]", children: [
|
|
28082
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "flex flex-col gap-2 p-3", children: (state.summary?.tables ?? []).map((table) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
27893
28083
|
"button",
|
|
27894
28084
|
{
|
|
27895
28085
|
type: "button",
|
|
@@ -27902,23 +28092,23 @@ function PanelStorage(props) {
|
|
|
27902
28092
|
children: table
|
|
27903
28093
|
}
|
|
27904
28094
|
) }, table)) }),
|
|
27905
|
-
/* @__PURE__ */ (0,
|
|
27906
|
-
state.tableFailed ? /* @__PURE__ */ (0,
|
|
27907
|
-
state.table === void 0 ? null : /* @__PURE__ */ (0,
|
|
27908
|
-
/* @__PURE__ */ (0,
|
|
27909
|
-
/* @__PURE__ */ (0,
|
|
27910
|
-
rows === void 0 || rows.length === 0 ? null : /* @__PURE__ */ (0,
|
|
28095
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 p-4", children: [
|
|
28096
|
+
state.tableFailed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-destructive", children: state.tableError !== void 0 && state.tableError.length > 0 ? state.tableError : label("storage-failed") }) : null,
|
|
28097
|
+
state.table === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
28098
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mb-3 flex items-center justify-between gap-3", children: [
|
|
28099
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h4", { className: "font-mono text-sm", children: state.table }),
|
|
28100
|
+
rows === void 0 || rows.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ShapeSwitch, { raw, label, onRaw: setRaw })
|
|
27911
28101
|
] }),
|
|
27912
|
-
rows === void 0 ? null : rows.length === 0 ? /* @__PURE__ */ (0,
|
|
28102
|
+
rows === void 0 ? null : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-muted-foreground", children: label("storage-empty-rows") }) : raw ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("pre", { className: "overflow-auto rounded-xl border bg-card p-3 font-mono text-[12px] leading-5 whitespace-pre-wrap", children: JSON.stringify(rows, null, 2) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col gap-3", children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RecordCard, { row }, recordKey(row, index))) })
|
|
27913
28103
|
] })
|
|
27914
28104
|
] })
|
|
27915
28105
|
] })
|
|
27916
28106
|
] }),
|
|
27917
|
-
askRestore ? /* @__PURE__ */ (0,
|
|
27918
|
-
/* @__PURE__ */ (0,
|
|
27919
|
-
/* @__PURE__ */ (0,
|
|
27920
|
-
/* @__PURE__ */ (0,
|
|
27921
|
-
/* @__PURE__ */ (0,
|
|
28107
|
+
askRestore ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Dialog, { width: "sm", onClose: () => setAskRestore(false), children: [
|
|
28108
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "m-0 text-sm", children: label("restore-storage-confirm") }),
|
|
28109
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
28110
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: () => setAskRestore(false), children: label("cancel") }),
|
|
28111
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: () => {
|
|
27922
28112
|
setAskRestore(false);
|
|
27923
28113
|
void client.restoreStorage?.(props.appId);
|
|
27924
28114
|
}, children: label("restore") })
|
|
@@ -27928,35 +28118,35 @@ function PanelStorage(props) {
|
|
|
27928
28118
|
}
|
|
27929
28119
|
function RecordCard(props) {
|
|
27930
28120
|
if (isRecord(props.row) && typeof props.row.key === "string" && "value" in props.row) {
|
|
27931
|
-
return /* @__PURE__ */ (0,
|
|
27932
|
-
/* @__PURE__ */ (0,
|
|
27933
|
-
/* @__PURE__ */ (0,
|
|
28121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("article", { className: "overflow-hidden rounded-xl border bg-card", children: [
|
|
28122
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("header", { className: "border-b px-3 py-2 font-mono text-xs", children: props.row.key }),
|
|
28123
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ValueView, { value: props.row.value }) })
|
|
27934
28124
|
] });
|
|
27935
28125
|
}
|
|
27936
|
-
return /* @__PURE__ */ (0,
|
|
28126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("pre", { className: "overflow-auto rounded-xl border bg-card p-3 font-mono text-[12px] leading-5 whitespace-pre-wrap", children: JSON.stringify(props.row, null, 2) });
|
|
27937
28127
|
}
|
|
27938
28128
|
function ValueView(props) {
|
|
27939
28129
|
const items = titledItems(props.value);
|
|
27940
28130
|
if (items !== void 0) {
|
|
27941
|
-
return /* @__PURE__ */ (0,
|
|
27942
|
-
/* @__PURE__ */ (0,
|
|
27943
|
-
item.extra.length === 0 ? null : /* @__PURE__ */ (0,
|
|
28131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "flex flex-col gap-1.5", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: "flex items-baseline justify-between gap-3 text-sm", children: [
|
|
28132
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: item.done ? "text-muted-foreground line-through" : "", children: item.title }),
|
|
28133
|
+
item.extra.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: item.extra })
|
|
27944
28134
|
] }, item.key)) });
|
|
27945
28135
|
}
|
|
27946
28136
|
if (props.value === null || typeof props.value === "string" || typeof props.value === "number" || typeof props.value === "boolean") {
|
|
27947
|
-
return /* @__PURE__ */ (0,
|
|
28137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm", children: props.value === null ? "\u2014" : String(props.value) });
|
|
27948
28138
|
}
|
|
27949
|
-
return /* @__PURE__ */ (0,
|
|
28139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("pre", { className: "overflow-auto font-mono text-[12px] leading-5 whitespace-pre-wrap", children: JSON.stringify(props.value, null, 2) });
|
|
27950
28140
|
}
|
|
27951
28141
|
function ShapeSwitch(props) {
|
|
27952
|
-
return /* @__PURE__ */ (0,
|
|
27953
|
-
/* @__PURE__ */ (0,
|
|
27954
|
-
/* @__PURE__ */ (0,
|
|
28142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex gap-1 rounded-lg bg-muted p-1", children: [
|
|
28143
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-7 rounded-md px-2.5 text-xs data-[on=1]:bg-card data-[on=1]:font-semibold", "data-on": props.raw ? "0" : "1", "aria-pressed": !props.raw, onClick: () => props.onRaw(false), children: props.label("storage-preview") }),
|
|
28144
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-7 rounded-md px-2.5 text-xs data-[on=1]:bg-card data-[on=1]:font-semibold", "data-on": props.raw ? "1" : "0", "aria-pressed": props.raw, onClick: () => props.onRaw(true), children: props.label("storage-raw") })
|
|
27955
28145
|
] });
|
|
27956
28146
|
}
|
|
27957
28147
|
function PaneClose2(props) {
|
|
27958
28148
|
if (props.onClose === void 0) return null;
|
|
27959
|
-
return /* @__PURE__ */ (0,
|
|
28149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "h-8 rounded-lg border bg-background px-3 text-sm hover:bg-muted", onClick: props.onClose, children: props.label });
|
|
27960
28150
|
}
|
|
27961
28151
|
function titledItems(value) {
|
|
27962
28152
|
if (!Array.isArray(value) || value.length === 0 || !value.every(isRecord)) return void 0;
|
|
@@ -27987,7 +28177,7 @@ function trim(value) {
|
|
|
27987
28177
|
|
|
27988
28178
|
// ../../panel/src/theme/view.tsx
|
|
27989
28179
|
var import_react13 = __toESM(require_react(), 1);
|
|
27990
|
-
var
|
|
28180
|
+
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
27991
28181
|
|
|
27992
28182
|
// ../../panel/src/surface/state.ts
|
|
27993
28183
|
function surfaceState() {
|
|
@@ -28038,7 +28228,7 @@ var import_react15 = __toESM(require_react(), 1);
|
|
|
28038
28228
|
|
|
28039
28229
|
// ../../panel/src/settings/update-dialog.tsx
|
|
28040
28230
|
var import_react14 = __toESM(require_react(), 1);
|
|
28041
|
-
var
|
|
28231
|
+
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
28042
28232
|
var reasonKeys = {
|
|
28043
28233
|
timeout: "update-reason-timeout",
|
|
28044
28234
|
exit: "update-reason-exit",
|
|
@@ -28064,26 +28254,27 @@ function attemptCard(attempt, current) {
|
|
|
28064
28254
|
}
|
|
28065
28255
|
function UpdateDialog(props) {
|
|
28066
28256
|
const label = (key) => panelText(props.locale, key, props.mode);
|
|
28067
|
-
return /* @__PURE__ */ (0,
|
|
28068
|
-
props.card.kind === "offer" ? /* @__PURE__ */ (0,
|
|
28069
|
-
props.card.kind === "installing" ? /* @__PURE__ */ (0,
|
|
28070
|
-
props.card.kind === "failed" ? /* @__PURE__ */ (0,
|
|
28071
|
-
props.card.kind === "done" ? /* @__PURE__ */ (0,
|
|
28257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Dialog, { width: "md", onClose: props.card.kind === "installing" ? () => void 0 : props.onClose, children: [
|
|
28258
|
+
props.card.kind === "offer" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Offer, { card: props.card, label, onClose: props.onClose, onInstall: props.onInstall }) : null,
|
|
28259
|
+
props.card.kind === "installing" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Installing, { card: props.card, label }) : null,
|
|
28260
|
+
props.card.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Failed, { card: props.card, label, onClose: props.onClose, onInstall: props.onInstall }) : null,
|
|
28261
|
+
props.card.kind === "done" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Done, { card: props.card, label, onClose: props.onClose }) : null
|
|
28072
28262
|
] }) });
|
|
28073
28263
|
}
|
|
28074
28264
|
function Offer(props) {
|
|
28075
|
-
return /* @__PURE__ */ (0,
|
|
28076
|
-
/* @__PURE__ */ (0,
|
|
28077
|
-
/* @__PURE__ */ (0,
|
|
28078
|
-
/* @__PURE__ */ (0,
|
|
28079
|
-
/* @__PURE__ */ (0,
|
|
28080
|
-
/* @__PURE__ */ (0,
|
|
28081
|
-
props.card.channel === void 0 ? null : /* @__PURE__ */ (0,
|
|
28265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
28266
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "m-0 text-base font-semibold", children: props.label("update-card-title") }),
|
|
28267
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-4 flex items-end gap-4", children: [
|
|
28268
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Version, { caption: props.label("update-card-current"), version: props.card.current }),
|
|
28269
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "pb-1.5 text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
|
|
28270
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Version, { caption: props.label("update-card-latest"), version: props.card.latest, strong: true }),
|
|
28271
|
+
props.card.channel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "mb-0.5 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground", children: props.label(channelKeys[props.card.channel]) })
|
|
28082
28272
|
] }),
|
|
28083
|
-
/* @__PURE__ */ (0,
|
|
28084
|
-
/* @__PURE__ */ (0,
|
|
28085
|
-
|
|
28086
|
-
/* @__PURE__ */ (0,
|
|
28273
|
+
props.card.source === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(UpdateSourceChip, { source: props.card.source, label: props.label }) }),
|
|
28274
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-4 text-sm text-muted-foreground", children: props.label("update-card-note") }),
|
|
28275
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-5 flex justify-end gap-2", children: [
|
|
28276
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onClose, children: props.label("cancel") }),
|
|
28277
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
28087
28278
|
"button",
|
|
28088
28279
|
{
|
|
28089
28280
|
type: "button",
|
|
@@ -28104,25 +28295,25 @@ function Installing(props) {
|
|
|
28104
28295
|
clearInterval(tick);
|
|
28105
28296
|
};
|
|
28106
28297
|
}, [props.card.startedAt]);
|
|
28107
|
-
return /* @__PURE__ */ (0,
|
|
28108
|
-
/* @__PURE__ */ (0,
|
|
28109
|
-
/* @__PURE__ */ (0,
|
|
28298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
28299
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h3", { className: "m-0 flex items-center gap-2 text-base font-semibold", children: [
|
|
28300
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(LoaderCircle, { size: 16, className: "animate-spin", "aria-hidden": true }),
|
|
28110
28301
|
props.label("update-installing-title").replace("{n}", props.card.version)
|
|
28111
28302
|
] }),
|
|
28112
|
-
/* @__PURE__ */ (0,
|
|
28113
|
-
/* @__PURE__ */ (0,
|
|
28114
|
-
/* @__PURE__ */ (0,
|
|
28303
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-5 h-0.5 w-full overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block h-full w-1/3 animate-pulse rounded-full bg-foreground/40" }) }),
|
|
28304
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-4 font-mono text-sm text-muted-foreground", children: props.label("update-installing-elapsed").replace("{n}", clockText(elapsed)) }),
|
|
28305
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: props.label("update-installing-note") })
|
|
28115
28306
|
] });
|
|
28116
28307
|
}
|
|
28117
28308
|
function Failed(props) {
|
|
28118
|
-
return /* @__PURE__ */ (0,
|
|
28119
|
-
/* @__PURE__ */ (0,
|
|
28120
|
-
/* @__PURE__ */ (0,
|
|
28121
|
-
props.card.back === void 0 ? null : /* @__PURE__ */ (0,
|
|
28122
|
-
props.card.log === void 0 ? null : /* @__PURE__ */ (0,
|
|
28123
|
-
/* @__PURE__ */ (0,
|
|
28124
|
-
/* @__PURE__ */ (0,
|
|
28125
|
-
props.card.target === void 0 ? null : /* @__PURE__ */ (0,
|
|
28309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
28310
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "m-0 text-base font-semibold", children: props.label("update-failed-title") }),
|
|
28311
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-3 text-sm", children: reasonText(props.card.reason, props.label) }),
|
|
28312
|
+
props.card.back === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: props.label("update-failed-back").replace("{n}", props.card.back) }),
|
|
28313
|
+
props.card.log === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-3 break-all font-mono text-[11px] text-muted-foreground", children: props.label("update-log").replace("{n}", props.card.log) }),
|
|
28314
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-5 flex justify-end gap-2", children: [
|
|
28315
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "h-8 rounded-lg border px-3 text-sm", onClick: props.onClose, children: props.label("update-card-close") }),
|
|
28316
|
+
props.card.target === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
28126
28317
|
"button",
|
|
28127
28318
|
{
|
|
28128
28319
|
type: "button",
|
|
@@ -28138,16 +28329,16 @@ function Failed(props) {
|
|
|
28138
28329
|
] });
|
|
28139
28330
|
}
|
|
28140
28331
|
function Done(props) {
|
|
28141
|
-
return /* @__PURE__ */ (0,
|
|
28142
|
-
/* @__PURE__ */ (0,
|
|
28143
|
-
/* @__PURE__ */ (0,
|
|
28144
|
-
/* @__PURE__ */ (0,
|
|
28332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
28333
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "m-0 text-base font-semibold", children: props.label("update-card-done-title").replace("{n}", props.card.version) }),
|
|
28334
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-3 text-sm text-muted-foreground", children: props.label("update-card-done-note") }),
|
|
28335
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-5 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "h-8 rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground", onClick: props.onClose, children: props.label("update-card-ok") }) })
|
|
28145
28336
|
] });
|
|
28146
28337
|
}
|
|
28147
28338
|
function Version(props) {
|
|
28148
|
-
return /* @__PURE__ */ (0,
|
|
28149
|
-
/* @__PURE__ */ (0,
|
|
28150
|
-
/* @__PURE__ */ (0,
|
|
28339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
28340
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-[10px] tracking-wide text-muted-foreground uppercase", children: props.caption }),
|
|
28341
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: props.strong === true ? "font-mono text-lg font-semibold" : "font-mono text-lg", children: props.version })
|
|
28151
28342
|
] });
|
|
28152
28343
|
}
|
|
28153
28344
|
function reasonText(reason, label) {
|
|
@@ -28162,7 +28353,7 @@ function clockText(milliseconds) {
|
|
|
28162
28353
|
}
|
|
28163
28354
|
|
|
28164
28355
|
// ../../panel/src/surface/view.tsx
|
|
28165
|
-
var
|
|
28356
|
+
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
28166
28357
|
function PanelSurface(props) {
|
|
28167
28358
|
const [state, dispatch] = (0, import_react15.useReducer)(reduceSurface, void 0, surfaceState);
|
|
28168
28359
|
const [palettes, setPalettes] = (0, import_react15.useState)([]);
|
|
@@ -28209,11 +28400,11 @@ function PanelSurface(props) {
|
|
|
28209
28400
|
}, [chromeLocale, props.mode]);
|
|
28210
28401
|
const appId = state.focus?.appId ?? props.appId;
|
|
28211
28402
|
const toggle = (section) => dispatch({ type: "section", section: state.section === section ? "gallery" : section });
|
|
28212
|
-
const tool = (section, title, icon) => /* @__PURE__ */ (0,
|
|
28213
|
-
/* @__PURE__ */ (0,
|
|
28403
|
+
const tool = (section, title, icon) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Tooltip, { text: title, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "inline-flex size-8 items-center justify-center rounded-lg transition-colors duration-150 hover:bg-muted", "aria-label": title, onClick: () => toggle(section), children: [
|
|
28404
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: title }),
|
|
28214
28405
|
icon
|
|
28215
28406
|
] }) }, section);
|
|
28216
|
-
return /* @__PURE__ */ (0,
|
|
28407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28217
28408
|
PanelGallery,
|
|
28218
28409
|
{
|
|
28219
28410
|
client: props.client,
|
|
@@ -28229,7 +28420,7 @@ function PanelSurface(props) {
|
|
|
28229
28420
|
onToggleTheme: () => dispatch({ type: "toggle-theme" })
|
|
28230
28421
|
},
|
|
28231
28422
|
...props.settings === void 0 ? {} : { onToggleSettings: () => toggle("settings") },
|
|
28232
|
-
theme: (app) => /* @__PURE__ */ (0,
|
|
28423
|
+
theme: (app) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28233
28424
|
ThemeMenu,
|
|
28234
28425
|
{
|
|
28235
28426
|
locale: chromeLocale,
|
|
@@ -28241,13 +28432,13 @@ function PanelSurface(props) {
|
|
|
28241
28432
|
onHostPolicy: setHostPolicy
|
|
28242
28433
|
}
|
|
28243
28434
|
),
|
|
28244
|
-
tools: /* @__PURE__ */ (0,
|
|
28245
|
-
props.history !== void 0 && appId !== void 0 ? tool("history", label("history"), /* @__PURE__ */ (0,
|
|
28246
|
-
props.storage !== void 0 && appId !== void 0 ? tool("storage", label("storage"), /* @__PURE__ */ (0,
|
|
28435
|
+
tools: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
28436
|
+
props.history !== void 0 && appId !== void 0 ? tool("history", label("history"), /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Clock, { size: 16 })) : null,
|
|
28437
|
+
props.storage !== void 0 && appId !== void 0 ? tool("storage", label("storage"), /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Database, { size: 16 })) : null
|
|
28247
28438
|
] }),
|
|
28248
|
-
overlay: (chrome) => /* @__PURE__ */ (0,
|
|
28249
|
-
state.unavailable === void 0 ? null : /* @__PURE__ */ (0,
|
|
28250
|
-
props.settings === void 0 || state.section !== "settings" ? null : /* @__PURE__ */ (0,
|
|
28439
|
+
overlay: (chrome) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
28440
|
+
state.unavailable === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "px-6 py-2 text-sm text-destructive", children: label("host-unreachable") }),
|
|
28441
|
+
props.settings === void 0 || state.section !== "settings" ? null : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mma-pane absolute inset-0 z-30 flex flex-col bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28251
28442
|
PanelSettings,
|
|
28252
28443
|
{
|
|
28253
28444
|
locale: chromeLocale,
|
|
@@ -28271,7 +28462,7 @@ function PanelSurface(props) {
|
|
|
28271
28462
|
...props.versions === void 0 ? {} : { versions: props.versions }
|
|
28272
28463
|
}
|
|
28273
28464
|
) }),
|
|
28274
|
-
state.section === "history" && appId !== void 0 ? /* @__PURE__ */ (0,
|
|
28465
|
+
state.section === "history" && appId !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mma-pane absolute inset-0 z-20 flex min-h-0 flex-col bg-background", "data-open": "1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28275
28466
|
PanelHistory,
|
|
28276
28467
|
{
|
|
28277
28468
|
appId,
|
|
@@ -28282,7 +28473,7 @@ function PanelSurface(props) {
|
|
|
28282
28473
|
},
|
|
28283
28474
|
appId
|
|
28284
28475
|
) }) : null,
|
|
28285
|
-
state.section === "storage" && appId !== void 0 ? /* @__PURE__ */ (0,
|
|
28476
|
+
state.section === "storage" && appId !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mma-pane absolute inset-0 z-20 flex min-h-0 flex-col bg-background", "data-open": "1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28286
28477
|
PanelStorage,
|
|
28287
28478
|
{
|
|
28288
28479
|
appId,
|
|
@@ -28294,7 +28485,7 @@ function PanelSurface(props) {
|
|
|
28294
28485
|
},
|
|
28295
28486
|
appId
|
|
28296
28487
|
) }) : null,
|
|
28297
|
-
updateCard === void 0 ? null : /* @__PURE__ */ (0,
|
|
28488
|
+
updateCard === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
28298
28489
|
UpdateDialog,
|
|
28299
28490
|
{
|
|
28300
28491
|
locale: chromeLocale,
|
|
@@ -28346,11 +28537,13 @@ function receiveUpdate(check, settings) {
|
|
|
28346
28537
|
function offerCard(check) {
|
|
28347
28538
|
if (!check.updateAvailable || check.installable !== true || check.latest === null) return void 0;
|
|
28348
28539
|
if (sessionStorage.getItem(updateDismissedKey) === check.latest) return void 0;
|
|
28540
|
+
const source = checkSource(check);
|
|
28349
28541
|
return {
|
|
28350
28542
|
kind: "offer",
|
|
28351
28543
|
current: check.current,
|
|
28352
28544
|
latest: check.latest,
|
|
28353
|
-
...check.channel === void 0 ? {} : { channel: check.channel }
|
|
28545
|
+
...check.channel === void 0 ? {} : { channel: check.channel },
|
|
28546
|
+
...source === void 0 ? {} : { source }
|
|
28354
28547
|
};
|
|
28355
28548
|
}
|
|
28356
28549
|
|
|
@@ -28639,6 +28832,7 @@ function publicPolicy(value) {
|
|
|
28639
28832
|
const policy2 = record(value);
|
|
28640
28833
|
const llm = policy2.llm;
|
|
28641
28834
|
const desk = optionalText(policy2.defaultWorkbenchId);
|
|
28835
|
+
const updateRegistry = optionalText(policy2.updateRegistry);
|
|
28642
28836
|
return {
|
|
28643
28837
|
theme: policy2.theme === "dark" || policy2.theme === "system" ? policy2.theme : "light",
|
|
28644
28838
|
palette: typeof policy2.palette === "string" ? policy2.palette : "",
|
|
@@ -28647,7 +28841,8 @@ function publicPolicy(value) {
|
|
|
28647
28841
|
hostPort: typeof policy2.hostPort === "number" ? policy2.hostPort : 0,
|
|
28648
28842
|
llm: llmOf(llm),
|
|
28649
28843
|
runtimeProvider: { id: text(record(policy2.runtimeProvider).id) },
|
|
28650
|
-
...desk === void 0 ? {} : { defaultWorkbenchId: desk }
|
|
28844
|
+
...desk === void 0 ? {} : { defaultWorkbenchId: desk },
|
|
28845
|
+
...updateRegistry === void 0 ? {} : { updateRegistry }
|
|
28651
28846
|
};
|
|
28652
28847
|
}
|
|
28653
28848
|
async function readApps(origin, path) {
|
|
@@ -28799,10 +28994,12 @@ function stringMap(value, field) {
|
|
|
28799
28994
|
}
|
|
28800
28995
|
function panelAbout(value) {
|
|
28801
28996
|
const authoring = record(value.authoring);
|
|
28997
|
+
const source = updateSource(value.source);
|
|
28802
28998
|
return {
|
|
28803
28999
|
name: text(value.name),
|
|
28804
29000
|
current: text(value.current),
|
|
28805
29001
|
platform: text(value.platform),
|
|
29002
|
+
...source === void 0 ? {} : { source },
|
|
28806
29003
|
authoring: {
|
|
28807
29004
|
url: text(authoring.url),
|
|
28808
29005
|
token: text(authoring.token),
|
|
@@ -28892,6 +29089,8 @@ function authorMcpAgent(value) {
|
|
|
28892
29089
|
}
|
|
28893
29090
|
function updateCheck(value) {
|
|
28894
29091
|
const attempt = updateAttempt(value.lastAttempt);
|
|
29092
|
+
const registry = updateText2(value.registry);
|
|
29093
|
+
const tarballDir = updateText2(value.tarballDir);
|
|
28895
29094
|
return {
|
|
28896
29095
|
name: text(value.name),
|
|
28897
29096
|
current: text(value.current),
|
|
@@ -28899,6 +29098,8 @@ function updateCheck(value) {
|
|
|
28899
29098
|
updateAvailable: value.updateAvailable === true,
|
|
28900
29099
|
...value.channel === "registry" || value.channel === "tarball" ? { channel: value.channel } : {},
|
|
28901
29100
|
...value.installable === true ? { installable: true } : {},
|
|
29101
|
+
...registry === void 0 ? {} : { registry },
|
|
29102
|
+
...tarballDir === void 0 ? {} : { tarballDir },
|
|
28902
29103
|
...typeof value.error === "string" ? { error: value.error } : {},
|
|
28903
29104
|
...attempt === void 0 ? {} : { lastAttempt: attempt }
|
|
28904
29105
|
};
|
|
@@ -28931,12 +29132,27 @@ function updateAttempt(value) {
|
|
|
28931
29132
|
...typeof row.log === "string" && row.log.length > 0 ? { log: row.log } : {}
|
|
28932
29133
|
};
|
|
28933
29134
|
}
|
|
29135
|
+
function updateSource(value) {
|
|
29136
|
+
const row = record(value);
|
|
29137
|
+
if (row.channel === "registry") {
|
|
29138
|
+
const registry = updateText2(row.registry);
|
|
29139
|
+
return registry === void 0 ? void 0 : { channel: "registry", registry };
|
|
29140
|
+
}
|
|
29141
|
+
if (row.channel === "tarball") {
|
|
29142
|
+
const tarballDir = updateText2(row.tarballDir);
|
|
29143
|
+
return tarballDir === void 0 ? void 0 : { channel: "tarball", tarballDir };
|
|
29144
|
+
}
|
|
29145
|
+
return row.channel === "none" ? { channel: "none" } : void 0;
|
|
29146
|
+
}
|
|
29147
|
+
function updateText2(value) {
|
|
29148
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
29149
|
+
}
|
|
28934
29150
|
function updateVersion(value) {
|
|
28935
29151
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
28936
29152
|
}
|
|
28937
29153
|
|
|
28938
29154
|
// browser.tsx
|
|
28939
|
-
var
|
|
29155
|
+
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
28940
29156
|
function record2(value) {
|
|
28941
29157
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
28942
29158
|
}
|
|
@@ -28947,7 +29163,7 @@ var root = document.getElementById("root");
|
|
|
28947
29163
|
var controls;
|
|
28948
29164
|
if (root) {
|
|
28949
29165
|
(0, import_client3.createRoot)(root).render(
|
|
28950
|
-
/* @__PURE__ */ (0,
|
|
29166
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
28951
29167
|
PanelSurface,
|
|
28952
29168
|
{
|
|
28953
29169
|
client: clients,
|
|
@@ -28958,7 +29174,7 @@ if (root) {
|
|
|
28958
29174
|
locale: isPanelLocale(policy.locale) ? policy.locale : "en",
|
|
28959
29175
|
mode: "production",
|
|
28960
29176
|
shell: "standalone",
|
|
28961
|
-
frame: (appId) => /* @__PURE__ */ (0,
|
|
29177
|
+
frame: (appId) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("iframe", { className: "block size-full border-0", sandbox: appFrameSandbox, src: runnerPath(appId), title: appId }),
|
|
28962
29178
|
versions: [about.name, about.current].filter((part) => typeof part === "string" && part.length > 0).join(" "),
|
|
28963
29179
|
onControls: (next) => {
|
|
28964
29180
|
controls = next;
|
|
@@ -29080,6 +29296,8 @@ lucide-react/dist/esm/icons/check.js:
|
|
|
29080
29296
|
lucide-react/dist/esm/icons/clock.js:
|
|
29081
29297
|
lucide-react/dist/esm/icons/database.js:
|
|
29082
29298
|
lucide-react/dist/esm/icons/external-link.js:
|
|
29299
|
+
lucide-react/dist/esm/icons/globe.js:
|
|
29300
|
+
lucide-react/dist/esm/icons/hard-drive.js:
|
|
29083
29301
|
lucide-react/dist/esm/icons/key-round.js:
|
|
29084
29302
|
lucide-react/dist/esm/icons/layout-grid.js:
|
|
29085
29303
|
lucide-react/dist/esm/icons/loader-circle.js:
|
|
@@ -29089,6 +29307,7 @@ lucide-react/dist/esm/icons/pin.js:
|
|
|
29089
29307
|
lucide-react/dist/esm/icons/refresh-cw.js:
|
|
29090
29308
|
lucide-react/dist/esm/icons/search.js:
|
|
29091
29309
|
lucide-react/dist/esm/icons/settings.js:
|
|
29310
|
+
lucide-react/dist/esm/icons/terminal.js:
|
|
29092
29311
|
lucide-react/dist/esm/icons/trash-2.js:
|
|
29093
29312
|
lucide-react/dist/esm/lucide-react.js:
|
|
29094
29313
|
(**
|