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

@firstlovecenter/ai-chat

v0.9.14

Published

Reusable AI chat module: agent loop, Vertex providers (Claude + Gemini), narrators, persistence schema, and chat UI components. Host injects auth, scope, tools, and credentials via configureAiChat().

Downloads

1,038

Readme

@firstlovecenter/ai-chat

Reusable AI chat module for Next.js apps. Ships:

  • An agent tool loop that runs against Vertex AI (Claude or Gemini).
  • Two chat UI components: a custom hand-rolled chat and a Vercel AI SDK chat.
  • Persistence routes (sessions, messages, admin AI settings).
  • ORM-agnostic persistence: bring your own Drizzle (drizzle-orm) or Prisma (@prisma/client).
  • Registries for available tool-calling models and chat interfaces — your app picks which to expose.

The host app supplies its own auth, scope, tools, prompts, Vertex credentials, and settings UI. The package handles everything else.

Status

Pre-release. See the project plan for the current roadmap.

Install

pnpm add @firstlovecenter/ai-chat next react react-dom
# pick one persistence backend:
pnpm add drizzle-orm
# or:
pnpm add @prisma/client

Quick start

// src/lib/ai-chat.ts (host)
import { configureAiChat } from '@firstlovecenter/ai-chat/server';
import { createDrizzlePersistence } from '@firstlovecenter/ai-chat/server/drizzle';
// or: import { createPrismaPersistence } from '@firstlovecenter/ai-chat/server/prisma';

export const aiChat = configureAiChat({
  persistence: createDrizzlePersistence(db),
  auth: { requireAuth, isSuperAdmin },
  scope: { resolveScopeLabel, buildScopeSummary },
  tools: { tools: ALL_TOOLS, buildSystemBlocks },
  vertex: {
    projectId: process.env.GCP_PROJECT_ID!,
    defaultLocation: process.env.GCP_LOCATION ?? 'us-east5',
    auth: getVertexAuth(),
    modelIds: { claude: process.env.GCP_CLAUDE_MODEL!, gemini: process.env.GCP_GEMINI_MODEL! }
  }
});

Detailed integration docs (Drizzle migrations, Prisma fragment paste, Vertex auth recipes, tool authoring, settings UI) ship with v0.1.0.

Database footprint

See DATABASE.md for the full footprint: which three tables the package adds, what it explicitly does not add (no FKs to the host, no users table, no triggers/views), MySQL-only and BIGINT-UNSIGNED user-id assumptions, table-name configurability per ORM, and the known independence gaps for hosts whose schema doesn't match FLC's.