imgx-cli 0.8.0 → 0.8.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/CHANGELOG.md +6 -0
- package/dist/cli.bundle.js +2 -4
- package/dist/mcp.bundle.js +4 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1 (2026-02-27)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Remove MCP inline preview size guard — always include base64 image data in MCP responses regardless of size. MCP clients that support `type: "image"` content (e.g. Claude Desktop) will display inline; others will use the file path from the text content. Gemini-generated images (~900KB raw, ~1.2MB base64) exceed Claude Desktop's 1MB limit but the file path fallback ensures usability.
|
|
8
|
+
|
|
3
9
|
## 0.8.0 (2026-02-27)
|
|
4
10
|
|
|
5
11
|
### Fixed
|
package/dist/cli.bundle.js
CHANGED
|
@@ -39235,9 +39235,7 @@ function fallbackOutputDir(outputDir) {
|
|
|
39235
39235
|
}
|
|
39236
39236
|
function saveImage(image, outputPath, outputDir) {
|
|
39237
39237
|
const ext = MIME_TO_EXT[image.mimeType] || ".png";
|
|
39238
|
-
const
|
|
39239
|
-
const filePath = outputPath ? resolve2(outputPath) : resolve2(resolvedDir, `imgx-${randomUUID().slice(0, 8)}${ext}`);
|
|
39240
|
-
console.error(`[imgx-debug] homedir=${homedir2()} cwd=${process.cwd()} outputPath=${outputPath} outputDir=${outputDir} resolvedDir=${resolvedDir} filePath=${filePath}`);
|
|
39238
|
+
const filePath = outputPath ? resolve2(outputPath) : resolve2(fallbackOutputDir(outputDir), `imgx-${randomUUID().slice(0, 8)}${ext}`);
|
|
39241
39239
|
mkdirSync2(dirname(filePath), { recursive: true });
|
|
39242
39240
|
writeFileSync2(filePath, image.data);
|
|
39243
39241
|
return filePath;
|
|
@@ -39778,7 +39776,7 @@ function showAll() {
|
|
|
39778
39776
|
}
|
|
39779
39777
|
|
|
39780
39778
|
// build/cli/index.js
|
|
39781
|
-
var VERSION2 = "0.8.
|
|
39779
|
+
var VERSION2 = "0.8.1";
|
|
39782
39780
|
var HELP = `imgx v${VERSION2} \u2014 AI image generation and editing CLI
|
|
39783
39781
|
|
|
39784
39782
|
Commands:
|
package/dist/mcp.bundle.js
CHANGED
|
@@ -69273,9 +69273,7 @@ function fallbackOutputDir(outputDir) {
|
|
|
69273
69273
|
}
|
|
69274
69274
|
function saveImage(image, outputPath, outputDir) {
|
|
69275
69275
|
const ext = MIME_TO_EXT[image.mimeType] || ".png";
|
|
69276
|
-
const
|
|
69277
|
-
const filePath = outputPath ? resolve2(outputPath) : resolve2(resolvedDir, `imgx-${randomUUID().slice(0, 8)}${ext}`);
|
|
69278
|
-
console.error(`[imgx-debug] homedir=${homedir2()} cwd=${process.cwd()} outputPath=${outputPath} outputDir=${outputDir} resolvedDir=${resolvedDir} filePath=${filePath}`);
|
|
69276
|
+
const filePath = outputPath ? resolve2(outputPath) : resolve2(fallbackOutputDir(outputDir), `imgx-${randomUUID().slice(0, 8)}${ext}`);
|
|
69279
69277
|
mkdirSync2(dirname(filePath), { recursive: true });
|
|
69280
69278
|
writeFileSync2(filePath, image.data);
|
|
69281
69279
|
return filePath;
|
|
@@ -69599,28 +69597,17 @@ function initOpenAI() {
|
|
|
69599
69597
|
}
|
|
69600
69598
|
|
|
69601
69599
|
// build/mcp/server.js
|
|
69602
|
-
var MAX_INLINE_BASE64 = 8e5;
|
|
69603
69600
|
function buildImageContent(images, paths, extra) {
|
|
69604
69601
|
const content = [];
|
|
69605
|
-
let skipped = 0;
|
|
69606
69602
|
for (const img of images) {
|
|
69607
|
-
|
|
69608
|
-
if (b64.length <= MAX_INLINE_BASE64) {
|
|
69609
|
-
content.push({ type: "image", data: b64, mimeType: img.mimeType });
|
|
69610
|
-
} else {
|
|
69611
|
-
skipped++;
|
|
69612
|
-
}
|
|
69613
|
-
}
|
|
69614
|
-
const info = { success: true, filePaths: paths, ...extra };
|
|
69615
|
-
if (skipped > 0) {
|
|
69616
|
-
info.note = `${skipped} image(s) too large for inline preview. Open file(s) directly.`;
|
|
69603
|
+
content.push({ type: "image", data: img.data.toString("base64"), mimeType: img.mimeType });
|
|
69617
69604
|
}
|
|
69618
|
-
content.push({ type: "text", text: JSON.stringify(
|
|
69605
|
+
content.push({ type: "text", text: JSON.stringify({ success: true, filePaths: paths, ...extra }) });
|
|
69619
69606
|
return content;
|
|
69620
69607
|
}
|
|
69621
69608
|
var server = new McpServer({
|
|
69622
69609
|
name: "imgx",
|
|
69623
|
-
version: "0.8.
|
|
69610
|
+
version: "0.8.1"
|
|
69624
69611
|
});
|
|
69625
69612
|
initGemini();
|
|
69626
69613
|
initOpenAI();
|