@frontmcp/plugin-dashboard 0.0.1 → 0.7.1
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/app/dashboard.app.d.ts +45 -0
- package/app/dashboard.app.d.ts.map +1 -0
- package/app/index.d.ts +2 -0
- package/app/index.d.ts.map +1 -0
- package/dashboard.plugin.d.ts +65 -0
- package/dashboard.plugin.d.ts.map +1 -0
- package/dashboard.symbol.d.ts +10 -0
- package/dashboard.symbol.d.ts.map +1 -0
- package/dashboard.types.d.ts +85 -0
- package/dashboard.types.d.ts.map +1 -0
- package/esm/index.mjs +1281 -0
- package/esm/package.json +53 -0
- package/html/html.generator.d.ts +10 -0
- package/html/html.generator.d.ts.map +1 -0
- package/html/index.d.ts +2 -0
- package/html/index.d.ts.map +1 -0
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +1309 -0
- package/package.json +2 -2
- package/providers/graph-data.provider.d.ts +59 -0
- package/providers/graph-data.provider.d.ts.map +1 -0
- package/providers/index.d.ts +2 -0
- package/providers/index.d.ts.map +1 -0
- package/shared/index.d.ts +2 -0
- package/shared/index.d.ts.map +1 -0
- package/shared/safe-regex.d.ts +9 -0
- package/shared/safe-regex.d.ts.map +1 -0
- package/shared/types.d.ts +170 -0
- package/shared/types.d.ts.map +1 -0
- package/tools/graph.tool.d.ts +18 -0
- package/tools/graph.tool.d.ts.map +1 -0
- package/tools/index.d.ts +4 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/list-resources.tool.d.ts +31 -0
- package/tools/list-resources.tool.d.ts.map +1 -0
- package/tools/list-tools.tool.d.ts +33 -0
- package/tools/list-tools.tool.d.ts.map +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DynamicPlugin, ProviderType } from '@frontmcp/sdk';
|
|
2
|
+
import { DashboardPluginOptions, DashboardPluginOptionsInput } from '../dashboard.types';
|
|
3
|
+
/**
|
|
4
|
+
* Internal Dashboard HTTP Plugin.
|
|
5
|
+
*
|
|
6
|
+
* Handles HTTP requests for serving the dashboard HTML.
|
|
7
|
+
* The SSE transport and MCP protocol are handled by FrontMCP's built-in transport layer.
|
|
8
|
+
*/
|
|
9
|
+
declare class DashboardHttpPlugin extends DynamicPlugin<DashboardPluginOptions, DashboardPluginOptionsInput> {
|
|
10
|
+
options: DashboardPluginOptions;
|
|
11
|
+
constructor(options?: DashboardPluginOptionsInput);
|
|
12
|
+
/**
|
|
13
|
+
* Provide the dashboard config and middleware registration via DI.
|
|
14
|
+
*/
|
|
15
|
+
static dynamicProviders(options: DashboardPluginOptionsInput): ProviderType[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* FrontMCP Dashboard App.
|
|
19
|
+
*
|
|
20
|
+
* A dashboard application that provides:
|
|
21
|
+
* - Server structure visualization via MCP tools
|
|
22
|
+
* - Real-time event streaming via SSE (built into FrontMCP)
|
|
23
|
+
* - Access to server scope for monitoring
|
|
24
|
+
*
|
|
25
|
+
* The dashboard UI is loaded from CDN (esm.sh by default) and connects
|
|
26
|
+
* to the dashboard via MCP protocol over SSE transport.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { DashboardApp } from '@frontmcp/plugins';
|
|
31
|
+
*
|
|
32
|
+
* @FrontMCP({
|
|
33
|
+
* name: 'my-server',
|
|
34
|
+
* apps: [DashboardApp],
|
|
35
|
+
* })
|
|
36
|
+
* class MyServer {}
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Then access the dashboard at `http://localhost:3000/dashboard`
|
|
40
|
+
* The dashboard connects via SSE at the standard `/sse` endpoint.
|
|
41
|
+
*/
|
|
42
|
+
export declare class DashboardApp {
|
|
43
|
+
}
|
|
44
|
+
export { DashboardHttpPlugin };
|
|
45
|
+
//# sourceMappingURL=dashboard.app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.app.d.ts","sourceRoot":"","sources":["../../src/app/dashboard.app.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EAMb,YAAY,EAGb,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAI5B,MAAM,oBAAoB,CAAC;AAmD5B;;;;;GAKG;AACH,cAIM,mBAAoB,SAAQ,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;IAClG,OAAO,EAAE,sBAAsB,CAAC;gBAEpB,OAAO,GAAE,2BAAgC;IAQrD;;OAEG;WACa,gBAAgB,CAAC,OAAO,EAAE,2BAA2B,GAAG,YAAY,EAAE;CAyBvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAgCa,YAAY;CAAG;AAG5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
package/app/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DynamicPlugin, ProviderType } from '@frontmcp/sdk';
|
|
2
|
+
import { DashboardPluginOptions, DashboardPluginOptionsInput } from './dashboard.types';
|
|
3
|
+
/**
|
|
4
|
+
* FrontMCP Dashboard Plugin.
|
|
5
|
+
*
|
|
6
|
+
* Adds a visual dashboard to your FrontMCP server for:
|
|
7
|
+
* - Viewing server structure (tools, resources, prompts, apps)
|
|
8
|
+
* - Real-time monitoring via MCP protocol
|
|
9
|
+
* - Graph-based visualization of your MCP architecture
|
|
10
|
+
*
|
|
11
|
+
* The dashboard UI is loaded from CDN (esm.sh by default) and connects
|
|
12
|
+
* to the dashboard via MCP protocol over SSE transport.
|
|
13
|
+
*
|
|
14
|
+
* @example Basic usage
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { DashboardPlugin } from '@frontmcp/plugins';
|
|
17
|
+
*
|
|
18
|
+
* @FrontMCP({
|
|
19
|
+
* name: 'my-server',
|
|
20
|
+
* plugins: [new DashboardPlugin()],
|
|
21
|
+
* })
|
|
22
|
+
* class MyServer {}
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example With authentication
|
|
26
|
+
* ```typescript
|
|
27
|
+
* @FrontMCP({
|
|
28
|
+
* name: 'my-server',
|
|
29
|
+
* plugins: [
|
|
30
|
+
* new DashboardPlugin({
|
|
31
|
+
* auth: { enabled: true, token: 'my-secret-token' },
|
|
32
|
+
* }),
|
|
33
|
+
* ],
|
|
34
|
+
* })
|
|
35
|
+
* class MyServer {}
|
|
36
|
+
*
|
|
37
|
+
* // Access: http://localhost:3000/dashboard?token=my-secret-token
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example With custom CDN entrypoint
|
|
41
|
+
* ```typescript
|
|
42
|
+
* @FrontMCP({
|
|
43
|
+
* name: 'my-server',
|
|
44
|
+
* plugins: [
|
|
45
|
+
* new DashboardPlugin({
|
|
46
|
+
* cdn: {
|
|
47
|
+
* entrypoint: 'https://cdn.example.com/dashboard-ui@1.0.0/index.js',
|
|
48
|
+
* },
|
|
49
|
+
* }),
|
|
50
|
+
* ],
|
|
51
|
+
* })
|
|
52
|
+
* class MyServer {}
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export default class DashboardPlugin extends DynamicPlugin<DashboardPluginOptions, DashboardPluginOptionsInput> {
|
|
56
|
+
options: DashboardPluginOptions;
|
|
57
|
+
constructor(options?: DashboardPluginOptionsInput);
|
|
58
|
+
/**
|
|
59
|
+
* Dynamic providers allow configuration of the dashboard with custom options.
|
|
60
|
+
* This injects the parsed options into the DI container so all dashboard
|
|
61
|
+
* components can access the configuration.
|
|
62
|
+
*/
|
|
63
|
+
static dynamicProviders(options: DashboardPluginOptionsInput): ProviderType[];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=dashboard.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.plugin.d.ts","sourceRoot":"","sources":["../src/dashboard.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,YAAY,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAG5B,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAMH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;IAC7G,OAAO,EAAE,sBAAsB,CAAC;gBAEpB,OAAO,GAAE,2BAAgC;IASrD;;;;OAIG;WACa,gBAAgB,CAAC,OAAO,EAAE,2BAA2B,GAAG,YAAY,EAAE;CAevF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency injection tokens for dashboard plugin.
|
|
3
|
+
*/
|
|
4
|
+
/** Token for dashboard configuration */
|
|
5
|
+
export declare const DashboardConfigToken: unique symbol;
|
|
6
|
+
/** Token for graph data provider */
|
|
7
|
+
export declare const GraphDataProviderToken: unique symbol;
|
|
8
|
+
/** Token for parent scope reference */
|
|
9
|
+
export declare const ParentScopeToken: unique symbol;
|
|
10
|
+
//# sourceMappingURL=dashboard.symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.symbol.d.ts","sourceRoot":"","sources":["../src/dashboard.symbol.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wCAAwC;AACxC,eAAO,MAAM,oBAAoB,eAA4B,CAAC;AAE9D,oCAAoC;AACpC,eAAO,MAAM,sBAAsB,eAA8B,CAAC;AAElE,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,eAAwB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* CDN configuration for loading dashboard UI from external sources.
|
|
4
|
+
*/
|
|
5
|
+
export declare const cdnConfigSchema: z.ZodObject<{
|
|
6
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
7
|
+
react: z.ZodDefault<z.ZodString>;
|
|
8
|
+
reactDom: z.ZodDefault<z.ZodString>;
|
|
9
|
+
reactDomClient: z.ZodDefault<z.ZodString>;
|
|
10
|
+
reactJsxRuntime: z.ZodDefault<z.ZodString>;
|
|
11
|
+
reactRouter: z.ZodDefault<z.ZodString>;
|
|
12
|
+
xyflow: z.ZodDefault<z.ZodString>;
|
|
13
|
+
dagre: z.ZodDefault<z.ZodString>;
|
|
14
|
+
xyflowCss: z.ZodDefault<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/** CDN config type */
|
|
17
|
+
export type CdnConfig = z.output<typeof cdnConfigSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Authentication configuration for dashboard access.
|
|
20
|
+
*/
|
|
21
|
+
export declare const dashboardAuthSchema: z.ZodObject<{
|
|
22
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
token: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
/** Dashboard auth type */
|
|
26
|
+
export type DashboardAuth = z.output<typeof dashboardAuthSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Dashboard plugin options schema.
|
|
29
|
+
*/
|
|
30
|
+
export declare const dashboardPluginOptionsSchema: z.ZodObject<{
|
|
31
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
33
|
+
auth: z.ZodPipe<z.ZodOptional<z.ZodObject<{
|
|
34
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
token: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>, z.ZodTransform<{
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
token?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
token?: string | undefined;
|
|
42
|
+
} | undefined>>;
|
|
43
|
+
cdn: z.ZodPipe<z.ZodOptional<z.ZodObject<{
|
|
44
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
45
|
+
react: z.ZodDefault<z.ZodString>;
|
|
46
|
+
reactDom: z.ZodDefault<z.ZodString>;
|
|
47
|
+
reactDomClient: z.ZodDefault<z.ZodString>;
|
|
48
|
+
reactJsxRuntime: z.ZodDefault<z.ZodString>;
|
|
49
|
+
reactRouter: z.ZodDefault<z.ZodString>;
|
|
50
|
+
xyflow: z.ZodDefault<z.ZodString>;
|
|
51
|
+
dagre: z.ZodDefault<z.ZodString>;
|
|
52
|
+
xyflowCss: z.ZodDefault<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>, z.ZodTransform<{
|
|
54
|
+
react: string;
|
|
55
|
+
reactDom: string;
|
|
56
|
+
reactDomClient: string;
|
|
57
|
+
reactJsxRuntime: string;
|
|
58
|
+
reactRouter: string;
|
|
59
|
+
xyflow: string;
|
|
60
|
+
dagre: string;
|
|
61
|
+
xyflowCss: string;
|
|
62
|
+
entrypoint?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
react: string;
|
|
65
|
+
reactDom: string;
|
|
66
|
+
reactDomClient: string;
|
|
67
|
+
reactJsxRuntime: string;
|
|
68
|
+
reactRouter: string;
|
|
69
|
+
xyflow: string;
|
|
70
|
+
dagre: string;
|
|
71
|
+
xyflowCss: string;
|
|
72
|
+
entrypoint?: string | undefined;
|
|
73
|
+
} | undefined>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
/** Dashboard plugin options (parsed/validated) */
|
|
76
|
+
export type DashboardPluginOptions = z.output<typeof dashboardPluginOptionsSchema>;
|
|
77
|
+
/** Dashboard plugin options input (before validation) */
|
|
78
|
+
export type DashboardPluginOptionsInput = z.input<typeof dashboardPluginOptionsSchema>;
|
|
79
|
+
/** Default dashboard plugin options */
|
|
80
|
+
export declare const defaultDashboardPluginOptions: DashboardPluginOptionsInput;
|
|
81
|
+
/**
|
|
82
|
+
* Check if dashboard is enabled based on options and environment.
|
|
83
|
+
*/
|
|
84
|
+
export declare function isDashboardEnabled(options: DashboardPluginOptions): boolean;
|
|
85
|
+
//# sourceMappingURL=dashboard.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.types.d.ts","sourceRoot":"","sources":["../src/dashboard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;iBAmB1B,CAAC;AAEH,sBAAsB;AACtB,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;iBAK9B,CAAC;AAEH,0BAA0B;AAC1B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASvC,CAAC;AAEH,kDAAkD;AAClD,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEnF,yDAAyD;AACzD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEvF,uCAAuC;AACvC,eAAO,MAAM,6BAA6B,EAAE,2BAI3C,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAM3E"}
|