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

@extravirgin/payload-plugin-tone-of-voice

v0.1.4

Published

Payload CMS plugin for AI-assisted tone-of-voice audits in the admin editor.

Readme

Payload Tone of Voice Plugin

AI-assisted tone-of-voice audits for Payload CMS admin editors.

This plugin adds a Tone audit action next to the Payload save button for configured collections. Editors can extract text from the current document, split longer rich text into reviewable sections, stream feedback, compare suggested edits, accept suggestions into the audit workspace, and export a PDF report.

Status

MVP release. The plugin is intended for Payload 3 projects and currently uses Vercel AI Gateway by default. You can also provide a custom audit provider for another model gateway or an internal service.

Install

pnpm add @extravirgin/payload-plugin-tone-of-voice

Peer dependencies expected in the host app:

pnpm add payload @payloadcms/ui @payloadcms/richtext-lexical react react-dom

Payload package peers support Payload ^3.24.0.

Configuration

import { toneOfVoice } from '@extravirgin/payload-plugin-tone-of-voice'
import { buildConfig } from 'payload'

export default buildConfig({
  plugins: [
    toneOfVoice({
      collections: {
        posts: {
          excludeFields: ['slug', 'seo.*', 'legalDisclaimer'],
          fields: 'auto',
        },
      },
      rules: `
# Tone of voice

- Write clearly and concretely.
- Avoid inflated claims.
- Preserve legal, official, and factual wording.
      `,
    }),
  ],
})

Vercel AI Gateway

The default provider requires one of these environment variables:

AI_GATEWAY_API_KEY=...
# or
VERCEL_OIDC_TOKEN=...

Optional model settings:

toneOfVoice({
  collections: {
    posts: true,
  },
  model: 'anthropic/claude-sonnet-4.6',
  rules: toneGuide,
  temperature: 0.2,
  timeoutMs: 120_000,
})

Options

type ToneOfVoiceConfig = {
  auditProvider?: ToneOfVoiceAuditProvider
  collections: Partial<Record<CollectionSlug, boolean | ToneOfVoiceCollectionOptions>>
  disabled?: boolean
  maxInputChars?: number
  model?: string
  rules: string
  temperature?: number
  timeoutMs?: number
}

Collection options:

type ToneOfVoiceCollectionOptions = {
  excludeFields?: string[]
  fields?: 'auto' | string[]
  rules?: string
}
  • collections: collection slugs to enable. Use true for auto field extraction or pass collection-specific options.
  • fields: auto extracts supported text, textarea, and rich text fields. A string array limits extraction to specific paths.
  • excludeFields: paths to skip when extracting fields. Simple names match anywhere (slug), nested paths match descendants (seo), and * matches one path segment (layout.*.legalText).
  • rules: global tone guide in Markdown. Collection-level rules override this value.
  • auditProvider: custom provider for testing or non-Vercel AI backends.
  • maxInputChars: max characters per section sent to the model. Defaults to 24000.
  • disabled: keeps plugin configuration present while disabling the admin UI and endpoint.

Custom Provider

import type { ToneOfVoiceAuditProvider } from '@extravirgin/payload-plugin-tone-of-voice'

const auditProvider: ToneOfVoiceAuditProvider = async (input) => {
  return {
    issues: [],
    score: 100,
    suggestions: [],
    summary: 'No changes needed.',
  }
}

Streaming providers can add a stream method:

const auditProvider: ToneOfVoiceAuditProvider = Object.assign(runAudit, {
  async *stream(input, options) {
    yield {
      type: 'result',
      value: await runAudit(input, options),
    }
  },
})

Rich Text Behavior

Long rich text fields are split into topical audit sections before being sent to the model. Heading nodes and short heading-like paragraphs start new sections; long unheaded content is chunked by paragraph. Structured rich text containing blocks or inline blocks is marked for manual review to avoid overwriting embedded content.

The model prompt asks for narrow sentence or paragraph suggestions instead of full-section replacements, and it treats legal, regulatory, official decision, permit, procurement, citation, amount, date, and named-party passages conservatively.

Development

pnpm install
pnpm dev
pnpm test:int
pnpm build

Before publishing:

pnpm clean
pnpm build
npm pack --dry-run
npm publish --access public