@trops/dash-core 0.1.450 → 0.1.452
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/electron/index.js +113 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +214 -54
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +214 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45820,7 +45820,9 @@ var getIconForServer = function getIconForServer(server) {
|
|
|
45820
45820
|
*/
|
|
45821
45821
|
var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
45822
45822
|
var onSave = _ref.onSave,
|
|
45823
|
-
onCancel = _ref.onCancel
|
|
45823
|
+
onCancel = _ref.onCancel,
|
|
45824
|
+
_ref$initialSelectedI = _ref.initialSelectedId,
|
|
45825
|
+
initialSelectedId = _ref$initialSelectedI === void 0 ? null : _ref$initialSelectedI;
|
|
45824
45826
|
var appContext = React.useContext(AppContext);
|
|
45825
45827
|
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
45826
45828
|
var _useState = React.useState([]),
|
|
@@ -45957,6 +45959,22 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
45957
45959
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45958
45960
|
}, [dashApi]);
|
|
45959
45961
|
|
|
45962
|
+
// Pre-select a catalog entry when initialSelectedId is provided
|
|
45963
|
+
// (used by the cross-modal "Add new <type>" CTA from the Widget
|
|
45964
|
+
// Builder). Fires once the catalog finishes loading; if no entry
|
|
45965
|
+
// matches the id (e.g. type isn't in the catalog), silently no-ops
|
|
45966
|
+
// and the user lands on the catalog grid to pick manually.
|
|
45967
|
+
React.useEffect(function () {
|
|
45968
|
+
if (!initialSelectedId || selectedServer || catalog.length === 0) return;
|
|
45969
|
+
var match = catalog.find(function (s) {
|
|
45970
|
+
return s && s.id === initialSelectedId;
|
|
45971
|
+
});
|
|
45972
|
+
if (match) {
|
|
45973
|
+
setSelectedServer(match);
|
|
45974
|
+
}
|
|
45975
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45976
|
+
}, [catalog, initialSelectedId]);
|
|
45977
|
+
|
|
45960
45978
|
// Filter catalog by search, then sort alphabetically by display name.
|
|
45961
45979
|
// Built-in and known-external entries are interleaved alphabetically —
|
|
45962
45980
|
// the per-card "external" badge keeps the source obvious without
|
|
@@ -47030,7 +47048,11 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
47030
47048
|
_ref$createRequested = _ref.createRequested,
|
|
47031
47049
|
createRequested = _ref$createRequested === void 0 ? false : _ref$createRequested,
|
|
47032
47050
|
_ref$onCreateAcknowle = _ref.onCreateAcknowledged,
|
|
47033
|
-
onCreateAcknowledged = _ref$onCreateAcknowle === void 0 ? null : _ref$onCreateAcknowle
|
|
47051
|
+
onCreateAcknowledged = _ref$onCreateAcknowle === void 0 ? null : _ref$onCreateAcknowle,
|
|
47052
|
+
_ref$initialProviderT = _ref.initialProviderType,
|
|
47053
|
+
initialProviderType = _ref$initialProviderT === void 0 ? null : _ref$initialProviderT,
|
|
47054
|
+
_ref$initialProviderC = _ref.initialProviderClass,
|
|
47055
|
+
initialProviderClass = _ref$initialProviderC === void 0 ? null : _ref$initialProviderC;
|
|
47034
47056
|
var appContext = React.useContext(AppContext);
|
|
47035
47057
|
var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
|
|
47036
47058
|
var refreshProviders = appContext === null || appContext === void 0 ? void 0 : appContext.refreshProviders;
|
|
@@ -47366,14 +47388,29 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
47366
47388
|
});
|
|
47367
47389
|
}
|
|
47368
47390
|
|
|
47369
|
-
// Respond to external create trigger from header
|
|
47391
|
+
// Respond to external create trigger from header (or from the
|
|
47392
|
+
// cross-modal "Add new <type>" event dispatched by the Widget
|
|
47393
|
+
// Builder, with optional initialProviderType/initialProviderClass
|
|
47394
|
+
// for type pre-fill / catalog pre-select).
|
|
47370
47395
|
var prevCreateRequested = React.useRef(false);
|
|
47371
47396
|
React.useEffect(function () {
|
|
47372
47397
|
if (createRequested && !prevCreateRequested.current) {
|
|
47373
47398
|
resetForm();
|
|
47374
47399
|
setSelectedName(null);
|
|
47375
|
-
|
|
47376
|
-
|
|
47400
|
+
if (initialProviderClass === "mcp") {
|
|
47401
|
+
// MCP class: open the catalog detail. Pre-select happens in
|
|
47402
|
+
// McpCatalogDetail via the initialSelectedId prop passed below.
|
|
47403
|
+
setIsCreating(false);
|
|
47404
|
+
setIsAddingMcp(true);
|
|
47405
|
+
} else {
|
|
47406
|
+
// Credential class (default): open the credential create form
|
|
47407
|
+
// and pre-fill the type field if provided.
|
|
47408
|
+
setIsAddingMcp(false);
|
|
47409
|
+
setIsCreating(true);
|
|
47410
|
+
if (initialProviderType) {
|
|
47411
|
+
setFormType(initialProviderType);
|
|
47412
|
+
}
|
|
47413
|
+
}
|
|
47377
47414
|
}
|
|
47378
47415
|
prevCreateRequested.current = createRequested;
|
|
47379
47416
|
if (createRequested && onCreateAcknowledged) {
|
|
@@ -47509,7 +47546,8 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
47509
47546
|
onSave: handleMcpSave,
|
|
47510
47547
|
onCancel: function onCancel() {
|
|
47511
47548
|
return setIsAddingMcp(false);
|
|
47512
|
-
}
|
|
47549
|
+
},
|
|
47550
|
+
initialSelectedId: initialProviderType
|
|
47513
47551
|
});
|
|
47514
47552
|
} else if (isCreating) {
|
|
47515
47553
|
detailContent = /*#__PURE__*/jsxRuntime.jsx(ProviderDetail, {
|
|
@@ -49239,6 +49277,15 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49239
49277
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
49240
49278
|
packageInfo = _useState14[0],
|
|
49241
49279
|
setPackageInfo = _useState14[1];
|
|
49280
|
+
// When the main-process pre-publish scan finds personal filesystem
|
|
49281
|
+
// paths in the package source, it returns `{ needsConfirmation: true,
|
|
49282
|
+
// personalPathFindings: [...] }` instead of publishing. We stash the
|
|
49283
|
+
// findings and surface a confirm-or-cancel panel; "Publish anyway"
|
|
49284
|
+
// retries with `confirmPersonalPaths: true`.
|
|
49285
|
+
var _useState15 = React.useState(null),
|
|
49286
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
49287
|
+
personalPathFindings = _useState16[0],
|
|
49288
|
+
setPersonalPathFindings = _useState16[1];
|
|
49242
49289
|
|
|
49243
49290
|
// Reset modal state on open
|
|
49244
49291
|
React.useEffect(function () {
|
|
@@ -49249,6 +49296,7 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49249
49296
|
setIsPublishing(false);
|
|
49250
49297
|
setResult(null);
|
|
49251
49298
|
setPackageInfo(null);
|
|
49299
|
+
setPersonalPathFindings(null);
|
|
49252
49300
|
}, [isOpen]);
|
|
49253
49301
|
|
|
49254
49302
|
// Inspect the package to get its metadata + component list
|
|
@@ -49416,10 +49464,18 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49416
49464
|
}
|
|
49417
49465
|
function _handlePublish() {
|
|
49418
49466
|
_handlePublish = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
49419
|
-
var
|
|
49467
|
+
var _ref4,
|
|
49468
|
+
_ref4$confirmPersonal,
|
|
49469
|
+
confirmPersonalPaths,
|
|
49470
|
+
options,
|
|
49471
|
+
packageId,
|
|
49472
|
+
res,
|
|
49473
|
+
_args4 = arguments,
|
|
49474
|
+
_t3;
|
|
49420
49475
|
return _regeneratorRuntime.wrap(function (_context4) {
|
|
49421
49476
|
while (1) switch (_context4.prev = _context4.next) {
|
|
49422
49477
|
case 0:
|
|
49478
|
+
_ref4 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref4$confirmPersonal = _ref4.confirmPersonalPaths, confirmPersonalPaths = _ref4$confirmPersonal === void 0 ? false : _ref4$confirmPersonal;
|
|
49423
49479
|
if (widget) {
|
|
49424
49480
|
_context4.next = 1;
|
|
49425
49481
|
break;
|
|
@@ -49428,18 +49484,28 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49428
49484
|
case 1:
|
|
49429
49485
|
setIsPublishing(true);
|
|
49430
49486
|
setResult(null);
|
|
49487
|
+
if (!confirmPersonalPaths) setPersonalPathFindings(null);
|
|
49431
49488
|
_context4.prev = 2;
|
|
49432
|
-
options = _objectSpread$k({
|
|
49489
|
+
options = _objectSpread$k(_objectSpread$k({
|
|
49433
49490
|
visibility: visibility
|
|
49434
49491
|
}, bump && bump !== "none" ? {
|
|
49435
49492
|
bump: bump
|
|
49493
|
+
} : {}), confirmPersonalPaths ? {
|
|
49494
|
+
confirmPersonalPaths: true
|
|
49436
49495
|
} : {});
|
|
49437
49496
|
packageId = widget.packageId || widget.name;
|
|
49438
49497
|
_context4.next = 3;
|
|
49439
49498
|
return window.mainApi.registry.publishWidget(appId, packageId, options);
|
|
49440
49499
|
case 3:
|
|
49441
49500
|
res = _context4.sent;
|
|
49442
|
-
|
|
49501
|
+
// Main process asked us to confirm a privacy warning before it ships
|
|
49502
|
+
// the package. Stash the findings and render the confirm panel —
|
|
49503
|
+
// don't mark as a completed result.
|
|
49504
|
+
if (res !== null && res !== void 0 && res.needsConfirmation && (res === null || res === void 0 ? void 0 : res.reason) === "personal-paths") {
|
|
49505
|
+
setPersonalPathFindings(res.personalPathFindings || []);
|
|
49506
|
+
} else {
|
|
49507
|
+
setResult(res);
|
|
49508
|
+
}
|
|
49443
49509
|
_context4.next = 5;
|
|
49444
49510
|
break;
|
|
49445
49511
|
case 4:
|
|
@@ -49461,6 +49527,14 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49461
49527
|
}));
|
|
49462
49528
|
return _handlePublish.apply(this, arguments);
|
|
49463
49529
|
}
|
|
49530
|
+
function handleCancelPersonalPathsConfirm() {
|
|
49531
|
+
setPersonalPathFindings(null);
|
|
49532
|
+
}
|
|
49533
|
+
function handleConfirmPersonalPathsAndPublish() {
|
|
49534
|
+
handlePublish({
|
|
49535
|
+
confirmPersonalPaths: true
|
|
49536
|
+
});
|
|
49537
|
+
}
|
|
49464
49538
|
if (!widget) return null;
|
|
49465
49539
|
var currentVersion = widget.version || "1.0.0";
|
|
49466
49540
|
var newVersion = bumpPreview(currentVersion, bump);
|
|
@@ -49505,7 +49579,48 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49505
49579
|
className: "text-xs text-red-300",
|
|
49506
49580
|
children: authError
|
|
49507
49581
|
})]
|
|
49508
|
-
}), authStatus === "authenticated" && !result && /*#__PURE__*/jsxRuntime.jsxs(
|
|
49582
|
+
}), authStatus === "authenticated" && personalPathFindings && !result && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49583
|
+
className: "space-y-3",
|
|
49584
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49585
|
+
className: "p-3 bg-amber-900/20 border border-amber-700/40 rounded text-sm text-amber-200",
|
|
49586
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49587
|
+
className: "font-semibold flex items-center gap-2 mb-1",
|
|
49588
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
49589
|
+
icon: "triangle-exclamation",
|
|
49590
|
+
className: "h-4 w-4"
|
|
49591
|
+
}), "Personal paths detected in this package"]
|
|
49592
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49593
|
+
className: "text-xs opacity-90",
|
|
49594
|
+
children: ["The following lines look like absolute paths on your machine. Publishing will include them. If any of these are your local filesystem, replace them with a tilde (e.g.", /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
49595
|
+
className: "px-1 opacity-90",
|
|
49596
|
+
children: "~/pipeline"
|
|
49597
|
+
}), ") or a schema ", /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
49598
|
+
className: "px-1 opacity-90",
|
|
49599
|
+
children: "defaultValue"
|
|
49600
|
+
}), " ", "before publishing."]
|
|
49601
|
+
})]
|
|
49602
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
49603
|
+
className: "bg-white/5 border border-white/10 rounded-lg divide-y divide-white/10 max-h-60 overflow-y-auto",
|
|
49604
|
+
children: personalPathFindings.map(function (f, idx) {
|
|
49605
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49606
|
+
className: "px-3 py-2 text-xs",
|
|
49607
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49608
|
+
className: "font-mono text-amber-200 truncate",
|
|
49609
|
+
children: [f.file, ":", f.line]
|
|
49610
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
49611
|
+
className: "font-mono opacity-80 mt-0.5 break-all",
|
|
49612
|
+
children: f.match
|
|
49613
|
+
}), f.context && f.context !== f.match && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
49614
|
+
className: "font-mono opacity-50 mt-0.5 truncate",
|
|
49615
|
+
children: f.context
|
|
49616
|
+
})]
|
|
49617
|
+
}, "".concat(f.file, ":").concat(f.line, ":").concat(idx));
|
|
49618
|
+
})
|
|
49619
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49620
|
+
className: "text-xs opacity-60",
|
|
49621
|
+
children: ["Total findings: ", personalPathFindings.length, personalPathFindings.length >= 50 && " (capped)"]
|
|
49622
|
+
})]
|
|
49623
|
+
}), authStatus === "authenticated" && !result && !personalPathFindings && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
49509
49624
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49510
49625
|
className: "bg-white/5 border border-white/10 rounded-lg p-3 text-sm",
|
|
49511
49626
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -49666,16 +49781,29 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
|
|
|
49666
49781
|
})
|
|
49667
49782
|
})]
|
|
49668
49783
|
})]
|
|
49669
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
49784
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
49670
49785
|
className: "flex-shrink-0 flex flex-row justify-end gap-2 p-4 border-t border-white/10",
|
|
49671
|
-
children:
|
|
49672
|
-
|
|
49673
|
-
|
|
49674
|
-
|
|
49675
|
-
|
|
49676
|
-
|
|
49677
|
-
|
|
49678
|
-
|
|
49786
|
+
children: personalPathFindings ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
49787
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
49788
|
+
title: "Go back",
|
|
49789
|
+
onClick: handleCancelPersonalPathsConfirm
|
|
49790
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
49791
|
+
title: isPublishing ? "Publishing…" : "Publish anyway",
|
|
49792
|
+
onClick: handleConfirmPersonalPathsAndPublish,
|
|
49793
|
+
disabled: isPublishing
|
|
49794
|
+
})]
|
|
49795
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
49796
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
49797
|
+
title: result !== null && result !== void 0 && result.success ? "Close" : "Cancel",
|
|
49798
|
+
onClick: handleClose
|
|
49799
|
+
}), !(result !== null && result !== void 0 && result.success) && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
49800
|
+
title: isPublishing ? "Publishing…" : "Publish",
|
|
49801
|
+
onClick: function onClick() {
|
|
49802
|
+
return handlePublish();
|
|
49803
|
+
},
|
|
49804
|
+
disabled: !canPublish
|
|
49805
|
+
})]
|
|
49806
|
+
})
|
|
49679
49807
|
})]
|
|
49680
49808
|
})
|
|
49681
49809
|
});
|
|
@@ -53201,6 +53329,10 @@ var AppSettingsModal = function AppSettingsModal(_ref) {
|
|
|
53201
53329
|
initialProviderName = _ref$initialProviderN === void 0 ? null : _ref$initialProviderN,
|
|
53202
53330
|
_ref$initialCreatePro = _ref.initialCreateProvider,
|
|
53203
53331
|
initialCreateProvider = _ref$initialCreatePro === void 0 ? false : _ref$initialCreatePro,
|
|
53332
|
+
_ref$initialProviderT = _ref.initialProviderType,
|
|
53333
|
+
initialProviderType = _ref$initialProviderT === void 0 ? null : _ref$initialProviderT,
|
|
53334
|
+
_ref$initialProviderC = _ref.initialProviderClass,
|
|
53335
|
+
initialProviderClass = _ref$initialProviderC === void 0 ? null : _ref$initialProviderC,
|
|
53204
53336
|
_ref$workspaces = _ref.workspaces,
|
|
53205
53337
|
workspaces = _ref$workspaces === void 0 ? [] : _ref$workspaces,
|
|
53206
53338
|
_ref$menuItems = _ref.menuItems,
|
|
@@ -53336,7 +53468,9 @@ var AppSettingsModal = function AppSettingsModal(_ref) {
|
|
|
53336
53468
|
return setCreateRequested(false);
|
|
53337
53469
|
},
|
|
53338
53470
|
initialProviderName: initialProviderName,
|
|
53339
|
-
initialCreateRequested: initialCreateProvider
|
|
53471
|
+
initialCreateRequested: initialCreateProvider,
|
|
53472
|
+
initialProviderType: initialProviderType,
|
|
53473
|
+
initialProviderClass: initialProviderClass
|
|
53340
53474
|
}), activeSection === "themes" && /*#__PURE__*/jsxRuntime.jsx(ThemesSection, {
|
|
53341
53475
|
onOpenThemeEditor: onOpenThemeEditor,
|
|
53342
53476
|
dashApi: dashApi,
|
|
@@ -58188,13 +58322,31 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
58188
58322
|
_useState52 = _slicedToArray(_useState51, 2),
|
|
58189
58323
|
appSettingsCreateProvider = _useState52[0],
|
|
58190
58324
|
setAppSettingsCreateProvider = _useState52[1];
|
|
58325
|
+
// Optional pre-fills used by the cross-modal "Add new <type>"
|
|
58326
|
+
// flow dispatched from dash-electron's WidgetBuilderModal.
|
|
58327
|
+
// initialProviderType is the type id (e.g. "filesystem", "slack").
|
|
58328
|
+
// initialProviderClass routes the create flow: "mcp" opens the
|
|
58329
|
+
// catalog detail with that type pre-selected; otherwise opens
|
|
58330
|
+
// the credential create form with formType pre-filled.
|
|
58331
|
+
var _useState53 = React.useState(null),
|
|
58332
|
+
_useState54 = _slicedToArray(_useState53, 2),
|
|
58333
|
+
appSettingsInitialProviderType = _useState54[0],
|
|
58334
|
+
setAppSettingsInitialProviderType = _useState54[1];
|
|
58335
|
+
var _useState55 = React.useState(null),
|
|
58336
|
+
_useState56 = _slicedToArray(_useState55, 2),
|
|
58337
|
+
appSettingsInitialProviderClass = _useState56[0],
|
|
58338
|
+
setAppSettingsInitialProviderClass = _useState56[1];
|
|
58191
58339
|
function openAppSettings() {
|
|
58192
58340
|
var section = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "general";
|
|
58193
58341
|
var providerName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
58194
58342
|
var createProvider = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
58343
|
+
var providerType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
58344
|
+
var providerClass = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
58195
58345
|
setAppSettingsInitialSection(section);
|
|
58196
58346
|
setAppSettingsInitialProvider(providerName);
|
|
58197
58347
|
setAppSettingsCreateProvider(createProvider);
|
|
58348
|
+
setAppSettingsInitialProviderType(providerType);
|
|
58349
|
+
setAppSettingsInitialProviderClass(providerClass);
|
|
58198
58350
|
setIsAppSettingsOpen(true);
|
|
58199
58351
|
}
|
|
58200
58352
|
function handleProfileUpdated() {
|
|
@@ -58286,6 +58438,27 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
58286
58438
|
};
|
|
58287
58439
|
}, [changeCurrentTheme]);
|
|
58288
58440
|
|
|
58441
|
+
// ─── Listen for "open Settings to create a provider of type X" ──
|
|
58442
|
+
// Dispatched by dash-electron's Widget Builder PreviewProviderPicker
|
|
58443
|
+
// when the user clicks "Add new <type>" because no instances of the
|
|
58444
|
+
// chosen type exist yet. Detail: { type, providerClass }. The
|
|
58445
|
+
// Widget Builder's own listener (in dash-electron/Dash.js) handles
|
|
58446
|
+
// closing the builder modal — this listener only opens Settings.
|
|
58447
|
+
React.useEffect(function () {
|
|
58448
|
+
var handler = function handler(e) {
|
|
58449
|
+
var _ref4 = (e === null || e === void 0 ? void 0 : e.detail) || {},
|
|
58450
|
+
type = _ref4.type,
|
|
58451
|
+
providerClass = _ref4.providerClass;
|
|
58452
|
+
if (!type) return;
|
|
58453
|
+
openAppSettings("providers", null, true, type, providerClass || null);
|
|
58454
|
+
};
|
|
58455
|
+
window.addEventListener("dash:open-settings-create-provider", handler);
|
|
58456
|
+
return function () {
|
|
58457
|
+
return window.removeEventListener("dash:open-settings-create-provider", handler);
|
|
58458
|
+
};
|
|
58459
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58460
|
+
}, []);
|
|
58461
|
+
|
|
58289
58462
|
// ─── Listen for external "open workspace" requests ──────────────
|
|
58290
58463
|
// Fired by: Dash.js notification click, MCP state-changed for
|
|
58291
58464
|
// create_dashboard, etc. Any code that wants to switch the active
|
|
@@ -58295,10 +58468,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
58295
58468
|
// We record the requested ID and open it once it appears in
|
|
58296
58469
|
// workspaceConfig — handles the case where the workspace was just
|
|
58297
58470
|
// created and the config reload is still in flight.
|
|
58298
|
-
var
|
|
58299
|
-
|
|
58300
|
-
pendingOpenWorkspaceId =
|
|
58301
|
-
setPendingOpenWorkspaceId =
|
|
58471
|
+
var _useState57 = React.useState(null),
|
|
58472
|
+
_useState58 = _slicedToArray(_useState57, 2),
|
|
58473
|
+
pendingOpenWorkspaceId = _useState58[0],
|
|
58474
|
+
setPendingOpenWorkspaceId = _useState58[1];
|
|
58302
58475
|
React.useEffect(function () {
|
|
58303
58476
|
var handler = function handler(e) {
|
|
58304
58477
|
var _e$detail2;
|
|
@@ -58920,10 +59093,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
58920
59093
|
}
|
|
58921
59094
|
|
|
58922
59095
|
// ─── Page State ──────────────────────────────────────────────────
|
|
58923
|
-
var
|
|
58924
|
-
|
|
58925
|
-
activePageId =
|
|
58926
|
-
setActivePageId =
|
|
59096
|
+
var _useState59 = React.useState(null),
|
|
59097
|
+
_useState60 = _slicedToArray(_useState59, 2),
|
|
59098
|
+
activePageId = _useState60[0],
|
|
59099
|
+
setActivePageId = _useState60[1];
|
|
58927
59100
|
|
|
58928
59101
|
// Page history stack for goBack() — pushes the previous page id
|
|
58929
59102
|
// whenever a navigation happens through navigateToPage().
|
|
@@ -58957,9 +59130,9 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
58957
59130
|
// Listen for programmatic page switches via DashboardActionsApi
|
|
58958
59131
|
React.useEffect(function () {
|
|
58959
59132
|
function onSwitchPage(e) {
|
|
58960
|
-
var
|
|
58961
|
-
pageId =
|
|
58962
|
-
pageName =
|
|
59133
|
+
var _ref5 = e.detail || {},
|
|
59134
|
+
pageId = _ref5.pageId,
|
|
59135
|
+
pageName = _ref5.pageName;
|
|
58963
59136
|
if (pageId) {
|
|
58964
59137
|
navigateToPage(pageId);
|
|
58965
59138
|
} else if (pageName) {
|
|
@@ -59814,11 +59987,15 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
59814
59987
|
if (!open) {
|
|
59815
59988
|
setAppSettingsInitialProvider(null);
|
|
59816
59989
|
setAppSettingsCreateProvider(false);
|
|
59990
|
+
setAppSettingsInitialProviderType(null);
|
|
59991
|
+
setAppSettingsInitialProviderClass(null);
|
|
59817
59992
|
}
|
|
59818
59993
|
},
|
|
59819
59994
|
initialSection: appSettingsInitialSection,
|
|
59820
59995
|
initialProviderName: appSettingsInitialProvider,
|
|
59821
59996
|
initialCreateProvider: appSettingsCreateProvider,
|
|
59997
|
+
initialProviderType: appSettingsInitialProviderType,
|
|
59998
|
+
initialProviderClass: appSettingsInitialProviderClass,
|
|
59822
59999
|
workspaces: workspaceConfig,
|
|
59823
60000
|
menuItems: menuItems,
|
|
59824
60001
|
dashApi: dashApi,
|
|
@@ -62630,15 +62807,6 @@ function ChatCore(_ref) {
|
|
|
62630
62807
|
}
|
|
62631
62808
|
};
|
|
62632
62809
|
|
|
62633
|
-
// End CLI session
|
|
62634
|
-
var handleEndSession = function handleEndSession() {
|
|
62635
|
-
var _mainApi$llm4;
|
|
62636
|
-
if (!isCliBackend || !(mainApi !== null && mainApi !== void 0 && (_mainApi$llm4 = mainApi.llm) !== null && _mainApi$llm4 !== void 0 && _mainApi$llm4.endCliSession)) return;
|
|
62637
|
-
if (isLoading) handleStop();
|
|
62638
|
-
mainApi.llm.endCliSession(uuid || persistKey || sessionKey);
|
|
62639
|
-
setSessionActive(false);
|
|
62640
|
-
};
|
|
62641
|
-
|
|
62642
62810
|
// Toggle tool
|
|
62643
62811
|
var handleToggleTool = function handleToggleTool(toolName) {
|
|
62644
62812
|
setEnabledTools(function (prev) {
|
|
@@ -62663,29 +62831,21 @@ function ChatCore(_ref) {
|
|
|
62663
62831
|
className: "inline-block w-2 h-2 rounded-full bg-green-400",
|
|
62664
62832
|
title: "CLI session active"
|
|
62665
62833
|
})]
|
|
62666
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
62834
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
62667
62835
|
className: "flex items-center gap-1",
|
|
62668
|
-
children:
|
|
62669
|
-
onClick: handleEndSession,
|
|
62670
|
-
className: "px-2 py-1 text-xs rounded bg-red-900/50 hover:bg-red-800/50 text-red-300 transition-colors",
|
|
62671
|
-
children: "End Session"
|
|
62672
|
-
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
62836
|
+
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
62673
62837
|
onClick: handleNewChat,
|
|
62674
62838
|
className: "px-2 py-1 text-xs rounded bg-gray-700 hover:bg-gray-600 text-gray-300 transition-colors",
|
|
62675
62839
|
children: "New Chat"
|
|
62676
|
-
})
|
|
62840
|
+
})
|
|
62677
62841
|
})]
|
|
62678
|
-
}) : /*#__PURE__*/jsxRuntime.
|
|
62842
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
62679
62843
|
className: "flex items-center justify-end px-3 py-1 shrink-0",
|
|
62680
|
-
children:
|
|
62681
|
-
onClick: handleEndSession,
|
|
62682
|
-
className: "px-2 py-1 text-xs rounded bg-red-900/50 hover:bg-red-800/50 text-red-300 transition-colors mr-1",
|
|
62683
|
-
children: "End Session"
|
|
62684
|
-
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
62844
|
+
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
62685
62845
|
onClick: handleNewChat,
|
|
62686
62846
|
className: "px-2 py-1 text-xs rounded bg-gray-700 hover:bg-gray-600 text-gray-300 transition-colors",
|
|
62687
62847
|
children: "New Chat"
|
|
62688
|
-
})
|
|
62848
|
+
})
|
|
62689
62849
|
}), error && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
62690
62850
|
className: "mx-3 mt-2 p-2 bg-red-900/30 border border-red-700 rounded text-red-300 text-xs",
|
|
62691
62851
|
children: [error, /*#__PURE__*/jsxRuntime.jsx("button", {
|