uloop-cli 0.55.1 → 0.56.0
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 +57 -3
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/cli.ts +51 -1
- package/src/default-tools.json +6 -1
- package/src/direct-unity-client.ts +5 -1
- package/src/execute-tool.ts +3 -1
- package/src/tool-cache.ts +21 -0
- package/src/version.ts +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -5511,7 +5511,11 @@ var DirectUnityClient = class {
|
|
|
5511
5511
|
return new Promise((resolve2, reject) => {
|
|
5512
5512
|
const socket = this.socket;
|
|
5513
5513
|
const timeoutId = setTimeout(() => {
|
|
5514
|
-
reject(
|
|
5514
|
+
reject(
|
|
5515
|
+
new Error(
|
|
5516
|
+
`Request timed out after ${NETWORK_TIMEOUT_MS}ms. Unity may be frozen or busy. [For AI] Please report this to the user and ask how to proceed. Do NOT kill Unity processes without user permission.`
|
|
5517
|
+
)
|
|
5518
|
+
);
|
|
5515
5519
|
}, NETWORK_TIMEOUT_MS);
|
|
5516
5520
|
const onData = (chunk) => {
|
|
5517
5521
|
this.receiveBuffer = Buffer.concat([this.receiveBuffer, chunk]);
|
|
@@ -5759,7 +5763,7 @@ var import_path3 = require("path");
|
|
|
5759
5763
|
|
|
5760
5764
|
// src/default-tools.json
|
|
5761
5765
|
var default_tools_default = {
|
|
5762
|
-
version: "0.
|
|
5766
|
+
version: "0.56.0",
|
|
5763
5767
|
tools: [
|
|
5764
5768
|
{
|
|
5765
5769
|
name: "compile",
|
|
@@ -5902,6 +5906,11 @@ var default_tools_default = {
|
|
|
5902
5906
|
IncludePaths: {
|
|
5903
5907
|
type: "boolean",
|
|
5904
5908
|
description: "Include path information"
|
|
5909
|
+
},
|
|
5910
|
+
UseSelection: {
|
|
5911
|
+
type: "boolean",
|
|
5912
|
+
description: "Use selected GameObject(s) as root(s). When true, RootPath is ignored.",
|
|
5913
|
+
default: false
|
|
5905
5914
|
}
|
|
5906
5915
|
}
|
|
5907
5916
|
}
|
|
@@ -6191,9 +6200,22 @@ function hasCacheFile() {
|
|
|
6191
6200
|
function getCacheFilePath() {
|
|
6192
6201
|
return getCachePath();
|
|
6193
6202
|
}
|
|
6203
|
+
function getCachedServerVersion() {
|
|
6204
|
+
const cachePath = getCachePath();
|
|
6205
|
+
if (!(0, import_fs3.existsSync)(cachePath)) {
|
|
6206
|
+
return void 0;
|
|
6207
|
+
}
|
|
6208
|
+
try {
|
|
6209
|
+
const content = (0, import_fs3.readFileSync)(cachePath, "utf-8");
|
|
6210
|
+
const cache = JSON.parse(content);
|
|
6211
|
+
return typeof cache.serverVersion === "string" ? cache.serverVersion : void 0;
|
|
6212
|
+
} catch {
|
|
6213
|
+
return void 0;
|
|
6214
|
+
}
|
|
6215
|
+
}
|
|
6194
6216
|
|
|
6195
6217
|
// src/version.ts
|
|
6196
|
-
var VERSION = "0.
|
|
6218
|
+
var VERSION = "0.56.0";
|
|
6197
6219
|
|
|
6198
6220
|
// src/spinner.ts
|
|
6199
6221
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -6437,6 +6459,7 @@ async function syncTools(globalOptions) {
|
|
|
6437
6459
|
}
|
|
6438
6460
|
const cache = {
|
|
6439
6461
|
version: VERSION,
|
|
6462
|
+
serverVersion: result.Ver,
|
|
6440
6463
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6441
6464
|
tools: result.Tools.map((tool) => ({
|
|
6442
6465
|
name: tool.name,
|
|
@@ -7382,6 +7405,30 @@ function printConnectionError() {
|
|
|
7382
7405
|
console.error("");
|
|
7383
7406
|
console.error("[For AI] Please report the above to the user.");
|
|
7384
7407
|
}
|
|
7408
|
+
function printVersionMismatchDiagnostic() {
|
|
7409
|
+
const serverVersion = getCachedServerVersion();
|
|
7410
|
+
if (serverVersion === void 0) {
|
|
7411
|
+
return;
|
|
7412
|
+
}
|
|
7413
|
+
if (serverVersion === VERSION) {
|
|
7414
|
+
return;
|
|
7415
|
+
}
|
|
7416
|
+
const isCliOlder = isVersionOlder(VERSION, serverVersion);
|
|
7417
|
+
const action = isCliOlder ? "Update" : "Downgrade";
|
|
7418
|
+
const updateCommand = `npm install -g uloop-cli@${serverVersion}`;
|
|
7419
|
+
console.error("");
|
|
7420
|
+
console.error("\x1B[33m\u2501\u2501\u2501 Version Mismatch Diagnostic \u2501\u2501\u2501\x1B[0m");
|
|
7421
|
+
console.error("");
|
|
7422
|
+
console.error(` CLI version: ${VERSION}`);
|
|
7423
|
+
console.error(` Unity package: ${serverVersion}`);
|
|
7424
|
+
console.error(" Version mismatch may cause communication errors.");
|
|
7425
|
+
console.error("");
|
|
7426
|
+
console.error(` To fix: ${action} CLI to match Unity package version`);
|
|
7427
|
+
console.error(` ${updateCommand}`);
|
|
7428
|
+
console.error("");
|
|
7429
|
+
console.error("[For AI] Please ask the user if they would like to run this command.");
|
|
7430
|
+
console.error("\x1B[33m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\x1B[0m");
|
|
7431
|
+
}
|
|
7385
7432
|
async function runWithErrorHandling(fn) {
|
|
7386
7433
|
try {
|
|
7387
7434
|
await fn();
|
|
@@ -7405,10 +7452,17 @@ async function runWithErrorHandling(fn) {
|
|
|
7405
7452
|
if (message === "UNITY_NO_RESPONSE") {
|
|
7406
7453
|
console.error("\x1B[33m\u23F3 Unity is busy (no response received).\x1B[0m");
|
|
7407
7454
|
console.error("Unity may be compiling, reloading, or starting. Please wait and try again.");
|
|
7455
|
+
printVersionMismatchDiagnostic();
|
|
7408
7456
|
process.exit(1);
|
|
7409
7457
|
}
|
|
7410
7458
|
if (isConnectionError(message)) {
|
|
7411
7459
|
printConnectionError();
|
|
7460
|
+
printVersionMismatchDiagnostic();
|
|
7461
|
+
process.exit(1);
|
|
7462
|
+
}
|
|
7463
|
+
if (message.includes("Request timed out")) {
|
|
7464
|
+
console.error(`\x1B[31mError: ${message}\x1B[0m`);
|
|
7465
|
+
printVersionMismatchDiagnostic();
|
|
7412
7466
|
process.exit(1);
|
|
7413
7467
|
}
|
|
7414
7468
|
console.error(`\x1B[31mError: ${message}\x1B[0m`);
|