@atelierai/uco 1.0.2 → 1.0.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/codegen/emit.js +1 -1
  3. package/dist/codegen/fetch.js +1 -1
  4. package/dist/codegen/fetch.js.map +1 -1
  5. package/dist/commands/devops/login.js +1 -1
  6. package/dist/commands/devops/login.js.map +1 -1
  7. package/dist/commands/devops/setup-mcp.js +1 -1
  8. package/dist/commands/devops/setup-mcp.js.map +1 -1
  9. package/dist/commands/gen.js +2 -2
  10. package/dist/commands/gen.js.map +1 -1
  11. package/dist/commands/ping.js +2 -2
  12. package/dist/commands/ping.js.map +1 -1
  13. package/dist/config/resolve.js +1 -1
  14. package/dist/config/resolve.js.map +1 -1
  15. package/dist/generated/tools.js +1 -1
  16. package/dist/generated/tools.js.map +1 -1
  17. package/package.json +1 -1
  18. package/skills/uco-setup/references/recovery.md +26 -2
  19. package/vendor/plugin/com.atelierai.unity.copilot/CHANGELOG.md +17 -0
  20. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/CopilotServerManager.cs +31 -41
  21. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UI/Window/MainWindowEditor.Connection.cs +177 -409
  22. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UI/Window/MainWindowEditor.CreateGUI.cs +1 -8
  23. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UI/Window/MainWindowEditor.cs +0 -69
  24. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UnityCopilotPluginEditor.Config.cs +6 -1
  25. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UnityCopilotPluginEditor.Static.cs +9 -12
  26. package/vendor/plugin/com.atelierai.unity.copilot/Runtime/UnityCopilotPlugin.Config.cs +11 -62
  27. package/vendor/plugin/com.atelierai.unity.copilot/Runtime/UnityCopilotPlugin.cs +1 -1
  28. package/vendor/plugin/com.atelierai.unity.copilot/Runtime/Utils/EnvironmentUtils.cs +7 -25
  29. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/Environment/EnvironmentUtilsTests.cs +260 -320
  30. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/UI/MainWindowEditor.StatusLogicTests.cs +0 -125
  31. package/vendor/plugin/com.atelierai.unity.copilot/package.json +1 -1
  32. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/Services/DeviceAuthFlow.cs +0 -133
  33. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/Services/DeviceAuthFlow.cs.meta +0 -11
  34. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/CopilotServerManagerAutoStartTests.cs +0 -43
  35. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/CopilotServerManagerAutoStartTests.cs.meta +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelierai/uco",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "uco — Unity Copilot CLI. Drive Unity Editor (and runtime game builds) from any AI agent via plain HTTP. No MCP protocol on the wire.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,12 +2,36 @@
2
2
 
3
3
  Read this only after the bootstrap happy path fails.
4
4
 
5
+ ## Bridge not running (`uco ping` fails / connection refused)
6
+
7
+ The bridge is a plain Node process (`bin/server.mjs` from the `@atelierai/uco`
8
+ npm package) listening on a per-project deterministic port. Bring it up in any
9
+ of these ways:
10
+
11
+ - `uco open <project> --start-server true` — the CLI starts a uco-owned bridge
12
+ before Unity launches.
13
+ - Open the Unity Editor: the plugin auto-starts the bridge in Custom mode when
14
+ `keepServerRunning` is true (the default) — discovery looks for the
15
+ `@atelierai/uco` package (project `node_modules` first, then the npm global).
16
+ - Start it manually with the exact same arguments the plugin would use:
17
+
18
+ ```bash
19
+ node <npm-global>/node_modules/@atelierai/uco/bin/server.mjs \
20
+ --port <port> --authorization required --token <token from UserSettings/uco-config.json>
21
+ ```
22
+
23
+ The plugin detects an already-running server on its port and connects to it.
24
+
25
+ If the plugin still refuses to start it: `nodeServerPath` in
26
+ `UserSettings/uco-config.json` may point at a dead path (it must exist or be
27
+ cleared), or the npm package is missing (`npm i -g @atelierai/uco`).
28
+
5
29
  ## Diagnose by layer
