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

@templatical/ai-kit

v0.64.1

Published

Bring your own AI backend to the Templatical email editor: the wire, an HTTP provider, a server kit with prompts and tools, and a conformance suite

Downloads

7,415

Readme

@templatical/ai-kit

Bring your own AI backend to the Templatical email editor.

npm version License

The editor's AI (the AI assistant with Undo and attachments, Rewrite, Fix with AI, Write alt text and static localized chat starters) runs on an AiProvider you pass to init({ ai }). This package is everything around that contract, with no LLM SDK and no Node-only API: it runs in Node, Deno, Bun, Workers and the browser.

| Entry | What it is | |---|---| | @templatical/ai-kit | The wire: routes, headers, events, bodies, error statuses, limits; the contract types | | @templatical/ai-kit/client | createHttpAiProvider(): an AiProvider over the wire, for the browser | | @templatical/ai-kit/server | Prompts, the apply_operations tool, createEditingSession, runEditingTurn, aiEventStream, output checks | | @templatical/ai-kit/testing | runAiProviderConformance, runAiWireConformance, createMockAiProvider, the test set and runAiEvalSet | | @templatical/ai-kit/prompts/*, /schema/*, /eval/* | The prompt files, the JSON schemas and the test set, for backends in any language |

Install

npm install @templatical/ai-kit
pnpm add @templatical/ai-kit
yarn add @templatical/ai-kit
bun add @templatical/ai-kit

Choose the command for your package manager.

In the editor

import { init } from "@templatical/editor";
import "@templatical/editor/style.css";
import { createHttpAiProvider } from "@templatical/ai-kit/client";

const editor = await init({
  container: "#editor",
  templates: {
    load: async (id) => {
      const response = await fetch(`/api/templates/${encodeURIComponent(id)}`);
      if (!response.ok) throw new Error("Template load failed.");
      return response.json();
    },
    create: false,
    save: false,
  },
  ai: createHttpAiProvider({
    baseUrl: "/api/ai",
  }),
});
await editor.load("tpl_123");

AI needs a loaded template: the AI assistant and other entry points appear after editor.load(id) or editor.create() resolves. Omit ai to leave the feature out. Fix with AI and Write alt text also require @templatical/quality and lint on. The AI kit and the editor UI are MIT.

On your server

See Bring your own AI backend for a complete Fetch-API server, model adapters for the Vercel AI SDK, OpenAI and Anthropic, and the wire for other languages.

Model adapters: @templatical/ai-kit/adapters/anthropic (createAnthropicAdapter({ client: new Anthropic(), model })), /adapters/openai (createOpenAiAdapter({ client: new OpenAI(), model })) and /adapters/vercel (createVercelAdapter({ model })). Install the SDK of the one you import; they're optional peers.

License

MIT