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 🙏

© 2025 – Pkg Stats / Ryan Hefner

agentsphere-sandbox

v1.0.0

Published

云端代码沙箱 SDK - 为 AI agents 提供安全的代码执行环境

Downloads

13

Readme

agentsphere-sandbox

云端代码沙箱 SDK - 为 AI agents 提供安全的代码执行环境

简介

这是一个强大的云端代码执行平台 SDK,专为 AI agents 和自动化系统设计。提供安全隔离的沙箱环境,支持在云端运行各种编程语言的代码。

安装

npm install agentsphere-sandbox

快速开始

1. 获取 API 密钥

  1. 注册云沙箱服务账号
  2. 获取您的 API 密钥
  3. 设置环境变量:
SANDBOX_API_KEY=your_api_key_here

2. 使用代码解释器

import { Sandbox } from 'agentsphere-sandbox'

// 创建云端沙箱实例
const sandbox = await Sandbox.create()

// 执行 Python 代码
const result = await sandbox.runCode(`
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

print(fibonacci(10))
`)

console.log(result.stdout)  // 输出: 55
await sandbox.close()

API 文档

核心方法

// 创建沙箱
const sandbox = await Sandbox.create(options?)

// 执行代码
const result = await sandbox.runCode(code: string)

// 文件操作
await sandbox.writeFile('/path/to/file', content)
const content = await sandbox.readFile('/path/to/file')

// 管理沙箱
await sandbox.kill()        // 终止沙箱
await sandbox.close()       // 关闭连接

功能特性

  • 🔒 安全隔离: 每个代码执行都在独立的容器环境中
  • 🌐 多语言支持: Python, JavaScript, Node.js, Bash 等
  • 实时执行: 快速的代码执行和结果返回
  • 📝 TypeScript: 完整的类型定义支持
  • 🔄 跨平台: 支持浏览器和 Node.js 环境
  • 📁 文件系统: 完整的文件读写和管理功能
  • 🎯 AI 友好: 专为 AI agents 和自动化工作流设计

使用场景

  • AI 代码助手: 安全执行 AI 生成的代码
  • 在线代码编辑器: 构建 Web IDE 和代码演示
  • 自动化测试: 在隔离环境中运行测试脚本
  • 数据处理: 云端数据分析和处理管道
  • 教育平台: 安全的编程学习环境

许可证

MIT License


开始使用云端沙箱,让您的应用拥有安全的代码执行能力! 🚀