Skip to content

建议增加 Node.js / TypeScript SDK 支持 #1492

Description

@infore19890394-star

背景

我们正在使用 OpenSandbox/Aone Sandbox 接入基于 Node.js、TypeScript 和 pi 的 Agent Server。

目前已有 Python、Java/Kotlin、Go SDK,但暂未发现官方 Node.js/TypeScript SDK。自行封装 OpenAPI 会增加开发和维护成本。

期望能力

希望 Node.js/TypeScript SDK 支持:

  • 创建、连接、续期和销毁 Sandbox;
  • 查询状态及健康信息;
  • 执行和中断命令;
  • 文件上传、下载和读写;
  • 网络 Egress 配置;
  • Sandbox Extensions;
  • spiffe.lazyAuthattachSpiffeIdentity
  • 日志及诊断信息查询。

示例

const sandbox = await Sandbox.create({
  template: "code-interpreter",
  extensions: {
    "spiffe.lazyAuth": "true",
  },
});

await sandbox.attachSpiffeIdentity({
  rawEmpID: "123456",
  agentID: "spiffe://example/agent/123",
  agentToken: "<initial-token>",
});

const result = await sandbox.commands.run({
  command: ["echo", "hello"],
});

await sandbox.kill();

## 想确认的问题

1. 官方是否已有 Node.js/TypeScript SDK 计划?
2. 是否已有正在开发但尚未发布的实现?
3. 建议参考 Python 还是 Java/Kotlin SDK?
4. SDK 应放在当前仓库还是独立仓库?
5. 是否接受社区提交相关 PR?

如果官方接受贡献,我们愿意参与实现并提交 PR。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions