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

gcsdk

v1.0.9

Published

Git Chat SDK - A Git-like conversation SDK for managing chat histories with branching support

Readme

gcsdk

A Git-like conversation SDK for managing chat histories with branching support. Built with Rust (via Neon) for performance.

Overview

gcsdk models chat conversations as a git-like tree structure where each message is a "commit" that can:

  • Have a parent message (forming a linked history)
  • Belong to a branch
  • Snapshot file state at that point in the conversation

This enables features like:

  • Branching conversations to explore different paths
  • Switching between conversation branches
  • Tracking file changes alongside messages

Installation

Installation

npm install gcsdk
# or
bun add gcsdk
# or
pnpm add gcsdk
# or
yarn add gcsdk

Note: The native module is pre-built and included in the package. No Rust installation required!

Troubleshooting

If you encounter an error about the native module not being found, ensure you're using the published version from npm. The native module is pre-built and included in the package.

If you're developing locally, you'll need Rust installed to build the native module:

cd native
npm install
npm run build

From source

git clone https://github.com/warpy-ai/gcsdk.git
cd gcsdk
npm install
npm run build

Usage

import { GitChat } from "gcsdk";

const chat = new GitChat();

// Commit a message with file snapshots
await chat.commit(
  { role: "user", content: "Hello!" },
  { "main.ts": "console.log('hello')" }
);

await chat.commit(
  { role: "assistant", content: "Hi there!" },
  { "main.ts": "console.log('hello')" }
);

// Create a branch from main
chat.createBranch("experiment", "main");
chat.checkout("experiment");

// Commits on this branch won't affect main
await chat.commit(
  { role: "user", content: "Let's try something different" },
  { "main.ts": "console.log('experiment')" }
);

// Switch back to main
chat.checkout("main");

// Get conversation history for current branch
const history = chat.getHistory();

API

GitChat

commit(message, files): Promise<string>

Commits a message to the current branch with an optional file snapshot.

  • message: { role: "user" | "assistant" | "system", content: string }
  • files: Record<string, string> - filepath to content mapping
  • Returns: commit ID (SHA256 hash)

createBranch(branchName, baseBranchName): void

Creates a new branch from an existing branch's head.

checkout(branchName): void

Switches to the specified branch.

getHistory(): ChatNode[]

Returns the full message history for the current branch, ordered from oldest to newest.

ChatNode

interface ChatNode {
  id: string;
  parent_id: string | null;
  role: string;
  content: string;
  vfs_snapshot: Record<string, string>;
}

Architecture

  • TypeScript layer (index.ts): Provides the high-level GitChat API
  • Rust native module (native/src/lib.rs): Handles the core data structures and operations using Neon bindings

The conversation tree is stored in memory with:

  • nodes: HashMap of commit ID to ChatNode
  • branches: HashMap of branch name to head commit ID

Development

# Build native module
cd native && npm run build

# Run tests
npm test

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

Apache-2.0