npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aparte/plugin-artifacts

v0.17.3

Published

Artifacts for aparté — a create_artifact tool the model calls, a rich Code/Preview card that renders its result, and the <artifact> tag grammar for a model that writes one in its prose.

Readme

@aparte/plugin-artifacts

Artifacts for aparté: a document the model produces — a page, a component, a script, an SVG, a Markdown note, a spreadsheet — shown as a Code/Preview card in the transcript. An artifact is a convention an app teaches its model, not something a model does by nature, so the whole convention lives here: the create_artifact tool the model calls, the card that renders its result, and the <artifact> tag grammar for a model that writes one in its prose.

npm install @aparte/plugin-artifacts @aparte/core
import { setupArtifacts } from '@aparte/plugin-artifacts';

setupArtifacts(); // registers the tool, its renderer, the grammar and the segment renderer

@aparte/core is the only peer dependency.

Options

setupArtifacts({
  name: 'create_artifact',        // the tool's name as the model sees it
  systemPrompt: false,            // your own string, or false to send none
  tag: 'artifact',                // the tag recognised in the prose; false for none
  preview: true,                  // false: no Preview tab; a function: your own srcdoc builder
  onBinary: async (artifact) => { // pdf / xlsx / docx: produce the file from the model's source
    const { buffer, filename } = await runInYourSandbox(artifact.content);
    return { buffer, filename, mime: artifact.mimeType };
  },
});

A second argument scopes everything to one AparteConfig instead of the global one. The call returns a function that unregisters all four.

What the card does

  • Opens on Code, highlighted through whatever highlighter core was given.
  • Preview — for html, react, svg, js and css — is mounted only when the reader presses the tab: a previewable artifact is model-authored code, and mounting it unasked executes it. The frame is sandbox="allow-scripts" with a CSP that lets nothing out.
  • Copy and Download on every text artifact; a binary one (pdf, xlsx, docx) downloads only once your onBinary produced it — without one there is no button, because the library holds no bytes.

Two ways in, one card

A model with tools calls create_artifact with { mimeType, title, content }; the handler returns the document as the tool's structured result and the card is drawn from it. A model without tools writes <artifact type="text/html" title="…">…</artifact> in its reply; core's parser — taught the grammar by this plugin through registerStreamBlock — streams it into an artifact segment the same card renders.

MIME types follow the standard, plus Anthropic's application/vnd.ant.* namespace for framework kinds (application/vnd.ant.react). deriveArtifactKind(mimeType) gives the short kind the card switches on.