@umengfe/mcp-server-chart 0.0.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/LICENSE +21 -0
- package/README.md +273 -0
- package/build/charts/area.d.ts +51 -0
- package/build/charts/area.js +52 -0
- package/build/charts/bar.d.ts +49 -0
- package/build/charts/bar.js +53 -0
- package/build/charts/base.d.ts +34 -0
- package/build/charts/base.js +74 -0
- package/build/charts/boxplot.d.ts +47 -0
- package/build/charts/boxplot.js +45 -0
- package/build/charts/column.d.ts +49 -0
- package/build/charts/column.js +53 -0
- package/build/charts/district-map.d.ts +93 -0
- package/build/charts/district-map.js +85 -0
- package/build/charts/dual-axes.d.ts +47 -0
- package/build/charts/dual-axes.js +54 -0
- package/build/charts/fishbone-diagram.d.ts +28 -0
- package/build/charts/fishbone-diagram.js +55 -0
- package/build/charts/flow-diagram.d.ts +91 -0
- package/build/charts/flow-diagram.js +41 -0
- package/build/charts/funnel.d.ts +42 -0
- package/build/charts/funnel.js +37 -0
- package/build/charts/histogram.d.ts +36 -0
- package/build/charts/histogram.js +41 -0
- package/build/charts/index.d.ts +28 -0
- package/build/charts/index.js +56 -0
- package/build/charts/line.d.ts +50 -0
- package/build/charts/line.js +47 -0
- package/build/charts/liquid.d.ts +34 -0
- package/build/charts/liquid.js +42 -0
- package/build/charts/mind-map.d.ts +26 -0
- package/build/charts/mind-map.js +39 -0
- package/build/charts/network-graph.d.ts +91 -0
- package/build/charts/network-graph.js +41 -0
- package/build/charts/organization-chart.d.ts +114 -0
- package/build/charts/organization-chart.js +56 -0
- package/build/charts/path-map.d.ts +25 -0
- package/build/charts/path-map.js +25 -0
- package/build/charts/pie.d.ts +43 -0
- package/build/charts/pie.js +44 -0
- package/build/charts/pin-map.d.ts +35 -0
- package/build/charts/pin-map.js +34 -0
- package/build/charts/radar.d.ts +48 -0
- package/build/charts/radar.js +45 -0
- package/build/charts/sankey.d.ts +46 -0
- package/build/charts/sankey.js +43 -0
- package/build/charts/scatter.d.ts +47 -0
- package/build/charts/scatter.js +43 -0
- package/build/charts/treemap.d.ts +86 -0
- package/build/charts/treemap.js +55 -0
- package/build/charts/venn.d.ts +45 -0
- package/build/charts/venn.js +45 -0
- package/build/charts/violin.d.ts +47 -0
- package/build/charts/violin.js +45 -0
- package/build/charts/word-cloud.d.ts +42 -0
- package/build/charts/word-cloud.js +40 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +73 -0
- package/build/sdk.d.ts +6 -0
- package/build/sdk.js +24 -0
- package/build/server.d.ts +17 -0
- package/build/server.js +132 -0
- package/build/services/index.d.ts +3 -0
- package/build/services/index.js +9 -0
- package/build/services/sse.d.ts +2 -0
- package/build/services/sse.js +58 -0
- package/build/services/stdio.d.ts +2 -0
- package/build/services/stdio.js +21 -0
- package/build/services/streamable.d.ts +2 -0
- package/build/services/streamable.js +58 -0
- package/build/utils/callTool.d.ts +18 -0
- package/build/utils/callTool.js +130 -0
- package/build/utils/env.d.ts +12 -0
- package/build/utils/env.js +32 -0
- package/build/utils/generate.d.ts +25 -0
- package/build/utils/generate.js +68 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.js +9 -0
- package/build/utils/logger.d.ts +28 -0
- package/build/utils/logger.js +57 -0
- package/build/utils/schema.d.ts +7 -0
- package/build/utils/schema.js +14 -0
- package/build/utils/validator.d.ts +34 -0
- package/build/utils/validator.js +76 -0
- package/package.json +65 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const funnel: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
category: z.ZodString;
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
value: number;
|
|
9
|
+
category: string;
|
|
10
|
+
}, {
|
|
11
|
+
value: number;
|
|
12
|
+
category: string;
|
|
13
|
+
}>, "atleastone">;
|
|
14
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
16
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
texture: "default" | "rough";
|
|
20
|
+
backgroundColor?: string | undefined;
|
|
21
|
+
palette?: string[] | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
backgroundColor?: string | undefined;
|
|
24
|
+
palette?: string[] | undefined;
|
|
25
|
+
texture?: "default" | "rough" | undefined;
|
|
26
|
+
}>>;
|
|
27
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
28
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
29
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
};
|
|
32
|
+
tool: {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
36
|
+
$schema?: string | undefined;
|
|
37
|
+
definitions?: {
|
|
38
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
39
|
+
} | undefined;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.funnel = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
const data = zod_1.z.object({
|
|
8
|
+
category: zod_1.z.string(),
|
|
9
|
+
value: zod_1.z.number(),
|
|
10
|
+
});
|
|
11
|
+
const schema = {
|
|
12
|
+
data: zod_1.z
|
|
13
|
+
.array(data)
|
|
14
|
+
.describe("Data for funnel chart, such as, [{ category: '浏览网站', value: 50000 }, { category: '放入购物车', value: 35000 }, { category: '生成订单', value: 25000 }, { category: '支付订单', value: 15000 }, { category: '完成交易', value: 8000 }].")
|
|
15
|
+
.nonempty({ message: "Funnel chart data cannot be empty." }),
|
|
16
|
+
style: zod_1.z
|
|
17
|
+
.object({
|
|
18
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
19
|
+
palette: base_1.PaletteSchema,
|
|
20
|
+
texture: base_1.TextureSchema,
|
|
21
|
+
})
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
24
|
+
theme: base_1.ThemeSchema,
|
|
25
|
+
width: base_1.WidthSchema,
|
|
26
|
+
height: base_1.HeightSchema,
|
|
27
|
+
title: base_1.TitleSchema,
|
|
28
|
+
};
|
|
29
|
+
const tool = {
|
|
30
|
+
name: "generate_funnel_chart",
|
|
31
|
+
description: "Generate a funnel chart to visualize the progressive reduction of data as it passes through stages, such as, the conversion rates of users from visiting a website to completing a purchase.",
|
|
32
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
33
|
+
};
|
|
34
|
+
exports.funnel = {
|
|
35
|
+
schema,
|
|
36
|
+
tool,
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const histogram: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodNumber, "atleastone">;
|
|
5
|
+
binNumber: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
texture: "default" | "rough";
|
|
12
|
+
backgroundColor?: string | undefined;
|
|
13
|
+
palette?: string[] | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
backgroundColor?: string | undefined;
|
|
16
|
+
palette?: string[] | undefined;
|
|
17
|
+
texture?: "default" | "rough" | undefined;
|
|
18
|
+
}>>;
|
|
19
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
20
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
22
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
};
|
|
26
|
+
tool: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
30
|
+
$schema?: string | undefined;
|
|
31
|
+
definitions?: {
|
|
32
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
33
|
+
} | undefined;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.histogram = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Histogram chart input schema
|
|
8
|
+
const schema = {
|
|
9
|
+
data: zod_1.z
|
|
10
|
+
.array(zod_1.z.number())
|
|
11
|
+
.describe("Data for histogram chart, it should be an array of numbers, such as, [78, 88, 60, 100, 95].")
|
|
12
|
+
.nonempty({ message: "Histogram chart data cannot be empty." }),
|
|
13
|
+
binNumber: zod_1.z
|
|
14
|
+
.number()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Number of intervals to define the number of intervals in a histogram, when not specified, a built-in value will be used."),
|
|
17
|
+
style: zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
20
|
+
palette: base_1.PaletteSchema,
|
|
21
|
+
texture: base_1.TextureSchema,
|
|
22
|
+
})
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
25
|
+
theme: base_1.ThemeSchema,
|
|
26
|
+
width: base_1.WidthSchema,
|
|
27
|
+
height: base_1.HeightSchema,
|
|
28
|
+
title: base_1.TitleSchema,
|
|
29
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
30
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
31
|
+
};
|
|
32
|
+
// Histogram chart tool descriptor
|
|
33
|
+
const tool = {
|
|
34
|
+
name: "generate_histogram_chart",
|
|
35
|
+
description: "Generate a histogram chart to show the frequency of data points within a certain range. It can observe data distribution, such as, normal and skewed distributions, and identify data concentration areas and extreme points.",
|
|
36
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
37
|
+
};
|
|
38
|
+
exports.histogram = {
|
|
39
|
+
schema,
|
|
40
|
+
tool,
|
|
41
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* export all charts as named exports to match the chart type
|
|
3
|
+
*/
|
|
4
|
+
export { area } from "./area";
|
|
5
|
+
export { bar } from "./bar";
|
|
6
|
+
export { boxplot } from "./boxplot";
|
|
7
|
+
export { column } from "./column";
|
|
8
|
+
export { districtMap as "district-map" } from "./district-map";
|
|
9
|
+
export { dualAxes as "dual-axes" } from "./dual-axes";
|
|
10
|
+
export { fishboneDiagram as "fishbone-diagram" } from "./fishbone-diagram";
|
|
11
|
+
export { flowDiagram as "flow-diagram" } from "./flow-diagram";
|
|
12
|
+
export { funnel } from "./funnel";
|
|
13
|
+
export { histogram } from "./histogram";
|
|
14
|
+
export { line } from "./line";
|
|
15
|
+
export { liquid } from "./liquid";
|
|
16
|
+
export { mindMap as "mind-map" } from "./mind-map";
|
|
17
|
+
export { networkGraph as "network-graph" } from "./network-graph";
|
|
18
|
+
export { organizationChart as "organization-chart" } from "./organization-chart";
|
|
19
|
+
export { pathMap as "path-map" } from "./path-map";
|
|
20
|
+
export { pie } from "./pie";
|
|
21
|
+
export { pinMap as "pin-map" } from "./pin-map";
|
|
22
|
+
export { radar } from "./radar";
|
|
23
|
+
export { sankey } from "./sankey";
|
|
24
|
+
export { scatter } from "./scatter";
|
|
25
|
+
export { treemap } from "./treemap";
|
|
26
|
+
export { venn } from "./venn";
|
|
27
|
+
export { violin } from "./violin";
|
|
28
|
+
export { wordCloud as "word-cloud" } from "./word-cloud";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports["word-cloud"] = exports.violin = exports.venn = exports.treemap = exports.scatter = exports.sankey = exports.radar = exports["pin-map"] = exports.pie = exports["path-map"] = exports["organization-chart"] = exports["network-graph"] = exports["mind-map"] = exports.liquid = exports.line = exports.histogram = exports.funnel = exports["flow-diagram"] = exports["fishbone-diagram"] = exports["dual-axes"] = exports["district-map"] = exports.column = exports.boxplot = exports.bar = exports.area = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* export all charts as named exports to match the chart type
|
|
6
|
+
*/
|
|
7
|
+
var area_1 = require("./area.js");
|
|
8
|
+
Object.defineProperty(exports, "area", { enumerable: true, get: function () { return area_1.area; } });
|
|
9
|
+
var bar_1 = require("./bar.js");
|
|
10
|
+
Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.bar; } });
|
|
11
|
+
var boxplot_1 = require("./boxplot.js");
|
|
12
|
+
Object.defineProperty(exports, "boxplot", { enumerable: true, get: function () { return boxplot_1.boxplot; } });
|
|
13
|
+
var column_1 = require("./column.js");
|
|
14
|
+
Object.defineProperty(exports, "column", { enumerable: true, get: function () { return column_1.column; } });
|
|
15
|
+
var district_map_1 = require("./district-map.js");
|
|
16
|
+
Object.defineProperty(exports, "district-map", { enumerable: true, get: function () { return district_map_1.districtMap; } });
|
|
17
|
+
var dual_axes_1 = require("./dual-axes.js");
|
|
18
|
+
Object.defineProperty(exports, "dual-axes", { enumerable: true, get: function () { return dual_axes_1.dualAxes; } });
|
|
19
|
+
var fishbone_diagram_1 = require("./fishbone-diagram.js");
|
|
20
|
+
Object.defineProperty(exports, "fishbone-diagram", { enumerable: true, get: function () { return fishbone_diagram_1.fishboneDiagram; } });
|
|
21
|
+
var flow_diagram_1 = require("./flow-diagram.js");
|
|
22
|
+
Object.defineProperty(exports, "flow-diagram", { enumerable: true, get: function () { return flow_diagram_1.flowDiagram; } });
|
|
23
|
+
var funnel_1 = require("./funnel.js");
|
|
24
|
+
Object.defineProperty(exports, "funnel", { enumerable: true, get: function () { return funnel_1.funnel; } });
|
|
25
|
+
var histogram_1 = require("./histogram.js");
|
|
26
|
+
Object.defineProperty(exports, "histogram", { enumerable: true, get: function () { return histogram_1.histogram; } });
|
|
27
|
+
var line_1 = require("./line.js");
|
|
28
|
+
Object.defineProperty(exports, "line", { enumerable: true, get: function () { return line_1.line; } });
|
|
29
|
+
var liquid_1 = require("./liquid.js");
|
|
30
|
+
Object.defineProperty(exports, "liquid", { enumerable: true, get: function () { return liquid_1.liquid; } });
|
|
31
|
+
var mind_map_1 = require("./mind-map.js");
|
|
32
|
+
Object.defineProperty(exports, "mind-map", { enumerable: true, get: function () { return mind_map_1.mindMap; } });
|
|
33
|
+
var network_graph_1 = require("./network-graph.js");
|
|
34
|
+
Object.defineProperty(exports, "network-graph", { enumerable: true, get: function () { return network_graph_1.networkGraph; } });
|
|
35
|
+
var organization_chart_1 = require("./organization-chart.js");
|
|
36
|
+
Object.defineProperty(exports, "organization-chart", { enumerable: true, get: function () { return organization_chart_1.organizationChart; } });
|
|
37
|
+
var path_map_1 = require("./path-map.js");
|
|
38
|
+
Object.defineProperty(exports, "path-map", { enumerable: true, get: function () { return path_map_1.pathMap; } });
|
|
39
|
+
var pie_1 = require("./pie.js");
|
|
40
|
+
Object.defineProperty(exports, "pie", { enumerable: true, get: function () { return pie_1.pie; } });
|
|
41
|
+
var pin_map_1 = require("./pin-map.js");
|
|
42
|
+
Object.defineProperty(exports, "pin-map", { enumerable: true, get: function () { return pin_map_1.pinMap; } });
|
|
43
|
+
var radar_1 = require("./radar.js");
|
|
44
|
+
Object.defineProperty(exports, "radar", { enumerable: true, get: function () { return radar_1.radar; } });
|
|
45
|
+
var sankey_1 = require("./sankey.js");
|
|
46
|
+
Object.defineProperty(exports, "sankey", { enumerable: true, get: function () { return sankey_1.sankey; } });
|
|
47
|
+
var scatter_1 = require("./scatter.js");
|
|
48
|
+
Object.defineProperty(exports, "scatter", { enumerable: true, get: function () { return scatter_1.scatter; } });
|
|
49
|
+
var treemap_1 = require("./treemap.js");
|
|
50
|
+
Object.defineProperty(exports, "treemap", { enumerable: true, get: function () { return treemap_1.treemap; } });
|
|
51
|
+
var venn_1 = require("./venn.js");
|
|
52
|
+
Object.defineProperty(exports, "venn", { enumerable: true, get: function () { return venn_1.venn; } });
|
|
53
|
+
var violin_1 = require("./violin.js");
|
|
54
|
+
Object.defineProperty(exports, "violin", { enumerable: true, get: function () { return violin_1.violin; } });
|
|
55
|
+
var word_cloud_1 = require("./word-cloud.js");
|
|
56
|
+
Object.defineProperty(exports, "word-cloud", { enumerable: true, get: function () { return word_cloud_1.wordCloud; } });
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const line: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
time: z.ZodString;
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
group: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
time: string;
|
|
10
|
+
value: number;
|
|
11
|
+
group?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
time: string;
|
|
14
|
+
value: number;
|
|
15
|
+
group?: string | undefined;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
19
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
20
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
texture: "default" | "rough";
|
|
24
|
+
backgroundColor?: string | undefined;
|
|
25
|
+
palette?: string[] | undefined;
|
|
26
|
+
lineWidth?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
backgroundColor?: string | undefined;
|
|
29
|
+
palette?: string[] | undefined;
|
|
30
|
+
texture?: "default" | "rough" | undefined;
|
|
31
|
+
lineWidth?: number | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
34
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
39
|
+
};
|
|
40
|
+
tool: {
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
44
|
+
$schema?: string | undefined;
|
|
45
|
+
definitions?: {
|
|
46
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
47
|
+
} | undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.line = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Line chart data schema
|
|
8
|
+
const data = zod_1.z.object({
|
|
9
|
+
time: zod_1.z.string(),
|
|
10
|
+
value: zod_1.z.number(),
|
|
11
|
+
group: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
// Line chart input schema
|
|
14
|
+
const schema = {
|
|
15
|
+
data: zod_1.z
|
|
16
|
+
.array(data)
|
|
17
|
+
.describe("Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }].")
|
|
18
|
+
.nonempty({ message: "Line chart data cannot be empty." }),
|
|
19
|
+
style: zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
texture: base_1.TextureSchema,
|
|
22
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
23
|
+
palette: base_1.PaletteSchema,
|
|
24
|
+
lineWidth: zod_1.z
|
|
25
|
+
.number()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Line width for the lines of chart, such as 4."),
|
|
28
|
+
})
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
31
|
+
theme: base_1.ThemeSchema,
|
|
32
|
+
width: base_1.WidthSchema,
|
|
33
|
+
height: base_1.HeightSchema,
|
|
34
|
+
title: base_1.TitleSchema,
|
|
35
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
36
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
37
|
+
};
|
|
38
|
+
// Line chart tool descriptor
|
|
39
|
+
const tool = {
|
|
40
|
+
name: "generate_line_chart",
|
|
41
|
+
description: "Generate a line chart to show trends over time, such as, the ratio of Apple computer sales to Apple's profits changed from 2000 to 2016.",
|
|
42
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
43
|
+
};
|
|
44
|
+
exports.line = {
|
|
45
|
+
schema,
|
|
46
|
+
tool,
|
|
47
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const liquid: {
|
|
3
|
+
schema: {
|
|
4
|
+
percent: z.ZodNumber;
|
|
5
|
+
shape: z.ZodDefault<z.ZodOptional<z.ZodEnum<["circle", "rect", "pin", "triangle"]>>>;
|
|
6
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
9
|
+
color: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
texture: "default" | "rough";
|
|
12
|
+
backgroundColor?: string | undefined;
|
|
13
|
+
color?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
backgroundColor?: string | undefined;
|
|
16
|
+
texture?: "default" | "rough" | undefined;
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
}>>;
|
|
19
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
20
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
22
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
};
|
|
24
|
+
tool: {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
28
|
+
$schema?: string | undefined;
|
|
29
|
+
definitions?: {
|
|
30
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.liquid = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
const schema = {
|
|
8
|
+
percent: zod_1.z
|
|
9
|
+
.number()
|
|
10
|
+
.describe("The percentage value to display in the liquid chart, should be a number between 0 and 1, where 1 represents 100%. For example, 0.75 represents 75%.")
|
|
11
|
+
.min(0, { message: "Value must be at least 0." })
|
|
12
|
+
.max(1, { message: "Value must be at most 1." }),
|
|
13
|
+
shape: zod_1.z
|
|
14
|
+
.enum(["circle", "rect", "pin", "triangle"])
|
|
15
|
+
.optional()
|
|
16
|
+
.default("circle")
|
|
17
|
+
.describe("The shape of the liquid chart, can be 'circle', 'rect', 'pin', or 'triangle'. Default is 'circle'."),
|
|
18
|
+
style: zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
21
|
+
texture: base_1.TextureSchema,
|
|
22
|
+
color: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Custom color for the liquid chart, if not specified, defaults to the theme color."),
|
|
26
|
+
})
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
29
|
+
theme: base_1.ThemeSchema,
|
|
30
|
+
width: base_1.WidthSchema,
|
|
31
|
+
height: base_1.HeightSchema,
|
|
32
|
+
title: base_1.TitleSchema,
|
|
33
|
+
};
|
|
34
|
+
const tool = {
|
|
35
|
+
name: "generate_liquid_chart",
|
|
36
|
+
description: "Generate a liquid chart to visualize a single value as a percentage, such as, the current occupancy rate of a reservoir or the completion percentage of a project.",
|
|
37
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
38
|
+
};
|
|
39
|
+
exports.liquid = {
|
|
40
|
+
schema,
|
|
41
|
+
tool,
|
|
42
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const mindMap: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodEffects<z.ZodType<import("../utils/validator").TreeDataType, z.ZodTypeDef, import("../utils/validator").TreeDataType>, import("../utils/validator").TreeDataType, import("../utils/validator").TreeDataType>;
|
|
5
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
texture: "default" | "rough";
|
|
9
|
+
}, {
|
|
10
|
+
texture?: "default" | "rough" | undefined;
|
|
11
|
+
}>>;
|
|
12
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
13
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
14
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
15
|
+
};
|
|
16
|
+
tool: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
20
|
+
$schema?: string | undefined;
|
|
21
|
+
definitions?: {
|
|
22
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
23
|
+
} | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mindMap = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const validator_1 = require("../utils/validator.js");
|
|
7
|
+
const base_1 = require("./base.js");
|
|
8
|
+
const fishbone_diagram_1 = require("./fishbone-diagram.js");
|
|
9
|
+
// Mind map node schema
|
|
10
|
+
// The recursive schema is not supported by gemini, and other clients, so we use a non-recursive schema which can represent a tree structure with a fixed depth.
|
|
11
|
+
// Ref: https://github.com/antvis/mcp-server-chart/issues/155
|
|
12
|
+
// Ref: https://github.com/antvis/mcp-server-chart/issues/132
|
|
13
|
+
const MindMapNodeSchema = fishbone_diagram_1.FishboneNodeSchema;
|
|
14
|
+
// Mind map chart input schema
|
|
15
|
+
const schema = {
|
|
16
|
+
data: MindMapNodeSchema.describe("Data for mind map chart which is a hierarchical structure, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name:'subtopic 1-1' }] }, and the maximum depth is 3.").refine(validator_1.validatedTreeDataSchema, {
|
|
17
|
+
message: "Invalid parameters: node name is not unique.",
|
|
18
|
+
path: ["data"],
|
|
19
|
+
}),
|
|
20
|
+
style: zod_1.z
|
|
21
|
+
.object({
|
|
22
|
+
texture: base_1.TextureSchema,
|
|
23
|
+
})
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
26
|
+
theme: base_1.ThemeSchema,
|
|
27
|
+
width: base_1.WidthSchema,
|
|
28
|
+
height: base_1.HeightSchema,
|
|
29
|
+
};
|
|
30
|
+
// Mind map chart tool descriptor
|
|
31
|
+
const tool = {
|
|
32
|
+
name: "generate_mind_map",
|
|
33
|
+
description: "Generate a mind map chart to organizes and presents information in a hierarchical structure with branches radiating from a central topic, such as, a diagram showing the relationship between a main topic and its subtopics.",
|
|
34
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
35
|
+
};
|
|
36
|
+
exports.mindMap = {
|
|
37
|
+
schema,
|
|
38
|
+
tool,
|
|
39
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const networkGraph: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name: string;
|
|
9
|
+
}, {
|
|
10
|
+
name: string;
|
|
11
|
+
}>, "atleastone">;
|
|
12
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
target: z.ZodString;
|
|
15
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
target: string;
|
|
19
|
+
source: string;
|
|
20
|
+
}, {
|
|
21
|
+
target: string;
|
|
22
|
+
source: string;
|
|
23
|
+
name?: string | undefined;
|
|
24
|
+
}>, "many">;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
nodes: [{
|
|
27
|
+
name: string;
|
|
28
|
+
}, ...{
|
|
29
|
+
name: string;
|
|
30
|
+
}[]];
|
|
31
|
+
edges: {
|
|
32
|
+
name: string;
|
|
33
|
+
target: string;
|
|
34
|
+
source: string;
|
|
35
|
+
}[];
|
|
36
|
+
}, {
|
|
37
|
+
nodes: [{
|
|
38
|
+
name: string;
|
|
39
|
+
}, ...{
|
|
40
|
+
name: string;
|
|
41
|
+
}[]];
|
|
42
|
+
edges: {
|
|
43
|
+
target: string;
|
|
44
|
+
source: string;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
}[];
|
|
47
|
+
}>, {
|
|
48
|
+
nodes: [{
|
|
49
|
+
name: string;
|
|
50
|
+
}, ...{
|
|
51
|
+
name: string;
|
|
52
|
+
}[]];
|
|
53
|
+
edges: {
|
|
54
|
+
name: string;
|
|
55
|
+
target: string;
|
|
56
|
+
source: string;
|
|
57
|
+
}[];
|
|
58
|
+
}, {
|
|
59
|
+
nodes: [{
|
|
60
|
+
name: string;
|
|
61
|
+
}, ...{
|
|
62
|
+
name: string;
|
|
63
|
+
}[]];
|
|
64
|
+
edges: {
|
|
65
|
+
target: string;
|
|
66
|
+
source: string;
|
|
67
|
+
name?: string | undefined;
|
|
68
|
+
}[];
|
|
69
|
+
}>;
|
|
70
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
texture: "default" | "rough";
|
|
74
|
+
}, {
|
|
75
|
+
texture?: "default" | "rough" | undefined;
|
|
76
|
+
}>>;
|
|
77
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
|
|
78
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
79
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
80
|
+
};
|
|
81
|
+
tool: {
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
85
|
+
$schema?: string | undefined;
|
|
86
|
+
definitions?: {
|
|
87
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
88
|
+
} | undefined;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkGraph = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const validator_1 = require("../utils/validator.js");
|
|
7
|
+
const base_1 = require("./base.js");
|
|
8
|
+
// Network graph input schema
|
|
9
|
+
const schema = {
|
|
10
|
+
data: zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
nodes: zod_1.z
|
|
13
|
+
.array(base_1.NodeSchema)
|
|
14
|
+
.nonempty({ message: "At least one node is required." }),
|
|
15
|
+
edges: zod_1.z.array(base_1.EdgeSchema),
|
|
16
|
+
})
|
|
17
|
+
.describe("Data for network graph chart, such as, { nodes: [{ name: 'node1' }, { name: 'node2' }], edges: [{ source: 'node1', target: 'node2', name: 'edge1' }] }")
|
|
18
|
+
.refine(validator_1.validatedNodeEdgeDataSchema, {
|
|
19
|
+
message: "Invalid parameters",
|
|
20
|
+
path: ["data", "edges"],
|
|
21
|
+
}),
|
|
22
|
+
style: zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
texture: base_1.TextureSchema,
|
|
25
|
+
})
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
28
|
+
theme: base_1.ThemeSchema,
|
|
29
|
+
width: base_1.WidthSchema,
|
|
30
|
+
height: base_1.HeightSchema,
|
|
31
|
+
};
|
|
32
|
+
// Network graph tool descriptor
|
|
33
|
+
const tool = {
|
|
34
|
+
name: "generate_network_graph",
|
|
35
|
+
description: "Generate a network graph chart to show relationships (edges) between entities (nodes), such as, relationships between people in social networks.",
|
|
36
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
37
|
+
};
|
|
38
|
+
exports.networkGraph = {
|
|
39
|
+
schema,
|
|
40
|
+
tool,
|
|
41
|
+
};
|