mulmocast-vision 0.0.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.
- package/LICENSE +661 -0
- package/README.md +102 -0
- package/assets/html/agendaPage.html +13 -0
- package/assets/html/balanceSheetPage.html +29 -0
- package/assets/html/balancedScorecardPage.html +15 -0
- package/assets/html/bcgMatrixPage.html +37 -0
- package/assets/html/beforeAfterPage.html +21 -0
- package/assets/html/benchmarkingTablePage.html +23 -0
- package/assets/html/bubbleChartPlaceholderPage.html +9 -0
- package/assets/html/businessModelCanvasPage.html +14 -0
- package/assets/html/capabilityMaturityPage.html +8 -0
- package/assets/html/cashFlowPage.html +21 -0
- package/assets/html/changeCurvePage.html +11 -0
- package/assets/html/circularEconomyMapPage.html +8 -0
- package/assets/html/communicationPlanPage.html +22 -0
- package/assets/html/complianceHeatmapPage.html +19 -0
- package/assets/html/costStructurePage.html +20 -0
- package/assets/html/csrInitiativesPage.html +8 -0
- package/assets/html/cultureValuesPage.html +21 -0
- package/assets/html/customerJourneyPage.html +21 -0
- package/assets/html/customerSuccessJourneyPage.html +15 -0
- package/assets/html/digitalMaturityPage.html +14 -0
- package/assets/html/driverTreePage.html +20 -0
- package/assets/html/ecosystemMapPage.html +11 -0
- package/assets/html/esgFrameworkPage.html +28 -0
- package/assets/html/executiveSummaryPage.html +15 -0
- package/assets/html/fourPPage.html +36 -0
- package/assets/html/funnelPage.html +8 -0
- package/assets/html/ganttSimplePage.html +21 -0
- package/assets/html/geMcKinseyMatrixPage.html +13 -0
- package/assets/html/heatmapPlaceholderPage.html +24 -0
- package/assets/html/hypothesisPage.html +22 -0
- package/assets/html/innovationFunnelPage.html +13 -0
- package/assets/html/integrationPlanPage.html +21 -0
- package/assets/html/issueTreePage.html +23 -0
- package/assets/html/keyMessageWithSupportsPage.html +13 -0
- package/assets/html/kpiHighlightPage.html +14 -0
- package/assets/html/launchPlanPage.html +29 -0
- package/assets/html/mAPipelinePage.html +16 -0
- package/assets/html/marimekkoPlaceholderPage.html +9 -0
- package/assets/html/marketDriversPage.html +8 -0
- package/assets/html/marketingMixPage.html +11 -0
- package/assets/html/meceListPage.html +15 -0
- package/assets/html/milestoneTimelinePage.html +14 -0
- package/assets/html/npvSummaryPage.html +12 -0
- package/assets/html/okrKpiDashboardPage.html +16 -0
- package/assets/html/optionEvaluationPage.html +23 -0
- package/assets/html/orgChartPage.html +8 -0
- package/assets/html/pLBreakdownPage.html +19 -0
- package/assets/html/partnershipMapPage.html +11 -0
- package/assets/html/personasPage.html +19 -0
- package/assets/html/pipelineFunnelPage.html +8 -0
- package/assets/html/porterFiveForcesPage.html +44 -0
- package/assets/html/positioningMapPage.html +11 -0
- package/assets/html/pricingWaterfallPage.html +8 -0
- package/assets/html/productRoadmapPage.html +15 -0
- package/assets/html/pyramidPrinciplePage.html +27 -0
- package/assets/html/quarterlyRoadmapPage.html +15 -0
- package/assets/html/raciPage.html +23 -0
- package/assets/html/revenueModelPage.html +17 -0
- package/assets/html/riskMitigationPage.html +17 -0
- package/assets/html/salesDashboardPage.html +11 -0
- package/assets/html/scenarioPlanningPage.html +13 -0
- package/assets/html/scqaPage.html +27 -0
- package/assets/html/sectionDividerPage.html +7 -0
- package/assets/html/segmentationPage.html +15 -0
- package/assets/html/sensitivityAnalysisPage.html +22 -0
- package/assets/html/sevenSPage.html +11 -0
- package/assets/html/shareholderValueTreePage.html +8 -0
- package/assets/html/stakeholderMapPage.html +14 -0
- package/assets/html/supportOrgModelPage.html +21 -0
- package/assets/html/surveyResultsPage.html +11 -0
- package/assets/html/sustainabilityRoadmapPage.html +15 -0
- package/assets/html/swotPage.html +36 -0
- package/assets/html/synergyCapturePage.html +8 -0
- package/assets/html/tamSamSomPage.html +11 -0
- package/assets/html/techRoadmapPage.html +15 -0
- package/assets/html/thankYouContactPage.html +24 -0
- package/assets/html/threeCPage.html +28 -0
- package/assets/html/twoByTwoMatrixPage.html +17 -0
- package/assets/html/valueChainPage.html +18 -0
- package/assets/html/waterfallPage.html +8 -0
- package/assets/html2/agendaPage.html +26 -0
- package/assets/html2/balanceSheetPage.html +87 -0
- package/assets/html2/balancedScorecardPage.html +29 -0
- package/assets/html2/bcgMatrixPage.html +165 -0
- package/assets/html2/beforeAfterPage.html +78 -0
- package/assets/html2/benchmarkingTablePage.html +70 -0
- package/assets/html2/bubbleChartPlaceholderPage.html +107 -0
- package/assets/html2/businessModelCanvasPage.html +43 -0
- package/assets/html2/capabilityMaturityPage.html +38 -0
- package/assets/html2/cashFlowPage.html +68 -0
- package/assets/html2/changeCurvePage.html +53 -0
- package/assets/html2/circularEconomyMapPage.html +35 -0
- package/assets/html2/communicationPlanPage.html +82 -0
- package/assets/html2/complianceHeatmapPage.html +42 -0
- package/assets/html2/costStructurePage.html +60 -0
- package/assets/html2/csrInitiativesPage.html +26 -0
- package/assets/html2/cultureValuesPage.html +44 -0
- package/assets/html2/customerJourneyPage.html +68 -0
- package/assets/html2/customerSuccessJourneyPage.html +54 -0
- package/assets/html2/digitalMaturityPage.html +51 -0
- package/assets/html2/driverTreePage.html +92 -0
- package/assets/html2/ecosystemMapPage.html +30 -0
- package/assets/html2/esgFrameworkPage.html +66 -0
- package/assets/html2/executiveSummaryPage.html +27 -0
- package/assets/html2/fourPPage.html +85 -0
- package/assets/html2/funnelPage.html +53 -0
- package/assets/html2/ganttSimplePage.html +56 -0
- package/assets/html2/geMcKinseyMatrixPage.html +43 -0
- package/assets/html2/heatmapPlaceholderPage.html +131 -0
- package/assets/html2/hypothesisPage.html +100 -0
- package/assets/html2/innovationFunnelPage.html +61 -0
- package/assets/html2/integrationPlanPage.html +61 -0
- package/assets/html2/issueTreePage.html +97 -0
- package/assets/html2/keyMessageWithSupportsPage.html +47 -0
- package/assets/html2/kpiHighlightPage.html +54 -0
- package/assets/html2/launchPlanPage.html +86 -0
- package/assets/html2/mAPipelinePage.html +79 -0
- package/assets/html2/marimekkoPlaceholderPage.html +120 -0
- package/assets/html2/marketDriversPage.html +32 -0
- package/assets/html2/marketingMixPage.html +50 -0
- package/assets/html2/meceListPage.html +32 -0
- package/assets/html2/milestoneTimelinePage.html +59 -0
- package/assets/html2/npvSummaryPage.html +54 -0
- package/assets/html2/okrKpiDashboardPage.html +85 -0
- package/assets/html2/optionEvaluationPage.html +128 -0
- package/assets/html2/orgChartPage.html +30 -0
- package/assets/html2/pLBreakdownPage.html +73 -0
- package/assets/html2/partnershipMapPage.html +26 -0
- package/assets/html2/personasPage.html +39 -0
- package/assets/html2/pipelineFunnelPage.html +77 -0
- package/assets/html2/porterFiveForcesPage.html +140 -0
- package/assets/html2/positioningMapPage.html +40 -0
- package/assets/html2/pricingWaterfallPage.html +33 -0
- package/assets/html2/productRoadmapPage.html +47 -0
- package/assets/html2/pyramidPrinciplePage.html +47 -0
- package/assets/html2/quarterlyRoadmapPage.html +54 -0
- package/assets/html2/raciPage.html +49 -0
- package/assets/html2/revenueModelPage.html +54 -0
- package/assets/html2/riskMitigationPage.html +36 -0
- package/assets/html2/salesDashboardPage.html +58 -0
- package/assets/html2/scenarioPlanningPage.html +63 -0
- package/assets/html2/scqaPage.html +74 -0
- package/assets/html2/sectionDividerPage.html +25 -0
- package/assets/html2/segmentationPage.html +36 -0
- package/assets/html2/sensitivityAnalysisPage.html +82 -0
- package/assets/html2/sevenSPage.html +31 -0
- package/assets/html2/shareholderValueTreePage.html +32 -0
- package/assets/html2/stakeholderMapPage.html +36 -0
- package/assets/html2/supportOrgModelPage.html +57 -0
- package/assets/html2/surveyResultsPage.html +32 -0
- package/assets/html2/sustainabilityRoadmapPage.html +54 -0
- package/assets/html2/swotPage.html +97 -0
- package/assets/html2/synergyCapturePage.html +39 -0
- package/assets/html2/tamSamSomPage.html +62 -0
- package/assets/html2/techRoadmapPage.html +54 -0
- package/assets/html2/thankYouContactPage.html +78 -0
- package/assets/html2/threeCPage.html +66 -0
- package/assets/html2/twoByTwoMatrixPage.html +72 -0
- package/assets/html2/valueChainPage.html +56 -0
- package/assets/html2/waterfallPage.html +47 -0
- package/assets/templates/tailwind-sea.html +34 -0
- package/assets/templates/tailwind.html +14 -0
- package/lib/browser.d.ts +1 -0
- package/lib/browser.js +17 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +18 -0
- package/lib/mcp/server.d.ts +2 -0
- package/lib/mcp/server.js +77 -0
- package/lib/mcp/test.d.ts +1 -0
- package/lib/mcp/test.js +56 -0
- package/lib/presentation.d.ts +1 -0
- package/lib/presentation.js +67 -0
- package/lib/presentationHandlers/html.d.ts +322 -0
- package/lib/presentationHandlers/html.js +348 -0
- package/lib/presentationHandlers/html_class.d.ts +98 -0
- package/lib/presentationHandlers/html_class.js +266 -0
- package/lib/runner.d.ts +1 -0
- package/lib/runner.js +31 -0
- package/lib/server.d.ts +2 -0
- package/lib/server.js +76 -0
- package/lib/tools.d.ts +1 -0
- package/lib/tools.js +1604 -0
- package/lib/utils.d.ts +13 -0
- package/lib/utils.js +80 -0
- package/package.json +51 -0
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const renderHTMLToImage: (html: string, outputPath: string, width: number, height: number) => Promise<void>;
|
|
2
|
+
export declare const interpolate: (template: string, data: Record<string, string | undefined>) => string;
|
|
3
|
+
export declare const getHTMLFile: (filename: string) => string;
|
|
4
|
+
export declare const createPage: (outputFile: string, htmlBody: string, options?: {
|
|
5
|
+
htmlTemplateFile?: string;
|
|
6
|
+
headerStyle?: string;
|
|
7
|
+
htmlFile?: string;
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
export declare const mkdir: (dirPath: string) => void;
|
|
10
|
+
export declare const writeTools: (baseDir: string, tools: any) => void;
|
|
11
|
+
export declare const getRootDir: () => string;
|
|
12
|
+
export declare const getOutDir: () => string;
|
|
13
|
+
export declare const debugLogger: (data: unknown) => void;
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
exports.debugLogger = exports.getOutDir = exports.getRootDir = exports.writeTools = exports.mkdir = exports.createPage = exports.getHTMLFile = exports.interpolate = exports.renderHTMLToImage = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const puppeteer_1 = __importDefault(require("puppeteer"));
|
|
10
|
+
const isCI = process.env.CI === "true";
|
|
11
|
+
const rootDir = path_1.default.resolve(__dirname, "../");
|
|
12
|
+
const renderHTMLToImage = async (html, outputPath, width, height) => {
|
|
13
|
+
// Use Puppeteer to render HTML to an image
|
|
14
|
+
const browser = await puppeteer_1.default.launch({
|
|
15
|
+
args: isCI ? ["--no-sandbox"] : [],
|
|
16
|
+
});
|
|
17
|
+
const page = await browser.newPage();
|
|
18
|
+
// Set the page content to the HTML generated from the Markdown
|
|
19
|
+
await page.setContent(html);
|
|
20
|
+
// Adjust page settings if needed (like width, height, etc.)
|
|
21
|
+
await page.setViewport({ width, height });
|
|
22
|
+
// Step 3: Capture screenshot of the page (which contains the Markdown-rendered HTML)
|
|
23
|
+
await page.screenshot({
|
|
24
|
+
path: outputPath,
|
|
25
|
+
});
|
|
26
|
+
await browser.close();
|
|
27
|
+
};
|
|
28
|
+
exports.renderHTMLToImage = renderHTMLToImage;
|
|
29
|
+
const interpolate = (template, data) => {
|
|
30
|
+
return template.replace(/\$\{(.*?)\}/g, (_, key) => data[key.trim()] ?? "");
|
|
31
|
+
};
|
|
32
|
+
exports.interpolate = interpolate;
|
|
33
|
+
const getHTMLFile = (filename) => {
|
|
34
|
+
return fs_1.default.readFileSync(path_1.default.resolve(rootDir, `./assets/templates/${filename}.html`), "utf-8");
|
|
35
|
+
};
|
|
36
|
+
exports.getHTMLFile = getHTMLFile;
|
|
37
|
+
const createPage = async (outputFile, htmlBody, options) => {
|
|
38
|
+
const canvasSize = { width: 1536, height: 1024 };
|
|
39
|
+
const { htmlTemplateFile, headerStyle, htmlFile } = options ?? {};
|
|
40
|
+
const template = (0, exports.getHTMLFile)(htmlTemplateFile ?? "tailwind");
|
|
41
|
+
// console.log(template)
|
|
42
|
+
const htmlData = (0, exports.interpolate)(template, { htmlBody, headerStyle });
|
|
43
|
+
// console.log(htmlData);
|
|
44
|
+
await (0, exports.renderHTMLToImage)(htmlData, outputFile, canvasSize.width, canvasSize.height);
|
|
45
|
+
if (htmlFile) {
|
|
46
|
+
fs_1.default.writeFileSync(htmlFile, htmlData, "utf8");
|
|
47
|
+
}
|
|
48
|
+
return htmlData;
|
|
49
|
+
};
|
|
50
|
+
exports.createPage = createPage;
|
|
51
|
+
const mkdir = (dirPath) => {
|
|
52
|
+
if (!fs_1.default.existsSync(dirPath)) {
|
|
53
|
+
fs_1.default.mkdirSync(dirPath, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.mkdir = mkdir;
|
|
57
|
+
const writeTools = (baseDir, tools) => {
|
|
58
|
+
fs_1.default.writeFileSync(path_1.default.resolve(baseDir, "tools.json"), JSON.stringify(tools, null, 2), "utf8");
|
|
59
|
+
};
|
|
60
|
+
exports.writeTools = writeTools;
|
|
61
|
+
const getRootDir = () => {
|
|
62
|
+
return path_1.default.resolve(__dirname, "../");
|
|
63
|
+
};
|
|
64
|
+
exports.getRootDir = getRootDir;
|
|
65
|
+
const getOutDir = () => {
|
|
66
|
+
const now = Date.now();
|
|
67
|
+
return path_1.default.resolve((0, exports.getRootDir)(), "outdir", String(now));
|
|
68
|
+
};
|
|
69
|
+
exports.getOutDir = getOutDir;
|
|
70
|
+
const debugLogger = (data) => {
|
|
71
|
+
const logFile = path_1.default.resolve("/tmp/mcp.log");
|
|
72
|
+
try {
|
|
73
|
+
const json = JSON.stringify(data, null, 2); // pretty print
|
|
74
|
+
fs_1.default.appendFileSync(logFile, json + "\n", { encoding: "utf8" });
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
console.error("Failed to write debug log:", err);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.debugLogger = debugLogger;
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mulmocast-vision",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "PlayGround",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"./lib",
|
|
8
|
+
"./assets"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"lint": "eslint src tests",
|
|
13
|
+
"format": "prettier --write '{src,tests,assets}/**/*.{ts,html}'",
|
|
14
|
+
"test": "node --test --require ts-node/register ./tests/test_*.ts",
|
|
15
|
+
"test_run": "node --test --require ts-node/register ./tests/run_*.ts # just run locally",
|
|
16
|
+
"ai": "npx tsx ./src/presentation.ts",
|
|
17
|
+
"generate_all_images": "npx tsx ./tests/test.ts",
|
|
18
|
+
"ci_test": "NODE_ENV=test npx tsx ./tests/test.ts"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/receptron/mulmocast-vision"
|
|
23
|
+
},
|
|
24
|
+
"author": "Satoshi Nakajima, Isamu Arimoto",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/receptron/mulmocast-vision/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/receptron/mulmocast-vision",
|
|
29
|
+
"license": "AGPL-3.0-or-later",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@graphai/openai_agent": "^2.0.7",
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.17.4",
|
|
33
|
+
"dotenv": "^17.2.1",
|
|
34
|
+
"graphai": "^2.0.14",
|
|
35
|
+
"nunjucks": "^3.2.4",
|
|
36
|
+
"puppeteer": "^24.17.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/nunjucks": "^3.2.6",
|
|
40
|
+
"eslint": "^9.34.0",
|
|
41
|
+
"eslint-config-prettier": "^10.1.8",
|
|
42
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
43
|
+
"prettier": "^3.6.2",
|
|
44
|
+
"typescript": "^5.9.2",
|
|
45
|
+
"typescript-eslint": "^8.40.0"
|
|
46
|
+
},
|
|
47
|
+
"types": "./lib/index.d.ts",
|
|
48
|
+
"directories": {
|
|
49
|
+
"lib": "lib"
|
|
50
|
+
}
|
|
51
|
+
}
|