@trops/dash-core 0.1.283 → 0.1.285
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/README.md +85 -83
- package/dist/electron/index.js +16006 -14921
- package/dist/electron/index.js.map +1 -1
- package/dist/index.js +41 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ npm install @trops/dash-core
|
|
|
12
12
|
|
|
13
13
|
```json
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
"@trops/dash-react": ">=0.1.187",
|
|
16
|
+
"react": "^18.2.0",
|
|
17
|
+
"react-dom": "^18.2.0"
|
|
18
18
|
}
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -26,31 +26,31 @@ Platform-agnostic UI framework — contexts, hooks, models, components, widget s
|
|
|
26
26
|
|
|
27
27
|
```javascript
|
|
28
28
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
ComponentManager,
|
|
30
|
+
DashboardPublisher,
|
|
31
|
+
ErrorBoundary,
|
|
32
|
+
// Contexts
|
|
33
|
+
AppContext,
|
|
34
|
+
DashboardContext,
|
|
35
|
+
ThemeWrapper,
|
|
36
|
+
ProviderContext,
|
|
37
|
+
// Hooks
|
|
38
|
+
useDashboard,
|
|
39
|
+
useMcpProvider,
|
|
40
|
+
useWidgetProviders,
|
|
41
|
+
useInstalledWidgets,
|
|
42
|
+
// Models
|
|
43
|
+
DashboardModel,
|
|
44
|
+
LayoutModel,
|
|
45
|
+
ThemeModel,
|
|
46
|
+
// Components
|
|
47
|
+
LayoutBuilder,
|
|
48
|
+
SettingsPanel,
|
|
49
|
+
NavigationBar,
|
|
50
|
+
// Widget
|
|
51
|
+
Widget,
|
|
52
|
+
WidgetFactory,
|
|
53
|
+
ExternalWidget,
|
|
54
54
|
} from "@trops/dash-core";
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -60,20 +60,20 @@ Controllers, IPC handlers, events, and widget pipeline for Electron apps.
|
|
|
60
60
|
|
|
61
61
|
```javascript
|
|
62
62
|
const {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
// Factory
|
|
64
|
+
createMainApi,
|
|
65
|
+
// Controllers
|
|
66
|
+
providerController,
|
|
67
|
+
mcpController,
|
|
68
|
+
workspaceController,
|
|
69
|
+
themeController,
|
|
70
|
+
registryController,
|
|
71
|
+
// Widget pipeline
|
|
72
|
+
widgetRegistry,
|
|
73
|
+
widgetCompiler,
|
|
74
|
+
dynamicWidgetLoader,
|
|
75
|
+
// Events
|
|
76
|
+
events,
|
|
77
77
|
} = require("@trops/dash-core/electron");
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -102,28 +102,28 @@ const {
|
|
|
102
102
|
|
|
103
103
|
Platform-agnostic UI framework.
|
|
104
104
|
|
|
105
|
-
| Module
|
|
106
|
-
|
|
107
|
-
| **ComponentManager** | `ComponentManager.js` | Widget/workspace registration, config resolution
|
|
108
|
-
| **Context**
|
|
109
|
-
| **Hooks**
|
|
110
|
-
| **Models**
|
|
111
|
-
| **Api**
|
|
112
|
-
| **Components**
|
|
113
|
-
| **Widget**
|
|
114
|
-
| **Utils**
|
|
105
|
+
| Module | Key Files | Purpose |
|
|
106
|
+
| -------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| **ComponentManager** | `ComponentManager.js` | Widget/workspace registration, config resolution |
|
|
108
|
+
| **Context** | `Context/` | AppContext, DashboardContext, ThemeWrapper, ProviderContext, WidgetContext, WorkspaceContext |
|
|
109
|
+
| **Hooks** | `hooks/` | useDashboard, useMcpProvider, useWidgetProviders, useInstalledWidgets, useWidgetEvents, useRegistrySearch |
|
|
110
|
+
| **Models** | `Models/` | DashboardModel, LayoutModel, ThemeModel, ComponentConfigModel, SettingsModel, etc. |
|
|
111
|
+
| **Api** | `Api/` | DashboardApi, ElectronDashboardApi (typed), WidgetApi, ThemeApi, MockDashboardApi |
|
|
112
|
+
| **Components** | `Components/` | Dashboard, Layout, Settings, Navigation, Theme, Provider, Menu, Workspace |
|
|
113
|
+
| **Widget** | `Widget/` | Widget, WidgetFactory, ExternalWidget |
|
|
114
|
+
| **Utils** | `utils/` | widgetBundleLoader, layout, validation, mcpUtils, dragTypes, resolveIcon, themeGenerator, DynamicWidgetLoader, WidgetRegistry, plugin-loader |
|
|
115
115
|
|
|
116
116
|
### Electron Layer (`electron/`)
|
|
117
117
|
|
|
118
118
|
Main process controllers, APIs, and widget pipeline.
|
|
119
119
|
|
|
120
|
-
| Module
|
|
121
|
-
|
|
122
|
-
| **Controllers**
|
|
123
|
-
| **APIs**
|
|
124
|
-
| **Events**
|
|
125
|
-
| **Widget Pipeline** | `widgetRegistry.js`, `widgetCompiler.js`, `dynamicWidgetLoader.js` | Install, compile (esbuild), and load external widgets
|
|
126
|
-
| **MCP**
|
|
120
|
+
| Module | Key Files | Purpose |
|
|
121
|
+
| ------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
122
|
+
| **Controllers** | `controller/` | providerController, mcpController, workspaceController, themeController, settingsController, layoutController, dataController, registryController, secureStoreController, dialogController, algoliaController, openaiController, menuItemsController, pluginController |
|
|
123
|
+
| **APIs** | `api/` | IPC handlers for each controller + `mainApi.js` (createMainApi factory) |
|
|
124
|
+
| **Events** | `events/` | Event channel definitions for each module |
|
|
125
|
+
| **Widget Pipeline** | `widgetRegistry.js`, `widgetCompiler.js`, `dynamicWidgetLoader.js` | Install, compile (esbuild), and load external widgets |
|
|
126
|
+
| **MCP** | `mcp/mcpServerCatalog.json` | MCP server definitions (transport, command, args, env mapping) |
|
|
127
127
|
|
|
128
128
|
### Directory Structure
|
|
129
129
|
|
|
@@ -187,7 +187,7 @@ Template apps use `createMainApi(extensions)` to combine core APIs with custom o
|
|
|
187
187
|
const { createMainApi } = require("@trops/dash-core/electron");
|
|
188
188
|
|
|
189
189
|
const api = createMainApi({
|
|
190
|
-
|
|
190
|
+
myCustomApi: require("./myCustomApi"),
|
|
191
191
|
});
|
|
192
192
|
```
|
|
193
193
|
|
|
@@ -236,25 +236,25 @@ import { ThemeContext } from "./Context/ThemeContext";
|
|
|
236
236
|
|
|
237
237
|
## Key Files
|
|
238
238
|
|
|
239
|
-
| File
|
|
240
|
-
|
|
241
|
-
| `src/index.js`
|
|
242
|
-
| `electron/index.js`
|
|
243
|
-
| `electron/api/mainApi.js`
|
|
244
|
-
| `src/ComponentManager.js`
|
|
245
|
-
| `src/Context/ThemeWrapper.js`
|
|
246
|
-
| `src/Context/DashboardWrapper.js`
|
|
247
|
-
| `src/hooks/useMcpProvider.js`
|
|
248
|
-
| `src/hooks/useWidgetProviders.js`
|
|
249
|
-
| `src/hooks/useInstalledWidgets.js`
|
|
250
|
-
| `src/utils/widgetBundleLoader.js`
|
|
251
|
-
| `src/Models/LayoutModel.js`
|
|
252
|
-
| `src/Models/ComponentConfigModel.js`
|
|
253
|
-
| `electron/controller/providerController.js` | Provider CRUD + encryption
|
|
254
|
-
| `electron/controller/mcpController.js`
|
|
255
|
-
| `electron/widgetRegistry.js`
|
|
256
|
-
| `electron/widgetCompiler.js`
|
|
257
|
-
| `electron/mcp/mcpServerCatalog.json`
|
|
239
|
+
| File | Purpose |
|
|
240
|
+
| ------------------------------------------- | ------------------------------------------------------------ |
|
|
241
|
+
| `src/index.js` | Main renderer export + auto-registration |
|
|
242
|
+
| `electron/index.js` | Main electron export |
|
|
243
|
+
| `electron/api/mainApi.js` | `createMainApi(extensions)` factory |
|
|
244
|
+
| `src/ComponentManager.js` | Widget registration system |
|
|
245
|
+
| `src/Context/ThemeWrapper.js` | Theme provider (imports ThemeContext from @trops/dash-react) |
|
|
246
|
+
| `src/Context/DashboardWrapper.js` | Dashboard context + provider passing |
|
|
247
|
+
| `src/hooks/useMcpProvider.js` | MCP server connection and tool calling |
|
|
248
|
+
| `src/hooks/useWidgetProviders.js` | Widget provider resolution |
|
|
249
|
+
| `src/hooks/useInstalledWidgets.js` | Merges builtin + installed widgets |
|
|
250
|
+
| `src/utils/widgetBundleLoader.js` | CJS bundle evaluation in renderer |
|
|
251
|
+
| `src/Models/LayoutModel.js` | Layout processing, refreshes events from ComponentManager |
|
|
252
|
+
| `src/Models/ComponentConfigModel.js` | Normalizes widget config with defaults |
|
|
253
|
+
| `electron/controller/providerController.js` | Provider CRUD + encryption |
|
|
254
|
+
| `electron/controller/mcpController.js` | MCP server spawn/stop/call |
|
|
255
|
+
| `electron/widgetRegistry.js` | Widget install/uninstall persistence |
|
|
256
|
+
| `electron/widgetCompiler.js` | esbuild compilation pipeline |
|
|
257
|
+
| `electron/mcp/mcpServerCatalog.json` | MCP server definitions |
|
|
258
258
|
|
|
259
259
|
## Documentation
|
|
260
260
|
|
|
@@ -271,10 +271,10 @@ See [docs/INDEX.md](docs/INDEX.md) for the full documentation index:
|
|
|
271
271
|
|
|
272
272
|
## Related Packages
|
|
273
273
|
|
|
274
|
-
| Package
|
|
275
|
-
|
|
276
|
-
| `@trops/dash-react` | UI component library
|
|
277
|
-
| `dash-electron`
|
|
274
|
+
| Package | Purpose | Location |
|
|
275
|
+
| ------------------- | --------------------- | ------------------------------------------------------- |
|
|
276
|
+
| `@trops/dash-react` | UI component library | [dash-react](https://github.com/trops/dash-react) |
|
|
277
|
+
| `dash-electron` | Electron app template | [dash-electron](https://github.com/trops/dash-electron) |
|
|
278
278
|
|
|
279
279
|
## Development
|
|
280
280
|
|
|
@@ -307,11 +307,13 @@ A build that exits 0 but produces incomplete output is a silent failure.
|
|
|
307
307
|
### Rollup Configuration
|
|
308
308
|
|
|
309
309
|
**Renderer** (`rollup.config.renderer.mjs`):
|
|
310
|
+
|
|
310
311
|
- Input: `src/index.js`
|
|
311
312
|
- Output: CJS (`dist/index.js`) + ESM (`dist/index.esm.js`)
|
|
312
313
|
- Externals: react, react-dom, @trops/dash-react, @fortawesome/\*, @babel/runtime
|
|
313
314
|
|
|
314
315
|
**Electron** (`rollup.config.electron.mjs`):
|
|
316
|
+
|
|
315
317
|
- Input: `electron/index.js`
|
|
316
318
|
- Output: CJS only (`dist/electron/index.js`)
|
|
317
319
|
- Externals: electron, Node builtins, esbuild, @anthropic-ai/sdk, @modelcontextprotocol/sdk, algoliasearch, openai, etc.
|