@vint.tri/report_gen_mcp 1.0.43 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -45
- package/detailed-debug.js +1 -1
- package/dist/charts/bar.js +22 -29
- package/dist/charts/line.js +22 -29
- package/dist/charts/pie.js +21 -28
- package/dist/index.js +79 -336
- package/dist/utils/reportGenerator.js +21 -28
- package/dollar_to_ruble_report.html +4 -55
- package/final-verification-test.js +112 -197
- package/package.json +11 -10
- package/src/charts/bar.ts +7 -20
- package/src/charts/line.ts +7 -20
- package/src/charts/pie.ts +7 -20
- package/src/index.ts +45 -330
- package/src/utils/reportGenerator.ts +6 -21
- package/COMPLETED_TASK_SUMMARY.md +0 -77
- package/FINAL_IMPLEMENTATION_SUMMARY.md +0 -54
- package/PUBLISH_SUMMARY.md +0 -46
- package/check-file-content.js +0 -94
- package/corrected-final-verification.js +0 -196
- package/demo-latest-features-report.html +0 -15
- package/demo-new-methods.js +0 -185
- package/demonstrate-all-features.js +0 -168
- package/demonstrate-latest-features.js +0 -146
- package/demonstrate-new-features.js +0 -205
- package/demonstrate-new-methods.js +0 -185
- package/detailed-file-opening-test.js +0 -212
- package/direct-test.js +0 -31
- package/dollar_rub_report.html +0 -51
- package/http_test_reports/http_test.html +0 -15
- package/large-test.html +0 -52
- package/manual-file-url-test.js +0 -89
- package/package/README.md +0 -445
- package/package/cwd-report.html +0 -18
- package/package/debug-report.html +0 -15
- package/package/demonstrate-reports-dir-feature.js +0 -70
- package/package/demonstration.js +0 -200
- package/package/detailed-debug.js +0 -36
- package/package/dist/charts/bar.js +0 -43
- package/package/dist/charts/line.js +0 -43
- package/package/dist/charts/pie.js +0 -42
- package/package/dist/index.js +0 -233
- package/package/dist/utils/reportGenerator.js +0 -59
- package/package/dollar_to_ruble_report.html +0 -15
- package/package/final-verification-test.js +0 -139
- package/package/fix-verification-report.html +0 -18
- package/package/package.json +0 -35
- package/package/random_report.html +0 -19
- package/package/simple-file-test.js +0 -60
- package/package/src/charts/bar.ts +0 -43
- package/package/src/charts/line.ts +0 -43
- package/package/src/charts/pie.ts +0 -42
- package/package/src/index.ts +0 -242
- package/package/src/utils/reportGenerator.ts +0 -60
- package/package/tsconfig.json +0 -14
- package/problematic-file-test.js +0 -105
- package/published-package-verification.js +0 -225
- package/simple-test-tools.js +0 -80
- package/simple-usage-demo.js +0 -94
- package/test-install/package-lock.json +0 -2265
- package/test-install/package.json +0 -15
- package/test-interactive-charts-report.html +0 -55
- package/test-similar-content.html +0 -14
- package/test.html +0 -1
- package/test_install/package-lock.json +0 -2264
- package/test_install/package.json +0 -15
- package/test_published/dollar_to_ruble_report.html +0 -15
- package/test_published/package-lock.json +0 -2264
- package/test_published/package.json +0 -15
- package/test_published/proper-test-published.js +0 -175
- package/test_published/simple-test-published.js +0 -84
- package/test_reports/cli_test.html +0 -14
- package/test_reports/comprehensive-test.html +0 -14
- package/test_reports/new-report.html +0 -12
- package/test_reports/simple-test.html +0 -1
- package/test_reports/test-file.html +0 -1
- package/test_reports/test-report-final.html +0 -13
- package/test_reports/test-report-fixed.html +0 -13
- package/test_reports/test-report-improved.html +0 -14
- package/test_reports/test-report-literal-fix.html +0 -14
package/README.md
CHANGED
|
@@ -17,13 +17,13 @@ A powerful CLI tool for generating HTML reports with embedded charts, designed t
|
|
|
17
17
|
### Global Installation (Recommended)
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install -g @vint.tri/report_gen_mcp@1.0.
|
|
20
|
+
npm install -g @vint.tri/report_gen_mcp@1.0.45
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Direct Execution with npx
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
REPORTS_DIR=./reports npx @vint.tri/report_gen_mcp@1.0.
|
|
26
|
+
REPORTS_DIR=./reports npx @vint.tri/report_gen_mcp@1.0.45
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
@@ -80,7 +80,7 @@ To use this tool with Claude Desktop, add the following configuration to your Cl
|
|
|
80
80
|
"REPORTS_DIR": "./reports"
|
|
81
81
|
},
|
|
82
82
|
"args": [
|
|
83
|
-
"@vint.tri/report_gen_mcp@1.0.
|
|
83
|
+
"@vint.tri/report_gen_mcp@1.0.45"
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -366,10 +366,9 @@ npm test
|
|
|
366
366
|
### Methods
|
|
367
367
|
|
|
368
368
|
1. `generate-report`: Creates an HTML report with embedded charts
|
|
369
|
-
2. `get-report-url`: Returns a clickable URL for a generated report file
|
|
370
|
-
3. `
|
|
371
|
-
4. `
|
|
372
|
-
5. `mcp:list-tools`: Returns available tools (used by Claude Desktop)
|
|
369
|
+
2. `get-report-url`: Returns a clickable URL for a generated report file
|
|
370
|
+
3. `health`: Checks if the tool is running correctly
|
|
371
|
+
4. `mcp:list-tools`: Returns available tools (used by Claude Desktop)
|
|
373
372
|
|
|
374
373
|
### Method Details
|
|
375
374
|
|
|
@@ -394,7 +393,7 @@ npm test
|
|
|
394
393
|
|
|
395
394
|
#### get-report-url
|
|
396
395
|
|
|
397
|
-
**Description:** Get
|
|
396
|
+
**Description:** Get a clickable URL for a generated report file
|
|
398
397
|
|
|
399
398
|
**Parameters:**
|
|
400
399
|
- `filePath` (string): Full path to the report file
|
|
@@ -403,48 +402,12 @@ npm test
|
|
|
403
402
|
```json
|
|
404
403
|
{
|
|
405
404
|
"success": true,
|
|
406
|
-
"message": "Report file information retrieved successfully",
|
|
407
|
-
"filePath": "/absolute/path/to/report.html",
|
|
408
|
-
"relativePath": "report.html",
|
|
409
405
|
"fileUrl": "file:///absolute/path/to/report.html",
|
|
410
|
-
"
|
|
411
|
-
"size": 12345,
|
|
412
|
-
"created": "2023-01-01T00:00:00.000Z",
|
|
413
|
-
"modified": "2023-01-01T00:00:00.000Z"
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
**Note:** This method only returns metadata about the file, not the file content itself. Use `get-report-file` to retrieve the actual file content.
|
|
419
|
-
|
|
420
|
-
#### get-report-file
|
|
421
|
-
|
|
422
|
-
**Description:** Get the content of a generated report file
|
|
423
|
-
|
|
424
|
-
**Parameters:**
|
|
425
|
-
- `filePath` (string): Full path to the report file
|
|
426
|
-
|
|
427
|
-
**Response:**
|
|
428
|
-
```json
|
|
429
|
-
{
|
|
430
|
-
"success": true,
|
|
431
|
-
"message": "Report file content retrieved successfully",
|
|
406
|
+
"message": "Click the URL to open the report",
|
|
432
407
|
"filePath": "/absolute/path/to/report.html"
|
|
433
408
|
}
|
|
434
409
|
```
|
|
435
410
|
|
|
436
|
-
The file content is returned as a resource attachment in the response with the following structure:
|
|
437
|
-
```json
|
|
438
|
-
{
|
|
439
|
-
"type": "resource",
|
|
440
|
-
"resource": {
|
|
441
|
-
"uri": "file:///absolute/path/to/report.html",
|
|
442
|
-
"mimeType": "text/html",
|
|
443
|
-
"text": "<!DOCTYPE html><html>...</html>"
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
```
|
|
447
|
-
|
|
448
411
|
#### health
|
|
449
412
|
|
|
450
413
|
**Response:**
|
package/detailed-debug.js
CHANGED
|
@@ -2,7 +2,7 @@ const { spawn } = require('child_process');
|
|
|
2
2
|
|
|
3
3
|
console.log('Detailed debug test...\n');
|
|
4
4
|
|
|
5
|
-
const child = spawn('npx', ['-y', '@vint.tri/report_gen_mcp@1.0.
|
|
5
|
+
const child = spawn('npx', ['-y', '@vint.tri/report_gen_mcp@1.0.45'], {
|
|
6
6
|
stdio: ['pipe', 'pipe', 'pipe']
|
|
7
7
|
});
|
|
8
8
|
|
package/dist/charts/bar.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.barSchema = void 0;
|
|
4
|
+
exports.renderBarChart = renderBarChart;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const chartjs_node_canvas_1 = require("chartjs-node-canvas");
|
|
7
|
+
exports.barSchema = zod_1.z.object({
|
|
8
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
9
|
+
datasets: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
label: zod_1.z.string(),
|
|
11
|
+
data: zod_1.z.array(zod_1.z.number()),
|
|
12
|
+
backgroundColor: zod_1.z.array(zod_1.z.string()).optional(),
|
|
13
|
+
borderColor: zod_1.z.array(zod_1.z.string()).optional(),
|
|
9
14
|
})),
|
|
10
|
-
options: z.object({
|
|
11
|
-
title: z.string().optional(),
|
|
15
|
+
options: zod_1.z.object({
|
|
16
|
+
title: zod_1.z.string().optional(),
|
|
12
17
|
// Add more Chart.js options as needed
|
|
13
18
|
}).optional(),
|
|
14
19
|
});
|
|
15
|
-
|
|
16
|
-
// Generate a unique ID for the canvas element
|
|
17
|
-
const chartId = `bar-chart-${Math.random().toString(36).substr(2, 9)}`;
|
|
18
|
-
// Prepare the chart configuration as a JSON string
|
|
20
|
+
async function renderBarChart(config) {
|
|
19
21
|
const chartConfig = {
|
|
20
22
|
type: 'bar',
|
|
21
23
|
data: {
|
|
@@ -32,19 +34,10 @@ export async function renderBarChart(config) {
|
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
36
|
};
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<script>
|
|
42
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
43
|
-
var ctx = document.getElementById('${chartId}').getContext('2d');
|
|
44
|
-
var chartConfig = ${chartConfigJson};
|
|
45
|
-
new Chart(ctx, chartConfig);
|
|
46
|
-
});
|
|
47
|
-
</script>
|
|
48
|
-
</div>
|
|
49
|
-
`.trim();
|
|
37
|
+
const width = 800;
|
|
38
|
+
const height = 600;
|
|
39
|
+
const chartJSNodeCanvas = new chartjs_node_canvas_1.ChartJSNodeCanvas({ width, height });
|
|
40
|
+
const buffer = await chartJSNodeCanvas.renderToBuffer(chartConfig);
|
|
41
|
+
const base64Image = buffer.toString('base64');
|
|
42
|
+
return `<img src="data:image/png;base64,${base64Image}" alt="Chart" />`;
|
|
50
43
|
}
|
package/dist/charts/line.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lineSchema = void 0;
|
|
4
|
+
exports.renderLineChart = renderLineChart;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const chartjs_node_canvas_1 = require("chartjs-node-canvas");
|
|
7
|
+
exports.lineSchema = zod_1.z.object({
|
|
8
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
9
|
+
datasets: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
label: zod_1.z.string(),
|
|
11
|
+
data: zod_1.z.array(zod_1.z.number()),
|
|
12
|
+
borderColor: zod_1.z.array(zod_1.z.string()).optional(),
|
|
13
|
+
fill: zod_1.z.boolean().optional(),
|
|
9
14
|
})),
|
|
10
|
-
options: z.object({
|
|
11
|
-
title: z.string().optional(),
|
|
15
|
+
options: zod_1.z.object({
|
|
16
|
+
title: zod_1.z.string().optional(),
|
|
12
17
|
// Add more Chart.js options as needed
|
|
13
18
|
}).optional(),
|
|
14
19
|
});
|
|
15
|
-
|
|
16
|
-
// Generate a unique ID for the canvas element
|
|
17
|
-
const chartId = `line-chart-${Math.random().toString(36).substr(2, 9)}`;
|
|
18
|
-
// Prepare the chart configuration as a JSON string
|
|
20
|
+
async function renderLineChart(config) {
|
|
19
21
|
const chartConfig = {
|
|
20
22
|
type: 'line',
|
|
21
23
|
data: {
|
|
@@ -32,19 +34,10 @@ export async function renderLineChart(config) {
|
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
36
|
};
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<script>
|
|
42
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
43
|
-
var ctx = document.getElementById('${chartId}').getContext('2d');
|
|
44
|
-
var chartConfig = ${chartConfigJson};
|
|
45
|
-
new Chart(ctx, chartConfig);
|
|
46
|
-
});
|
|
47
|
-
</script>
|
|
48
|
-
</div>
|
|
49
|
-
`.trim();
|
|
37
|
+
const width = 800;
|
|
38
|
+
const height = 600;
|
|
39
|
+
const chartJSNodeCanvas = new chartjs_node_canvas_1.ChartJSNodeCanvas({ width, height });
|
|
40
|
+
const buffer = await chartJSNodeCanvas.renderToBuffer(chartConfig);
|
|
41
|
+
const base64Image = buffer.toString('base64');
|
|
42
|
+
return `<img src="data:image/png;base64,${base64Image}" alt="Chart" />`;
|
|
50
43
|
}
|
package/dist/charts/pie.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pieSchema = void 0;
|
|
4
|
+
exports.renderPieChart = renderPieChart;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const chartjs_node_canvas_1 = require("chartjs-node-canvas");
|
|
7
|
+
exports.pieSchema = zod_1.z.object({
|
|
8
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
9
|
+
datasets: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
data: zod_1.z.array(zod_1.z.number()),
|
|
11
|
+
backgroundColor: zod_1.z.array(zod_1.z.string()).optional(),
|
|
12
|
+
borderColor: zod_1.z.array(zod_1.z.string()).optional(),
|
|
8
13
|
})),
|
|
9
|
-
options: z.object({
|
|
10
|
-
title: z.string().optional(),
|
|
14
|
+
options: zod_1.z.object({
|
|
15
|
+
title: zod_1.z.string().optional(),
|
|
11
16
|
// Add more Chart.js options as needed
|
|
12
17
|
}).optional(),
|
|
13
18
|
});
|
|
14
|
-
|
|
15
|
-
// Generate a unique ID for the canvas element
|
|
16
|
-
const chartId = `pie-chart-${Math.random().toString(36).substr(2, 9)}`;
|
|
17
|
-
// Prepare the chart configuration as a JSON string
|
|
19
|
+
async function renderPieChart(config) {
|
|
18
20
|
const chartConfig = {
|
|
19
21
|
type: 'pie',
|
|
20
22
|
data: {
|
|
@@ -31,19 +33,10 @@ export async function renderPieChart(config) {
|
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
};
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
42
|
-
var ctx = document.getElementById('${chartId}').getContext('2d');
|
|
43
|
-
var chartConfig = ${chartConfigJson};
|
|
44
|
-
new Chart(ctx, chartConfig);
|
|
45
|
-
});
|
|
46
|
-
</script>
|
|
47
|
-
</div>
|
|
48
|
-
`.trim();
|
|
36
|
+
const width = 800;
|
|
37
|
+
const height = 600;
|
|
38
|
+
const chartJSNodeCanvas = new chartjs_node_canvas_1.ChartJSNodeCanvas({ width, height });
|
|
39
|
+
const buffer = await chartJSNodeCanvas.renderToBuffer(chartConfig);
|
|
40
|
+
const base64Image = buffer.toString('base64');
|
|
41
|
+
return `<img src="data:image/png;base64,${base64Image}" alt="Chart" />`;
|
|
49
42
|
}
|