@8btc/ppt-generator-mcp 0.0.12 → 0.0.14
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/dist/index.js +7 -1
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.js +36 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const zod_1 = require("zod");
|
|
|
13
13
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
14
14
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
15
15
|
require("./node-only");
|
|
16
|
+
const logger_js_1 = __importDefault(require("./utils/logger.js"));
|
|
16
17
|
class PPTGeneratorMCPServer {
|
|
17
18
|
constructor() {
|
|
18
19
|
this.server = new mcp_js_1.McpServer({
|
|
@@ -101,6 +102,7 @@ class PPTGeneratorMCPServer {
|
|
|
101
102
|
])),
|
|
102
103
|
},
|
|
103
104
|
}, async ({ outline, templateFilePath, outputPath }) => {
|
|
105
|
+
logger_js_1.default.info("generate_ppt", { outline, templateFilePath, outputPath });
|
|
104
106
|
if (!templateFilePath) {
|
|
105
107
|
templateFilePath = node_path_1.default.join(__dirname, "tpls", "tpl-2.json");
|
|
106
108
|
}
|
|
@@ -162,6 +164,7 @@ class PPTGeneratorMCPServer {
|
|
|
162
164
|
}
|
|
163
165
|
catch (err) {
|
|
164
166
|
console.error(err);
|
|
167
|
+
logger_js_1.default.error("generate_ppt error", err);
|
|
165
168
|
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, "生成PPT失败");
|
|
166
169
|
}
|
|
167
170
|
});
|
|
@@ -174,4 +177,7 @@ class PPTGeneratorMCPServer {
|
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
const server = new PPTGeneratorMCPServer();
|
|
177
|
-
server.run().catch(
|
|
180
|
+
server.run().catch((err) => {
|
|
181
|
+
console.error(err);
|
|
182
|
+
logger_js_1.default.error("PPTGeneratorMCPServer run error", err);
|
|
183
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const winston_1 = __importDefault(require("winston"));
|
|
7
|
+
const logger = winston_1.default.createLogger({
|
|
8
|
+
level: "info",
|
|
9
|
+
format: winston_1.default.format.json(),
|
|
10
|
+
defaultMeta: { service: "user-service" },
|
|
11
|
+
transports: [
|
|
12
|
+
//
|
|
13
|
+
// - Write all logs with importance level of `error` or higher to `error.log`
|
|
14
|
+
// (i.e., error, fatal, but not other levels)
|
|
15
|
+
//
|
|
16
|
+
new winston_1.default.transports.File({
|
|
17
|
+
filename: "loggererror.log",
|
|
18
|
+
level: "error",
|
|
19
|
+
}),
|
|
20
|
+
//
|
|
21
|
+
// - Write all logs with importance level of `info` or higher to `combined.log`
|
|
22
|
+
// (i.e., fatal, error, warn, and info, but not trace)
|
|
23
|
+
//
|
|
24
|
+
new winston_1.default.transports.File({ filename: "logercombined.log" }),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
//
|
|
28
|
+
// If we're not in production then log to the `console` with the format:
|
|
29
|
+
// `${info.level}: ${info.message} JSON.stringify({ ...rest }) `
|
|
30
|
+
//
|
|
31
|
+
if (process.env.NODE_ENV !== "production") {
|
|
32
|
+
logger.add(new winston_1.default.transports.Console({
|
|
33
|
+
format: winston_1.default.format.simple(),
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
exports.default = logger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@8btc/ppt-generator-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "MCP service for generating PPT files from AI-generated outlines and templates",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"svg-arc-to-cubic-bezier": "^3.2.0",
|
|
43
43
|
"svg-pathdata": "^8.0.0",
|
|
44
44
|
"tinycolor2": "^1.6.0",
|
|
45
|
-
"uuid": "^9.0.1"
|
|
45
|
+
"uuid": "^9.0.1",
|
|
46
|
+
"winston": "^3.19.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@types/fs-extra": "^11.0.4",
|