{"_id":"@bluebag/langchain","name":"@bluebag/langchain","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bluebag/langchain","version":"0.1.0","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"description":"LangChain integration for Bluebag","repository":{"type":"git","url":"git+https://github.com/BluebagAI/bluebag.git","directory":"packages/langchain"},"license":"MIT","keywords":["bluebag","ai","sdk","langchain"],"scripts":{"build":"tsup","build:watch":"tsup --watch","clean":"node -e \"const fs=require('fs');const path=require('path');const dir=path.join(__dirname,'dist');if(fs.existsSync(dir))fs.rmSync(dir,{recursive:true,force:true});\"","dev":"npm run build:watch","typecheck":"tsc --noEmit"},"dependencies":{"@bluebag/core":"*","zod":"^3.24.0"},"peerDependencies":{"@langchain/core":"^0.3.0"},"devDependencies":{"@langchain/core":"^0.3.0","@types/node":"^20.14.9","tsup":"^8.0.0","typescript":"^5.5.2"},"_id":"@bluebag/langchain@0.1.0","gitHead":"7faab670cb4f705367217ca774c6822163cfdf30","bugs":{"url":"https://github.com/BluebagAI/bluebag/issues"},"homepage":"https://github.com/BluebagAI/bluebag#readme","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-wqcqFwd7MdwUoRAfzyvREy47mIVYSxIki2DoVLBPE5n3Dh7CLdwQ1KkpxWMzoTOO/Sinv/Fk7EuKxqjr8j5H9A==","shasum":"6c167741ca50682c1901179c3f85485e4ca07bcc","tarball":"https://registry.npmjs.org/@bluebag/langchain/-/langchain-0.1.0.tgz","fileCount":4,"unpackedSize":14128,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrRkPxZ4L1uwEmBJsUjiPsAnyE2uDoH2rFIRBfp4O0uwIhAKjVFLUK6iznX5efj7+Taso+ne7lpUFPOWvBKs3jW3uR"}]},"_npmUser":{"name":"ohansfavour","email":"fohanekwu@gmail.com"},"directories":{},"maintainers":[{"name":"ohansfavour","email":"fohanekwu@gmail.com"},{"name":"ohansemmanuel","email":"ohansemmanuel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/langchain_0.1.0_1769010708712_0.7355321280472111"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-21T15:51:48.634Z","0.1.0":"2026-01-21T15:51:48.886Z","modified":"2026-01-21T15:51:49.088Z"},"maintainers":[{"name":"ohansfavour","email":"fohanekwu@gmail.com"},{"name":"ohansemmanuel","email":"ohansemmanuel@gmail.com"}],"description":"LangChain integration for Bluebag","homepage":"https://github.com/BluebagAI/bluebag#readme","keywords":["bluebag","ai","sdk","langchain"],"repository":{"type":"git","url":"git+https://github.com/BluebagAI/bluebag.git","directory":"packages/langchain"},"bugs":{"url":"https://github.com/BluebagAI/bluebag/issues"},"license":"MIT","readme":"# @bluebag/langchain\n\nLangChain integration for Bluebag.\n\n## Installation\n\n```bash\nnpm install @bluebag/langchain langchain @langchain/openai\n```\n\n## Quick Start\n\n```typescript\nimport { createAgent } from 'langchain';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { Bluebag } from '@bluebag/langchain';\n\n// Create the Bluebag client\nconst bluebag = new Bluebag({\n  apiKey: process.env.BLUEBAG_API_KEY!,\n});\n\n// Enhance your config with Bluebag tools\nconst config = await bluebag.enhance({\n  model: 'openai:gpt-4o',\n  messages: [\n    new HumanMessage('Create a Python script that prints hello world'),\n  ],\n});\n\n// Create a LangChain agent\nconst agent = createAgent({\n  model: config.model,\n  tools: config.tools,\n  systemPrompt: config.systemMessage,\n});\n\n// Run the agent\nconst result = await agent.invoke({ messages: config.messages });\n\nconsole.log(result.messages.at(-1)?.content);\n```\n\n## Configuration Options\n\n```typescript\nconst bluebag = new Bluebag({\n  apiKey: process.env.BLUEBAG_API_KEY!,\n  stableId: 'user-123', // Optional: for multi-tenant isolation\n  activeSkills: ['skill-id'], // Optional: restrict to specific skills\n  stripMimeTypes: ['image/png'], // Optional: strip specific MIME types from messages\n});\n```\n\n## Tools\n\nThe package provides the following tools:\n\n- **bluebag_bash** - Execute bash commands in the sandbox\n- **bluebag_code_execution** - Run Python, JavaScript, or TypeScript code\n- **bluebag_computer_use** - Control the sandbox desktop\n- **bluebag_text_editor** - View, create, and edit files\n- **bluebag_file_download_url** - Get download URLs for generated files\n\n## API Reference\n\n### `Bluebag` Class\n\nThe main client class for Bluebag integration.\n\n```typescript\nconst bluebag = new Bluebag({ apiKey: \"...\" });\n\n// Enhance your config with Bluebag tools\nconst config = await bluebag.enhance({\n  model: \"openai:gpt-4o\",\n  messages: [...],\n});\n\n// Session management\nawait bluebag.initSession();\nconst sessionId = bluebag.getSessionId();\nbluebag.setStableId(\"user-123\");\nbluebag.setActiveSkills([\"pdf-processing\"]);\n\n// File operations\nconst file = await bluebag.files.create({ file, filename, mediaType });\nconst blob = await bluebag.files.download(fileId);\nconst metadata = await bluebag.files.retrieveMetadata(fileId);\nconst url = await bluebag.files.mintShortLivedDownloadUrl(fileId);\n```\n\n### Constructor Options\n\n| Option           | Type           | Description                                  |\n| ---------------- | -------------- | -------------------------------------------- |\n| `apiKey`         | `string`       | Your Bluebag API key (required)              |\n| `stableId`       | `string`       | Stable identifier for multi-tenant isolation |\n| `activeSkills`   | `string[]`     | Array of skill IDs to enable                 |\n| `apiBaseUrl`     | `string`       | Custom API base URL                          |\n| `fetchImpl`      | `typeof fetch` | Custom fetch implementation                  |\n| `stripMimeTypes` | `string[]`     | MIME types to strip from messages            |\n","readmeFilename":"README.md","_rev":"1-6f71473d9081ffcb2f903d3b8cc7eed5"}