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

@qlibin/tg-assistant-contracts

v2.1.0

Published

Shared message schemas and TypeScript types for tg-assistant SQS queues

Readme

@qlibin/tg-assistant-contracts

Shared message schemas and TypeScript types for the tg-assistant dual-queue SQS architecture.

Uses Zod as the single source of truth — one schema definition gives you TypeScript types, runtime validation, and JSON Schema files with zero drift between them.

Install

npm install @qlibin/tg-assistant-contracts

Usage

import {
  OrderMessage,         // TypeScript type (inferred from Zod)
  OrderMessageSchema,   // Zod schema (runtime validation)
  ResultMessage,
  ResultMessageSchema,
  SCHEMA_VERSION,
} from "@qlibin/tg-assistant-contracts";

// Type-safe message construction
const order: OrderMessage = {
  orderId: randomUUID(),
  taskType: "playwright-scraping",
  payload: { url: "https://example.com" },
  userId: "12345",
  timestamp: new Date().toISOString(),
  schemaVersion: SCHEMA_VERSION,
};

// Runtime validation (e.g., when consuming from SQS)
const parsed = OrderMessageSchema.parse(JSON.parse(record.body));

// Safe parsing (returns result instead of throwing)
const result = OrderMessageSchema.safeParse(JSON.parse(record.body));
if (!result.success) {
  console.error("Invalid message:", result.error);
}

Schemas

OrderMessage

Messages sent to the Order Queue for worker processing.

Required fields: orderId, taskType, payload, userId, timestamp, schemaVersion

Optional fields: priority, retryCount, deduplicationId, correlationId

ResultMessage

Processing results sent to the Result Queue for feedback handling.

Required fields: orderId, taskType, status, result, processingTime, timestamp, userId, schemaVersion

Optional fields: correlationId, followUpAction, priority, retryCount, cost, queueMetrics

Shared enums

| Export | Values | |------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | TaskType | playwright-scraping, url-monitoring, web-automation, perplexity-summary, content-analysis, text-processing, scheduled-linkedin, scheduled-german, system-health | | Priority | low, normal, high, critical | | Status | success, failure, partial, timeout, rate-limited, cancelled | | FollowUpAction | notify, requeue, enhance, escalate, archive |

JSON Schema files

Static JSON Schema (Draft-07) files are generated at build time and included in the published package under schemas/:

  • schemas/order-message.schema.json
  • schemas/result-message.schema.json

These can be used with validators like ajv if you prefer JSON Schema validation over Zod's .parse().

Schema versioning

All messages support an optional schemaVersion field (currently "1.0.0"). See Schema Versioning Conventions for compatibility rules.

Publishing

See the publishing procedure in CLAUDE.md.