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

hackclubai-ts

v1.3.0

Published

TypeScript implementation of Hack Club AI

Readme

HackClubAI.ts

A typescript implementation of the HackClub AI api with built in JSON tooling support, web search, and prompt generation.

Installing

Install via npm or pnpm from npmjs or directly from GitHub:

# latest release
npm install hackclubai-ts

# latest push / nightly
npm install github:gavingogaming/hackclubai-ts

Usage

First, create a Config with your hackclub AI api key, supplying it to a HCAI Requestor to actually make requests.

import {Config, HCAIRequestor} from 'hackclubai-ts';

const config = createConfig(process.env.HACKCLUB_AI);
const requestor = new HCAIRequestor(config);

Once a requestor is made, you can use it to send all requests to the Hack Club AI api.

// awaited request
let response = await requestor.request(config.ROUTES[...], {...});

// SSE / streamed request
requestor.request(config.ROUTES[...], {...}, {
    onMessage: (event) => {
        console.log("SSE message: ", event.data);
    },
    onError: (err) => {
        console.error("SSE error: ", error);
    }
})

Tooling

HackClubAI.ts includes a JSON-based tooling helper. This will not work for all models, and it isn't a 100% success rate for working models to spit out reliable results. I've seen success often with nvidia/nemotron-3-ultra-550b-a55b:free.

[!WARNING] Tooling has not been tested for streaming/SSE. You'll need to check once the reply is complete, and for user experience, don't show raw reply segments if the first segment includes the start of a JSON object.

Create a HCAI Tooling that contains all your tools:

const tooling = new HCAITooling({
    'get_name': {
        name: 'Get Name',
        description: "Returns the current user's name.",
        // hasQuery?: false
        execute: async (query?: string) => {
            return "John Doe";
        }
    }
});

You can then add the tooling's system prompt, passing your own system prompt & previous tool responses (you have to store those yourself!)

You do not need to pass previousReplies for non-chat requests.

let previousReplies = [];
const systemPrompt = "You are a helpful assistant.";

/* request data */
return {
    model: ...,
    messages: [
        await tooling.getSystemMessage(systemPrompt, previousReplies),
        ...
    ]
};

Then, loop the request until all tool calls are done, checking with the tooling's tryExecuteTool.

async function call(query: string, previousReplies?: any) {
    const data = await requestor.request(config.ROUTES.chat, {
        model: ...,
        messages: [
            await tooling.getSystemMessage(systemPrompt, previousReplies),
            {
                role: 'user',
                content: query
            }
        ]
    }) as any;

    const toolResult = await tooling.tryExecuteTool(data.choices[0].message.content);
    if (toolResult.toolCalled) {
        return await call(query, [...(previousReplies || []), toolResult]);
    }
    return data.choices[0].message;
}

Utility

HackClubAI.ts also contains some utility functions.

DEFAULT_TOOLS is a helper for creating common tools, including web_search (exa's answer api) and web_contents (exa's search+contents api).

const tooling = new HCAITooling({
    ...,
    'web_search': {
        name: 'Web Search',
        description: 'Search the web to get information.',
        hasQuery: true,
        execute: DEFAULT_TOOLS.web_search(config)
    }
});

PROMPTING is a helper for creating your system prompts. Currently only contains currentDateTime.

import {PROMPTING} from 'hackclubai-ts';
const prompt = `You are a helpful assistant. ${PROMPTING.currentDateTime()}`;