uloop-cli 0.57.0 → 0.58.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.
@@ -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. [For AI] 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] Run 'uloop focus-window' to bring Unity to the front, then retry the tool. If the issue persists, 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.57.0",
5766
+ version: "0.58.0",
5767
5767
  tools: [
5768
5768
  {
5769
5769
  name: "compile",
@@ -6215,7 +6215,7 @@ function getCachedServerVersion() {
6215
6215
  }
6216
6216
 
6217
6217
  // src/version.ts
6218
- var VERSION = "0.57.0";
6218
+ var VERSION = "0.58.0";
6219
6219
 
6220
6220
  // src/spinner.ts
6221
6221
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -7905,6 +7905,49 @@ async function runLaunchCommand(projectPath, options) {
7905
7905
  await updateLastModifiedIfExists(resolvedProjectPath, now);
7906
7906
  }
7907
7907
 
7908
+ // src/commands/focus-window.ts
7909
+ function registerFocusWindowCommand(program3) {
7910
+ program3.command("focus-window").description("Bring Unity Editor window to front using OS-level commands").action(async () => {
7911
+ const projectRoot = findUnityProjectRoot();
7912
+ if (projectRoot === null) {
7913
+ console.error(
7914
+ JSON.stringify({
7915
+ Success: false,
7916
+ Message: "Unity project not found"
7917
+ })
7918
+ );
7919
+ process.exit(1);
7920
+ }
7921
+ const runningProcess = await findRunningUnityProcess(projectRoot);
7922
+ if (!runningProcess) {
7923
+ console.error(
7924
+ JSON.stringify({
7925
+ Success: false,
7926
+ Message: "No running Unity process found for this project"
7927
+ })
7928
+ );
7929
+ process.exit(1);
7930
+ }
7931
+ try {
7932
+ await focusUnityProcess(runningProcess.pid);
7933
+ console.log(
7934
+ JSON.stringify({
7935
+ Success: true,
7936
+ Message: `Unity Editor window focused (PID: ${runningProcess.pid})`
7937
+ })
7938
+ );
7939
+ } catch (error) {
7940
+ console.error(
7941
+ JSON.stringify({
7942
+ Success: false,
7943
+ Message: `Failed to focus Unity window: ${error instanceof Error ? error.message : String(error)}`
7944
+ })
7945
+ );
7946
+ process.exit(1);
7947
+ }
7948
+ });
7949
+ }
7950
+
7908
7951
  // src/cli.ts
7909
7952
  var BUILTIN_COMMANDS = [
7910
7953
  "list",
@@ -7913,7 +7956,8 @@ var BUILTIN_COMMANDS = [
7913
7956
  "update",
7914
7957
  "fix",
7915
7958
  "skills",
7916
- "launch"
7959
+ "launch",
7960
+ "focus-window"
7917
7961
  ];
7918
7962
  var program2 = new Command();
7919
7963
  program2.name("uloop").description("Unity MCP CLI - Direct communication with Unity Editor").version(VERSION, "-v, --version", "Output the version number");
@@ -7936,7 +7980,11 @@ program2.command("fix").description("Clean up stale lock files that may prevent
7936
7980
  });
7937
7981
  registerSkillsCommand(program2);
7938
7982
  registerLaunchCommand(program2);
7983
+ registerFocusWindowCommand(program2);
7939
7984
  function registerToolCommand(tool) {
7985
+ if (BUILTIN_COMMANDS.includes(tool.name)) {
7986
+ return;
7987
+ }
7940
7988
  const cmd = program2.command(tool.name).description(tool.description);
7941
7989
  const properties = tool.inputSchema.properties;
7942
7990
  for (const [propName, propInfo] of Object.entries(properties)) {