Files
e2b-dev--e2b/package.json
T
Mish Ushakov 4fcf7cb150 feat: sync API specs from infra and belt with Copybara (#1564)
The specs in `spec/` were copied from their source repos by hand and had
drifted ~2,400 lines behind infra, so they are now imported with
Copybara (`copy.bara.sky`, run in a pinned Docker image by
`scripts/fetch-spec.sh`): `make codegen` re-fetches them at the commits
pinned in `spec/infra-ref` and `spec/belt-ref` before generating, and
the generated-files CI check fails if the tracked copies don't match the
pins. Regenerating from the current pins picks up the accumulated spec
changes in the generated JS/Python clients (renamed request schemas,
`SandboxNetworkConfig`, `SandboxIam` workload identity,
`FILE_TYPE_SYMLINK`, access-token auth deprecation, volume path-metadata
tweaks). The one handwritten SDK change follows from that: the public
`FileType` enums gain a `SYMLINK` member (JS and both Python surfaces)
so entries envd reports as symlinks show up in `files.list()` and
`getInfo()`/`get_info()` instead of being silently skipped as unknown
types. The custom `spec/remove_extra_tags.py` tag-filtering script is
replaced by Redocly CLI's `filter-in` decorator (`redocly.yaml`), which
produces identical generated JS output; a `filter-out` decorator
additionally drops any operation or component schema the upstream specs
mark `x-not-implemented: true` (currently the SOCKS5
`SandboxEgressProxyConfig`/`egressProxy` surface, which infra flagged as
spec-only); each SDK's bundle now goes to its own gitignored
`spec/openapi_generated.<api>.yml` instead of both pipelines overwriting
one shared file; Python client models now list fields in spec order
instead of alphabetical (mechanical reordering only — construct models
with keyword args). Spec fetches try whatever GitHub token is available
and fall back to the tracked copies with a warning (the public infra
specs also fetch anonymously); in CI a short-lived belt-scoped token is
minted from the org-wide Autofixer GitHub App (no new secrets), so fork
PRs simply fall back for the belt spec; the CI workflows also cache the
Copybara image alongside the codegen image, and the previously ignored
`CODEGEN_IMAGE` env is honored by the Makefile.

## Usage

```sh
# update the specs: bump a pin, then regenerate
echo <infra-commit-sha> > spec/infra-ref
make codegen

# fetch a single spec without regenerating
pnpm fetch:api-spec     # spec/openapi.yml from infra
pnpm fetch:envd-spec    # spec/envd/ from infra
pnpm fetch:volume-spec  # spec/openapi-volumecontent.yml from belt

# try the latest spec without touching the pin
E2B_INFRA_REF=main pnpm fetch:api-spec

# change which endpoint tags an SDK exposes
$EDITOR redocly.yaml && make codegen
```

```ts
// symlinks are now visible in the filesystem API (JS; same shape in Python)
const entries = await sandbox.files.list('/home/user')
const link = entries.find((e) => e.type === FileType.SYMLINK)
console.log(link?.symlinkTarget)
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 16:37:02 +02:00

56 lines
2.0 KiB
JSON

{
"name": "e2b",
"private": true,
"scripts": {
"version": "pnpm changeset version && pnpm run -r postVersion",
"publish": "pnpm changeset publish && pnpm run -r postPublish",
"test": "pnpm test --recursive --if-present",
"rm-node-modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"pnpm-install-hack": "cd packages/js-sdk && sed -i '' 's/\"version\": \".*\"/\"version\": \"9.9.9\"/g' package.json && cd ../.. && pnpm i && git checkout -- packages/js-sdk/package.json",
"fetch:api-spec": "./scripts/fetch-spec.sh api-spec",
"fetch:envd-spec": "./scripts/fetch-spec.sh envd-spec",
"fetch:volume-spec": "./scripts/fetch-spec.sh volume-api-spec",
"lint": "pnpm --if-present --recursive run lint",
"typecheck": "pnpm --if-present --recursive run typecheck",
"format": "pnpm --if-present --recursive run format",
"changeset": "pnpm dlx @changesets/cli"
},
"packageManager": "pnpm@9.15.5",
"dependencies": {
"@changesets/read": "^0.6.2"
},
"devDependencies": {
"changeset": "^0.2.6",
"oxlint": "^1.72.0"
},
"engines": {
"pnpm": ">=9.0.0 <10"
},
"pnpm": {
"overrides": {
"rollup@>=4": ">=4.59.0",
"postcss@<8.5.10": "^8.5.10",
"vite@>=6.0.0 <6.4.3": "^6.4.3",
"lodash@<4.18.0": "^4.18.0",
"brace-expansion@<1.1.13": "^1.1.13",
"brace-expansion@>=2.0.0 <2.1.2": "^2.1.2",
"brace-expansion@>=5.0.0 <5.0.6": "^5.0.6",
"underscore@<1.13.8": "^1.13.8",
"js-yaml@<3.15.0": "^3.15.0",
"js-yaml@>=4.0.0 <4.2.0": "^4.2.0",
"@babel/core@<7.29.6": "^7.29.6",
"picomatch@<2.3.2": "^2.3.2",
"picomatch@>=4.0.0 <4.0.4": "^4.0.4",
"smol-toml@<1.6.1": "^1.6.1",
"minimatch@<3.1.3": "^3.1.3",
"minimatch@>=5.0.0 <5.1.8": "^5.1.8",
"minimatch@>=9.0.0 <9.0.7": "^9.0.7",
"minimatch@>=10.0.0 <10.2.3": "^10.2.3",
"ws@>=8.0.0 <8.20.1": "^8.20.1",
"shell-quote@<1.9.0": "^1.9.0",
"sharp@<0.35.0": "^0.35.0",
"tar@<7.5.19": "^7.5.19"
}
}
}