@mflrevan/ucp 0.3.1 → 0.3.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mflrevan/ucp
2
2
 
3
- Version `0.3.1` of the Unity Control Protocol CLI.
3
+ Version `0.3.3` of the Unity Control Protocol CLI.
4
4
 
5
5
  This package installs the `ucp` command, downloads the matching published binary for your platform during `postinstall`, and ships the matching Unity bridge payload inside the npm package.
6
6
 
@@ -49,7 +49,7 @@ Or add this to `Packages/manifest.json`:
49
49
  ```json
50
50
  {
51
51
  "dependencies": {
52
- "com.ucp.bridge": "https://github.com/mflRevan/unity-control-protocol.git?path=unity-package/com.ucp.bridge#v0.3.1"
52
+ "com.ucp.bridge": "https://github.com/mflRevan/unity-control-protocol.git?path=unity-package/com.ucp.bridge#v0.3.3"
53
53
  }
54
54
  }
55
55
  ```
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.3] - 2026-03-14
4
+
5
+ ### Added
6
+
7
+ - Added missing Unity metadata for `EditorController.cs` and `ObjectReferenceResolver.cs` so both controllers import reliably in embedded and tracked package installs.
8
+
9
+ ### Changed
10
+
11
+ - `CommandRouter` now maps `ArgumentException` to `InvalidParams` and `UnauthorizedAccessException` to `FileAccessDenied` without emitting misleading internal-error logs.
12
+
13
+ ### Fixed
14
+
15
+ - Fixed negative smoke tests around unresolved object references and project-root path traversal.
16
+
17
+ ## [0.3.2] - 2026-03-14
18
+
19
+ ### Added
20
+
21
+ - Added `editor/quit` so the CLI can request graceful Unity editor shutdown before falling back to OS-level close/terminate behavior.
22
+
23
+ ### Changed
24
+
25
+ - Bridge server registration now includes editor lifecycle RPC handlers alongside the existing play, compile, scene, asset, and build controllers.
26
+
3
27
  ## [0.3.1] - 2026-03-14
4
28
 
5
29
  ### Added
@@ -26,7 +26,7 @@ namespace UCP.Bridge
26
26
  private const int DefaultPort = 21342;
27
27
  private const int MaxPort = 21352;
28
28
  private const int MaxConnections = 4;
29
- private const string ProtocolVersion = "0.3.1";
29
+ private const string ProtocolVersion = "0.3.3";
30
30
 
31
31
  private static TcpListener s_listener;
32
32
  private static CancellationTokenSource s_cts;
@@ -108,6 +108,9 @@ namespace UCP.Bridge
108
108
  // Compilation
109
109
  CompilationController.Register(s_router);
110
110
 
111
+ // Editor lifecycle
112
+ EditorController.Register(s_router);
113
+
111
114
  // Scenes
112
115
  SceneController.Register(s_router);
113
116
 
@@ -0,0 +1,18 @@
1
+ using UnityEditor;
2
+
3
+ namespace UCP.Bridge
4
+ {
5
+ public static class EditorController
6
+ {
7
+ public static void Register(CommandRouter router)
8
+ {
9
+ router.Register("editor/quit", HandleQuit);
10
+ }
11
+
12
+ private static object HandleQuit(string paramsJson)
13
+ {
14
+ EditorApplication.delayCall += () => EditorApplication.Exit(0);
15
+ return new { status = "ok", message = "Unity editor shutdown requested" };
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ fileFormatVersion: 2
2
+ guid: 4dfae33b6e324de8b6502bbf8e3e44cd
@@ -0,0 +1,2 @@
1
+ fileFormatVersion: 2
2
+ guid: 3e6a1ac0c4ee4782a482cc62f85e5313
@@ -31,6 +31,14 @@ namespace UCP.Bridge
31
31
  var result = handler(paramsJson);
32
32
  return JsonRpcResponse.Success(id, result);
33
33
  }
34
+ catch (ArgumentException ex)
35
+ {
36
+ return JsonRpcResponse.Error(id, ErrorCodes.InvalidParams, ex.Message);
37
+ }
38
+ catch (UnauthorizedAccessException ex)
39
+ {
40
+ return JsonRpcResponse.Error(id, ErrorCodes.FileAccessDenied, ex.Message);
41
+ }
34
42
  catch (Exception ex)
35
43
  {
36
44
  Debug.LogError($"[UCP] Error handling '{method}': {ex}");
@@ -301,6 +301,7 @@ namespace UCP.Bridge.Tests
301
301
  );
302
302
 
303
303
  Assert.That(response.error, Is.Not.Null);
304
+ Assert.That(response.error.code, Is.EqualTo(ErrorCodes.InvalidParams));
304
305
  }
305
306
 
306
307
  [Test]
@@ -348,9 +349,9 @@ namespace UCP.Bridge.Tests
348
349
  var readResult = (Dictionary<string, object>)read.result;
349
350
  Assert.That(readResult["content"].ToString(), Is.EqualTo("hello patched"));
350
351
 
351
- LogAssert.Expect(LogType.Error, new Regex("\\[UCP\\] Error handling 'file/read':"));
352
352
  var traversal = _router.Dispatch("file/read", 1, "{\"path\":\"../outside.txt\"}");
353
353
  Assert.That(traversal.error, Is.Not.Null);
354
+ Assert.That(traversal.error.code, Is.EqualTo(ErrorCodes.FileAccessDenied));
354
355
  }
355
356
 
356
357
  [Test]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.ucp.bridge",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "displayName": "Unity Control Protocol Bridge",
5
5
  "description": "WebSocket bridge for programmatic Unity Editor control via CLI and AI agents.",
6
6
  "unity": "2021.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mflrevan/ucp",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Unity Control Protocol — CLI for programmatic Unity Editor control",
5
5
  "license": "MIT",
6
6
  "repository": {