feat(studio): surface provider + sourceKind + versionAdvisory on CapabilityInfo
Some checks failed
Security / Security check (push) Failing after 1s

Studio's UI-side `CapabilityInfo` record now carries the
three fields that the F∆I 0.12.0 hub exposes on
CapabilityEntry:

  - `provider` — publisher identity ("fai", "fai.system",
    "bmds.spark", ...)
  - `sourceKind` — transport ("bundle", "system", "mcp",
    "n8n", "temporal", "webhook")
  - `versionAdvisory` — true for federation sources whose
    version pin is a label, not a contract

`allCapabilities()` populates them from the freshly-regenerated
protobuf bindings. Defaults are backward-compatible (empty
strings + false) so a pre-0.12 hub still works against this
Studio build.

Badge rendering in the capability picker / store grid lands
in a follow-up Studio commit; this change is the data-layer
plumbing only. dart analyze green.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-28 10:54:48 +02:00
parent a5bd51de33
commit d697339393
3 changed files with 38 additions and 21 deletions

View file

@ -9,9 +9,9 @@
// drop into the running app.
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../theme/theme.dart';
import 'hub.dart';
/// SharedPreferences key for the operator's preferred theme
@ -94,26 +94,15 @@ Future<ThemePluginSchemes> loadThemePluginSchemes(String capability) async {
return ThemePluginSchemes(light: light, dark: dark);
}
/// Build a `ThemeData` from a plugin-supplied `ColorScheme`,
/// keeping Studio's typography (Inter for UI, JetBrains Mono
/// for code) so a theme swap doesn't reflow text metrics.
/// Mirrors what `FaiTheme.light()` / `.dark()` do internally
/// but with the operator-chosen palette.
ThemeData themeDataFromScheme(ColorScheme scheme) {
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
scaffoldBackgroundColor: scheme.surface,
canvasColor: scheme.surface,
cardColor: scheme.surfaceContainer,
dividerColor: scheme.outlineVariant,
textTheme: GoogleFonts.interTextTheme(
scheme.brightness == Brightness.dark
? Typography.whiteCupertino
: Typography.blackCupertino,
),
);
}
/// Build a `ThemeData` from a plugin-supplied `ColorScheme`.
/// Delegates to [FaiTheme.fromColorScheme] so plugin-themed
/// builds and built-in themes share one structural shape same
/// textTheme cascade, same component themes, same `inherit`
/// values on every TextStyle. Without that, Flutter's
/// AnimatedDefaultTextStyle lerp blows up when swapping between
/// the two paths.
ThemeData themeDataFromScheme(ColorScheme scheme) =>
FaiTheme.fromColorScheme(scheme);
/// Translate the plugin's 14 ARGB tokens into a `ColorScheme`.
/// Order matches the plugin contract: