uloop-cli 0.54.2 → 0.54.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uloop-cli",
3
- "version": "0.54.2",
3
+ "version": "0.54.4",
4
4
  "//version": "x-release-please-version",
5
5
  "description": "CLI tool for Unity Editor communication via uLoopMCP",
6
6
  "main": "dist/cli.bundle.cjs",
package/src/cli.ts CHANGED
@@ -213,6 +213,17 @@ function extractGlobalOptions(options: Record<string, unknown>): GlobalOptions {
213
213
  };
214
214
  }
215
215
 
216
+ function isConnectionError(message: string): boolean {
217
+ return message.includes('ECONNREFUSED') || message.includes('EADDRNOTAVAIL');
218
+ }
219
+
220
+ function printConnectionError(): void {
221
+ console.error('\x1b[31mError: Cannot connect to Unity.\x1b[0m');
222
+ console.error('Make sure Unity Editor is open and uLoopMCP server is running.');
223
+ console.error('');
224
+ console.error('[For AI] Please report the above to the user.');
225
+ }
226
+
216
227
  async function runWithErrorHandling(fn: () => Promise<void>): Promise<void> {
217
228
  try {
218
229
  await fn();
@@ -243,9 +254,8 @@ async function runWithErrorHandling(fn: () => Promise<void>): Promise<void> {
243
254
  process.exit(1);
244
255
  }
245
256
 
246
- if (message.includes('ECONNREFUSED')) {
247
- console.error('\x1b[31mError: Cannot connect to Unity.\x1b[0m');
248
- console.error('Make sure Unity is running with uLoopMCP installed.');
257
+ if (isConnectionError(message)) {
258
+ printConnectionError();
249
259
  process.exit(1);
250
260
  }
251
261
 
@@ -632,7 +642,11 @@ async function main(): Promise<void> {
632
642
  }
633
643
  } catch (error) {
634
644
  const message = error instanceof Error ? error.message : String(error);
635
- console.error(`\x1b[31mError: Failed to sync tools: ${message}\x1b[0m`);
645
+ if (isConnectionError(message)) {
646
+ printConnectionError();
647
+ } else {
648
+ console.error(`\x1b[31mError: Failed to sync tools: ${message}\x1b[0m`);
649
+ }
636
650
  process.exit(1);
637
651
  }
638
652
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.54.2",
2
+ "version": "0.54.4",
3
3
  "tools": [
4
4
  {
5
5
  "name": "compile",
@@ -68,7 +68,11 @@ function isRetryableError(error: unknown): boolean {
68
68
  return false;
69
69
  }
70
70
  const message = error.message;
71
- return message.includes('ECONNREFUSED') || message === 'UNITY_NO_RESPONSE';
71
+ return (
72
+ message.includes('ECONNREFUSED') ||
73
+ message.includes('EADDRNOTAVAIL') ||
74
+ message === 'UNITY_NO_RESPONSE'
75
+ );
72
76
  }
73
77
 
74
78
  /**
package/src/version.ts CHANGED
@@ -4,4 +4,4 @@
4
4
  * This file exists to avoid bundling the entire package.json into the CLI bundle.
5
5
  * This version is automatically updated by release-please.
6
6
  */
7
- export const VERSION = '0.54.2'; // x-release-please-version
7
+ export const VERSION = '0.54.4'; // x-release-please-version