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

@cherserg/ai-engine

v0.0.14

Published

`@cherserg/ai-engine` is a TypeScript library for generating landing page structure, block content, and design theme tokens with a Mastra workflow.

Readme

@cherserg/ai-engine

@cherserg/ai-engine is a TypeScript library for generating landing page structure, block content, and design theme tokens with a Mastra workflow.

The public entry point is LandingGeneratorWorkflow.

Installation

npm install @cherserg/ai-engine

Runtime requirements

  • Node.js: >=22.13.0
  • Runtime: server-side only
  • API key: pass an OpenAI-compatible API key through WorkflowConfig.apiKey

Do not use this package directly in browser/client-side code because LandingGeneratorWorkflow receives an API key.

Quick start

import { LandingGeneratorWorkflow } from "@cherserg/ai-engine";

const workflow = new LandingGeneratorWorkflow({
  apiKey: process.env.OPENAI_API_KEY!,
  blocksCatalog: [
    {
      id: "hero",
      description: "Main landing page hero section",
      schema: {
        type: "object",
        properties: {
          title: { type: "string" },
          subtitle: { type: "string" },
        },
        required: ["title", "subtitle"],
      },
    },
  ],
  designTokens: {
    allowedPalettes: ["light", "dark"],
    allowedFonts: ["sans", "serif"],
  },
});

const result = await workflow.execute({
  initialPrompt: "Generate a landing page for a SaaS CRM product",
});

Public exports

export { LandingGeneratorWorkflow } from "@cherserg/ai-engine";
export type {
  LandingContext,
  WorkflowConfig,
  WorkflowInput,
  WorkflowOutput,
} from "@cherserg/ai-engine";

Use only public exports from @cherserg/ai-engine. Do not import internal files from dist, src, or src/mastra.

Configuration contract

type WorkflowConfig = {
  apiKey: string;
  blocksCatalog: {
    id: string;
    description: string;
    schema: unknown;
  }[];
  designTokens: {
    allowedPalettes: string[];
    allowedFonts: string[];
  };
};

Input contract

type WorkflowInput = {
  initialPrompt: string;
};

Output contract

type WorkflowOutput = {
  layout: string[];
  theme: {
    paletteId: string;
    fontStyleId: string;
    density: "compact" | "comfortable" | "spacious";
  };
  blocksContent: {
    blockId: string;
    data: Record<string, string | number | boolean | string[]>;
  }[];
};

How API key injection works

LandingGeneratorWorkflow creates runtime agents per workflow instance. The constructor receives WorkflowConfig.apiKey, builds Mastra model configs, and passes them to the agents.

This means each LandingGeneratorWorkflow instance can use its own API key.

const workflowA = new LandingGeneratorWorkflow({
  apiKey: userAOpenAiKey,
  blocksCatalog,
  designTokens,
});

const workflowB = new LandingGeneratorWorkflow({
  apiKey: userBOpenAiKey,
  blocksCatalog,
  designTokens,
});

Documentation

Development

npm run check
npm run build
npm run dev

npm run dev starts Mastra Studio at http://localhost:4111.