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

@botuyo/contracts

v0.3.1

Published

Shared TypeScript contracts (types & constants) for the BotUyo platform — AI models, voice profiles, REST envelope. Public, secret-free.

Readme

@botuyo/contracts

Shared TypeScript contracts (types & constants) for the BotUyo platform. Public on npm, secret-free — it only contains identifiers, enums and pure helpers that several repos must agree on.

Why this package exists

The BotUyo system is split across several independent repositories (backend services, web apps, and developer tooling). Without a shared package, the same contracts (model identifiers, voice profiles, the REST envelope, the API base URL) were re-declared by hand in each one and drifted apart. This package centralizes them so a change happens once.

What lives here (and what does NOT)

| In this package | Why | | --- | --- | | AI text-model identifiers + defaults + deprecation map | Hardcoded ~10x across repos | | Voice profile catalog (VOICE_PROFILES, resolveVoiceProfile) | Shared by backend services and web apps | | REST envelope (ApiResponse<T>, PaginatedData<T>) | Every frontend reads res.data.data | | DEFAULT_API_BASE_URL | Hardcoded across all consumers |

| NOT here | Why | | --- | --- | | Chat-widget socket events / props / theme | The widget (@botuyo/chat-widget-standalone) is public and self-contained. External consumers must never need a separate contracts package, so the widget keeps its own public contracts. | | Secrets, env values, API keys | This package is public. | | Business logic, framework code | Types & pure constants only. |

Install

npm install @botuyo/contracts

Usage

import {
  DEFAULT_API_BASE_URL,
  DEFAULT_TEXT_MODEL,
  normalizeModel,
  VOICE_PROFILES,
  resolveVoiceProfile,
  type ApiResponse,
  type AIProvider
} from '@botuyo/contracts'

// API base (frontends)
const API_URL = import.meta.env.VITE_API_URL || DEFAULT_API_BASE_URL

// Models
const model = normalizeModel(stored.model) // dead ids → live successor

// Voice
const profile = resolveVoiceProfile('Profesional Femenina') // → { id: 'kore', ... }

// REST typing
type AgentResponse = ApiResponse<{ id: string; name: string }>

Build

Dual ESM + CJS via tsup so both the CommonJS backend and the ESM frontends can import it.

npm install
npm run build      # → dist/index.js (esm), dist/index.cjs (cjs), dist/index.d.ts
npm run typecheck

Publishing

Versioned with semver. Publishing is fully automated by CI (.github/workflows/publish.yml):

  • Trigger: any push to main that changes package.json. A version guard compares the local version against the one on npm and publishes only when they differ — so a version bump is all you need.
  • Auth: npm trusted publishing via OIDC — no NPM_TOKEN, no long-lived secrets. Provenance is generated and signed automatically (proof the artifact came from this workflow).
  • Runner: ubuntu-latest (GitHub-hosted is required for provenance).
  • Fallback: the workflow also exposes workflow_dispatch for a manual re-run.

To cut a release, just bump and push:

npm version patch   # or minor / major
git push            # CI publishes the new version

Adding a contract

  1. Add/extend a module under src/ (e.g. src/ai/models.ts).
  2. Re-export it from src/index.ts.
  3. Bump the version and push — CI publishes — then bump the dependency in each consumer.

Keep it dependency-free at runtime and secret-free. If something is private or widget-public, it does not belong here.