UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

22 lines • 1.51 kB
import { jsx as _jsx } from "react/jsx-runtime"; import 'katex/dist/katex.min.css'; import 'streamdown/styles.css'; import { code } from '@streamdown/code'; import { math } from '@streamdown/math'; import { mermaid } from '@streamdown/mermaid'; import { Streamdown } from 'streamdown'; const STREAMDOWN_PLUGINS = { code, mermaid, math }; /** * The optional rich markdown renderer for agent chat — the exact streamdown stack flip uses * (GFM, KaTeX math, syntax-highlighted code, Mermaid), ported 1:1 but with the flip-specific * mention handling lifted out into the `remarkPlugins`/`components` props so the library stays * domain-agnostic. Lives behind the `@adonis-agora/agent/react/markdown` subpath so the base * package never forces these heavy peers on consumers that don't want them. * * Pass it to a `MessageItem`/`MessageList` `renderText` slot: * `renderText={(text, { isStreaming }) => <AgentMarkdown isStreaming={isStreaming}>{text}</AgentMarkdown>}` */ export function AgentMarkdown({ children, isStreaming = false, remarkPlugins, components, allowedTags, literalTagContent, }) { return (_jsx(Streamdown, { animated: true, isAnimating: isStreaming, plugins: STREAMDOWN_PLUGINS, ...(remarkPlugins !== undefined ? { remarkPlugins } : {}), ...(components !== undefined ? { components } : {}), ...(allowedTags !== undefined ? { allowedTags } : {}), ...(literalTagContent !== undefined ? { literalTagContent } : {}), children: children })); } //# sourceMappingURL=agent-markdown.js.map