namespace AIStudio.Tools.Rust;
public static class RuntimeInfoResponseExtensions
{
/// What the runtime tells about itself.
extension(RuntimeInfoResponse runtimeInfo)
{
///
/// Whether a document can be opened at a page at all.
///
///
/// Never inside a Flatpak: its sandbox lets AI Studio start no program itself, and the desktop
/// portal, which opens the document instead, knows no pages, see PageOutcome in
/// runtime/src/file_actions.rs. Everywhere else, whether the page arrives depends on the
/// program, which the runtime learns only while it opens the document.
///
/// False inside a Flatpak.
public bool CanOpenDocumentsAtPage => runtimeInfo.LinuxPackageType is not LinuxPackageType.FLATPAK;
}
}