feat: add release pipeline for crates.io and npm publishing

- Add --check, --publish-crates, --publish-npm-sdk, --publish-npm-cli flags to release script
- Create CI workflow with pre-release checks (cargo fmt, clippy, test, tsc)
- Update release workflow to run checks, build binaries, and publish packages
- Add @sandbox-agent/cli npm package with platform-specific binaries (esbuild pattern)
- Configure TypeScript SDK for npm publishing (exports, files, types)
- Add crates.io metadata to Cargo.toml (repository, description)
- Rename @sandbox-agent/web to @sandbox-agent/inspector
This commit is contained in:
Nathan Flurry 2026-01-25 14:11:39 -08:00
parent 6e1b13c242
commit 016024c04b
26 changed files with 360 additions and 48 deletions

26
sdks/cli/bin/sandbox-agent Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env node
const { execFileSync } = require("child_process");
const path = require("path");
const PLATFORMS = {
"darwin-arm64": "@sandbox-agent/cli-darwin-arm64",
"darwin-x64": "@sandbox-agent/cli-darwin-x64",
"linux-x64": "@sandbox-agent/cli-linux-x64",
"win32-x64": "@sandbox-agent/cli-win32-x64",
};
const key = `${process.platform}-${process.arch}`;
const pkg = PLATFORMS[key];
if (!pkg) {
console.error(`Unsupported platform: ${key}`);
process.exit(1);
}
try {
const pkgPath = require.resolve(`${pkg}/package.json`);
const bin = process.platform === "win32" ? "sandbox-agent.exe" : "sandbox-agent";
execFileSync(path.join(path.dirname(pkgPath), "bin", bin), process.argv.slice(2), { stdio: "inherit" });
} catch (e) {
if (e.status !== undefined) process.exit(e.status);
throw e;
}

22
sdks/cli/package.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "@sandbox-agent/cli",
"version": "0.1.0",
"description": "CLI for sandbox-agent - run AI coding agents in sandboxes",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"bin": {
"sandbox-agent": "bin/sandbox-agent"
},
"optionalDependencies": {
"@sandbox-agent/cli-darwin-arm64": "0.1.0",
"@sandbox-agent/cli-darwin-x64": "0.1.0",
"@sandbox-agent/cli-linux-x64": "0.1.0",
"@sandbox-agent/cli-win32-x64": "0.1.0"
},
"files": [
"bin"
]
}

View file

@ -0,0 +1,19 @@
{
"name": "@sandbox-agent/cli-darwin-arm64",
"version": "0.1.0",
"description": "sandbox-agent CLI binary for macOS ARM64",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"files": [
"bin"
]
}

View file

@ -0,0 +1,19 @@
{
"name": "@sandbox-agent/cli-darwin-x64",
"version": "0.1.0",
"description": "sandbox-agent CLI binary for macOS x64",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"os": [
"darwin"
],
"cpu": [
"x64"
],
"files": [
"bin"
]
}

View file

@ -0,0 +1,19 @@
{
"name": "@sandbox-agent/cli-linux-x64",
"version": "0.1.0",
"description": "sandbox-agent CLI binary for Linux x64",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"os": [
"linux"
],
"cpu": [
"x64"
],
"files": [
"bin"
]
}

View file

@ -0,0 +1,19 @@
{
"name": "@sandbox-agent/cli-win32-x64",
"version": "0.1.0",
"description": "sandbox-agent CLI binary for Windows x64",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"os": [
"win32"
],
"cpu": [
"x64"
],
"files": [
"bin"
]
}

View file

@ -1,9 +1,24 @@
{
"name": "sandbox-agent",
"version": "0.1.0",
"private": true,
"description": "TypeScript SDK for sandbox-agent",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/rivet-dev/sandbox-agent"
},
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"generate:openapi": "cargo check -p sandbox-agent-openapi-gen && cargo run -p sandbox-agent-openapi-gen -- --out src/generated/openapi.json",
"generate:types": "openapi-typescript src/generated/openapi.json -o src/generated/openapi.ts",
@ -14,5 +29,8 @@
"@types/node": "^22.0.0",
"openapi-typescript": "^6.7.0",
"typescript": "^5.7.0"
},
"optionalDependencies": {
"@sandbox-agent/cli": "0.1.0"
}
}