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

@getoma/sdk

v0.1.1

Published

Official TypeScript SDK for the oma managed agents platform. The API is also wire-compatible with @anthropic-ai/sdk via baseURL.

Readme

@getoma/sdk

⚠️ Deprecated — use @anthropic-ai/sdk instead

This package is no longer the recommended way to call the oma platform. The oma API is wire-compatible with Anthropic's Managed Agents API, so you can use the official Anthropic SDK directly:

npm i @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://oma.duyet.net",
  apiKey: process.env.OMA_API_KEY!,
});

const env = await client.beta.environments.create({
  name: "my-env",
  config: {
    type: "cloud",
    networking: { type: "unrestricted" },
    packages: { type: "packages" },
  },
});

The same SDK works against Anthropic's hosted API and any other compatible server — moving between providers is a baseURL change. OMA-specific endpoints (tenants, OAuth, evals, cost reports, …) live under /v1/oma/* and can be invoked via client._client.post('/v1/oma/...', ...).

No new versions of @getoma/sdk will be published. The source remains in the repo for reference. Existing users continue to work; please migrate at your convenience.


Official TypeScript SDK for the oma managed agents platform — typed REST + SSE streaming, runs anywhere fetch exists (Node ≥ 20, Bun, Deno, browsers, Cloudflare Workers).

Install

npm i @getoma/sdk
# or
pnpm add @getoma/sdk
# or
bun add @getoma/sdk

Quick start

import { Oma } from "@getoma/sdk";

const oma = new Oma({ apiKey: process.env.OMA_API_KEY! });

// Streaming chat — async iterator over typed events.
for await (const ev of oma.sessions.chat(sessionId, "Hello")) {
  if (ev.type === "agent.message_chunk") process.stdout.write(ev.delta);
}

Why streaming is first-class

Three kinds of stream — text, thinking, tool input — flow over the same SSE channel. Each carries a correlation id (message_id, thinking_id, tool_use_id) that matches the eventually-committed canonical event. The discriminated-union narrowing handles the rest:

for await (const ev of oma.sessions.chat(sessionId, "Use bash to print uptime")) {
  switch (ev.type) {
    case "agent.message_chunk":
      // Live text delta — incremental render.
      process.stdout.write(ev.delta);
      break;
    case "agent.message":
      // Canonical message — same message_id as the chunks above. Drop
      // your in-flight buffer; this content is the source of truth.
      break;
    case "agent.thinking_chunk":
      // Live extended-thinking delta.
      process.stderr.write(`💭 ${ev.delta}`);
      break;
    case "agent.tool_use":
      // Tool call committed — `id` matches any prior tool_use_input_chunk events.
      console.log(`→ ${ev.name}`, ev.input);
      break;
    case "agent.tool_result":
      console.log(`← ${ev.content}`);
      break;
    case "session.warning":
      // The recovery scan reconciled an interrupted stream after a
      // runtime restart — surface to the user as "stream dropped".
      console.warn(`⚠ ${ev.source}: ${ev.message}`);
      break;
    case "session.status_idle":
      return; // turn done; the server closes the stream too
  }
}

High-level chatComplete

When you don't need token-by-token rendering, chatComplete accumulates the stream into a structured summary:

const reply = await oma.sessions.chatComplete(sessionId, "Hello", {
  onText: (delta) => process.stdout.write(delta), // optional incremental hook
});

console.log(reply.text);           // assembled assistant text
console.log(reply.thinking);       // string[] — one per reasoning block
console.log(reply.toolCalls);      // {id, name, input}[] for every tool call
console.log(reply.toolResults);    // results paired by tool_use_id

Long-lived tail

For monitoring / dashboards / agent-to-agent observability:

// Replays history on connect, then streams every future event.
// Never closes; pass an AbortSignal or break out of the loop to stop.
for await (const ev of oma.sessions.tail(sessionId, { signal: ac.signal })) {
  console.log(ev.type, ev);
}

Resources covered

| Resource | Methods | |---|---| | oma.agents | list, get, create, update, delete | | oma.sessions | list, get, create, chat, chatComplete, tail, events, message, interrupt, archive, delete | | oma.environments | list, get, create, delete |

More resources land per release — file an issue if something you need is missing.

Errors

Every non-2xx throws an OmaError:

import { OmaError } from "@getoma/sdk";

try {
  await oma.sessions.get("sess-bogus");
} catch (err) {
  if (err instanceof OmaError) {
    console.error(err.status, err.body);
    if (err.status === 404) { /* handle missing */ }
  }
}

Auth

// API key — server-to-server, CLI scripts. Sent as `x-api-key`.
new Oma({ apiKey: "oma_..." });

// Cookie auth — for embedding in the Console UI. Sent as `Authorization: Bearer ...`.
new Oma({ bearer: cookieToken });

// Self-host
new Oma({ apiKey: "oma_...", baseUrl: "https://your.oma.example" });

// Multi-tenant (cookie-auth users in workspaces with multiple memberships)
new Oma({ bearer: cookieToken, activeTenantId: "tn_..." });

License

MIT — see LICENSE.