chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Response schema for ClearConsole command
|
||||
/// Provides type-safe response structure for console clearing operation
|
||||
/// </summary>
|
||||
public class ClearConsoleResponse : BaseToolResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the console clear operation was successful
|
||||
/// </summary>
|
||||
public bool Success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of logs that were cleared from the console
|
||||
/// </summary>
|
||||
public int ClearedLogCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Breakdown of cleared logs by type
|
||||
/// </summary>
|
||||
public ClearedLogCounts ClearedCounts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message describing the clear operation result
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Error message if the operation failed
|
||||
/// </summary>
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a new ClearConsoleResponse for successful operation
|
||||
/// </summary>
|
||||
public ClearConsoleResponse(bool success, int clearedLogCount, ClearedLogCounts clearedCounts, string message)
|
||||
{
|
||||
Success = success;
|
||||
ClearedLogCount = clearedLogCount;
|
||||
ClearedCounts = clearedCounts ?? new ClearedLogCounts();
|
||||
Message = message ?? string.Empty;
|
||||
ErrorMessage = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new ClearConsoleResponse for failed operation
|
||||
/// </summary>
|
||||
public ClearConsoleResponse(string errorMessage)
|
||||
{
|
||||
Success = false;
|
||||
ClearedLogCount = 0;
|
||||
ClearedCounts = new ClearedLogCounts();
|
||||
Message = string.Empty;
|
||||
ErrorMessage = errorMessage ?? string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor for JSON deserialization
|
||||
/// </summary>
|
||||
public ClearConsoleResponse()
|
||||
{
|
||||
ClearedCounts = new ClearedLogCounts();
|
||||
Message = string.Empty;
|
||||
ErrorMessage = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Breakdown of cleared logs by type
|
||||
/// </summary>
|
||||
public class ClearedLogCounts
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of error logs that were cleared
|
||||
/// </summary>
|
||||
public int ErrorCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of warning logs that were cleared
|
||||
/// </summary>
|
||||
public int WarningCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of info logs that were cleared
|
||||
/// </summary>
|
||||
public int LogCount { get; set; }
|
||||
|
||||
public ClearedLogCounts()
|
||||
{
|
||||
}
|
||||
|
||||
public ClearedLogCounts(int errorCount, int warningCount, int logCount)
|
||||
{
|
||||
ErrorCount = errorCount;
|
||||
WarningCount = warningCount;
|
||||
LogCount = logCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbbf8d96e00c54171b03c9c0d42822dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Schema for ClearConsole command parameters
|
||||
/// Provides type-safe parameter access for clearing Unity Console
|
||||
/// Related classes:
|
||||
/// - ConsoleUtility: Service layer for console operations
|
||||
/// - ClearConsoleResponse: Type-safe response structure
|
||||
/// - ClearConsoleCommand: Command implementation
|
||||
/// </summary>
|
||||
public class ClearConsoleSchema : BaseToolSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether to add a confirmation log message after clearing
|
||||
/// </summary>
|
||||
[Description("Whether to add a confirmation log message after clearing")]
|
||||
public bool AddConfirmationMessage { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94a230c702f0e4d75b03dc706886b935
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// ClearConsole tool handler - Type-safe implementation using Schema and Response
|
||||
/// Clears Unity console logs for clean development workflow
|
||||
/// Related classes: ClearConsoleUseCase, ConsoleUtility, ClearConsoleSchema, ClearConsoleResponse
|
||||
/// </summary>
|
||||
[McpTool(Description = "Clear Unity console logs")]
|
||||
public class ClearConsoleTool : AbstractUnityTool<ClearConsoleSchema, ClearConsoleResponse>
|
||||
{
|
||||
public override string ToolName => "clear-console";
|
||||
|
||||
/// <summary>
|
||||
/// Execute console clear tool
|
||||
/// </summary>
|
||||
/// <param name="parameters">Type-safe parameters</param>
|
||||
/// <param name="cancellationToken">Cancellation token for timeout control</param>
|
||||
/// <returns>Clear operation result</returns>
|
||||
protected override async Task<ClearConsoleResponse> ExecuteAsync(ClearConsoleSchema parameters, CancellationToken cancellationToken)
|
||||
{
|
||||
// Create and execute ClearConsoleUseCase instance
|
||||
ClearConsoleUseCase useCase = new();
|
||||
return await useCase.ExecuteAsync(parameters, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b72387c853bad490fb5cb20f551f0781
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc3fddf04059a4303be8a7f27aa53052
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: uloop-clear-console
|
||||
description: "Clear Unity Console entries. Use before compile, tests, or debugging when stale logs would hide the current result."
|
||||
---
|
||||
|
||||
# uloop clear-console
|
||||
|
||||
Clear Unity console logs.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
uloop clear-console [--add-confirmation-message]
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `--add-confirmation-message` | boolean | `false` | Add confirmation message after clearing |
|
||||
|
||||
## Global Options
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `--project-path <path>` | Optional. Use only when the target Unity project is not the current directory. |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Clear console
|
||||
uloop clear-console
|
||||
|
||||
# Clear with confirmation
|
||||
uloop clear-console --add-confirmation-message
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
Returns JSON with:
|
||||
- `Success` (boolean): Whether the clear operation succeeded
|
||||
- `ClearedLogCount` (number): Total number of log entries that were cleared
|
||||
- `ClearedCounts` (object): Breakdown by log type
|
||||
- `ErrorCount` (number): Errors cleared
|
||||
- `WarningCount` (number): Warnings cleared
|
||||
- `LogCount` (number): Info logs cleared
|
||||
- `Message` (string): Description of the result; carries the failure summary when the operation fails (e.g. `"Failed to clear console: ..."`)
|
||||
- `ErrorMessage` (string): Currently always empty for this tool — read `Message` for failure details
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f1d3cbc9cba645b398b9f4bbe9537c4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user