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

@tcb-sandbox/e2b-sandbox-adapter

v0.3.13

Published

Local adapter/proxy that bridges E2B SDK to tcb-remote-workspace, handling path rewriting and session header injection.

Downloads

274

Readme

@tcb-sandbox/e2b-sandbox-adapter

E2B SDK 适配代理,让标准 E2B SDK 透明连接到 TRW。

安装

pnpm add @tcb-sandbox/e2b-sandbox-adapter e2b

快速开始

import { startAdapter } from "@tcb-sandbox/e2b-sandbox-adapter"
import { Sandbox } from "e2b"

const adapter = await startAdapter({
  endpoint: "https://your-gateway.com",
  sessionId: "your-session-id",
})

const sandbox = new Sandbox({
  sandboxId: "any",
  debug: true,
  envdVersion: "99.99.99",
})

// 文件操作
await sandbox.files.write("hello.txt", "Hello!")
const content = await sandbox.files.read("hello.txt")

// 命令执行
const result = await sandbox.commands.run("echo hello")
console.log(result.stdout)

await adapter.close()

架构

E2B SDK → 127.0.0.1:49983 → adapter → TRW /e2b-compatible/*

Adapter 自动处理:

  • 路径改写:/health/e2b-compatible/health
  • Header 注入:X-Cloudbase-Session-Id
  • 全双工流式转发

API

startAdapter(options)

| 参数 | 必填 | 默认值 | 说明 | |------|:----:|--------|------| | endpoint | ✅ | - | TRW 网关 URL | | sessionId | ✅ | - | Session ID | | pathPrefix | - | /e2b-compatible | 路径前缀 | | port | - | 49983 | 代理端口 | | adminPort | - | 49984 | 管理 API 端口 | | host | - | 127.0.0.1 | 绑定地址 | | logLevel | - | warn | 日志级别 |

AdapterHandle

| 属性/方法 | 说明 | |-----------|------| | setSessionId(value) | 热更新 session | | setEndpoint(value) | 热更新 endpoint | | close() | 优雅关闭 |

运行时热更新

// 直接调用方法
adapter.setSessionId("new-session-id")
adapter.setEndpoint("https://new-gateway.com")

或通过 Management API:

curl -X PUT http://127.0.0.1:49984/_admin/config \
  -d '{"sessionId": "new", "endpoint": "https://new.com"}'

CLI 模式

pnpm dlx @tcb-sandbox/e2b-sandbox-adapter \
  --endpoint https://your-gateway.com \
  --session-id your-session-id

限制

  • 仅数据面(Sandbox.connect/create 不支持)
  • 必须使用 adapter(SDK 不能直连)
  • StreamInput 未实现
  • 输出上限 10 MB

E2B SDK 注意(2.14+)

  • 设置 envdVersion: "99.99.99"
  • sendStdinstdin: true 启动