Commit Graph

20 Commits

Author SHA1 Message Date
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
Jakub Novák 5c4d07536f Add filtering option for listing sandboxes (#532)
# Description

Allow users to filter out sandbox based on metadata

---------

Co-authored-by: Mish Ushakov <10400064+mishushakov@users.noreply.github.com>
2025-03-21 15:57:48 +01:00
Jakub Novak 4b5d17e8a4 Add missing files 2025-01-17 14:28:42 -08:00
0div d599ddac32 rebrand to SDK reference 2024-11-26 10:34:04 -08:00
Jakub Novak 3752a49586 Ignore .DS_Store files 2024-10-15 08:06:43 -07:00
0div 9b7a38ad2c git ignore apiRefRoutes.json 2024-09-26 14:23:10 +02:00
0div fa90994e49 [squashed many commits] GH actions workflow for API ref autogen 2024-09-24 18:15:31 +02:00
Jakub Novak 2dc079d48d Git ignore all .env files 2024-08-05 15:00:34 +02:00
Vasek Mlejnsky b66d190d49 Ignore .vscode 2024-04-25 16:26:04 -07:00
Jakub Novák 388309830b New infra (#212)
Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
Co-authored-by: Vasek Mlejnsky <vasek.mlejnsky@gmail.com>
2023-11-06 15:07:09 +01:00
Pavel 'Strajk' Dolecek f2e3a6fa81 feat: Docs to TypeScript (tightening) (#85) 2023-08-24 12:18:57 +02:00
Jakub Novak ae95ded016 Improve .gitignore 2023-08-21 13:22:59 +02:00
Tomas Valenta a7ebf79229 Update gitignore 2023-08-20 18:24:23 +02:00
Tomas Valenta 428f9f7cd3 Add vale.sh config 2023-08-18 13:45:18 +02:00
Tomas Valenta 55560bd096 Reorganize repo 2023-08-14 14:32:42 +02:00
Tomas Valenta 6039b3b679 Add sentry 2023-06-14 18:31:27 -07:00
SnoopyDevelops 0be6dbfb01 cross-env 2023-04-19 23:40:06 +08:00
Tomas Valenta 0b1b339d97 Allow prompt customization [WIP] 2023-04-16 23:24:41 +00:00
Vasek Mlejnsky db8c068ad3 commit 2023-03-05 20:15:15 +01:00
Vasek Mlejnsky 745d4c453c Commit 2023-03-04 14:46:01 +01:00