@atelierai/uco 1.0.8 → 1.0.9

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 (31) hide show
  1. package/CHANGELOG.md +18 -8
  2. package/package.json +2 -2
  3. package/vendor/plugin/com.atelierai.unity.copilot/CHANGELOG.md +4 -4
  4. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/API/Tool/ToolGroups.SetEnabled.cs +92 -92
  5. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/CopilotServerManager.cs +0 -147
  6. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/UI/Window/MainWindowEditor.CopilotServer.cs +3 -3
  7. package/vendor/plugin/com.atelierai.unity.copilot/Editor/Scripts/Utils/ToolGroupRegistry.cs +461 -460
  8. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/CopilotPromptsWindow.uss +11 -11
  9. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/CopilotResourcesWindow.uss +16 -16
  10. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/CopilotToolsWindow.uss +36 -36
  11. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/MainWindow.uss +183 -183
  12. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/common/{_mcp-list-window.uss → _copilot-list-window.uss} +18 -18
  13. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/common/_list-view.uss +77 -77
  14. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uxml/CopilotPromptsWindow.uxml +18 -18
  15. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uxml/CopilotResourcesWindow.uxml +18 -18
  16. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uxml/CopilotToolsWindow.uxml +18 -18
  17. package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uxml/MainWindow.uxml +115 -115
  18. package/vendor/plugin/com.atelierai.unity.copilot/Plugins/ReflectorNet.dll +0 -0
  19. package/vendor/plugin/com.atelierai.unity.copilot/Plugins/Uco.Framework.Common.dll +0 -0
  20. package/vendor/plugin/com.atelierai.unity.copilot/Plugins/Uco.Framework.dll +0 -0
  21. package/vendor/plugin/com.atelierai.unity.copilot/README.md +88 -88
  22. package/vendor/plugin/com.atelierai.unity.copilot/Runtime/UnityCopilotPlugin.cs +1 -1
  23. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/DependencyResolver/NuGetExtractorDevelopmentDependencyTests.cs +148 -148
  24. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/DependencyResolver/NuGetExtractorFlatLayoutTests.cs +166 -166
  25. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/DependencyResolver/NuGetInstallManifestTests.cs +436 -436
  26. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/DependencyResolver/NuGetLegacyMigrationTests.cs +1 -1
  27. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/DependencyResolver/NuGetPackageInstallerStaleVersionCleanupTests.cs +200 -200
  28. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/Environment/EnvironmentUtilsTests.cs +1 -1
  29. package/vendor/plugin/com.atelierai.unity.copilot/Tests/Editor/Tool/GameObject/TestJsonSchema.cs +199 -199
  30. package/vendor/plugin/com.atelierai.unity.copilot/package.json +1 -1
  31. /package/vendor/plugin/com.atelierai.unity.copilot/Editor/UI/uss/common/{_mcp-list-window.uss.meta → _copilot-list-window.uss.meta} +0 -0
