Editor/Drivers/VideoRecordingDriver.cs

Editor utility that controls video recording via console commands. It checks EditorUtility.IsRecordingVideo and issues ConsoleSystem.Run("video {fileName}") to start or "video stop" to stop, returning simple status objects wrapped in ToolOutcome<object>.

Process Execution
#nullable enable
using System;
using Sandbox;

namespace Editor.Mcp
{
	internal static class VideoRecordingDriver
	{
		public static ToolOutcome<object> Control( string action, string fileName = "test_run.mp4" )
		{
			var normAction = action.ToLowerInvariant();
			var isRecording = EditorUtility.IsRecordingVideo;

			switch ( normAction )
			{
				case "start":
					if ( isRecording ) return ToolOutcome<object>.Ready( new { IsRecording = true, Message = "Already recording video." } );
					ConsoleSystem.Run( $"video {fileName}" );
					return ToolOutcome<object>.Ready( new { IsRecording = true, FileName = fileName } );

				case "stop":
					if ( !isRecording ) return ToolOutcome<object>.Ready( new { IsRecording = false, Message = "No video recording was active." } );
					ConsoleSystem.Run( "video stop" );
					return ToolOutcome<object>.Ready( new { IsRecording = false, Stopped = true } );

				case "status":
				default:
					return ToolOutcome<object>.Ready( new { IsRecording = isRecording } );
			}
		}
	}
}