uloop-cli 0.55.2 → 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 +53 -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 +1 -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
|
@@ -5513,7 +5513,7 @@ var DirectUnityClient = class {
|
|
|
5513
5513
|
const timeoutId = setTimeout(() => {
|
|
5514
5514
|
reject(
|
|
5515
5515
|
new Error(
|
|
5516
|
-
`Request timed out after ${NETWORK_TIMEOUT_MS}ms. Unity may be frozen or busy. Please report this to the user and ask how to proceed. Do NOT kill Unity processes without user permission.`
|
|
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
5517
|
)
|
|
5518
5518
|
);
|
|
5519
5519
|
}, NETWORK_TIMEOUT_MS);
|
|
@@ -5763,7 +5763,7 @@ var import_path3 = require("path");
|
|
|
5763
5763
|
|
|
5764
5764
|
// src/default-tools.json
|
|
5765
5765
|
var default_tools_default = {
|
|
5766
|
-
version: "0.
|
|
5766
|
+
version: "0.56.0",
|
|
5767
5767
|
tools: [
|
|
5768
5768
|
{
|
|
5769
5769
|
name: "compile",
|
|
@@ -5906,6 +5906,11 @@ var default_tools_default = {
|
|
|
5906
5906
|
IncludePaths: {
|
|
5907
5907
|
type: "boolean",
|
|
5908
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
|
|
5909
5914
|
}
|
|
5910
5915
|
}
|
|
5911
5916
|
}
|
|
@@ -6195,9 +6200,22 @@ function hasCacheFile() {
|
|
|
6195
6200
|
function getCacheFilePath() {
|
|
6196
6201
|
return getCachePath();
|
|
6197
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
|
+
}
|
|
6198
6216
|
|
|
6199
6217
|
// src/version.ts
|
|
6200
|
-
var VERSION = "0.
|
|
6218
|
+
var VERSION = "0.56.0";
|
|
6201
6219
|
|
|
6202
6220
|
// src/spinner.ts
|
|
6203
6221
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -6441,6 +6459,7 @@ async function syncTools(globalOptions) {
|
|
|
6441
6459
|
}
|
|
6442
6460
|
const cache = {
|
|
6443
6461
|
version: VERSION,
|
|
6462
|
+
serverVersion: result.Ver,
|
|
6444
6463
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6445
6464
|
tools: result.Tools.map((tool) => ({
|
|
6446
6465
|
name: tool.name,
|
|
@@ -7386,6 +7405,30 @@ function printConnectionError() {
|
|
|
7386
7405
|
console.error("");
|
|
7387
7406
|
console.error("[For AI] Please report the above to the user.");
|
|
7388
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
|
+
}
|
|
7389
7432
|
async function runWithErrorHandling(fn) {
|
|
7390
7433
|
try {
|
|
7391
7434
|
await fn();
|
|
@@ -7409,10 +7452,17 @@ async function runWithErrorHandling(fn) {
|
|
|
7409
7452
|
if (message === "UNITY_NO_RESPONSE") {
|
|
7410
7453
|
console.error("\x1B[33m\u23F3 Unity is busy (no response received).\x1B[0m");
|
|
7411
7454
|
console.error("Unity may be compiling, reloading, or starting. Please wait and try again.");
|
|
7455
|
+
printVersionMismatchDiagnostic();
|
|
7412
7456
|
process.exit(1);
|
|
7413
7457
|
}
|
|
7414
7458
|
if (isConnectionError(message)) {
|
|
7415
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();
|
|
7416
7466
|
process.exit(1);
|
|
7417
7467
|
}
|
|
7418
7468
|
console.error(`\x1B[31mError: ${message}\x1B[0m`);
|