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

@monagoio/monago-atrium-ts

v0.1.1

Published

Atrium SDK — an AI runtime for governed systems. Governance visible (PII redaction, policy decisions, audit IDs, cost) on every call.

Readme

Atrium SDK — TypeScript

An AI runtime for governed systems — not just an LLM wrapper.

Atrium SDK is the official TypeScript/JavaScript client for the Monago Atrium gateway. It surfaces an OpenAI-compatible chat completion API, but with one critical difference: governance is visible on every call.

Every response carries a structured governance object — auditId, piiRedacted, policyDecision, provider, latencyMs, costIdr — parsed from the gateway's response headers. Blocks aren't opaque either: PII / security / policy blocks throw typed errors that carry the same audit trail.

This is the SDK for teams that need to ship LLM features into regulated environments (healthcare, finance, government) without losing the audit trail.


Install

npm install @monagoio/monago-atrium-ts

Works in Node.js 18+, Deno, Bun, and edge runtimes — uses the platform's native fetch, zero runtime dependencies. Ships ESM + CommonJS builds and full TypeScript types.


Quickstart

import { Atrium } from "@monagoio/monago-atrium-ts";

const client = new Atrium({
  apiKey: "sk-mng-your-key",
  baseUrl: "https://api.monago.io/v1",
});

const res = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [{ role: "user", content: "Pasien NIK 3201... batuk 2 minggu" }],
});

// OpenAI-compatible surface — drop-in for existing code.
console.log(res.content);
console.log(res.choices[0]?.finishReason);
console.log(res.usage.totalTokens);

// The differentiator — governance, parsed and typed.
console.log(res.governance.auditId);        // "audit-uuid-..."
console.log(res.governance.piiRedacted);     // ["NIK"]
console.log(res.governance.policyDecision);  // "allowed"
console.log(res.governance.provider);        // "openai"
console.log(res.governance.latencyMs);       // 412.3
console.log(res.governance.costIdr);         // 12.5 (or null if gateway doesn't surface cost)

The API key can also come from the ATRIUM_API_KEY environment variable (Node only):

const client = new Atrium(); // reads process.env.ATRIUM_API_KEY

Block errors carry governance too

When the gateway blocks a request (PII / security / policy / model), the SDK throws a typed error that still carries the audit trail:

import { Atrium, PIIBlockedError } from "@monagoio/monago-atrium-ts";

const client = new Atrium({ apiKey: "sk-mng-your-key" });

try {
  const res = await client.chat.completions.create({
    model: "gpt-5.4-mini",
    messages: [{ role: "user", content: "leak SSN 123-45-6789" }],
  });
} catch (err) {
  if (err instanceof PIIBlockedError) {
    console.log("blocked:", err.blockReason);
    console.log("audit:", err.auditId); // still traceable
    console.log("decision:", err.policyDecision);
  }
}

Error hierarchy:

AtriumError
├── AuthError                   (401/403)
├── RateLimitError              (429)
├── APIError                    (5xx / malformed / network)
├── TimeoutError
└── PolicyBlockedError          (400/422/451 with policyDecision=blocked)
    ├── PIIBlockedError
    ├── SecurityBlockedError    (prompt injection, jailbreak)
    └── ModelNotAllowedError

Open-core note

The SDK itself is open source (MIT). The governance engine — policy DSL, PII detection, security analysis, audit trail — runs in the Atrium gateway, a hosted Monago service. Get an API key at monago.io.


Roadmap

Shipped:

  • [x] Atrium client
  • [x] chat.completions.create with an OpenAI-compatible body
  • [x] Governance metadata parsed from X-Monago-* response headers
  • [x] Typed error hierarchy with governance context on every block
  • [x] Native fetch, zero runtime deps — isomorphic (Node / Deno / Bun / edge)
  • [x] ESM + CommonJS builds with full type declarations

Upcoming:

  • [ ] Streaming chat completions (SSE)
  • [ ] Eval hooks — pre- and post-response evaluators (toxicity, PII, custom)
  • [ ] Skills — packaged tool / capability bundles
  • [ ] Tracing — OpenTelemetry integration
  • [ ] Request metadata tagging — attach userId / sessionId / custom fields to every audit record
  • [ ] Multi-agent — orchestration primitives

Development

npm install
npm run build      # tsup -> dist (ESM + CJS + d.ts)
npm test           # vitest
npm run typecheck  # tsc --noEmit

Questions or contributions

Any questions, bug reports, or contributions — reach the founder directly:

Pull requests welcome. For larger changes, open an issue first to discuss the direction.


License

MIT — see LICENSE.