nx-mcp-server 1.0.3 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools/smart.js +10 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx-mcp-server",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "图像生成 MCP Server — 智能生图(万相API) + 本地图形工具集",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -21,22 +21,16 @@ export async function generateSmart(args){
21
21
  const buf=Buffer.from(res.data);
22
22
  const saved=await saveOutput(buf,'ai_generated.png',args.outputDir,'url');
23
23
 
24
- if(args.outputFormat==='base64'){
25
- const b64=buf.toString('base64');
26
- results.push({
27
- ...saved,
28
- base64:`data:image/png;base64,${b64}`,
29
- mimeType:'image/png',
30
- width:args.width||1024,
31
- height:args.height||1024,
32
- });
33
- }else{
34
- results.push({
35
- ...saved,
36
- width:args.width||1024,
37
- height:args.height||1024,
38
- });
39
- }
24
+ // 始终附带 base64,确保远程部署时用户也能看到图片
25
+ const b64=buf.toString('base64');
26
+ const mime='image/png';
27
+ results.push({
28
+ ...saved,
29
+ base64:`data:${mime};base64,${b64}`,
30
+ mimeType:mime,
31
+ width:args.width||1024,
32
+ height:args.height||1024,
33
+ });
40
34
  }
41
35
 
42
36
  return {