Show Paseo logo and nice names for Paseo MCP tool calls
Detect Paseo MCP tool names across provider formats (Claude's mcp__paseo__*, Codex's paseo.*) and display humanized leaf names with the Paseo SVG logo instead of raw namespaced strings.
This commit is contained in:
@@ -141,6 +141,46 @@ describe("shared tool-call display mapping", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("humanizes Paseo MCP tool names (Claude Code format)", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "mcp__paseo__create_agent",
|
||||
status: "running",
|
||||
error: null,
|
||||
detail: { type: "unknown", input: null, output: null },
|
||||
});
|
||||
expect(display.displayName).toBe("Create Agent");
|
||||
});
|
||||
|
||||
it("humanizes Paseo MCP tool names (Codex format)", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "paseo.create_agent",
|
||||
status: "running",
|
||||
error: null,
|
||||
detail: { type: "unknown", input: null, output: null },
|
||||
});
|
||||
expect(display.displayName).toBe("Create Agent");
|
||||
});
|
||||
|
||||
it("humanizes list_agents Paseo tool", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "mcp__paseo__list_agents",
|
||||
status: "running",
|
||||
error: null,
|
||||
detail: { type: "unknown", input: null, output: null },
|
||||
});
|
||||
expect(display.displayName).toBe("List Agents");
|
||||
});
|
||||
|
||||
it("does not override speak tool display name", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "speak",
|
||||
status: "running",
|
||||
error: null,
|
||||
detail: { type: "unknown", input: null, output: null },
|
||||
});
|
||||
expect(display.displayName).toBe("Speak");
|
||||
});
|
||||
|
||||
it("labels plan detail rows as Plan", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "plan",
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import type { ToolCallTimelineItem } from "../server/agent/agent-sdk-types.js";
|
||||
import {
|
||||
getPaseoToolLeafName,
|
||||
isPaseoToolName,
|
||||
} from "../server/agent/tool-name-normalization.js";
|
||||
import { stripCwdPrefix } from "./path-utils.js";
|
||||
|
||||
export type ToolCallDisplayInput = Pick<
|
||||
@@ -32,6 +36,12 @@ function humanizeToolName(name: string): string {
|
||||
if (!trimmed) {
|
||||
return name;
|
||||
}
|
||||
if (isPaseoToolName(trimmed)) {
|
||||
const leaf = getPaseoToolLeafName(trimmed);
|
||||
if (leaf) {
|
||||
return humanizeToolName(leaf);
|
||||
}
|
||||
}
|
||||
if (/[:./]/.test(trimmed) || trimmed.includes("__")) {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user