diff --git a/.agents/skills/uloop-control-play-mode/SKILL.md b/.agents/skills/uloop-control-play-mode/SKILL.md
index 220eeebe9..3eead2c5e 100644
--- a/.agents/skills/uloop-control-play-mode/SKILL.md
+++ b/.agents/skills/uloop-control-play-mode/SKILL.md
@@ -1,5 +1,6 @@
---
name: uloop-control-play-mode
+toolName: control-play-mode
description: "Control Unity Editor play mode (play/stop/pause). Use when you need to: (1) Start play mode to test game behavior, (2) Stop play mode to return to edit mode, (3) Pause play mode for frame-by-frame inspection."
---
diff --git a/.claude/skills/uloop-control-play-mode/SKILL.md b/.claude/skills/uloop-control-play-mode/SKILL.md
index 220eeebe9..3eead2c5e 100644
--- a/.claude/skills/uloop-control-play-mode/SKILL.md
+++ b/.claude/skills/uloop-control-play-mode/SKILL.md
@@ -1,5 +1,6 @@
---
name: uloop-control-play-mode
+toolName: control-play-mode
description: "Control Unity Editor play mode (play/stop/pause). Use when you need to: (1) Start play mode to test game behavior, (2) Stop play mode to return to edit mode, (3) Pause play mode for frame-by-frame inspection."
---
diff --git a/.coderabbit.yaml b/.coderabbit.yaml
index 4725cd50c..99ddbc02b 100644
--- a/.coderabbit.yaml
+++ b/.coderabbit.yaml
@@ -12,7 +12,7 @@ reviews:
poem: false
auto_review:
enabled: true
- drafts: true
+ drafts: false
base_branches:
- ".*"
path_filters:
diff --git a/.gitignore b/.gitignore
index 3f2444739..71014174a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -106,6 +106,10 @@ yarn-error.log*
.npm
.yarn-integrity
+# .NET development tools
+**/[Bb]in/
+**/[Oo]bj/
+
# Native Go CLI release artifacts are included in the Unity package
Packages/src/Cli~/Core~/dist/*
!Packages/src/Cli~/Core~/dist/darwin-arm64/
diff --git a/Assets/Editor/CaptureTest/EditorWindowCaptureTest.cs b/Assets/Editor/CaptureTest/EditorWindowCaptureTest.cs
index 8cd9587de..0c04e852b 100644
--- a/Assets/Editor/CaptureTest/EditorWindowCaptureTest.cs
+++ b/Assets/Editor/CaptureTest/EditorWindowCaptureTest.cs
@@ -3,8 +3,14 @@
using System.IO;
using System.Threading;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Defines the Unity Editor window for Editor Window Capture workflows.
+ ///
public class EditorWindowCaptureTest : EditorWindow
{
private string _windowName = "Console";
@@ -34,7 +40,7 @@ private void OnGUI()
EditorWindow[] windows = EditorWindowCaptureUtility.FindWindowsByName(_windowName, _matchMode);
if (windows.Length > 0)
{
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ System.Text.StringBuilder sb = new();
sb.AppendLine($"Found {windows.Length} window(s):");
for (int i = 0; i < windows.Length; i++)
{
@@ -117,14 +123,14 @@ private async void CaptureWindowAsync()
DestroyImmediate(_previewTexture);
}
- string outputDir = Path.Combine(Application.dataPath.Replace("/Assets", ""), McpConstants.OUTPUT_ROOT_DIR, McpConstants.SCREENSHOTS_DIR);
+ string outputDir = Path.Combine(UnityEngine.Application.dataPath.Replace("/Assets", ""), UnityCliLoopConstants.OUTPUT_ROOT_DIR, UnityCliLoopConstants.SCREENSHOTS_DIR);
if (!Directory.Exists(outputDir))
{
Directory.CreateDirectory(outputDir);
}
string timestamp = System.DateTime.Now.ToString("yyyyMMdd_HHmmss");
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ System.Text.StringBuilder sb = new();
sb.AppendLine($"Captured {windows.Length} window(s):");
for (int i = 0; i < windows.Length; i++)
@@ -176,14 +182,14 @@ private void OnDestroy()
///
private void OpenOutputFolder()
{
- string outputDir = Path.Combine(Application.dataPath.Replace("/Assets", ""), McpConstants.OUTPUT_ROOT_DIR, McpConstants.SCREENSHOTS_DIR);
+ string outputDir = Path.Combine(UnityEngine.Application.dataPath.Replace("/Assets", ""), UnityCliLoopConstants.OUTPUT_ROOT_DIR, UnityCliLoopConstants.SCREENSHOTS_DIR);
if (!Directory.Exists(outputDir))
{
Directory.CreateDirectory(outputDir);
}
string fileUri = "file:///" + outputDir.Replace("\\", "/");
- Application.OpenURL(fileUri);
+ UnityEngine.Application.OpenURL(fileUri);
}
}
}
diff --git a/Assets/Editor/CompileCheckWindow/CompileCheckerExample.cs b/Assets/Editor/CompileCheckWindow/CompileCheckerExample.cs
index f8eef8784..2221a2cc7 100644
--- a/Assets/Editor/CompileCheckWindow/CompileCheckerExample.cs
+++ b/Assets/Editor/CompileCheckWindow/CompileCheckerExample.cs
@@ -1,14 +1,19 @@
using UnityEditor;
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Provides Compile Checker Example behavior for Unity CLI Loop.
+ ///
public class CompileCheckerExample
{
[MenuItem("UnityCliLoop/Debug/Compile Tests/Compile Checker Usage Example")]
public static async void TestCompileChecker()
{
- CompileController compileController = new CompileController();
+ CompileController compileController = new();
try
{
@@ -42,7 +47,7 @@ public static async void TestCompileChecker()
[MenuItem("UnityCliLoop/Debug/Compile Tests/Force Compile Checker Usage Example")]
public static async void TestForceCompileChecker()
{
- CompileController compileController = new CompileController();
+ CompileController compileController = new();
try
{
diff --git a/Assets/Editor/CompileCheckWindow/CompileEditorWindow.cs b/Assets/Editor/CompileCheckWindow/CompileEditorWindow.cs
index c266bc434..e453b7435 100644
--- a/Assets/Editor/CompileCheckWindow/CompileEditorWindow.cs
+++ b/Assets/Editor/CompileCheckWindow/CompileEditorWindow.cs
@@ -3,8 +3,15 @@
using UnityEditor.Compilation;
using System.Threading.Tasks;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Application;
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Defines the Unity Editor window for Compile Editor workflows.
+ ///
public class CompileEditorWindow : EditorWindow
{
private CompileController _compileController;
@@ -139,7 +146,7 @@ private async Task ExecuteCompileAsync()
private void OnCompileCompleted(CompileResult result)
{
_logDisplay.AppendCompletionMessage(result);
- McpEditorSettings.SetCompileWindowHasData(true);
+ UnityCliLoopEditorSettings.SetCompileWindowHasData(true);
Repaint();
}
@@ -168,7 +175,7 @@ private void ClearLog()
_compileController.ClearMessages();
// Also clear McpSessionManager data
- McpEditorSettings.ClearCompileWindowData();
+ UnityCliLoopEditorSettings.ClearCompileWindowData();
Repaint();
}
diff --git a/Assets/Editor/CompileCheckWindow/CompileLogDisplay.cs b/Assets/Editor/CompileCheckWindow/CompileLogDisplay.cs
index b51c25117..1eef91de0 100644
--- a/Assets/Editor/CompileCheckWindow/CompileLogDisplay.cs
+++ b/Assets/Editor/CompileCheckWindow/CompileLogDisplay.cs
@@ -1,8 +1,13 @@
using UnityEditor.Compilation;
using System.Text;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Provides Compile Log Display behavior for Unity CLI Loop.
+ ///
public class CompileLogDisplay : System.IDisposable
{
private StringBuilder _logBuilder = new();
diff --git a/Assets/Editor/ConsoleMaskDebugger.cs b/Assets/Editor/ConsoleMaskDebugger.cs
index dfd390cfc..ae2ff2aa3 100644
--- a/Assets/Editor/ConsoleMaskDebugger.cs
+++ b/Assets/Editor/ConsoleMaskDebugger.cs
@@ -3,7 +3,7 @@
using UnityEditor;
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Debug tool to analyze Unity Console mask values for different Clear settings
diff --git a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoResponse.cs b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoResponse.cs
index 481f4b6cc..ad85711dd 100644
--- a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoResponse.cs
+++ b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoResponse.cs
@@ -1,13 +1,13 @@
using System;
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Response schema for GetProjectInfo tool
/// Provides detailed Unity project information
///
- public class GetProjectInfoResponse : BaseToolResponse
+ public class GetProjectInfoResponse : UnityCliLoopToolResponse
{
public string ProjectName { get; set; }
public string CompanyName { get; set; }
diff --git a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoSchema.cs b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoSchema.cs
index 0302ecc7a..8c0ebdb23 100644
--- a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoSchema.cs
+++ b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoSchema.cs
@@ -1,12 +1,12 @@
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Schema for GetProjectInfo tool parameters
/// This tool takes no parameters
///
- public class GetProjectInfoSchema : BaseToolSchema
+ public class GetProjectInfoSchema : UnityCliLoopToolSchema
{
// No parameters needed for this tool
}
diff --git a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoTool.cs b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoTool.cs
index f41bfb81e..6328c2cc2 100644
--- a/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoTool.cs
+++ b/Assets/Editor/CustomCommandSamples/GetProjectInfo/GetProjectInfoTool.cs
@@ -1,37 +1,36 @@
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Project information retrieval custom tool
/// Example of retrieving detailed Unity project information
///
- [McpTool(Description = "Get detailed Unity project information")]
- public class GetProjectInfoTool : AbstractUnityTool
+ [UnityCliLoopTool]
+ public class GetProjectInfoTool : UnityCliLoopTool
{
public override string ToolName => "get-project-info";
protected override Task ExecuteAsync(GetProjectInfoSchema parameters, CancellationToken cancellationToken)
{
- GetProjectInfoResponse response = new GetProjectInfoResponse
- {
- ProjectName = Application.productName,
- CompanyName = Application.companyName,
- Version = Application.version,
- UnityVersion = Application.unityVersion,
- Platform = Application.platform.ToString(),
- DataPath = Application.dataPath,
- PersistentDataPath = Application.persistentDataPath,
- TemporaryCachePath = Application.temporaryCachePath,
- IsEditor = Application.isEditor,
- IsPlaying = Application.isPlaying,
- TargetFrameRate = Application.targetFrameRate,
- RunInBackground = Application.runInBackground,
- SystemLanguage = Application.systemLanguage.ToString(),
- InternetReachability = Application.internetReachability.ToString(),
+ GetProjectInfoResponse response = new() {
+ ProjectName = UnityEngine.Application.productName,
+ CompanyName = UnityEngine.Application.companyName,
+ Version = UnityEngine.Application.version,
+ UnityVersion = UnityEngine.Application.unityVersion,
+ Platform = UnityEngine.Application.platform.ToString(),
+ DataPath = UnityEngine.Application.dataPath,
+ PersistentDataPath = UnityEngine.Application.persistentDataPath,
+ TemporaryCachePath = UnityEngine.Application.temporaryCachePath,
+ IsEditor = UnityEngine.Application.isEditor,
+ IsPlaying = UnityEngine.Application.isPlaying,
+ TargetFrameRate = UnityEngine.Application.targetFrameRate,
+ RunInBackground = UnityEngine.Application.runInBackground,
+ SystemLanguage = UnityEngine.Application.systemLanguage.ToString(),
+ InternetReachability = UnityEngine.Application.internetReachability.ToString(),
DeviceType = SystemInfo.deviceType.ToString(),
DeviceModel = SystemInfo.deviceModel,
OperatingSystem = SystemInfo.operatingSystem,
diff --git a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldResponse.cs b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldResponse.cs
index 5807554c1..7db0e3a2f 100644
--- a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldResponse.cs
+++ b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldResponse.cs
@@ -1,12 +1,12 @@
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Response schema for HelloWorld tool
/// Provides type-safe response structure
///
- public class HelloWorldResponse : BaseToolResponse
+ public class HelloWorldResponse : UnityCliLoopToolResponse
{
///
/// The greeting message
diff --git a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldSchema.cs b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldSchema.cs
index a77c25da9..2bdc6d0c4 100644
--- a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldSchema.cs
+++ b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldSchema.cs
@@ -1,7 +1,7 @@
using System.ComponentModel;
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Supported languages for greeting
@@ -18,7 +18,7 @@ public enum GreetingLanguage
/// Schema for HelloWorld tool parameters
/// Provides type-safe parameter access with default values
///
- public class HelloWorldSchema : BaseToolSchema
+ public class HelloWorldSchema : UnityCliLoopToolSchema
{
///
/// Name to greet
diff --git a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldTool.cs b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldTool.cs
index 3d9027e80..7ae26a00f 100644
--- a/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldTool.cs
+++ b/Assets/Editor/CustomCommandSamples/HelloWorld/HelloWorldTool.cs
@@ -1,16 +1,16 @@
using System;
using System.Threading;
using System.Threading.Tasks;
-using io.github.hatayama.UnityCliLoop;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
-namespace Samples
+namespace io.github.hatayama.UnityCliLoop.Samples
{
///
/// Hello World custom tool - Type-safe implementation using Schema and Response
/// Basic implementation example of a custom tool with strongly typed parameters and response
///
- [McpTool(Description = "Personalized hello world tool with name parameter")]
- public class HelloWorldTool : AbstractUnityTool
+ [UnityCliLoopTool]
+ public class HelloWorldTool : UnityCliLoopTool
{
public override string ToolName => "hello-world";
@@ -31,7 +31,7 @@ protected override Task ExecuteAsync(HelloWorldSchema parame
};
// Create type-safe response
- HelloWorldResponse response = new HelloWorldResponse(
+ HelloWorldResponse response = new(
message: greeting,
language: language.ToString().ToLower(),
timestamp: includeTimestamp ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : null
diff --git a/Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef b/Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef
new file mode 100644
index 000000000..b1a69a6e4
--- /dev/null
+++ b/Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef
@@ -0,0 +1,18 @@
+{
+ "name": "UnityCLILoop.CustomCommandSamples.Editor",
+ "rootNamespace": "io.github.hatayama.UnityCliLoop.Samples",
+ "references": [
+ "UnityCLILoop.ToolContracts"
+ ],
+ "includePlatforms": [
+ "Editor"
+ ],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
diff --git a/Packages/src/Editor/Shared/uLoopMCP.Editor.Shared.asmdef.meta b/Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef.meta
similarity index 76%
rename from Packages/src/Editor/Shared/uLoopMCP.Editor.Shared.asmdef.meta
rename to Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef.meta
index e91ec0984..2033479c5 100644
--- a/Packages/src/Editor/Shared/uLoopMCP.Editor.Shared.asmdef.meta
+++ b/Assets/Editor/CustomCommandSamples/UnityCLILoop.CustomCommandSamples.Editor.asmdef.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 290394860909340b7835eb7cc215ee75
+guid: d717131ba3a4b4757b2e824bcae56c53
AssemblyDefinitionImporter:
externalObjects: {}
userData:
diff --git a/Assets/Editor/EditorDelayManualTests.cs b/Assets/Editor/EditorDelayManualTests.cs
index 3c72f9307..4c8d04393 100644
--- a/Assets/Editor/EditorDelayManualTests.cs
+++ b/Assets/Editor/EditorDelayManualTests.cs
@@ -4,7 +4,9 @@
using UnityEditor;
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Manual testing class for EditorDelay
@@ -141,7 +143,7 @@ public static void TestCancellation()
Debug.Log("=== Cancellation Test Started ===");
Debug.Log("==============================");
- CancellationTokenSource cts = new CancellationTokenSource();
+ CancellationTokenSource cts = new();
TestCancellableTaskAsync(cts.Token).Forget();
@@ -172,13 +174,13 @@ private static async Task TestCancellableTaskAsync(CancellationToken cancellatio
}
[MenuItem("UnityCliLoop/Debug/EditorDelay Tests/Integration Test")]
- public static void TestMcpServerControllerIntegration()
+ public static void TestUnityCliLoopServerControllerIntegration()
{
Debug.Log("==========================================");
- Debug.Log("=== McpServerController Integration Test ===");
+ Debug.Log("=== UnityCliLoopServerController Integration Test ===");
Debug.Log("==========================================");
- Debug.Log("Testing EditorDelay integration with McpServerController...");
+ Debug.Log("Testing EditorDelay integration with UnityCliLoopServerController...");
Debug.Log("This will simulate the actual usage in server restoration.");
SimulateServerRestorationAsync().Forget();
@@ -188,7 +190,7 @@ private static async Task SimulateServerRestorationAsync()
{
Debug.Log("Simulation: Starting server restoration sequence...");
- // Test with the same pattern as McpServerController
+ // Test with the same pattern as UnityCliLoopServerController
await EditorDelay.DelayFrame(1);
Debug.Log("Simulation: Phase 1 - Port release wait completed");
@@ -230,7 +232,7 @@ public static void ShowTestInstructions()
Debug.Log("2. Concurrent Execution Test - Test parallel task execution order");
Debug.Log("3. Stress Test - Test 100 concurrent tasks");
Debug.Log("4. Cancellation Test - Test CancellationToken functionality");
- Debug.Log("5. Integration Test - Test McpServerController integration");
+ Debug.Log("5. Integration Test - Test UnityCliLoopServerController integration");
Debug.Log("");
Debug.Log("Status Commands:");
Debug.Log("- Show Manager Status - Display current state");
diff --git a/Assets/Editor/FindGameObjects/FindGameObjectsTestMenu.cs b/Assets/Editor/FindGameObjects/FindGameObjectsTestMenu.cs
index 22109b339..8faf5c3ab 100644
--- a/Assets/Editor/FindGameObjects/FindGameObjectsTestMenu.cs
+++ b/Assets/Editor/FindGameObjects/FindGameObjectsTestMenu.cs
@@ -3,17 +3,22 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Provides Find Game Objects Test Menu behavior for Unity CLI Loop.
+ ///
public static class FindGameObjectsTestMenu
{
[MenuItem("UnityCliLoop/Debug/FindGameObjects Tests/Test Camera Search")]
public static async void TestFindGameObjectsCamera()
{
- FindGameObjectsTool tool = new FindGameObjectsTool();
+ FindGameObjectsTool tool = CreateTool();
- JObject parameters = new JObject
- {
+ JObject parameters = new() {
["RequiredComponents"] = new JArray { "Camera" },
["MaxResults"] = 1,
["IncludeInheritedProperties"] = true
@@ -21,17 +26,17 @@ public static async void TestFindGameObjectsCamera()
try
{
- BaseToolResponse response = await tool.ExecuteAsync(parameters);
+ UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters);
if (response is FindGameObjectsResponse findResponse)
{
Debug.Log($"Found {findResponse.totalFound} objects with Camera");
- foreach (var result in findResponse.results)
+ foreach (FindGameObjectResult result in findResponse.results)
{
Debug.Log($"- {result.name}: {result.components.Length} components");
- foreach (var component in result.components)
+ foreach (ComponentInfo component in result.components)
{
if (component.type == "Camera")
{
@@ -52,11 +57,10 @@ public static async void TestFindMainCameraByPath()
{
Debug.Log("[FindGameObjectsTestMenu] Starting Main Camera path search test...");
- FindGameObjectsTool tool = new FindGameObjectsTool();
+ FindGameObjectsTool tool = CreateTool();
// Search for Main Camera by path
- JObject parameters = new JObject
- {
+ JObject parameters = new() {
["NamePattern"] = "Main Camera",
["SearchMode"] = "Path",
["MaxResults"] = 1
@@ -65,18 +69,18 @@ public static async void TestFindMainCameraByPath()
try
{
Debug.Log("[FindGameObjectsTestMenu] Executing search for Main Camera...");
- BaseToolResponse response = await tool.ExecuteAsync(parameters);
+ UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters);
if (response is FindGameObjectsResponse findResponse)
{
Debug.Log($"[FindGameObjectsTestMenu] Found {findResponse.totalFound} objects");
- foreach (var result in findResponse.results)
+ foreach (FindGameObjectResult result in findResponse.results)
{
Debug.Log($"[FindGameObjectsTestMenu] - {result.name} at {result.path}");
Debug.Log($"[FindGameObjectsTestMenu] Components: {result.components.Length}");
- foreach (var component in result.components)
+ foreach (ComponentInfo component in result.components)
{
Debug.Log($"[FindGameObjectsTestMenu] - {component.type}: {component.properties?.Length ?? 0} properties");
}
@@ -95,5 +99,10 @@ public static async void TestFindMainCameraByPath()
Debug.Log("[FindGameObjectsTestMenu] Test completed");
}
+
+ private static FindGameObjectsTool CreateTool()
+ {
+ return new FindGameObjectsTool();
+ }
}
-}
\ No newline at end of file
+}
diff --git a/Assets/Editor/ForCheck/Compile_Test.cs b/Assets/Editor/ForCheck/Compile_Test.cs
index b0f9a8e1c..df48ca8ec 100644
--- a/Assets/Editor/ForCheck/Compile_Test.cs
+++ b/Assets/Editor/ForCheck/Compile_Test.cs
@@ -1,5 +1,8 @@
using UnityEngine;
+///
+/// Provides the Unity component behavior for Compile.
+///
public class Compile_Test : MonoBehaviour
{
void Start()
diff --git a/Assets/Editor/LogGetter/LogGetterEditorWindow.cs b/Assets/Editor/LogGetter/LogGetterEditorWindow.cs
index adf5cb4bb..7c05dabcb 100644
--- a/Assets/Editor/LogGetter/LogGetterEditorWindow.cs
+++ b/Assets/Editor/LogGetter/LogGetterEditorWindow.cs
@@ -1,8 +1,13 @@
using UnityEngine;
using UnityEditor;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Defines the Unity Editor window for Log Getter Editor workflows.
+ ///
public class LogGetterEditorWindow : EditorWindow
{
private LogGetterPresenter _presenter;
@@ -69,8 +74,8 @@ private void OnGUI()
string buttonText = _selectedLogType == "All" ? "Get All Logs" : $"Get {_selectedLogType} Logs";
if (GUILayout.Button(buttonText, GUILayout.Height(30)))
{
- string mcpLogType = ConvertStringToMcpLogType(_selectedLogType);
- _presenter.GetLogs(mcpLogType);
+ string unityCliLoopLogType = ConvertStringToUnityCliLoopLogType(_selectedLogType);
+ _presenter.GetLogs(unityCliLoopLogType);
}
GUILayout.Space(5);
@@ -141,13 +146,13 @@ private void DrawLogStatistics()
{
switch (entry.LogType)
{
- case McpLogType.Log:
+ case UnityCliLoopLogType.Log:
logCount++;
break;
- case McpLogType.Warning:
+ case UnityCliLoopLogType.Warning:
warningCount++;
break;
- case McpLogType.Error:
+ case UnityCliLoopLogType.Error:
errorCount++;
break;
default:
@@ -188,15 +193,15 @@ private void DrawLogEntry(LogEntryDto logEntry)
GUILayout.Space(2);
}
- private string ConvertStringToMcpLogType(string logType)
+ private string ConvertStringToUnityCliLoopLogType(string logType)
{
return logType switch
{
- "Error" => McpLogType.Error,
- "Warning" => McpLogType.Warning,
- "Log" => McpLogType.Log,
- "All" => McpLogType.All,
- _ => McpLogType.All
+ "Error" => UnityCliLoopLogType.Error,
+ "Warning" => UnityCliLoopLogType.Warning,
+ "Log" => UnityCliLoopLogType.Log,
+ "All" => UnityCliLoopLogType.All,
+ _ => UnityCliLoopLogType.All
};
}
@@ -204,11 +209,11 @@ private GUIStyle GetLogStyle(string logType)
{
switch (logType)
{
- case McpLogType.Error:
- case McpLogType.Warning:
+ case UnityCliLoopLogType.Error:
+ case UnityCliLoopLogType.Warning:
default:
return EditorStyles.helpBox;
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Assets/Editor/LogGetter/LogGetterPresenter.cs b/Assets/Editor/LogGetter/LogGetterPresenter.cs
index e29efd0b0..bfd002a2d 100644
--- a/Assets/Editor/LogGetter/LogGetterPresenter.cs
+++ b/Assets/Editor/LogGetter/LogGetterPresenter.cs
@@ -1,6 +1,8 @@
using System;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Presenter class for LogGetterEditorWindow.
@@ -19,7 +21,7 @@ public void GetLogs(string logType)
{
LogDisplayDto displayData;
- if (logType == McpLogType.All)
+ if (logType == UnityCliLoopLogType.All)
{
displayData = LogGetter.GetAllConsoleLogs();
}
@@ -33,7 +35,7 @@ public void GetLogs(string logType)
public void ClearLogs()
{
- LogDisplayDto displayData = new LogDisplayDto(new LogEntryDto[0], 0);
+ LogDisplayDto displayData = new(new LogEntryDto[0], 0);
OnLogDataUpdated?.Invoke(displayData);
}
diff --git a/Assets/Editor/LogGetter/LogGetterTestHelper.cs b/Assets/Editor/LogGetter/LogGetterTestHelper.cs
index 097919695..5dd3bfdb1 100644
--- a/Assets/Editor/LogGetter/LogGetterTestHelper.cs
+++ b/Assets/Editor/LogGetter/LogGetterTestHelper.cs
@@ -1,8 +1,11 @@
using UnityEngine;
using UnityEditor;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Dev
{
+ ///
+ /// Provides helper operations for Log Getter Test behavior.
+ ///
public class LogGetterTestHelper
{
[MenuItem("UnityCliLoop/Debug/LogGetter Tests/Output Test Logs")]
diff --git a/Assets/Editor/LogGetter/LogGetterUsageExample.cs b/Assets/Editor/LogGetter/LogGetterUsageExample.cs
index 4aada1b84..be1eb9248 100644
--- a/Assets/Editor/LogGetter/LogGetterUsageExample.cs
+++ b/Assets/Editor/LogGetter/LogGetterUsageExample.cs
@@ -1,7 +1,9 @@
using UnityEngine;
using UnityEditor;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Usage examples for the LogGetter generic API.
@@ -66,15 +68,15 @@ private static void FilteringUsage()
Debug.Log("--- Filtering Usage Example ---");
// Get only error logs
- LogDisplayDto errorLogs = LogGetter.GetConsoleLogsByType(McpLogType.Error);
+ LogDisplayDto errorLogs = LogGetter.GetConsoleLogsByType(UnityCliLoopLogType.Error);
Debug.Log($"Number of error logs: {errorLogs.TotalCount}");
// Get only warning logs
- LogDisplayDto warningLogs = LogGetter.GetConsoleLogsByType(McpLogType.Warning);
+ LogDisplayDto warningLogs = LogGetter.GetConsoleLogsByType(UnityCliLoopLogType.Warning);
Debug.Log($"Number of warning logs: {warningLogs.TotalCount}");
// Get only normal logs
- LogDisplayDto normalLogs = LogGetter.GetConsoleLogsByType(McpLogType.Log);
+ LogDisplayDto normalLogs = LogGetter.GetConsoleLogsByType(UnityCliLoopLogType.Log);
Debug.Log($"Number of normal logs: {normalLogs.TotalCount}");
}
@@ -103,13 +105,13 @@ public static void CustomProcessingExample()
{
switch (entry.LogType)
{
- case McpLogType.Error:
+ case UnityCliLoopLogType.Error:
errorCount++;
break;
- case McpLogType.Warning:
+ case UnityCliLoopLogType.Warning:
warningCount++;
break;
- case McpLogType.Log:
+ case UnityCliLoopLogType.Log:
logCount++;
break;
}
diff --git a/Assets/Editor/TestRunnerMenu.cs b/Assets/Editor/TestRunnerMenu.cs
index e0d37a085..6dd299ee1 100644
--- a/Assets/Editor/TestRunnerMenu.cs
+++ b/Assets/Editor/TestRunnerMenu.cs
@@ -3,7 +3,9 @@
using UnityEditor.TestTools.TestRunner.Api;
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Class that provides menu items related to the Test Runner.
@@ -108,7 +110,7 @@ private static void LogTestResult(SerializableTestResult result)
// Select the file in the Project view if it exists
Object xmlAsset = AssetDatabase.LoadAssetAtPath(
- result.xmlPath.Replace(Application.dataPath, "Assets"));
+ result.xmlPath.Replace(UnityEngine.Application.dataPath, "Assets"));
if (xmlAsset != null)
{
EditorGUIUtility.PingObject(xmlAsset);
diff --git a/Assets/Editor/ULoopMCPDebugToggle.cs b/Assets/Editor/UnityCliLoopDebugToggle.cs
similarity index 85%
rename from Assets/Editor/ULoopMCPDebugToggle.cs
rename to Assets/Editor/UnityCliLoopDebugToggle.cs
index 1333bb392..98e9ba8d9 100644
--- a/Assets/Editor/ULoopMCPDebugToggle.cs
+++ b/Assets/Editor/UnityCliLoopDebugToggle.cs
@@ -2,18 +2,20 @@
using UnityEngine;
using System.Linq;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Unity Editor menu items for toggling ULOOP_DEBUG and debug-only Roslyn support.
///
/// This file is intended for internal debugging convenience:
/// - It lives under Assets/Editor/ outside Packages, so it is NOT included in the distributed UnityCliLoop package.
- /// - In production, Roslyn define symbols are managed centrally via McpEditorSettings (see UpdateRoslynDefineSymbol).
+ /// - In production, Roslyn define symbols are managed centrally via UnityCliLoopEditorSettings (see UpdateRoslynDefineSymbol).
/// These menus operate only on the currently selected BuildTargetGroup and may temporarily diverge from global policy.
///
/// Related classes:
- /// - McpEditorWindow: Uses ULOOP_DEBUG to show/hide developer tools
+ /// - UnityCliLoopSettingsWindow: Uses ULOOP_DEBUG to show/hide developer tools
/// - McpLogger: Debug logging behavior controlled by this symbol
///
public static class UnityCliLoopDebugToggle
@@ -28,7 +30,7 @@ private static bool IsDebugModeEnabled()
{
BuildTargetGroup targetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup);
- return defines.Split(';').Contains(McpConstants.SCRIPTING_DEFINE_ULOOP_DEBUG);
+ return defines.Split(';').Contains(UnityCliLoopConstants.SCRIPTING_DEFINE_ULOOP_DEBUG);
}
///
@@ -48,11 +50,11 @@ public static void EnableDebugMode()
if (string.IsNullOrEmpty(defines))
{
- defines = McpConstants.SCRIPTING_DEFINE_ULOOP_DEBUG;
+ defines = UnityCliLoopConstants.SCRIPTING_DEFINE_ULOOP_DEBUG;
}
else
{
- defines += ";" + McpConstants.SCRIPTING_DEFINE_ULOOP_DEBUG;
+ defines += ";" + UnityCliLoopConstants.SCRIPTING_DEFINE_ULOOP_DEBUG;
}
PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, defines);
@@ -75,7 +77,7 @@ public static void DisableDebugMode()
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup);
string[] defineArray = defines.Split(';');
- defineArray = defineArray.Where(d => d != McpConstants.SCRIPTING_DEFINE_ULOOP_DEBUG).ToArray();
+ defineArray = defineArray.Where(d => d != UnityCliLoopConstants.SCRIPTING_DEFINE_ULOOP_DEBUG).ToArray();
defines = string.Join(";", defineArray);
PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, defines);
diff --git a/Assets/Editor/ULoopMCPDebugToggle.cs.meta b/Assets/Editor/UnityCliLoopDebugToggle.cs.meta
similarity index 100%
rename from Assets/Editor/ULoopMCPDebugToggle.cs.meta
rename to Assets/Editor/UnityCliLoopDebugToggle.cs.meta
diff --git a/Assets/Editor/VibeLoggerTest.cs b/Assets/Editor/VibeLoggerTest.cs
index de08b2086..c039fdb75 100644
--- a/Assets/Editor/VibeLoggerTest.cs
+++ b/Assets/Editor/VibeLoggerTest.cs
@@ -2,7 +2,9 @@
using UnityEngine;
using System;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Dev
{
///
/// Test menu for VibeLogger stacktrace functionality
diff --git a/Assets/Editor/uLoopMCP.Dev.asmdef b/Assets/Editor/uLoopMCP.Dev.asmdef
index 3a918f176..e24817449 100644
--- a/Assets/Editor/uLoopMCP.Dev.asmdef
+++ b/Assets/Editor/uLoopMCP.Dev.asmdef
@@ -1,9 +1,23 @@
{
"name": "uLoopMCP.Dev",
- "rootNamespace": "",
+ "rootNamespace": "io.github.hatayama.UnityCliLoop.Dev",
"references": [
"GUID:214998e563c124e8a88199b2dd1f522d",
- "GUID:290394860909340b7835eb7cc215ee75",
+ "UnityCLILoop.FirstPartyTools.Editor",
+ "UnityCLILoop.FirstPartyTools.ClearConsole.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.Console.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.EditorUtility.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.InputRecording.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.InputSimulation.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.InputSystem.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.MouseUi.Editor",
+ "UnityCLILoop.FirstPartyTools.Common.Overlay.Editor",
+ "UnityCLILoop.FirstPartyTools.Compile.Editor",
+ "UnityCLILoop.FirstPartyTools.FindGameObjects.Editor",
+ "UnityCLILoop.FirstPartyTools.GetLogs.Editor",
+ "UnityCLILoop.FirstPartyTools.RunTests.Editor",
+ "UnityCLILoop.FirstPartyTools.Screenshot.Editor",
+ "UnityCLILoop.ToolContracts",
"GUID:c956a21f824994ef087b6de566690b3d",
"GUID:75469ad4d38634e559750d17036d5f7c"
],
diff --git a/Assets/Scenes/MakeDontDestroyOnLoadScene.cs b/Assets/Scenes/MakeDontDestroyOnLoadScene.cs
index aaf868cbc..f597c17e7 100644
--- a/Assets/Scenes/MakeDontDestroyOnLoadScene.cs
+++ b/Assets/Scenes/MakeDontDestroyOnLoadScene.cs
@@ -1,5 +1,8 @@
using UnityEngine;
+///
+/// Provides the Unity component behavior for Make Dont Destroy On Load Scene.
+///
public class MakeDontDestroyOnLoadScene : MonoBehaviour
{
private void Start()
diff --git a/Assets/Scripts/RecordInput.meta b/Assets/Scripts/RecordInput.meta
deleted file mode 100644
index 3539f4305..000000000
--- a/Assets/Scripts/RecordInput.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 1488002abacdb4ecdbc53a734070bb52
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Tests/Demo/ClickCounterButton.cs b/Assets/Tests/Demo/ClickCounterButton.cs
index 64b30fb6f..65767de5a 100644
--- a/Assets/Tests/Demo/ClickCounterButton.cs
+++ b/Assets/Tests/Demo/ClickCounterButton.cs
@@ -2,8 +2,11 @@
using UnityEngine;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class ClickCounterButton : MonoBehaviour
{
[SerializeField] private Text? counterText;
diff --git a/Assets/Tests/Demo/DemoDirectionArrow.cs b/Assets/Tests/Demo/DemoDirectionArrow.cs
index cc7d80ee6..92027627d 100644
--- a/Assets/Tests/Demo/DemoDirectionArrow.cs
+++ b/Assets/Tests/Demo/DemoDirectionArrow.cs
@@ -1,8 +1,11 @@
#nullable enable
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoDirectionArrow : MonoBehaviour
{
[SerializeField] private DemoVirtualPad virtualPad = null!;
diff --git a/Assets/Tests/Demo/DemoDraggableItem.cs b/Assets/Tests/Demo/DemoDraggableItem.cs
index 8e6f14ea8..af739c8e7 100644
--- a/Assets/Tests/Demo/DemoDraggableItem.cs
+++ b/Assets/Tests/Demo/DemoDraggableItem.cs
@@ -3,8 +3,11 @@
using UnityEngine.EventSystems;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoDraggableItem : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
private RectTransform rectTransform = null!;
diff --git a/Assets/Tests/Demo/DemoKeyIndicator.cs b/Assets/Tests/Demo/DemoKeyIndicator.cs
index e9ecd12c5..237e9ad40 100644
--- a/Assets/Tests/Demo/DemoKeyIndicator.cs
+++ b/Assets/Tests/Demo/DemoKeyIndicator.cs
@@ -4,8 +4,13 @@
using UnityEngine.InputSystem;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Runtime;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoKeyIndicator : MonoBehaviour
{
[SerializeField] private Key targetKey;
diff --git a/Assets/Tests/Demo/DemoKeyboardMover.cs b/Assets/Tests/Demo/DemoKeyboardMover.cs
index 6329e5492..05dc6dd87 100644
--- a/Assets/Tests/Demo/DemoKeyboardMover.cs
+++ b/Assets/Tests/Demo/DemoKeyboardMover.cs
@@ -3,8 +3,11 @@
using UnityEngine;
using UnityEngine.InputSystem;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoKeyboardMover : MonoBehaviour
{
private const float MoveSpeed = 3f;
diff --git a/Assets/Tests/Demo/DemoLongPressButton.cs b/Assets/Tests/Demo/DemoLongPressButton.cs
index d1f83a17c..c5ef45dfc 100644
--- a/Assets/Tests/Demo/DemoLongPressButton.cs
+++ b/Assets/Tests/Demo/DemoLongPressButton.cs
@@ -3,8 +3,11 @@
using UnityEngine.EventSystems;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoLongPressButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
[SerializeField] private float requiredHoldTime = 3f;
diff --git a/Assets/Tests/Demo/DemoMouseInputOverlayTester.cs b/Assets/Tests/Demo/DemoMouseInputOverlayTester.cs
index ca7b68740..a235ae0b4 100644
--- a/Assets/Tests/Demo/DemoMouseInputOverlayTester.cs
+++ b/Assets/Tests/Demo/DemoMouseInputOverlayTester.cs
@@ -3,10 +3,15 @@
using UnityEngine;
using UnityEngine.InputSystem;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Runtime;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
// Reads actual mouse input and drives SimulateMouseInputOverlayState
// so the overlay can be tested standalone without the CLI tool pipeline.
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoMouseInputOverlayTester : MonoBehaviour
{
private void Update()
diff --git a/Assets/Tests/Demo/DemoMouseLook.cs b/Assets/Tests/Demo/DemoMouseLook.cs
index c4e5e4409..f65a87a72 100644
--- a/Assets/Tests/Demo/DemoMouseLook.cs
+++ b/Assets/Tests/Demo/DemoMouseLook.cs
@@ -4,11 +4,14 @@
using UnityEngine.InputSystem;
using Cinemachine;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
// Orbits the Cinemachine camera around the character without rotating the character.
// Mouse delta.x rotates the camera's FollowOffset around Y axis,
// mouse delta.y tilts the camera pitch via the Composer's TrackedObjectOffset.
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoMouseLook : MonoBehaviour
{
[SerializeField] private float horizontalSensitivity = 0.4f;
diff --git a/Assets/Tests/Demo/DemoMouseShooter.cs b/Assets/Tests/Demo/DemoMouseShooter.cs
index d7603938f..356c1f812 100644
--- a/Assets/Tests/Demo/DemoMouseShooter.cs
+++ b/Assets/Tests/Demo/DemoMouseShooter.cs
@@ -3,8 +3,11 @@
using UnityEngine;
using UnityEngine.InputSystem;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoMouseShooter : MonoBehaviour
{
[SerializeField] private float bulletSpeed = 20f;
diff --git a/Assets/Tests/Demo/DemoVirtualPad.cs b/Assets/Tests/Demo/DemoVirtualPad.cs
index 29ec15e5f..fb4a93401 100644
--- a/Assets/Tests/Demo/DemoVirtualPad.cs
+++ b/Assets/Tests/Demo/DemoVirtualPad.cs
@@ -3,8 +3,11 @@
using UnityEngine;
using UnityEngine.EventSystems;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoVirtualPad : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler
{
[SerializeField] private RectTransform knob = null!;
diff --git a/Assets/Tests/Demo/DemoWeaponSelector.cs b/Assets/Tests/Demo/DemoWeaponSelector.cs
index 8cf9cb315..dd935747c 100644
--- a/Assets/Tests/Demo/DemoWeaponSelector.cs
+++ b/Assets/Tests/Demo/DemoWeaponSelector.cs
@@ -4,9 +4,12 @@
using UnityEngine.InputSystem;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
// Cycles bullet color via mouse scroll wheel and shows a HUD indicator.
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class DemoWeaponSelector : MonoBehaviour
{
private static readonly Color[] BULLET_COLORS =
@@ -76,7 +79,7 @@ private void Update()
private void BuildHud()
{
- GameObject canvasGo = new GameObject("WeaponSelectorCanvas");
+ GameObject canvasGo = new("WeaponSelectorCanvas");
canvasGo.transform.SetParent(transform, false);
Canvas canvas = canvasGo.AddComponent
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshCollider))]
diff --git a/Assets/Tests/Demo/Minecraft/Scripts/World/TerrainGenerator.cs b/Assets/Tests/Demo/Minecraft/Scripts/World/TerrainGenerator.cs
index d6d4bcfa6..9d459040f 100644
--- a/Assets/Tests/Demo/Minecraft/Scripts/World/TerrainGenerator.cs
+++ b/Assets/Tests/Demo/Minecraft/Scripts/World/TerrainGenerator.cs
@@ -1,7 +1,10 @@
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public static class TerrainGenerator
{
private enum Biome
diff --git a/Assets/Tests/Demo/Minecraft/Scripts/World/World.cs b/Assets/Tests/Demo/Minecraft/Scripts/World/World.cs
index c6a0cbbb4..0a9bb5290 100644
--- a/Assets/Tests/Demo/Minecraft/Scripts/World/World.cs
+++ b/Assets/Tests/Demo/Minecraft/Scripts/World/World.cs
@@ -1,8 +1,11 @@
using System.Collections.Generic;
using UnityEngine;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
[DefaultExecutionOrder(-10)]
public class World : MonoBehaviour
{
@@ -37,7 +40,7 @@ private void RestoreFromPrebaked(ChunkRenderer[] existingChunks)
ChunkRenderer renderer = existingChunks[i];
Vector2Int chunkPos = renderer.ChunkPosition;
- ChunkData data = new ChunkData(chunkPos);
+ ChunkData data = new(chunkPos);
TerrainGenerator.GenerateChunk(data);
chunks[chunkPos] = renderer;
@@ -96,7 +99,7 @@ private void GenerateWorld()
{
for (int cz = 0; cz < WorldConstants.WorldSizeInChunks; cz++)
{
- Vector2Int chunkPos = new Vector2Int(cx, cz);
+ Vector2Int chunkPos = new(cx, cz);
CreateChunk(chunkPos);
}
}
@@ -104,10 +107,10 @@ private void GenerateWorld()
private void CreateChunk(Vector2Int chunkPos)
{
- ChunkData data = new ChunkData(chunkPos);
+ ChunkData data = new(chunkPos);
TerrainGenerator.GenerateChunk(data);
- GameObject chunkObj = new GameObject($"Chunk_{chunkPos.x}_{chunkPos.y}");
+ GameObject chunkObj = new($"Chunk_{chunkPos.x}_{chunkPos.y}");
chunkObj.transform.parent = transform;
chunkObj.AddComponent();
chunkObj.AddComponent();
diff --git a/Assets/Tests/Demo/ReplayVerificationControllerBase.cs b/Assets/Tests/Demo/ReplayVerificationControllerBase.cs
index bc41c67be..1ee968e8f 100644
--- a/Assets/Tests/Demo/ReplayVerificationControllerBase.cs
+++ b/Assets/Tests/Demo/ReplayVerificationControllerBase.cs
@@ -5,11 +5,14 @@
using UnityEngine;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
// Base class for replay verification controllers.
// Provides event logging, log persistence, and frame-normalized comparison.
// Subclasses override RecordEvents() to capture scene-specific state each frame.
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public abstract class ReplayVerificationControllerBase : MonoBehaviour
{
private const int TARGET_FRAME_RATE = 60;
@@ -36,7 +39,7 @@ protected virtual void Start()
Debug.Assert(_verifyPanel != null, "_verifyPanel must be assigned in scene");
Debug.Assert(_verifyResultText != null, "_verifyResultText must be assigned in scene");
- Application.targetFrameRate = TARGET_FRAME_RATE;
+ UnityEngine.Application.targetFrameRate = TARGET_FRAME_RATE;
_startFrame = Time.frameCount;
HidePanel(_verifyPanel);
}
@@ -134,7 +137,7 @@ public void OnCompareLogs()
int maxLines = Mathf.Max(normalizedRecording.Length, normalizedReplay.Length);
int diffCount = 0;
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ System.Text.StringBuilder sb = new();
for (int i = 0; i < maxLines; i++)
{
diff --git a/Assets/Tests/Demo/UiReplayVerificationController.cs b/Assets/Tests/Demo/UiReplayVerificationController.cs
index f5433e9f8..0ee509360 100644
--- a/Assets/Tests/Demo/UiReplayVerificationController.cs
+++ b/Assets/Tests/Demo/UiReplayVerificationController.cs
@@ -4,11 +4,14 @@
using UnityEngine.InputSystem;
using UnityEngine.UI;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests.Demo
{
// Verification controller for UI-based record/replay.
// Logs mouse position, button states, and UI interaction results
// to compare recording vs replay for EventSystem-driven scenes.
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
public class UiReplayVerificationController : ReplayVerificationControllerBase
{
[SerializeField] private Text? _mousePositionText;
diff --git a/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef b/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef
index 53fd9fecb..a5dd7cbf1 100644
--- a/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef
+++ b/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef
@@ -1,6 +1,6 @@
{
"name": "uLoopMCP.Tests.Demo",
- "rootNamespace": "",
+ "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.Demo",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:c956a21f824994ef087b6de566690b3d",
diff --git a/Assets/Tests/DraggableItem.cs b/Assets/Tests/DraggableItem.cs
index 75f04d6a8..137e7e76b 100644
--- a/Assets/Tests/DraggableItem.cs
+++ b/Assets/Tests/DraggableItem.cs
@@ -1,9 +1,12 @@
using UnityEngine;
using UnityEngine.EventSystems;
-namespace io.github.hatayama.UnityCliLoop
+namespace io.github.hatayama.UnityCliLoop.Tests
{
+///
+/// Test support type used by editor and play mode fixtures.
+///
public class DraggableItem : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
private RectTransform rectTransform;
diff --git a/Assets/Tests/Editor/BridgeTransportEndpointTests.cs b/Assets/Tests/Editor/BridgeTransportEndpointTests.cs
index 9bdb5be00..c659913cd 100644
--- a/Assets/Tests/Editor/BridgeTransportEndpointTests.cs
+++ b/Assets/Tests/Editor/BridgeTransportEndpointTests.cs
@@ -1,8 +1,13 @@
using System.IO;
using NUnit.Framework;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Domain;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies Bridge Transport Endpoint behavior.
+ ///
public class BridgeTransportEndpointTests
{
[Test]
@@ -10,7 +15,8 @@ public void CanonicalizeProjectRoot_WhenPathIsFilesystemRoot_ShouldPreserveRoot(
{
string filesystemRoot = Path.GetPathRoot(Directory.GetCurrentDirectory());
- string canonicalProjectRoot = BridgeTransportEndpoint.CanonicalizeProjectRoot(filesystemRoot);
+ // Tests that root path canonicalization keeps the filesystem root stable.
+ string canonicalProjectRoot = ProjectRootCanonicalizer.Canonicalize(filesystemRoot);
Assert.That(canonicalProjectRoot, Is.EqualTo(filesystemRoot));
}
diff --git a/Assets/Tests/Editor/CliInstallRefreshPolicyTests.cs b/Assets/Tests/Editor/CliInstallRefreshPolicyTests.cs
index 4307478bd..ef0cbe2c0 100644
--- a/Assets/Tests/Editor/CliInstallRefreshPolicyTests.cs
+++ b/Assets/Tests/Editor/CliInstallRefreshPolicyTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.Presentation;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies CLI Install Refresh Policy behavior.
+ ///
public class CliInstallRefreshPolicyTests
{
[Test]
diff --git a/Assets/Tests/Editor/CliSetupSectionTests.cs b/Assets/Tests/Editor/CliSetupSectionTests.cs
index c8c6aff49..2f8d1858e 100644
--- a/Assets/Tests/Editor/CliSetupSectionTests.cs
+++ b/Assets/Tests/Editor/CliSetupSectionTests.cs
@@ -1,7 +1,13 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.Application;
+using io.github.hatayama.UnityCliLoop.Presentation;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies CLI Setup Section behavior.
+ ///
public class CliSetupSectionTests
{
[TestCase(false, false, false, false, false, false, null, "3.0.0", "Install CLI")]
diff --git a/Assets/Tests/Editor/CliUninstallPromptTests.cs b/Assets/Tests/Editor/CliUninstallPromptTests.cs
index 7868a88a7..0aada9a0c 100644
--- a/Assets/Tests/Editor/CliUninstallPromptTests.cs
+++ b/Assets/Tests/Editor/CliUninstallPromptTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.Presentation;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies CLI Uninstall Prompt behavior.
+ ///
public class CliUninstallPromptTests
{
[Test]
diff --git a/Assets/Tests/Editor/CliVersionComparerTests.cs b/Assets/Tests/Editor/CliVersionComparerTests.cs
index a7593b352..738f0931a 100644
--- a/Assets/Tests/Editor/CliVersionComparerTests.cs
+++ b/Assets/Tests/Editor/CliVersionComparerTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.Domain;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies CLI Version Comparer behavior.
+ ///
public class CliVersionComparerTests
{
[TestCase("3.0.0-beta.0", "3.0.0-beta.0", true)]
diff --git a/Assets/Tests/Editor/CompilationDiagnosticMessageParserTests.cs b/Assets/Tests/Editor/CompilationDiagnosticMessageParserTests.cs
index 622dfa608..c9d673e23 100644
--- a/Assets/Tests/Editor/CompilationDiagnosticMessageParserTests.cs
+++ b/Assets/Tests/Editor/CompilationDiagnosticMessageParserTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies Compilation Diagnostic Message Parser behavior.
+ ///
public class CompilationDiagnosticMessageParserTests
{
[Test]
diff --git a/Assets/Tests/Editor/ConsoleLogRetrieverTests.cs b/Assets/Tests/Editor/ConsoleLogRetrieverTests.cs
index 6f5abfeec..d98e052d3 100644
--- a/Assets/Tests/Editor/ConsoleLogRetrieverTests.cs
+++ b/Assets/Tests/Editor/ConsoleLogRetrieverTests.cs
@@ -4,7 +4,9 @@
using UnityEngine;
using UnityEngine.TestTools;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
[Ignore("Skipped because full-console reflection scans make routine EditMode runs too slow; run manually when changing console log retrieval.")]
///
@@ -96,7 +98,7 @@ public void GetLogsByType_TemporarilyChangeMask_RestoresOriginalMask()
// Log should be retrieved correctly
Assert.IsNotNull(logTypeLogs);
- Assert.IsTrue(logTypeLogs.Any(log => log.Message.Contains(testLogMessage) && log.LogType == McpLogType.Log));
+ Assert.IsTrue(logTypeLogs.Any(log => log.Message.Contains(testLogMessage) && log.LogType == UnityCliLoopLogType.Log));
}
[Test]
@@ -187,7 +189,7 @@ public void LogEntry_MessageWithStackTrace_SeparatedCorrectly()
string testMessage = $"MessageWithStack_{uniqueTestId}";
// Create a dummy GameObject to use as context (this generates stack trace)
- GameObject testObject = new GameObject("TestObject");
+ GameObject testObject = new("TestObject");
LogAssert.Expect(UnityEngine.LogType.Log, testMessage);
Debug.Log(testMessage, testObject);
@@ -273,7 +275,7 @@ public void LogEntry_ErrorWithStackTrace_SeparatedCorrectly()
// Assert - Error should have message and stack trace separated
LogEntryDto testLog = logs.FirstOrDefault(log =>
- log.LogType == McpLogType.Error && log.Message.Contains(testErrorMessage));
+ log.LogType == UnityCliLoopLogType.Error && log.Message.Contains(testErrorMessage));
Assert.IsNotNull(testLog, "Test error log should be found");
// Message should be clean
@@ -325,7 +327,7 @@ public void ConsoleLogRetriever_ReflectionInitialization_SucceedsWithoutExceptio
// Act & Assert - Reflection-based initialization should succeed
Assert.DoesNotThrow(() => {
- ConsoleLogRetriever newRetriever = new ConsoleLogRetriever();
+ ConsoleLogRetriever newRetriever = new();
// Basic reflection functionality should work
int count = newRetriever.GetLogCount();
diff --git a/Assets/Tests/Editor/DefaultErrorTranslatorTests.cs b/Assets/Tests/Editor/DefaultErrorTranslatorTests.cs
index 64e7b30f7..16da7c95f 100644
--- a/Assets/Tests/Editor/DefaultErrorTranslatorTests.cs
+++ b/Assets/Tests/Editor/DefaultErrorTranslatorTests.cs
@@ -1,7 +1,13 @@
using NUnit.Framework;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Application;
+using io.github.hatayama.UnityCliLoop.Domain;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies Default Error Translator behavior.
+ ///
[TestFixture]
public class DefaultErrorTranslatorTests
{
@@ -20,7 +26,7 @@ public void SetUp()
[Test]
public void TranslateFromException_ToolDisabled_ShouldReturnToolNameInMessage()
{
- ToolDisabledException exception = new ToolDisabledException("compile");
+ ToolDisabledException exception = new("compile");
TranslationOutput result = _translator.TranslateFromException(exception);
@@ -31,17 +37,17 @@ public void TranslateFromException_ToolDisabled_ShouldReturnToolNameInMessage()
[Test]
public void TranslateFromException_ToolDisabled_ShouldIncludeMenuPath()
{
- ToolDisabledException exception = new ToolDisabledException("compile");
+ ToolDisabledException exception = new("compile");
TranslationOutput result = _translator.TranslateFromException(exception);
- StringAssert.Contains(McpUIConstants.TOOL_SETTINGS_MENU_PATH, result.FriendlyMessage);
+ StringAssert.Contains(UnityCliLoopUIConstants.TOOL_SETTINGS_MENU_PATH, result.FriendlyMessage);
}
[Test]
public void TranslateFromException_ToolDisabled_ShouldHaveExplanation()
{
- ToolDisabledException exception = new ToolDisabledException("compile");
+ ToolDisabledException exception = new("compile");
TranslationOutput result = _translator.TranslateFromException(exception);
@@ -51,7 +57,7 @@ public void TranslateFromException_ToolDisabled_ShouldHaveExplanation()
[Test]
public void TranslateFromException_ToolDisabled_ShouldHaveSolution()
{
- ToolDisabledException exception = new ToolDisabledException("get-logs");
+ ToolDisabledException exception = new("get-logs");
TranslationOutput result = _translator.TranslateFromException(exception);
@@ -64,7 +70,7 @@ public void TranslateFromException_ToolDisabled_ShouldHaveSolution()
[Test]
public void DetermineSeverity_ToolDisabled_ShouldBeMedium()
{
- ToolDisabledException exception = new ToolDisabledException("compile");
+ ToolDisabledException exception = new("compile");
TranslationOutput translation = _translator.TranslateFromException(exception);
UserFriendlyErrorDto dto = _formatter.Format(translation, exception.Message, exception);
@@ -77,7 +83,7 @@ public void DetermineSeverity_ToolDisabled_ShouldBeMedium()
[Test]
public void TranslateFromException_GenericException_ShouldReturnInternalError()
{
- System.Exception exception = new System.Exception("something went wrong");
+ System.Exception exception = new("something went wrong");
TranslationOutput result = _translator.TranslateFromException(exception);
diff --git a/Assets/Tests/Editor/DomainReloadDetectionServiceTests.cs b/Assets/Tests/Editor/DomainReloadDetectionServiceTests.cs
index 360cbb709..b993100c6 100644
--- a/Assets/Tests/Editor/DomainReloadDetectionServiceTests.cs
+++ b/Assets/Tests/Editor/DomainReloadDetectionServiceTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Application;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies Domain Reload Detection Service behavior.
+ ///
public class DomainReloadDetectionServiceTests
{
private bool _originalIsServerRunning;
@@ -14,26 +19,26 @@ public class DomainReloadDetectionServiceTests
[SetUp]
public void SetUp()
{
- _originalIsServerRunning = McpEditorSettings.GetIsServerRunning();
- _originalIsAfterCompile = McpEditorSettings.GetIsAfterCompile();
- _originalIsDomainReloadInProgress = McpEditorSettings.GetIsDomainReloadInProgress();
- _originalIsReconnecting = McpEditorSettings.GetIsReconnecting();
- _originalShowReconnectingUI = McpEditorSettings.GetShowReconnectingUI();
- _originalShowPostCompileReconnectingUI = McpEditorSettings.GetShowPostCompileReconnectingUI();
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ _originalIsServerRunning = UnityCliLoopEditorSettings.GetIsServerRunning();
+ _originalIsAfterCompile = UnityCliLoopEditorSettings.GetIsAfterCompile();
+ _originalIsDomainReloadInProgress = UnityCliLoopEditorSettings.GetIsDomainReloadInProgress();
+ _originalIsReconnecting = UnityCliLoopEditorSettings.GetIsReconnecting();
+ _originalShowReconnectingUI = UnityCliLoopEditorSettings.GetShowReconnectingUI();
+ _originalShowPostCompileReconnectingUI = UnityCliLoopEditorSettings.GetShowPostCompileReconnectingUI();
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
DomainReloadDetectionService.DeleteLockFile();
}
[TearDown]
public void TearDown()
{
- McpEditorSettings.SetIsServerRunning(_originalIsServerRunning);
- McpEditorSettings.SetIsAfterCompile(_originalIsAfterCompile);
- McpEditorSettings.SetIsDomainReloadInProgress(_originalIsDomainReloadInProgress);
- McpEditorSettings.SetIsReconnecting(_originalIsReconnecting);
- McpEditorSettings.SetShowReconnectingUI(_originalShowReconnectingUI);
- McpEditorSettings.SetShowPostCompileReconnectingUI(_originalShowPostCompileReconnectingUI);
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ UnityCliLoopEditorSettings.SetIsServerRunning(_originalIsServerRunning);
+ UnityCliLoopEditorSettings.SetIsAfterCompile(_originalIsAfterCompile);
+ UnityCliLoopEditorSettings.SetIsDomainReloadInProgress(_originalIsDomainReloadInProgress);
+ UnityCliLoopEditorSettings.SetIsReconnecting(_originalIsReconnecting);
+ UnityCliLoopEditorSettings.SetShowReconnectingUI(_originalShowReconnectingUI);
+ UnityCliLoopEditorSettings.SetShowPostCompileReconnectingUI(_originalShowPostCompileReconnectingUI);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
DomainReloadDetectionService.DeleteLockFile();
}
@@ -41,27 +46,27 @@ public void TearDown()
public void RollbackDomainReloadStart_ClearsTemporaryFlagsProviderStateAndLockFile()
{
const string correlationId = "test-correlation";
- McpEditorDomainReloadStateProvider provider = new McpEditorDomainReloadStateProvider();
+ UnityCliLoopEditorDomainReloadStateProvider provider = new();
DomainReloadDetectionService.StartDomainReload(correlationId, true);
- Assert.That(McpEditorSettings.GetIsServerRunning(), Is.True);
- Assert.That(McpEditorSettings.GetIsAfterCompile(), Is.True);
- Assert.That(McpEditorSettings.GetIsDomainReloadInProgress(), Is.True);
- Assert.That(McpEditorSettings.GetIsReconnecting(), Is.True);
- Assert.That(McpEditorSettings.GetShowReconnectingUI(), Is.True);
- Assert.That(McpEditorSettings.GetShowPostCompileReconnectingUI(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetIsServerRunning(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetIsAfterCompile(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetIsDomainReloadInProgress(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetIsReconnecting(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetShowReconnectingUI(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetShowPostCompileReconnectingUI(), Is.True);
Assert.That(provider.IsDomainReloadInProgress(), Is.True);
Assert.That(DomainReloadDetectionService.IsLockFilePresent(), Is.True);
DomainReloadDetectionService.RollbackDomainReloadStart(correlationId);
- Assert.That(McpEditorSettings.GetIsServerRunning(), Is.True);
- Assert.That(McpEditorSettings.GetIsAfterCompile(), Is.False);
- Assert.That(McpEditorSettings.GetIsDomainReloadInProgress(), Is.False);
- Assert.That(McpEditorSettings.GetIsReconnecting(), Is.False);
- Assert.That(McpEditorSettings.GetShowReconnectingUI(), Is.False);
- Assert.That(McpEditorSettings.GetShowPostCompileReconnectingUI(), Is.False);
+ Assert.That(UnityCliLoopEditorSettings.GetIsServerRunning(), Is.True);
+ Assert.That(UnityCliLoopEditorSettings.GetIsAfterCompile(), Is.False);
+ Assert.That(UnityCliLoopEditorSettings.GetIsDomainReloadInProgress(), Is.False);
+ Assert.That(UnityCliLoopEditorSettings.GetIsReconnecting(), Is.False);
+ Assert.That(UnityCliLoopEditorSettings.GetShowReconnectingUI(), Is.False);
+ Assert.That(UnityCliLoopEditorSettings.GetShowPostCompileReconnectingUI(), Is.False);
Assert.That(provider.IsDomainReloadInProgress(), Is.False);
Assert.That(DomainReloadDetectionService.IsLockFilePresent(), Is.False);
}
diff --git a/Assets/Tests/Editor/DomainReloadRecoveryUseCaseTests.cs b/Assets/Tests/Editor/DomainReloadRecoveryUseCaseTests.cs
index 5e62cec13..e7bf32c0b 100644
--- a/Assets/Tests/Editor/DomainReloadRecoveryUseCaseTests.cs
+++ b/Assets/Tests/Editor/DomainReloadRecoveryUseCaseTests.cs
@@ -1,6 +1,12 @@
using NUnit.Framework;
+using System.Threading;
+using System.Threading.Tasks;
-namespace io.github.hatayama.UnityCliLoop
+using io.github.hatayama.UnityCliLoop.Application;
+using io.github.hatayama.UnityCliLoop.Domain;
+using io.github.hatayama.UnityCliLoop.Infrastructure;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
///
/// Tests for DomainReloadRecoveryUseCase session state fallback functionality.
@@ -14,19 +20,19 @@ public class DomainReloadRecoveryUseCaseTests
public void SetUp()
{
// Save original session state
- _originalIsServerRunning = McpEditorSettings.GetIsServerRunning();
+ _originalIsServerRunning = UnityCliLoopEditorSettings.GetIsServerRunning();
}
[TearDown]
public void TearDown()
{
// Restore original session state
- McpEditorSettings.SetIsServerRunning(_originalIsServerRunning);
- McpEditorSettings.SetIsAfterCompile(false);
- McpEditorSettings.SetIsDomainReloadInProgress(false);
- McpEditorSettings.SetIsReconnecting(false);
- McpEditorSettings.SetShowReconnectingUI(false);
- McpEditorSettings.SetShowPostCompileReconnectingUI(false);
+ UnityCliLoopEditorSettings.SetIsServerRunning(_originalIsServerRunning);
+ UnityCliLoopEditorSettings.SetIsAfterCompile(false);
+ UnityCliLoopEditorSettings.SetIsDomainReloadInProgress(false);
+ UnityCliLoopEditorSettings.SetIsReconnecting(false);
+ UnityCliLoopEditorSettings.SetShowReconnectingUI(false);
+ UnityCliLoopEditorSettings.SetShowPostCompileReconnectingUI(false);
// Clean up lock file created by ExecuteBeforeDomainReload
DomainReloadDetectionService.DeleteLockFile();
@@ -36,49 +42,49 @@ public void TearDown()
public void ExecuteBeforeDomainReload_ShouldUseSessionState_WhenServerInstanceIsNull()
{
// Arrange
- McpEditorSettings.SetIsServerRunning(true);
+ UnityCliLoopEditorSettings.SetIsServerRunning(true);
- DomainReloadRecoveryUseCase useCase = new();
+ DomainReloadRecoveryUseCase useCase = CreateUseCase();
// Act
ServiceResult result = useCase.ExecuteBeforeDomainReload(null);
// Assert
Assert.IsTrue(result.Success, "ExecuteBeforeDomainReload should succeed");
- Assert.IsTrue(McpEditorSettings.GetIsAfterCompile(), "IsAfterCompile should be set to true");
+ Assert.IsTrue(UnityCliLoopEditorSettings.GetIsAfterCompile(), "IsAfterCompile should be set to true");
}
[Test]
public void ExecuteBeforeDomainReload_ShouldNotSaveState_WhenBothInstanceAndSessionAreNotRunning()
{
// Arrange
- McpEditorSettings.SetIsServerRunning(false);
- McpEditorSettings.SetIsAfterCompile(false);
+ UnityCliLoopEditorSettings.SetIsServerRunning(false);
+ UnityCliLoopEditorSettings.SetIsAfterCompile(false);
- DomainReloadRecoveryUseCase useCase = new();
+ DomainReloadRecoveryUseCase useCase = CreateUseCase();
// Act
ServiceResult result = useCase.ExecuteBeforeDomainReload(null);
// Assert
Assert.IsTrue(result.Success, "ExecuteBeforeDomainReload should succeed");
- Assert.IsFalse(McpEditorSettings.GetIsAfterCompile(), "IsAfterCompile should remain false when server was not running");
+ Assert.IsFalse(UnityCliLoopEditorSettings.GetIsAfterCompile(), "IsAfterCompile should remain false when server was not running");
}
[Test]
public void ExecuteBeforeDomainReload_ShouldPreferInstanceState_WhenInstanceIsRunning()
{
// Arrange
- McpEditorSettings.SetIsServerRunning(true);
+ UnityCliLoopEditorSettings.SetIsServerRunning(true);
// Create a running server instance
- McpBridgeServer server = null;
+ UnityCliLoopBridgeServer server = null;
try
{
- server = new McpBridgeServer();
+ server = new UnityCliLoopBridgeServer();
server.StartServer();
- DomainReloadRecoveryUseCase useCase = new();
+ DomainReloadRecoveryUseCase useCase = CreateUseCase();
// Act
ServiceResult result = useCase.ExecuteBeforeDomainReload(server);
@@ -92,5 +98,26 @@ public void ExecuteBeforeDomainReload_ShouldPreferInstanceState_WhenInstanceIsRu
server?.Dispose();
}
}
+
+ private static DomainReloadRecoveryUseCase CreateUseCase()
+ {
+ TestRecoveryCoordinator recoveryCoordinator = new();
+ SessionRecoveryService sessionRecoveryService =
+ new SessionRecoveryService(recoveryCoordinator);
+ return new DomainReloadRecoveryUseCase(sessionRecoveryService);
+ }
+
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
+ private sealed class TestRecoveryCoordinator : IUnityCliLoopServerRecoveryCoordinator
+ {
+ public IUnityCliLoopServerInstance CurrentServer => null;
+
+ public Task StartRecoveryIfNeededAsync(bool isAfterCompile, CancellationToken cancellationToken)
+ {
+ return Task.CompletedTask;
+ }
+ }
}
}
diff --git a/Assets/Tests/Editor/DomainReloadStateRegistryTests.cs b/Assets/Tests/Editor/DomainReloadStateRegistryTests.cs
index 614bb6b66..530c9c1d7 100644
--- a/Assets/Tests/Editor/DomainReloadStateRegistryTests.cs
+++ b/Assets/Tests/Editor/DomainReloadStateRegistryTests.cs
@@ -1,7 +1,12 @@
using NUnit.Framework;
+using io.github.hatayama.UnityCliLoop.Application;
+
namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
+ ///
+ /// Test fixture that verifies Domain Reload State Registry behavior.
+ ///
public class DomainReloadStateRegistryTests
{
private IDomainReloadStateProvider _previousProvider;
@@ -9,14 +14,14 @@ public class DomainReloadStateRegistryTests
[SetUp]
public void SetUp()
{
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
_previousProvider = DomainReloadStateRegistry.SwapProviderForTests(null);
}
[TearDown]
public void TearDown()
{
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
DomainReloadStateRegistry.SwapProviderForTests(_previousProvider);
}
@@ -41,24 +46,27 @@ public void IsDomainReloadInProgress_ReturnsProviderValue_WhenProviderIsRegister
[Test]
public void Provider_ReturnsUpdatedInMemoryFlag()
{
- McpEditorDomainReloadStateProvider provider = new McpEditorDomainReloadStateProvider();
+ UnityCliLoopEditorDomainReloadStateProvider provider = new();
try
{
Assert.That(provider.IsDomainReloadInProgress(), Is.False);
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(true);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(true);
Assert.That(provider.IsDomainReloadInProgress(), Is.True);
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
Assert.That(provider.IsDomainReloadInProgress(), Is.False);
}
finally
{
- McpEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
+ UnityCliLoopEditorDomainReloadStateProvider.SetDomainReloadInProgressFromMainThread(false);
}
}
+ ///
+ /// Test support type used by editor and play mode fixtures.
+ ///
private sealed class StubDomainReloadStateProvider : IDomainReloadStateProvider
{
private readonly bool _isDomainReloadInProgress;
diff --git a/Assets/Tests/Editor/DynamicCodeToolTests/AssemblyReferencePolicyTests.cs b/Assets/Tests/Editor/DynamicCodeToolTests/AssemblyReferencePolicyTests.cs
index 3ed5b6c2b..5f8e83810 100644
--- a/Assets/Tests/Editor/DynamicCodeToolTests/AssemblyReferencePolicyTests.cs
+++ b/Assets/Tests/Editor/DynamicCodeToolTests/AssemblyReferencePolicyTests.cs
@@ -4,7 +4,10 @@
using System.Linq;
using System.Reflection;
-namespace io.github.hatayama.UnityCliLoop.DynamicCodeToolTests
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor.DynamicCodeToolTests
{
///
/// Test for AssemblyReferencePolicy
diff --git a/Assets/Tests/Editor/DynamicCodeToolTests/AutoInjectedNamespacesTests.cs b/Assets/Tests/Editor/DynamicCodeToolTests/AutoInjectedNamespacesTests.cs
index 0c58c6463..7d25ccf43 100644
--- a/Assets/Tests/Editor/DynamicCodeToolTests/AutoInjectedNamespacesTests.cs
+++ b/Assets/Tests/Editor/DynamicCodeToolTests/AutoInjectedNamespacesTests.cs
@@ -3,8 +3,14 @@
using System.Threading.Tasks;
using NUnit.Framework;
-namespace io.github.hatayama.UnityCliLoop.DynamicCodeToolTests
+using io.github.hatayama.UnityCliLoop.FirstPartyTools;
+using io.github.hatayama.UnityCliLoop.ToolContracts;
+
+namespace io.github.hatayama.UnityCliLoop.Tests.Editor.DynamicCodeToolTests
{
+ ///
+ /// Test fixture that verifies Pre Using Resolver Added Namespaces behavior.
+ ///
[TestFixture]
public class PreUsingResolverAddedNamespacesTests
{
@@ -60,7 +66,7 @@ public void Resolve_WhenMultipleTypes_ShouldReportAllAddedNamespaces()
[Test]
public void Resolve_WhenAlreadyHasUsing_ShouldNotReportIt()
{
- List usings = new List { "using System.Text;" };
+ List usings = new() { "using System.Text;" };
string body = "StringBuilder builder = new StringBuilder();\nreturn builder.ToString();";
string wrappedSource = WrapperTemplate.Build(usings, "TestNs", "TestClass", body);
@@ -70,6 +76,9 @@ public void Resolve_WhenAlreadyHasUsing_ShouldNotReportIt()
}
}
+ ///
+ /// Test fixture that verifies Auto Injected Namespaces Integration behavior.
+ ///
[TestFixture]
public class AutoInjectedNamespacesIntegrationTests
{
@@ -91,11 +100,10 @@ public void TearDown()
[Test]
public async Task CompileAsync_ScriptMode_MissingUsing_ShouldReportAutoInjectedNamespaces()
{
- DynamicCodeCompiler compiler = new DynamicCodeCompiler(DynamicCodeSecurityLevel.Restricted);
- CompilationRequest request = new CompilationRequest
- {
+ DynamicCodeCompiler compiler = new(DynamicCodeSecurityLevel.Restricted);
+ CompilationRequest request = new() {
Code = @"
- StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new();
builder.Append(""hello"");
return builder.ToString();
",
@@ -113,9 +121,8 @@ public async Task CompileAsync_ScriptMode_MissingUsing_ShouldReportAutoInjectedN
[Test]
public async Task CompileAsync_ScriptMode_NoMissingUsing_ShouldReportEmptyAutoInjectedNamespaces()
{
- DynamicCodeCompiler compiler = new DynamicCodeCompiler(DynamicCodeSecurityLevel.Restricted);
- CompilationRequest request = new CompilationRequest
- {
+ DynamicCodeCompiler compiler = new(DynamicCodeSecurityLevel.Restricted);
+ CompilationRequest request = new() {
Code = "return 1 + 2;",
ClassName = "NoAutoInjectionCommand",
Namespace = "TestNamespace"
@@ -131,12 +138,11 @@ public async Task CompileAsync_ScriptMode_NoMissingUsing_ShouldReportEmptyAutoIn
[Test]
public async Task CompileAsync_ScriptMode_WithExistingUsing_ShouldNotReportIt()
{
- DynamicCodeCompiler compiler = new DynamicCodeCompiler(DynamicCodeSecurityLevel.Restricted);
- CompilationRequest request = new CompilationRequest
- {
+ DynamicCodeCompiler compiler = new(DynamicCodeSecurityLevel.Restricted);
+ CompilationRequest request = new() {
Code = @"
using System.Text;
- StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new();
builder.Append(""already imported"");
return builder.ToString();
",
@@ -154,12 +160,11 @@ public async Task CompileAsync_ScriptMode_WithExistingUsing_ShouldNotReportIt()
[Test]
public async Task CompileAsync_ScriptMode_MultipleMissing_ShouldReportAll()
{
- DynamicCodeCompiler compiler = new DynamicCodeCompiler(DynamicCodeSecurityLevel.Restricted);
- CompilationRequest request = new CompilationRequest
- {
+ DynamicCodeCompiler compiler = new(DynamicCodeSecurityLevel.Restricted);
+ CompilationRequest request = new() {
Code = @"
- StringBuilder sb = new StringBuilder();
- Regex regex = new Regex(@""\d+"");
+ StringBuilder sb = new();
+ Regex regex = new(@""\d+"");
return sb.ToString() + regex.ToString();
",
ClassName = "MultipleAutoInjectedCommand",
@@ -177,17 +182,19 @@ public async Task CompileAsync_ScriptMode_MultipleMissing_ShouldReportAll()
[Test]
public async Task CompileAsync_RawMode_MissingUsing_ShouldReportAutoInjectedNamespaces()
{
- DynamicCodeCompiler compiler = new DynamicCodeCompiler(DynamicCodeSecurityLevel.Restricted);
- CompilationRequest request = new CompilationRequest
- {
+ DynamicCodeCompiler compiler = new(DynamicCodeSecurityLevel.Restricted);
+ CompilationRequest request = new() {
Code = @"
+ ///
+ /// Test fixture that verifies Raw Mode Missing Using behavior.
+ ///
public class RawModeMissingUsingTest
{
public async System.Threading.Tasks.Task