@bendyline/gezel-mcp 1.2.10 → 1.2.11
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/server.js +17 -55
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -2493,43 +2493,6 @@ function createEntityResolvers(deps) {
|
|
|
2493
2493
|
return { resolveProjectId: resolveProjectId2, resolveGezelId: resolveGezelId2, availableGezelsHint: availableGezelsHint2, parseRef: parseRef2 };
|
|
2494
2494
|
}
|
|
2495
2495
|
|
|
2496
|
-
// src/generate-image-normalization.ts
|
|
2497
|
-
var AGENT_IMAGE_MAX_SIDE_PX = 1024;
|
|
2498
|
-
var SIZE_MULTIPLE = 64;
|
|
2499
|
-
function normalizeGenerateImageToolArgs(args, kind = "local") {
|
|
2500
|
-
if (kind === "cloud") return { args: { ...args } };
|
|
2501
|
-
const next = { ...args };
|
|
2502
|
-
const changes = [];
|
|
2503
|
-
const originalSize = typeof args.width === "number" && typeof args.height === "number" ? `${args.width}x${args.height}` : void 0;
|
|
2504
|
-
if (typeof args.width === "number" && typeof args.height === "number") {
|
|
2505
|
-
const maxSide = Math.max(args.width, args.height);
|
|
2506
|
-
if (maxSide > AGENT_IMAGE_MAX_SIDE_PX) {
|
|
2507
|
-
const scale = AGENT_IMAGE_MAX_SIDE_PX / maxSide;
|
|
2508
|
-
next.width = quantizeImageSize(args.width * scale);
|
|
2509
|
-
next.height = quantizeImageSize(args.height * scale);
|
|
2510
|
-
}
|
|
2511
|
-
} else if (typeof args.width === "number" && args.width > AGENT_IMAGE_MAX_SIDE_PX) {
|
|
2512
|
-
next.width = AGENT_IMAGE_MAX_SIDE_PX;
|
|
2513
|
-
} else if (typeof args.height === "number" && args.height > AGENT_IMAGE_MAX_SIDE_PX) {
|
|
2514
|
-
next.height = AGENT_IMAGE_MAX_SIDE_PX;
|
|
2515
|
-
}
|
|
2516
|
-
if (originalSize && typeof next.width === "number" && typeof next.height === "number" && `${next.width}x${next.height}` !== originalSize) {
|
|
2517
|
-
changes.push(`size ${originalSize} -> ${next.width}x${next.height}`);
|
|
2518
|
-
} else if (args.width !== next.width && typeof next.width === "number") {
|
|
2519
|
-
changes.push(`width ${args.width} -> ${next.width}`);
|
|
2520
|
-
} else if (args.height !== next.height && typeof next.height === "number") {
|
|
2521
|
-
changes.push(`height ${args.height} -> ${next.height}`);
|
|
2522
|
-
}
|
|
2523
|
-
return {
|
|
2524
|
-
args: next,
|
|
2525
|
-
...changes.length > 0 ? { note: `Request normalized for agent image generation (${changes.join(", ")}).` } : {}
|
|
2526
|
-
};
|
|
2527
|
-
}
|
|
2528
|
-
function quantizeImageSize(size) {
|
|
2529
|
-
const rounded = Math.round(size / SIZE_MULTIPLE) * SIZE_MULTIPLE;
|
|
2530
|
-
return Math.max(SIZE_MULTIPLE, Math.min(AGENT_IMAGE_MAX_SIDE_PX, rounded));
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
2496
|
// src/github-tools.ts
|
|
2534
2497
|
import { prioritizePullsForCurrentBranch } from "@bendyline/gezel";
|
|
2535
2498
|
import { z as z6 } from "zod";
|
|
@@ -12583,25 +12546,25 @@ server.tool(
|
|
|
12583
12546
|
},
|
|
12584
12547
|
async (args) => {
|
|
12585
12548
|
try {
|
|
12586
|
-
const
|
|
12587
|
-
const cloud = !args.model?.startsWith("remote:") && ["copilot", "codex-cli", "google-ai", "openai"].includes(config.imageProvider ?? "sd-cpp");
|
|
12588
|
-
const normalized = normalizeGenerateImageToolArgs(args, cloud ? "cloud" : "local");
|
|
12589
|
-
const imageArgs = normalized.args;
|
|
12590
|
-
const saveAs = imageArgs.saveAs || inferGeneratedImageSaveAs(imageArgs.prompt);
|
|
12549
|
+
const saveAs = args.saveAs || inferGeneratedImageSaveAs(args.prompt);
|
|
12591
12550
|
const res = await api.generateImage({
|
|
12592
|
-
prompt:
|
|
12593
|
-
...
|
|
12594
|
-
...
|
|
12595
|
-
...
|
|
12596
|
-
...
|
|
12597
|
-
...
|
|
12598
|
-
...
|
|
12599
|
-
...
|
|
12600
|
-
...
|
|
12601
|
-
...
|
|
12602
|
-
...
|
|
12551
|
+
prompt: args.prompt,
|
|
12552
|
+
...args.negativePrompt ? { negativePrompt: args.negativePrompt } : {},
|
|
12553
|
+
...args.model ? { model: args.model } : {},
|
|
12554
|
+
...args.width ? { width: args.width } : {},
|
|
12555
|
+
...args.height ? { height: args.height } : {},
|
|
12556
|
+
...args.aspectRatio ? { aspectRatio: args.aspectRatio } : {},
|
|
12557
|
+
...args.quality ? { quality: args.quality } : {},
|
|
12558
|
+
...args.steps ? { steps: args.steps } : {},
|
|
12559
|
+
...args.seed !== void 0 ? { seed: args.seed } : {},
|
|
12560
|
+
...args.inputImages && args.inputImages.length > 0 ? { inputImages: args.inputImages } : {},
|
|
12561
|
+
...args.strength !== void 0 ? { strength: args.strength } : {},
|
|
12603
12562
|
...saveAs ? { saveAs } : {},
|
|
12604
12563
|
capStepsAtRecommended: true,
|
|
12564
|
+
// The daemon holds the size to about a megapixel only when a local
|
|
12565
|
+
// engine serves the call. Only it knows which provider that is: a
|
|
12566
|
+
// session token cannot read the config.
|
|
12567
|
+
capSizeForAgent: true,
|
|
12605
12568
|
projectId,
|
|
12606
12569
|
// Pin agent + session so the cloud-image cost-confirmation
|
|
12607
12570
|
// gate can synthesize a question scoped to the right
|
|
@@ -12622,12 +12585,11 @@ To display this image in HTML, copy this exact tag verbatim \u2014 do not add an
|
|
|
12622
12585
|
\`<img src="${workspacePath}">\`
|
|
12623
12586
|
|
|
12624
12587
|
If you are working on a website/logo task and an HTML file already exists, your next tool call should patch that HTML with this exact tag using \`replace_in_file\` or \`write_file\`. Do not call \`generate_image\` again for the same missing image; the image asset already exists.` : "\n\nNOTE: workspace copy was skipped (project has an external workingDir not approved for writes). To reference from HTML, copy the image into the workspace yourself first via `write_file`.";
|
|
12625
|
-
const normalizedLine = normalized.note ? ` ${normalized.note}` : "";
|
|
12626
12588
|
const settingsLine = meta.settingsNotes?.length ? ` Image settings: ${meta.settingsNotes.join(" ")}` : "";
|
|
12627
12589
|
const skippedLine = meta.img2imgSkippedReason ? ` NOTE: the source image was not used \u2014 ${meta.img2imgSkippedReason}; the image was generated from the prompt alone.` : "";
|
|
12628
12590
|
const guideLine = promptGuide && !promptGuidesShown.has(meta.model) ? ` For your next prompt: ${promptGuide}` : "";
|
|
12629
12591
|
if (promptGuide) promptGuidesShown.add(meta.model);
|
|
12630
|
-
const summary = `Generated ${meta.widthPx}\xD7${meta.heightPx} image with ${meta.model} (seed ${meta.seed}, ${meta.steps} steps, ${meta.durationMs}ms).${
|
|
12592
|
+
const summary = `Generated ${meta.widthPx}\xD7${meta.heightPx} image with ${meta.model} (seed ${meta.seed}, ${meta.steps} steps, ${meta.durationMs}ms).${settingsLine}${skippedLine}${guideLine} The user already sees this image inline below the tool call \u2014 DO NOT embed it again as Markdown (e.g. \`\`); just refer to it by name in your reply when needed. To iterate on it, pass \`{ inputImages: [{ artifactPath: "${artifactPath}" }] }\` to a follow-up generate_image call. To read its bytes, call \`read_artifact\` with path \`${artifactPath}\`.${workspaceLine}`;
|
|
12631
12593
|
const content = [{ type: "text", text: summary }];
|
|
12632
12594
|
if (b64Png) {
|
|
12633
12595
|
content.push({ type: "image", data: b64Png, mimeType: "image/png" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "Gezel's Model Context Protocol server: gives gezels and other MCP clients access to memory, workspace files, artifacts, tasks, and team tools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"!dist/**/*.map"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@bendyline/gezel": "1.2.
|
|
60
|
-
"@bendyline/gezel-client": "1.2.
|
|
59
|
+
"@bendyline/gezel": "1.2.11",
|
|
60
|
+
"@bendyline/gezel-client": "1.2.11",
|
|
61
61
|
"@modelcontextprotocol/sdk": "1.31.0",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
63
|
"zod": "^4.4.3"
|