gpteam 0.1.21 → 0.1.22
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/README.md +1 -1
- package/lib/help.js +1 -1
- package/lib/image-mcp/image.js +34 -2
- package/lib/image-mcp/server.js +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ The Image MCP exposes both a synchronous compatibility tool and a local async jo
|
|
|
27
27
|
|
|
28
28
|
Image MCP results are returned as stable JSON text and MCP `structuredContent`. Successful results include final file path, model, action, size, format, quality, byte size, SHA-256, MIME type, image dimensions, duration, retry count, `job_id`, `trace_id`, and optional `idempotency_key`. Error results use stable `error.code`, `error.message`, `error.retryable`, `error.stage`, `error.upstream_status`, and `error.trace_id` fields while keeping compatibility fields such as `category` and `http_status`.
|
|
29
29
|
|
|
30
|
-
The MCP supports normal text-to-image generation and image-to-image/edit inputs. Pass `images` as data URLs, HTTPS URLs, or local file paths. Pass `mask` the same way for masked edits. `input_fidelity` is accepted for compatibility but is not forwarded to the current GPTeam Image 2 bridge because upstream Codex image edits reject it. The MCP requests GPTeam image endpoints with `stream=true` and reads the final image event, so long image jobs get early stream bytes instead of sitting idle until the final JSON body. File writes create missing directories, avoid overwriting existing files by adding `-v2`, `-v3`, etc., and validate PNG/JPEG/WebP before returning success. `overwrite: true` is available for explicit replacement. `return_revised_prompt` controls whether the upstream revised prompt is included in the result.
|
|
30
|
+
The MCP supports normal text-to-image generation and image-to-image/edit inputs. Pass `images` as data URLs, HTTPS URLs, or local file paths. For easier tool calling, `image`, `image_path`, `image_paths`, `input_image`, and `input_images` are accepted as aliases. Pass `mask` or `mask_path` the same way for masked edits. `input_fidelity` is accepted for compatibility but is not forwarded to the current GPTeam Image 2 bridge because upstream Codex image edits reject it. The MCP requests GPTeam image endpoints with `stream=true` and reads the final image event, so long image jobs get early stream bytes instead of sitting idle until the final JSON body. File writes create missing directories, avoid overwriting existing files by adding `-v2`, `-v3`, etc., and validate PNG/JPEG/WebP before returning success. `overwrite: true` is available for explicit replacement. `return_revised_prompt` controls whether the upstream revised prompt is included in the result.
|
|
31
31
|
|
|
32
32
|
Claude Code is written to `~/.claude/settings.json` under the `env` section, using the GPTeam `/anthropic` base URL. OpenClaw writes `models.providers.gpteam` and also selects `gpteam/<model>` under `agents.defaults.model`, so the chosen model is active without an extra manual step.
|
|
33
33
|
|
package/lib/help.js
CHANGED
package/lib/image-mcp/image.js
CHANGED
|
@@ -35,9 +35,9 @@ export function buildImageGenerationPayload(input = {}, options = {}) {
|
|
|
35
35
|
output_format: normalizeImageFormat(input.format || input.output_format || DEFAULT_IMAGE_FORMAT)
|
|
36
36
|
};
|
|
37
37
|
const imageOptions = { ...options, home: options.home };
|
|
38
|
-
const images = normalizeInputImages(input
|
|
38
|
+
const images = normalizeInputImages(collectInputImageValues(input), imageOptions);
|
|
39
39
|
if (images.length > 0) payload.images = images.map((imageURL) => ({ image_url: imageURL }));
|
|
40
|
-
const mask = normalizeImageReference(input.mask, imageOptions);
|
|
40
|
+
const mask = normalizeImageReference(firstPresentImageReference(input.mask, input.mask_path), imageOptions);
|
|
41
41
|
if (mask) payload.mask = { image_url: mask };
|
|
42
42
|
copyOptionalImageToolOption(payload, input, 'background');
|
|
43
43
|
copyOptionalImageToolOption(payload, input, 'moderation');
|
|
@@ -286,6 +286,8 @@ export function getCapabilities(options = {}) {
|
|
|
286
286
|
supports_idempotency_key: true,
|
|
287
287
|
supports_image_to_image: true,
|
|
288
288
|
supports_mask: true,
|
|
289
|
+
image_input_fields: ['images', 'image', 'image_path', 'image_paths', 'input_image', 'input_images'],
|
|
290
|
+
mask_input_fields: ['mask', 'mask_path'],
|
|
289
291
|
sizes: ['1024x1024', '1536x1024', '1024x1536', 'auto'],
|
|
290
292
|
formats: ['png', 'jpeg', 'webp'],
|
|
291
293
|
quality: ['low', 'medium', 'high', 'auto'],
|
|
@@ -632,6 +634,36 @@ function normalizeInputImages(value, options = {}) {
|
|
|
632
634
|
return rawImages.map((item) => normalizeImageReference(item, options)).filter(Boolean);
|
|
633
635
|
}
|
|
634
636
|
|
|
637
|
+
function collectInputImageValues(input = {}) {
|
|
638
|
+
const values = [];
|
|
639
|
+
appendImageAlias(values, input.images);
|
|
640
|
+
appendImageAlias(values, input.image);
|
|
641
|
+
appendImageAlias(values, input.image_path);
|
|
642
|
+
appendImageAlias(values, input.image_paths);
|
|
643
|
+
appendImageAlias(values, input.input_image);
|
|
644
|
+
appendImageAlias(values, input.input_images);
|
|
645
|
+
return values;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function appendImageAlias(target, value) {
|
|
649
|
+
if (Array.isArray(value)) {
|
|
650
|
+
for (const item of value) appendImageAlias(target, item);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (value) target.push(value);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
function firstPresentImageReference(...values) {
|
|
657
|
+
for (const value of values) {
|
|
658
|
+
if (Array.isArray(value)) {
|
|
659
|
+
if (value.length > 0) return value[0];
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (value) return value;
|
|
663
|
+
}
|
|
664
|
+
return '';
|
|
665
|
+
}
|
|
666
|
+
|
|
635
667
|
function normalizeImageReference(value, options = {}) {
|
|
636
668
|
if (!value) return '';
|
|
637
669
|
if (typeof value === 'object') {
|
package/lib/image-mcp/server.js
CHANGED
|
@@ -53,10 +53,32 @@ const imageInputProperties = {
|
|
|
53
53
|
items: { type: 'string' },
|
|
54
54
|
description: 'Optional input images for image-to-image or edit. Values may be data URLs, HTTPS URLs, or local file paths.'
|
|
55
55
|
},
|
|
56
|
+
image_path: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Optional single local image path alias for image-to-image or edit.'
|
|
59
|
+
},
|
|
60
|
+
image_paths: {
|
|
61
|
+
type: 'array',
|
|
62
|
+
items: { type: 'string' },
|
|
63
|
+
description: 'Optional local image path aliases for image-to-image or edit.'
|
|
64
|
+
},
|
|
65
|
+
input_image: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'Optional single input image alias. Accepts a data URL, HTTPS URL, or local file path.'
|
|
68
|
+
},
|
|
69
|
+
input_images: {
|
|
70
|
+
type: 'array',
|
|
71
|
+
items: { type: 'string' },
|
|
72
|
+
description: 'Optional input image aliases. Accepts data URLs, HTTPS URLs, or local file paths.'
|
|
73
|
+
},
|
|
56
74
|
mask: {
|
|
57
75
|
type: 'string',
|
|
58
76
|
description: 'Optional mask image for image edit. Value may be a data URL, HTTPS URL, or local file path.'
|
|
59
77
|
},
|
|
78
|
+
mask_path: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Optional local mask image path alias for image edit.'
|
|
81
|
+
},
|
|
60
82
|
input_fidelity: {
|
|
61
83
|
type: 'string',
|
|
62
84
|
description: 'Accepted for compatibility. The GPTeam Image 2 bridge currently ignores this option because the upstream Codex image tool rejects it on edits.',
|