chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Response for debug sleep tool execution
|
||||
/// Related classes:
|
||||
/// - SleepTool: Implementation that generates this response
|
||||
/// - SleepSchema: Input parameters for the sleep tool
|
||||
/// - BaseToolResponse: Base class providing timing information
|
||||
/// </summary>
|
||||
public class SleepResponse : BaseToolResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Message indicating the result of the sleep operation
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Actual number of seconds the tool slept before completion or timeout
|
||||
/// </summary>
|
||||
public int ActualSleepSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the operation completed successfully or was cancelled
|
||||
/// </summary>
|
||||
public bool WasCancelled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28eaf066ee0a94a999dd67f9f4baabcd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Schema for debug sleep tool parameters
|
||||
/// Related classes:
|
||||
/// - SleepTool: Implementation of the debug sleep tool
|
||||
/// - SleepResponse: Response structure for the sleep tool
|
||||
/// </summary>
|
||||
public class SleepSchema : BaseToolSchema
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of seconds to sleep for testing purposes (default: 15)
|
||||
/// </summary>
|
||||
[Description("Number of seconds to sleep for testing purposes (default: 15)")]
|
||||
public int SleepSeconds { get; set; } = 15;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65adc65e8b27d41e889d4ccb67be267b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Debug tool that sleeps for specified duration to test timeout functionality
|
||||
/// Related classes:
|
||||
/// - SleepSchema: Input parameters including sleep duration and timeout
|
||||
/// - SleepResponse: Output containing results and timing information
|
||||
/// - AbstractUnityTool: Base class providing timeout infrastructure
|
||||
/// </summary>
|
||||
[McpTool(
|
||||
DisplayDevelopmentOnly = true,
|
||||
Description = "Debug tool that sleeps for specified duration to test timeout functionality"
|
||||
)]
|
||||
public class SleepTool : AbstractUnityTool<SleepSchema, SleepResponse>
|
||||
{
|
||||
public override string ToolName => "debug-sleep";
|
||||
|
||||
protected override async Task<SleepResponse> ExecuteAsync(SleepSchema parameters, CancellationToken cancellationToken)
|
||||
{
|
||||
int actualSleepSeconds = 0;
|
||||
|
||||
// Sleep 1 second at a time, checking for cancellation between each sleep
|
||||
for (int i = 0; i < parameters.SleepSeconds; i++)
|
||||
{
|
||||
// Check for cancellation before each sleep iteration
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// Sleep for 1 second with cancellation support
|
||||
await Task.Delay(1000, cancellationToken);
|
||||
|
||||
actualSleepSeconds = i + 1;
|
||||
}
|
||||
|
||||
return new SleepResponse
|
||||
{
|
||||
Message = $"Successfully slept for {actualSleepSeconds} seconds",
|
||||
ActualSleepSeconds = actualSleepSeconds,
|
||||
WasCancelled = false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3819fd5fb05cb4309a2229a93f79f74a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user