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

@dmindai/sdk

v0.1.1

Published

TypeScript SDK for DMind AI — chat completions with built-in crypto trading tools (SEARCH_TOKEN, EXECUTE_SWAP).

Readme

DMind SDK

TypeScript SDK for the DMind AI platform — chat completions with built-in crypto trading tools.

Installation

npm install @dmindai/sdk

Quick Start

import {
  DMind,
  SEARCH_TOKEN,
  EXECUTE_SWAP,
  type SearchTokenInput,
  type ExecuteSwapInput,
} from "@dmindai/sdk";

// 1. Implement the two built-in tools with your own backend logic
//    params is fully typed — IDE will auto-complete all fields from SearchTokenInput / ExecuteSwapInput

const searchToken = SEARCH_TOKEN.implement(async (params: SearchTokenInput) => {
  const tokens = await myTokenService.search(params);
  return { tokens };
});

const executeSwap = EXECUTE_SWAP.implement(async (params: ExecuteSwapInput) => {
  const result = await myDexService.buildSwap(params);
  return { transaction: result.transaction, quote: result.quote };
});

// 2. Create the DMind client

const dmind = new DMind({
  baseUrl: "http://localhost:8000/v1", // vLLM local server
  apiKey: "your-api-key", // optional
});

// 3. Send a chat request with tool definitions

const response = await dmind.chat.send({
  messages: [{ role: "user", content: "Swap 1 SOL to USDC on Solana" }],
  model: "dmind-3-nano",
  tools: [searchToken.toDefinition(), executeSwap.toDefinition()],
  toolChoice: "auto",
});

// 4. Handle the tool call

const toolCall = response.choices[0].message.toolCalls?.[0];
if (toolCall) {
  const args = searchToken.parseInput(JSON.parse(toolCall.function.arguments));
  console.log("Tool called:", toolCall.function.name, args);
}

Built-in Tools

The SDK provides two fixed tools matching the DMind-3-nano model card. Their names, descriptions, and parameter schemas cannot be modified.

SEARCH_TOKEN

Search for a cryptocurrency token on-chain to retrieve its metadata or address.

| Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------ | | symbol | string | No | Token ticker symbol (e.g. SOL, USDC) | | address | string | No | Contract address of the token | | chain | string | No | Target blockchain: solana, ethereum, bsc, base | | keyword | string | No | Free-text search keywords |

EXECUTE_SWAP

Propose a token swap transaction.

| Parameter | Type | Required | Description | | -------------------- | ------ | -------- | --------------------------------------- | | inputTokenSymbol | string | Yes | Symbol of the token being sold | | inputTokenCA | string | No | Contract address of the input token | | outputTokenCA | string | No | Contract address of the output token | | inputTokenAmount | number | No | Absolute amount to swap | | inputTokenPercentage | number | No | Percentage of balance to swap (0.0–1.0) | | outputTokenAmount | number | No | Minimum output amount expected |

Using Tools Without Execute Logic

The tools can also be used directly without implement() — for schema definitions and input parsing only:

import { SEARCH_TOKEN, EXECUTE_SWAP } from "@dmindai/sdk";

// Get the fixed JSON schema for the chat API
const tools = [SEARCH_TOKEN.toDefinition(), EXECUTE_SWAP.toDefinition()];

// Parse and validate raw tool call arguments
const args = SEARCH_TOKEN.parseInput({ symbol: "SOL", chain: "solana" });

Streaming

const stream = await dmind.chat.send({
  messages: [{ role: "user", content: "Find the USDC token on Ethereum" }],
  model: "dmind-3-nano",
  tools: [searchToken.toDefinition()],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0].delta.content ?? "");
}

Multi-turn Tool Loop

For automated multi-turn conversations with tool execution:

import { DMind, runLoop } from "@dmindai/sdk";

const dmind = new DMind({
  modelGenerate: async (messages) => {
    // call your model inference here
    return modelResponse;
  },
  tools: {
    SEARCH_TOKEN: async (args) => {
      return await myTokenService.search(args);
    },
    EXECUTE_SWAP: async (args) => {
      return await myDexService.buildSwap(args);
    },
  },
});

const result = await runLoop(dmind, [
  { role: "user", content: "Swap 0.5 SOL to USDC" },
]);

console.log(result.final); // final parsed result
console.log(result.toolHops); // number of tool calls executed

Developer Prompt Guard (DMind-3-nano)

For dmind-3-nano, the SDK enforces the official developer prompt from the model card:

  • If no developer message is provided, the SDK injects the official one.
  • If a developer message exists but does not match the official policy, the SDK replaces it.
  • This guard is applied in both dmind.generate(...) and dmind.chat.send(...).
  • For custom modelProfile without developerPromptPolicy, no prompt is injected.

This keeps tool-call behavior aligned with the model's expected protocol.