feat(studio): surface provider + sourceKind + versionAdvisory on CapabilityInfo
Some checks failed
Security / Security check (push) Failing after 1s
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:
parent
a5bd51de33
commit
d697339393
3 changed files with 38 additions and 21 deletions
|
|
@ -135,6 +135,9 @@ class HubService {
|
||||||
version: c.version,
|
version: c.version,
|
||||||
moduleName: c.moduleName,
|
moduleName: c.moduleName,
|
||||||
kind: c.kind.isEmpty ? 'wasm' : c.kind,
|
kind: c.kind.isEmpty ? 'wasm' : c.kind,
|
||||||
|
provider: c.provider,
|
||||||
|
sourceKind: c.sourceKind,
|
||||||
|
versionAdvisory: c.versionAdvisory,
|
||||||
))
|
))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
@ -915,12 +918,27 @@ class CapabilityInfo {
|
||||||
final String version;
|
final String version;
|
||||||
final String moduleName;
|
final String moduleName;
|
||||||
final String kind;
|
final String kind;
|
||||||
|
/// Publisher segment of the fully-qualified identifier.
|
||||||
|
/// "fai" for legacy bundles, "fai.system" for built-ins,
|
||||||
|
/// operator-config service name for federated capabilities.
|
||||||
|
final String provider;
|
||||||
|
/// Transport that delivers the capability: bundle / system /
|
||||||
|
/// mcp / n8n / temporal / webhook. Empty string falls back
|
||||||
|
/// to deriving from `kind` for pre-0.12 hubs.
|
||||||
|
final String sourceKind;
|
||||||
|
/// Whether the version on this capability is a label rather
|
||||||
|
/// than a hard contract. True for federation sources whose
|
||||||
|
/// upstream service does not honour semver.
|
||||||
|
final bool versionAdvisory;
|
||||||
|
|
||||||
const CapabilityInfo({
|
const CapabilityInfo({
|
||||||
required this.capability,
|
required this.capability,
|
||||||
required this.version,
|
required this.version,
|
||||||
required this.moduleName,
|
required this.moduleName,
|
||||||
required this.kind,
|
required this.kind,
|
||||||
|
this.provider = '',
|
||||||
|
this.sourceKind = '',
|
||||||
|
this.versionAdvisory = false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
// drop into the running app.
|
// drop into the running app.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../theme/theme.dart';
|
||||||
import 'hub.dart';
|
import 'hub.dart';
|
||||||
|
|
||||||
/// SharedPreferences key for the operator's preferred theme
|
/// SharedPreferences key for the operator's preferred theme
|
||||||
|
|
@ -94,26 +94,15 @@ Future<ThemePluginSchemes> loadThemePluginSchemes(String capability) async {
|
||||||
return ThemePluginSchemes(light: light, dark: dark);
|
return ThemePluginSchemes(light: light, dark: dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build a `ThemeData` from a plugin-supplied `ColorScheme`,
|
/// Build a `ThemeData` from a plugin-supplied `ColorScheme`.
|
||||||
/// keeping Studio's typography (Inter for UI, JetBrains Mono
|
/// Delegates to [FaiTheme.fromColorScheme] so plugin-themed
|
||||||
/// for code) so a theme swap doesn't reflow text metrics.
|
/// builds and built-in themes share one structural shape — same
|
||||||
/// Mirrors what `FaiTheme.light()` / `.dark()` do internally
|
/// textTheme cascade, same component themes, same `inherit`
|
||||||
/// but with the operator-chosen palette.
|
/// values on every TextStyle. Without that, Flutter's
|
||||||
ThemeData themeDataFromScheme(ColorScheme scheme) {
|
/// AnimatedDefaultTextStyle lerp blows up when swapping between
|
||||||
return ThemeData(
|
/// the two paths.
|
||||||
useMaterial3: true,
|
ThemeData themeDataFromScheme(ColorScheme scheme) =>
|
||||||
colorScheme: scheme,
|
FaiTheme.fromColorScheme(scheme);
|
||||||
scaffoldBackgroundColor: scheme.surface,
|
|
||||||
canvasColor: scheme.surface,
|
|
||||||
cardColor: scheme.surfaceContainer,
|
|
||||||
dividerColor: scheme.outlineVariant,
|
|
||||||
textTheme: GoogleFonts.interTextTheme(
|
|
||||||
scheme.brightness == Brightness.dark
|
|
||||||
? Typography.whiteCupertino
|
|
||||||
: Typography.blackCupertino,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Translate the plugin's 14 ARGB tokens into a `ColorScheme`.
|
/// Translate the plugin's 14 ARGB tokens into a `ColorScheme`.
|
||||||
/// Order matches the plugin contract:
|
/// Order matches the plugin contract:
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,16 @@ class FaiTheme {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Build a Studio ThemeData around any [ColorScheme]. Used by
|
||||||
|
/// the built-in light/dark constructors and by
|
||||||
|
/// `themeDataFromScheme` when a Studio plugin supplies the
|
||||||
|
/// palette. Single entry-point so the plugin path and the
|
||||||
|
/// built-in path always produce structurally identical
|
||||||
|
/// ThemeData (same textTheme, same component themes); without
|
||||||
|
/// this, swapping between them at runtime trips Flutter's
|
||||||
|
/// TextStyle.lerp with mismatched `inherit` values.
|
||||||
|
static ThemeData fromColorScheme(ColorScheme scheme) => _build(scheme);
|
||||||
|
|
||||||
static ThemeData dark() {
|
static ThemeData dark() {
|
||||||
final scheme = ColorScheme(
|
final scheme = ColorScheme(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue