using System.Security; namespace ClaudeDo.Installer.Core; public static class ScheduledTaskXml { public static string Build(string userId, string workerExePath, int restartIntervalMinutes) { var minutes = restartIntervalMinutes < 1 ? 1 : restartIntervalMinutes; var user = SecurityElement.Escape(userId); var cmd = SecurityElement.Escape(workerExePath); return $""" ClaudeDo background worker (per-user). true {user} {user} InteractiveToken LeastPrivilege IgnoreNew false false true true true PT0S PT{minutes}M 3 {cmd} """; } }