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.

feat(chat): show original logos and one row per connected plugin

rubenluetke10-beepa676cd6a1cae
diff --git a/jarvis/agent_chat/tool_catalog.py b/jarvis/agent_chat/tool_catalog.py
index 2423e30bd0..24ceb0da1e 100644
--- a/jarvis/agent_chat/tool_catalog.py
+++ b/jarvis/agent_chat/tool_catalog.py
@@ -53,17 +53,34 @@ def category_for(name: str) -> Category:
return "system"
+def _plugin_owned_skill(slug: str, plugin_ids: set[str]) -> bool:
+ """True when a skill is the bundled companion of a marketplace plugin."""
+ text = (slug or "").strip().lower().replace("_", "-")
+ if not text:
+ return False
+ if text.startswith("plugin-"):
+ rest = text[7:].replace("-", "_")
+ return rest in plugin_ids or text[7:] in {pid.replace("_", "-") for pid in plugin_ids}
+ return text.replace("-", "_") in plugin_ids
+
+
def build_catalog(
tools: Mapping[str, Tool],
plugins: Iterable[Any] = (),
skills: Iterable[Any] = (),
connected_plugins: set[str] | None = None,
) -> list[ToolChoice]:
- """One plugin/server row plus every individual operation, without duplicates."""
+ """One row per connector, leftover MCP server, CLI and standalone skill.
+
+ Selecting a plugin already hands every tool behind it, so individual
+ operations and ``plugin-*`` skills stay off the picker.
+ """
rows: list[ToolChoice] = []
owned: set[str] = set()
+ plugin_list = list(plugins)
+ plugin_ids = {spec.id for spec in plugin_list}
usable = {n: t for n, t in tools.items() if str(getattr(t, "risk_tier", "")) != "block"}
- for spec in plugins:
+ for spec in plugin_list:
names = tuple(n for n in usable if n.startswith(spec.id + "/") or n == spec.native_tool)
available = bool(names) and (
connected_plugins is None
@@ -82,23 +99,7 @@ def build_catalog(
tool_names=names,
)
)
- for name in names:
- owned.add(name)
- # A native tool already is the plugin's only operation.
- if "/" not in name:
- continue
- rows.append(
- ToolChoice(
- id=f"tool:{name}",
- label=name.split("/", 1)[1],
- description=str(usable[name].description),
- category="plugins",
- group=spec.display_name,
- brand=spec.id,
- available=available,
- tool_names=(name,),
- )
- )
+ owned.update(names)
servers: dict[str, list[str]] = {}
for name, tool in usable.items():
if name in owned:
@@ -134,6 +135,9 @@ def build_catalog(
)
)
for skill in skills:
+ slug = str(getattr(skill, "value", "") or "")
+ if _plugin_owned_skill(slug, plugin_ids):
+ continue
rows.append(
ToolChoice(
id=f"skill:{skill.value}",
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.test.tsx b/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.test.tsx
index 6c9468f2a7..e0ba3285ad 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.test.tsx
@@ -87,13 +87,39 @@ describe("Add menu", () => {
expect(document.activeElement).toBe(screen.getByTestId("composer-add"));
});
- it("opens setup for unavailable plugins without selecting them", async () => {
+ it("opens setup for unavailable plugins once they are searched for", async () => {
const { connect } = setup();
- fireEvent.click(await screen.findByRole("button", { name: /Offline Read your inbox/ }));
+ await screen.findByRole("button", { name: /Gmail Read your inbox/ });
+ expect(screen.queryByRole("button", { name: /Offline Read your inbox/ })).toBeNull();
+ fireEvent.change(screen.getByLabelText("chat_tools.search"), {
+ target: { value: "Offline" },
+ });
+ fireEvent.click(
+ await screen.findByRole("button", { name: /Offline Read your inbox/ }, { timeout: 2000 }),
+ );
expect(connect).toHaveBeenCalledOnce();
expect(screen.queryByTestId("tool-choice-chips")).toBeNull();
});
+ it("lists the connected plugin, not its commands or bundled skill", async () => {
+ setup([
+ gmail,
+ { ...gmail, id: "tool:gmail/send", label: "send", description: "Send a message" },
+ {
+ ...gmail,
+ id: "skill:plugin-gmail",
+ label: "plugin-gmail",
+ category: "skills",
+ group: "skills",
+ skill: "plugin-gmail",
+ description: "Use Gmail",
+ },
+ ]);
+ expect(await screen.findByRole("button", { name: /Gmail Read your inbox/ })).toBeTruthy();
+ expect(screen.queryByRole("button", { name: /send Send a message/ })).toBeNull();
+ expect(screen.queryByText("plugin-gmail")).toBeNull();
+ });
+
it("forwards category and natural-language query to the server", async () => {
setup();
await screen.findByRole("button", { name: /Gmail Read your inbox/ });
@@ -133,11 +159,13 @@ describe("Add menu", () => {
const fetcher = vi.fn<typeof fetch>(async () => new Response('{"turn_id":"turn"}'));
vi.stubGlobal("fetch", fetcher);
await sendAgentChatMessage("session", "Read it", [], [gmail.id]);
- expect(JSON.parse(String(fetcher.mock.calls[0][1]?.body))).toEqual({
- text: "Read it",
- attachments: [],
- tool_choices: ["plugin:gmail"],
- });
+ expect(JSON.parse(String(fetcher.mock.calls[0][1]?.body))).toEqual(
+ expect.objectContaining({
+ text: "Read it",
+ attachments: [],
+ tool_choices: ["plugin:gmail"],
+ }),
+ );
expect(readToolChoices(undefined)).toEqual([]);
expect(readToolChoices([gmail, { id: "invalid" }])).toEqual([gmail]);
});
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.tsx b/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.tsx
index fffbd61767..a32cb58a6f 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentchat/ComposerAddMenu.tsx
@@ -7,6 +7,7 @@ import { BrandedSelect } from "@/components/ui/select";
import { ToolChoiceIcon } from "./ToolChoiceChips";
import { CATEGORY_ICONS, toolIdentityStyle } from "./toolIdentity";
import {
+ browseToolRows,
searchTools,
TOOL_CATEGORIES,
type ToolChoice,
@@ -126,13 +127,14 @@ export function ComposerAddMenu({
};
}, [open, provider, model, cwd, stance, query, category, retry]);
+ const visible = browseToolRows(result?.items ?? [], query);
const groups = new Map<string, ToolChoice[]>();
const operationGroups = new Set(
- (result?.items ?? [])
- .filter((row) => row.id.startsWith("tool:") && ["plugins", "mcp"].includes(row.category))
+ visible
+ .filter((row) => row.id.startsWith("tool:") && row.category === "mcp")
.map((row) => `${row.category}:${row.group}`),
);
- for (const row of result?.items ?? []) {
+ for (const row of visible) {
const subgroup = `${row.category}:${row.group}`;
const key = operationGroups.has(subgroup) ? subgroup : row.category;
groups.set(key, [...(groups.get(key) ?? []), row]);
@@ -260,7 +262,7 @@ export function ComposerAddMenu({
className="ml-auto h-4 w-4 animate-spin"
/>
) : result ? (
- `${result.items.length} · ${t(`chat_tools.${result.mode}`)}`
+ `${visible.length} · ${t(`chat_tools.${result.mode}`)}`
) : (
""
)}
@@ -301,7 +303,7 @@ export function ComposerAddMenu({
</button>
</div>
)}
- {!loading && !failed && result?.items.length === 0 && (
+ {!loading && !failed && visible.length === 0 && (
<p className="p-3 text-sm text-muted-foreground">{t("chat_tools.empty")}</p>
)}
{[...groups].map(([key, rows]) => (
@@ -335,7 +337,9 @@ export function ComposerAddMenu({
!row.available && "opacity-60",
)}
>
- <ToolChoiceIcon row={row} size={22} />
+ <span className="inline-flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-background">
+ <ToolChoiceIcon row={row} size={20} />
+ </span>
<span className="min-w-0 flex-1">
<span className="tool-picker-name block truncate text-sm font-medium">
{row.label}
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/toolChoices.ts b/jarvis/ui/web/frontend/src/components/agentchat/toolChoices.ts
index 2b59cac85f..60bdd787b9 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/toolChoices.ts
+++ b/jarvis/ui/web/frontend/src/components/agentchat/toolChoices.ts
@@ -1,3 +1,5 @@
+import { isPluginOwnedSkill } from "@/lib/pluginFamilies";
+
/** Mirrors the composer catalog's Pydantic model; selections send IDs only. */
export type ToolCategory =
"plugins" | "skills" | "mcp" | "memory" | "web" | "files" | "automation" | "system" | "cli";
@@ -40,6 +42,20 @@ export async function searchTools(
return res.json();
}
+/**
+ * The Add menu lists connectors, not the skills and commands behind them.
+ * Disconnected plugins stay hidden until someone searches for them.
+ */
+export function browseToolRows(items: ToolChoice[], query = ""): ToolChoice[] {
+ const searching = Boolean(query.trim());
+ return items.filter((row) => {
+ if (row.category === "plugins" && row.id.startsWith("tool:")) return false;
+ if (row.category === "plugins" && !row.available && !searching) return false;
+ if (row.category === "skills" && isPluginOwnedSkill(row.skill || row.label || row.id)) return false;
+ return true;
+ });
+}
+
/** Old events have no selections. Discard malformed receipts. */
export function readToolChoices(value: unknown): ToolChoice[] {
if (!Array.isArray(value)) return [];
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.test.tsx b/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.test.tsx
index 6b8c44eb2d..69b8bfffb2 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.test.tsx
@@ -29,6 +29,9 @@ describe("tool visual identities", () => {
["skill:google-drive:sheets", "skills", "google_drive"],
["tool:cli_gh", "cli", "github"],
["tool:cli_codex", "cli", "openai"],
+ ["cli:kubectl", "cli", "kubernetes"],
+ ["cli:gcloud", "cli", "google-cloud"],
+ ["cli:az", "cli", "azure"],
["skill:figma:design", "skills", "figma"],
["mcp:postgres-server", "mcp", "postgresql"],
])("resolves %s to the original %s identity", (id, category, brand) => {
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.ts b/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.ts
index 504a650971..7eb469fb5a 100644
--- a/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.ts
+++ b/jarvis/ui/web/frontend/src/components/agentchat/toolIdentity.ts
@@ -27,6 +27,7 @@ import {
Wrench,
} from "lucide-react";
import { McpLogo } from "@/components/extensions/McpLogo";
+import { CLI_VENDOR_LOGOS, cliVendor } from "@/lib/cliVendors";
import type { ToolCategory, ToolChoice } from "./toolChoices";
type Palette = readonly [string, string];
@@ -66,12 +67,24 @@ const BRANDS: Record<string, Brand> = {
telegram: { palette: BLUE },
todoist: { palette: ["#b12d27", "#ff9c92"] },
vercel: { palette: NEUTRAL, mark: "mono" },
- youtube_music: { palette: ["#bb2424", "#ff9494"], aliases: ["youtube-music", "ytmusic"] },
+ youtube_music: { palette: ["#bb2424", "#ff9494"], aliases: ["youtube-music", "ytmusic", "youtube"] },
stripe: { palette: VIOLET, mark: "mono" },
cloudflare: { palette: ["#a84c14", "#ffb276"], mark: "mono", aliases: ["wrangler"] },
figma: { palette: ["#9c3a28", "#ffa18e"], mark: "mono" },
- gitlab: { palette: ["#a8441a", "#ffad83"], mark: "mono" },
- docker: { palette: BLUE, mark: "mono" },
+ gitlab: { palette: ["#a8441a", "#ffad83"], mark: "mono", aliases: ["glab"] },
+ docker: { palette: BLUE, mark: "colour" },
+ aws: { palette: ["#a15b00", "#f0b429"], mark: "mono" },
+ azure: { palette: BLUE, aliases: ["az"] },
+ firebase: { palette: ["#b45309", "#ffb74d"] },
+ fly: { palette: VIOLET, aliases: ["flyctl"] },
+ heroku: { palette: VIOLET },
+ kubernetes: { palette: BLUE, aliases: ["kubectl"] },
+ neon: { palette: GREEN, aliases: ["neonctl"] },
+ netlify: { palette: GREEN },
+ planetscale: { palette: NEUTRAL, mark: "mono", aliases: ["pscale"] },
+ railway: { palette: VIOLET, mark: "mono" },
+ render: { palette: GREEN, mark: "mono" },
+ twilio: { palette: ["#b3261e", "#ff938a"] },
n8n: { palette: ["#b43351", "#f69ab1"], mark: "mono" },
postgresql: { palette: BLUE, aliases: ["postgres"] },
obsidian: { palette: VIOLET, mark: "mono" },
@@ -100,24 +113,30 @@ const BRANDS: Record<string, Brand> = {
zai: { palette: NEUTRAL, asset: "/agent-logos/zai.svg", aliases: ["glm", "z.ai"] },
};
-const assets = import.meta.glob("../../assets/{brands,providers,tool-brands}/*.{svg,png}", {
+const assets = import.meta.glob("../../assets/{brands,providers,tool-brands,clis}/*.{svg,png}", {
eager: true,
query: "?url",
import: "default",
}) as Record<string, string>;
-function assetFor(key: string): string | undefined {
+function assetFor(key: string, preferCli = false): string | undefined {
+ const cliFile = CLI_VENDOR_LOGOS[key]?.file ?? `${key}.svg`;
+ const cli = assets[`../../assets/clis/${cliFile}`] || assets[`../../assets/clis/${key}.svg`];
+ if (preferCli && cli) return cli;
return (
BRANDS[key]?.asset ||
assets[`../../assets/brands/${key}.svg`] ||
assets[`../../assets/tool-brands/${key}.svg`] ||
assets[`../../assets/providers/${key}.svg`] ||
- assets[`../../assets/providers/${key}.png`]
+ assets[`../../assets/providers/${key}.png`] ||
+ cli
);
}
const normalize = (value: string) => value.toLowerCase().replace(/[^a-z0-9]/g, "");
-const bundledKeys = Object.keys(assets).map((path) => path.split("/").pop()!.replace(/\.(svg|png)$/, ""));
+const bundledKeys = Object.keys(assets)
+ .filter((path) => !path.includes("/clis/"))
+ .map((path) => path.split("/").pop()!.replace(/\.(svg|png)$/, ""));
const aliases = [...new Set([...Object.keys(BRANDS), ...bundledKeys])]
.flatMap((key) =>
[key, ...(BRANDS[key]?.aliases ?? [])].map((alias) => ({ key, alias: alias.replace(/[_. ]/g, "-") })),
@@ -186,9 +205,15 @@ const DETAIL_ICONS = [
] as const;
export function toolIdentity(row: ToolChoice) {
+ const cliName = [row.brand, row.label, row.id.replace(/^(cli:|tool:|plugin:)/, "")]
+ .map((value) => cliVendor(value || ""))
+ .find(Boolean);
+ const preferCli = row.category === "cli" || row.id.startsWith("cli:") || Boolean(cliName);
const key =
+ (preferCli ? cliName : undefined) ||
(row.brand && brandFor(row.brand)) ||
- [row.id, row.group, row.skill, row.label].map((s) => brandFor(s || "")).find(Boolean);
+ [row.id, row.group, row.skill, row.label].map((s) => brandFor(s || "")).find(Boolean) ||
+ cliName;
const brand = key ? BRANDS[key] : undefined;
const palette = brand?.palette ?? CATEGORY_PALETTES[row.category];
const words = `${row.id} ${row.skill} ${row.label}`.toLowerCase().replace(/[_:-]/g, " ");
@@ -197,10 +222,11 @@ export function toolIdentity(row: ToolChoice) {
? McpLogo
: (DETAIL_ICONS.find(([pattern]) => pattern.test(words))?.[1] ??
CATEGORY_ICONS[row.category]);
+ const mark = preferCli && key && CLI_VENDOR_LOGOS[key] ? CLI_VENDOR_LOGOS[key].render : (brand?.mark ?? "colour");
return {
key,
- logo: key ? assetFor(key) : undefined,
- mark: brand?.mark ?? "colour",
+ logo: key ? assetFor(key, preferCli) : undefined,
+ mark,
palette,
Glyph,
};
diff --git a/jarvis/ui/web/frontend/src/components/clis/CliLogo.tsx b/jarvis/ui/web/frontend/src/components/clis/CliLogo.tsx
index 6bb5629f26..45f83e89c1 100644
--- a/jarvis/ui/web/frontend/src/components/clis/CliLogo.tsx
+++ b/jarvis/ui/web/frontend/src/components/clis/CliLogo.tsx
@@ -10,8 +10,11 @@ import {
} from "lucide-react";
import type { ComponentType, SVGProps } from "react";
+import { CLI_VENDOR_LOGOS, cliVendor } from "@/lib/cliVendors";
import { cn } from "@/lib/utils";
+export { cliVendor };
+
/**
* The vendor mark on a CLI row.
*
@@ -26,69 +29,6 @@ import { cn } from "@/lib/utils";
* glyph drawn as a CSS mask over the current text ink, so it follows the theme
* by itself instead of needing a light and a dark asset.
*/
-type Render = "colour" | "mono";
-
-interface VendorLogo {
- file: string;
- render: Render;
-}
-
-const CLI_VENDOR_LOGOS: Record<string, VendorLogo> = {
- aws: { file: "aws.svg", render: "mono" },
- azure: { file: "azure.svg", render: "colour" },
- cloudflare: { file: "cloudflare.svg", render: "mono" },
- docker: { file: "docker.svg", render: "colour" },
- firebase: { file: "firebase.svg", render: "colour" },
- fly: { file: "fly.svg", render: "colour" },
- github: { file: "github.svg", render: "mono" },
- gitlab: { file: "gitlab.svg", render: "colour" },
- google: { file: "google.svg", render: "colour" },
- "google-cloud": { file: "google-cloud.svg", render: "colour" },
- heroku: { file: "heroku.svg", render: "colour" },
- kubernetes: { file: "kubernetes.svg", render: "colour" },
- neon: { file: "neon.svg", render: "colour" },
- netlify: { file: "netlify.svg", render: "colour" },
- planetscale: { file: "planetscale.svg", render: "mono" },
- railway: { file: "railway.svg", render: "mono" },
- render: { file: "render.svg", render: "mono" },
- stripe: { file: "stripe.svg", render: "mono" },
- supabase: { file: "supabase.svg", render: "colour" },
- twilio: { file: "twilio.svg", render: "colour" },
- vercel: { file: "vercel.svg", render: "mono" },
-};
-
-/**
- * Catalog CLI name -> vendor.
- *
- * Exact names, not substrings: `render` the vendor and `render` the binary
- * happen to match, but `gh` and `glab` share no letters with their companies,
- * and a substring rule would make `gws` a Google Cloud tool. Custom CLIs a
- * user registers land on the category glyph, which is the honest answer for a
- * binary this project has never heard of.
- */
-const CLI_VENDORS: Record<string, string> = {
- aws: "aws",
- az: "azure",
- docker: "docker",
- firebase: "firebase",
- flyctl: "fly",
- gcloud: "google-cloud",
- gh: "github",
- glab: "gitlab",
- gws: "google",
- heroku: "heroku",
- kubectl: "kubernetes",
- neonctl: "neon",
- netlify: "netlify",
- pscale: "planetscale",
- railway: "railway",
- render: "render",
- stripe: "stripe",
- supabase: "supabase",
- twilio: "twilio",
- vercel: "vercel",
- wrangler: "cloudflare",
-};
/** The glyph a CLI falls back to: what kind of thing it drives. */
const CATEGORY_GLYPHS: Record<string, ComponentType<SVGProps<SVGSVGElement>>> = {
@@ -112,10 +52,6 @@ const BUNDLED = import.meta.glob("../../assets/clis/*.svg", {
import: "default",
}) as Record<string, string>;
-export function cliVendor(cliName: string): string | null {
- return CLI_VENDORS[cliName.toLowerCase()] ?? null;
-}
-
export function CategoryGlyph({
category,
className,
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.test.tsx b/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.test.tsx
index 996768a356..7deb0d3e83 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.test.tsx
@@ -29,8 +29,8 @@ describe("MentionPicker", () => {
[],
[
cap({ id: "plugin:gmail", label: "gmail", one_liner: "Read and send mail." }),
- cap({ id: "mcp:github/create_issue" }),
- cap({ id: "mcp:github/list_issues" }),
+ cap({ id: "mcp:sentry/create_issue" }),
+ cap({ id: "mcp:sentry/list_issues" }),
cap({ id: "core:search-web", label: "search-web" }),
],
),
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.tsx b/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.tsx
index 955c320727..0107a68830 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/chat/MentionPicker.tsx
@@ -140,7 +140,7 @@ export function MentionPicker({
onClick={() => onPick(item)}
className={cn(
!item.agent && "tool-identity",
- "flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5",
+ "flex cursor-pointer items-center gap-3 rounded-xl px-2 py-2",
active ? "bg-secondary text-foreground" : "text-foreground",
!item.connected && "opacity-50",
)}
@@ -148,26 +148,19 @@ export function MentionPicker({
<Mark item={item} />
<span className="min-w-0 flex-1">
<span className="flex items-baseline gap-1.5">
- <span className="font-mono text-meta">
- <span className="text-muted-foreground">@</span>
- {item.value}
+ <span className="truncate text-sm font-medium text-foreground">{item.label}</span>
+ <span className="shrink-0 font-mono text-micro text-muted-foreground">
+ @{item.value}
</span>
- {item.label.toLowerCase() !== item.value.toLowerCase() ? (
- <span className="truncate text-xs text-foreground">{item.label}</span>
- ) : null}
</span>
{item.hint ? (
- <span className="block truncate text-xs text-muted-foreground">{item.hint}</span>
+ <span className="mt-0.5 block truncate text-xs text-muted-foreground">{item.hint}</span>
) : null}
</span>
{!item.connected ? (
<span className="shrink-0 text-micro text-muted-foreground">
{t("society.chat.mention_disconnected")}
</span>
- ) : item.kind === "mcp" && !item.detail && item.pinIds.length > 1 ? (
- <span className="shrink-0 font-mono text-micro text-muted-foreground">
- {item.pinIds.length}
- </span>
) : null}
</div>
);
@@ -201,7 +194,11 @@ function groupLabel(group: MentionGroup, t: (key: string) => string): string {
function Mark({ item }: { item: MentionItem }) {
if (item.agent) {
- return <AgentSwatch agent={item.agent} size={20} className="h-5 w-5" />;
+ return <AgentSwatch agent={item.agent} size={28} className="h-7 w-7 rounded-lg" />;
}
- return <ToolChoiceIcon row={mentionChoice(item)} />;
+ return (
+ <span className="inline-flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-background">
+ <ToolChoiceIcon row={mentionChoice(item)} size={18} />
+ </span>
+ );
}
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/mentionChoices.ts b/jarvis/ui/web/frontend/src/components/society/chat/mentionChoices.ts
index d1d0b3b55d..b9462ef2e9 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/mentionChoices.ts
+++ b/jarvis/ui/web/frontend/src/components/society/chat/mentionChoices.ts
@@ -1,5 +1,6 @@
/** Presentation adapter for the agent cards' existing capability-pin protocol. */
import type { ToolChoice, ToolCategory } from "@/components/agentchat/toolChoices";
+import { pluginFamily } from "@/lib/pluginFamilies";
import { resolveToolBrand } from "@/lib/toolBrand";
import type { MentionItem } from "./mentionItems";
@@ -31,8 +32,13 @@ function choice(id: string, name: string, description = ""): ToolChoice {
}
export function mentionChoice(item: MentionItem): ToolChoice {
+ const family = item.kind === "plugin" ? pluginFamily(item.toolName) ?? pluginFamily(item.key.replace(/^plugin:/, "")) : undefined;
+ const base = choice(item.key, item.toolName || item.value, item.hint);
return {
- ...choice(item.key, item.toolName || item.value, item.hint),
+ ...base,
+ label: item.label || base.label,
+ brand: family?.id || base.brand,
+ category: item.kind === "plugin" ? "plugins" : item.kind === "cli" ? "cli" : base.category,
available: item.connected,
tool_names: [item.toolName].filter(Boolean),
};
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.test.ts b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.test.ts
index c1f9bfdd31..728cd373bc 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.test.ts
@@ -61,6 +61,7 @@ describe("buildMentionCatalog", () => {
expect(items).toEqual([
expect.objectContaining({
value: "gmail",
+ label: "Gmail",
kind: "plugin",
group: "plugins",
pinIds: ["plugin:gmail"],
@@ -69,22 +70,76 @@ describe("buildMentionCatalog", () => {
]);
});
- it("collapses an MCP server to one browse row and keeps the tools as detail", () => {
+ it("folds a connector's MCP tools and bundled skill into one plugin row", () => {
const items = buildMentionCatalog(
[],
[
cap({ id: "mcp:github/create_issue", label: "create_issue", one_liner: "Open an issue." }),
cap({ id: "mcp:github/list_issues", label: "list_issues" }),
- cap({ id: "mcp:sentry/list_issues", label: "list_issues", tool_name: "sentry/list_issues" }),
+ cap({ id: "skill:plugin-github", label: "plugin-github", kind: "skill" }),
+ cap({
+ id: "plugin:agentic-ide-close-agent-terminals",
+ label: "agentic-ide-close-agent-terminals",
+ one_liner: "Stop a coding terminal.",
+ }),
+ ],
+ );
+ expect(items.map((i) => i.value)).toEqual(["github"]);
+ const github = items.find((i) => i.key === "plugin:github")!;
+ expect(github.label).toBe("GitHub");
+ expect(github.group).toBe("plugins");
+ expect(github.pinIds).toEqual([
+ "mcp:github/create_issue",
+ "mcp:github/list_issues",
+ "skill:plugin-github",
+ ]);
+ expect(items.some((i) => i.kind === "skill")).toBe(false);
+ expect(items.some((i) => i.value.includes("agentic-ide"))).toBe(false);
+ });
+
+ it("collapses a non-marketplace MCP server to one browse row and keeps the tools as detail", () => {
+ const items = buildMentionCatalog(
+ [],
+ [
+ cap({ id: "mcp:sentry/list_issues", label: "list_issues", one_liner: "List issues." }),
+ cap({ id: "mcp:sentry/create_issue", label: "create_issue" }),
],
);
const browse = items.filter((i) => !i.detail);
- expect(browse.map((i) => i.value).sort()).toEqual(["github", "sentry"]);
- const github = items.find((i) => i.key === "mcp-server:github")!;
- expect(github.pinIds).toEqual(["mcp:github/create_issue", "mcp:github/list_issues"]);
+ expect(browse.map((i) => i.value)).toEqual(["sentry"]);
+ const sentry = items.find((i) => i.key === "mcp-server:sentry")!;
+ expect(sentry.pinIds).toEqual(["mcp:sentry/list_issues", "mcp:sentry/create_issue"]);
expect(items.filter((i) => i.detail).map((i) => i.value)).toEqual([
- "github/create_issue",
- "github/list_issues",
+ "sentry/list_issues",
+ "sentry/create_issue",
+ ]);
+ });
+
+ it("shows YouTube Music once, with its skill folded in", () => {
+ const items = buildMentionCatalog(
+ [],
+ [
+ cap({
+ id: "plugin:youtube_music",
+ label: "youtube_music",
+ one_liner: "Play a song.",
+ }),
+ cap({
+ id: "skill:plugin-youtube_music",
+ kind: "skill",
+ label: "plugin-youtube_music",
+ one_liner: "Control YouTube Music.",
+ }),
+ ],
+ );
+ expect(items).toEqual([
+ expect.objectContaining({
+ key: "plugin:youtube_music",
+ value: "youtube-music",
+ label: "YouTube Music",
+ group: "plugins",
+ pinIds: ["plugin:youtube_music", "skill:plugin-youtube_music"],
+ }),
]);
});
@@ -106,6 +161,8 @@ describe("filterMentions", () => {
cap({ id: "plugin:notion", label: "notion", connected: false }),
cap({ id: "mcp:github/create_issue", label: "create_issue" }),
cap({ id: "mcp:github/list_issues", label: "list_issues" }),
+ cap({ id: "mcp:sentry/create_issue", label: "create_issue" }),
+ cap({ id: "mcp:sentry/list_issues", label: "list_issues" }),
cap({ id: "core:search-web", label: "search-web", one_liner: "Search the web." }),
cap({ id: "cli:gh", label: "gh" }),
],
@@ -113,9 +170,10 @@ describe("filterMentions", () => {
it("on a bare @ lists connected browse rows, not disconnected plugins or MCP tools", () => {
const values = filterMentions(items, "").map((i) => i.value);
- expect(values).toEqual(["Scout", "gmail", "search-web", "gh", "github"]);
+ expect(values).toEqual(["Scout", "gmail", "github", "search-web", "gh", "sentry"]);
expect(values).not.toContain("notion");
expect(values).not.toContain("github/create_issue");
+ expect(values).not.toContain("sentry/create_issue");
});
it("finds Gmail by @gmail, @mail and the catalog id", () => {
@@ -124,10 +182,12 @@ describe("filterMentions", () => {
expect(filterMentions(items, "plugin:gmail").map((i) => i.value)).toEqual(["gmail"]);
});
- it("unfolds MCP tools when the query names them, and still matches the server", () => {
- const create = filterMentions(items, "create");
- expect(create.map((i) => i.value)).toContain("github/create_issue");
+ it("finds a folded plugin by a tool name, and unfolds leftover MCP tools", () => {
+ expect(filterMentions(items, "create_issue").map((i) => i.value)).toContain("github");
expect(filterMentions(items, "github").map((i) => i.value)[0]).toBe("github");
+ const sentry = filterMentions(items, "create");
+ expect(sentry.map((i) => i.value)).toContain("sentry/create_issue");
+ expect(filterMentions(items, "sentry").map((i) => i.value)[0]).toBe("sentry");
});
it("a disconnected plugin still appears once it is searched for", () => {
@@ -149,11 +209,10 @@ describe("groupMentions / mentionsInText / mentionToken", () => {
expect(groupMentions(filterMentions(items, "")).map((g) => g.group)).toEqual([
"agents",
"plugins",
- "mcp",
]);
});
- it("pins @gmail to the plugin id and @github to every GitHub MCP tool", () => {
+ it("pins @gmail to the plugin id and @github to every GitHub capability", () => {
const named = mentionsInText("please check @gmail and ping @github", items);
expect(named.pinIds).toEqual([
"plugin:gmail",
@@ -163,9 +222,13 @@ describe("groupMentions / mentionsInText / mentionToken", () => {
expect(named.agents).toEqual([]);
});
- it("a longer MCP tag is not also the server tag", () => {
- const named = mentionsInText("open @github/create_issue", items);
- expect(named.pinIds).toEqual(["mcp:github/create_issue"]);
+ it("a longer leftover MCP tag is not also the server tag", () => {
+ const catalog = buildMentionCatalog(
+ [],
+ [cap({ id: "mcp:sentry/create_issue" }), cap({ id: "mcp:sentry/list_issues" })],
+ );
+ const named = mentionsInText("open @sentry/create_issue", catalog);
+ expect(named.pinIds).toEqual(["mcp:sentry/create_issue"]);
});
it("names an agent for delegation", () => {
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts
index 9b33b8fb6d..37e05d0868 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts
+++ b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts
@@ -8,6 +8,8 @@
* browsing; typing a tool name unfolds the individual tools.
*/
+import { marketplacePluginId, pluginFamily } from "@/lib/pluginFamilies";
+
import type { Capability, SocietyAgent } from "../data";
/** "plugin:gmail" → "gmail"; "mcp:github/create_issue" → "github/create_issue". */
@@ -137,8 +139,8 @@ function capabilityItem(
/**
* Every taggable row: agents first (they keep their names), then one row per
- * plugin / CLI / skill / core tool, plus a collapsed MCP server and its
- * individual tools.
+ * connected marketplace plugin (skills and commands folded in), remaining MCP
+ * servers, CLIs, standalone skills and Jarvis tools.
*/
export function buildMentionCatalog(
agents: readonly SocietyAgent[],
@@ -165,10 +167,23 @@ export function buildMentionCatalog(
});
}
+ const families = new Map<string, Capability[]>();
const mcpByServer = new Map<string, Capability[]>();
const rest: Capability[] = [];
for (const cap of capabilities) {
- if (kindOf(cap) === "mcp") {
+ const familyId = marketplacePluginId(cap.id) || marketplacePluginId(cap.tool_name || "");
+ if (familyId) {
+ const bucket = families.get(familyId);
+ if (bucket) bucket.push(cap);
+ else families.set(familyId, [cap]);
+ continue;
+ }
+ const kind = kindOf(cap);
+ if (kind === "plugin") {
+ // Coding commands and other non-connector tools are not plugins.
+ continue;
+ }
+ if (kind === "mcp") {
const server = mcpServer(cap.id);
const bucket = mcpByServer.get(server);
if (bucket) bucket.push(cap);
@@ -178,6 +193,43 @@ export function buildMentionCatalog(
}
}
+ for (const [familyId, members] of families) {
+ const family = pluginFamily(familyId);
+ const live = members.filter((cap) => kindOf(cap) !== "skill");
+ const connected = live.some((cap) => cap.connected);
+ const representative =
+ members.find((cap) => kindOf(cap) === "plugin") ?? live[0] ?? members[0];
+ const tag = family?.tag ?? familyId.replace(/_/g, "-");
+ const value = takeValue(tag, `plugin:${familyId}`, taken);
+ const item = capabilityItem(representative, value, {
+ key: `plugin:${familyId}`,
+ detail: false,
+ pinIds: members.map((cap) => cap.id),
+ label: family?.displayName ?? representative.label,
+ hint: family?.description || representative.one_liner,
+ toolName: familyId,
+ connected,
+ });
+ items.push({
+ ...item,
+ kind: "plugin",
+ group: "plugins",
+ searchText: searchBlob([
+ item.searchText,
+ family?.displayName,
+ family?.description,
+ family?.tag,
+ ...members.flatMap((cap) => [
+ cap.id,
+ cap.label,
+ cap.one_liner,
+ cap.tool_name,
+ ...(cap.aliases ?? []),
+ ]),
+ ]),
+ });
+ }
+
for (const cap of rest) {
const short = capabilityName(cap.id);
const value = takeValue(short, cap.id, taken);
diff --git a/jarvis/ui/web/frontend/src/lib/cliVendors.ts b/jarvis/ui/web/frontend/src/lib/cliVendors.ts
new file mode 100644
index 0000000000..3aef448650
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/cliVendors.ts
@@ -0,0 +1,68 @@
+/**
+ * Catalog CLI name → vendor mark. Shared by the CLIs table, the composer
+ * picker and the mention list so a row never has to guess which file to draw.
+ *
+ * Exact names, not substrings: `gh` and `glab` share no letters with their
+ * companies, and a substring rule would make `gws` a Google Cloud tool.
+ */
+
+export type CliMarkRender = "colour" | "mono";
+
+export interface CliVendorLogo {
+ file: string;
+ render: CliMarkRender;
+}
+
+export const CLI_VENDOR_LOGOS: Record<string, CliVendorLogo> = {
+ aws: { file: "aws.svg", render: "mono" },
+ azure: { file: "azure.svg", render: "colour" },
+ cloudflare: { file: "cloudflare.svg", render: "mono" },
+ docker: { file: "docker.svg", render: "colour" },
+ firebase: { file: "firebase.svg", render: "colour" },
+ fly: { file: "fly.svg", render: "colour" },
+ github: { file: "github.svg", render: "mono" },
+ gitlab: { file: "gitlab.svg", render: "colour" },
+ google: { file: "google.svg", render: "colour" },
+ "google-cloud": { file: "google-cloud.svg", render: "colour" },
+ heroku: { file: "heroku.svg", render: "colour" },
+ kubernetes: { file: "kubernetes.svg", render: "colour" },
+ neon: { file: "neon.svg", render: "colour" },
+ netlify: { file: "netlify.svg", render: "colour" },
+ planetscale: { file: "planetscale.svg", render: "mono" },
+ railway: { file: "railway.svg", render: "mono" },
+ render: { file: "render.svg", render: "mono" },
+ stripe: { file: "stripe.svg", render: "mono" },
+ supabase: { file: "supabase.svg", render: "colour" },
+ twilio: { file: "twilio.svg", render: "colour" },
+ vercel: { file: "vercel.svg", render: "mono" },
+};
+
+export const CLI_VENDORS: Record<string, string> = {
+ aws: "aws",
+ az: "azure",
+ docker: "docker",
+ firebase: "firebase",
+ flyctl: "fly",
+ gcloud: "google-cloud",
+ gh: "github",
+ glab: "gitlab",
+ gws: "google",
+ heroku: "heroku",
+ kubectl: "kubernetes",
+ neonctl: "neon",
+ netlify: "netlify",
+ pscale: "planetscale",
+ railway: "railway",
+ render: "render",
+ stripe: "stripe",
+ supabase: "supabase",
+ twilio: "twilio",
+ vercel: "vercel",
+ wrangler: "cloudflare",
+};
+
+/** The vendor a catalog CLI name belongs to, or null for an unknown binary. */
+export function cliVendor(cliName: string): string | null {
+ const trimmed = cliName.trim().toLowerCase().replace(/^(?:cli[_:-])+/, "");
+ return CLI_VENDORS[trimmed] ?? CLI_VENDORS[trimmed.replace(/_/g, "-")] ?? null;
+}
diff --git a/jarvis/ui/web/frontend/src/lib/pluginFamilies.test.ts b/jarvis/ui/web/frontend/src/lib/pluginFamilies.test.ts
new file mode 100644
index 0000000000..168dd09cd0
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/pluginFamilies.test.ts
@@ -0,0 +1,39 @@
+import { describe, expect, it } from "vitest";
+
+import {
+ isPluginOwnedSkill,
+ marketplacePluginId,
+ pluginFamily,
+} from "./pluginFamilies";
+
+describe("marketplacePluginId", () => {
+ it("maps the connector, its MCP tools and its bundled skill to one family", () => {
+ expect(marketplacePluginId("plugin:gmail")).toBe("gmail");
+ expect(marketplacePluginId("gmail")).toBe("gmail");
+ expect(marketplacePluginId("plugin-gmail")).toBe("gmail");
+ expect(marketplacePluginId("skill:plugin-gmail")).toBe("gmail");
+ expect(marketplacePluginId("mcp:github/create_issue")).toBe("github");
+ expect(marketplacePluginId("youtube_music/play")).toBe("youtube_music");
+ expect(marketplacePluginId("youtube")).toBe("youtube_music");
+ });
+
+ it("does not invent a connector for coding commands or lookalike names", () => {
+ expect(marketplacePluginId("plugin:agentic-ide-close-agent-terminals")).toBeUndefined();
+ expect(marketplacePluginId("core:search-web")).toBeUndefined();
+ expect(marketplacePluginId("cli:gh")).toBeUndefined();
+ expect(marketplacePluginId("nonlinear_solver")).toBeUndefined();
+ expect(marketplacePluginId("daily-brief")).toBeUndefined();
+ expect(marketplacePluginId("mcp:sentry/list_issues")).toBeUndefined();
+ });
+
+ it("keeps a human name and @ tag per family", () => {
+ expect(pluginFamily("youtube_music")).toEqual(
+ expect.objectContaining({
+ displayName: "YouTube Music",
+ tag: "youtube-music",
+ }),
+ );
+ expect(isPluginOwnedSkill("plugin-gmail")).toBe(true);
+ expect(isPluginOwnedSkill("daily-brief")).toBe(false);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/lib/pluginFamilies.ts b/jarvis/ui/web/frontend/src/lib/pluginFamilies.ts
new file mode 100644
index 0000000000..6a43c23dfb
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/pluginFamilies.ts
@@ -0,0 +1,117 @@
+/**
+ * Marketplace plugins as the user thinks of them: one YouTube, one Gmail —
+ * not the skills, MCP tools or commands that sit behind the connection.
+ *
+ * The seed catalog is the canonical family list. Community plugins that
+ * reuse a seed id fold into the same row; unknown `plugin:*` tools (coding
+ * commands, device lists) are not a family and must not appear as plugins.
+ */
+
+import seedCatalog from "../../../../../marketplace/seed_catalog.json";
+
+export interface PluginFamily {
+ id: string;
+ displayName: string;
+ description: string;
+ /** Hyphenated tag that lands after `@`. */
+ tag: string;
+}
+
+type SeedPlugin = {
+ id: string;
+ display_name: string;
+ description: string;
+ native_tool?: string | null;
+};
+
+const seedPlugins = seedCatalog.plugins as SeedPlugin[];
+
+export const PLUGIN_FAMILIES: PluginFamily[] = seedPlugins.map((plugin) => ({
+ id: plugin.id,
+ displayName: plugin.display_name,
+ description: plugin.description,
+ tag: plugin.id.replace(/_/g, "-"),
+}));
+
+const FAMILY_BY_ID = new Map(PLUGIN_FAMILIES.map((family) => [family.id, family]));
+
+interface Needle {
+ familyId: string;
+ compact: string;
+ alias: string;
+}
+
+function compact(value: string): string {
+ return value.toLowerCase().replace(/[^a-z0-9]/g, "");
+}
+
+function needlesFor(plugin: SeedPlugin): Needle[] {
+ const aliases = new Set<string>([
+ plugin.id,
+ plugin.id.replace(/_/g, "-"),
+ `plugin-${plugin.id}`,
+ `plugin-${plugin.id.replace(/_/g, "-")}`,
+ ]);
+ if (plugin.native_tool) aliases.add(plugin.native_tool);
+ // Spoken / typed shorthand: "youtube" is YouTube Music, not a second plugin.
+ if (plugin.id === "youtube_music") aliases.add("youtube");
+ return [...aliases].map((alias) => ({
+ familyId: plugin.id,
+ compact: compact(alias),
+ alias: alias.toLowerCase(),
+ }));
+}
+
+const NEEDLES: Needle[] = seedPlugins
+ .flatMap(needlesFor)
+ .sort((a, b) => b.compact.length - a.compact.length || b.alias.length - a.alias.length);
+
+function stripKind(raw: string): string {
+ return raw.replace(/^(plugin|mcp|skill|cli|core):/i, "");
+}
+
+/**
+ * The marketplace plugin this name belongs to, or undefined when it is not
+ * a connector (a skill, a coding command, an MCP tool of some other server).
+ *
+ * Whole aliases and identity segments only: "nonlinear" is not Linear,
+ * "drive-jarvis" is not Drive.
+ */
+export function marketplacePluginId(raw: string): string | undefined {
+ const stripped = stripKind(raw.trim());
+ if (!stripped) return undefined;
+ const lowered = stripped.toLowerCase();
+ const compacted = compact(stripped);
+ const server = stripped.split(/[/:]/, 1)[0] ?? stripped;
+
+ for (const needle of NEEDLES) {
+ if (compact(server) === needle.compact || compacted === needle.compact) return needle.familyId;
+ }
+ for (const needle of NEEDLES) {
+ if (
+ lowered === needle.alias ||
+ lowered.startsWith(`${needle.alias}/`) ||
+ lowered.startsWith(`${needle.alias}-`) ||
+ lowered.startsWith(`${needle.alias}_`)
+ ) {
+ return needle.familyId;
+ }
+ }
+ const tokens = lowered.split(/[^a-z0-9]+/).filter((token) => token && token !== "plugin" && token !== "mcp");
+ for (const needle of NEEDLES) {
+ if (tokens.includes(needle.alias) || tokens.some((token) => compact(token) === needle.compact)) {
+ return needle.familyId;
+ }
+ }
+ return undefined;
+}
+
+export function pluginFamily(id: string): PluginFamily | undefined {
+ return FAMILY_BY_ID.get(id);
+}
+
+export function isPluginOwnedSkill(slug: string): boolean {
+ const trimmed = slug.trim();
+ if (!trimmed) return false;
+ return Boolean(marketplacePluginId(trimmed));
+}
diff --git a/jarvis/ui/web/frontend/src/lib/toolBrand.test.ts b/jarvis/ui/web/frontend/src/lib/toolBrand.test.ts
index 52501caf90..195400243f 100644
--- a/jarvis/ui/web/frontend/src/lib/toolBrand.test.ts
+++ b/jarvis/ui/web/frontend/src/lib/toolBrand.test.ts
@@ -53,6 +53,14 @@ describe("resolveToolBrand", () => {
expect(resolveToolBrand("").label).toBe("?");
expect(resolveToolBrand("").monogram).toBe("??");
});
+
+ it("maps a catalog CLI name to the vendor mark", () => {
+ expect(resolveToolBrand("cli_gh").brandId).toBe("github");
+ expect(resolveToolBrand("kubectl").brandId).toBe("kubernetes");
+ expect(resolveToolBrand("gcloud").brandId).toBe("google-cloud");
+ expect(resolveToolBrand("cli_gh").logoUrl).toMatch(/svg/);
+ expect(resolveToolBrand("kubectl").logoUrl).toMatch(/svg/);
+ });
});
describe("helpers", () => {
diff --git a/jarvis/ui/web/frontend/src/lib/toolBrand.ts b/jarvis/ui/web/frontend/src/lib/toolBrand.ts
index 16e70713a1..84f950611e 100644
--- a/jarvis/ui/web/frontend/src/lib/toolBrand.ts
+++ b/jarvis/ui/web/frontend/src/lib/toolBrand.ts
@@ -17,26 +17,38 @@
* wins.
*/
+import { CLI_VENDOR_LOGOS, cliVendor } from "./cliVendors";
+
const BUNDLED_BRAND_LOGOS = import.meta.glob("../assets/brands/*.svg", {
eager: true,
query: "?url",
import: "default",
}) as Record<string, string>;
+const BUNDLED_CLI_LOGOS = import.meta.glob("../assets/clis/*.svg", {
+ eager: true,
+ query: "?url",
+ import: "default",
+}) as Record<string, string>;
+
/** Display names where the file id's auto-humanised form would be wrong. */
const BRAND_DISPLAY_NAMES: Record<string, string> = {
cal_com: "Cal.com",
clickup: "ClickUp",
github: "GitHub",
gmail: "Gmail",
+ google: "Google",
+ "google-cloud": "Google Cloud",
google_calendar: "Google Calendar",
google_drive: "Google Drive",
home_assistant: "Home Assistant",
+ kubernetes: "Kubernetes",
+ planetscale: "PlanetScale",
youtube_music: "YouTube Music",
};
/** Tokens that name a wrapper, not an action — dropped from the label. */
-const NOISE_TOKENS = new Set(["plugin", "tool", "mcp"]);
+const NOISE_TOKENS = new Set(["plugin", "tool", "mcp", "cli"]);
interface Brand {
id: string;
@@ -64,6 +76,17 @@ const BRANDS: Brand[] = Object.entries(BUNDLED_BRAND_LOGOS)
logoUrl,
};
})
+ .concat(
+ Object.entries(CLI_VENDOR_LOGOS)
+ .filter(([id]) => !BUNDLED_BRAND_LOGOS[`../assets/brands/${id}.svg`])
+ .map(([id, spec]) => ({
+ id,
+ tokens: id.split(/[-_]/),
+ label: BRAND_DISPLAY_NAMES[id] ?? humanise(id.split(/[-_]/)),
+ logoUrl: BUNDLED_CLI_LOGOS[`../assets/clis/${spec.file}`],
+ }))
+ .filter((brand) => Boolean(brand.logoUrl)),
+ )
.sort(
(a, b) => b.tokens.length - a.tokens.length || b.id.length - a.id.length,
);
@@ -139,6 +162,25 @@ export function resolveToolBrand(toolName: string): ToolBrand {
}
const plain = tokens.filter((w) => !NOISE_TOKENS.has(w));
+ const vendor =
+ cliVendor(plain.join("_")) || cliVendor(plain.join("-")) || (plain[0] ? cliVendor(plain[0]) : null);
+ if (vendor) {
+ const brand = BRANDS.find((entry) => entry.id === vendor);
+ const logoUrl =
+ brand?.logoUrl ||
+ BUNDLED_CLI_LOGOS[`../assets/clis/${CLI_VENDOR_LOGOS[vendor]?.file}`] ||
+ BUNDLED_CLI_LOGOS[`../assets/clis/${vendor}.svg`];
+ const brandLabel = brand?.label ?? BRAND_DISPLAY_NAMES[vendor] ?? humanise(vendor.split(/[-_]/));
+ const rest = cliVendor(plain.join("_")) || cliVendor(plain.join("-")) ? [] : plain.slice(1);
+ const label = rest.length ? `${brandLabel} · ${rest.join(" ")}` : brandLabel;
+ return {
+ label,
+ logoUrl,
+ monogram: monogramFor(brandLabel),
+ brandId: vendor,
+ };
+ }
+
const label = (plain.length ? plain : tokens).join(" ");
return { label, monogram: monogramFor(label) };
}
diff --git a/tests/contract/test_chat_tool_choices.py b/tests/contract/test_chat_tool_choices.py
index c17d99a81f..9ff15587e4 100644
--- a/tests/contract/test_chat_tool_choices.py
+++ b/tests/contract/test_chat_tool_choices.py
@@ -65,6 +65,26 @@ def test_inventory_covers_categories_and_connected_state():
assert len(rows) == len(by_id)
+def test_plugin_row_hides_operations_and_bundled_skills():
+ tools = {
+ "github/create_issue": tool("github/create_issue", "Open an issue"),
+ "github/list_issues": tool("github/list_issues", "List issues"),
+ "run-skill": tool("run-skill", risk="ask"),
+ }
+ plugin = SimpleNamespace(
+ id="github", display_name="GitHub", description="Repos", native_tool=None
+ )
+ skill = SimpleNamespace(value="plugin-github", label="GitHub skill", hint="Use GitHub")
+ extra = SimpleNamespace(value="daily-brief", label="Daily brief", hint="Summarize")
+ rows = build_catalog(tools, [plugin], [skill, extra], {"github"})
+ by_id = {row.id: row for row in rows}
+ assert by_id["plugin:github"].tool_names == ("github/create_issue", "github/list_issues")
+ assert "tool:github/create_issue" not in by_id
+ assert "mcp:github" not in by_id
+ assert "skill:plugin-github" not in by_id
+ assert "skill:daily-brief" in by_id
+
+
@pytest.mark.parametrize("ids", [["invented"], ["plugin:offline"], ["plugin:gmail"] * 25])
def test_invalid_choices_fail_closed(ids):
with pytest.raises(ValueError):