@dotzero.ai/export-mcp 1.2.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.
Files changed (50) hide show
  1. package/README.md +474 -0
  2. package/dist/chart-engine.d.ts +29 -0
  3. package/dist/chart-engine.js +1 -0
  4. package/dist/colors.d.ts +21 -0
  5. package/dist/colors.js +1 -0
  6. package/dist/export-engine.d.ts +17 -0
  7. package/dist/export-engine.js +1 -0
  8. package/dist/file-output.d.ts +10 -0
  9. package/dist/file-output.js +1 -0
  10. package/dist/index.d.ts +8 -0
  11. package/dist/index.js +2 -0
  12. package/dist/schemas.d.ts +126 -0
  13. package/dist/schemas.js +1 -0
  14. package/dist/tool-registry.d.ts +10 -0
  15. package/dist/tool-registry.js +1 -0
  16. package/dist/tools/charts/bar.d.ts +214 -0
  17. package/dist/tools/charts/bar.js +1 -0
  18. package/dist/tools/charts/control-chart.d.ts +109 -0
  19. package/dist/tools/charts/control-chart.js +1 -0
  20. package/dist/tools/charts/gauge.d.ts +120 -0
  21. package/dist/tools/charts/gauge.js +1 -0
  22. package/dist/tools/charts/index.d.ts +9 -0
  23. package/dist/tools/charts/index.js +1 -0
  24. package/dist/tools/charts/line.d.ts +226 -0
  25. package/dist/tools/charts/line.js +1 -0
  26. package/dist/tools/charts/multi.d.ts +466 -0
  27. package/dist/tools/charts/multi.js +1 -0
  28. package/dist/tools/charts/oee-breakdown.d.ts +156 -0
  29. package/dist/tools/charts/oee-breakdown.js +1 -0
  30. package/dist/tools/charts/pie.d.ts +90 -0
  31. package/dist/tools/charts/pie.js +1 -0
  32. package/dist/tools/charts/scatter.d.ts +250 -0
  33. package/dist/tools/charts/scatter.js +1 -0
  34. package/dist/tools/charts/timeline.d.ts +128 -0
  35. package/dist/tools/charts/timeline.js +1 -0
  36. package/dist/tools/exports/csv.d.ts +51 -0
  37. package/dist/tools/exports/csv.js +1 -0
  38. package/dist/tools/exports/index.d.ts +2 -0
  39. package/dist/tools/exports/index.js +1 -0
  40. package/dist/tools/exports/xlsx.d.ts +85 -0
  41. package/dist/tools/exports/xlsx.js +1 -0
  42. package/dist/tools/smart/chart-from-json.d.ts +84 -0
  43. package/dist/tools/smart/chart-from-json.js +1 -0
  44. package/dist/tools/smart/index.d.ts +2 -0
  45. package/dist/tools/smart/index.js +1 -0
  46. package/dist/tools/smart/table-from-json.d.ts +63 -0
  47. package/dist/tools/smart/table-from-json.js +1 -0
  48. package/dist/types.d.ts +75 -0
  49. package/dist/types.js +1 -0
  50. package/package.json +64 -0
