chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Response schema for GetToolDetails tool
|
||||
/// Provides type-safe response structure for tool information
|
||||
/// </summary>
|
||||
public class GetToolDetailsResponse : BaseToolResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Array of detailed tool information
|
||||
/// </summary>
|
||||
public ToolInfo[] Tools { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9ee3426fd05148ce937a7d0410e9d5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Schema for GetToolDetails tool parameters
|
||||
/// Provides type-safe parameter access for retrieving tool information
|
||||
/// </summary>
|
||||
public class GetToolDetailsSchema : BaseToolSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether to include development-only tools in the results
|
||||
/// </summary>
|
||||
[Description("Whether to include development-only tools in the results")]
|
||||
public bool IncludeDevelopmentOnly { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06cfc692beed3460f86b422dc166d9a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// GetToolDetails tool handler - Type-safe implementation using Schema and Response
|
||||
/// Retrieves detailed information about all registered Unity MCP tools
|
||||
/// Related classes:
|
||||
/// - UnityToolRegistry: Source of tool information
|
||||
/// - ToolInfo: Data structure for tool details
|
||||
/// - GetToolDetailsResponse: Type-safe response structure
|
||||
/// </summary>
|
||||
[McpTool(
|
||||
Description = "Retrieve detailed information about all registered Unity MCP tools",
|
||||
DisplayDevelopmentOnly = true
|
||||
)]
|
||||
public class GetToolDetailsTool : AbstractUnityTool<GetToolDetailsSchema, GetToolDetailsResponse>
|
||||
{
|
||||
public override string ToolName => "get-tool-details";
|
||||
|
||||
protected override Task<GetToolDetailsResponse> ExecuteAsync(GetToolDetailsSchema parameters, CancellationToken cancellationToken)
|
||||
{
|
||||
// Type-safe parameter access
|
||||
bool includeDevelopmentOnly = parameters.IncludeDevelopmentOnly;
|
||||
|
||||
// Get tool registry and retrieve all registered tools
|
||||
UnityToolRegistry registry = CustomToolManager.GetRegistry();
|
||||
ToolInfo[] allTools = registry.GetRegisteredTools();
|
||||
|
||||
// Filter tools based on development-only setting
|
||||
ToolInfo[] filteredTools = allTools;
|
||||
if (!includeDevelopmentOnly)
|
||||
{
|
||||
filteredTools = allTools
|
||||
.Where(tool => !tool.DisplayDevelopmentOnly)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
// Create type-safe response
|
||||
GetToolDetailsResponse response = new GetToolDetailsResponse
|
||||
{
|
||||
Tools = filteredTools
|
||||
};
|
||||
|
||||
return Task.FromResult(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8822cfe69693e4813bd4f3edf0080a66
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user