6
30
 
7
31
  1. Verify `Packages/manifest.json` contains `com.atelierai.unity.copilot` and inspect its source/version without rewriting unrelated dependencies.
8
32
  2. Check the OpenUPM scopes required by the package and preserve an active local package source.
9
- 3. Check that `Assets/Plugins/NuGet` is present when using full `uco install`. (No server directory is staged — the Unity plugin launches its Node server itself.)
10
- 4. Check `UserSettings/AI-Game-Developer-Config.json` exists, but never print its token.
33
+ 3. Check `Assets/Plugins/NuGet` is present when using full `uco install`. (No server directory is staged — the Unity plugin launches its Node server itself.)
34
+ 4. Check `UserSettings/uco-config.json` exists, but never print its token.
11
35
  5. Confirm the expected Unity Editor process owns this exact project before diagnosing REST readiness.
12
36
  6. Use `uco status`, then `open` plus `wait-for-ready`; only then run `ping` and `instance-get-current`.
13
37
 
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.3] - 2026-09-17 — Cloud mode removed; bridge finds the published npm package
4
+
5
+ - **Cloud connection mode deleted.** The upstream remnant connected to a dead
6
+ third-party endpoint (ai-game.dev), silently prevented the local bridge from
7
+ auto-starting (its gate only allowed Custom), and confused every session that
8
+ hit a config without an explicit mode. ConnectionMode now has a single value
9
+ (Custom), the default is Custom, the device-code auth flow and its UI are
10
+ gone, and old configs carrying "Cloud" are mapped to Custom on load.
11
+ - **Node bridge discovery follows the published package.** npm rejected the
12
+ bare name "uco" (typosquatting policy), so the package publishes as
13
+ @atelierai/uco — but discovery still looked for node_modules/uco, which
14
+ stopped existing the moment the pre-scope global install was removed.
15
+ Discovery now probes @atelierai/uco, then the legacy uco and cocli layouts,
16
+ project-local and npm-global.
17
+ - Token env overrides route straight to the local token (no mode routing);
18
+ UNITY_MCP_CLOUD_URL is gone, --url/UNITY_MCP_HOST keep working.
19
+
3
20
  ## [1.0.2] - 2026-09-15 — one menu tree, one name: Unity Copilot
4
21
 
5
22
  - The product is named **Unity Copilot** (no hyphen). All menus, window
@@ -85,12 +85,15 @@ namespace com.AtelierAI.Unity.Copilot.Editor
85
85
  #region Node Server Discovery
86
86
 
87
87
  /// <summary>
88
- /// Name of the npm package that ships the Node.js server.
88
+ /// npm package directories that ship the Node.js server, newest first: the
89
+ /// published scoped package (@atelierai/uco — the registry rejected the bare
90
+ /// short name), the pre-scope local layout, and the deprecated cocli install
91
+ /// from the private era.
89
92
  /// </summary>
90
- public const string NodeServerPackageName = "uco";
93
+ public static readonly string[] NodeServerPackageNames = { "@atelierai/uco", "uco", "cocli" };
91
94
 
92
95
  /// <summary>
93
- /// Path of the server entry script inside the <see cref="NodeServerPackageName"/> package.
96
+ /// Path of the server entry script inside a <see cref="NodeServerPackageNames"/> package.
94
97
  /// </summary>
95
98
  public const string NodeServerEntryRelativePath = "bin/server.mjs";
96
99
 
@@ -124,28 +127,33 @@ namespace com.AtelierAI.Unity.Copilot.Editor
124
127
  return null;
125
128
  }
126
129
 
