@trops/dash-core 0.1.386 → 0.1.387
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 +198 -0
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -49470,6 +49470,27 @@ const dashboardTools$1 = [
|
|
|
49470
49470
|
required: [],
|
|
49471
49471
|
},
|
|
49472
49472
|
},
|
|
49473
|
+
{
|
|
49474
|
+
name: "search_registry_dashboards",
|
|
49475
|
+
description:
|
|
49476
|
+
"Search the online Dash registry for pre-built dashboard templates. Returns matching dashboards with their names, descriptions, and the list of widgets they require. Useful when the user asks for a dashboard by topic (e.g. 'find me a sales dashboard'). If `compatibleWidgetsOnly` is true, only dashboards whose required widgets are ALL already installed are returned — safe to install without additional widget downloads. Otherwise, include dashboards that may require pulling in new widget packages first.",
|
|
49477
|
+
inputSchema: {
|
|
49478
|
+
type: "object",
|
|
49479
|
+
properties: {
|
|
49480
|
+
query: {
|
|
49481
|
+
type: "string",
|
|
49482
|
+
description:
|
|
49483
|
+
"Search keyword to match against dashboard names, descriptions, and tags",
|
|
49484
|
+
},
|
|
49485
|
+
compatibleWidgetsOnly: {
|
|
49486
|
+
type: "boolean",
|
|
49487
|
+
description:
|
|
49488
|
+
"When true, restrict results to dashboards whose required widgets are already installed. Defaults to false (returns all matches).",
|
|
49489
|
+
},
|
|
49490
|
+
},
|
|
49491
|
+
required: ["query"],
|
|
49492
|
+
},
|
|
49493
|
+
},
|
|
49473
49494
|
];
|
|
49474
49495
|
|
|
49475
49496
|
const widgetTools$1 = [
|
|
@@ -49678,6 +49699,22 @@ const themeTools$1 = [
|
|
|
49678
49699
|
required: ["name"],
|
|
49679
49700
|
},
|
|
49680
49701
|
},
|
|
49702
|
+
{
|
|
49703
|
+
name: "search_registry_themes",
|
|
49704
|
+
description:
|
|
49705
|
+
"Search the online Dash registry for themes by keyword. Returns matching theme packages with their names, descriptions, and preview metadata. Useful when the user asks for a theme style (e.g. 'find me a dark purple theme') and the local `list_themes` set doesn't have a good match. Each result includes an `installed` boolean — if false, call `install_registry_theme` to pull it in, then `apply_theme` to activate.",
|
|
49706
|
+
inputSchema: {
|
|
49707
|
+
type: "object",
|
|
49708
|
+
properties: {
|
|
49709
|
+
query: {
|
|
49710
|
+
type: "string",
|
|
49711
|
+
description:
|
|
49712
|
+
"Search keyword to match against theme names, descriptions, and tags",
|
|
49713
|
+
},
|
|
49714
|
+
},
|
|
49715
|
+
required: ["query"],
|
|
49716
|
+
},
|
|
49717
|
+
},
|
|
49681
49718
|
];
|
|
49682
49719
|
|
|
49683
49720
|
const guideTools$1 = [
|
|
@@ -60826,6 +60863,159 @@ async function handleApplyTheme$1({ name, dashboard }) {
|
|
|
60826
60863
|
};
|
|
60827
60864
|
}
|
|
60828
60865
|
|
|
60866
|
+
/**
|
|
60867
|
+
* search_registry_themes — Search the online Dash registry for themes by
|
|
60868
|
+
* keyword. Companion to list_themes (which lists already-saved themes).
|
|
60869
|
+
*/
|
|
60870
|
+
async function handleSearchRegistryThemes$1({ query }) {
|
|
60871
|
+
if (!query || typeof query !== "string" || !query.trim()) {
|
|
60872
|
+
return {
|
|
60873
|
+
content: [
|
|
60874
|
+
{
|
|
60875
|
+
type: "text",
|
|
60876
|
+
text: JSON.stringify({
|
|
60877
|
+
error: "query is required and must be a non-empty string",
|
|
60878
|
+
}),
|
|
60879
|
+
},
|
|
60880
|
+
],
|
|
60881
|
+
isError: true,
|
|
60882
|
+
};
|
|
60883
|
+
}
|
|
60884
|
+
|
|
60885
|
+
try {
|
|
60886
|
+
const result = await registryController$2.searchThemes(query.trim());
|
|
60887
|
+
const packages = result.packages || [];
|
|
60888
|
+
|
|
60889
|
+
// Build a set of locally-saved theme names so the LLM knows which
|
|
60890
|
+
// registry themes are already available.
|
|
60891
|
+
let installedNames = new Set();
|
|
60892
|
+
try {
|
|
60893
|
+
const { win, appId } = requireContext$1();
|
|
60894
|
+
const local = themeController$4.listThemesForApplication(win, appId);
|
|
60895
|
+
const themeMap = local?.themes || {};
|
|
60896
|
+
installedNames = new Set(Object.keys(themeMap));
|
|
60897
|
+
} catch {
|
|
60898
|
+
/* best-effort — continue with empty set if context unavailable */
|
|
60899
|
+
}
|
|
60900
|
+
|
|
60901
|
+
const themes = packages.map((pkg) => ({
|
|
60902
|
+
name: pkg.name,
|
|
60903
|
+
scope: pkg.scope || null,
|
|
60904
|
+
displayName: pkg.displayName || pkg.name,
|
|
60905
|
+
description: pkg.description || "",
|
|
60906
|
+
icon: pkg.icon || null,
|
|
60907
|
+
installed: installedNames.has(pkg.name),
|
|
60908
|
+
preview: pkg.preview || null,
|
|
60909
|
+
}));
|
|
60910
|
+
|
|
60911
|
+
return {
|
|
60912
|
+
content: [
|
|
60913
|
+
{
|
|
60914
|
+
type: "text",
|
|
60915
|
+
text: JSON.stringify(
|
|
60916
|
+
{ query: query.trim(), themes, count: themes.length },
|
|
60917
|
+
null,
|
|
60918
|
+
2,
|
|
60919
|
+
),
|
|
60920
|
+
},
|
|
60921
|
+
],
|
|
60922
|
+
};
|
|
60923
|
+
} catch (err) {
|
|
60924
|
+
return {
|
|
60925
|
+
content: [
|
|
60926
|
+
{
|
|
60927
|
+
type: "text",
|
|
60928
|
+
text: JSON.stringify({
|
|
60929
|
+
error: `Failed to search theme registry: ${err.message}`,
|
|
60930
|
+
}),
|
|
60931
|
+
},
|
|
60932
|
+
],
|
|
60933
|
+
isError: true,
|
|
60934
|
+
};
|
|
60935
|
+
}
|
|
60936
|
+
}
|
|
60937
|
+
|
|
60938
|
+
/**
|
|
60939
|
+
* search_registry_dashboards — Search the online Dash registry for
|
|
60940
|
+
* pre-built dashboard templates.
|
|
60941
|
+
*/
|
|
60942
|
+
async function handleSearchRegistryDashboards$1({
|
|
60943
|
+
query,
|
|
60944
|
+
compatibleWidgetsOnly = false,
|
|
60945
|
+
}) {
|
|
60946
|
+
if (!query || typeof query !== "string" || !query.trim()) {
|
|
60947
|
+
return {
|
|
60948
|
+
content: [
|
|
60949
|
+
{
|
|
60950
|
+
type: "text",
|
|
60951
|
+
text: JSON.stringify({
|
|
60952
|
+
error: "query is required and must be a non-empty string",
|
|
60953
|
+
}),
|
|
60954
|
+
},
|
|
60955
|
+
],
|
|
60956
|
+
isError: true,
|
|
60957
|
+
};
|
|
60958
|
+
}
|
|
60959
|
+
|
|
60960
|
+
try {
|
|
60961
|
+
// If compatibility filter requested, compute the list of widget
|
|
60962
|
+
// scoped IDs the user currently has installed. The registry
|
|
60963
|
+
// filter in searchDashboards then prunes dashboards whose required
|
|
60964
|
+
// widgets aren't all present.
|
|
60965
|
+
let filters = {};
|
|
60966
|
+
if (compatibleWidgetsOnly) {
|
|
60967
|
+
const installedPkgs = getInstalledPackageNames();
|
|
60968
|
+
filters.compatibleWidgets = Array.from(installedPkgs);
|
|
60969
|
+
}
|
|
60970
|
+
|
|
60971
|
+
const result = await registryController$2.searchDashboards(
|
|
60972
|
+
query.trim(),
|
|
60973
|
+
filters,
|
|
60974
|
+
);
|
|
60975
|
+
const packages = result.packages || [];
|
|
60976
|
+
|
|
60977
|
+
const dashboards = packages.map((pkg) => ({
|
|
60978
|
+
name: pkg.name,
|
|
60979
|
+
scope: pkg.scope || null,
|
|
60980
|
+
displayName: pkg.displayName || pkg.name,
|
|
60981
|
+
description: pkg.description || "",
|
|
60982
|
+
icon: pkg.icon || null,
|
|
60983
|
+
requiredWidgets: pkg.requiredWidgets || pkg.widgets || [],
|
|
60984
|
+
preview: pkg.preview || null,
|
|
60985
|
+
}));
|
|
60986
|
+
|
|
60987
|
+
return {
|
|
60988
|
+
content: [
|
|
60989
|
+
{
|
|
60990
|
+
type: "text",
|
|
60991
|
+
text: JSON.stringify(
|
|
60992
|
+
{
|
|
60993
|
+
query: query.trim(),
|
|
60994
|
+
compatibleWidgetsOnly,
|
|
60995
|
+
dashboards,
|
|
60996
|
+
count: dashboards.length,
|
|
60997
|
+
},
|
|
60998
|
+
null,
|
|
60999
|
+
2,
|
|
61000
|
+
),
|
|
61001
|
+
},
|
|
61002
|
+
],
|
|
61003
|
+
};
|
|
61004
|
+
} catch (err) {
|
|
61005
|
+
return {
|
|
61006
|
+
content: [
|
|
61007
|
+
{
|
|
61008
|
+
type: "text",
|
|
61009
|
+
text: JSON.stringify({
|
|
61010
|
+
error: `Failed to search dashboard registry: ${err.message}`,
|
|
61011
|
+
}),
|
|
61012
|
+
},
|
|
61013
|
+
],
|
|
61014
|
+
isError: true,
|
|
61015
|
+
};
|
|
61016
|
+
}
|
|
61017
|
+
}
|
|
61018
|
+
|
|
60829
61019
|
// --- Provider Tool Handlers ---
|
|
60830
61020
|
|
|
60831
61021
|
const { PROVIDER_LIST_COMPLETE } = events$8;
|
|
@@ -61691,6 +61881,8 @@ var toolHandlers$1 = {
|
|
|
61691
61881
|
handleCreateTheme: handleCreateTheme$1,
|
|
61692
61882
|
handleCreateThemeFromUrl: handleCreateThemeFromUrl$1,
|
|
61693
61883
|
handleApplyTheme: handleApplyTheme$1,
|
|
61884
|
+
handleSearchRegistryThemes: handleSearchRegistryThemes$1,
|
|
61885
|
+
handleSearchRegistryDashboards: handleSearchRegistryDashboards$1,
|
|
61694
61886
|
handleListProviders: handleListProviders$1,
|
|
61695
61887
|
handleAddProvider: handleAddProvider$1,
|
|
61696
61888
|
handleRemoveProvider: handleRemoveProvider$1,
|
|
@@ -61759,6 +61951,8 @@ const dashToolHandlerMap = {
|
|
|
61759
61951
|
create_theme: toolHandlers.handleCreateTheme,
|
|
61760
61952
|
create_theme_from_url: toolHandlers.handleCreateThemeFromUrl,
|
|
61761
61953
|
apply_theme: toolHandlers.handleApplyTheme,
|
|
61954
|
+
search_registry_themes: toolHandlers.handleSearchRegistryThemes,
|
|
61955
|
+
search_registry_dashboards: toolHandlers.handleSearchRegistryDashboards,
|
|
61762
61956
|
list_providers: toolHandlers.handleListProviders,
|
|
61763
61957
|
add_provider: toolHandlers.handleAddProvider,
|
|
61764
61958
|
remove_provider: toolHandlers.handleRemoveProvider,
|
|
@@ -75075,6 +75269,7 @@ const {
|
|
|
75075
75269
|
handleCreateDashboard,
|
|
75076
75270
|
handleDeleteDashboard,
|
|
75077
75271
|
handleGetAppStats,
|
|
75272
|
+
handleSearchRegistryDashboards,
|
|
75078
75273
|
} = toolHandlers$1;
|
|
75079
75274
|
|
|
75080
75275
|
// Map tool names to handler functions
|
|
@@ -75084,6 +75279,7 @@ const handlerMap$7 = {
|
|
|
75084
75279
|
create_dashboard: handleCreateDashboard,
|
|
75085
75280
|
delete_dashboard: handleDeleteDashboard,
|
|
75086
75281
|
get_app_stats: handleGetAppStats,
|
|
75282
|
+
search_registry_dashboards: handleSearchRegistryDashboards,
|
|
75087
75283
|
};
|
|
75088
75284
|
|
|
75089
75285
|
/**
|
|
@@ -75175,6 +75371,7 @@ const {
|
|
|
75175
75371
|
handleCreateTheme,
|
|
75176
75372
|
handleCreateThemeFromUrl,
|
|
75177
75373
|
handleApplyTheme,
|
|
75374
|
+
handleSearchRegistryThemes,
|
|
75178
75375
|
} = toolHandlers$1;
|
|
75179
75376
|
|
|
75180
75377
|
// Map tool names to handler functions
|
|
@@ -75184,6 +75381,7 @@ const handlerMap$5 = {
|
|
|
75184
75381
|
create_theme: handleCreateTheme,
|
|
75185
75382
|
create_theme_from_url: handleCreateThemeFromUrl,
|
|
75186
75383
|
apply_theme: handleApplyTheme,
|
|
75384
|
+
search_registry_themes: handleSearchRegistryThemes,
|
|
75187
75385
|
};
|
|
75188
75386
|
|
|
75189
75387
|
/**
|