@@ -1,166 +1,166 @@
1
- /*
2
- +------------------------------------------------------------------+
3
- | Author: Ivan Murzak (https://github.com/IvanMurzak) |
4
- | Repository: GitHub (https://github.com/IvanMurzak/Unity-MCP) |
5
- | Copyright (c) 2025 Ivan Murzak |
6
- | Licensed under the Apache License, Version 2.0. |
7
- | See the LICENSE file in the project root for more information. |
8
- +------------------------------------------------------------------+
9
- */
10
-
11
- #nullable enable
12
- using System.IO;
13
- using System.IO.Compression;
14
- using NUnit.Framework;
15
- using com.AtelierAI.Unity.Copilot.Editor.DependencyResolver;
16
-
17
- namespace com.AtelierAI.Unity.Copilot.Editor.Tests.DependencyResolverTests
18
- {
19
- /// <summary>
20
- /// Coverage for <see cref="NuGetExtractor"/>'s flat-layout extraction.
21
- /// Synthetic .nupkg fixtures exercise the extractor directly without
22
- /// touching nuget.org. DLLs are written FLAT under the install directory
23
- /// using the original <c>{stem}.dll</c> filename from the .nupkg lib
24
- /// folder — the package version is NOT embedded in the on-disk filename
25
- /// (it is tracked in <see cref="NuGetInstallManifest"/> instead, so
26
- /// asmdef <c>precompiledReferences</c> stay stable across version bumps).
27
- /// </summary>
28
- [TestFixture]
29
- public class NuGetExtractorFlatLayoutTests
30
- {
31
- string _tempDir = string.Empty;
32
- string _installDir = string.Empty;
33
-
34
- [SetUp]
35
- public void SetUp()
36
- {
37
- _tempDir = Path.Combine(Path.GetTempPath(), "UnityMcp-Extractor-" + Path.GetRandomFileName());
38
- Directory.CreateDirectory(_tempDir);
39
- _installDir = Path.Combine(_tempDir, "install");
40
- Directory.CreateDirectory(_installDir);
41
- }
42
-
43
- [TearDown]
44
- public void TearDown()
45
- {
46
- if (Directory.Exists(_tempDir))
47
- {
48
- try { Directory.Delete(_tempDir, recursive: true); }
49
- catch { /* best-effort */ }
50
- }
51
- }
52
-
53
- [Test]
54
- public void ExtractDlls_WritesUnversionedFlatFilename()
55
- {
56
- // Output filename is the original {stem}.dll from the .nupkg's
57
- // lib/<tfm>/ folder; version is tracked in the manifest, not the
58
- // filename. The DLL sits directly under the install path (no
59
- // per-package subfolder, no version tail).
60
- var nupkg = BuildNupkg("System.Text.Json", "8.0.5", "lib/netstandard2.0/System.Text.Json.dll");
61
-
62
- var extracted = NuGetExtractor.ExtractDlls(nupkg, _installDir);
63
-
64
- CollectionAssert.AreEqual(new[] { "System.Text.Json.dll" }, extracted);
65
- Assert.IsTrue(File.Exists(Path.Combine(_installDir, "System.Text.Json.dll")));
66
- Assert.IsFalse(File.Exists(Path.Combine(_installDir, "System.Text.Json.8.0.5.dll")),
67
- "Versioned-filename layout is no longer produced.");
68
- }
69
-
70
- [Test]
71
- public void ExtractDlls_WritesAllShippedDlls_ForMultiDllPackage()
72
- {
73
- // Multi-DLL packages (e.g. Microsoft.Bcl.Memory) write every DLL
74
- // under its original stem; the per-package version (10.0.3 here)
75
- // lives in the manifest entry.
76
- var nupkg = BuildNupkg("Microsoft.Bcl.Memory", "10.0.3",
77
- "lib/netstandard2.0/System.Memory.dll",
78
- "lib/netstandard2.0/System.Buffers.dll",
79
- "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll");
80
-
81
- var extracted = NuGetExtractor.ExtractDlls(nupkg, _installDir);
82
-
83
- CollectionAssert.AreEquivalent(
84
- new[]
85
- {
86
- "System.Memory.dll",
87
- "System.Buffers.dll",
88
- "System.Runtime.CompilerServices.Unsafe.dll",
89
- },
90
- extracted);
91
- }
92
-
93
- [Test]
94
- public void ExtractDlls_OverwritesExistingFile_ForVersionBumpInPlace()
95
- {
96
- // Steady-state version-bump: the same {stem}.dll filename is
97
- // reused across versions, so re-extraction overwrites bytes in
98
- // place. This is the primary win of the unversioned layout —
99
- // asmdef precompiledReferences never need to be edited when the
100
- // configured package version bumps.
101
- var nupkg = BuildNupkg("Foo.Bar", "1.0.0", "lib/netstandard2.0/Foo.Bar.dll");
102
- var targetPath = Path.Combine(_installDir, "Foo.Bar.dll");
103
-
104
- File.WriteAllText(targetPath, "old-version-bytes");
105
- NuGetExtractor.ExtractDlls(nupkg, _installDir);
106
-
107
- Assert.AreEqual("dummy-dll-content", File.ReadAllText(targetPath),
108
- "Extraction must overwrite the existing file with the new version's bytes.");
109
- }
110
-
111
- [Test]
112
- public void ExtractDlls_ReturnsEmpty_WhenPackageHasNoCompatibleFramework()
113
- {
114
- // Build a nupkg with NO lib/ entries.
115
- var emptyNupkg = Path.Combine(_tempDir, "Empty.1.0.0.nupkg");
116
- using (var zip = ZipFile.Open(emptyNupkg, ZipArchiveMode.Create))
117
- {
118
- var entry = zip.CreateEntry("Empty.nuspec");
119
- using var w = new StreamWriter(entry.Open());
120
- w.Write("<?xml version=\"1.0\"?><package><metadata><id>Empty</id><version>1.0.0</version><authors>t</authors><description>t</description></metadata></package>");
121
- }
122
-
123
- var extracted = NuGetExtractor.ExtractDlls(emptyNupkg, _installDir);
124
-
125
- Assert.AreEqual(0, extracted.Count);
126
- Assert.AreEqual(0, Directory.GetFiles(_installDir).Length,
127
- "Empty package must not write anything to disk.");
128
- }
129
-
130
- /// <summary>
131
- /// Builds a minimal synthetic .nupkg zip with a .nuspec at the root and
132
- /// the given lib/{tfm}/*.dll entries. Sufficient input for the
133
- /// extractor under test.
134
- /// </summary>
135
- string BuildNupkg(string id, string version, params string[] entryPaths)
136
- {
137
- var nupkgPath = Path.Combine(_tempDir, $"{id}.{version}.nupkg");
138
- using var zip = ZipFile.Open(nupkgPath, ZipArchiveMode.Create);
139
-
140
- // Minimal .nuspec at root.
141
- var nuspec = zip.CreateEntry($"{id}.nuspec");
142
- using (var w = new StreamWriter(nuspec.Open()))
143
- {
144
- w.Write(
145
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
146
- "<package xmlns=\"http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd\">" +
147
- "<metadata>" +
148
- $"<id>{id}</id>" +
149
- $"<version>{version}</version>" +
150
- "<authors>test</authors>" +
151
- "<description>fixture</description>" +
152
- "</metadata>" +
153
- "</package>");
154
- }
155
-
156
- foreach (var path in entryPaths)
157
- {
158
- var entry = zip.CreateEntry(path);
159
- using var w = new StreamWriter(entry.Open());
160
- w.Write("dummy-dll-content");
161
- }
162
-
163
- return nupkgPath;
164
- }
165
- }
166
- }
1
+ /*
2
+ +------------------------------------------------------------------+
3
+ | Author: Ivan Murzak (https://github.com/IvanMurzak) |
4
+ | Repository: GitHub (https://github.com/IvanMurzak/Unity-MCP) |
5
+ | Copyright (c) 2025 Ivan Murzak |
6
+ | Licensed under the Apache License, Version 2.0. |
7
+ | See the LICENSE file in the project root for more information. |
8
+ +------------------------------------------------------------------+
9
+ */
10
+
11
+ #nullable enable
12
+ using System.IO;
13
+ using System.IO.Compression;
14
+ using NUnit.Framework;
15
+ using com.AtelierAI.Unity.Copilot.Editor.DependencyResolver;
16
+
17
+ namespace com.AtelierAI.Unity.Copilot.Editor.Tests.DependencyResolverTests
18
+ {
19
+ /// <summary>
20
+ /// Coverage for <see cref="NuGetExtractor"/>'s flat-layout extraction.
21
+ /// Synthetic .nupkg fixtures exercise the extractor directly without
22
+ /// touching nuget.org. DLLs are written FLAT under the install directory
23
+ /// using the original <c>{stem}.dll</c> filename from the .nupkg lib
24
+ /// folder — the package version is NOT embedded in the on-disk filename
25
+ /// (it is tracked in <see cref="NuGetInstallManifest"/> instead, so
26
+ /// asmdef <c>precompiledReferences</c> stay stable across version bumps).
27
+ /// </summary>
28
+ [TestFixture]
29
+ public class NuGetExtractorFlatLayoutTests
30
+ {
31
+ string _tempDir = string.Empty;
32
+ string _installDir = string.Empty;
33
+
34
+ [SetUp]
35
+ public void SetUp()
36
+ {
37
+ _tempDir = Path.Combine(Path.GetTempPath(), "Uco-Extractor-" + Path.GetRandomFileName());
38
+ Directory.CreateDirectory(_tempDir);
39
+ _installDir = Path.Combine(_tempDir, "install");
40
+ Directory.CreateDirectory(_installDir);
41
+ }
42
+
43
+ [TearDown]
44
+ public void TearDown()
45
+ {
46
+ if (Directory.Exists(_tempDir))
47
+ {
48
+ try { Directory.Delete(_tempDir, recursive: true); }
49
+ catch { /* best-effort */ }
50
+ }
51
+ }
52
+
53
+ [Test]
54
+ public void ExtractDlls_WritesUnversionedFlatFilename()
55
+ {
56
+ // Output filename is the original {stem}.dll from the .nupkg's
57
+ // lib/<tfm>/ folder; version is tracked in the manifest, not the
58
+ // filename. The DLL sits directly under the install path (no
59
+ // per-package subfolder, no version tail).
60
+ var nupkg = BuildNupkg("System.Text.Json", "8.0.5", "lib/netstandard2.0/System.Text.Json.dll");
61
+
62
+ var extracted = NuGetExtractor.ExtractDlls(nupkg, _installDir);
63
+
64
+ CollectionAssert.AreEqual(new[] { "System.Text.Json.dll" }, extracted);
65
+ Assert.IsTrue(File.Exists(Path.Combine(_installDir, "System.Text.Json.dll")));
66
+ Assert.IsFalse(File.Exists(Path.Combine(_installDir, "System.Text.Json.8.0.5.dll")),
67
+ "Versioned-filename layout is no longer produced.");
68
+ }
69
+
70
+ [Test]
71
+ public void ExtractDlls_WritesAllShippedDlls_ForMultiDllPackage()
72
+ {
73
+ // Multi-DLL packages (e.g. Microsoft.Bcl.Memory) write every DLL
74
+ // under its original stem; the per-package version (10.0.3 here)
75
+ // lives in the manifest entry.
76
+ var nupkg = BuildNupkg("Microsoft.Bcl.Memory", "10.0.3",
77
+ "lib/netstandard2.0/System.Memory.dll",
78
+ "lib/netstandard2.0/System.Buffers.dll",
79
+ "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll");
80
+
81
+ var extracted = NuGetExtractor.ExtractDlls(nupkg, _installDir);
82
+
83
+ CollectionAssert.AreEquivalent(
84
+ new[]
85
+ {
86
+ "System.Memory.dll",
87
+ "System.Buffers.dll",
88
+ "System.Runtime.CompilerServices.Unsafe.dll",
89
+ },
90
+ extracted);
91
+ }
92
+
93
+ [Test]
94
+ public void ExtractDlls_OverwritesExistingFile_ForVersionBumpInPlace()
95
+ {
96
+ // Steady-state version-bump: the same {stem}.dll filename is
97
+ // reused across versions, so re-extraction overwrites bytes in
98
+ // place. This is the primary win of the unversioned layout —
99
+ // asmdef precompiledReferences never need to be edited when the
100
+ // configured package version bumps.
101
+ var nupkg = BuildNupkg("Foo.Bar", "1.0.0", "lib/netstandard2.0/Foo.Bar.dll");
102
+ var targetPath = Path.Combine(_installDir, "Foo.Bar.dll");
103
+
104
+ File.WriteAllText(targetPath, "old-version-bytes");
105
+ NuGetExtractor.ExtractDlls(nupkg, _installDir);
106
+
107
+ Assert.AreEqual("dummy-dll-content", File.ReadAllText(targetPath),
108
+ "Extraction must overwrite the existing file with the new version's bytes.");
109
+ }
110
+
111
+ [Test]
112
+ public void ExtractDlls_ReturnsEmpty_WhenPackageHasNoCompatibleFramework()
113
+ {
114
+ // Build a nupkg with NO lib/ entries.
115
+ var emptyNupkg = Path.Combine(_tempDir, "Empty.1.0.0.nupkg");
116
+ using (var zip = ZipFile.Open(emptyNupkg, ZipArchiveMode.Create))
117
+ {
118
+ var entry = zip.CreateEntry("Empty.nuspec");
119
+ using var w = new StreamWriter(entry.Open());
120
+ w.Write("<?xml version=\"1.0\"?><package><metadata><id>Empty</id><version>1.0.0</version><authors>t</authors><description>t</description></metadata></package>");
121
+ }
122
+
123
+ var extracted = NuGetExtractor.ExtractDlls(emptyNupkg, _installDir);
124
+
125
+ Assert.AreEqual(0, extracted.Count);
126
+ Assert.AreEqual(0, Directory.GetFiles(_installDir).Length,
127
+ "Empty package must not write anything to disk.");
128
+ }
129
+
130
+ /// <summary>
131
+ /// Builds a minimal synthetic .nupkg zip with a .nuspec at the root and
132
+ /// the given lib/{tfm}/*.dll entries. Sufficient input for the
133
+ /// extractor under test.
134
+ /// </summary>
135
+ string BuildNupkg(string id, string version, params string[] entryPaths)
136
+ {
137
+ var nupkgPath = Path.Combine(_tempDir, $"{id}.{version}.nupkg");
138
+ using var zip = ZipFile.Open(nupkgPath, ZipArchiveMode.Create);
139
+
140
+ // Minimal .nuspec at root.
141
+ var nuspec = zip.CreateEntry($"{id}.nuspec");
142
+ using (var w = new StreamWriter(nuspec.Open()))
143
+ {
144
+ w.Write(
145
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
146
+ "<package xmlns=\"http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd\">" +
147
+ "<metadata>" +
148
+ $"<id>{id}</id>" +
149
+ $"<version>{version}</version>" +
150
+ "<authors>test</authors>" +
151
+ "<description>fixture</description>" +
152
+ "</metadata>" +
153
+ "</package>");
154
+ }
155
+
156
+ foreach (var path in entryPaths)
157
+ {
158
+ var entry = zip.CreateEntry(path);
159
+ using var w = new StreamWriter(entry.Open());
160
+ w.Write("dummy-dll-content");
161
+ }
162
+
163
+ return nupkgPath;
164
+ }
165
+ }
166
+ }