uloop-cli 0.54.7 → 0.55.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.
@@ -5759,7 +5759,7 @@ var import_path3 = require("path");
5759
5759
 
5760
5760
  // src/default-tools.json
5761
5761
  var default_tools_default = {
5762
- version: "0.54.7",
5762
+ version: "0.55.0",
5763
5763
  tools: [
5764
5764
  {
5765
5765
  name: "compile",
@@ -6185,12 +6185,15 @@ function saveToolsCache(cache) {
6185
6185
  const content = JSON.stringify(cache, null, 2);
6186
6186
  (0, import_fs3.writeFileSync)(cachePath, content, "utf-8");
6187
6187
  }
6188
+ function hasCacheFile() {
6189
+ return (0, import_fs3.existsSync)(getCachePath());
6190
+ }
6188
6191
  function getCacheFilePath() {
6189
6192
  return getCachePath();
6190
6193
  }
6191
6194
 
6192
6195
  // src/version.ts
6193
- var VERSION = "0.54.7";
6196
+ var VERSION = "0.55.0";
6194
6197
 
6195
6198
  // src/spinner.ts
6196
6199
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -7246,10 +7249,6 @@ program2.command("fix").description("Clean up stale lock files that may prevent
7246
7249
  cleanupLockFiles();
7247
7250
  });
7248
7251
  registerSkillsCommand(program2);
7249
- var toolsCache = loadToolsCache();
7250
- for (const tool of toolsCache.tools) {
7251
- registerToolCommand(tool);
7252
- }
7253
7252
  function registerToolCommand(tool) {
7254
7253
  const cmd = program2.command(tool.name).description(tool.description);
7255
7254
  const properties = tool.inputSchema.properties;
@@ -7675,6 +7674,30 @@ async function main() {
7675
7674
  if (handleCompletionOptions()) {
7676
7675
  return;
7677
7676
  }
7677
+ const cachedVersion = loadToolsCache().version;
7678
+ if (hasCacheFile() && cachedVersion !== VERSION) {
7679
+ console.log(
7680
+ `\x1B[33mCache outdated (${cachedVersion} \u2192 ${VERSION}). Syncing tools from Unity...\x1B[0m`
7681
+ );
7682
+ try {
7683
+ await syncTools({});
7684
+ console.log("\x1B[32m\u2713 Tools synced successfully.\x1B[0m\n");
7685
+ } catch (error) {
7686
+ const message = error instanceof Error ? error.message : String(error);
7687
+ if (isConnectionError(message)) {
7688
+ console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
7689
+ console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
7690
+ } else {
7691
+ console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
7692
+ console.error(`\x1B[33mError: ${message}\x1B[0m`);
7693
+ console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
7694
+ }
7695
+ }
7696
+ }
7697
+ const toolsCache = loadToolsCache();
7698
+ for (const tool of toolsCache.tools) {
7699
+ registerToolCommand(tool);
7700
+ }
7678
7701
  const args = process.argv.slice(2);
7679
7702
  const cmdName = args.find((arg) => !arg.startsWith("-"));
7680
7703
  if (cmdName && !commandExists(cmdName)) {