Editor tool entry point for package publishing. Exposes a Mcp tool method PublishPackage that calls PackagePublishDriver.PublishAsync with action, changeTitle and changeDetail, returning JSON result or a failure JSON on exception.
#nullable enable
using System;
using System.ComponentModel;
using System.Threading.Tasks;
namespace Editor.Mcp
{
public static partial class SboxMcpAssistant
{
[McpTool( "pocketknife_publish_package" )]
public static async Task<string> PublishPackage(
[Description( "Action: inspect_manifest, preflight, publish" )] string action = "inspect_manifest",
[Description( "Revision changelog title (e.g. 'v1.1 - Added Vehicle Physics')" )] string? changeTitle = null,
[Description( "Detailed changelog markdown notes" )] string? changeDetail = null )
{
try
{
var result = await PackagePublishDriver.PublishAsync( action, changeTitle, changeDetail );
return McpJson.Write( result );
}
catch ( Exception ex )
{
return McpJson.Write( ToolOutcome<object>.Failure( null, ToolStatus.Failed, "publish.failed", "Package publishing operation failed.", ex ) );
}
}
}
}