mulmocast-vision 0.1.2 → 0.1.3
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/lib/{mcp/core.js → mcp.js} +15 -3
- package/lib/{mcp_tools.d.ts → tools/mcp_tools.d.ts} +1 -1
- package/lib/{tools.d.ts → tools/tools.d.ts} +3 -3
- package/lib/utils.js +3 -1
- package/package.json +3 -3
- package/lib/mcp/cli.d.ts +0 -2
- package/lib/mcp/cli.js +0 -22
- package/lib/mcp/test.d.ts +0 -1
- package/lib/mcp/test.js +0 -56
- /package/lib/{mcp/core.d.ts → mcp.d.ts} +0 -0
- /package/lib/{mcp_tools.js → tools/mcp_tools.js} +0 -0
- /package/lib/{tools.js → tools/tools.js} +0 -0
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.getServer = void 0;
|
|
5
5
|
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
6
6
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
7
|
-
const tools_1 = require("
|
|
8
|
-
const html_class_1 = require("
|
|
9
|
-
const commons_1 = require("
|
|
7
|
+
const tools_1 = require("./tools");
|
|
8
|
+
const html_class_1 = require("./presentationHandlers/html_class");
|
|
9
|
+
const commons_1 = require("./commons");
|
|
10
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
10
12
|
const getServer = (rootDir, outputDir) => {
|
|
11
13
|
const server = new index_js_1.Server({
|
|
12
14
|
name: "mulmocast-vision-mcp",
|
|
@@ -24,6 +26,7 @@ const getServer = (rootDir, outputDir) => {
|
|
|
24
26
|
// Handle tool calls
|
|
25
27
|
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
26
28
|
const { name, arguments: args } = request.params;
|
|
29
|
+
console.error([...tools_1.tools, ...tools_1.mcp_tools]);
|
|
27
30
|
try {
|
|
28
31
|
if (args) {
|
|
29
32
|
const fileName = (0, commons_1.generateUniqueId)();
|
|
@@ -55,3 +58,12 @@ const getServer = (rootDir, outputDir) => {
|
|
|
55
58
|
return server;
|
|
56
59
|
};
|
|
57
60
|
exports.getServer = getServer;
|
|
61
|
+
const main = async () => {
|
|
62
|
+
const rootDir = (0, utils_1.getRootDir)();
|
|
63
|
+
const outputDir = (0, utils_1.getOutDir)();
|
|
64
|
+
(0, utils_1.mkdir)(outputDir);
|
|
65
|
+
const server = (0, exports.getServer)(rootDir, outputDir);
|
|
66
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
67
|
+
await server.connect(transport);
|
|
68
|
+
};
|
|
69
|
+
main();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenAITool } from "
|
|
1
|
+
import { OpenAITool } from "../type";
|
|
2
2
|
export declare const mcp_tools: OpenAITool[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { OpenAITool } from "
|
|
1
|
+
import { OpenAITool } from "../type";
|
|
2
2
|
export declare const toolsBase: OpenAITool[];
|
|
3
3
|
export declare const tools: {
|
|
4
4
|
type: "function";
|
|
5
5
|
function: {
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|
|
8
|
-
parameters: import("
|
|
8
|
+
parameters: import("../type").ToolParametersSchema;
|
|
9
9
|
};
|
|
10
10
|
}[];
|
|
11
11
|
export declare const toolsForBeat: {
|
|
@@ -13,6 +13,6 @@ export declare const toolsForBeat: {
|
|
|
13
13
|
function: {
|
|
14
14
|
name: string;
|
|
15
15
|
description: string;
|
|
16
|
-
parameters: import("
|
|
16
|
+
parameters: import("../type").ToolParametersSchema;
|
|
17
17
|
};
|
|
18
18
|
}[];
|
package/lib/utils.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.debugLogger = exports.getOutDir = exports.getRootDir = exports.writeJSONData = exports.mkdir = exports.createPage = exports.getHTMLFile = exports.interpolate = exports.renderHTMLToImage = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
9
10
|
const puppeteer_1 = __importDefault(require("puppeteer"));
|
|
10
11
|
const isCI = process.env.CI === "true";
|
|
11
12
|
const renderHTMLToImage = async (html, outputPath, width, height) => {
|
|
@@ -70,8 +71,9 @@ const getRootDir = () => {
|
|
|
70
71
|
};
|
|
71
72
|
exports.getRootDir = getRootDir;
|
|
72
73
|
const getOutDir = () => {
|
|
74
|
+
const documentsDir = path_1.default.join(os_1.default.homedir(), "Documents");
|
|
73
75
|
const now = Date.now();
|
|
74
|
-
return path_1.default.
|
|
76
|
+
return path_1.default.join(documentsDir, "mulmocast-vision", String(now));
|
|
75
77
|
};
|
|
76
78
|
exports.getOutDir = getOutDir;
|
|
77
79
|
const debugLogger = (data) => {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast-vision",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Slide geneartor",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"mulmocast-vision": "lib/mcp
|
|
7
|
+
"mulmocast-vision": "lib/mcp.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"./lib",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"license": "AGPL-3.0-or-later",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.17.5",
|
|
36
|
-
"graphai": "^2.0.14",
|
|
37
36
|
"nunjucks": "^3.2.4",
|
|
38
37
|
"pdfkit": "^0.17.2",
|
|
39
38
|
"puppeteer": "^24.19.0"
|
|
@@ -44,6 +43,7 @@
|
|
|
44
43
|
"eslint": "^9.35.0",
|
|
45
44
|
"eslint-config-prettier": "^10.1.8",
|
|
46
45
|
"eslint-plugin-prettier": "^5.5.4",
|
|
46
|
+
"graphai": "^2.0.14",
|
|
47
47
|
"prettier": "^3.6.2",
|
|
48
48
|
"ts-node": "^10.9.2",
|
|
49
49
|
"typescript": "^5.9.2",
|
package/lib/mcp/cli.d.ts
DELETED
package/lib/mcp/cli.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
|
-
const core_1 = require("./core");
|
|
10
|
-
const os_1 = __importDefault(require("os"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const main = async () => {
|
|
13
|
-
const rootDir = (0, utils_1.getRootDir)();
|
|
14
|
-
const documentsDir = path_1.default.join(os_1.default.homedir(), "Documents");
|
|
15
|
-
const now = Date.now();
|
|
16
|
-
const outputDir = path_1.default.join(documentsDir, "mulmocast-vision", String(now));
|
|
17
|
-
(0, utils_1.mkdir)(outputDir);
|
|
18
|
-
const server = (0, core_1.getServer)(rootDir, outputDir);
|
|
19
|
-
const transport = new stdio_js_1.StdioServerTransport();
|
|
20
|
-
await server.connect(transport);
|
|
21
|
-
};
|
|
22
|
-
main();
|
package/lib/mcp/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/mcp/test.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
4
|
-
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
-
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
6
|
-
const server = new index_js_1.Server({
|
|
7
|
-
name: "mock-mcp-server",
|
|
8
|
-
version: "0.1.0",
|
|
9
|
-
}, {
|
|
10
|
-
capabilities: {
|
|
11
|
-
tools: {},
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
// Tool 一覧を返す
|
|
15
|
-
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
16
|
-
return {
|
|
17
|
-
tools: [
|
|
18
|
-
{
|
|
19
|
-
name: "hello",
|
|
20
|
-
description: "Return a simple greeting",
|
|
21
|
-
inputSchema: { type: "object", properties: {} },
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "createSectionDividerPage",
|
|
25
|
-
description: "Insert a new slide in the presentation that serves as a section divider. This slide must include both a large main heading and a subtitle. Use this when the user wants to create a single slide that clearly introduces or separates a new section in their presentation.",
|
|
26
|
-
inputSchema: {
|
|
27
|
-
type: "object",
|
|
28
|
-
properties: {
|
|
29
|
-
heading: { type: "string", description: "Main section title, shown prominently on the slide" },
|
|
30
|
-
subheading: { type: "string", description: "Subtitle that provides context or explanation for the section" },
|
|
31
|
-
},
|
|
32
|
-
required: ["heading", "subheading"],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
// Tool 呼び出しを処理
|
|
39
|
-
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
40
|
-
if (request.params.name === "hello") {
|
|
41
|
-
return {
|
|
42
|
-
content: [{ type: "text", text: "Hello from MCP mock server!" }],
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
46
|
-
});
|
|
47
|
-
// エントリポイント
|
|
48
|
-
async function main() {
|
|
49
|
-
const transport = new stdio_js_1.StdioServerTransport();
|
|
50
|
-
await server.connect(transport);
|
|
51
|
-
console.error("✅ MCP Mock Server running on stdio");
|
|
52
|
-
}
|
|
53
|
-
main().catch((err) => {
|
|
54
|
-
console.error("❌ Failed to start server:", err);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|