unity-agent-tools 0.7.4 → 0.7.5
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/server.mjs +16 -4
- package/package.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -32130,7 +32130,7 @@ function registerEditorPlatformResource(server, bridge) {
|
|
|
32130
32130
|
async function main() {
|
|
32131
32131
|
const server = new McpServer({
|
|
32132
32132
|
name: "unity-agent-tools",
|
|
32133
|
-
version: "0.7.
|
|
32133
|
+
version: "0.7.5"
|
|
32134
32134
|
});
|
|
32135
32135
|
const bridge = new UnityBridge("ws://localhost:8090");
|
|
32136
32136
|
const lspClient = new ShaderLspClient();
|
|
@@ -32161,11 +32161,23 @@ async function main() {
|
|
|
32161
32161
|
console.error("[UnityAgent] Invalid AI query: missing id or prompt");
|
|
32162
32162
|
return;
|
|
32163
32163
|
}
|
|
32164
|
+
let refImageData;
|
|
32165
|
+
if (params.referenceImagePath) {
|
|
32166
|
+
try {
|
|
32167
|
+
const { readFileSync: readFileSync3 } = await import("fs");
|
|
32168
|
+
refImageData = readFileSync3(params.referenceImagePath, "utf-8");
|
|
32169
|
+
console.error(`[NanoBanana] Reference image loaded from ${params.referenceImagePath}`);
|
|
32170
|
+
} catch (e) {
|
|
32171
|
+
console.error(`[NanoBanana] Failed to read reference image: ${e}`);
|
|
32172
|
+
}
|
|
32173
|
+
} else if (params.referenceImage) {
|
|
32174
|
+
refImageData = params.referenceImage;
|
|
32175
|
+
}
|
|
32164
32176
|
if (params.geminiApiKey) {
|
|
32165
32177
|
geminiConfig.apiKey = params.geminiApiKey;
|
|
32166
32178
|
geminiConfig.model = params.geminiModel || geminiConfig.model;
|
|
32167
|
-
geminiConfig.referenceImage =
|
|
32168
|
-
console.error(`[NanoBanana] Config updated: model=${geminiConfig.model}, hasRef=${!!
|
|
32179
|
+
geminiConfig.referenceImage = refImageData || void 0;
|
|
32180
|
+
console.error(`[NanoBanana] Config updated: model=${geminiConfig.model}, hasRef=${!!refImageData}`);
|
|
32169
32181
|
}
|
|
32170
32182
|
console.error(`[UnityAgent] AI query received (id=${id}): ${params.prompt.substring(0, 80)}...`);
|
|
32171
32183
|
try {
|
|
@@ -32176,7 +32188,7 @@ async function main() {
|
|
|
32176
32188
|
projectPath: params.projectPath,
|
|
32177
32189
|
geminiApiKey: params.geminiApiKey,
|
|
32178
32190
|
geminiModel: params.geminiModel,
|
|
32179
|
-
referenceImage:
|
|
32191
|
+
referenceImage: refImageData,
|
|
32180
32192
|
onChunk: (chunk) => {
|
|
32181
32193
|
bridge.sendRaw({ method: "ai/chunk", id, chunk });
|
|
32182
32194
|
},
|
package/package.json
CHANGED