Function getDiagnostics

One-off read of the previewed app's current diagnostics. Returns the empty snapshot until the host answers (or if the app lacks diagnostics:read). Use onDiagnosticsChange/useDiagnostics to react to live updates.