export function makeComponentId( cmd: unknown, ...parts: Array ): string { const name = typeof cmd === "string" ? cmd : cmd && typeof (cmd as { name?: string }).name === "string" ? (cmd as { name?: string }).name : ""; if (!name) throw new Error("command name is required to make a component id"); if (parts.length === 0) return name; return [name, ...parts.map(String)].join(":"); } export function parseComponentId(customId: string) { const [commandName, ...parts] = customId.split(":"); return { commandName, parts }; }