uloop-cli 0.62.2 → 0.62.3

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.62.2",
3
+ "version": "0.62.3",
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
@@ -38,6 +38,8 @@ interface CliOptions extends GlobalOptions {
38
38
  [key: string]: unknown;
39
39
  }
40
40
 
41
+ const LAUNCH_COMMAND = 'launch' as const;
42
+
41
43
  const BUILTIN_COMMANDS = [
42
44
  'list',
43
45
  'sync',
@@ -45,7 +47,7 @@ const BUILTIN_COMMANDS = [
45
47
  'update',
46
48
  'fix',
47
49
  'skills',
48
- 'launch',
50
+ LAUNCH_COMMAND,
49
51
  'focus-window',
50
52
  ] as const;
51
53
 
@@ -751,24 +753,30 @@ async function main(): Promise<void> {
751
753
  return;
752
754
  }
753
755
 
754
- // Check if cache version is outdated and auto-sync if needed
755
- const cachedVersion = loadToolsCache().version;
756
- if (hasCacheFile() && cachedVersion !== VERSION) {
757
- console.log(
758
- `\x1b[33mCache outdated (${cachedVersion} ${VERSION}). Syncing tools from Unity...\x1b[0m`,
759
- );
760
- try {
761
- await syncTools({});
762
- console.log('\x1b[32m✓ Tools synced successfully.\x1b[0m\n');
763
- } catch (error) {
764
- const message = error instanceof Error ? error.message : String(error);
765
- if (isConnectionError(message)) {
766
- console.error('\x1b[33mWarning: Failed to sync tools. Using cached definitions.\x1b[0m');
767
- console.error("\x1b[33mRun 'uloop sync' manually when Unity is available.\x1b[0m\n");
768
- } else {
769
- console.error('\x1b[33mWarning: Failed to sync tools. Using cached definitions.\x1b[0m');
770
- console.error(`\x1b[33mError: ${message}\x1b[0m`);
771
- console.error("\x1b[33mRun 'uloop sync' manually when Unity is available.\x1b[0m\n");
756
+ const args = process.argv.slice(2);
757
+ const cmdName = args.find((arg) => !arg.startsWith('-'));
758
+
759
+ // launch starts Unity, so it cannot connect to Unity for sync
760
+ if (cmdName !== LAUNCH_COMMAND) {
761
+ // Check if cache version is outdated and auto-sync if needed
762
+ const cachedVersion = loadToolsCache().version;
763
+ if (hasCacheFile() && cachedVersion !== VERSION) {
764
+ console.log(
765
+ `\x1b[33mCache outdated (${cachedVersion} ${VERSION}). Syncing tools from Unity...\x1b[0m`,
766
+ );
767
+ try {
768
+ await syncTools({});
769
+ console.log('\x1b[32m✓ Tools synced successfully.\x1b[0m\n');
770
+ } catch (error) {
771
+ const message = error instanceof Error ? error.message : String(error);
772
+ if (isConnectionError(message)) {
773
+ console.error('\x1b[33mWarning: Failed to sync tools. Using cached definitions.\x1b[0m');
774
+ console.error("\x1b[33mRun 'uloop sync' manually when Unity is available.\x1b[0m\n");
775
+ } else {
776
+ console.error('\x1b[33mWarning: Failed to sync tools. Using cached definitions.\x1b[0m');
777
+ console.error(`\x1b[33mError: ${message}\x1b[0m`);
778
+ console.error("\x1b[33mRun 'uloop sync' manually when Unity is available.\x1b[0m\n");
779
+ }
772
780
  }
773
781
  }
774
782
  }
@@ -779,9 +787,6 @@ async function main(): Promise<void> {
779
787
  registerToolCommand(tool);
780
788
  }
781
789
 
782
- const args = process.argv.slice(2);
783
- const cmdName = args.find((arg) => !arg.startsWith('-'));
784
-
785
790
  if (cmdName && !commandExists(cmdName)) {
786
791
  console.log(`\x1b[33mUnknown command '${cmdName}'. Syncing tools from Unity...\x1b[0m`);
787
792
  try {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.62.2",
2
+ "version": "0.62.3",
3
3
  "tools": [
4
4
  {
5
5
  "name": "compile",
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.62.2'; // x-release-please-version
7
+ export const VERSION = '0.62.3'; // x-release-please-version