@standby/mcp-server-chart 0.9.10

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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +285 -0
  3. package/build/charts/area.d.ts +41 -0
  4. package/build/charts/area.js +56 -0
  5. package/build/charts/bar.d.ts +41 -0
  6. package/build/charts/bar.js +57 -0
  7. package/build/charts/base.d.ts +30 -0
  8. package/build/charts/base.js +79 -0
  9. package/build/charts/boxplot.d.ts +40 -0
  10. package/build/charts/boxplot.js +50 -0
  11. package/build/charts/column.d.ts +41 -0
  12. package/build/charts/column.js +57 -0
  13. package/build/charts/dual-axes.d.ts +43 -0
  14. package/build/charts/dual-axes.js +59 -0
  15. package/build/charts/fishbone-diagram.d.ts +32 -0
  16. package/build/charts/fishbone-diagram.js +59 -0
  17. package/build/charts/flow-diagram.d.ts +39 -0
  18. package/build/charts/flow-diagram.js +45 -0
  19. package/build/charts/funnel.d.ts +36 -0
  20. package/build/charts/funnel.js +41 -0
  21. package/build/charts/histogram.d.ts +36 -0
  22. package/build/charts/histogram.js +45 -0
  23. package/build/charts/index.d.ts +26 -0
  24. package/build/charts/index.js +52 -0
  25. package/build/charts/line.d.ts +41 -0
  26. package/build/charts/line.js +52 -0
  27. package/build/charts/liquid.d.ts +39 -0
  28. package/build/charts/liquid.js +46 -0
  29. package/build/charts/mind-map.d.ts +30 -0
  30. package/build/charts/mind-map.js +43 -0
  31. package/build/charts/network-graph.d.ts +39 -0
  32. package/build/charts/network-graph.js +45 -0
  33. package/build/charts/organization-chart.d.ts +49 -0
  34. package/build/charts/organization-chart.js +60 -0
  35. package/build/charts/pie.d.ts +37 -0
  36. package/build/charts/pie.js +48 -0
  37. package/build/charts/radar.d.ts +38 -0
  38. package/build/charts/radar.js +49 -0
  39. package/build/charts/sankey.d.ts +43 -0
  40. package/build/charts/sankey.js +47 -0
  41. package/build/charts/scatter.d.ts +39 -0
  42. package/build/charts/scatter.js +47 -0
  43. package/build/charts/treemap.d.ts +44 -0
  44. package/build/charts/treemap.js +59 -0
  45. package/build/charts/venn.d.ts +37 -0
  46. package/build/charts/venn.js +49 -0
  47. package/build/charts/violin.d.ts +40 -0
  48. package/build/charts/violin.js +50 -0
  49. package/build/charts/waterfall.d.ts +44 -0
  50. package/build/charts/waterfall.js +73 -0
  51. package/build/charts/word-cloud.d.ts +36 -0
  52. package/build/charts/word-cloud.js +44 -0
  53. package/build/index.d.ts +2 -0
  54. package/build/index.js +73 -0
  55. package/build/sdk.d.ts +6 -0
  56. package/build/sdk.js +24 -0
  57. package/build/server.d.ts +17 -0
  58. package/build/server.js +151 -0
  59. package/build/services/index.d.ts +3 -0
  60. package/build/services/index.js +9 -0
  61. package/build/services/sse.d.ts +2 -0
  62. package/build/services/sse.js +59 -0
  63. package/build/services/stdio.d.ts +2 -0
  64. package/build/services/stdio.js +21 -0
  65. package/build/services/streamable.d.ts +2 -0
  66. package/build/services/streamable.js +58 -0
  67. package/build/utils/callTool.d.ts +18 -0
  68. package/build/utils/callTool.js +129 -0
  69. package/build/utils/env.d.ts +12 -0
  70. package/build/utils/env.js +38 -0
  71. package/build/utils/generate.d.ts +4 -0
  72. package/build/utils/generate.js +35 -0
  73. package/build/utils/image-server.d.ts +18 -0
  74. package/build/utils/image-server.js +66 -0
  75. package/build/utils/index.d.ts +3 -0
  76. package/build/utils/index.js +9 -0
  77. package/build/utils/local-render.d.ts +17 -0
  78. package/build/utils/local-render.js +121 -0
  79. package/build/utils/logger.d.ts +28 -0
  80. package/build/utils/logger.js +57 -0
  81. package/build/utils/schema.d.ts +4 -0
  82. package/build/utils/schema.js +12 -0
  83. package/build/utils/spec-translator.d.ts +12 -0
  84. package/build/utils/spec-translator.js +515 -0
  85. package/build/utils/validator.d.ts +34 -0
  86. package/build/utils/validator.js +76 -0
  87. package/package.json +66 -0
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.radar = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Radar chart data schema
8
+ const data = zod_1.z.object({
9
+ name: zod_1.z.string(),
10
+ value: zod_1.z.number(),
11
+ group: zod_1.z.string().optional(),
12
+ });
13
+ // Radar chart input schema
14
+ const schema = {
15
+ data: zod_1.z
16
+ .array(data)
17
+ .describe("Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }], when the data is grouped by `group`, the `group` field is required, such as, [{ name: 'Design', value: 70, group: 'Huawei' }].")
18
+ .nonempty({ message: "Radar chart data cannot be empty." }),
19
+ style: zod_1.z
20
+ .object({
21
+ backgroundColor: base_1.BackgroundColorSchema,
22
+ palette: base_1.PaletteSchema,
23
+ texture: base_1.TextureSchema,
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
+ };
36
+ // Radar chart tool descriptor
37
+ const tool = {
38
+ name: "generate_radar_chart",
39
+ description: "Generate a radar chart to display multidimensional data (four dimensions or more), such as, evaluate Huawei and Apple phones in terms of five dimensions: ease of use, functionality, camera, benchmark scores, and battery life.",
40
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
41
+ annotations: {
42
+ title: "Generate Radar Chart",
43
+ readOnlyHint: true,
44
+ },
45
+ };
46
+ exports.radar = {
47
+ schema,
48
+ tool,
49
+ };
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const sankey: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ source: z.ZodString;
6
+ target: z.ZodString;
7
+ value: z.ZodNumber;
8
+ }, z.core.$strip>>;
9
+ nodeAlign: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
10
+ right: "right";
11
+ center: "center";
12
+ left: "left";
13
+ justify: "justify";
14
+ }>>>;
15
+ style: z.ZodOptional<z.ZodObject<{
16
+ backgroundColor: z.ZodOptional<z.ZodString>;
17
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
19
+ default: "default";
20
+ rough: "rough";
21
+ }>>>;
22
+ }, z.core.$strip>>;
23
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
24
+ default: "default";
25
+ academy: "academy";
26
+ dark: "dark";
27
+ }>>>;
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: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
36
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
37
+ }, z.core.$strip>>;
38
+ annotations: {
39
+ title: string;
40
+ readOnlyHint: boolean;
41
+ };
42
+ };
43
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sankey = 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
+ source: zod_1.z.string(),
9
+ target: zod_1.z.string(),
10
+ value: zod_1.z.number(),
11
+ });
12
+ const schema = {
13
+ data: zod_1.z
14
+ .array(data)
15
+ .describe("Date for sankey chart, such as, [{ source: 'Landing Page', target: 'Product Page', value: 50000 }, { source: 'Product Page', target: 'Add to Cart', value: 35000 }, { source: 'Add to Cart', target: 'Checkout', value: 25000 }, { source: 'Checkout', target: 'Payment', value: 15000 }, { source: 'Payment', target: 'Purchase Completed', value: 8000 }].")
16
+ .nonempty({ message: "Sankey chart data cannot be empty." }),
17
+ nodeAlign: zod_1.z
18
+ .enum(["left", "right", "justify", "center"])
19
+ .optional()
20
+ .default("center")
21
+ .describe("Alignment of nodes in the sankey chart, such as, 'left', 'right', 'justify', or 'center'."),
22
+ style: zod_1.z
23
+ .object({
24
+ backgroundColor: base_1.BackgroundColorSchema,
25
+ palette: base_1.PaletteSchema,
26
+ texture: base_1.TextureSchema,
27
+ })
28
+ .optional()
29
+ .describe("Style configuration for the chart with a JSON object, optional."),
30
+ theme: base_1.ThemeSchema,
31
+ width: base_1.WidthSchema,
32
+ height: base_1.HeightSchema,
33
+ title: base_1.TitleSchema,
34
+ };
35
+ const tool = {
36
+ name: "generate_sankey_chart",
37
+ description: "Generate a sankey chart to visualize the flow of data between different stages or categories, such as, the user journey from landing on a page to completing a purchase.",
38
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
39
+ annotations: {
40
+ title: "Generate Sankey Chart",
41
+ readOnlyHint: true,
42
+ },
43
+ };
44
+ exports.sankey = {
45
+ schema,
46
+ tool,
47
+ };
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ export declare const scatter: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ x: z.ZodNumber;
6
+ y: z.ZodNumber;
7
+ group: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ }, z.core.$strip>>;
17
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
18
+ default: "default";
19
+ academy: "academy";
20
+ dark: "dark";
21
+ }>>>;
22
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
23
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
25
+ axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
+ axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
+ };
28
+ tool: {
29
+ name: string;
30
+ description: string;
31
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
32
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
33
+ }, z.core.$strip>>;
34
+ annotations: {
35
+ title: string;
36
+ readOnlyHint: boolean;
37
+ };
38
+ };
39
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scatter = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Scatter chart data schema
8
+ const data = zod_1.z.object({
9
+ x: zod_1.z.number(),
10
+ y: zod_1.z.number(),
11
+ group: zod_1.z.string().optional().describe("Group name for the data point."),
12
+ });
13
+ // Scatter chart input schema
14
+ const schema = {
15
+ data: zod_1.z
16
+ .array(data)
17
+ .describe("Data for scatter chart, such as, [{ x: 10, y: 15 }], when the data is grouped, the group name can be specified in the `group` field, such as, [{ x: 10, y: 15, group: 'Group A' }].")
18
+ .nonempty({ message: "Scatter chart data cannot be empty." }),
19
+ style: zod_1.z
20
+ .object({
21
+ backgroundColor: base_1.BackgroundColorSchema,
22
+ palette: base_1.PaletteSchema,
23
+ texture: base_1.TextureSchema,
24
+ })
25
+ .optional()
26
+ .describe("Style configuration for the chart with a JSON object, optional."),
27
+ theme: base_1.ThemeSchema,
28
+ width: base_1.WidthSchema,
29
+ height: base_1.HeightSchema,
30
+ title: base_1.TitleSchema,
31
+ axisXTitle: base_1.AxisXTitleSchema,
32
+ axisYTitle: base_1.AxisYTitleSchema,
33
+ };
34
+ // Scatter chart tool descriptor
35
+ const tool = {
36
+ name: "generate_scatter_chart",
37
+ description: "Generate a scatter chart to show the relationship between two variables, helps discover their relationship or trends, such as, the strength of correlation, data distribution patterns.",
38
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
39
+ annotations: {
40
+ title: "Generate Scatter Chart",
41
+ readOnlyHint: true,
42
+ },
43
+ };
44
+ exports.scatter = {
45
+ schema,
46
+ tool,
47
+ };
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ export declare const treemap: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ value: z.ZodNumber;
7
+ children: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
+ name: z.ZodString;
9
+ value: z.ZodNumber;
10
+ children: z.ZodOptional<z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodNumber;
13
+ }, z.core.$strip>>>;
14
+ }, z.core.$strip>>>;
15
+ }, z.core.$strip>>;
16
+ style: z.ZodOptional<z.ZodObject<{
17
+ backgroundColor: z.ZodOptional<z.ZodString>;
18
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
20
+ default: "default";
21
+ rough: "rough";
22
+ }>>>;
23
+ }, z.core.$strip>>;
24
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
25
+ default: "default";
26
+ academy: "academy";
27
+ dark: "dark";
28
+ }>>>;
29
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
30
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
31
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
32
+ };
33
+ tool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
37
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
38
+ }, z.core.$strip>>;
39
+ annotations: {
40
+ title: string;
41
+ readOnlyHint: boolean;
42
+ };
43
+ };
44
+ };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.treemap = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Define recursive schema for hierarchical data.
8
+ // 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.
9
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/155
10
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/132
11
+ const TreeNodeSchema = zod_1.z.object({
12
+ name: zod_1.z.string(),
13
+ value: zod_1.z.number(),
14
+ children: zod_1.z
15
+ .array(zod_1.z.object({
16
+ name: zod_1.z.string(),
17
+ value: zod_1.z.number(),
18
+ children: zod_1.z
19
+ .array(zod_1.z.object({
20
+ name: zod_1.z.string(),
21
+ value: zod_1.z.number(),
22
+ }))
23
+ .optional(),
24
+ }))
25
+ .optional(),
26
+ });
27
+ // Treemap chart input schema
28
+ const schema = {
29
+ data: zod_1.z
30
+ .array(TreeNodeSchema)
31
+ .describe("Data for treemap chart which is a hierarchical structure, such as, [{ name: 'Design', value: 70, children: [{ name: 'Tech', value: 20 }] }], and the maximum depth is 3.")
32
+ .nonempty({ message: "Treemap chart data cannot be empty." }),
33
+ style: zod_1.z
34
+ .object({
35
+ backgroundColor: base_1.BackgroundColorSchema,
36
+ palette: base_1.PaletteSchema,
37
+ texture: base_1.TextureSchema,
38
+ })
39
+ .optional()
40
+ .describe("Style configuration for the chart with a JSON object, optional."),
41
+ theme: base_1.ThemeSchema,
42
+ width: base_1.WidthSchema,
43
+ height: base_1.HeightSchema,
44
+ title: base_1.TitleSchema,
45
+ };
46
+ // Treemap chart tool descriptor
47
+ const tool = {
48
+ name: "generate_treemap_chart",
49
+ description: "Generate a treemap chart to display hierarchical data and can intuitively show comparisons between items at the same level, such as, show disk space usage with treemap.",
50
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
51
+ annotations: {
52
+ title: "Generate Treemap Chart",
53
+ readOnlyHint: true,
54
+ },
55
+ };
56
+ exports.treemap = {
57
+ schema,
58
+ tool,
59
+ };
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ export declare const venn: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ label: z.ZodOptional<z.ZodString>;
6
+ value: z.ZodNumber;
7
+ sets: z.ZodArray<z.ZodString>;
8
+ }, z.core.$strip>>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ }, z.core.$strip>>;
17
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
18
+ default: "default";
19
+ academy: "academy";
20
+ dark: "dark";
21
+ }>>>;
22
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
23
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
25
+ };
26
+ tool: {
27
+ name: string;
28
+ description: string;
29
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
30
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
31
+ }, z.core.$strip>>;
32
+ annotations: {
33
+ title: string;
34
+ readOnlyHint: boolean;
35
+ };
36
+ };
37
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.venn = 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
+ label: zod_1.z
9
+ .string()
10
+ .optional()
11
+ .describe("Label for the venn chart segment, such as 'A', 'B', or 'C'."),
12
+ value: zod_1.z
13
+ .number()
14
+ .describe("Value for the venn chart segment, such as 10, 20, or 30."),
15
+ sets: zod_1.z
16
+ .array(zod_1.z.string())
17
+ .describe("Array of set names that this segment belongs to, such as ['A', 'B'] for an intersection between sets A and B."),
18
+ });
19
+ const schema = {
20
+ data: zod_1.z
21
+ .array(data)
22
+ .describe("Data for venn chart, such as, [{ label: 'A', value: 10, sets: ['A'] }, { label: 'B', value: 20, sets: ['B'] }, { label: 'C', value: 30, sets: ['C'] }, { label: 'AB', value: 5, sets: ['A', 'B'] }].")
23
+ .nonempty({ message: "Venn chart data cannot be empty." }),
24
+ style: zod_1.z
25
+ .object({
26
+ backgroundColor: base_1.BackgroundColorSchema,
27
+ palette: base_1.PaletteSchema,
28
+ texture: base_1.TextureSchema,
29
+ })
30
+ .optional()
31
+ .describe("Style configuration for the chart with a JSON object, optional."),
32
+ theme: base_1.ThemeSchema,
33
+ width: base_1.WidthSchema,
34
+ height: base_1.HeightSchema,
35
+ title: base_1.TitleSchema,
36
+ };
37
+ const tool = {
38
+ name: "generate_venn_chart",
39
+ description: "Generate a Venn diagram to visualize the relationships between different sets, showing how they intersect and overlap, such as the commonalities and differences between various groups.",
40
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
41
+ annotations: {
42
+ title: "Generate Venn Chart",
43
+ readOnlyHint: true,
44
+ },
45
+ };
46
+ exports.venn = {
47
+ schema,
48
+ tool,
49
+ };
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ export declare const violin: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ category: z.ZodString;
6
+ value: z.ZodNumber;
7
+ group: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>>;
9
+ style: z.ZodOptional<z.ZodObject<{
10
+ backgroundColor: z.ZodOptional<z.ZodString>;
11
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ startAtZero: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
14
+ default: "default";
15
+ rough: "rough";
16
+ }>>>;
17
+ }, z.core.$strip>>;
18
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
19
+ default: "default";
20
+ academy: "academy";
21
+ dark: "dark";
22
+ }>>>;
23
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
25
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
+ axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
+ axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
28
+ };
29
+ tool: {
30
+ name: string;
31
+ description: string;
32
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
33
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
34
+ }, z.core.$strip>>;
35
+ annotations: {
36
+ title: string;
37
+ readOnlyHint: boolean;
38
+ };
39
+ };
40
+ };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.violin = 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
9
+ .string()
10
+ .describe("Category of the data point, such as '分类一'."),
11
+ value: zod_1.z.number().describe("Value of the data point, such as 10."),
12
+ group: zod_1.z
13
+ .string()
14
+ .optional()
15
+ .describe("Optional group for the data point, used for grouping in the violin chart."),
16
+ });
17
+ const schema = {
18
+ data: zod_1.z
19
+ .array(data)
20
+ .describe("Data for violin chart, such as, [{ category: 'Category A', value: 10 }], when the data is grouped, the 'group' field is required, such as, [{ category: 'Category B', value: 20, group: 'Group A' }].")
21
+ .nonempty({ message: "Violin chart data cannot be empty." }),
22
+ style: zod_1.z
23
+ .object({
24
+ backgroundColor: base_1.BackgroundColorSchema,
25
+ palette: base_1.PaletteSchema,
26
+ startAtZero: base_1.StartAtZeroSchema,
27
+ texture: base_1.TextureSchema,
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
+ const tool = {
39
+ name: "generate_violin_chart",
40
+ description: "Generate a violin chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories.",
41
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
42
+ annotations: {
43
+ title: "Generate Violin Chart",
44
+ readOnlyHint: true,
45
+ },
46
+ };
47
+ exports.violin = {
48
+ schema,
49
+ tool,
50
+ };
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ export declare const waterfall: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ category: z.ZodString;
6
+ value: z.ZodOptional<z.ZodNumber>;
7
+ isIntermediateTotal: z.ZodOptional<z.ZodBoolean>;
8
+ isTotal: z.ZodOptional<z.ZodBoolean>;
9
+ }, z.core.$strip>>;
10
+ style: z.ZodOptional<z.ZodObject<{
11
+ backgroundColor: z.ZodOptional<z.ZodString>;
12
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ default: "default";
14
+ rough: "rough";
15
+ }>>>;
16
+ palette: z.ZodOptional<z.ZodObject<{
17
+ positiveColor: z.ZodOptional<z.ZodString>;
18
+ negativeColor: z.ZodOptional<z.ZodString>;
19
+ totalColor: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>>;
22
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
23
+ default: "default";
24
+ academy: "academy";
25
+ dark: "dark";
26
+ }>>>;
27
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
28
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
29
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
30
+ axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
31
+ axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
32
+ };
33
+ tool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
37
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
38
+ }, z.core.$strip>>;
39
+ annotations: {
40
+ title: string;
41
+ readOnlyHint: boolean;
42
+ };
43
+ };
44
+ };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.waterfall = 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
8
+ .object({
9
+ category: zod_1.z.string(),
10
+ value: zod_1.z.number().optional(),
11
+ isIntermediateTotal: zod_1.z.boolean().optional(),
12
+ isTotal: zod_1.z.boolean().optional(),
13
+ })
14
+ .superRefine((item, ctx) => {
15
+ if (!item.isIntermediateTotal &&
16
+ !item.isTotal &&
17
+ item.value === undefined) {
18
+ ctx.addIssue({
19
+ code: zod_1.z.ZodIssueCode.custom,
20
+ message: "The 'value' field is required for data points that are not totals.",
21
+ path: ["value"],
22
+ });
23
+ }
24
+ });
25
+ const schema = {
26
+ data: zod_1.z
27
+ .array(data)
28
+ .describe("Data for waterfall chart, it should be an array of objects. Each object must contain a `category` field. For regular items, a `value` field is also required. The `isIntermediateTotal` field marks intermediate subtotals, and the `isTotal` field marks the final total. For example, [{ category: 'Initial', value: 100 }, { category: 'Increase', value: 50 }, { category: 'Subtotal', isIntermediateTotal: true }, { category: 'Decrease', value: -30 }, { category: 'Total', isTotal: true }].")
29
+ .nonempty({ message: "Waterfall chart data cannot be empty." }),
30
+ style: zod_1.z
31
+ .object({
32
+ backgroundColor: base_1.BackgroundColorSchema,
33
+ texture: base_1.TextureSchema,
34
+ palette: zod_1.z
35
+ .object({
36
+ positiveColor: zod_1.z
37
+ .string()
38
+ .optional()
39
+ .describe("Color for positive values (increases). Default is '#FF4D4F'."),
40
+ negativeColor: zod_1.z
41
+ .string()
42
+ .optional()
43
+ .describe("Color for negative values (decreases). Default is '#2EBB59'."),
44
+ totalColor: zod_1.z
45
+ .string()
46
+ .optional()
47
+ .describe("Color for total and intermediate total bars. Default is '#1783FF'."),
48
+ })
49
+ .optional(),
50
+ })
51
+ .optional()
52
+ .describe("Style configuration for the chart with a JSON object, optional."),
53
+ theme: base_1.ThemeSchema,
54
+ width: base_1.WidthSchema,
55
+ height: base_1.HeightSchema,
56
+ title: base_1.TitleSchema,
57
+ axisXTitle: base_1.AxisXTitleSchema,
58
+ axisYTitle: base_1.AxisYTitleSchema,
59
+ };
60
+ // Waterfall chart tool descriptor
61
+ const tool = {
62
+ name: "generate_waterfall_chart",
63
+ description: "Generate a waterfall chart to visualize the cumulative effect of sequentially introduced positive or negative values, such as showing how an initial value is affected by a series of intermediate positive or negative values leading to a final result. Waterfall charts are ideal for financial analysis, budget tracking, profit and loss statements, and understanding the composition of changes over time or categories.",
64
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
65
+ annotations: {
66
+ title: "Generate Waterfall Chart",
67
+ readOnlyHint: true,
68
+ },
69
+ };
70
+ exports.waterfall = {
71
+ schema,
72
+ tool,
73
+ };
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ export declare const wordCloud: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ text: z.ZodString;
6
+ value: z.ZodNumber;
7
+ }, z.core.$strip>>;
8
+ style: z.ZodOptional<z.ZodObject<{
9
+ backgroundColor: z.ZodOptional<z.ZodString>;
10
+ palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
11
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
12
+ default: "default";
13
+ rough: "rough";
14
+ }>>>;
15
+ }, z.core.$strip>>;
16
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
17
+ default: "default";
18
+ academy: "academy";
19
+ dark: "dark";
20
+ }>>>;
21
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
22
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
23
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
24
+ };
25
+ tool: {
26
+ name: string;
27
+ description: string;
28
+ inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
29
+ [x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
30
+ }, z.core.$strip>>;
31
+ annotations: {
32
+ title: string;
33
+ readOnlyHint: boolean;
34
+ };
35
+ };
36
+ };