Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { parseStandardSetUnsetSlashCommand } from "./commands-setunset-standard.js";
export type McpCommand =
| { action: "show"; name?: string }
| { action: "set"; name: string; value: unknown }
| { action: "unset"; name: string }
| { action: "error"; message: string };
export function parseMcpCommand(raw: string): McpCommand | null {
return parseStandardSetUnsetSlashCommand<McpCommand>({
raw,
slash: "/mcp",
invalidMessage: "Invalid /mcp syntax.",
usageMessage: "Usage: /mcp show|set|unset",
onKnownAction: (action, args) => {
if (action === "show" || action === "get") {
return { action: "show", name: args || undefined };
}
return undefined;
},
onSet: (name, value) => ({ action: "set", name, value }),
onUnset: (name) => ({ action: "unset", name }),
});
}
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland