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

@ai-universe/config-utils

v1.0.1

Published

Shared configuration utilities for AI Universe ecosystem

Readme

@ai-universe/config-utils

Shared configuration utilities for the AI Universe ecosystem. This package provides centralized configuration management with support for environment variables, GCP Secret Manager, and Firestore-based runtime configuration.

Features

  • ConfigManager: Unified configuration loading with GCP Secret Manager fallback
  • SecretManager: Google Cloud Secret Manager integration with caching
  • RuntimeConfigService: Dynamic configuration stored in Firestore
  • Constants & Validation: Shared limits, timeouts, and validation rules
  • Type Safety: Full TypeScript support with exported interfaces

Installation

npm install @ai-universe/config-utils

Usage

ConfigManager

import { ConfigManager, configManager } from '@ai-universe/config-utils';

// Load complete application configuration
const config = await configManager.loadConfig();
console.log('Server port:', config.server.port);
console.log('API keys configured:', Object.keys(config.apiKeys));

SecretManager

import { SecretManager } from '@ai-universe/config-utils';

const secretManager = new SecretManager('your-gcp-project');
const apiKey = await secretManager.getSecret('claude-api-key');

RuntimeConfigService

import { runtimeConfigService } from '@ai-universe/config-utils';

// Get current configuration
const runtimeConfig = await runtimeConfigService.getConfig();
console.log('Rate limits:', runtimeConfig.rateLimit);

// Update configuration
await runtimeConfigService.updateConfigValue('features', {
  enableCerebras: true,
  enableClaude: true
});

Constants & conversation defaults

import {
  MAX_QUESTION_LENGTH,
  DEFAULT_TIMEOUT_MS,
  MODEL_SPECIFIC_LIMITS,
  DEFAULT_SECONDARY_MODELS,
  MAX_CLIENT_FINGERPRINT_LENGTH,
  estimateTokens
} from '@ai-universe/config-utils';

// Validate input length
if (userInput.length > MAX_QUESTION_LENGTH) {
  throw new Error('Input too long');
}

// Estimate tokens
const tokenCount = estimateTokens(userInput.length);

All constants from SecondOpinionConfig.ts are available through the package entry point so downstream consumers no longer need to deep import from dist/SecondOpinionConfig.js.

Verifying the public API

After building the package, you can confirm that the published surface matches the TypeScript source by listing the exported keys from Node:

npm run build
npm run check:exports

The check:exports script executes scripts/check-exports.mjs to import the package entry point and print the sorted export keys. This helper is suitable as a lightweight regression check in CI to ensure the build artifact matches the TypeScript source.

Extracted Code

This package contains 874 LOC extracted from AI Universe backend:

  • ConfigManager.ts (485 LOC) - Environment/API key/Firebase configuration
  • SecretManager.ts (171 LOC) - GCP Secret Manager integration
  • RuntimeConfigService.ts (218 LOC) - Dynamic Firestore configuration

API Reference

Types

  • AppConfig - Complete application configuration interface
  • RuntimeConfig - Dynamic runtime configuration interface
  • ConfigSource - Configuration value source tracking
  • PrimaryModelName - Supported AI model names

Constants

  • Input validation limits (MAX_QUESTION_LENGTH, etc.)
  • Timeout configurations (MIN/MAX/DEFAULT_TIMEOUT_MS)
  • Model-specific limits (MODEL_SPECIFIC_LIMITS)
  • Error messages (ERROR_MESSAGES)

Dependencies

  • @google-cloud/secret-manager - GCP Secret Manager client
  • @google-cloud/firestore - Firestore client
  • winston - Logging

License

MIT