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.
- package/package.json +1 -1
- package/src/tools/smart.js +10 -16
package/package.json
CHANGED
package/src/tools/smart.js
CHANGED
|
@@ -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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
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 {
|