@genart-dev/mcp-server 0.4.0 → 0.4.2
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.cjs +4 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -15
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +4 -16
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +3 -15
- package/dist/lib.js.map +1 -1
- package/package.json +3 -11
package/dist/index.js
CHANGED
|
@@ -2749,26 +2749,12 @@ import {
|
|
|
2749
2749
|
} from "@genart-dev/core";
|
|
2750
2750
|
|
|
2751
2751
|
// src/capture/headless.ts
|
|
2752
|
-
|
|
2753
|
-
async function loadPuppeteer() {
|
|
2754
|
-
if (!cachedModule) {
|
|
2755
|
-
try {
|
|
2756
|
-
const mod = await import("puppeteer");
|
|
2757
|
-
cachedModule = mod.default ?? mod;
|
|
2758
|
-
} catch {
|
|
2759
|
-
throw new Error(
|
|
2760
|
-
"Puppeteer is required for screenshot capture. Install it with: npm install puppeteer"
|
|
2761
|
-
);
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
return cachedModule;
|
|
2765
|
-
}
|
|
2752
|
+
import puppeteer from "puppeteer";
|
|
2766
2753
|
var browserInstance = null;
|
|
2767
2754
|
async function getBrowser() {
|
|
2768
2755
|
if (browserInstance && browserInstance.connected) {
|
|
2769
2756
|
return browserInstance;
|
|
2770
2757
|
}
|
|
2771
|
-
const puppeteer = await loadPuppeteer();
|
|
2772
2758
|
browserInstance = await puppeteer.launch({
|
|
2773
2759
|
headless: true,
|
|
2774
2760
|
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || void 0,
|
|
@@ -6079,6 +6065,7 @@ function registerCaptureTools(server, state) {
|
|
|
6079
6065
|
async (args) => {
|
|
6080
6066
|
try {
|
|
6081
6067
|
const result = await captureScreenshot(state, args);
|
|
6068
|
+
console.error(`[capture_screenshot] jpeg base64 length: ${result.previewJpegBase64.length}, metadata: ${JSON.stringify(result.metadata)}`);
|
|
6082
6069
|
return {
|
|
6083
6070
|
content: [
|
|
6084
6071
|
{ type: "text", text: JSON.stringify(result.metadata, null, 2) },
|
|
@@ -6086,6 +6073,7 @@ function registerCaptureTools(server, state) {
|
|
|
6086
6073
|
]
|
|
6087
6074
|
};
|
|
6088
6075
|
} catch (e) {
|
|
6076
|
+
console.error(`[capture_screenshot] error: ${e instanceof Error ? e.message : String(e)}`);
|
|
6089
6077
|
return toolError(e instanceof Error ? e.message : String(e));
|
|
6090
6078
|
}
|
|
6091
6079
|
}
|