startManaged function
Starts a child that belongs to the current tool call: it is stopped if the call is abandoned, and forgotten once it exits. Call CallProgress.release to hand it over to outlive the call.
Implementation
Future<Process> startManaged(
String executable,
List<String> arguments, {
String? label,
Map<String, String>? environment,
String? workingDirectory,
}) async {
CallProgress.checkAlive();
final process = ProcessRegistry.instance
.track(await Process.start(executable, arguments, environment: environment, workingDirectory: workingDirectory));
return _ownedByCall(process, label ?? describeCommand(executable, arguments));
}