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/dist/cli.bundle.cjs +19 -7
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/cli.ts +18 -4
- package/src/default-tools.json +1 -1
- package/src/execute-tool.ts +5 -1
- package/src/version.ts +1 -1
package/package.json
CHANGED
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
|
|
247
|
-
|
|
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
|
-
|
|
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
|
}
|
package/src/default-tools.json
CHANGED
package/src/execute-tool.ts
CHANGED
|
@@ -68,7 +68,11 @@ function isRetryableError(error: unknown): boolean {
|
|
|
68
68
|
return false;
|
|
69
69
|
}
|
|
70
70
|
const message = error.message;
|
|
71
|
-
return
|
|
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.
|
|
7
|
+
export const VERSION = '0.54.4'; // x-release-please-version
|