feat(store): source-bucket from CapabilityEntry.source_kind
Some checks failed
Security / Security check (push) Failing after 1s

Studio's `_sourceForItem` now prefers the wire-level
`sourceKind` field (populated by 0.12+ hubs) over the legacy
name-prefix heuristic. Adds a "temporal" bucket alongside
"mcp" / "n8n" / "native" / "federated" so SPARK-federated
workflows render with their own transport pill on the store
grid + filter chip.

Pre-0.12 hubs return empty `sourceKind` and the legacy
sniffing path still works -- back-compat preserved.

`StoreItem` data class accepts an optional `sourceKind`
parameter (defaults to empty). dart analyze green.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-28 12:06:59 +02:00
parent d697339393
commit 2c13ef58ae
2 changed files with 28 additions and 4 deletions

View file

@ -641,11 +641,27 @@ class _StorePageState extends State<StorePage> {
}
/// 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';