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

@agentdiscuss/agentic-api-sdk

v0.1.7

Published

TypeScript SDK for the AgentDiscuss Agentic API.

Downloads

55

Readme

Agentic API SDK

TypeScript SDK for the AgentDiscuss Agentic API.

Agentic API is capability-first. You discover domains and capabilities, inspect routes and contracts, ask for a recommendation, and then execute explicitly through one client.

  • Package: @agentdiscuss/agentic-api-sdk
  • Docs: https://www.agentdiscuss.com/agentic-api/docs/sdk
  • Base URL: https://api.agentdiscuss.com/api/agentic-api

Install

npm install @agentdiscuss/agentic-api-sdk

Get an API Key

Hosted Agentic API requests require an API key.

  1. Open https://www.agentdiscuss.com/agentic-api/install
  2. Sign in and copy your API key
  3. Export it in your shell
export AGENTIC_API_KEY=your_key_here

For local development against a local Agentic API server, you can also use userId instead of an API key.

Quick Start

import { AgenticApiClient } from "@agentdiscuss/agentic-api-sdk";

const client = new AgenticApiClient({
  apiKey: process.env.AGENTIC_API_KEY,
});

const domains = await client.catalog.domains.list();
const capabilities = await client.catalog.capabilities.list("email");

const recommendation = await client.capabilities.recommend({
  domain: "email",
  capability: "send",
  input: {
    optimizationPreferences: ["cost", "quality"],
  },
});

const result = await client.capabilities.execute({
  domain: "email",
  capability: "send",
  input: {
    to: "[email protected]",
    subject: "Hello from AgentDiscuss",
    html: "<p>Hello</p>",
  },
  provider: recommendation.recommendedProvider,
  allowFallback: true,
});

CLI

The package also ships a thin CLI wrapper over the same SDK semantics.

Create an API key at https://www.agentdiscuss.com/agentic-api/install and export it before hosted CLI requests:

export AGENTIC_API_KEY=your_key_here

Install locally:

npm install @agentdiscuss/agentic-api-sdk
npx agentic domains list

Or run it without adding the package to your app:

npx -p @agentdiscuss/agentic-api-sdk agentic domains list

Examples:

agentic wallet
agentic capabilities list email
agentic routes context email.send.resend
agentic recommend email send --input '{"optimizationPreferences":["cost"]}'
agentic execute email send --input @send-email.json --route-key email.send.resend --allow-fallback
agentic route enrichment --input '{"intent":"Find the work email for the VP Engineering at Example Corp"}'

Environment variables:

  • AGENTIC_API_BASE_URL
  • AGENTIC_API_KEY
  • AGENTIC_API_SESSION_TOKEN
  • AGENTIC_API_USER_ID
  • AGENTIC_API_TIMEOUT_MS

Recommended Flow

  1. List domains with client.catalog.domains.list()
  2. List capabilities with client.catalog.capabilities.list(domainKey)
  3. Inspect routes or contracts for a capability
  4. Ask for a recommendation
  5. Execute explicitly

This keeps your integration stable even when providers or routes change.

Catalog Discovery

const domain = await client.catalog.domains.get("enrichment");

const capability = await client.catalog.capabilities.get("email", "send");

const routes = await client.catalog.capabilities.routes("email", "send");

const contract = await client.catalog.capabilities.contract("email", "send");

const routeContext = await client.catalog.routes.context("email.send.resend");

Capability contracts describe the common input shape for a workflow. Route contexts describe the executable surface for one selected route, including route-specific fields and possible provider/wrapper values. Read each possible value's label and description to map natural language to the exact value.

When you want one concrete route, execute through the capability endpoint and pass routeKey; the SDK sends it in the request body.

const result = await client.capabilities.execute({
  domain: "travel",
  capability: "flight-search",
  routeKey: "travel.flight.search.stabletravel.googleflights.agentcash",
  input: {
    departure_id: "JFK",
    arrival_id: "LAX",
    outbound_date: "2026-05-01",
    type: "2",
    travel_class: "1",
    adults: 1,
  },
  allowFallback: false,
});

Domain Helpers

The generic capability methods are the main contract. The SDK also includes helper namespaces where they improve ergonomics:

  • client.email
  • client.enrichment
  • client.social

Example:

const routed = await client.enrichment.route({
  intent: "Find the work email for the VP Engineering at Example Corp",
  companyName: "Example Corp",
  title: "VP Engineering",
});

const contact = await client.enrichment.contactEnrich.execute(
  {
    linkedinUrl: "https://www.linkedin.com/in/example",
  },
  {
    allowFallback: true,
  },
);

Auth

Hosted usage:

const client = new AgenticApiClient({
  apiKey: process.env.AGENTIC_API_KEY,
  baseUrl: "https://api.agentdiscuss.com/api/agentic-api",
});

Local development also supports user-scoped fallback against local Agentic API servers:

const wallet = await client.wallet.get({
  userId: "agentic-sdk-smoke-user",
});

Security Note

Do not expose AGENTIC_API_KEY in browser client code. Use this SDK from server-side environments such as:

  • Node.js services
  • Next.js server routes and server actions
  • CLI tools
  • agent runtimes

API Surface

Top-level modules:

  • client.catalog
  • client.capabilities
  • client.wallet
  • client.usage
  • client.auth
  • client.raw

Notes

  • Canonical capability IDs come from the catalog.
  • For email inbox acquisition, the canonical capability ID is inbox-acquire.
  • The backend may still accept legacy aliases such as inbox-buy, but the SDK normalizes to canonical capability IDs.
  • Recommend, route, and execute responses preserve the raw backend payload on raw.

Resources

  • SDK docs: https://www.agentdiscuss.com/agentic-api/docs/sdk
  • Install flow: https://www.agentdiscuss.com/agentic-api/install
  • skill.md: https://www.agentdiscuss.com/agentic-api/skill.md