diff --git a/lib/data/hub.dart b/lib/data/hub.dart index 15a6e4c..e62399b 100644 --- a/lib/data/hub.dart +++ b/lib/data/hub.dart @@ -597,6 +597,7 @@ class HubService { docsUrl: e.docsUrl, kind: e.kind, provider: e.provider, + sourceKind: e.sourceKind, ), ) .toList(); @@ -1399,6 +1400,12 @@ class StoreItem { /// Provider id for federated entries. Empty for native. /// E.g. "filesystem" for an `mcp.filesystem.read_file` tool. final String provider; + /// Transport delivering this entry. Distinct from `kind` — + /// `sourceKind` answers "HOW does the hub reach this", not + /// "is it installable". Values: "bundle", "mcp", "n8n", + /// "temporal", "webhook". Empty falls back to deriving + /// from `kind` for pre-0.12 hubs. + final String sourceKind; bool get isFederated => kind == 'federated'; @@ -1423,5 +1430,6 @@ class StoreItem { required this.docsUrl, required this.kind, required this.provider, + this.sourceKind = '', }); } diff --git a/lib/pages/store.dart b/lib/pages/store.dart index 98416c1..210338b 100644 --- a/lib/pages/store.dart +++ b/lib/pages/store.dart @@ -641,11 +641,27 @@ class _StorePageState extends State { } /// Maps a store entry to its provenance bucket: 'native' for -/// non-federated entries, 'mcp' / 'n8n' for federated tools that -/// flow through one of the bridges. Used by the source filter -/// chip and the per-card provenance pill so operators can tell -/// at a glance which entries come from where. +/// non-federated entries, 'mcp' / 'n8n' / 'temporal' for federated +/// tools that flow through one of the bridges. Used by the +/// source filter chip and the per-card provenance pill so +/// operators can tell at a glance which entries come from where. +/// +/// Prefers the wire-level `sourceKind` field (0.12+); falls back +/// to the legacy name-prefix heuristic for pre-0.12 hubs that +/// don't populate it. String _sourceForItem(StoreItem i) { + if (i.sourceKind.isNotEmpty) { + switch (i.sourceKind) { + case 'bundle': + return 'native'; + case 'mcp': + case 'n8n': + case 'temporal': + return i.sourceKind; + default: + return 'federated'; + } + } if (!i.isFederated) return 'native'; if (i.name.startsWith('mcp.')) return 'mcp'; if (i.name.startsWith('n8n.')) return 'n8n';