Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(extensions): the Skill Finder searches the text, the tables read larger, and the MCP mark is the real one

rubenluetke10-beep72d2f54a56a0
diff --git a/jarvis/skills/finder.py b/jarvis/skills/finder.py
index dc651461fa..71cd50b763 100644
--- a/jarvis/skills/finder.py
+++ b/jarvis/skills/finder.py
@@ -25,7 +25,12 @@ from pathlib import Path
from typing import Any, Literal
from jarvis.core.paths import user_skills_dir
-from jarvis.skills.catalog import load_catalog
+
+# ``search`` reads the seed through the module attribute so a test can swap
+# ``load_catalog`` on ``jarvis.skills.catalog``; the direct name stays a
+# re-export for callers that read the seed through the finder.
+from jarvis.skills import catalog as _catalog_module
+from jarvis.skills.catalog import load_catalog # noqa: F401
from jarvis.skills.loader import parse_skill
log = logging.getLogger(__name__)
@@ -174,52 +179,128 @@ def _passes_filter(entry: dict[str, Any], f: SearchFilters) -> bool:
_WORD_RE = re.compile(r"\b\w{3,}\b", re.UNICODE)
+_MATCH_WORD_RE = re.compile(r"\w+", re.UNICODE)
+
+# A query token this long or longer may also PREFIX-match an entry token
+# ("extract" finds "extraction"); shorter tokens ("pdf", "ui") match exactly.
+_PREFIX_MIN_LEN = 4
def _tokenize(text: str) -> set[str]:
return {w.lower() for w in _WORD_RE.findall(text)}
-def _score_heuristic(query_tokens: set[str], entry: dict[str, Any]) -> float:
- """Heuristic ranking without a brain.
+def _match_tokens(text: str) -> set[str]:
+ """Lower-cased word tokens of a catalog field, no minimum length — a tag
+ like "ui" or "git" must stay findable."""
+ return {w.lower() for w in _MATCH_WORD_RE.findall(text)}
+
+
+def _query_tokens(query: str) -> set[str]:
+ """Tokens of the user's query for text matching.
+
+ Every word of two or more characters counts, lower-cased ("PDf" → "pdf").
+ A query made of single letters only keeps those, so a non-empty query can
+ never silently turn into browse mode.
+ """
+ words = [w.lower() for w in _MATCH_WORD_RE.findall(query)]
+ return {w for w in words if len(w) >= 2} or set(words)
+
+
+def _token_hits(query_tokens: set[str], field_tokens: set[str]) -> set[str]:
+ """Query tokens that match a field: exact, or as a prefix when long enough."""
+ hits: set[str] = set()
+ for q in query_tokens:
+ if q in field_tokens:
+ hits.add(q)
+ elif len(q) >= _PREFIX_MIN_LEN and any(t.startswith(q) for t in field_tokens):
+ hits.add(q)
+ return hits
+
+
+@dataclass(frozen=True)
+class _TextMatch:
+ """Outcome of matching a query against one catalog entry."""
+ score: float
+ labels: tuple[str, ...]
+
+ @property
+ def matched(self) -> bool:
+ return self.score > 0.0
+
+ def reason(self, trust: str) -> str:
+ """Names WHAT matched ("name", "tag: pdf", ...). Without a text match
+ (browse mode) the only thing that matched is the filter set."""
+ if not self.matched:
+ return f"Trust match ({trust})"
+ return "Matches " + ", ".join(self.labels[:4])
+
+
+_NO_MATCH = _TextMatch(score=0.0, labels=())
+
+# Field weights: curated fields (name, title, tags) outrank prose.
+_FIELD_WEIGHTS: dict[str, float] = {
+ "name": 2.0,
+ "title": 2.0,
+ "tag": 2.0,
+ "category": 1.5,
+ "description": 1.0,
+}
+_MAX_FIELD_WEIGHT = max(_FIELD_WEIGHTS.values())
+
- Counts token overlaps between the query and (title + description + tags).
- Weighs tags higher because they're curated.
+def _match_text(query_tokens: set[str], entry: dict[str, Any]) -> _TextMatch:
+ """Token-wise, case-insensitive match of the query against an entry.
+
+ Looks at name, title, description, tags and categories. Each query token
+ scores the weight of the best field it hits, so one token found in three
+ fields does not outrank three tokens found once. The score is normalised
+ to [0, 1] by the number of query tokens — coverage matters.
+
+ Returns a zero score with no labels when nothing matches: the caller
+ drops such entries from a text search.
"""
if not query_tokens:
- return 0.0
- blob_tokens = _tokenize(
- " ".join([
- str(entry.get("title", "")),
- str(entry.get("description", "")),
- " ".join(entry.get("categories", [])),
- ])
- )
- tag_tokens = _tokenize(" ".join(entry.get("tags", [])))
+ return _NO_MATCH
+
+ best_per_token: dict[str, float] = {}
+ labels: list[str] = []
+
+ def _record(label: str, field: str, text: str) -> None:
+ hits = _token_hits(query_tokens, _match_tokens(text))
+ if not hits:
+ return
+ if label not in labels:
+ labels.append(label)
+ weight = _FIELD_WEIGHTS[field]
+ for tok in hits:
+ best_per_token[tok] = max(best_per_token.get(tok, 0.0), weight)
+
+ _record("name", "name", str(entry.get("name", "")))
+ _record("title", "title", str(entry.get("title", "")))
+ for tag in entry.get("tags", []) or []:
+ _record(f"tag: {tag}", "tag", str(tag))
+ for cat in entry.get("categories", []) or []:
+ _record(f"category: {cat}", "category", str(cat))
+ _record("description", "description", str(entry.get("description", "")))
+
+ if not best_per_token:
+ return _NO_MATCH
+ raw = sum(best_per_token.values())
+ score = min(1.0, raw / (_MAX_FIELD_WEIGHT * len(query_tokens)))
+ return _TextMatch(score=score, labels=tuple(labels))
- blob_overlap = len(query_tokens & blob_tokens)
- tag_overlap = len(query_tokens & tag_tokens)
- # Tags get a factor of 2, so "docker" in tags outranks "docker" somewhere in the body
- raw = blob_overlap + tag_overlap * 2
- # Normalize to [0, 1] with a soft decay
- return min(1.0, raw / (len(query_tokens) + 1))
+def _score_heuristic(query_tokens: set[str], entry: dict[str, Any]) -> float:
+ """Heuristic ranking without a brain — see ``_match_text``."""
+ return _match_text(query_tokens, entry).score
def _heuristic_reason(query_tokens: set[str], entry: dict[str, Any]) -> str:
- """Human-readable reason for a match — so the user understands why a
- skill was ranked highly."""
- matches = query_tokens & _tokenize(
- " ".join([
- str(entry.get("title", "")),
- str(entry.get("description", "")),
- " ".join(entry.get("tags", [])),
- ])
+ """Human-readable reason for a hit — see ``_TextMatch.reason``."""
+ return _match_text(query_tokens, entry).reason(
+ str(entry.get("trust", "community"))
)
- if not matches:
- trust = entry.get("trust", "community")
- return f"Trust match ({trust})"
- return "Match: " + ", ".join(sorted(matches)[:4])
# ----------------------------------------------------------------------
@@ -350,8 +431,18 @@ class SkillFinder:
self._brain = brain
async def search(self, filters: SearchFilters) -> list[SkillCandidate]:
- """Filter + rank — returns up to ``filters.limit`` candidates."""
- catalog = list(load_catalog())
+ """Filter + rank — returns up to ``filters.limit`` candidates.
+
+ Two modes:
+ - **Text search** (non-empty query): an entry must pass the hard
+ filters AND match the query text (name/title/description/tags/
+ categories, case-insensitive, token-wise). Entries that only pass
+ the filters are dropped; when nothing matches the result is empty.
+ The brain only re-ranks the textual matches — it never resurrects
+ an entry the text match rejected.
+ - **Browse** (empty query): hard filters only, no brain call.
+ """
+ catalog = list(_catalog_module.load_catalog())
# Community entries join the pool AFTER the seed so a name the curated
# catalog already lists cannot be shadowed by a marketplace upload.
seen_names = {str(e.get("name")) for e in catalog}
@@ -363,23 +454,40 @@ class SkillFinder:
if not filtered:
return []
- # Brain ranking
- brain_scores = await _brain_rank(self._brain, filters.query, filtered)
+ query = filters.query.strip()
+ query_tokens = _query_tokens(query)
+ if query and not query_tokens:
+ # Punctuation-only query: nothing can match, and it must not
+ # silently turn into browse mode.
+ return []
+ if query_tokens:
+ pool = [
+ (entry, match)
+ for entry in filtered
+ if (match := _match_text(query_tokens, entry)).matched
+ ]
+ if not pool:
+ return []
+ brain_scores = await _brain_rank(
+ self._brain, query, [entry for entry, _ in pool]
+ )
+ else:
+ pool = [(entry, _NO_MATCH) for entry in filtered]
+ brain_scores = None
- query_tokens = _tokenize(filters.query)
candidates: list[SkillCandidate] = []
- for entry in filtered:
+ for entry, match in pool:
cand = SkillCandidate.from_catalog_entry(entry)
+ heur_reason = match.reason(cand.trust)
if brain_scores and cand.name in brain_scores:
score, reason = brain_scores[cand.name]
# Brain score weighted 0.7, heuristic score weighted 0.3 — so
- # a heuristic zero-hit isn't left completely blind
- heur = _score_heuristic(query_tokens, entry)
- final_score = 0.7 * score + 0.3 * heur
- final_reason = reason or _heuristic_reason(query_tokens, entry)
+ # a brain that under-rates an exact tag hit cannot bury it
+ final_score = 0.7 * score + 0.3 * match.score
+ final_reason = reason or heur_reason
else:
- final_score = _score_heuristic(query_tokens, entry)
- final_reason = _heuristic_reason(query_tokens, entry)
+ final_score = match.score
+ final_reason = heur_reason
# Trust bonus: on equal score, the more trustworthy one wins
trust_bonus = (3 - TRUST_ORDER.get(cand.trust, 3)) * 0.01
diff --git a/jarvis/ui/web/frontend/src/components/extensions/McpLogo.tsx b/jarvis/ui/web/frontend/src/components/extensions/McpLogo.tsx
new file mode 100644
index 0000000000..bf9c9080d9
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/extensions/McpLogo.tsx
@@ -0,0 +1,22 @@
+import type { SVGProps } from "react";
+
+/**
+ * The Model Context Protocol mark, inlined so the navigation never depends on
+ * a CDN being reachable. Glyph from Simple Icons (CC0); drawn in
+ * `currentColor` so it follows the text colour of the row it sits in, exactly
+ * like the Lucide icons next to it.
+ */
+export function McpLogo(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ fill="currentColor"
+ role="img"
+ aria-hidden="true"
+ focusable="false"
+ {...props}
+ >
+ <path d="M13.85 0a4.16 4.16 0 0 0-2.95 1.217L1.456 10.66a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l9.442-9.442a2.49 2.49 0 0 1 3.541 0 2.49 2.49 0 0 1 0 3.541L8.59 12.97l-.1.1a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l.1-.098 7.03-7.034a2.49 2.49 0 0 1 3.542 0l.049.05a2.49 2.49 0 0 1 0 3.54l-8.54 8.54a1.96 1.96 0 0 0 0 2.755l1.753 1.753a.835.835 0 0 0 1.18 0 .835.835 0 0 0 0-1.18l-1.753-1.753a.266.266 0 0 1 0-.394l8.54-8.54a4.185 4.185 0 0 0 0-5.9l-.05-.05a4.16 4.16 0 0 0-2.95-1.218c-.2 0-.401.02-.6.048a4.17 4.17 0 0 0-1.17-3.552A4.16 4.16 0 0 0 13.85 0m0 3.333a.84.84 0 0 0-.59.245L6.275 10.56a4.186 4.186 0 0 0 0 5.902 4.186 4.186 0 0 0 5.902 0L19.16 9.48a.835.835 0 0 0 0-1.18.835.835 0 0 0-1.18 0l-6.985 6.984a2.49 2.49 0 0 1-3.54 0 2.49 2.49 0 0 1 0-3.54l6.983-6.985a.835.835 0 0 0 0-1.18.84.84 0 0 0-.59-.245" />
+ </svg>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/extensions/primitives.tsx b/jarvis/ui/web/frontend/src/components/extensions/primitives.tsx
index 0a0edc6d1e..92b769a93c 100644
--- a/jarvis/ui/web/frontend/src/components/extensions/primitives.tsx
+++ b/jarvis/ui/web/frontend/src/components/extensions/primitives.tsx
@@ -39,7 +39,7 @@ export function PanelHeader({
return (
<div className={cn("flex items-start justify-between gap-4", className)}>
<div className="min-w-0">
- <h2 className="font-display text-[15px] font-semibold tracking-tight text-foreground">
+ <h2 className="font-display text-base font-semibold tracking-tight text-foreground">
{title}
</h2>
{subtitle ? (
@@ -288,7 +288,7 @@ export function TableHead({ columns }: { columns: Column[] }) {
return (
<div
role="row"
- className="grid items-center gap-x-4 border-b border-border px-3 py-2 text-xs text-muted-foreground"
+ className="grid items-center gap-x-5 border-b border-border px-3 py-2.5 text-[13px] text-muted-foreground"
style={{ gridTemplateColumns: gridTemplate(columns) }}
>
{columns.map((c) => (
@@ -299,10 +299,12 @@ export function TableHead({ columns }: { columns: Column[] }) {
"truncate",
c.align === "right" && "text-right",
c.align === "center" && "text-center",
- c.srOnly && "sr-only",
)}
>
- {c.label}
+ {/* The label stays for assistive tech, but the cell keeps its grid
+ track — an absolutely positioned header would shift every
+ header after it one column to the left. */}
+ {c.srOnly ? <span className="sr-only">{c.label}</span> : c.label}
</div>
))}
</div>
@@ -347,7 +349,7 @@ export function TableRow({
: undefined
}
className={cn(
- "group grid min-h-[44px] items-center gap-x-4 border-b border-border/70 px-3 py-2 transition-colors last:border-b-0",
+ "group grid min-h-[54px] items-center gap-x-5 border-b border-border/70 px-3 py-2.5 transition-colors last:border-b-0",
clickable &&
"cursor-pointer hover:bg-sheen/[0.05] focus:outline-none focus-visible:bg-sheen/[0.06]",
selected && "bg-sheen/[0.06]",
@@ -383,7 +385,7 @@ export function Cell({
"min-w-0",
align === "right" && "flex justify-end text-right",
align === "center" && "flex justify-center text-center",
- muted && "text-xs text-muted-foreground",
+ muted && "text-sm text-muted-foreground",
className,
)}
>
@@ -556,8 +558,8 @@ export function StatusDot({
busy: "bg-primary",
}[tone];
return (
- <span className="inline-flex items-center gap-2 text-xs text-muted-foreground">
- <span className={cn("h-1.5 w-1.5 shrink-0 rounded-full", color, pulse && "animate-pulse")} />
+ <span className="inline-flex items-center gap-2 text-sm text-muted-foreground">
+ <span className={cn("h-2 w-2 shrink-0 rounded-full", color, pulse && "animate-pulse")} />
<span className="truncate">{label}</span>
</span>
);
diff --git a/jarvis/ui/web/frontend/src/views/ExtensionsView.tsx b/jarvis/ui/web/frontend/src/views/ExtensionsView.tsx
index c1a52f6334..2ba210162d 100644
--- a/jarvis/ui/web/frontend/src/views/ExtensionsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/ExtensionsView.tsx
@@ -1,4 +1,6 @@
-import { Blocks, Cable, Sparkles, type LucideIcon } from "lucide-react";
+import { Blocks, ScrollText } from "lucide-react";
+import type { ComponentType, SVGProps } from "react";
+import { McpLogo } from "@/components/extensions/McpLogo";
import { useEventStore, type SectionId } from "@/store/events";
import { usePluginAttention } from "@/hooks/usePluginAttention";
import { useT } from "@/i18n";
@@ -31,13 +33,14 @@ import { McpsView } from "@/views/McpsView";
interface AreaSpec {
id: SectionId;
labelKey: string;
- icon: LucideIcon;
+ icon: ComponentType<SVGProps<SVGSVGElement>>;
}
const AREAS = [
- { id: "skills", labelKey: "nav.skills", icon: Sparkles },
+ { id: "skills", labelKey: "nav.skills", icon: ScrollText },
{ id: "plugins", labelKey: "nav.plugins", icon: Blocks },
- { id: "mcps", labelKey: "nav.mcps", icon: Cable },
+ // The official Model Context Protocol mark, not a generic plug.
+ { id: "mcps", labelKey: "nav.mcps", icon: McpLogo },
] as const satisfies readonly AreaSpec[];
type AreaId = (typeof AREAS)[number]["id"];
@@ -73,7 +76,7 @@ export function ExtensionsView() {
onClick={() => setActive(area.id)}
aria-current={isActive ? "page" : undefined}
className={cn(
- "flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors",
+ "flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-sm transition-colors",
isActive
? "bg-sheen/[0.08] font-medium text-foreground"
: "text-foreground/75 hover:bg-sheen/[0.05] hover:text-foreground",
diff --git a/jarvis/ui/web/frontend/src/views/McpsView.tsx b/jarvis/ui/web/frontend/src/views/McpsView.tsx
index be665f7612..66572b707d 100644
--- a/jarvis/ui/web/frontend/src/views/McpsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/McpsView.tsx
@@ -10,8 +10,8 @@ import {
MoreHorizontal,
Trash2,
Activity,
- Cable,
} from "lucide-react";
+import { McpLogo } from "@/components/extensions/McpLogo";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Switch } from "@/components/ui/switch";
import { Button } from "@/components/ui/button";
@@ -274,8 +274,8 @@ export function McpsView() {
// ---- List page ---------------------------------------------------------
const columns: Column[] = [
{ id: "name", label: t("mcps_view.col_server") },
- { id: "transport", label: t("mcps_view.col_transport"), width: "96px" },
- { id: "status", label: t("mcps_view.col_status"), width: "150px" },
+ { id: "transport", label: t("mcps_view.col_transport"), width: "110px" },
+ { id: "status", label: t("mcps_view.col_status"), width: "170px" },
{ id: "enabled", label: t("mcps_view.col_enabled"), width: "44px", srOnly: true, align: "right" },
];
@@ -383,22 +383,17 @@ export function McpsView() {
ariaLabel={s.name}
>
<Cell>
- <div className="flex items-center gap-2">
- <span className="truncate text-[13px] font-medium">{s.name}</span>
+ <div className="flex items-center gap-2" title={s.description}>
+ <span className="truncate text-[15px] font-medium">{s.name}</span>
{s.tools.length > 0 && (
- <span className="shrink-0 text-[11px] text-muted-foreground">
+ <span className="shrink-0 text-xs text-muted-foreground">
{toolCountLabel(s.tools.length, t)}
</span>
)}
</div>
- {s.description && (
- <p className="mt-0.5 truncate text-[11px] text-muted-foreground" title={s.description}>
- {s.description}
- </p>
- )}
</Cell>
<Cell muted>
- <span className="font-mono text-[11px]">{s.transport ?? "—"}</span>
+ <span className="font-mono text-xs">{s.transport ?? "—"}</span>
</Cell>
<Cell>
<span title={s.error ?? undefined}>
@@ -458,7 +453,7 @@ function McpDetail({
<DetailHeader
leading={
<span className="grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-border bg-sheen/[0.05]">
- <Cable className="h-4 w-4 text-muted-foreground" />
+ <McpLogo className="h-5 w-5 text-muted-foreground" />
</span>
}
title={server.name}
diff --git a/jarvis/ui/web/frontend/src/views/PluginsView.tsx b/jarvis/ui/web/frontend/src/views/PluginsView.tsx
index 6dfb309a81..be069531b3 100644
--- a/jarvis/ui/web/frontend/src/views/PluginsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/PluginsView.tsx
@@ -1124,8 +1124,8 @@ function PluginTable({
} & ConnectHandlers) {
const columns: Column[] = [
{ id: "plugin", label: translate("plugins_view.col_plugin") },
- { id: "category", label: translate("plugins_view.col_category"), width: "130px" },
- { id: "status", label: translate("plugins_view.col_status"), width: "170px" },
+ { id: "category", label: translate("plugins_view.col_category"), width: "150px" },
+ { id: "status", label: translate("plugins_view.col_status"), width: "180px" },
{ id: "action", label: translate("plugins_view.col_action"), width: "36px", srOnly: true, align: "right" },
];
@@ -1187,11 +1187,11 @@ function PluginTableRow({
ariaLabel={plugin.name}
>
<Cell>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3" title={plugin.description}>
<BrandTile plugin={plugin} size="sm" />
<div className="min-w-0">
- <div className="flex items-center gap-1.5">
- <span className="truncate text-[13px] font-medium">{plugin.name}</span>
+ <div className="flex items-center gap-2">
+ <span className="truncate text-[15px] font-medium">{plugin.name}</span>
{plugin.fromMarketplace && <MarketplaceBadge publisher={plugin.publisher} />}
{plugin.selfUploaded && (
<span
@@ -1202,13 +1202,11 @@ function PluginTableRow({
</span>
)}
</div>
- <p className="mt-0.5 truncate text-[11px] text-muted-foreground" title={plugin.description}>
- {plugin.status === "needs_reauth" ? (
+ {plugin.status === "needs_reauth" && (
+ <p className="mt-0.5 truncate text-xs">
<ReauthExplanation plugin={plugin} inline />
- ) : (
- plugin.description
- )}
- </p>
+ </p>
+ )}
</div>
</div>
</Cell>
diff --git a/jarvis/ui/web/frontend/src/views/SkillsView.tsx b/jarvis/ui/web/frontend/src/views/SkillsView.tsx
index 13f3dacd63..ea1d0e8a7c 100644
--- a/jarvis/ui/web/frontend/src/views/SkillsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/SkillsView.tsx
@@ -65,6 +65,7 @@ import {
import { cn } from "@/lib/utils";
import { robustCopy } from "@/lib/clipboard";
import { fill, translate, useT, useUiLanguage } from "@/i18n";
+import { PRODUCT_NAME } from "@/lib/branding";
import {
useSkillsList,
useSkillDetail,
@@ -126,9 +127,11 @@ function isBrokenDraft(skill: {
return skill.state === "draft" && Boolean(skill.error);
}
-/** "You" / "Built-in" / the marketplace publisher — the Author column. */
+/** "You" / the product / the marketplace publisher — the Author column.
+ * A shipped skill is authored by the product, the way a vendor's name sits in
+ * that column elsewhere; "Built-in" said where it lives, not who wrote it. */
function authorLabel(skill: Pick<SkillSummary, "is_builtin" | "origin">): string {
- if (skill.is_builtin) return translate("skills_view.author_builtin");
+ if (skill.is_builtin) return PRODUCT_NAME;
if (skill.origin?.source === "marketplace") {
return skill.origin.publisher || translate("marketplace_origin.badge");
}
@@ -365,15 +368,20 @@ export function SkillsView() {
? [{ id: "check", label: t("skills_view.select"), width: "20px", srOnly: true }]
: []),
{ id: "name", label: t("skills_view.col_skill") },
- { id: "updated", label: t("skills_view.col_updated"), width: "110px" },
- { id: "author", label: t("skills_view.col_author"), width: "130px" },
+ { id: "updated", label: t("skills_view.col_updated"), width: "130px" },
+ { id: "author", label: t("skills_view.col_author"), width: "160px" },
{ id: "enabled", label: t("skills_view.col_enabled"), width: "44px", srOnly: true, align: "right" },
{ id: "actions", label: t("skills_view.col_actions"), width: "28px", srOnly: true, align: "right" },
];
+ // Selection exists to delete in bulk, and only the owner's skills can be
+ // deleted — so the selection view lists just those, instead of a page of
+ // dimmed built-ins with two tickable rows at the bottom.
const rows: (SkillSummary | LocalSkillHit)[] = searchActive
? (search.data?.skills ?? [])
- : items;
+ : selectionMode
+ ? items.filter((s) => !s.is_builtin)
+ : items;
const countLabel = fill(t("skills_view.count"), { n: items.length });
@@ -393,7 +401,7 @@ export function SkillsView() {
>
<Search className="h-4 w-4" />
</IconButton>
- {!searchActive && items.length > 0 && (
+ {!searchActive && deletableNames.length > 0 && (
<IconButton
label={selectionMode ? t("skills_view.delete_cancel") : t("skills_view.select")}
active={selectionMode}
@@ -604,7 +612,7 @@ function SkillRow({
<TableRow
columns={columns}
onClick={selectionMode ? (selectable ? onCheckChange : undefined) : onOpen}
- className={cn(selectionMode && skill.is_builtin && "opacity-50")}
+ className={cn(selectionMode && skill.is_builtin && "opacity-60")}
selected={checked}
ariaLabel={skill.name}
>
@@ -622,23 +630,18 @@ function SkillRow({
</Cell>
)}
<Cell>
- <div className="flex items-center gap-1.5">
- <span className="truncate text-[13px] font-medium">{skill.name}</span>
- {skill.is_builtin && (
- <Lock className="h-3 w-3 shrink-0 text-muted-foreground/70" aria-label={t("skills_view.author_builtin")} />
- )}
+ <div className="flex items-center gap-2" title={skill.description}>
+ <span className="truncate text-[15px] font-medium">{skill.name}</span>
{skill.origin?.source === "marketplace" && (
<MarketplaceBadge compact publisher={skill.origin.publisher} />
)}
{skill.triggers.map((tr, i) => {
const Icon = TRIGGER_ICON[tr.type];
- return <Icon key={i} className="h-3 w-3 shrink-0 text-muted-foreground/60" aria-label={tr.type} />;
+ return <Icon key={i} className="h-3.5 w-3.5 shrink-0 text-muted-foreground/50" aria-label={tr.type} />;
})}
</div>
- {(skill.description || reason) && (
- <p className="mt-0.5 truncate text-[11px] text-muted-foreground" title={skill.description}>
- {reason ? <span className="italic">{reason}</span> : skill.description}
- </p>
+ {reason && (
+ <p className="mt-0.5 truncate text-xs italic text-muted-foreground">{reason}</p>
)}
</Cell>
<Cell muted>{formatShortDate(skill.updated_at, locale)}</Cell>
@@ -755,6 +758,9 @@ function SelectionToolbar({
>
{t("skills_view.select_all")}
</button>
+ <span className="ml-3 hidden text-xs text-muted-foreground sm:inline">
+ {t("skills_view.select_hint")}
+ </span>
<span className="ml-auto text-xs text-muted-foreground">
{checkedCount} {t("skills_view.selected")}
</span>
diff --git a/tests/unit/skills/test_finder.py b/tests/unit/skills/test_finder.py
index 13bb4930f5..6390cade6b 100644
--- a/tests/unit/skills/test_finder.py
+++ b/tests/unit/skills/test_finder.py
@@ -212,6 +212,83 @@ async def test_search_mit_trust_filter(monkeypatch, sample_entries):
assert all(c.trust == "official" for c in result)
+async def test_search_query_without_text_match_returns_empty(
+ monkeypatch, sample_entries
+):
+ """A query that matches no entry text must NOT fall back to a page of
+ filter-only hits ("Trust match (official) · Score 0.03")."""
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ finder = SkillFinder(brain=None)
+ result = await finder.search(
+ SearchFilters(query="PDf", trust="official", min_stars=500, limit=10)
+ )
+ assert result == []
+
+ # Same without any filter: still nothing matches "pdf" in the sample set
+ assert await finder.search(SearchFilters(query="PDf", limit=10)) == []
+
+
+async def test_search_drops_filter_only_entries_when_query_matches_some(
+ monkeypatch, sample_entries
+):
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ result = await SkillFinder(brain=None).search(
+ SearchFilters(query="docker", limit=10)
+ )
+ assert [c.name for c in result] == ["docker-helper"]
+ assert not any("Trust match" in c.reason for c in result)
+
+
+async def test_search_tag_match_is_case_insensitive_and_names_the_tag(
+ monkeypatch, sample_entries
+):
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ result = await SkillFinder(brain=None).search(
+ SearchFilters(query="GMail", limit=10)
+ )
+ assert result[0].name == "email-triage"
+ assert "tag: gmail" in result[0].reason
+ assert "Trust match" not in result[0].reason
+
+
+async def test_search_empty_query_browses_by_filters_only(
+ monkeypatch, sample_entries
+):
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ result = await SkillFinder(brain=None).search(
+ SearchFilters(query="", trust="official", limit=10)
+ )
+ assert [c.name for c in result] == ["skill-creator"]
+ assert result[0].reason == "Trust match (official)"
+
+
+async def test_search_punctuation_only_query_returns_empty(
+ monkeypatch, sample_entries
+):
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ assert await SkillFinder(brain=None).search(SearchFilters(query="???")) == []
+
+
# ----------------------------------------------------------------------
# Brain-Ranking-Integration
# ----------------------------------------------------------------------
@@ -249,6 +326,30 @@ async def test_search_nutzt_brain_ranking(monkeypatch, sample_entries):
assert "Perfect match" in result[0].reason
+async def test_brain_cannot_resurrect_non_matching_entries(
+ monkeypatch, sample_entries
+):
+ """The brain re-ranks textual matches only — a high brain score for an
+ entry the query text rejected must not bring it back."""
+ from jarvis.skills import catalog
+
+ monkeypatch.setattr(catalog, "load_catalog", lambda: sample_entries)
+
+ fake = _FakeBrain(json.dumps([
+ {"name": "email-triage", "score": 0.99, "reason": "brain likes it"},
+ {"name": "docker-helper", "score": 0.5, "reason": "docker"},
+ ]))
+ result = await SkillFinder(brain=fake).search(
+ SearchFilters(query="docker", limit=10)
+ )
+ assert [c.name for c in result] == ["docker-helper"]
+ # With nothing matching, the brain is not even consulted
+ fake.call_count = 0
+ assert await SkillFinder(brain=fake).search(SearchFilters(query="PDf")) == []
+ assert fake.call_count == 0
+
+
@pytest.mark.asyncio
async def test_search_faellt_auf_heuristik_bei_brain_fehler( # i18n-allow: identifier name, not translatable prose
monkeypatch, sample_entries