@@ -0,0 +1,126 @@
1
+ import { z } from "zod";
2
+ export declare const ChartFormatEnum: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
3
+ export declare const ChartDatasetSchema: z.ZodObject<{
4
+ label: z.ZodString;
5
+ data: z.ZodArray<z.ZodNumber, "many">;
6
+ color: z.ZodOptional<z.ZodString>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ label: string;
9
+ data: number[];
10
+ color?: string | undefined;
11
+ }, {
12
+ label: string;
13
+ data: number[];
14
+ color?: string | undefined;
15
+ }>;
16
+ export declare const ScatterDatasetSchema: z.ZodObject<{
17
+ label: z.ZodString;
18
+ data: z.ZodArray<z.ZodObject<{
19
+ x: z.ZodNumber;
20
+ y: z.ZodNumber;
21
+ }, "strip", z.ZodTypeAny, {
22
+ x: number;
23
+ y: number;
24
+ }, {
25
+ x: number;
26
+ y: number;
27
+ }>, "many">;
28
+ color: z.ZodOptional<z.ZodString>;
29
+ }, "strict", z.ZodTypeAny, {
30
+ label: string;
31
+ data: {
32
+ x: number;
33
+ y: number;
34
+ }[];
35
+ color?: string | undefined;
36
+ }, {
37
+ label: string;
38
+ data: {
39
+ x: number;
40
+ y: number;
41
+ }[];
42
+ color?: string | undefined;
43
+ }>;
44
+ export declare const ChartOptionsSchema: z.ZodOptional<z.ZodObject<{
45
+ stacked: z.ZodOptional<z.ZodBoolean>;
46
+ horizontal: z.ZodOptional<z.ZodBoolean>;
47
+ show_legend: z.ZodOptional<z.ZodBoolean>;
48
+ show_grid: z.ZodOptional<z.ZodBoolean>;
49
+ x_label: z.ZodOptional<z.ZodString>;
50
+ y_label: z.ZodOptional<z.ZodString>;
51
+ min_y: z.ZodOptional<z.ZodNumber>;
52
+ max_y: z.ZodOptional<z.ZodNumber>;
53
+ }, "strict", z.ZodTypeAny, {
54
+ stacked?: boolean | undefined;
55
+ horizontal?: boolean | undefined;
56
+ show_legend?: boolean | undefined;
57
+ show_grid?: boolean | undefined;
58
+ x_label?: string | undefined;
59
+ y_label?: string | undefined;
60
+ min_y?: number | undefined;
61
+ max_y?: number | undefined;
62
+ }, {
63
+ stacked?: boolean | undefined;
64
+ horizontal?: boolean | undefined;
65
+ show_legend?: boolean | undefined;
66
+ show_grid?: boolean | undefined;
67
+ x_label?: string | undefined;
68
+ y_label?: string | undefined;
69
+ min_y?: number | undefined;
70
+ max_y?: number | undefined;
71
+ }>>;
72
+ export declare const BaseChartParams: z.ZodObject<{
73
+ output_path: z.ZodOptional<z.ZodString>;
74
+ width: z.ZodDefault<z.ZodNumber>;
75
+ height: z.ZodDefault<z.ZodNumber>;
76
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ width: number;
79
+ height: number;
80
+ format: "png" | "jpg";
81
+ output_path?: string | undefined;
82
+ }, {
83
+ width?: number | undefined;
84
+ height?: number | undefined;
85
+ output_path?: string | undefined;
86
+ format?: "png" | "jpg" | undefined;
87
+ }>;
88
+ export declare const ExportSheetSchema: z.ZodObject<{
89
+ name: z.ZodString;
90
+ headers: z.ZodArray<z.ZodString, "many">;
91
+ rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">, "many">;
92
+ }, "strict", z.ZodTypeAny, {
93
+ name: string;
94
+ headers: string[];
95
+ rows: (string | number | boolean | null)[][];
96
+ }, {
97
+ name: string;
98
+ headers: string[];
99
+ rows: (string | number | boolean | null)[][];
100
+ }>;
101
+ export declare const GaugeThresholdSchema: z.ZodObject<{
102
+ value: z.ZodNumber;
103
+ color: z.ZodString;
104
+ }, "strict", z.ZodTypeAny, {
105
+ color: string;
106
+ value: number;
107
+ }, {
108
+ color: string;
109
+ value: number;
110
+ }>;
111
+ export declare const TimelineSegmentSchema: z.ZodObject<{
112
+ start: z.ZodString;
113
+ end: z.ZodString;
114
+ state: z.ZodString;
115
+ color: z.ZodOptional<z.ZodString>;
116
+ }, "strict", z.ZodTypeAny, {
117
+ start: string;
118
+ end: string;
119
+ state: string;
120
+ color?: string | undefined;
121
+ }, {
122
+ start: string;
123
+ end: string;
124
+ state: string;
125
+ color?: string | undefined;
126
+ }>;
@@ -0,0 +1 @@
1
+ import{z}from"zod";export const ChartFormatEnum=z.enum(["png","jpg"]).default("png").describe("Image format: 'png' or 'jpg'");export const ChartDatasetSchema=z.object({label:z.string().describe("Dataset label"),data:z.array(z.number()).describe("Data values"),color:z.string().optional().describe("Series color (hex)")}).strict();export const ScatterDatasetSchema=z.object({label:z.string().describe("Dataset label"),data:z.array(z.object({x:z.number(),y:z.number()})).describe("Scatter data points"),color:z.string().optional().describe("Series color (hex)")}).strict();export const ChartOptionsSchema=z.object({stacked:z.boolean().optional().describe("Enable stacking"),horizontal:z.boolean().optional().describe("Horizontal orientation (bar charts)"),show_legend:z.boolean().optional().describe("Show legend (default: true)"),show_grid:z.boolean().optional().describe("Show grid lines (default: true)"),x_label:z.string().optional().describe("X-axis label"),y_label:z.string().optional().describe("Y-axis label"),min_y:z.number().optional().describe("Y-axis minimum"),max_y:z.number().optional().describe("Y-axis maximum")}).strict().optional();export const BaseChartParams=z.object({output_path:z.string().optional().describe("Custom output file path"),width:z.number().int().min(200).max(3e3).default(800).describe("Image width in pixels"),height:z.number().int().min(200).max(3e3).default(500).describe("Image height in pixels"),format:ChartFormatEnum});export const ExportSheetSchema=z.object({name:z.string().describe("Sheet name"),headers:z.array(z.string()).describe("Column headers"),rows:z.array(z.array(z.union([z.string(),z.number(),z.boolean(),z.null()]))).describe("Row data")}).strict();export const GaugeThresholdSchema=z.object({value:z.number().describe("Threshold value"),color:z.string().describe("Color for this threshold range (hex)")}).strict();export const TimelineSegmentSchema=z.object({start:z.string().describe("Segment start time (ISO 8601)"),end:z.string().describe("Segment end time (ISO 8601)"),state:z.string().describe("State name (e.g., 'running', 'idle', 'down', 'off')"),color:z.string().optional().describe("Override color (hex)")}).strict();
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tool registry - registers all 14 tools with the MCP server.
3
+ * No auth split — all tools are public (no API calls needed).
4
+ */
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ /**
7
+ * Register all 14 tools with the MCP server.
8
+ * No authentication required — all tools are available immediately.
9
+ */
10
+ export declare function registerAllTools(server: McpServer): void;
@@ -0,0 +1 @@
1
+ import{chartBarTool,executeChartBar,chartLineTool,executeChartLine,chartPieTool,executeChartPie,chartScatterTool,executeChartScatter,chartGaugeTool,executeChartGauge,chartOeeBreakdownTool,executeChartOeeBreakdown,chartControlTool,executeChartControl,chartTimelineTool,executeChartTimeline,chartMultiTool,executeChartMulti}from"./tools/charts/index.js";import{exportCsvTool,executeExportCsv,exportXlsxTool,executeExportXlsx}from"./tools/exports/index.js";import{chartFromJsonTool,executeChartFromJson,exportTableFromJsonTool,executeExportTableFromJson}from"./tools/smart/index.js";function reg(e,t,o){e.registerTool(t.name,{title:t.title,description:t.description,inputSchema:t.inputSchema,annotations:t.annotations},async e=>o(e))}export function registerAllTools(e){reg(e,chartBarTool,executeChartBar),reg(e,chartLineTool,executeChartLine),reg(e,chartPieTool,executeChartPie),reg(e,chartScatterTool,executeChartScatter),reg(e,chartGaugeTool,executeChartGauge),reg(e,chartOeeBreakdownTool,executeChartOeeBreakdown),reg(e,chartControlTool,executeChartControl),reg(e,chartTimelineTool,executeChartTimeline),reg(e,chartMultiTool,executeChartMulti),reg(e,exportCsvTool,executeExportCsv),reg(e,exportXlsxTool,executeExportXlsx),reg(e,chartFromJsonTool,executeChartFromJson),reg(e,exportTableFromJsonTool,executeExportTableFromJson)}
@@ -0,0 +1,214 @@
1
+ import { z } from "zod";
2
+ export declare const ChartBarSchema: z.ZodObject<{
3
+ title: z.ZodString;
4
+ labels: z.ZodArray<z.ZodString, "many">;
5
+ datasets: z.ZodArray<z.ZodObject<{
6
+ label: z.ZodString;
7
+ data: z.ZodArray<z.ZodNumber, "many">;
8
+ color: z.ZodOptional<z.ZodString>;
9
+ }, "strict", z.ZodTypeAny, {
10
+ label: string;
11
+ data: number[];
12
+ color?: string | undefined;
13
+ }, {
14
+ label: string;
15
+ data: number[];
16
+ color?: string | undefined;
17
+ }>, "many">;
18
+ options: z.ZodOptional<z.ZodObject<{
19
+ stacked: z.ZodOptional<z.ZodBoolean>;
20
+ horizontal: z.ZodOptional<z.ZodBoolean>;
21
+ show_legend: z.ZodOptional<z.ZodBoolean>;
22
+ show_grid: z.ZodOptional<z.ZodBoolean>;
23
+ x_label: z.ZodOptional<z.ZodString>;
24
+ y_label: z.ZodOptional<z.ZodString>;
25
+ min_y: z.ZodOptional<z.ZodNumber>;
26
+ max_y: z.ZodOptional<z.ZodNumber>;
27
+ }, "strict", z.ZodTypeAny, {
28
+ stacked?: boolean | undefined;
29
+ horizontal?: boolean | undefined;
30
+ show_legend?: boolean | undefined;
31
+ show_grid?: boolean | undefined;
32
+ x_label?: string | undefined;
33
+ y_label?: string | undefined;
34
+ min_y?: number | undefined;
35
+ max_y?: number | undefined;
36
+ }, {
37
+ stacked?: boolean | undefined;
38
+ horizontal?: boolean | undefined;
39
+ show_legend?: boolean | undefined;
40
+ show_grid?: boolean | undefined;
41
+ x_label?: string | undefined;
42
+ y_label?: string | undefined;
43
+ min_y?: number | undefined;
44
+ max_y?: number | undefined;
45
+ }>>;
46
+ } & {
47
+ output_path: z.ZodOptional<z.ZodString>;
48
+ width: z.ZodDefault<z.ZodNumber>;
49
+ height: z.ZodDefault<z.ZodNumber>;
50
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
51
+ }, "strict", z.ZodTypeAny, {
52
+ width: number;
53
+ height: number;
54
+ format: "png" | "jpg";
55
+ title: string;
56
+ labels: string[];
57
+ datasets: {
58
+ label: string;
59
+ data: number[];
60
+ color?: string | undefined;
61
+ }[];
62
+ options?: {
63
+ stacked?: boolean | undefined;
64
+ horizontal?: boolean | undefined;
65
+ show_legend?: boolean | undefined;
66
+ show_grid?: boolean | undefined;
67
+ x_label?: string | undefined;
68
+ y_label?: string | undefined;
69
+ min_y?: number | undefined;
70
+ max_y?: number | undefined;
71
+ } | undefined;
72
+ output_path?: string | undefined;
73
+ }, {
74
+ title: string;
75
+ labels: string[];
76
+ datasets: {
77
+ label: string;
78
+ data: number[];
79
+ color?: string | undefined;
80
+ }[];
81
+ width?: number | undefined;
82
+ height?: number | undefined;
83
+ options?: {
84
+ stacked?: boolean | undefined;
85
+ horizontal?: boolean | undefined;
86
+ show_legend?: boolean | undefined;
87
+ show_grid?: boolean | undefined;
88
+ x_label?: string | undefined;
89
+ y_label?: string | undefined;
90
+ min_y?: number | undefined;
91
+ max_y?: number | undefined;
92
+ } | undefined;
93
+ output_path?: string | undefined;
94
+ format?: "png" | "jpg" | undefined;
95
+ }>;
96
+ export type ChartBarInput = z.infer<typeof ChartBarSchema>;
97
+ export declare const chartBarTool: {
98
+ name: string;
99
+ title: string;
100
+ description: string;
101
+ inputSchema: z.ZodObject<{
102
+ title: z.ZodString;
103
+ labels: z.ZodArray<z.ZodString, "many">;
104
+ datasets: z.ZodArray<z.ZodObject<{
105
+ label: z.ZodString;
106
+ data: z.ZodArray<z.ZodNumber, "many">;
107
+ color: z.ZodOptional<z.ZodString>;
108
+ }, "strict", z.ZodTypeAny, {
109
+ label: string;
110
+ data: number[];
111
+ color?: string | undefined;
112
+ }, {
113
+ label: string;
114
+ data: number[];
115
+ color?: string | undefined;
116
+ }>, "many">;
117
+ options: z.ZodOptional<z.ZodObject<{
118
+ stacked: z.ZodOptional<z.ZodBoolean>;
119
+ horizontal: z.ZodOptional<z.ZodBoolean>;
120
+ show_legend: z.ZodOptional<z.ZodBoolean>;
121
+ show_grid: z.ZodOptional<z.ZodBoolean>;
122
+ x_label: z.ZodOptional<z.ZodString>;
123
+ y_label: z.ZodOptional<z.ZodString>;
124
+ min_y: z.ZodOptional<z.ZodNumber>;
125
+ max_y: z.ZodOptional<z.ZodNumber>;
126
+ }, "strict", z.ZodTypeAny, {
127
+ stacked?: boolean | undefined;
128
+ horizontal?: boolean | undefined;
129
+ show_legend?: boolean | undefined;
130
+ show_grid?: boolean | undefined;
131
+ x_label?: string | undefined;
132
+ y_label?: string | undefined;
133
+ min_y?: number | undefined;
134
+ max_y?: number | undefined;
135
+ }, {
136
+ stacked?: boolean | undefined;
137
+ horizontal?: boolean | undefined;
138
+ show_legend?: boolean | undefined;
139
+ show_grid?: boolean | undefined;
140
+ x_label?: string | undefined;
141
+ y_label?: string | undefined;
142
+ min_y?: number | undefined;
143
+ max_y?: number | undefined;
144
+ }>>;
145
+ } & {
146
+ output_path: z.ZodOptional<z.ZodString>;
147
+ width: z.ZodDefault<z.ZodNumber>;
148
+ height: z.ZodDefault<z.ZodNumber>;
149
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
150
+ }, "strict", z.ZodTypeAny, {
151
+ width: number;
152
+ height: number;
153
+ format: "png" | "jpg";
154
+ title: string;
155
+ labels: string[];
156
+ datasets: {
157
+ label: string;
158
+ data: number[];
159
+ color?: string | undefined;
160
+ }[];
161
+ options?: {
162
+ stacked?: boolean | undefined;
163
+ horizontal?: boolean | undefined;
164
+ show_legend?: boolean | undefined;
165
+ show_grid?: boolean | undefined;
166
+ x_label?: string | undefined;
167
+ y_label?: string | undefined;
168
+ min_y?: number | undefined;
169
+ max_y?: number | undefined;
170
+ } | undefined;
171
+ output_path?: string | undefined;
172
+ }, {
173
+ title: string;
174
+ labels: string[];
175
+ datasets: {
176
+ label: string;
177
+ data: number[];
178
+ color?: string | undefined;
179
+ }[];
180
+ width?: number | undefined;
181
+ height?: number | undefined;
182
+ options?: {
183
+ stacked?: boolean | undefined;
184
+ horizontal?: boolean | undefined;
185
+ show_legend?: boolean | undefined;
186
+ show_grid?: boolean | undefined;
187
+ x_label?: string | undefined;
188
+ y_label?: string | undefined;
189
+ min_y?: number | undefined;
190
+ max_y?: number | undefined;
191
+ } | undefined;
192
+ output_path?: string | undefined;
193
+ format?: "png" | "jpg" | undefined;
194
+ }>;
195
+ annotations: {
196
+ readOnlyHint: boolean;
197
+ destructiveHint: boolean;
198
+ idempotentHint: boolean;
199
+ openWorldHint: boolean;
200
+ };
201
+ };
202
+ export declare function executeChartBar(params: ChartBarInput): Promise<{
203
+ content: ({
204
+ type: "text";
205
+ text: string;
206
+ data?: undefined;
207
+ mimeType?: undefined;
208
+ } | {
209
+ type: "image";
210
+ data: string;
211
+ mimeType: "image/png" | "image/jpeg";
212
+ text?: undefined;
213
+ })[];
214
+ }>;
@@ -0,0 +1 @@
1
+ import{z}from"zod";import{ChartDatasetSchema,ChartOptionsSchema,BaseChartParams}from"../../schemas.js";import{renderChart,chartResultToContent}from"../../chart-engine.js";import{getSeriesColor,withAlpha}from"../../colors.js";export const ChartBarSchema=z.object({title:z.string().describe("Chart title"),labels:z.array(z.string()).describe("Category labels (x-axis)"),datasets:z.array(ChartDatasetSchema).describe("Data series"),options:ChartOptionsSchema}).merge(BaseChartParams).strict();export const chartBarTool={name:"chart_bar",title:"Bar Chart",description:"Generate a bar chart (vertical, horizontal, or stacked). Provide labels and one or more datasets.",inputSchema:ChartBarSchema,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}};export async function executeChartBar(t){const a=t.options||{},e=a.horizontal?"y":"x",r={type:"bar",data:{labels:t.labels,datasets:t.datasets.map((t,a)=>{const e=t.color||getSeriesColor(a);return{label:t.label,data:t.data,backgroundColor:withAlpha(e,.7),borderColor:e,borderWidth:1}})},options:{indexAxis:e,responsive:!1,plugins:{title:{display:!0,text:t.title,font:{size:16}},legend:{display:!1!==a.show_legend}},scales:{x:{stacked:a.stacked,title:{display:!!a.x_label,text:a.x_label},grid:{display:!1!==a.show_grid}},y:{stacked:a.stacked,title:{display:!!a.y_label,text:a.y_label},grid:{display:!1!==a.show_grid},min:a.min_y,max:a.max_y}}}},o=await renderChart(r,{width:t.width,height:t.height,format:t.format,outputPath:t.output_path,title:t.title});return chartResultToContent(o)}
@@ -0,0 +1,109 @@
1
+ import { z } from "zod";
2
+ import "chartjs-plugin-annotation";
3
+ export declare const ChartControlSchema: z.ZodObject<{
4
+ title: z.ZodDefault<z.ZodString>;
5
+ values: z.ZodArray<z.ZodNumber, "many">;
6
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ ucl: z.ZodNumber;
8
+ cl: z.ZodNumber;
9
+ lcl: z.ZodNumber;
10
+ usl: z.ZodOptional<z.ZodNumber>;
11
+ lsl: z.ZodOptional<z.ZodNumber>;
12
+ } & {
13
+ output_path: z.ZodOptional<z.ZodString>;
14
+ width: z.ZodDefault<z.ZodNumber>;
15
+ height: z.ZodDefault<z.ZodNumber>;
16
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ width: number;
19
+ height: number;
20
+ values: number[];
21
+ format: "png" | "jpg";
22
+ title: string;
23
+ ucl: number;
24
+ cl: number;
25
+ lcl: number;
26
+ output_path?: string | undefined;
27
+ labels?: string[] | undefined;
28
+ usl?: number | undefined;
29
+ lsl?: number | undefined;
30
+ }, {
31
+ values: number[];
32
+ ucl: number;
33
+ cl: number;
34
+ lcl: number;
35
+ width?: number | undefined;
36
+ height?: number | undefined;
37
+ output_path?: string | undefined;
38
+ format?: "png" | "jpg" | undefined;
39
+ title?: string | undefined;
40
+ labels?: string[] | undefined;
41
+ usl?: number | undefined;
42
+ lsl?: number | undefined;
43
+ }>;
44
+ export type ChartControlInput = z.infer<typeof ChartControlSchema>;
45
+ export declare const chartControlTool: {
46
+ name: string;
47
+ title: string;
48
+ description: string;
49
+ inputSchema: z.ZodObject<{
50
+ title: z.ZodDefault<z.ZodString>;
51
+ values: z.ZodArray<z.ZodNumber, "many">;
52
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
53
+ ucl: z.ZodNumber;
54
+ cl: z.ZodNumber;
55
+ lcl: z.ZodNumber;
56
+ usl: z.ZodOptional<z.ZodNumber>;
57
+ lsl: z.ZodOptional<z.ZodNumber>;
58
+ } & {
59
+ output_path: z.ZodOptional<z.ZodString>;
60
+ width: z.ZodDefault<z.ZodNumber>;
61
+ height: z.ZodDefault<z.ZodNumber>;
62
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
63
+ }, "strict", z.ZodTypeAny, {
64
+ width: number;
65
+ height: number;
66
+ values: number[];
67
+ format: "png" | "jpg";
68
+ title: string;
69
+ ucl: number;
70
+ cl: number;
71
+ lcl: number;
72
+ output_path?: string | undefined;
73
+ labels?: string[] | undefined;
74
+ usl?: number | undefined;
75
+ lsl?: number | undefined;
76
+ }, {
77
+ values: number[];
78
+ ucl: number;
79
+ cl: number;
80
+ lcl: number;
81
+ width?: number | undefined;
82
+ height?: number | undefined;
83
+ output_path?: string | undefined;
84
+ format?: "png" | "jpg" | undefined;
85
+ title?: string | undefined;
86
+ labels?: string[] | undefined;
87
+ usl?: number | undefined;
88
+ lsl?: number | undefined;
89
+ }>;
90
+ annotations: {
91
+ readOnlyHint: boolean;
92
+ destructiveHint: boolean;
93
+ idempotentHint: boolean;
94
+ openWorldHint: boolean;
95
+ };
96
+ };
97
+ export declare function executeChartControl(params: ChartControlInput): Promise<{
98
+ content: ({
99
+ type: "text";
100
+ text: string;
101
+ data?: undefined;
102
+ mimeType?: undefined;
103
+ } | {
104
+ type: "image";
105
+ data: string;
106
+ mimeType: "image/png" | "image/jpeg";
107
+ text?: undefined;
108
+ })[];
109
+ }>;
@@ -0,0 +1 @@
1
+ import{z}from"zod";import{BaseChartParams}from"../../schemas.js";import{renderChart,chartResultToContent}from"../../chart-engine.js";import{DOTZERO_COLORS}from"../../colors.js";import"chartjs-plugin-annotation";export const ChartControlSchema=z.object({title:z.string().default("Control Chart").describe("Chart title"),values:z.array(z.number()).describe("Measurement values"),labels:z.array(z.string()).optional().describe("X-axis labels (sample #, timestamps, etc.)"),ucl:z.number().describe("Upper Control Limit"),cl:z.number().describe("Center Line (mean)"),lcl:z.number().describe("Lower Control Limit"),usl:z.number().optional().describe("Upper Specification Limit"),lsl:z.number().optional().describe("Lower Specification Limit")}).merge(BaseChartParams).strict();export const chartControlTool={name:"chart_control",title:"SPC Control Chart",description:"Generate an SPC control chart with UCL/CL/LCL lines and optional USL/LSL specification limits. Highlights out-of-control points in red.",inputSchema:ChartControlSchema,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}};export async function executeChartControl(t){const{values:e,ucl:o,cl:i,lcl:r,usl:n,lsl:a}=t,l=t.labels||e.map((t,e)=>String(e+1)),s=e.map(t=>t>o||t<r?DOTZERO_COLORS.defect:"#2196F3"),d={uclLine:{type:"line",yMin:o,yMax:o,borderColor:DOTZERO_COLORS.defect,borderWidth:2,borderDash:[6,4],label:{display:!0,content:`UCL: ${o.toFixed(2)}`,position:"start"}},clLine:{type:"line",yMin:i,yMax:i,borderColor:DOTZERO_COLORS.good,borderWidth:2,label:{display:!0,content:`CL: ${i.toFixed(2)}`,position:"start"}},lclLine:{type:"line",yMin:r,yMax:r,borderColor:DOTZERO_COLORS.defect,borderWidth:2,borderDash:[6,4],label:{display:!0,content:`LCL: ${r.toFixed(2)}`,position:"start"}}};void 0!==n&&(d.uslLine={type:"line",yMin:n,yMax:n,borderColor:"#FF9800",borderWidth:1,borderDash:[3,3],label:{display:!0,content:`USL: ${n.toFixed(2)}`,position:"end"}}),void 0!==a&&(d.lslLine={type:"line",yMin:a,yMax:a,borderColor:"#FF9800",borderWidth:1,borderDash:[3,3],label:{display:!0,content:`LSL: ${a.toFixed(2)}`,position:"end"}});const c={type:"line",data:{labels:l,datasets:[{label:"Value",data:e,borderColor:"#2196F3",backgroundColor:"transparent",pointBackgroundColor:s,pointBorderColor:s,pointRadius:4,tension:0}]},options:{responsive:!1,plugins:{title:{display:!0,text:t.title,font:{size:16}},legend:{display:!1},annotation:{annotations:d}},scales:{x:{title:{display:!0,text:"Sample"}},y:{title:{display:!0,text:"Value"}}}}},p=await renderChart(c,{width:t.width,height:t.height,format:t.format,outputPath:t.output_path,title:t.title});return chartResultToContent(p)}
@@ -0,0 +1,120 @@
1
+ import { z } from "zod";
2
+ export declare const ChartGaugeSchema: z.ZodObject<{
3
+ value: z.ZodNumber;
4
+ label: z.ZodOptional<z.ZodString>;
5
+ min: z.ZodDefault<z.ZodNumber>;
6
+ max: z.ZodDefault<z.ZodNumber>;
7
+ thresholds: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
+ value: z.ZodNumber;
9
+ color: z.ZodString;
10
+ }, "strict", z.ZodTypeAny, {
11
+ color: string;
12
+ value: number;
13
+ }, {
14
+ color: string;
15
+ value: number;
16
+ }>, "many">>;
17
+ } & {
18
+ output_path: z.ZodOptional<z.ZodString>;
19
+ width: z.ZodDefault<z.ZodNumber>;
20
+ height: z.ZodDefault<z.ZodNumber>;
21
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
22
+ }, "strict", z.ZodTypeAny, {
23
+ width: number;
24
+ height: number;
25
+ value: number;
26
+ format: "png" | "jpg";
27
+ min: number;
28
+ max: number;
29
+ label?: string | undefined;
30
+ output_path?: string | undefined;
31
+ thresholds?: {
32
+ color: string;
33
+ value: number;
34
+ }[] | undefined;
35
+ }, {
36
+ value: number;
37
+ width?: number | undefined;
38
+ height?: number | undefined;
39
+ label?: string | undefined;
40
+ output_path?: string | undefined;
41
+ format?: "png" | "jpg" | undefined;
42
+ min?: number | undefined;
43
+ max?: number | undefined;
44
+ thresholds?: {
45
+ color: string;
46
+ value: number;
47
+ }[] | undefined;
48
+ }>;
49
+ export type ChartGaugeInput = z.infer<typeof ChartGaugeSchema>;
50
+ export declare const chartGaugeTool: {
51
+ name: string;
52
+ title: string;
53
+ description: string;
54
+ inputSchema: z.ZodObject<{
55
+ value: z.ZodNumber;
56
+ label: z.ZodOptional<z.ZodString>;
57
+ min: z.ZodDefault<z.ZodNumber>;
58
+ max: z.ZodDefault<z.ZodNumber>;
59
+ thresholds: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ value: z.ZodNumber;
61
+ color: z.ZodString;
62
+ }, "strict", z.ZodTypeAny, {
63
+ color: string;
64
+ value: number;
65
+ }, {
66
+ color: string;
67
+ value: number;
68
+ }>, "many">>;
69
+ } & {
70
+ output_path: z.ZodOptional<z.ZodString>;
71
+ width: z.ZodDefault<z.ZodNumber>;
72
+ height: z.ZodDefault<z.ZodNumber>;
73
+ format: z.ZodDefault<z.ZodEnum<["png", "jpg"]>>;
74
+ }, "strict", z.ZodTypeAny, {
75
+ width: number;
76
+ height: number;
77
+ value: number;
78
+ format: "png" | "jpg";
79
+ min: number;
80
+ max: number;
81
+ label?: string | undefined;
82
+ output_path?: string | undefined;
83
+ thresholds?: {
84
+ color: string;
85
+ value: number;
86
+ }[] | undefined;
87
+ }, {
88
+ value: number;
89
+ width?: number | undefined;
90
+ height?: number | undefined;
91
+ label?: string | undefined;
92
+ output_path?: string | undefined;
93
+ format?: "png" | "jpg" | undefined;
94
+ min?: number | undefined;
95
+ max?: number | undefined;
96
+ thresholds?: {
97
+ color: string;
98
+ value: number;
99
+ }[] | undefined;
100
+ }>;
101
+ annotations: {
102
+ readOnlyHint: boolean;
103
+ destructiveHint: boolean;
104
+ idempotentHint: boolean;
105
+ openWorldHint: boolean;
106
+ };
107
+ };
108
+ export declare function executeChartGauge(params: ChartGaugeInput): Promise<{
109
+ content: ({
110
+ type: "text";
111
+ text: string;
112
+ data?: undefined;
113
+ mimeType?: undefined;
114
+ } | {
115
+ type: "image";
116
+ data: string;
117
+ mimeType: "image/png" | "image/jpeg";
118
+ text?: undefined;
119
+ })[];
120
+ }>;
@@ -0,0 +1 @@
1
+ import{z}from"zod";import{GaugeThresholdSchema,BaseChartParams}from"../../schemas.js";import{renderChart,chartResultToContent}from"../../chart-engine.js";import{DOTZERO_COLORS}from"../../colors.js";export const ChartGaugeSchema=z.object({value:z.number().describe("Current value to display"),label:z.string().optional().describe("Metric label (e.g., 'OEE')"),min:z.number().default(0).describe("Gauge minimum"),max:z.number().default(100).describe("Gauge maximum"),thresholds:z.array(GaugeThresholdSchema).optional().describe("Threshold breakpoints with colors. Default: red<60, yellow<80, green>=80")}).merge(BaseChartParams).strict();export const chartGaugeTool={name:"chart_gauge",title:"Gauge Chart",description:"Generate a gauge/dial chart for a single KPI value with color thresholds.",inputSchema:ChartGaugeSchema,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}};export async function executeChartGauge(e){const{value:t,label:a,min:o,max:r}=e,l=r-o,i=Math.max(o,Math.min(r,t)),n=[...e.thresholds||[{value:60,color:DOTZERO_COLORS.defect},{value:80,color:DOTZERO_COLORS.idle},{value:100,color:DOTZERO_COLORS.good}]].sort((e,t)=>e.value-t.value);let s=n[n.length-1]?.color||DOTZERO_COLORS.good;for(const e of n)if(i<=e.value){s=e.color;break}const u=i-o,h={type:"doughnut",data:{labels:[a||"Value","Remaining"],datasets:[{data:[u,l-u],backgroundColor:[s,"#E0E0E0"],borderWidth:0}]},options:{responsive:!1,circumference:270,rotation:225,cutout:"75%",plugins:{title:{display:!0,text:`${a||"Value"}: ${t.toFixed(1)}%`,font:{size:18}},legend:{display:!1},tooltip:{enabled:!1}}}},c=await renderChart(h,{width:e.width,height:e.height,format:e.format,outputPath:e.output_path,title:a||"gauge"});return chartResultToContent(c)}
@@ -0,0 +1,9 @@
1
+ export { chartBarTool, executeChartBar, type ChartBarInput } from "./bar.js";
2
+ export { chartLineTool, executeChartLine, type ChartLineInput } from "./line.js";
3
+ export { chartPieTool, executeChartPie, type ChartPieInput } from "./pie.js";
4
+ export { chartScatterTool, executeChartScatter, type ChartScatterInput } from "./scatter.js";
5
+ export { chartGaugeTool, executeChartGauge, type ChartGaugeInput } from "./gauge.js";
6
+ export { chartOeeBreakdownTool, executeChartOeeBreakdown, type ChartOeeBreakdownInput } from "./oee-breakdown.js";
7
+ export { chartControlTool, executeChartControl, type ChartControlInput } from "./control-chart.js";
8
+ export { chartTimelineTool, executeChartTimeline, type ChartTimelineInput } from "./timeline.js";
9
+ export { chartMultiTool, executeChartMulti, type ChartMultiInput } from "./multi.js";
@@ -0,0 +1 @@
1
+ export{chartBarTool,executeChartBar}from"./bar.js";export{chartLineTool,executeChartLine}from"./line.js";export{chartPieTool,executeChartPie}from"./pie.js";export{chartScatterTool,executeChartScatter}from"./scatter.js";export{chartGaugeTool,executeChartGauge}from"./gauge.js";export{chartOeeBreakdownTool,executeChartOeeBreakdown}from"./oee-breakdown.js";export{chartControlTool,executeChartControl}from"./control-chart.js";export{chartTimelineTool,executeChartTimeline}from"./timeline.js";export{chartMultiTool,executeChartMulti}from"./multi.js";