@bendyline/gezel-mcp 1.2.9 → 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/harness.js CHANGED
@@ -2498,9 +2498,10 @@ ${doc.markdown}`);
2498
2498
  const content = [];
2499
2499
  if (res.b64Png) content.push({ type: "image", data: res.b64Png, mimeType: "image/png" });
2500
2500
  const skipped = res.meta.img2imgSkippedReason ? `This image engine can't edit images (${res.meta.img2imgSkippedReason}), so it ignored inputImages and made a new image from the prompt alone. To change an image, describe the whole picture you want. ` : "";
2501
+ const settings = res.meta.settingsNotes?.length ? `Image settings: ${res.meta.settingsNotes.join(" ")} ` : "";
2501
2502
  content.push({
2502
2503
  type: "text",
2503
- text: `${skipped}Saved to ${saved} (${res.meta.widthPx}x${res.meta.heightPx}, ${res.meta.model}). Copy it into the folder with your own file tools if it belongs there.`
2504
+ text: `${skipped}${settings}Saved to ${saved} (${res.meta.widthPx}x${res.meta.heightPx}, ${res.meta.model}). Copy it into the folder with your own file tools if it belongs there.`
2504
2505
  });
2505
2506
  return { content };
2506
2507
  })
package/dist/server.js CHANGED
@@ -2493,42 +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) {
2500
- const next = { ...args };
2501
- const changes = [];
2502
- const originalSize = typeof args.width === "number" && typeof args.height === "number" ? `${args.width}x${args.height}` : void 0;
2503
- if (typeof args.width === "number" && typeof args.height === "number") {
2504
- const maxSide = Math.max(args.width, args.height);
2505
- if (maxSide > AGENT_IMAGE_MAX_SIDE_PX) {
2506
- const scale = AGENT_IMAGE_MAX_SIDE_PX / maxSide;
2507
- next.width = quantizeImageSize(args.width * scale);
2508
- next.height = quantizeImageSize(args.height * scale);
2509
- }
2510
- } else if (typeof args.width === "number" && args.width > AGENT_IMAGE_MAX_SIDE_PX) {
2511
- next.width = AGENT_IMAGE_MAX_SIDE_PX;
2512
- } else if (typeof args.height === "number" && args.height > AGENT_IMAGE_MAX_SIDE_PX) {
2513
- next.height = AGENT_IMAGE_MAX_SIDE_PX;
2514
- }
2515
- if (originalSize && typeof next.width === "number" && typeof next.height === "number" && `${next.width}x${next.height}` !== originalSize) {
2516
- changes.push(`size ${originalSize} -> ${next.width}x${next.height}`);
2517
- } else if (args.width !== next.width && typeof next.width === "number") {
2518
- changes.push(`width ${args.width} -> ${next.width}`);
2519
- } else if (args.height !== next.height && typeof next.height === "number") {
2520
- changes.push(`height ${args.height} -> ${next.height}`);
2521
- }
2522
- return {
2523
- args: next,
2524
- ...changes.length > 0 ? { note: `Request normalized for agent image generation (${changes.join(", ")}).` } : {}
2525
- };
2526
- }
2527
- function quantizeImageSize(size) {
2528
- const rounded = Math.round(size / SIZE_MULTIPLE) * SIZE_MULTIPLE;
2529
- return Math.max(SIZE_MULTIPLE, Math.min(AGENT_IMAGE_MAX_SIDE_PX, rounded));
2530
- }
2531
-
2532
2496
  // src/github-tools.ts
2533
2497
  import { prioritizePullsForCurrentBranch } from "@bendyline/gezel";
2534
2498
  import { z as z6 } from "zod";
@@ -12582,23 +12546,25 @@ server.tool(
12582
12546
  },
12583
12547
  async (args) => {
12584
12548
  try {
12585
- const normalized = normalizeGenerateImageToolArgs(args);
12586
- const imageArgs = normalized.args;
12587
- const saveAs = imageArgs.saveAs || inferGeneratedImageSaveAs(imageArgs.prompt);
12549
+ const saveAs = args.saveAs || inferGeneratedImageSaveAs(args.prompt);
12588
12550
  const res = await api.generateImage({
12589
- prompt: imageArgs.prompt,
12590
- ...imageArgs.negativePrompt ? { negativePrompt: imageArgs.negativePrompt } : {},
12591
- ...imageArgs.model ? { model: imageArgs.model } : {},
12592
- ...imageArgs.width ? { width: imageArgs.width } : {},
12593
- ...imageArgs.height ? { height: imageArgs.height } : {},
12594
- ...imageArgs.aspectRatio ? { aspectRatio: imageArgs.aspectRatio } : {},
12595
- ...imageArgs.quality ? { quality: imageArgs.quality } : {},
12596
- ...imageArgs.steps ? { steps: imageArgs.steps } : {},
12597
- ...imageArgs.seed !== void 0 ? { seed: imageArgs.seed } : {},
12598
- ...imageArgs.inputImages && imageArgs.inputImages.length > 0 ? { inputImages: imageArgs.inputImages } : {},
12599
- ...imageArgs.strength !== void 0 ? { strength: imageArgs.strength } : {},
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 } : {},
12600
12562
  ...saveAs ? { saveAs } : {},
12601
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,
12602
12568
  projectId,
12603
12569
  // Pin agent + session so the cloud-image cost-confirmation
12604
12570
  // gate can synthesize a question scoped to the right
@@ -12619,11 +12585,11 @@ To display this image in HTML, copy this exact tag verbatim \u2014 do not add an
12619
12585
  \`<img src="${workspacePath}">\`
12620
12586
 
12621
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`.";
12622
- const normalizedLine = normalized.note ? ` ${normalized.note}` : "";
12588
+ const settingsLine = meta.settingsNotes?.length ? ` Image settings: ${meta.settingsNotes.join(" ")}` : "";
12623
12589
  const skippedLine = meta.img2imgSkippedReason ? ` NOTE: the source image was not used \u2014 ${meta.img2imgSkippedReason}; the image was generated from the prompt alone.` : "";
12624
12590
  const guideLine = promptGuide && !promptGuidesShown.has(meta.model) ? ` For your next prompt: ${promptGuide}` : "";
12625
12591
  if (promptGuide) promptGuidesShown.add(meta.model);
12626
- const summary = `Generated ${meta.widthPx}\xD7${meta.heightPx} image with ${meta.model} (seed ${meta.seed}, ${meta.steps} steps, ${meta.durationMs}ms).${normalizedLine}${skippedLine}${guideLine} The user already sees this image inline below the tool call \u2014 DO NOT embed it again as Markdown (e.g. \`![alt](artifacts/${artifactPath})\`); 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}`;
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. \`![alt](artifacts/${artifactPath})\`); 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}`;
12627
12593
  const content = [{ type: "text", text: summary }];
12628
12594
  if (b64Png) {
12629
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.9",
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.9",
60
- "@bendyline/gezel-client": "1.2.9",
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"