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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dexy-ai/agent-sdk

v0.1.5

Published

Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.

Readme

Dexy Agent SDK

Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the /api/search, /api/execute/:id, and /api/run endpoints and adds simple streaming support.

Install

npm install @dexy-ai/agent-sdk

Quick start

import { DexyClient } from "@dexy-ai/agent-sdk";

const dexy = new DexyClient({
  apiKey: process.env.DEXY_API_KEY!, // obtain from the /api-keys page in the app
  // baseURL defaults to https://api.dexy.run; override for local dev
  // baseURL: "http://localhost:3000",
  debug: true, // optional: logs run/search/execute steps to console
});

const result = await dexy.run({ prompt: "Explain blockchain like I'm five" });
console.log(result.output);

Streaming

const streamResult = await dexy.run({ prompt: "Write a haiku", stream: true });
if (!streamResult.stream) throw new Error("stream missing");

for await (const chunk of streamResult.stream) {
  process.stdout.write(chunk);
}

You can also stream a specific agent (the SDK calls /api/execute/:agentId under the hood). Streaming works if the server responds with text/event-stream; otherwise you will get a single chunk with the full response body.

const exec = await dexy.execute({ agentId: "openai-gpt4", input: "Draft a tweet", stream: true });
for await (const token of exec.stream!) {
  process.stdout.write(token);
}

Search + execute manually

const search = await dexy.search({ prompt: "Best agent for research" });
const exec = await dexy.execute({ agentId: search.agentId, input: "Summarize the latest LLM papers" });

console.log({
  agentId: search.agentId,
  confidence: search.confidence,
  output: exec.output,
  usage: exec.usage,
});

Error handling

All methods throw DexyError for HTTP or API failures.

import { DexyClient, DexyError } from "@dexy/agent-sdk";

try {
  await dexy.run({ prompt: "" });
} catch (err) {
  if (err instanceof DexyError) {
    console.error(err.code, err.status, err.message);
    console.error("details", err.details);
  }
}

Configuration

  • apiKey (required): sent as Authorization: Bearer <API_KEY>
  • baseURL (optional): defaults to https://api.dexy.run; set http://localhost:3000 for local Next.js API routes

API surface

  • client.run({ prompt, meta?, stream? }) → high-level search + execute; returns { output, usage, agent?, stream? }
  • client.search({ prompt, meta? }){ agentId, confidence, raw }
  • client.execute({ agentId, input, meta?, stream? }){ output, usage, agent?, stream? }

Handling JSON outputs

Some agents return JSON (e.g., { ok, results, finalReport }). After run/execute, parse and pick the fields you need:

const result = await dexy.run({ prompt: "research MEV" });
const payload = JSON.parse(result.output);
console.log(payload.results); // or payload.finalReport

Local development

Inside sdk/:

npm install
npm run build

The build outputs to sdk/dist (ignored by git).