@goonnguyen/human-mcp 2.8.2 → 2.8.4
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 +33 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -168065,76 +168065,66 @@ function buildEditingPrompt(options) {
|
|
|
168065
168065
|
let prompt = options.prompt;
|
|
168066
168066
|
switch (options.operation) {
|
|
168067
168067
|
case "inpaint":
|
|
168068
|
-
prompt = `Edit the specified area of this image: ${prompt}`;
|
|
168069
168068
|
if (options.maskPrompt) {
|
|
168070
|
-
prompt
|
|
168069
|
+
prompt = `Using the provided image, ${prompt}. Focus on ${options.maskPrompt}. Keep all other parts of the image unchanged.`;
|
|
168070
|
+
} else {
|
|
168071
|
+
prompt = `Using the provided image, ${prompt}. Ensure the changes blend naturally with the existing image style, lighting, and perspective.`;
|
|
168071
168072
|
}
|
|
168072
168073
|
break;
|
|
168073
168074
|
case "outpaint":
|
|
168074
|
-
|
|
168075
|
+
const direction = options.expandDirection || "all directions";
|
|
168076
|
+
prompt = `Expand the provided image ${direction === "all" ? "in all directions" : `to the ${direction}`} and add: ${prompt}. Match the original image's style, lighting, and perspective. Seamlessly blend the new content with the existing image.`;
|
|
168075
168077
|
if (options.expansionRatio && options.expansionRatio !== 1.5) {
|
|
168076
|
-
prompt +=
|
|
168078
|
+
prompt += ` Expand by approximately ${Math.round(options.expansionRatio * 100)}%.`;
|
|
168077
168079
|
}
|
|
168078
168080
|
break;
|
|
168079
168081
|
case "style_transfer":
|
|
168080
|
-
prompt = `
|
|
168081
|
-
if (options.styleStrength
|
|
168082
|
-
|
|
168082
|
+
prompt = `Transform the provided image to have this style: ${prompt}. Maintain the original composition, objects, and structure while applying the new artistic style.`;
|
|
168083
|
+
if (options.styleStrength) {
|
|
168084
|
+
const strength = options.styleStrength > 0.8 ? "strongly" : options.styleStrength > 0.5 ? "moderately" : "subtly";
|
|
168085
|
+
prompt += ` Apply the style ${strength}.`;
|
|
168083
168086
|
}
|
|
168084
168087
|
break;
|
|
168085
168088
|
case "object_manipulation":
|
|
168086
168089
|
if (options.targetObject) {
|
|
168087
|
-
|
|
168090
|
+
const action = options.manipulationType || "modify";
|
|
168091
|
+
prompt = `In the provided image, ${action} the ${options.targetObject}: ${prompt}`;
|
|
168088
168092
|
if (options.targetPosition) {
|
|
168089
168093
|
prompt += `. Position: ${options.targetPosition}`;
|
|
168090
168094
|
}
|
|
168095
|
+
prompt += `. Keep all other elements unchanged.`;
|
|
168091
168096
|
}
|
|
168092
168097
|
break;
|
|
168093
168098
|
case "multi_image_compose":
|
|
168094
|
-
prompt = `
|
|
168099
|
+
prompt = `Combine the provided images: ${prompt}`;
|
|
168095
168100
|
if (options.compositionLayout) {
|
|
168096
|
-
prompt += `.
|
|
168097
|
-
}
|
|
168098
|
-
if (options.blendMode) {
|
|
168099
|
-
prompt += `. Blend mode: ${options.blendMode}`;
|
|
168101
|
+
prompt += `. Use a ${options.compositionLayout} layout`;
|
|
168100
168102
|
}
|
|
168103
|
+
prompt += `. Ensure natural blending and consistent lighting across the composition.`;
|
|
168101
168104
|
break;
|
|
168102
168105
|
}
|
|
168103
168106
|
if (options.quality === "high") {
|
|
168104
|
-
prompt += "
|
|
168107
|
+
prompt += " Generate a high-quality result with fine details and professional finish.";
|
|
168105
168108
|
} else if (options.quality === "draft") {
|
|
168106
|
-
prompt += "
|
|
168109
|
+
prompt += " Provide a quick draft version.";
|
|
168107
168110
|
}
|
|
168108
168111
|
if (options.negativePrompt) {
|
|
168109
|
-
prompt += `
|
|
168112
|
+
prompt += ` Do not include: ${options.negativePrompt}.`;
|
|
168110
168113
|
}
|
|
168111
168114
|
return prompt;
|
|
168112
168115
|
}
|
|
168113
168116
|
async function buildRequestContent(options, processedInputImage, editingPrompt) {
|
|
168114
168117
|
const content = [
|
|
168115
|
-
{
|
|
168116
|
-
text: editingPrompt
|
|
168117
|
-
},
|
|
168118
168118
|
{
|
|
168119
168119
|
inlineData: {
|
|
168120
168120
|
data: processedInputImage.data,
|
|
168121
168121
|
mimeType: processedInputImage.mimeType
|
|
168122
168122
|
}
|
|
168123
|
+
},
|
|
168124
|
+
{
|
|
168125
|
+
text: editingPrompt
|
|
168123
168126
|
}
|
|
168124
168127
|
];
|
|
168125
|
-
if (options.operation === "inpaint" && options.maskImage) {
|
|
168126
|
-
try {
|
|
168127
|
-
const processedMask = await processImageForEditing(options.maskImage);
|
|
168128
|
-
content.push({
|
|
168129
|
-
inlineData: {
|
|
168130
|
-
data: processedMask.data,
|
|
168131
|
-
mimeType: processedMask.mimeType
|
|
168132
|
-
}
|
|
168133
|
-
});
|
|
168134
|
-
} catch (error) {
|
|
168135
|
-
logger2.warn(`Failed to process mask image: ${error}. Proceeding without mask.`);
|
|
168136
|
-
}
|
|
168137
|
-
}
|
|
168138
168128
|
if (options.operation === "style_transfer" && options.styleImage) {
|
|
168139
168129
|
try {
|
|
168140
168130
|
const processedStyle = await processImageForEditing(options.styleImage);
|
|
@@ -168149,7 +168139,12 @@ async function buildRequestContent(options, processedInputImage, editingPrompt)
|
|
|
168149
168139
|
}
|
|
168150
168140
|
}
|
|
168151
168141
|
if (options.operation === "multi_image_compose" && options.secondaryImages) {
|
|
168142
|
+
let imageCount = 1;
|
|
168152
168143
|
for (const secondaryImage of options.secondaryImages) {
|
|
168144
|
+
if (imageCount >= 3) {
|
|
168145
|
+
logger2.warn("Gemini supports up to 3 images. Skipping additional images.");
|
|
168146
|
+
break;
|
|
168147
|
+
}
|
|
168153
168148
|
try {
|
|
168154
168149
|
const processedSecondary = await processImageForEditing(secondaryImage);
|
|
168155
168150
|
content.push({
|
|
@@ -168158,6 +168153,7 @@ async function buildRequestContent(options, processedInputImage, editingPrompt)
|
|
|
168158
168153
|
mimeType: processedSecondary.mimeType
|
|
168159
168154
|
}
|
|
168160
168155
|
});
|
|
168156
|
+
imageCount++;
|
|
168161
168157
|
} catch (error) {
|
|
168162
168158
|
logger2.warn(`Failed to process secondary image: ${error}. Skipping this image.`);
|
|
168163
168159
|
}
|
|
@@ -168333,7 +168329,7 @@ async function registerHandsTool(server, config) {
|
|
|
168333
168329
|
});
|
|
168334
168330
|
server.registerTool("gemini_edit_image", {
|
|
168335
168331
|
title: "Gemini Image Editing Tool",
|
|
168336
|
-
description: "Edit images using AI with
|
|
168332
|
+
description: "Edit images using AI with text-based instructions for inpainting, outpainting, style transfer, object manipulation, and composition. No masks required - just describe what you want to change.",
|
|
168337
168333
|
inputSchema: {
|
|
168338
168334
|
operation: exports_external.enum([
|
|
168339
168335
|
"inpaint",
|
|
@@ -168380,12 +168376,12 @@ async function registerHandsTool(server, config) {
|
|
|
168380
168376
|
});
|
|
168381
168377
|
server.registerTool("gemini_inpaint_image", {
|
|
168382
168378
|
title: "Gemini Image Inpainting Tool",
|
|
168383
|
-
description: "
|
|
168379
|
+
description: "Add or modify specific areas of an image using natural language descriptions. No mask required - just describe what to change and where.",
|
|
168384
168380
|
inputSchema: {
|
|
168385
168381
|
input_image: exports_external.string().describe("Base64 encoded image or file path to the input image"),
|
|
168386
|
-
prompt: exports_external.string().min(1, "Prompt cannot be empty").describe("Text description of what to
|
|
168387
|
-
mask_image: exports_external.string().optional().describe("Base64 encoded mask image
|
|
168388
|
-
mask_prompt: exports_external.string().optional().describe("Text description of the
|
|
168382
|
+
prompt: exports_external.string().min(1, "Prompt cannot be empty").describe("Text description of what to add or change in the image"),
|
|
168383
|
+
mask_image: exports_external.string().optional().describe("(Optional) Base64 encoded mask image - not used by Gemini but kept for compatibility"),
|
|
168384
|
+
mask_prompt: exports_external.string().optional().describe("Text description of WHERE in the image to make changes (e.g., 'the empty space beside the cat', 'the top-left corner')"),
|
|
168389
168385
|
negative_prompt: exports_external.string().optional().describe("What to avoid in the edited area"),
|
|
168390
168386
|
strength: exports_external.number().min(0.1).max(1).optional().default(0.8).describe("Strength of the editing effect"),
|
|
168391
168387
|
guidance_scale: exports_external.number().min(1).max(20).optional().default(7.5).describe("How closely to follow the prompt"),
|