pabal-resource-mcp 1.9.0 → 1.9.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/dist/bin/mcp-server.js +19 -15
- package/package.json +1 -1
package/dist/bin/mcp-server.js
CHANGED
|
@@ -4462,6 +4462,10 @@ function buildResizeTasks(slug, sourceScreenshots, rawLocales, deviceTypes, scre
|
|
|
4462
4462
|
const key = `${screenshot.type}/${screenshot.filename}`;
|
|
4463
4463
|
sourceRefMap.set(key, screenshot.fullPath);
|
|
4464
4464
|
}
|
|
4465
|
+
const sourceHasByDevice = {
|
|
4466
|
+
phone: sourceScreenshots.some((s) => s.type === "phone"),
|
|
4467
|
+
tablet: sourceScreenshots.some((s) => s.type === "tablet")
|
|
4468
|
+
};
|
|
4465
4469
|
for (const locale of rawLocales) {
|
|
4466
4470
|
const rawScreenshots = scanRawScreenshots(slug, locale);
|
|
4467
4471
|
let filteredScreenshots = rawScreenshots.filter(
|
|
@@ -4485,7 +4489,7 @@ function buildResizeTasks(slug, sourceScreenshots, rawLocales, deviceTypes, scre
|
|
|
4485
4489
|
for (const screenshot of filteredScreenshots) {
|
|
4486
4490
|
const key = `${screenshot.type}/${screenshot.filename}`;
|
|
4487
4491
|
const sourceReferencePath = sourceRefMap.get(key);
|
|
4488
|
-
if (!sourceReferencePath) {
|
|
4492
|
+
if (!sourceReferencePath && sourceHasByDevice[screenshot.type]) {
|
|
4489
4493
|
continue;
|
|
4490
4494
|
}
|
|
4491
4495
|
const outputPath = path13.join(
|
|
@@ -4826,8 +4830,8 @@ var phoneToTabletTool = {
|
|
|
4826
4830
|
|
|
4827
4831
|
**PURPOSE:** Generate tablet-sized screenshots from existing phone screenshots by:
|
|
4828
4832
|
1. Reading phone screenshots from the source locale
|
|
4829
|
-
2. Using Gemini to
|
|
4830
|
-
3.
|
|
4833
|
+
2. Using Gemini to keep the same UI while adapting to a tablet canvas
|
|
4834
|
+
3. Preserving original content/layout without creating new UI
|
|
4831
4835
|
|
|
4832
4836
|
**OUTPUT:** Saves generated tablet images to raw/ folder: \`{locale}/tablet/raw/{filename}\`
|
|
4833
4837
|
|
|
@@ -4922,20 +4926,20 @@ async function convertPhoneToTablet(phonePath, tabletRawPath, preserveWords, ima
|
|
|
4922
4926
|
const { data: imageData, mimeType } = readImageAsBase64(phonePath);
|
|
4923
4927
|
const preserveInstruction = preserveWords && preserveWords.length > 0 ? `
|
|
4924
4928
|
- Do NOT change these words, keep them exactly as-is: ${preserveWords.join(", ")}` : "";
|
|
4925
|
-
const prompt = `
|
|
4929
|
+
const prompt = `Convert this PHONE app screenshot into a TABLET screenshot.
|
|
4926
4930
|
|
|
4927
4931
|
IMPORTANT INSTRUCTIONS:
|
|
4928
|
-
-
|
|
4929
|
-
-
|
|
4930
|
-
-
|
|
4931
|
-
-
|
|
4932
|
-
-
|
|
4933
|
-
-
|
|
4934
|
-
-
|
|
4935
|
-
-
|
|
4936
|
-
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4932
|
+
- Preserve the original UI exactly: same components, text, icons, colors, and visual hierarchy
|
|
4933
|
+
- Do NOT redesign, recompose, or invent any new UI
|
|
4934
|
+
- Do NOT add/remove/reorder elements
|
|
4935
|
+
- Do NOT create side-by-side layouts, new panels, or alternative arrangements
|
|
4936
|
+
- Keep the same screen content and structure from the phone screenshot
|
|
4937
|
+
- Only adapt to tablet aspect ratio (3:4) by extending canvas width as needed
|
|
4938
|
+
- Keep the original content centered and unchanged as much as possible
|
|
4939
|
+
- Use matching background fill/empty space for extra horizontal area
|
|
4940
|
+
- If a device frame exists, keep the same frame style and avoid changing its design${preserveInstruction}
|
|
4941
|
+
|
|
4942
|
+
Output one tablet screenshot that looks like the original phone screenshot placed on a wider tablet canvas.`;
|
|
4939
4943
|
try {
|
|
4940
4944
|
const generated = await generateImageWithFallback({
|
|
4941
4945
|
client,
|