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.
Files changed (2) hide show
  1. package/dist/server.mjs +16 -4
  2. 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.4"
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 = params.referenceImage || void 0;
32168
- console.error(`[NanoBanana] Config updated: model=${geminiConfig.model}, hasRef=${!!geminiConfig.referenceImage}`);
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: params.referenceImage,
32191
+ referenceImage: refImageData,
32180
32192
  onChunk: (chunk) => {
32181
32193
  bridge.sendRaw({ method: "ai/chunk", id, chunk });
32182
32194
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unity-agent-tools",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Unity Agent - AI-powered Unity Editor tools for shader analysis and error auto-fix via Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/server.mjs",