fix: style agent mentions with primary color in markdown messages

Agent @mentions in markdown use the primary accent instead of generic link color
Mentions render without external URL favicons
Markdown mode now matches plain text mention styling
This commit is contained in:
Bohdan Triapitsyn
2026-06-11 00:46:34 +03:00
parent b46153801b
commit d29a0c5697
4 changed files with 87 additions and 21 deletions
@@ -0,0 +1,29 @@
export const SKILL_LINK_PREFIX = '#openchamber-skill:';
export const AGENT_LINK_PREFIX = '#openchamber-agent:';
export const buildAgentMentionUrl = (name: string): string => {
const encoded = encodeURIComponent(name);
return `https://opencode.ai/docs/agents/#${encoded}`;
};
export const buildSkillHref = (name: string): string => `${SKILL_LINK_PREFIX}${encodeURIComponent(name)}`;
export const buildAgentHref = (name: string): string => `${AGENT_LINK_PREFIX}${encodeURIComponent(name)}`;
export const parseSkillHref = (href: string | null | undefined): string | null => {
if (!href?.startsWith(SKILL_LINK_PREFIX)) return null;
try {
return decodeURIComponent(href.slice(SKILL_LINK_PREFIX.length));
} catch {
return null;
}
};
export const parseAgentHref = (href: string | null | undefined): string | null => {
if (!href?.startsWith(AGENT_LINK_PREFIX)) return null;
try {
return decodeURIComponent(href.slice(AGENT_LINK_PREFIX.length));
} catch {
return null;
}
};