127
- // 2) Installed in the Unity project (uco first, legacy cocli as fallback)
128
- // 2) uco installed in the Unity project
129
- var projectLocal = Path.GetFullPath(Path.Combine(
130
- UnityCopilotPluginEditor.ProjectRootPath,
131
- "node_modules",
132
- NodeServerPackageName,
133
- NodeServerEntryRelativePath));
134
- if (File.Exists(projectLocal))
135
- return projectLocal;
136
-
137
- // 3) uco installed globally via npm
130
+ // 2) Installed in the Unity project (@atelierai/uco first, legacy names after)
131
+ foreach (var packageName in NodeServerPackageNames)
132
+ {
133
+ var projectLocal = Path.GetFullPath(Path.Combine(
134
+ UnityCopilotPluginEditor.ProjectRootPath,
135
+ "node_modules",
136
+ packageName,
137
+ NodeServerEntryRelativePath));
138
+ if (File.Exists(projectLocal))
139
+ return projectLocal;
140
+ }
141
+
142
+ // 3) Installed globally via npm (@atelierai/uco first, legacy names after)
138
143
  foreach (var globalRoot in GetNpmGlobalRoots())
139
144
  {
140
- try
141
- {
142
- var globalPath = Path.Combine(globalRoot, NodeServerPackageName, NodeServerEntryRelativePath);
143
- if (File.Exists(globalPath))
144
- return Path.GetFullPath(globalPath);
145
- }
146
- catch
145
+ foreach (var packageName in NodeServerPackageNames)
147
146
  {
148
- // Inaccessible candidate — skip it.
147
+ try
148
+ {
149
+ var globalPath = Path.Combine(globalRoot, packageName, NodeServerEntryRelativePath);
150
+ if (File.Exists(globalPath))
151
+ return Path.GetFullPath(globalPath);
152
+ }
153
+ catch
154
+ {
155
+ // Inaccessible candidate — skip it.
156
+ }
149
157
  }
150
158
  }
151
159
 
@@ -249,7 +257,7 @@ namespace com.AtelierAI.Unity.Copilot.Editor
249
257
  // documented project-local install location so the generated config is
250
258
  // still a valid, copy-pasteable starting point.
251
259
  var serverEntry = ResolveNodeServerEntry()
252
- ?? Path.Combine("node_modules", NodeServerPackageName, NodeServerEntryRelativePath);
260
+ ?? Path.Combine("node_modules", NodeServerPackageNames[0], NodeServerEntryRelativePath);
253
261
 
254
262
  serverConfig["command"] = ResolveNodeExecutable().Replace('\\', '/');
255
263
 
@@ -951,17 +959,6 @@ namespace com.AtelierAI.Unity.Copilot.Editor
951
959
  }
952
960
  }
953
961
 
954
- /// <summary>
955
- /// Returns true when the local server may be auto-started for the given connection mode.
956
- /// Only Custom mode targets the local server, so auto-start is allowed there (subject to
957
- /// other gates such as <see cref="UnityCopilotPluginEditor.KeepServerRunning"/>). Every other
958
- /// mode (Cloud today, plus any future addition) connects to a remote endpoint and must
959
- /// never auto-start the local server on Editor launch or after a binary update.
960
- /// Pure (no Unity API access) so it can be unit-tested in EditMode.
961
- /// </summary>
962
- public static bool IsAutoStartAllowedForMode(ConnectionMode mode)
963
- => mode == ConnectionMode.Custom;
964
-
965
962
  /// <summary>
966
963
  /// Starts the server if KeepServerRunning is enabled and no external server is detected.
967
964
  /// This method is called during Unity Editor startup to auto-start the server based on user preference.
@@ -971,13 +968,6 @@ namespace com.AtelierAI.Unity.Copilot.Editor
971
968
  {
972
969
  EditorApplication.update -= StartServerIfNeeded;
973
970
 
974
- // Skip local server auto-start in Cloud mode — Unity connects to the cloud server instead
975
- if (!IsAutoStartAllowedForMode(UnityCopilotPluginEditor.ConnectionMode))
976
- {
977
- _logger.LogDebug("StartServerIfNeeded: Cloud mode active, skipping local server auto-start");
978
- return;
979
- }
980
-
981
971
  // Check if user wants the server to keep running
982
972
  if (!UnityCopilotPluginEditor.KeepServerRunning)
983
973
  {