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

@bluebag/langchain

v0.1.0

Published

LangChain integration for Bluebag

Readme

@bluebag/langchain

LangChain integration for Bluebag.

Installation

npm install @bluebag/langchain langchain @langchain/openai

Quick Start

import { createAgent } from 'langchain';
import { HumanMessage } from '@langchain/core/messages';
import { Bluebag } from '@bluebag/langchain';

// Create the Bluebag client
const bluebag = new Bluebag({
  apiKey: process.env.BLUEBAG_API_KEY!,
});

// Enhance your config with Bluebag tools
const config = await bluebag.enhance({
  model: 'openai:gpt-4o',
  messages: [
    new HumanMessage('Create a Python script that prints hello world'),
  ],
});

// Create a LangChain agent
const agent = createAgent({
  model: config.model,
  tools: config.tools,
  systemPrompt: config.systemMessage,
});

// Run the agent
const result = await agent.invoke({ messages: config.messages });

console.log(result.messages.at(-1)?.content);

Configuration Options

const bluebag = new Bluebag({
  apiKey: process.env.BLUEBAG_API_KEY!,
  stableId: 'user-123', // Optional: for multi-tenant isolation
  activeSkills: ['skill-id'], // Optional: restrict to specific skills
  stripMimeTypes: ['image/png'], // Optional: strip specific MIME types from messages
});

Tools

The package provides the following tools:

  • bluebag_bash - Execute bash commands in the sandbox
  • bluebag_code_execution - Run Python, JavaScript, or TypeScript code
  • bluebag_computer_use - Control the sandbox desktop
  • bluebag_text_editor - View, create, and edit files
  • bluebag_file_download_url - Get download URLs for generated files

API Reference

Bluebag Class

The main client class for Bluebag integration.

const bluebag = new Bluebag({ apiKey: "..." });

// Enhance your config with Bluebag tools
const config = await bluebag.enhance({
  model: "openai:gpt-4o",
  messages: [...],
});

// Session management
await bluebag.initSession();
const sessionId = bluebag.getSessionId();
bluebag.setStableId("user-123");
bluebag.setActiveSkills(["pdf-processing"]);

// File operations
const file = await bluebag.files.create({ file, filename, mediaType });
const blob = await bluebag.files.download(fileId);
const metadata = await bluebag.files.retrieveMetadata(fileId);
const url = await bluebag.files.mintShortLivedDownloadUrl(fileId);

Constructor Options

| Option | Type | Description | | ---------------- | -------------- | -------------------------------------------- | | apiKey | string | Your Bluebag API key (required) | | stableId | string | Stable identifier for multi-tenant isolation | | activeSkills | string[] | Array of skill IDs to enable | | apiBaseUrl | string | Custom API base URL | | fetchImpl | typeof fetch | Custom fetch implementation | | stripMimeTypes | string[] | MIME types to strip from messages |