Plugins
@aparte/core is presentational and zero-dependency: it renders raw text, exposes seams, and asks
nothing of you. Plugins fill those seams — each is an opt-in @aparte/plugin-* package that you install
and wire in one call, so core stays small and you pay only for what you use.
| You want… | Package | Seam it fills |
|---|---|---|
| Render finished Markdown messages | marked | setMarkdownProvider |
| Stream Markdown token-by-token | streaming-markdown | setStreamingMarkdownProvider |
| Highlight code blocks | shiki | setHighlightProvider |
| Let the user pick a provider + model | model-selector | <aparte-model-selector> element |
| Let the AI ask the user a question | ask-question | registerTool + elicitation |
Every plugin lists @aparte/core as a peer dependency and, where it wraps a third-party library
(marked, streaming-markdown, shiki), that library too — so you control its version and it is never
bundled into core.
The shape of a plugin
Section titled “The shape of a plugin”Most plugins register something on the config once, at startup:
import { setupMarkedProvider } from '@aparte/plugin-marked';import { setupShikiProvider } from '@aparte/plugin-shiki';
setupMarkedProvider(); // finished messages → HTMLawait setupShikiProvider(); // code blocks → highlighted HTMLThe two Markdown plugins are complementary: streaming-markdown renders each token as it arrives, and
marked re-renders the finished message. Register both for the best of both.
Localization
Section titled “Localization”Translating the built-in UI strings is its own seam — see the
Localization guide and the @aparte/locale-fr package.